Skip to content

Commit 8dc7bea

Browse files
committed
Finalize CodeActionProviderMetadata.documentation
Fixes microsoft#86788
1 parent 222871e commit 8dc7bea

2 files changed

Lines changed: 34 additions & 20 deletions

File tree

src/vs/vscode.d.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2228,6 +2228,40 @@ declare module 'vscode' {
22282228
* such as `[CodeActionKind.Refactor.Extract.append('function'), CodeActionKind.Refactor.Extract.append('constant'), ...]`.
22292229
*/
22302230
readonly providedCodeActionKinds?: ReadonlyArray<CodeActionKind>;
2231+
2232+
/**
2233+
* Static documentation for a class of code actions.
2234+
*
2235+
* Documentation from the provider is shown in the code actions menu if either:
2236+
*
2237+
* - Code actions of `kind` are requested by VS Code. In this case, VS Code will show the documentation that
2238+
* most closely matches the requested code action kind. For example, if a provider has documentation for
2239+
* both `Refactor` and `RefactorExtract`, when the user requests code actions for `RefactorExtract`,
2240+
* VS Code will use the documentation for `RefactorExtract` instead of the documentation for `Refactor`.
2241+
*
2242+
* - Any code actions of `kind` are returned by the provider.
2243+
*
2244+
* At most one documentation entry will be shown per provider.
2245+
*/
2246+
readonly documentation?: ReadonlyArray<{
2247+
/**
2248+
* The kind of the code action being documented.
2249+
*
2250+
* If the kind is generic, such as `CodeActionKind.Refactor`, the documentation will be shown whenever any
2251+
* refactorings are returned. If the kind if more specific, such as `CodeActionKind.RefactorExtract`, the
2252+
* documentation will only be shown when extract refactoring code actions are returned.
2253+
*/
2254+
readonly kind: CodeActionKind;
2255+
2256+
/**
2257+
* Command that displays the documentation to the user.
2258+
*
2259+
* This can display the documentation directly in VS Code or open a website using [`env.openExternal`](#env.openExternal);
2260+
*
2261+
* The title of this documentation code action is taken from [`Command.title`](#Command.title)
2262+
*/
2263+
readonly command: Command;
2264+
}>;
22312265
}
22322266

22332267
/**

src/vs/vscode.proposed.d.ts

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2036,26 +2036,6 @@ declare module 'vscode' {
20362036

20372037
//#endregion
20382038

2039-
//#region https://github.com/microsoft/vscode/issues/86788
2040-
2041-
export interface CodeActionProviderMetadata {
2042-
/**
2043-
* Static documentation for a class of code actions.
2044-
*
2045-
* The documentation is shown in the code actions menu if either:
2046-
*
2047-
* - Code actions of `kind` are requested by VS Code. In this case, VS Code will show the documentation that
2048-
* most closely matches the requested code action kind. For example, if a provider has documentation for
2049-
* both `Refactor` and `RefactorExtract`, when the user requests code actions for `RefactorExtract`,
2050-
* VS Code will use the documentation for `RefactorExtract` intead of the documentation for `Refactor`.
2051-
*
2052-
* - Any code actions of `kind` are returned by the provider.
2053-
*/
2054-
readonly documentation?: ReadonlyArray<{ readonly kind: CodeActionKind, readonly command: Command; }>;
2055-
}
2056-
2057-
//#endregion
2058-
20592039
//#region Dialog title: https://github.com/microsoft/vscode/issues/82871
20602040

20612041
/**

0 commit comments

Comments
 (0)