Add code action trigger to proposed API

#50248
This commit is contained in:
Matt Bierner
2018-05-21 16:19:00 -07:00
parent cdea1bdc99
commit 0a0d3d5e45
10 changed files with 62 additions and 15 deletions

View File

@@ -672,6 +672,7 @@ export function createApiFactory(
Color: extHostTypes.Color,
ColorPresentation: extHostTypes.ColorPresentation,
ColorInformation: extHostTypes.ColorInformation,
CodeActionTrigger: extHostTypes.CodeActionTrigger,
EndOfLine: extHostTypes.EndOfLine,
CompletionItem: extHostTypes.CompletionItem,
CompletionItemKind: extHostTypes.CompletionItemKind,

View File

@@ -295,7 +295,8 @@ class CodeActionAdapter {
const codeActionContext: vscode.CodeActionContext = {
diagnostics: allDiagnostics,
only: context.only ? new CodeActionKind(context.only) : undefined
only: context.only ? new CodeActionKind(context.only) : undefined,
triggerKind: context.trigger,
};
return asWinJsPromise(token =>

View File

@@ -903,6 +903,11 @@ export class Hierarchy<T> {
}
}
export enum CodeActionTrigger {
Automatic = 1,
Manual = 2,
}
export class CodeAction {
title: string;