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
6 changes: 0 additions & 6 deletions src/client/common/installer/moduleInstaller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,16 +248,10 @@ export function translateProductToModule(product: Product): string {
return 'pylint';
case Product.pytest:
return 'pytest';
case Product.autopep8:
return 'autopep8';
case Product.black:
return 'black';
case Product.pycodestyle:
return 'pycodestyle';
case Product.pydocstyle:
return 'pydocstyle';
case Product.yapf:
return 'yapf';
case Product.flake8:
return 'flake8';
case Product.unittest:
Expand Down
3 changes: 0 additions & 3 deletions src/client/common/installer/productNames.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
import { Product } from '../types';

export const ProductNames = new Map<Product, string>();
ProductNames.set(Product.autopep8, 'autopep8');
ProductNames.set(Product.bandit, 'bandit');
ProductNames.set(Product.black, 'black');
ProductNames.set(Product.flake8, 'flake8');
ProductNames.set(Product.mypy, 'mypy');
ProductNames.set(Product.pycodestyle, 'pycodestyle');
Expand All @@ -15,7 +13,6 @@ ProductNames.set(Product.prospector, 'prospector');
ProductNames.set(Product.pydocstyle, 'pydocstyle');
ProductNames.set(Product.pylint, 'pylint');
ProductNames.set(Product.pytest, 'pytest');
ProductNames.set(Product.yapf, 'yapf');
ProductNames.set(Product.tensorboard, 'tensorboard');
ProductNames.set(Product.torchProfilerInstallName, 'torch-tb-profiler');
ProductNames.set(Product.torchProfilerImportName, 'torch_tb_profiler');
Expand Down
14 changes: 0 additions & 14 deletions src/client/common/installer/productPath.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import { inject, injectable } from 'inversify';
import * as path from 'path';
import { Uri } from 'vscode';
import { IFormatterHelper } from '../../formatters/types';
import { IServiceContainer } from '../../ioc/types';
import { ILinterManager } from '../../linters/types';
import { ITestingService } from '../../testing/types';
Expand Down Expand Up @@ -37,19 +36,6 @@ export abstract class BaseProductPathsService implements IProductPathService {
}
}

@injectable()
export class FormatterProductPathService extends BaseProductPathsService {
constructor(@inject(IServiceContainer) serviceContainer: IServiceContainer) {
super(serviceContainer);
}
public getExecutableNameFromSettings(product: Product, resource?: Uri): string {
const settings = this.configService.getSettings(resource);
const formatHelper = this.serviceContainer.get<IFormatterHelper>(IFormatterHelper);
const settingsPropNames = formatHelper.getSettingsPropertyNames(product);
return settings.formatting[settingsPropNames.pathName] as string;
}
}

@injectable()
export class LinterProductPathService extends BaseProductPathsService {
constructor(@inject(IServiceContainer) serviceContainer: IServiceContainer) {
Expand Down
3 changes: 0 additions & 3 deletions src/client/common/installer/productService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ export class ProductService implements IProductService {
this.ProductTypes.set(Product.pylint, ProductType.Linter);
this.ProductTypes.set(Product.pytest, ProductType.TestFramework);
this.ProductTypes.set(Product.unittest, ProductType.TestFramework);
this.ProductTypes.set(Product.autopep8, ProductType.Formatter);
this.ProductTypes.set(Product.black, ProductType.Formatter);
this.ProductTypes.set(Product.yapf, ProductType.Formatter);
this.ProductTypes.set(Product.tensorboard, ProductType.DataScience);
this.ProductTypes.set(Product.torchProfilerInstallName, ProductType.DataScience);
this.ProductTypes.set(Product.torchProfilerImportName, ProductType.DataScience);
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 @@ -11,7 +11,6 @@ import { PipInstaller } from './pipInstaller';
import { PoetryInstaller } from './poetryInstaller';
import {
DataScienceProductPathService,
FormatterProductPathService,
LinterProductPathService,
TestFrameworkProductPathService,
} from './productPath';
Expand All @@ -25,11 +24,6 @@ export function registerTypes(serviceManager: IServiceManager) {
serviceManager.addSingleton<IModuleInstaller>(IModuleInstaller, PoetryInstaller);
serviceManager.addSingleton<IInstallationChannelManager>(IInstallationChannelManager, InstallationChannelManager);
serviceManager.addSingleton<IProductService>(IProductService, ProductService);
serviceManager.addSingleton<IProductPathService>(
IProductPathService,
FormatterProductPathService,
ProductType.Formatter,
);
serviceManager.addSingleton<IProductPathService>(IProductPathService, LinterProductPathService, ProductType.Linter);
serviceManager.addSingleton<IProductPathService>(
IProductPathService,
Expand Down
5 changes: 0 additions & 5 deletions src/client/common/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ export enum ProductInstallStatus {

export enum ProductType {
Linter = 'Linter',
Formatter = 'Formatter',
TestFramework = 'TestFramework',
RefactoringLibrary = 'RefactoringLibrary',
DataScience = 'DataScience',
Expand All @@ -102,11 +101,8 @@ export enum Product {
pylama = 6,
prospector = 7,
pydocstyle = 8,
yapf = 9,
autopep8 = 10,
mypy = 11,
unittest = 12,
black = 16,
bandit = 17,
tensorboard = 24,
torchProfilerInstallName = 25,
Expand Down Expand Up @@ -185,7 +181,6 @@ export interface IPythonSettings {
readonly poetryPath: string;
readonly devOptions: string[];
readonly linting: ILintingSettings;
readonly formatting: IFormattingSettings;
readonly testing: ITestingSettings;
readonly autoComplete: IAutoCompleteSettings;
readonly terminal: ITerminalSettings;
Expand Down
23 changes: 4 additions & 19 deletions src/client/extensionActivation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { IExtensionActivationManager } from './activation/types';
import { registerTypes as appRegisterTypes } from './application/serviceRegistry';
import { IApplicationDiagnostics } from './application/types';
import { IApplicationEnvironment, ICommandManager, IWorkspaceService } from './common/application/types';
import { Commands, PYTHON, PYTHON_LANGUAGE, UseProposedApi } from './common/constants';
import { Commands, PYTHON_LANGUAGE, UseProposedApi } from './common/constants';
import { registerTypes as installerRegisterTypes } from './common/installer/serviceRegistry';
import { IFileSystem } from './common/platform/types';
import {
Expand All @@ -25,11 +25,9 @@ import { noop } from './common/utils/misc';
import { DebuggerTypeName } from './debugger/constants';
import { registerTypes as debugConfigurationRegisterTypes } from './debugger/extension/serviceRegistry';
import { IDebugConfigurationService, IDynamicDebugConfigurationService } from './debugger/extension/types';
import { registerTypes as formattersRegisterTypes } from './formatters/serviceRegistry';
import { IInterpreterService } from './interpreter/contracts';
import { getLanguageConfiguration } from './language/languageConfiguration';
import { registerTypes as lintersRegisterTypes } from './linters/serviceRegistry';
import { PythonFormattingEditProvider } from './providers/formatProvider';
import { ReplProvider } from './providers/replProvider';
import { registerTypes as providersRegisterTypes } from './providers/serviceRegistry';
import { TerminalProvider } from './providers/terminalProvider';
Expand All @@ -51,10 +49,10 @@ import { IDebugSessionEventHandlers } from './debugger/extension/hooks/types';
import { WorkspaceService } from './common/application/workspace';
import { DynamicPythonDebugConfigurationService } from './debugger/extension/configuration/dynamicdebugConfigurationService';
import { IInterpreterQuickPick } from './interpreter/configuration/types';
import { registerInstallFormatterPrompt } from './providers/prompts/installFormatterPrompt';
import { registerAllCreateEnvironmentFeatures } from './pythonEnvironments/creation/registrations';
import { registerCreateEnvironmentTriggers } from './pythonEnvironments/creation/createEnvironmentTrigger';
import { initializePersistentStateForTriggers } from './common/persistentState';
import { logAndNotifyOnFormatterSetting } from './logging/settingLogs';

export async function activateComponents(
// `ext` is passed to any extra activation funcs.
Expand Down Expand Up @@ -110,7 +108,7 @@ export function activateFeatures(ext: ExtensionState, _components: Components):
// See https://github.com/microsoft/vscode-python/issues/10454.

async function activateLegacy(ext: ExtensionState): Promise<ActivationResult> {
const { context, legacyIOC } = ext;
const { legacyIOC } = ext;
const { serviceManager, serviceContainer } = legacyIOC;

// register "services"
Expand All @@ -125,7 +123,6 @@ async function activateLegacy(ext: ExtensionState): Promise<ActivationResult> {
// Feature specific registrations.
unitTestsRegisterTypes(serviceManager);
lintersRegisterTypes(serviceManager);
formattersRegisterTypes(serviceManager);
installerRegisterTypes(serviceManager);
commonRegisterTerminalTypes(serviceManager);
debugConfigurationRegisterTypes(serviceManager);
Expand All @@ -134,7 +131,6 @@ async function activateLegacy(ext: ExtensionState): Promise<ActivationResult> {
const extensions = serviceContainer.get<IExtensions>(IExtensions);
await setDefaultLanguageServer(extensions, serviceManager);

const configuration = serviceManager.get<IConfigurationService>(IConfigurationService);
// Settings are dependent on Experiment service, so we need to initialize it after experiments are activated.
serviceContainer.get<IConfigurationService>(IConfigurationService).getSettings().register();

Expand Down Expand Up @@ -165,20 +161,9 @@ async function activateLegacy(ext: ExtensionState): Promise<ActivationResult> {
serviceContainer.get<IApplicationDiagnostics>(IApplicationDiagnostics).register();

serviceManager.get<ITerminalAutoActivation>(ITerminalAutoActivation).register();
const pythonSettings = configuration.getSettings();

serviceManager.get<ICodeExecutionManager>(ICodeExecutionManager).registerCommands();

if (
pythonSettings &&
pythonSettings.formatting &&
pythonSettings.formatting.provider !== 'internalConsole'
) {
const formatProvider = new PythonFormattingEditProvider(context, serviceContainer);
disposables.push(languages.registerDocumentFormattingEditProvider(PYTHON, formatProvider));
disposables.push(languages.registerDocumentRangeFormattingEditProvider(PYTHON, formatProvider));
}

disposables.push(new ReplProvider(serviceContainer));

const terminalProvider = new TerminalProvider(serviceContainer);
Expand All @@ -200,7 +185,7 @@ async function activateLegacy(ext: ExtensionState): Promise<ActivationResult> {
),
);

registerInstallFormatterPrompt(serviceContainer);
logAndNotifyOnFormatterSetting();
registerCreateEnvironmentTriggers(disposables);
initializePersistentStateForTriggers(ext.context);
}
Expand Down
43 changes: 0 additions & 43 deletions src/client/formatters/autoPep8Formatter.ts

This file was deleted.

Loading