Final Support for Notebook CodeActionKind (#193121)

* finalize nb CodeActionKind

* edit jsdoc + apiproposal change

* stricter doc comment
This commit is contained in:
Michael Lively
2023-09-15 09:27:21 -07:00
committed by GitHub
parent 26558d58c0
commit 6d1812beed
3 changed files with 18 additions and 18 deletions
@@ -58,7 +58,6 @@ export const allApiProposals = Object.freeze({
languageConfigurationAutoClosingPairs: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageConfigurationAutoClosingPairs.d.ts',
mappedEditsProvider: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.mappedEditsProvider.d.ts',
notebookCellExecutionState: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookCellExecutionState.d.ts',
notebookCodeActions: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookCodeActions.d.ts',
notebookControllerAffinityHidden: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookControllerAffinityHidden.d.ts',
notebookDeprecated: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookDeprecated.d.ts',
notebookExecution: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookExecution.d.ts',
+18
View File
@@ -2474,6 +2474,24 @@ declare module 'vscode' {
*/
static readonly SourceFixAll: CodeActionKind;
/**
* Base kind for all code actions applying to the enitre notebook's scope. CodeActionKinds using
* this should always begin with `notebook.`
*
* This requires that new CodeActions be created for it and contributed via extensions.
* Pre-existing kinds can not just have the new `notebook.` prefix added to them, as the functionality
* is unique to the full-notebook scope.
*
* Notebook CodeActionKinds can be initialized as either of the following (both resulting in `notebook.source.xyz`):
* - `const newKind = CodeActionKind.Notebook.append(CodeActionKind.Source.append('xyz').value)`
* - `const newKind = CodeActionKind.Notebook.append('source.xyz')`
*
* Example Kinds/Actions:
* - `notebook.source.organizeImports` (might move all imports to a new top cell)
* - `notebook.source.normalizeVariableNames` (might rename all variables to a standardized casing format)
*/
static readonly Notebook: CodeActionKind;
/**
* Private constructor, use statix `CodeActionKind.XYZ` to derive from an existing code action kind.
*
-17
View File
@@ -1,17 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
declare module 'vscode' {
// https://github.com/microsoft/vscode/issues/179213
export class NotebookCodeActionKind {
// can only return MULTI CELL workspaceEdits
// ex: notebook.organizeImprots
static readonly Notebook: CodeActionKind;
constructor(value: string);
}
}