@@ -9,13 +9,7 @@ import {
9
9
LanguageClientOptions ,
10
10
} from 'vscode-languageclient/node' ;
11
11
12
- import {
13
- IConfigurationService ,
14
- IExperimentService ,
15
- IExtensions ,
16
- IInterpreterPathService ,
17
- Resource ,
18
- } from '../../common/types' ;
12
+ import { IExperimentService , IExtensions , IInterpreterPathService , Resource } from '../../common/types' ;
19
13
import { IEnvironmentVariablesProvider } from '../../common/variables/types' ;
20
14
import { PythonEnvironment } from '../../pythonEnvironments/info' ;
21
15
import { captureTelemetry , sendTelemetryEvent } from '../../telemetry' ;
@@ -76,7 +70,6 @@ export class NodeLanguageServerProxy implements ILanguageServerProxy {
76
70
private readonly environmentService : IEnvironmentVariablesProvider ,
77
71
private readonly workspace : IWorkspaceService ,
78
72
private readonly extensions : IExtensions ,
79
- private readonly configurationService : IConfigurationService ,
80
73
) {
81
74
// Empty
82
75
}
@@ -111,22 +104,23 @@ export class NodeLanguageServerProxy implements ILanguageServerProxy {
111
104
if ( extension && ( extension . exports as PylanceApi ) . startClient ) {
112
105
this . pylanceApi = extension . exports as PylanceApi ;
113
106
await this . pylanceApi . startClient ! ( ) ;
114
- } else {
115
- this . cancellationStrategy = new FileBasedCancellationStrategy ( ) ;
116
- options . connectionOptions = { cancellationStrategy : this . cancellationStrategy } ;
107
+ return ;
108
+ }
117
109
118
- const client = await this . factory . createLanguageClient ( resource , interpreter , options ) ;
119
- this . registerHandlers ( client , resource ) ;
110
+ this . cancellationStrategy = new FileBasedCancellationStrategy ( ) ;
111
+ options . connectionOptions = { cancellationStrategy : this . cancellationStrategy } ;
120
112
121
- this . disposables . push (
122
- this . workspace . onDidGrantWorkspaceTrust ( ( ) => {
123
- client . sendNotification ( 'python/workspaceTrusted' , { isTrusted : true } ) ;
124
- } ) ,
125
- ) ;
113
+ const client = await this . factory . createLanguageClient ( resource , interpreter , options ) ;
114
+ this . registerHandlers ( client , resource ) ;
126
115
127
- await client . start ( ) ;
128
- this . languageClient = client ;
129
- }
116
+ this . disposables . push (
117
+ this . workspace . onDidGrantWorkspaceTrust ( ( ) => {
118
+ client . sendNotification ( 'python/workspaceTrusted' , { isTrusted : true } ) ;
119
+ } ) ,
120
+ ) ;
121
+
122
+ await client . start ( ) ;
123
+ this . languageClient = client ;
130
124
}
131
125
132
126
@traceDecoratorVerbose ( 'Disposing language server' )
0 commit comments