Skip to content

Commit 00717e8

Browse files
committed
removed unused code
1 parent ab2dcf2 commit 00717e8

File tree

1 file changed

+5
-61
lines changed

1 file changed

+5
-61
lines changed
Lines changed: 5 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT License.
33
import { inject, injectable } from 'inversify';
4-
import { Disposable, extensions } from 'vscode';
5-
import { IConfigurationService, IDisposableRegistry } from '../../common/types';
6-
import { sendTelemetryEvent } from '../../telemetry';
7-
import { EventName } from '../../telemetry/constants';
8-
import { JUPYTER_EXTENSION_ID, PYLANCE_EXTENSION_ID } from '../../common/constants';
9-
import { IExtensionSingleActivationService, LanguageServerType } from '../types';
10-
import { traceLog, traceVerbose } from '../../logging';
4+
import { IExtensionSingleActivationService } from '../types';
5+
import { traceVerbose } from '../../logging';
116
import { IJupyterExtensionDependencyManager } from '../../common/application/types';
127
import { IServiceContainer } from '../../ioc/types';
138
import { sleep } from '../../common/utils/async';
@@ -17,28 +12,18 @@ import { JupyterExtensionIntegration } from '../../jupyter/jupyterIntegration';
1712
export class LspNotebooksExperiment implements IExtensionSingleActivationService {
1813
public readonly supportedWorkspaceTypes = { untrustedWorkspace: true, virtualWorkspace: true };
1914

20-
private pylanceExtensionChangeHandler: Disposable | undefined;
21-
2215
private isJupyterInstalled = false;
2316

24-
private isUsingPylance: boolean | undefined;
25-
2617
constructor(
2718
@inject(IServiceContainer) private readonly serviceContainer: IServiceContainer,
28-
@inject(IConfigurationService) private readonly configurationService: IConfigurationService,
29-
@inject(IDisposableRegistry) private readonly disposables: IDisposableRegistry,
3019
@inject(IJupyterExtensionDependencyManager) jupyterDependencyManager: IJupyterExtensionDependencyManager,
3120
) {
3221
this.isJupyterInstalled = jupyterDependencyManager.isJupyterExtensionInstalled;
3322
}
3423

35-
public async activate(): Promise<void> {
36-
if (!LspNotebooksExperiment.isPylanceInstalled()) {
37-
this.pylanceExtensionChangeHandler = extensions.onDidChange(this.pylanceExtensionsChangeHandler.bind(this));
38-
this.disposables.push(this.pylanceExtensionChangeHandler);
39-
}
40-
41-
this.updateExperimentSupport();
24+
// eslint-disable-next-line class-methods-use-this
25+
public activate(): Promise<void> {
26+
return Promise.resolve();
4227
}
4328

4429
public async onJupyterInstalled(): Promise<void> {
@@ -47,34 +32,10 @@ export class LspNotebooksExperiment implements IExtensionSingleActivationService
4732
}
4833

4934
await this.waitForJupyterToRegisterPythonPathFunction();
50-
this.updateExperimentSupport();
5135

5236
this.isJupyterInstalled = true;
5337
}
5438

55-
private updateExperimentSupport(): void {
56-
const languageServerType = this.configurationService.getSettings().languageServer;
57-
58-
this.isUsingPylance = false;
59-
if (languageServerType !== LanguageServerType.Node) {
60-
traceLog(`LSP Notebooks is disabled -- not using Pylance`);
61-
} else if (!LspNotebooksExperiment.isJupyterInstalled()) {
62-
traceLog(`LSP Notebooks is disabled -- Jupyter disabled or not installed`);
63-
} else if (!LspNotebooksExperiment.isPylanceInstalled()) {
64-
traceLog(`LSP Notebooks is disabled -- Pylance disabled or not installed`);
65-
} else {
66-
this.isUsingPylance = true;
67-
traceLog(`LSP Notebooks is enabled`);
68-
sendTelemetryEvent(EventName.PYTHON_EXPERIMENTS_LSP_NOTEBOOKS);
69-
}
70-
71-
if (!this.isUsingPylance) {
72-
traceLog(`LSP Notebooks interactive window support is disabled -- not using Pylance`);
73-
} else {
74-
traceLog(`LSP Notebooks interactive window support is enabled`);
75-
}
76-
}
77-
7839
private async waitForJupyterToRegisterPythonPathFunction(): Promise<void> {
7940
const jupyterExtensionIntegration = this.serviceContainer.get<JupyterExtensionIntegration>(
8041
JupyterExtensionIntegration,
@@ -96,21 +57,4 @@ export class LspNotebooksExperiment implements IExtensionSingleActivationService
9657
traceVerbose(`Timed out waiting for Jupyter to call registerJupyterPythonPathFunction`);
9758
}
9859
}
99-
100-
private static isPylanceInstalled(): boolean {
101-
return !!extensions.getExtension(PYLANCE_EXTENSION_ID);
102-
}
103-
104-
private static isJupyterInstalled(): boolean {
105-
return !!extensions.getExtension(JUPYTER_EXTENSION_ID);
106-
}
107-
108-
private async pylanceExtensionsChangeHandler(): Promise<void> {
109-
if (LspNotebooksExperiment.isPylanceInstalled() && this.pylanceExtensionChangeHandler) {
110-
this.pylanceExtensionChangeHandler.dispose();
111-
this.pylanceExtensionChangeHandler = undefined;
112-
113-
this.updateExperimentSupport();
114-
}
115-
}
11660
}

0 commit comments

Comments
 (0)