Skip to content

Commit 66e4b71

Browse files
ChinazoOnwukaikeeleanorjboyd
authored andcommitted
Remove code lenses for "set as interpreter" (microsoft#19853)
Closes microsoft#3854 Removed shebangCodeLensProvider and IShebangCodeLensProvider as well as their references and instances. Also removed the setShebangInterpreter.
1 parent 66cbd91 commit 66e4b71

File tree

8 files changed

+3
-413
lines changed

8 files changed

+3
-413
lines changed

.eslintignore

-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@ src/client/interpreter/configuration/services/workspaceFolderUpdaterService.ts
158158
src/client/interpreter/helpers.ts
159159
src/client/interpreter/virtualEnvs/condaInheritEnvPrompt.ts
160160
src/client/interpreter/activation/service.ts
161-
src/client/interpreter/display/shebangCodeLensProvider.ts
162161
src/client/interpreter/display/index.ts
163162

164163
src/client/api.ts

build/existingFiles.json

-1
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@
170170
"src/client/interpreter/configuration/types.ts",
171171
"src/client/interpreter/contracts.ts",
172172
"src/client/interpreter/display/index.ts",
173-
"src/client/interpreter/display/shebangCodeLensProvider.ts",
174173
"src/client/interpreter/helpers.ts",
175174
"src/client/interpreter/interpreterService.ts",
176175
"src/client/interpreter/interpreterVersion.ts",

src/client/interpreter/configuration/interpreterSelector/commands/setShebangInterpreter.ts

-75
This file was deleted.

src/client/interpreter/contracts.ts

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { SemVer } from 'semver';
2-
import { CodeLensProvider, ConfigurationTarget, Disposable, Event, TextDocument, Uri } from 'vscode';
2+
import { ConfigurationTarget, Disposable, Event, Uri } from 'vscode';
33
import { FileChangeType } from '../common/platform/fileSystemWatcher';
44
import { Resource } from '../common/types';
55
import { PythonEnvSource } from '../pythonEnvironments/base/info';
@@ -100,11 +100,6 @@ export interface IInterpreterDisplay {
100100
registerVisibilityFilter(filter: IInterpreterStatusbarVisibilityFilter): void;
101101
}
102102

103-
export const IShebangCodeLensProvider = Symbol('IShebangCodeLensProvider');
104-
export interface IShebangCodeLensProvider extends CodeLensProvider {
105-
detectShebang(document: TextDocument, resolveShebangAsInterpreter?: boolean): Promise<string | undefined>;
106-
}
107-
108103
export const IInterpreterHelper = Symbol('IInterpreterHelper');
109104
export interface IInterpreterHelper {
110105
getActiveWorkspaceUri(resource: Resource): WorkspacePythonPath | undefined;

src/client/interpreter/display/shebangCodeLensProvider.ts

-84
This file was deleted.

src/client/interpreter/serviceRegistry.ts

+1-8
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import { InstallPythonCommand } from './configuration/interpreterSelector/comman
1515
import { InstallPythonViaTerminal } from './configuration/interpreterSelector/commands/installPython/installPythonViaTerminal';
1616
import { ResetInterpreterCommand } from './configuration/interpreterSelector/commands/resetInterpreter';
1717
import { SetInterpreterCommand } from './configuration/interpreterSelector/commands/setInterpreter';
18-
import { SetShebangInterpreterCommand } from './configuration/interpreterSelector/commands/setShebangInterpreter';
1918
import { InterpreterSelector } from './configuration/interpreterSelector/interpreterSelector';
2019
import { PythonPathUpdaterService } from './configuration/pythonPathUpdaterService';
2120
import { PythonPathUpdaterServiceFactory } from './configuration/pythonPathUpdaterServiceFactory';
@@ -26,10 +25,9 @@ import {
2625
IPythonPathUpdaterServiceFactory,
2726
IPythonPathUpdaterServiceManager,
2827
} from './configuration/types';
29-
import { IInterpreterDisplay, IInterpreterHelper, IInterpreterService, IShebangCodeLensProvider } from './contracts';
28+
import { IInterpreterDisplay, IInterpreterHelper, IInterpreterService } from './contracts';
3029
import { InterpreterDisplay } from './display';
3130
import { InterpreterLocatorProgressStatubarHandler } from './display/progressDisplay';
32-
import { ShebangCodeLensProvider } from './display/shebangCodeLensProvider';
3331
import { InterpreterHelper } from './helpers';
3432
import { InterpreterService } from './interpreterService';
3533
import { CondaInheritEnvPrompt } from './virtualEnvs/condaInheritEnvPrompt';
@@ -59,10 +57,6 @@ export function registerInterpreterTypes(serviceManager: IServiceManager): void
5957
IExtensionSingleActivationService,
6058
ResetInterpreterCommand,
6159
);
62-
serviceManager.addSingleton<IExtensionSingleActivationService>(
63-
IExtensionSingleActivationService,
64-
SetShebangInterpreterCommand,
65-
);
6660
serviceManager.addSingleton(IInterpreterQuickPick, SetInterpreterCommand);
6761

6862
serviceManager.addSingleton<IExtensionActivationService>(IExtensionActivationService, VirtualEnvironmentPrompt);
@@ -81,7 +75,6 @@ export function registerInterpreterTypes(serviceManager: IServiceManager): void
8175
);
8276

8377
serviceManager.addSingleton<IInterpreterSelector>(IInterpreterSelector, InterpreterSelector);
84-
serviceManager.addSingleton<IShebangCodeLensProvider>(IShebangCodeLensProvider, ShebangCodeLensProvider);
8578
serviceManager.addSingleton<IInterpreterHelper>(IInterpreterHelper, InterpreterHelper);
8679

8780
serviceManager.addSingleton<IInterpreterComparer>(IInterpreterComparer, EnvironmentTypeComparer);

src/test/interpreters/serviceRegistry.unit.test.ts

+1-10
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import { InstallPythonCommand } from '../../client/interpreter/configuration/int
1818
import { InstallPythonViaTerminal } from '../../client/interpreter/configuration/interpreterSelector/commands/installPython/installPythonViaTerminal';
1919
import { ResetInterpreterCommand } from '../../client/interpreter/configuration/interpreterSelector/commands/resetInterpreter';
2020
import { SetInterpreterCommand } from '../../client/interpreter/configuration/interpreterSelector/commands/setInterpreter';
21-
import { SetShebangInterpreterCommand } from '../../client/interpreter/configuration/interpreterSelector/commands/setShebangInterpreter';
2221
import { InterpreterSelector } from '../../client/interpreter/configuration/interpreterSelector/interpreterSelector';
2322
import { PythonPathUpdaterService } from '../../client/interpreter/configuration/pythonPathUpdaterService';
2423
import { PythonPathUpdaterServiceFactory } from '../../client/interpreter/configuration/pythonPathUpdaterServiceFactory';
@@ -29,15 +28,9 @@ import {
2928
IPythonPathUpdaterServiceFactory,
3029
IPythonPathUpdaterServiceManager,
3130
} from '../../client/interpreter/configuration/types';
32-
import {
33-
IInterpreterDisplay,
34-
IInterpreterHelper,
35-
IInterpreterService,
36-
IShebangCodeLensProvider,
37-
} from '../../client/interpreter/contracts';
31+
import { IInterpreterDisplay, IInterpreterHelper, IInterpreterService } from '../../client/interpreter/contracts';
3832
import { InterpreterDisplay } from '../../client/interpreter/display';
3933
import { InterpreterLocatorProgressStatubarHandler } from '../../client/interpreter/display/progressDisplay';
40-
import { ShebangCodeLensProvider } from '../../client/interpreter/display/shebangCodeLensProvider';
4134
import { InterpreterHelper } from '../../client/interpreter/helpers';
4235
import { InterpreterService } from '../../client/interpreter/interpreterService';
4336
import { registerTypes } from '../../client/interpreter/serviceRegistry';
@@ -56,7 +49,6 @@ suite('Interpreters - Service Registry', () => {
5649
[IExtensionSingleActivationService, SetInterpreterCommand],
5750
[IInterpreterQuickPick, SetInterpreterCommand],
5851
[IExtensionSingleActivationService, ResetInterpreterCommand],
59-
[IExtensionSingleActivationService, SetShebangInterpreterCommand],
6052

6153
[IExtensionActivationService, VirtualEnvironmentPrompt],
6254

@@ -66,7 +58,6 @@ suite('Interpreters - Service Registry', () => {
6658
[IPythonPathUpdaterServiceFactory, PythonPathUpdaterServiceFactory],
6759
[IPythonPathUpdaterServiceManager, PythonPathUpdaterService],
6860
[IInterpreterSelector, InterpreterSelector],
69-
[IShebangCodeLensProvider, ShebangCodeLensProvider],
7061
[IInterpreterHelper, InterpreterHelper],
7162
[IInterpreterComparer, EnvironmentTypeComparer],
7263

0 commit comments

Comments
 (0)