Skip to content

Commit 52512de

Browse files
eslint
1 parent 085d29a commit 52512de

File tree

119 files changed

+986
-785
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+986
-785
lines changed

.eslintignore

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,6 @@ src/test/testing/codeLenses/testFiles.unit.test.ts
134134
src/test/testing/nosetest/nosetest.test.ts
135135
src/test/testing/nosetest/nosetest.disovery.test.ts
136136
src/test/testing/nosetest/nosetest.run.test.ts
137-
src/test/testing/pytest/pytest.testMessageService.test.ts
138-
src/test/testing/pytest/pytest_unittest_parser_data.ts
139-
src/test/testing/pytest/pytest.test.ts
140-
src/test/testing/pytest/pytest_run_tests_data.ts
141-
src/test/testing/pytest/services/discoveryService.unit.test.ts
142137
src/test/testing/rediscover.test.ts
143138
src/test/testing/helper.ts
144139
src/test/testing/navigation/fileNavigator.unit.test.ts
@@ -158,8 +153,6 @@ src/test/testing/banners/proposeNewLanguageServerBanner.unit.test.ts
158153
src/test/testing/common/argsHelper.unit.test.ts
159154
src/test/testing/common/trackEnablement.unit.test.ts
160155
src/test/testing/common/debugLauncher.unit.test.ts
161-
src/test/testing/common/managers/baseTestManager.unit.test.ts
162-
src/test/testing/common/managers/testConfigurationManager.unit.test.ts
163156
src/test/testing/common/testUtils.unit.test.ts
164157
src/test/testing/common/testVisitors/resultResetVisitor.unit.test.ts
165158
src/test/testing/common/services/discoveredTestParser.unit.test.ts
@@ -460,12 +453,6 @@ src/client/testing/nosetest/services/parserService.ts
460453
src/client/testing/nosetest/services/argsService.ts
461454
src/client/testing/nosetest/services/discoveryService.ts
462455
src/client/testing/main.ts
463-
src/client/testing/pytest/main.ts
464-
src/client/testing/pytest/testConfigurationManager.ts
465-
src/client/testing/pytest/runner.ts
466-
src/client/testing/pytest/services/argsService.ts
467-
src/client/testing/pytest/services/discoveryService.ts
468-
src/client/testing/pytest/services/testMessageService.ts
469456
src/client/testing/configurationFactory.ts
470457
src/client/testing/navigation/serviceRegistry.ts
471458
src/client/testing/navigation/symbolProvider.ts
@@ -479,13 +466,9 @@ src/client/testing/explorer/testTreeViewProvider.ts
479466
src/client/testing/explorer/commandHandlers.ts
480467
src/client/testing/explorer/failedTestHandler.ts
481468
src/client/testing/explorer/treeView.ts
482-
src/client/testing/types.ts
483469
src/client/testing/common/argumentsHelper.ts
484470
src/client/testing/common/enablementTracker.ts
485471
src/client/testing/common/debugLauncher.ts
486-
src/client/testing/common/managers/testConfigurationManager.ts
487-
src/client/testing/common/managers/baseTestManager.ts
488-
src/client/testing/common/types.ts
489472
src/client/testing/common/constants.ts
490473
src/client/testing/common/testUtils.ts
491474
src/client/testing/common/xUnitParser.ts
@@ -498,7 +481,6 @@ src/client/testing/common/services/contextService.ts
498481
src/client/testing/common/services/testResultsService.ts
499482
src/client/testing/common/services/storageService.ts
500483
src/client/testing/common/services/types.ts
501-
src/client/testing/common/services/unitTestDiagnosticService.ts
502484
src/client/testing/common/services/testsStatusService.ts
503485
src/client/testing/common/services/discovery.ts
504486
src/client/testing/common/services/configSettingService.ts

src/client/activation/jedi.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ import { PythonRenameProvider } from '../providers/renameProvider';
4040
import { PythonSignatureProvider } from '../providers/signatureProvider';
4141
import { JediSymbolProvider } from '../providers/symbolProvider';
4242
import { PythonEnvironment } from '../pythonEnvironments/info';
43-
import { ITestManagementService } from '../testing/types';
43+
import { ITestingService } from '../testing/types';
4444
import { BlockFormatProviders } from '../typeFormatters/blockFormatProvider';
4545
import { OnTypeFormattingDispatcher } from '../typeFormatters/dispatcher';
4646
import { OnEnterFormatter } from '../typeFormatters/onEnterFormatter';
@@ -94,7 +94,7 @@ export class JediExtensionActivator implements ILanguageServerActivator {
9494
context.subscriptions.push(JediExtensionActivator.workspaceSymbols);
9595
}
9696

97-
const testManagementService = this.serviceManager.get<ITestManagementService>(ITestManagementService);
97+
const testManagementService = this.serviceManager.get<ITestingService>(ITestingService);
9898
testManagementService
9999
.activate(this.symbolProvider)
100100
.catch((ex) => traceError('Failed to activate Unit Tests', ex));

src/client/activation/jedi/languageServerProxy.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { LanguageServerSymbolProvider } from '../../providers/symbolProvider';
2121
import { PythonEnvironment } from '../../pythonEnvironments/info';
2222
import { captureTelemetry, sendTelemetryEvent } from '../../telemetry';
2323
import { EventName } from '../../telemetry/constants';
24-
import { ITestManagementService } from '../../testing/types';
24+
import { ITestingService } from '../../testing/types';
2525
import { FileBasedCancellationStrategy } from '../common/cancellationUtils';
2626
import { LanguageClientMiddleware } from '../languageClientMiddleware';
2727
import { ProgressReporting } from '../progress';
@@ -43,7 +43,7 @@ export class JediLanguageServerProxy implements ILanguageServerProxy {
4343

4444
constructor(
4545
@inject(ILanguageClientFactory) private readonly factory: ILanguageClientFactory,
46-
@inject(ITestManagementService) private readonly testManager: ITestManagementService,
46+
@inject(ITestingService) private readonly testManager: ITestingService,
4747
@inject(IConfigurationService) private readonly configurationService: IConfigurationService,
4848
@inject(IExperimentsManager) private readonly experiments: IExperimentsManager,
4949
@inject(IInterpreterPathService) private readonly interpreterPathService: IInterpreterPathService,

src/client/activation/languageServer/languageServerProxy.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { LanguageServerSymbolProvider } from '../../providers/symbolProvider';
1414
import { PythonEnvironment } from '../../pythonEnvironments/info';
1515
import { captureTelemetry, sendTelemetryEvent } from '../../telemetry';
1616
import { EventName } from '../../telemetry/constants';
17-
import { ITestManagementService } from '../../testing/types';
17+
import { ITestingService } from '../../testing/types';
1818
import { ProgressReporting } from '../progress';
1919
import { ILanguageClientFactory, ILanguageServerProxy } from '../types';
2020

@@ -28,7 +28,7 @@ export class DotNetLanguageServerProxy implements ILanguageServerProxy {
2828

2929
constructor(
3030
@inject(ILanguageClientFactory) private readonly factory: ILanguageClientFactory,
31-
@inject(ITestManagementService) private readonly testManager: ITestManagementService,
31+
@inject(ITestingService) private readonly testManager: ITestingService,
3232
@inject(IConfigurationService) private readonly configurationService: IConfigurationService,
3333
) {
3434
this.startupCompleted = createDeferred<void>();

src/client/activation/node/languageServerProxy.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import { LanguageServerSymbolProvider } from '../../providers/symbolProvider';
2828
import { PythonEnvironment } from '../../pythonEnvironments/info';
2929
import { captureTelemetry, sendTelemetryEvent } from '../../telemetry';
3030
import { EventName } from '../../telemetry/constants';
31-
import { ITestManagementService } from '../../testing/types';
31+
import { ITestingService } from '../../testing/types';
3232
import { FileBasedCancellationStrategy } from '../common/cancellationUtils';
3333
import { ProgressReporting } from '../progress';
3434
import { ILanguageClientFactory, ILanguageServerFolderService, ILanguageServerProxy } from '../types';
@@ -68,7 +68,7 @@ export class NodeLanguageServerProxy implements ILanguageServerProxy {
6868

6969
constructor(
7070
@inject(ILanguageClientFactory) private readonly factory: ILanguageClientFactory,
71-
@inject(ITestManagementService) private readonly testManager: ITestManagementService,
71+
@inject(ITestingService) private readonly testManager: ITestingService,
7272
@inject(IConfigurationService) private readonly configurationService: IConfigurationService,
7373
@inject(ILanguageServerFolderService) private readonly folderService: ILanguageServerFolderService,
7474
@inject(IExperimentsManager) private readonly experiments: IExperimentsManager,

src/client/common/application/commands.ts

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@
33

44
'use strict';
55

6-
import { CancellationToken, Position, TextDocument, Uri } from 'vscode';
6+
import { CancellationToken, Disposable, Position, TextDocument, Uri } from 'vscode';
77
import { Commands as LSCommands } from '../../activation/commands';
88
import { TensorBoardEntrypoint, TensorBoardEntrypointTrigger } from '../../tensorBoard/constants';
9-
import { CommandSource } from '../../testing/common/constants';
10-
import { TestFunction, TestsToRun } from '../../testing/common/types';
11-
import { TestDataItem, TestWorkspaceFolder } from '../../testing/types';
9+
import { TestDataItem, TestFunction, TestsToRun, TestWorkspaceFolder } from '../../testing/common/types';
1210
import { Commands } from '../constants';
13-
import { Channel } from './types';
11+
import { Channel, CommandSource, ICommandManager } from './types';
1412

1513
export type CommandsWithoutArgs = keyof ICommandNameWithoutArgumentTypeMapping;
1614

@@ -129,3 +127,17 @@ export interface ICommandNameArgumentTypeMapping extends ICommandNameWithoutArgu
129127
[Commands.navigateToTestSuite]: [Uri, TestDataItem, boolean];
130128
[Commands.LaunchTensorBoard]: [TensorBoardEntrypoint, TensorBoardEntrypointTrigger];
131129
}
130+
131+
//export const IPythonCommandManager = Symbol('IPythonCommandManager');
132+
export interface IPythonCommandManager extends ICommandManager {
133+
registerCommand<E extends keyof ICommandNameArgumentTypeMapping, U extends ICommandNameArgumentTypeMapping[E]>(
134+
command: E,
135+
callback: (...args: U) => any,
136+
thisArg?: any,
137+
): Disposable;
138+
139+
executeCommand<T, E extends keyof ICommandNameArgumentTypeMapping, U extends ICommandNameArgumentTypeMapping[E]>(
140+
command: E,
141+
...rest: U
142+
): Thenable<T | undefined>;
143+
}

src/client/common/application/types.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,14 @@ import type {
7676
} from 'vscode-proposed';
7777

7878
import { IAsyncDisposable, Resource } from '../types';
79-
import { ICommandNameArgumentTypeMapping } from './commands';
79+
80+
export enum CommandSource {
81+
auto = 'auto',
82+
ui = 'ui',
83+
codelens = 'codelens',
84+
commandPalette = 'commandpalette',
85+
testExplorer = 'testExplorer',
86+
}
8087

8188
export const IApplicationShell = Symbol('IApplicationShell');
8289
export interface IApplicationShell {
@@ -445,11 +452,7 @@ export interface ICommandManager {
445452
* @param thisArg The `this` context used when invoking the handler function.
446453
* @return Disposable which unregisters this command on disposal.
447454
*/
448-
registerCommand<E extends keyof ICommandNameArgumentTypeMapping, U extends ICommandNameArgumentTypeMapping[E]>(
449-
command: E,
450-
callback: (...args: U) => any,
451-
thisArg?: any,
452-
): Disposable;
455+
registerCommand(command: string, callback: (...args: any[]) => any, thisArg?: any): Disposable;
453456

454457
/**
455458
* Registers a text editor command that can be invoked via a keyboard shortcut,
@@ -485,10 +488,7 @@ export interface ICommandManager {
485488
* @return A thenable that resolves to the returned value of the given command. `undefined` when
486489
* the command handler function doesn't return anything.
487490
*/
488-
executeCommand<T, E extends keyof ICommandNameArgumentTypeMapping, U extends ICommandNameArgumentTypeMapping[E]>(
489-
command: E,
490-
...rest: U
491-
): Thenable<T | undefined>;
491+
executeCommand<T>(command: string, ...rest: any[]): Thenable<T | undefined>;
492492

493493
/**
494494
* Retrieve the list of all available commands. Commands starting an underscore are

src/client/common/configSettings.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import { LogLevel } from '../logging/levels';
2020
import { sendTelemetryEvent } from '../telemetry';
2121
import { EventName } from '../telemetry/constants';
2222
import { sendSettingTelemetry } from '../telemetry/envFileTelemetry';
23+
import { ITestingSettings } from '../testing/configuration/types';
2324
import { IWorkspaceService } from './application/types';
2425
import { WorkspaceService } from './application/workspace';
2526
import { DEFAULT_INTERPRETER_SETTING, isTestExecution } from './constants';
@@ -40,7 +41,6 @@ import {
4041
IPythonSettings,
4142
ISortImportSettings,
4243
ITerminalSettings,
43-
ITestingSettings,
4444
IWorkspaceSymbolSettings,
4545
LoggingLevelSettingType,
4646
Resource,

src/client/common/installer/productPath.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { Uri } from 'vscode';
99
import { IFormatterHelper } from '../../formatters/types';
1010
import { IServiceContainer } from '../../ioc/types';
1111
import { ILinterManager } from '../../linters/types';
12-
import { ITestsHelper } from '../../testing/common/types';
12+
import { ITestingService } from '../../testing/types';
1313
import { IConfigurationService, IInstaller, ModuleNamePurpose, Product } from '../types';
1414
import { IProductPathService } from './types';
1515

@@ -78,7 +78,7 @@ export class TestFrameworkProductPathService extends BaseProductPathsService {
7878
super(serviceContainer);
7979
}
8080
public getExecutableNameFromSettings(product: Product, resource?: Uri): string {
81-
const testHelper = this.serviceContainer.get<ITestsHelper>(ITestsHelper);
81+
const testHelper = this.serviceContainer.get<ITestingService>(ITestingService);
8282
const settingsPropNames = testHelper.getSettingsPropertyNames(product);
8383
if (!settingsPropNames.pathName) {
8484
// E.g. in the case of UnitTests we don't allow customizing the paths.

src/client/common/serviceRegistry.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { ApplicationEnvironment } from './application/applicationEnvironment';
1818
import { ApplicationShell } from './application/applicationShell';
1919
import { ClipboardService } from './application/clipboard';
2020
import { CommandManager } from './application/commandManager';
21+
import { IPythonCommandManager } from './application/commands';
2122
import { ReloadVSCodeCommandHandler } from './application/commands/reloadCommand';
2223
import { CustomEditorService } from './application/customEditorService';
2324
import { DebugService } from './application/debugService';
@@ -143,7 +144,7 @@ export function registerTypes(serviceManager: IServiceManager) {
143144
IJupyterExtensionDependencyManager,
144145
JupyterExtensionDependencyManager,
145146
);
146-
serviceManager.addSingleton<ICommandManager>(ICommandManager, CommandManager);
147+
serviceManager.addSingleton<IPythonCommandManager>(ICommandManager, CommandManager);
147148
serviceManager.addSingleton<IConfigurationService>(IConfigurationService, ConfigurationService);
148149
serviceManager.addSingleton<IWorkspaceService>(IWorkspaceService, WorkspaceService);
149150
serviceManager.addSingleton<IProcessLogger>(IProcessLogger, ProcessLogger);

0 commit comments

Comments
 (0)