File tree Expand file tree Collapse file tree 6 files changed +32
-28
lines changed Expand file tree Collapse file tree 6 files changed +32
-28
lines changed Original file line number Diff line number Diff line change 19
19
"publisher" : " ms-python" ,
20
20
"enabledApiProposals" : [
21
21
" quickPickSortByLabel" ,
22
+ " envShellEvent" ,
22
23
" testObserver"
23
24
],
24
25
"author" : {
Original file line number Diff line number Diff line change @@ -70,19 +70,15 @@ export class ApplicationEnvironment implements IApplicationEnvironment {
70
70
public get extensionName ( ) : string {
71
71
return this . packageJson . displayName ;
72
72
}
73
- /**
74
- * At the time of writing this API, the vscode.env.shell isn't officially released in stable version of VS Code.
75
- * Using this in stable version seems to throw errors in VSC with messages being displayed to the user about use of
76
- * unstable API.
77
- * Solution - log and suppress the errors.
78
- * @readonly
79
- * @type {(string) }
80
- * @memberof ApplicationEnvironment
81
- */
73
+
82
74
public get shell ( ) : string {
83
75
return vscode . env . shell ;
84
76
}
85
77
78
+ public get onDidChangeShell ( ) : vscode . Event < string > {
79
+ return vscode . env . onDidChangeShell ;
80
+ }
81
+
86
82
public get packageJson ( ) : any {
87
83
return require ( '../../../../package.json' ) ;
88
84
}
Original file line number Diff line number Diff line change @@ -1048,6 +1048,10 @@ export interface IApplicationEnvironment {
1048
1048
* @memberof IApplicationShell
1049
1049
*/
1050
1050
readonly shell : string ;
1051
+ /**
1052
+ * An {@link Event} which fires when the default shell changes.
1053
+ */
1054
+ readonly onDidChangeShell : Event < string > ;
1051
1055
/**
1052
1056
* Gets the vscode channel (whether 'insiders' or 'stable').
1053
1057
*/
Original file line number Diff line number Diff line change @@ -163,6 +163,11 @@ export class EnvironmentActivationService
163
163
this ,
164
164
this . disposables ,
165
165
) ;
166
+ this . applicationEnvironment . onDidChangeShell (
167
+ ( ) => this . applyCollectionForSelectedShell ( ) ,
168
+ this ,
169
+ this . disposables ,
170
+ ) ;
166
171
167
172
this . initializeCollection ( undefined ) . ignoreErrors ( ) ;
168
173
}
@@ -248,7 +253,7 @@ export class EnvironmentActivationService
248
253
args [ i ] = arg . toCommandArgumentForPythonExt ( ) ;
249
254
} ) ;
250
255
if ( interpreter ?. envType === EnvironmentType . Conda ) {
251
- const conda = await Conda . getConda ( ) ;
256
+ const conda = await Conda . getConda ( shell ) ;
252
257
const pythonArgv = await conda ?. getRunPythonArgs ( {
253
258
name : interpreter . envName ,
254
259
prefix : interpreter . envPath ?? '' ,
Original file line number Diff line number Diff line change
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License. See License.txt in the project root for license information.
4
+ *--------------------------------------------------------------------------------------------*/
5
+
6
+ declare module 'vscode' {
7
+
8
+ // See https://github.com/microsoft/vscode/issues/160694
9
+ export namespace env {
10
+
11
+ /**
12
+ * An {@link Event} which fires when the default shell changes.
13
+ */
14
+ export const onDidChangeShell : Event < string > ;
15
+ }
16
+ }
Original file line number Diff line number Diff line change @@ -68,24 +68,6 @@ declare module 'vscode' {
68
68
readonly removed : ReadonlyArray < TestItem > ;
69
69
}
70
70
71
- /**
72
- * A test item is an item shown in the "test explorer" view. It encompasses
73
- * both a suite and a test, since they have almost or identical capabilities.
74
- */
75
- export interface TestItem {
76
- /**
77
- * Marks the test as outdated. This can happen as a result of file changes,
78
- * for example. In "auto run" mode, tests that are outdated will be
79
- * automatically rerun after a short delay. Invoking this on a
80
- * test with children will mark the entire subtree as outdated.
81
- *
82
- * Extensions should generally not override this method.
83
- */
84
- // todo@api still unsure about this
85
- invalidateResults ( ) : void ;
86
- }
87
-
88
-
89
71
/**
90
72
* TestResults can be provided to the editor in {@link tests.publishTestResult},
91
73
* or read from it in {@link tests.testResults}.
You can’t perform that action at this time.
0 commit comments