File tree 3 files changed +17
-1
lines changed
3 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ export class ExtensionInfo {
37
37
readonly appName : string ;
38
38
/** True if the extension runs in preview mode (e.g. Nightly, prerelease) */
39
39
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 */
41
41
readonly isInCloudIDE : boolean ;
42
42
43
43
constructor ( ) {
Original file line number Diff line number Diff line change @@ -10,7 +10,20 @@ export interface CommandInvocation {
10
10
binPath : string ;
11
11
}
12
12
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
+ */
13
23
export interface ExtensionAPI {
24
+ /** True if the extension is running in preview mode (e.g. prerelease) */
25
+ isPreview : boolean ;
26
+
14
27
settings : {
15
28
/**
16
29
* Returns the execution command corresponding to the specified resource, taking into account
Original file line number Diff line number Diff line change 6
6
import { Uri } from 'vscode' ;
7
7
import { CommandInvocation , ExtensionAPI } from './export' ;
8
8
import { getBinPathWithExplanation } from './util' ;
9
+ import { extensionInfo } from './config' ;
9
10
10
11
const api : ExtensionAPI = {
12
+ isPreview : extensionInfo . isPreview ,
13
+
11
14
settings : {
12
15
getExecutionCommand ( toolName : string , resource ?: Uri ) : CommandInvocation | undefined {
13
16
const { binPath } = getBinPathWithExplanation ( toolName , true , resource ) ;
You can’t perform that action at this time.
0 commit comments