Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 0 additions & 41 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1812,47 +1812,6 @@
"description": "Path to folder with a list of Virtual Environments (e.g. ~/.pyenv, ~/Envs, ~/.virtualenvs).",
"scope": "machine"
},
"python.workspaceSymbols.ctagsPath": {
"type": "string",
"default": "ctags",
"description": "Fully qualified path to the ctags executable (else leave as ctags, assuming it is in current path).",
"scope": "resource"
},
"python.workspaceSymbols.enabled": {
"type": "boolean",
"default": false,
"description": "Set to 'true' to enable ctags to provide Workspace Symbols.",
"scope": "resource"
},
"python.workspaceSymbols.exclusionPatterns": {
"type": "array",
"default": [
"**/site-packages/**"
],
"items": {
"type": "string"
},
"description": "Pattern used to exclude files and folders from ctags See http://ctags.sourceforge.net/ctags.html.",
"scope": "resource"
},
"python.workspaceSymbols.rebuildOnFileSave": {
"type": "boolean",
"default": true,
"description": "Whether to re-build the tags file on when changes made to python files are saved.",
"scope": "resource"
},
"python.workspaceSymbols.rebuildOnStart": {
"type": "boolean",
"default": true,
"description": "Whether to re-build the tags file on start (defaults to true).",
"scope": "resource"
},
"python.workspaceSymbols.tagFilePath": {
"type": "string",
"default": "${workspaceFolder}/.vscode/tags",
"description": "Fully qualified path to tag file (exuberant ctag file), used to provide workspace symbols.",
"scope": "resource"
},
"python.insidersChannel": {
"type": "string",
"default": "off",
Expand Down
8 changes: 0 additions & 8 deletions src/client/activation/jedi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,10 @@ import { PythonSignatureProvider } from '../providers/signatureProvider';
import { JediSymbolProvider } from '../providers/symbolProvider';
import { PythonEnvironment } from '../pythonEnvironments/info';
import { ITestingService } from '../testing/types';
import { WorkspaceSymbols } from '../workspaceSymbols/main';
import { ILanguageServerActivator } from './types';

@injectable()
export class JediExtensionActivator implements ILanguageServerActivator {
private static workspaceSymbols: WorkspaceSymbols | undefined;
private readonly context: IExtensionContext;
private jediFactory?: JediFactory;
private readonly documentSelector: DocumentFilter[];
Expand Down Expand Up @@ -85,12 +83,6 @@ export class JediExtensionActivator implements ILanguageServerActivator {
this.symbolProvider = new JediSymbolProvider(serviceContainer, jediFactory);
this.signatureProvider = new PythonSignatureProvider(jediFactory);

if (!JediExtensionActivator.workspaceSymbols) {
// Workspace symbols is static because it doesn't rely on the jediFactory.
JediExtensionActivator.workspaceSymbols = new WorkspaceSymbols(serviceContainer);
context.subscriptions.push(JediExtensionActivator.workspaceSymbols);
}

const testManagementService = this.serviceManager.get<ITestingService>(ITestingService);
testManagementService
.activate(this.symbolProvider)
Expand Down
30 changes: 0 additions & 30 deletions src/client/common/configSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ import {
ISortImportSettings,
ITensorBoardSettings,
ITerminalSettings,
IWorkspaceSymbolSettings,
LoggingLevelSettingType,
Resource,
} from './types';
Expand Down Expand Up @@ -128,8 +127,6 @@ export class PythonSettings implements IPythonSettings {

public sortImports!: ISortImportSettings;

public workspaceSymbols!: IWorkspaceSymbolSettings;

public disableInstallationChecks = false;

public globalModuleInstallation = false;
Expand Down Expand Up @@ -470,33 +467,6 @@ export class PythonSettings implements IPythonSettings {
typeshedPaths: [],
};

const workspaceSymbolsSettings = systemVariables.resolveAny(
pythonSettings.get<IWorkspaceSymbolSettings>('workspaceSymbols'),
)!;
if (this.workspaceSymbols) {
Object.assign<IWorkspaceSymbolSettings, IWorkspaceSymbolSettings>(
this.workspaceSymbols,
workspaceSymbolsSettings,
);
} else {
this.workspaceSymbols = workspaceSymbolsSettings;
}
// Support for travis.
this.workspaceSymbols = this.workspaceSymbols
? this.workspaceSymbols
: {
ctagsPath: 'ctags',
enabled: true,
exclusionPatterns: [],
rebuildOnFileSave: true,
rebuildOnStart: true,
tagFilePath: workspaceRoot ? path.join(workspaceRoot, 'tags') : '',
};
this.workspaceSymbols.tagFilePath = getAbsolutePath(
systemVariables.resolveAny(this.workspaceSymbols.tagFilePath),
workspaceRoot,
);

const testSettings = systemVariables.resolveAny(pythonSettings.get<ITestingSettings>('testing'))!;
if (this.testing) {
Object.assign<ITestingSettings, ITestingSettings>(this.testing, testSettings);
Expand Down
48 changes: 0 additions & 48 deletions src/client/common/installer/productInstaller.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/* eslint-disable max-classes-per-file */

import { inject, injectable, named } from 'inversify';
import * as os from 'os';
import * as semver from 'semver';
import { CancellationToken, OutputChannel, Uri } from 'vscode';
import '../extensions';
Expand All @@ -13,9 +12,7 @@ import { EventName } from '../../telemetry/constants';
import { IApplicationShell, IWorkspaceService } from '../application/types';
import { STANDARD_OUTPUT_CHANNEL } from '../constants';
import { traceError, traceInfo } from '../logger';
import { IPlatformService } from '../platform/types';
import { IProcessServiceFactory, IPythonExecutionFactory } from '../process/types';
import { ITerminalServiceFactory } from '../terminal/types';
import {
IConfigurationService,
IInstaller,
Expand All @@ -40,9 +37,6 @@ import {

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

export const CTagsInstallationScript =
os.platform() === 'darwin' ? 'brew install ctags' : 'sudo apt-get install exuberant-ctags';

// Products which may not be available to install from certain package registries, keyed by product name
// Installer implementations can check this to determine a suitable installation channel for a product
// This is temporary and can be removed when https://github.com/microsoft/vscode-jupyter/issues/5034 is unblocked
Expand Down Expand Up @@ -223,46 +217,6 @@ abstract class BaseInstaller {
}
}

export class CTagsInstaller extends BaseInstaller {
public async install(_product: Product, resource?: Uri): Promise<InstallerResponse> {
if (this.serviceContainer.get<IPlatformService>(IPlatformService).isWindows) {
this.outputChannel.appendLine('Install Universal Ctags Win32 to enable support for Workspace Symbols');
this.outputChannel.appendLine('Download the CTags binary from the Universal CTags site.');
this.outputChannel.appendLine(
'Option 1: Extract ctags.exe from the downloaded zip to any folder within your PATH so that Visual Studio Code can run it.',
);
this.outputChannel.appendLine(
'Option 2: Extract to any folder and add the path to this folder to the command setting.',
);
this.outputChannel.appendLine(
'Option 3: Extract to any folder and define that path in the python.workspaceSymbols.ctagsPath setting of your user settings file (settings.json).',
);
this.outputChannel.show();
} else {
const terminalService = this.serviceContainer
.get<ITerminalServiceFactory>(ITerminalServiceFactory)
.getTerminalService({ resource });
terminalService
.sendCommand(CTagsInstallationScript, [])
.catch((ex) => traceError(`Failed to install ctags. Script sent '${CTagsInstallationScript}', ${ex}`));
}
return InstallerResponse.Ignore;
}

protected async promptToInstallImplementation(
product: Product,
resource?: Uri,
_cancel?: CancellationToken,
): Promise<InstallerResponse> {
const item = await this.appShell.showErrorMessage(
'Install CTags to enable Python workspace symbols?',
'Yes',
'No',
);
return item === 'Yes' ? this.install(product, resource) : InstallerResponse.Ignore;
}
}

export class FormatterInstaller extends BaseInstaller {
protected async promptToInstallImplementation(
product: Product,
Expand Down Expand Up @@ -489,8 +443,6 @@ export class ProductInstaller implements IInstaller {
switch (productType) {
case ProductType.Formatter:
return new FormatterInstaller(this.serviceContainer, this.outputChannel);
case ProductType.WorkspaceSymbols:
return new CTagsInstaller(this.serviceContainer, this.outputChannel);
case ProductType.TestFramework:
return new TestFrameworkInstaller(this.serviceContainer, this.outputChannel);
case ProductType.RefactoringLibrary:
Expand Down
11 changes: 0 additions & 11 deletions src/client/common/installer/productPath.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,6 @@ export abstract class BaseProductPathsService implements IProductPathService {
}
}

@injectable()
export class CTagsProductPathService extends BaseProductPathsService {
constructor(@inject(IServiceContainer) serviceContainer: IServiceContainer) {
super(serviceContainer);
}
public getExecutableNameFromSettings(_: Product, resource?: Uri): string {
const settings = this.configService.getSettings(resource);
return settings.workspaceSymbols.ctagsPath;
}
}

@injectable()
export class FormatterProductPathService extends BaseProductPathsService {
constructor(@inject(IServiceContainer) serviceContainer: IServiceContainer) {
Expand Down
1 change: 0 additions & 1 deletion src/client/common/installer/productService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export class ProductService implements IProductService {
this.ProductTypes.set(Product.pydocstyle, ProductType.Linter);
this.ProductTypes.set(Product.pylama, ProductType.Linter);
this.ProductTypes.set(Product.pylint, ProductType.Linter);
this.ProductTypes.set(Product.ctags, ProductType.WorkspaceSymbols);
this.ProductTypes.set(Product.nosetest, ProductType.TestFramework);
this.ProductTypes.set(Product.pytest, ProductType.TestFramework);
this.ProductTypes.set(Product.unittest, ProductType.TestFramework);
Expand Down
6 changes: 0 additions & 6 deletions src/client/common/installer/serviceRegistry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { PipEnvInstaller } from './pipEnvInstaller';
import { PipInstaller } from './pipInstaller';
import { PoetryInstaller } from './poetryInstaller';
import {
CTagsProductPathService,
DataScienceProductPathService,
FormatterProductPathService,
LinterProductPathService,
Expand Down Expand Up @@ -49,11 +48,6 @@ export function registerTypes(serviceManager: IServiceManager) {
);

serviceManager.addSingleton<IProductService>(IProductService, ProductService);
serviceManager.addSingleton<IProductPathService>(
IProductPathService,
CTagsProductPathService,
ProductType.WorkspaceSymbols,
);
serviceManager.addSingleton<IProductPathService>(
IProductPathService,
FormatterProductPathService,
Expand Down
12 changes: 1 addition & 11 deletions src/client/common/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ export enum ProductType {
Formatter = 'Formatter',
TestFramework = 'TestFramework',
RefactoringLibrary = 'RefactoringLibrary',
WorkspaceSymbols = 'WorkspaceSymbols',
DataScience = 'DataScience',
}

Expand All @@ -94,7 +93,6 @@ export enum Product {
autopep8 = 10,
mypy = 11,
unittest = 12,
ctags = 13,
rope = 14,
isort = 15,
black = 16,
Expand Down Expand Up @@ -191,7 +189,6 @@ export interface IPythonSettings {
readonly autoComplete: IAutoCompleteSettings;
readonly terminal: ITerminalSettings;
readonly sortImports: ISortImportSettings;
readonly workspaceSymbols: IWorkspaceSymbolSettings;
readonly envFile: string;
readonly disableInstallationChecks: boolean;
readonly globalModuleInstallation: boolean;
Expand Down Expand Up @@ -292,14 +289,7 @@ export interface IAutoCompleteSettings {
readonly showAdvancedMembers: boolean;
readonly typeshedPaths: string[];
}
export interface IWorkspaceSymbolSettings {
readonly enabled: boolean;
tagFilePath: string;
readonly rebuildOnStart: boolean;
readonly rebuildOnFileSave: boolean;
readonly ctagsPath: string;
readonly exclusionPatterns: string[];
}

export interface ITerminalSettings {
readonly executeInFileDir: boolean;
readonly launchArgs: string[];
Expand Down
9 changes: 0 additions & 9 deletions src/client/workspaceSymbols/contracts.ts

This file was deleted.

Loading