Skip to content

Commit

Permalink
Remove notebook controller kind API proposal
Browse files Browse the repository at this point in the history
  • Loading branch information
mjbvz committed Mar 1, 2023
1 parent 61a2399 commit afc9daf
Show file tree
Hide file tree
Showing 10 changed files with 3 additions and 49 deletions.
1 change: 0 additions & 1 deletion extensions/vscode-api-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"findTextInFiles",
"fsChunks",
"notebookCellExecutionState",
"notebookControllerKind",
"notebookDeprecated",
"notebookLiveShare",
"notebookMessaging",
Expand Down
6 changes: 0 additions & 6 deletions src/vs/workbench/api/browser/mainThreadNotebookKernels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ abstract class MainThreadKernel implements INotebookKernel {
label: string;
description?: string;
detail?: string;
kind?: string;
supportedLanguages: string[];
implementsExecutionOrder: boolean;
localResourceRoot: URI;
Expand All @@ -56,7 +55,6 @@ abstract class MainThreadKernel implements INotebookKernel {
this.label = data.label;
this.description = data.description;
this.detail = data.detail;
this.kind = data.kind;
this.supportedLanguages = isNonEmptyArray(data.supportedLanguages) ? data.supportedLanguages : _languageService.getRegisteredLanguageIds();
this.implementsExecutionOrder = data.supportsExecutionOrder ?? false;
this.localResourceRoot = URI.revive(data.extensionLocation);
Expand All @@ -79,10 +77,6 @@ abstract class MainThreadKernel implements INotebookKernel {
this.detail = data.detail;
event.detail = true;
}
if (data.kind !== undefined) {
this.kind = data.kind;
event.kind = true;
}
if (data.supportedLanguages !== undefined) {
this.supportedLanguages = isNonEmptyArray(data.supportedLanguages) ? data.supportedLanguages : this._languageService.getRegisteredLanguageIds();
event.supportedLanguages = true;
Expand Down
1 change: 0 additions & 1 deletion src/vs/workbench/api/common/extHost.protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1002,7 +1002,6 @@ export interface INotebookKernelDto2 {
label: string;
detail?: string;
description?: string;
kind?: string;
supportedLanguages?: string[];
supportsInterrupt?: boolean;
supportsExecutionOrder?: boolean;
Expand Down
9 changes: 0 additions & 9 deletions src/vs/workbench/api/common/extHostNotebookKernels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,15 +178,6 @@ export class ExtHostNotebookKernels implements ExtHostNotebookKernelsShape {
data.description = value;
_update();
},
get kind() {
checkProposedApiEnabled(extension, 'notebookControllerKind');
return data.kind ?? '';
},
set kind(value) {
checkProposedApiEnabled(extension, 'notebookControllerKind');
data.kind = value;
_update();
},
get supportedLanguages() {
return data.supportedLanguages;
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ CommandsRegistry.registerCommand('_resolveNotebookKernels', async (accessor, arg
return kernels.all.map(provider => ({
id: provider.id,
label: provider.label,
kind: provider.kind,
description: provider.description,
detail: provider.detail,
isPreferred: false, // todo@jrieken,@rebornix
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { Codicon } from 'vs/base/common/codicons';
import { Event } from 'vs/base/common/event';
import { DisposableStore } from 'vs/base/common/lifecycle';
import { MarshalledId } from 'vs/base/common/marshallingIds';
import { compareIgnoreCase, uppercaseFirstLetter } from 'vs/base/common/strings';
import { uppercaseFirstLetter } from 'vs/base/common/strings';
import 'vs/css!./notebookKernelActionViewItem';
import { Command } from 'vs/editor/common/languages';
import { localize } from 'vs/nls';
Expand Down Expand Up @@ -445,17 +445,9 @@ export class KernelPickerFlatStrategy extends KernelPickerStrategyBase {
// Always display suggested kernels on the top.
this._fillInSuggestions(quickPickItems, suggestions, selected);

// Next display all of the kernels not marked as hidden grouped by categories or extensions.
// If we don't have a kind, always display those at the bottom.
// Next display all of the kernels not marked as hidden
const picks = all.filter(item => (!suggestions.includes(item) && !hidden.includes(item))).map(kernel => toKernelQuickPick(kernel, selected));
const kernelsPerCategory = groupBy(picks, (a, b) => compareIgnoreCase(a.kernel.kind || 'z', b.kernel.kind || 'z'));
kernelsPerCategory.forEach(items => {
quickPickItems.push({
type: 'separator',
label: items[0].kernel.kind || localize('otherKernelKinds', "Other")
});
quickPickItems.push(...items);
});
quickPickItems.push(...picks);
}

const sourceActions = notebookKernelService.getSourceActions(notebookTextModel, scopedContextKeyService);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export interface INotebookKernelChangeEvent {
label?: true;
description?: true;
detail?: true;
kind?: true;
supportedLanguages?: true;
hasExecutionOrder?: true;
hasInterruptHandler?: true;
Expand All @@ -49,7 +48,6 @@ export interface INotebookKernel {
label: string;
description?: string;
detail?: string;
kind?: string;
supportedLanguages: string[];
implementsInterrupt?: boolean;
implementsExecutionOrder?: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ class TestNotebookKernel implements INotebookKernel {
constructor(opts?: { languages: string[] }) {
this.supportedLanguages = opts?.languages ?? [PLAINTEXT_LANGUAGE_ID];
}
kind?: string | undefined;
implementsInterrupt?: boolean | undefined;
implementsExecutionOrder?: boolean | undefined;
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ export const allApiProposals = Object.freeze({
ipc: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.ipc.d.ts',
notebookCellExecutionState: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookCellExecutionState.d.ts',
notebookControllerAffinityHidden: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookControllerAffinityHidden.d.ts',
notebookControllerKind: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookControllerKind.d.ts',
notebookDeprecated: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookDeprecated.d.ts',
notebookKernelSource: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookKernelSource.d.ts',
notebookLiveShare: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookLiveShare.d.ts',
Expand Down
16 changes: 0 additions & 16 deletions src/vscode-dts/vscode.proposed.notebookControllerKind.d.ts

This file was deleted.

0 comments on commit afc9daf

Please sign in to comment.