@@ -50,6 +50,7 @@ const AI_KEY: string = "AIF-d9b70cd4-b9f9-4d70-929b-a071c400b217";
50
50
let logger : Logger ;
51
51
let sessionManager : SessionManager ;
52
52
let extensionFeatures : IFeature [ ] = [ ] ;
53
+ let commandRegistrations : vscode . Disposable [ ] = [ ] ;
53
54
let telemetryReporter : TelemetryReporter ;
54
55
55
56
const documentSelector : DocumentSelector = [
@@ -139,26 +140,30 @@ export function activate(context: vscode.ExtensionContext): void {
139
140
PackageJSON . version ,
140
141
telemetryReporter ) ;
141
142
142
- // Create features
143
- extensionFeatures = [
144
- new ConsoleFeature ( logger ) ,
143
+ // Register commands that do not require Language client
144
+ commandRegistrations = [
145
145
new ExamplesFeature ( ) ,
146
- new OpenInISEFeature ( ) ,
147
146
new GenerateBugReportFeature ( sessionManager ) ,
147
+ new ISECompatibilityFeature ( ) ,
148
+ new OpenInISEFeature ( ) ,
149
+ new PesterTestsFeature ( sessionManager ) ,
150
+ new RunCodeFeature ( sessionManager ) ,
151
+ new CodeActionsFeature ( logger ) ,
152
+ new SpecifyScriptArgsFeature ( context ) ,
153
+ ]
154
+
155
+ // Create features that require language client
156
+ extensionFeatures = [
157
+ new ConsoleFeature ( logger ) ,
148
158
new ExpandAliasFeature ( logger ) ,
149
159
new GetCommandsFeature ( logger ) ,
150
- new ISECompatibilityFeature ( ) ,
151
160
new ShowHelpFeature ( logger ) ,
152
161
new FindModuleFeature ( ) ,
153
- new PesterTestsFeature ( sessionManager ) ,
154
- new RunCodeFeature ( sessionManager ) ,
155
162
new ExtensionCommandsFeature ( logger ) ,
156
- new CodeActionsFeature ( logger ) ,
157
163
new NewFileOrProjectFeature ( ) ,
158
164
new RemoteFilesFeature ( ) ,
159
165
new DebugSessionFeature ( context , sessionManager , logger ) ,
160
166
new PickPSHostProcessFeature ( ) ,
161
- new SpecifyScriptArgsFeature ( context ) ,
162
167
new HelpCompletionFeature ( logger ) ,
163
168
new CustomViewsFeature ( ) ,
164
169
new PickRunspaceFeature ( ) ,
@@ -206,6 +211,10 @@ export function deactivate(): void {
206
211
feature . dispose ( ) ;
207
212
} ) ;
208
213
214
+ commandRegistrations . forEach ( ( commandRegistration ) => {
215
+ commandRegistration . dispose ( ) ;
216
+ } ) ;
217
+
209
218
// Dispose of the current session
210
219
sessionManager . dispose ( ) ;
211
220
0 commit comments