File tree Expand file tree Collapse file tree 3 files changed +17
-1
lines changed Expand file tree Collapse file tree 3 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ export class ExtensionInfo {
3737 readonly appName : string ;
3838 /** True if the extension runs in preview mode (e.g. Nightly, prerelease) */
3939 readonly isPreview : boolean ;
40- /** True if the extension runs in well-kwnon cloud IDEs */
40+ /** True if the extension runs in well-known cloud IDEs */
4141 readonly isInCloudIDE : boolean ;
4242
4343 constructor ( ) {
Original file line number Diff line number Diff line change @@ -10,7 +10,20 @@ export interface CommandInvocation {
1010 binPath : string ;
1111}
1212
13+ /**
14+ * The API we expose to other extensions.
15+ *
16+ * @example
17+ * const Go = await vscode.extensions
18+ * .getExtension<ExtensionAPI>('golang.go')
19+ * .then(x => x.activate());
20+ *
21+ * console.log(`Go extension is a ${Go.isPreview ? 'preview' : 'release'} version`);
22+ */
1323export interface ExtensionAPI {
24+ /** True if the extension is running in preview mode (e.g. prerelease) */
25+ isPreview : boolean ;
26+
1427 settings : {
1528 /**
1629 * Returns the execution command corresponding to the specified resource, taking into account
Original file line number Diff line number Diff line change 66import { Uri } from 'vscode' ;
77import { CommandInvocation , ExtensionAPI } from './export' ;
88import { getBinPathWithExplanation } from './util' ;
9+ import { extensionInfo } from './config' ;
910
1011const api : ExtensionAPI = {
12+ isPreview : extensionInfo . isPreview ,
13+
1114 settings : {
1215 getExecutionCommand ( toolName : string , resource ?: Uri ) : CommandInvocation | undefined {
1316 const { binPath } = getBinPathWithExplanation ( toolName , true , resource ) ;
You can’t perform that action at this time.
0 commit comments