Skip to content

Commit 4644d80

Browse files
committed
Remove ctags (#16066)
1 parent 01ccb26 commit 4644d80

File tree

38 files changed

+5
-2272
lines changed

38 files changed

+5
-2272
lines changed

package.json

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1875,47 +1875,6 @@
18751875
"description": "Path to folder with a list of Virtual Environments (e.g. ~/.pyenv, ~/Envs, ~/.virtualenvs).",
18761876
"scope": "machine"
18771877
},
1878-
"python.workspaceSymbols.ctagsPath": {
1879-
"type": "string",
1880-
"default": "ctags",
1881-
"description": "Fully qualified path to the ctags executable (else leave as ctags, assuming it is in current path).",
1882-
"scope": "resource"
1883-
},
1884-
"python.workspaceSymbols.enabled": {
1885-
"type": "boolean",
1886-
"default": false,
1887-
"description": "Set to 'true' to enable ctags to provide Workspace Symbols.",
1888-
"scope": "resource"
1889-
},
1890-
"python.workspaceSymbols.exclusionPatterns": {
1891-
"type": "array",
1892-
"default": [
1893-
"**/site-packages/**"
1894-
],
1895-
"items": {
1896-
"type": "string"
1897-
},
1898-
"description": "Pattern used to exclude files and folders from ctags See http://ctags.sourceforge.net/ctags.html.",
1899-
"scope": "resource"
1900-
},
1901-
"python.workspaceSymbols.rebuildOnFileSave": {
1902-
"type": "boolean",
1903-
"default": true,
1904-
"description": "Whether to re-build the tags file on when changes made to python files are saved.",
1905-
"scope": "resource"
1906-
},
1907-
"python.workspaceSymbols.rebuildOnStart": {
1908-
"type": "boolean",
1909-
"default": true,
1910-
"description": "Whether to re-build the tags file on start (defaults to true).",
1911-
"scope": "resource"
1912-
},
1913-
"python.workspaceSymbols.tagFilePath": {
1914-
"type": "string",
1915-
"default": "${workspaceFolder}/.vscode/tags",
1916-
"description": "Fully qualified path to tag file (exuberant ctag file), used to provide workspace symbols.",
1917-
"scope": "resource"
1918-
},
19191878
"python.insidersChannel": {
19201879
"type": "string",
19211880
"default": "off",

src/client/activation/jedi.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,10 @@ import { PythonSignatureProvider } from '../providers/signatureProvider';
4141
import { JediSymbolProvider } from '../providers/symbolProvider';
4242
import { PythonEnvironment } from '../pythonEnvironments/info';
4343
import { ITestingService } from '../testing/types';
44-
import { WorkspaceSymbols } from '../workspaceSymbols/main';
4544
import { ILanguageServerActivator } from './types';
4645

4746
@injectable()
4847
export class JediExtensionActivator implements ILanguageServerActivator {
49-
private static workspaceSymbols: WorkspaceSymbols | undefined;
5048
private readonly context: IExtensionContext;
5149
private jediFactory?: JediFactory;
5250
private readonly documentSelector: DocumentFilter[];
@@ -85,12 +83,6 @@ export class JediExtensionActivator implements ILanguageServerActivator {
8583
this.symbolProvider = new JediSymbolProvider(serviceContainer, jediFactory);
8684
this.signatureProvider = new PythonSignatureProvider(jediFactory);
8785

88-
if (!JediExtensionActivator.workspaceSymbols) {
89-
// Workspace symbols is static because it doesn't rely on the jediFactory.
90-
JediExtensionActivator.workspaceSymbols = new WorkspaceSymbols(serviceContainer);
91-
context.subscriptions.push(JediExtensionActivator.workspaceSymbols);
92-
}
93-
9486
const testManagementService = this.serviceManager.get<ITestingService>(ITestingService);
9587
testManagementService
9688
.activate(this.symbolProvider)

src/client/common/configSettings.ts

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ import {
4141
ISortImportSettings,
4242
ITensorBoardSettings,
4343
ITerminalSettings,
44-
IWorkspaceSymbolSettings,
4544
LoggingLevelSettingType,
4645
Resource,
4746
} from './types';
@@ -128,8 +127,6 @@ export class PythonSettings implements IPythonSettings {
128127

129128
public sortImports!: ISortImportSettings;
130129

131-
public workspaceSymbols!: IWorkspaceSymbolSettings;
132-
133130
public disableInstallationChecks = false;
134131

135132
public globalModuleInstallation = false;
@@ -479,33 +476,6 @@ export class PythonSettings implements IPythonSettings {
479476
typeshedPaths: [],
480477
};
481478

482-
const workspaceSymbolsSettings = systemVariables.resolveAny(
483-
pythonSettings.get<IWorkspaceSymbolSettings>('workspaceSymbols'),
484-
)!;
485-
if (this.workspaceSymbols) {
486-
Object.assign<IWorkspaceSymbolSettings, IWorkspaceSymbolSettings>(
487-
this.workspaceSymbols,
488-
workspaceSymbolsSettings,
489-
);
490-
} else {
491-
this.workspaceSymbols = workspaceSymbolsSettings;
492-
}
493-
// Support for travis.
494-
this.workspaceSymbols = this.workspaceSymbols
495-
? this.workspaceSymbols
496-
: {
497-
ctagsPath: 'ctags',
498-
enabled: true,
499-
exclusionPatterns: [],
500-
rebuildOnFileSave: true,
501-
rebuildOnStart: true,
502-
tagFilePath: workspaceRoot ? path.join(workspaceRoot, 'tags') : '',
503-
};
504-
this.workspaceSymbols.tagFilePath = getAbsolutePath(
505-
systemVariables.resolveAny(this.workspaceSymbols.tagFilePath),
506-
workspaceRoot,
507-
);
508-
509479
const testSettings = systemVariables.resolveAny(pythonSettings.get<ITestingSettings>('testing'))!;
510480
if (this.testing) {
511481
Object.assign<ITestingSettings, ITestingSettings>(this.testing, testSettings);

src/client/common/installer/productInstaller.ts

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/* eslint-disable max-classes-per-file */
22

33
import { inject, injectable, named } from 'inversify';
4-
import * as os from 'os';
54
import * as semver from 'semver';
65
import { CancellationToken, OutputChannel, Uri } from 'vscode';
76
import '../extensions';
@@ -14,9 +13,7 @@ import { EventName } from '../../telemetry/constants';
1413
import { IApplicationShell, ICommandManager, IWorkspaceService } from '../application/types';
1514
import { Commands, STANDARD_OUTPUT_CHANNEL } from '../constants';
1615
import { traceError, traceInfo } from '../logger';
17-
import { IPlatformService } from '../platform/types';
1816
import { IProcessServiceFactory, IPythonExecutionFactory } from '../process/types';
19-
import { ITerminalServiceFactory } from '../terminal/types';
2017
import {
2118
IConfigurationService,
2219
IInstaller,
@@ -43,9 +40,6 @@ import {
4340

4441
export { Product } from '../types';
4542

46-
export const CTagsInstallationScript =
47-
os.platform() === 'darwin' ? 'brew install ctags' : 'sudo apt-get install exuberant-ctags';
48-
4943
// Products which may not be available to install from certain package registries, keyed by product name
5044
// Installer implementations can check this to determine a suitable installation channel for a product
5145
// This is temporary and can be removed when https://github.com/microsoft/vscode-jupyter/issues/5034 is unblocked
@@ -226,46 +220,6 @@ abstract class BaseInstaller {
226220
}
227221
}
228222

229-
export class CTagsInstaller extends BaseInstaller {
230-
public async install(_product: Product, resource?: Uri): Promise<InstallerResponse> {
231-
if (this.serviceContainer.get<IPlatformService>(IPlatformService).isWindows) {
232-
this.outputChannel.appendLine('Install Universal Ctags Win32 to enable support for Workspace Symbols');
233-
this.outputChannel.appendLine('Download the CTags binary from the Universal CTags site.');
234-
this.outputChannel.appendLine(
235-
'Option 1: Extract ctags.exe from the downloaded zip to any folder within your PATH so that Visual Studio Code can run it.',
236-
);
237-
this.outputChannel.appendLine(
238-
'Option 2: Extract to any folder and add the path to this folder to the command setting.',
239-
);
240-
this.outputChannel.appendLine(
241-
'Option 3: Extract to any folder and define that path in the python.workspaceSymbols.ctagsPath setting of your user settings file (settings.json).',
242-
);
243-
this.outputChannel.show();
244-
} else {
245-
const terminalService = this.serviceContainer
246-
.get<ITerminalServiceFactory>(ITerminalServiceFactory)
247-
.getTerminalService({ resource });
248-
terminalService
249-
.sendCommand(CTagsInstallationScript, [])
250-
.catch((ex) => traceError(`Failed to install ctags. Script sent '${CTagsInstallationScript}', ${ex}`));
251-
}
252-
return InstallerResponse.Ignore;
253-
}
254-
255-
protected async promptToInstallImplementation(
256-
product: Product,
257-
resource?: Uri,
258-
_cancel?: CancellationToken,
259-
): Promise<InstallerResponse> {
260-
const item = await this.appShell.showErrorMessage(
261-
'Install CTags to enable Python workspace symbols?',
262-
'Yes',
263-
'No',
264-
);
265-
return item === 'Yes' ? this.install(product, resource) : InstallerResponse.Ignore;
266-
}
267-
}
268-
269223
export class FormatterInstaller extends BaseInstaller {
270224
protected async promptToInstallImplementation(
271225
product: Product,
@@ -589,8 +543,6 @@ export class ProductInstaller implements IInstaller {
589543
return new FormatterInstaller(this.serviceContainer, this.outputChannel);
590544
case ProductType.Linter:
591545
return new LinterInstaller(this.serviceContainer, this.outputChannel);
592-
case ProductType.WorkspaceSymbols:
593-
return new CTagsInstaller(this.serviceContainer, this.outputChannel);
594546
case ProductType.TestFramework:
595547
return new TestFrameworkInstaller(this.serviceContainer, this.outputChannel);
596548
case ProductType.RefactoringLibrary:

src/client/common/installer/productPath.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,6 @@ export abstract class BaseProductPathsService implements IProductPathService {
3737
}
3838
}
3939

40-
@injectable()
41-
export class CTagsProductPathService extends BaseProductPathsService {
42-
constructor(@inject(IServiceContainer) serviceContainer: IServiceContainer) {
43-
super(serviceContainer);
44-
}
45-
public getExecutableNameFromSettings(_: Product, resource?: Uri): string {
46-
const settings = this.configService.getSettings(resource);
47-
return settings.workspaceSymbols.ctagsPath;
48-
}
49-
}
50-
5140
@injectable()
5241
export class FormatterProductPathService extends BaseProductPathsService {
5342
constructor(@inject(IServiceContainer) serviceContainer: IServiceContainer) {

src/client/common/installer/productService.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ export class ProductService implements IProductService {
2020
this.ProductTypes.set(Product.pydocstyle, ProductType.Linter);
2121
this.ProductTypes.set(Product.pylama, ProductType.Linter);
2222
this.ProductTypes.set(Product.pylint, ProductType.Linter);
23-
this.ProductTypes.set(Product.ctags, ProductType.WorkspaceSymbols);
2423
this.ProductTypes.set(Product.nosetest, ProductType.TestFramework);
2524
this.ProductTypes.set(Product.pytest, ProductType.TestFramework);
2625
this.ProductTypes.set(Product.unittest, ProductType.TestFramework);

src/client/common/installer/serviceRegistry.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import { PipEnvInstaller } from './pipEnvInstaller';
1313
import { PipInstaller } from './pipInstaller';
1414
import { PoetryInstaller } from './poetryInstaller';
1515
import {
16-
CTagsProductPathService,
1716
DataScienceProductPathService,
1817
FormatterProductPathService,
1918
LinterProductPathService,
@@ -49,11 +48,6 @@ export function registerTypes(serviceManager: IServiceManager) {
4948
);
5049

5150
serviceManager.addSingleton<IProductService>(IProductService, ProductService);
52-
serviceManager.addSingleton<IProductPathService>(
53-
IProductPathService,
54-
CTagsProductPathService,
55-
ProductType.WorkspaceSymbols,
56-
);
5751
serviceManager.addSingleton<IProductPathService>(
5852
IProductPathService,
5953
FormatterProductPathService,

src/client/common/types.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ export enum ProductType {
7777
Formatter = 'Formatter',
7878
TestFramework = 'TestFramework',
7979
RefactoringLibrary = 'RefactoringLibrary',
80-
WorkspaceSymbols = 'WorkspaceSymbols',
8180
DataScience = 'DataScience',
8281
}
8382

@@ -94,7 +93,6 @@ export enum Product {
9493
autopep8 = 10,
9594
mypy = 11,
9695
unittest = 12,
97-
ctags = 13,
9896
rope = 14,
9997
isort = 15,
10098
black = 16,
@@ -191,7 +189,6 @@ export interface IPythonSettings {
191189
readonly autoComplete: IAutoCompleteSettings;
192190
readonly terminal: ITerminalSettings;
193191
readonly sortImports: ISortImportSettings;
194-
readonly workspaceSymbols: IWorkspaceSymbolSettings;
195192
readonly envFile: string;
196193
readonly disableInstallationChecks: boolean;
197194
readonly globalModuleInstallation: boolean;
@@ -293,14 +290,7 @@ export interface IAutoCompleteSettings {
293290
readonly showAdvancedMembers: boolean;
294291
readonly typeshedPaths: string[];
295292
}
296-
export interface IWorkspaceSymbolSettings {
297-
readonly enabled: boolean;
298-
tagFilePath: string;
299-
readonly rebuildOnStart: boolean;
300-
readonly rebuildOnFileSave: boolean;
301-
readonly ctagsPath: string;
302-
readonly exclusionPatterns: string[];
303-
}
293+
304294
export interface ITerminalSettings {
305295
readonly executeInFileDir: boolean;
306296
readonly launchArgs: string[];

src/client/workspaceSymbols/contracts.ts

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)