Skip to content

Commit

Permalink
removed more unnecessary changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
heejaechang committed Oct 3, 2022
1 parent 356aeea commit cf5deec
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 22 deletions.
36 changes: 15 additions & 21 deletions src/client/activation/node/languageServerProxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,7 @@ import {
LanguageClientOptions,
} from 'vscode-languageclient/node';

import {
IConfigurationService,
IExperimentService,
IExtensions,
IInterpreterPathService,
Resource,
} from '../../common/types';
import { IExperimentService, IExtensions, IInterpreterPathService, Resource } from '../../common/types';
import { IEnvironmentVariablesProvider } from '../../common/variables/types';
import { PythonEnvironment } from '../../pythonEnvironments/info';
import { captureTelemetry, sendTelemetryEvent } from '../../telemetry';
Expand Down Expand Up @@ -76,7 +70,6 @@ export class NodeLanguageServerProxy implements ILanguageServerProxy {
private readonly environmentService: IEnvironmentVariablesProvider,
private readonly workspace: IWorkspaceService,
private readonly extensions: IExtensions,
private readonly configurationService: IConfigurationService,
) {
// Empty
}
Expand Down Expand Up @@ -111,22 +104,23 @@ export class NodeLanguageServerProxy implements ILanguageServerProxy {
if (extension && (extension.exports as PylanceApi).startClient) {
this.pylanceApi = extension.exports as PylanceApi;
await this.pylanceApi.startClient!();
} else {
this.cancellationStrategy = new FileBasedCancellationStrategy();
options.connectionOptions = { cancellationStrategy: this.cancellationStrategy };
return;
}

const client = await this.factory.createLanguageClient(resource, interpreter, options);
this.registerHandlers(client, resource);
this.cancellationStrategy = new FileBasedCancellationStrategy();
options.connectionOptions = { cancellationStrategy: this.cancellationStrategy };

this.disposables.push(
this.workspace.onDidGrantWorkspaceTrust(() => {
client.sendNotification('python/workspaceTrusted', { isTrusted: true });
}),
);
const client = await this.factory.createLanguageClient(resource, interpreter, options);
this.registerHandlers(client, resource);

await client.start();
this.languageClient = client;
}
this.disposables.push(
this.workspace.onDidGrantWorkspaceTrust(() => {
client.sendNotification('python/workspaceTrusted', { isTrusted: true });
}),
);

await client.start();
this.languageClient = client;
}

@traceDecoratorVerbose('Disposing language server')
Expand Down
1 change: 0 additions & 1 deletion src/client/languageServer/pylanceLSExtensionManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ export class PylanceLSExtensionManager implements IDisposable, ILanguageServerEx
environmentService,
workspaceService,
extensions,
configurationService,
);
this.serverManager = new NodeLanguageServerManager(
serviceContainer,
Expand Down

0 comments on commit cf5deec

Please sign in to comment.