CodeActionScope (#41782)

* Add CodeActionScope

* Replace matches with contains, try using in ts extension

* Move filtering to getCodeActions

* Basic test

* Docs

* Fix tests

* Hooking up requested scope

* Add basic test for requestedScope

* Added auto apply logic

* Gate refactor provider to only compute refactorings when requested

* Making suggested renames

* Clean up code action trigger impl to use single Trrigger info object

* Rename codeActionScope file and internal CodeActionScope class

* Add quick fix base type

* Make keybinding API more similar to insertSnippet

Take args as an object instead of as an array of values

* Clean up docs

* scope -> kind

* Fixing examples to match Refactor kind
This commit is contained in:
Matt Bierner
2018-01-22 11:45:22 -08:00
committed by GitHub
parent 8f58711d82
commit eccf728e64
18 changed files with 372 additions and 41 deletions

View File

@@ -639,6 +639,7 @@ export interface CodeActionDto {
edit?: WorkspaceEditDto;
diagnostics?: IMarkerData[];
command?: modes.Command;
scope?: string;
}
export interface ExtHostLanguageFeaturesShape {
@@ -651,7 +652,7 @@ export interface ExtHostLanguageFeaturesShape {
$provideHover(handle: number, resource: UriComponents, position: IPosition): TPromise<modes.Hover>;
$provideDocumentHighlights(handle: number, resource: UriComponents, position: IPosition): TPromise<modes.DocumentHighlight[]>;
$provideReferences(handle: number, resource: UriComponents, position: IPosition, context: modes.ReferenceContext): TPromise<LocationDto[]>;
$provideCodeActions(handle: number, resource: UriComponents, range: IRange): TPromise<CodeActionDto[]>;
$provideCodeActions(handle: number, resource: UriComponents, range: IRange, context: modes.CodeActionContext): TPromise<CodeActionDto[]>;
$provideDocumentFormattingEdits(handle: number, resource: UriComponents, options: modes.FormattingOptions): TPromise<ISingleEditOperation[]>;
$provideDocumentRangeFormattingEdits(handle: number, resource: UriComponents, range: IRange, options: modes.FormattingOptions): TPromise<ISingleEditOperation[]>;
$provideOnTypeFormattingEdits(handle: number, resource: UriComponents, position: IPosition, ch: string, options: modes.FormattingOptions): TPromise<ISingleEditOperation[]>;