Skip to content

Commit 1c3c449

Browse files
committed
removed more unnecessary changes.
1 parent f86ad52 commit 1c3c449

File tree

2 files changed

+15
-22
lines changed

2 files changed

+15
-22
lines changed

src/client/activation/node/languageServerProxy.ts

+15-21
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,7 @@ import {
99
LanguageClientOptions,
1010
} from 'vscode-languageclient/node';
1111

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';
1913
import { IEnvironmentVariablesProvider } from '../../common/variables/types';
2014
import { PythonEnvironment } from '../../pythonEnvironments/info';
2115
import { captureTelemetry, sendTelemetryEvent } from '../../telemetry';
@@ -76,7 +70,6 @@ export class NodeLanguageServerProxy implements ILanguageServerProxy {
7670
private readonly environmentService: IEnvironmentVariablesProvider,
7771
private readonly workspace: IWorkspaceService,
7872
private readonly extensions: IExtensions,
79-
private readonly configurationService: IConfigurationService,
8073
) {
8174
// Empty
8275
}
@@ -111,22 +104,23 @@ export class NodeLanguageServerProxy implements ILanguageServerProxy {
111104
if (extension && (extension.exports as PylanceApi).startClient) {
112105
this.pylanceApi = extension.exports as PylanceApi;
113106
await this.pylanceApi.startClient!();
114-
} else {
115-
this.cancellationStrategy = new FileBasedCancellationStrategy();
116-
options.connectionOptions = { cancellationStrategy: this.cancellationStrategy };
107+
return;
108+
}
117109

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 };
120112

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);
126115

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;
130124
}
131125

132126
@traceDecoratorVerbose('Disposing language server')

src/client/languageServer/pylanceLSExtensionManager.ts

-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ export class PylanceLSExtensionManager implements IDisposable, ILanguageServerEx
6565
environmentService,
6666
workspaceService,
6767
extensions,
68-
configurationService,
6968
);
7069
this.serverManager = new NodeLanguageServerManager(
7170
serviceContainer,

0 commit comments

Comments
 (0)