Skip to content

Migrate over to using enabledApiProposals in package.json #18269

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jan 11, 2022
Merged
Show file tree
Hide file tree
Changes from 4 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
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"languageServerVersion": "0.5.30",
"publisher": "ms-python",
"enableProposedApi": true,
"enabledApiProposals": ["languageStatus", "quickPickSortByLabel", "quickPickSeparators", "testRefresh", "testObserver", "notebookEditor"],
"author": {
"name": "Microsoft Corporation"
},
Expand All @@ -38,7 +38,7 @@
"theme": "dark"
},
"engines": {
"vscode": "^1.61.0"
"vscode": "^1.63.0"
},
"keywords": [
"python",
Expand Down Expand Up @@ -1954,7 +1954,7 @@
"@types/tmp": "0.0.33",
"@types/untildify": "^3.0.0",
"@types/uuid": "^3.4.3",
"@types/vscode": "~1.53.0",
"@types/vscode": "~1.63.0",
"@types/winreg": "^1.2.30",
"@types/xml2js": "^0.4.2",
"@typescript-eslint/eslint-plugin": "^3.7.0",
Expand Down
4 changes: 3 additions & 1 deletion src/client/activation/node/activator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ export class NodeLanguageServerActivator extends LanguageServerActivatorBase {
if (languageClient) {
// Turn our item into a ProtocolCompletionItem before we convert it. This preserves the .data
// attribute that it has and is needed to match on the language server side.
const protoItem: ProtocolCompletionItem = new ProtocolCompletionItem(item.label);
const protoItem: ProtocolCompletionItem = new ProtocolCompletionItem(
typeof item.label === 'string' ? item.label : item.label.label,
);
Object.assign(protoItem, item);

const args = languageClient.code2ProtocolConverter.asCompletionItem(protoItem);
Expand Down
2 changes: 1 addition & 1 deletion src/client/common/application/debugService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class DebugService implements IDebugService {
public get activeDebugSession(): DebugSession | undefined {
return debug.activeDebugSession;
}
public get breakpoints(): Breakpoint[] {
public get breakpoints(): readonly Breakpoint[] {
return debug.breakpoints;
}
public get onDidChangeActiveDebugSession(): Event<DebugSession | undefined> {
Expand Down
4 changes: 2 additions & 2 deletions src/client/common/application/documentManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class DocumentManager implements IDocumentManager {
public get activeTextEditor(): TextEditor | undefined {
return window.activeTextEditor;
}
public get visibleTextEditors(): TextEditor[] {
public get visibleTextEditors(): readonly TextEditor[] {
return window.visibleTextEditors;
}
public get onDidChangeActiveTextEditor(): Event<TextEditor | undefined> {
Expand All @@ -38,7 +38,7 @@ export class DocumentManager implements IDocumentManager {
public get onDidChangeTextDocument(): Event<TextDocumentChangeEvent> {
return workspace.onDidChangeTextDocument;
}
public get onDidChangeVisibleTextEditors(): Event<TextEditor[]> {
public get onDidChangeVisibleTextEditors(): Event<readonly TextEditor[]> {
return window.onDidChangeVisibleTextEditors;
}
public get onDidChangeTextEditorSelection(): Event<TextEditorSelectionChangeEvent> {
Expand Down
48 changes: 0 additions & 48 deletions src/client/common/application/notebook.ts

This file was deleted.

14 changes: 3 additions & 11 deletions src/client/common/application/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ import {
WorkspaceFolderPickOptions,
WorkspaceFoldersChangeEvent,
} from 'vscode';
import type { NotebookConcatTextDocument, NotebookDocument } from 'vscode-proposed';

import { Channel } from '../constants';
import { Resource } from '../types';
Expand Down Expand Up @@ -522,7 +521,7 @@ export interface IDocumentManager {
/**
* The currently visible editors or an empty array.
*/
readonly visibleTextEditors: TextEditor[];
readonly visibleTextEditors: readonly TextEditor[];

/**
* An [event](#Event) which fires when the [active editor](#window.activeTextEditor)
Expand All @@ -542,7 +541,7 @@ export interface IDocumentManager {
* An [event](#Event) which fires when the array of [visible editors](#window.visibleTextEditors)
* has changed.
*/
readonly onDidChangeVisibleTextEditors: Event<TextEditor[]>;
readonly onDidChangeVisibleTextEditors: Event<readonly TextEditor[]>;

/**
* An [event](#Event) which fires when the selection in an editor has changed.
Expand Down Expand Up @@ -874,7 +873,7 @@ export interface IDebugService {
/**
* List of breakpoints.
*/
readonly breakpoints: Breakpoint[];
readonly breakpoints: readonly Breakpoint[];

/**
* An [event](#Event) which fires when the [active debug session](#debug.activeDebugSession)
Expand Down Expand Up @@ -1099,10 +1098,3 @@ export interface IClipboard {
*/
writeText(value: string): Promise<void>;
}
export const IVSCodeNotebook = Symbol('IVSCodeNotebook');
export interface IVSCodeNotebook {
readonly notebookDocuments: ReadonlyArray<NotebookDocument>;
readonly onDidOpenNotebookDocument: Event<NotebookDocument>;
readonly onDidCloseNotebookDocument: Event<NotebookDocument>;
createConcatTextDocument(notebook: NotebookDocument, selector?: DocumentSelector): NotebookConcatTextDocument;
}
Comment on lines -1102 to -1108
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

3 changes: 0 additions & 3 deletions src/client/common/serviceRegistry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import { DebugSessionTelemetry } from './application/debugSessionTelemetry';
import { DocumentManager } from './application/documentManager';
import { Extensions } from './application/extensions';
import { LanguageService } from './application/languageService';
import { VSCodeNotebook } from './application/notebook';
import { TerminalManager } from './application/terminalManager';
import {
IActiveResourceService,
Expand All @@ -50,7 +49,6 @@ import {
IJupyterExtensionDependencyManager,
ILanguageService,
ITerminalManager,
IVSCodeNotebook,
IWorkspaceService,
} from './application/types';
import { WorkspaceService } from './application/workspace';
Expand Down Expand Up @@ -123,7 +121,6 @@ export function registerTypes(serviceManager: IServiceManager): void {
serviceManager.addSingleton<ITerminalServiceFactory>(ITerminalServiceFactory, TerminalServiceFactory);
serviceManager.addSingleton<IPathUtils>(IPathUtils, PathUtils);
serviceManager.addSingleton<IApplicationShell>(IApplicationShell, ApplicationShell);
serviceManager.addSingleton<IVSCodeNotebook>(IVSCodeNotebook, VSCodeNotebook);
serviceManager.addSingleton<IClipboard>(IClipboard, ClipboardService);
serviceManager.addSingleton<ICurrentProcess>(ICurrentProcess, CurrentProcess);
serviceManager.addSingleton<IInstaller>(IInstaller, ProductInstaller);
Expand Down
6 changes: 3 additions & 3 deletions src/client/testing/testController/common/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
import { TestDiscoveryOptions } from '../../common/types';

export type TestRunInstanceOptions = TestRunOptions & {
exclude?: TestItem[];
exclude?: readonly TestItem[];
debug: boolean;
};

Expand Down Expand Up @@ -51,8 +51,8 @@ export interface ITestController {
}

export interface ITestRun {
includes: TestItem[];
excludes: TestItem[];
includes: readonly TestItem[];
excludes: readonly TestItem[];
runKind: TestRunProfileKind;
runInstance: TestRun;
}
Expand Down
2 changes: 1 addition & 1 deletion src/client/testing/testController/unittest/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export class UnittestRunner implements ITestsRunner {
}

private async runTest(
testNodes: TestItem[],
testNodes: readonly TestItem[],
runInstance: TestRun,
options: TestRunInstanceOptions,
idToRawData: Map<string, TestData>,
Expand Down
12 changes: 6 additions & 6 deletions src/test/common/terminals/activation.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ suite('Terminal Auto Activation', () => {
let terminal: Terminal;

setup(() => {
terminal = {
terminal = ({
dispose: noop,
hide: noop,
name: 'Python',
Expand All @@ -34,7 +34,7 @@ suite('Terminal Auto Activation', () => {
sendText: noop,
show: noop,
exitStatus: { code: 0 },
};
} as unknown) as Terminal;
terminalManager = mock(TerminalManager);
activator = mock(TerminalActivator);
activeResourceService = mock(ActiveResourceService);
Expand Down Expand Up @@ -68,7 +68,7 @@ suite('Terminal Auto Activation', () => {
verify(activator.activateEnvironmentInTerminal(terminal, anything())).once();
});
test('New Terminals should not be activated if hidden from user', async () => {
terminal = {
terminal = ({
dispose: noop,
hide: noop,
name: 'Python',
Expand All @@ -77,7 +77,7 @@ suite('Terminal Auto Activation', () => {
sendText: noop,
show: noop,
exitStatus: { code: 0 },
};
} as unknown) as Terminal;
type EventHandler = (e: Terminal) => void;
let handler: undefined | EventHandler;
const handlerDisposable = TypeMoq.Mock.ofType<IDisposable>();
Expand All @@ -98,7 +98,7 @@ suite('Terminal Auto Activation', () => {
verify(activator.activateEnvironmentInTerminal(terminal, anything())).never();
});
test('New Terminals should not be activated if auto activation is to be disabled', async () => {
terminal = {
terminal = ({
dispose: noop,
hide: noop,
name: 'Python',
Expand All @@ -107,7 +107,7 @@ suite('Terminal Auto Activation', () => {
sendText: noop,
show: noop,
exitStatus: { code: 0 },
};
} as unknown) as Terminal;
type EventHandler = (e: Terminal) => void;
let handler: undefined | EventHandler;
const handlerDisposable = TypeMoq.Mock.ofType<IDisposable>();
Expand Down
Loading