mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-23 18:19:12 +01:00
Support new TS proposed API for refactorings
For https://github.com/microsoft/TypeScript/pull/38378/files#diff-121b46a8c0f71b73817f429b57e27e61R553
This commit is contained in:
@@ -25,11 +25,7 @@ namespace Experimental {
|
||||
readonly error?: string
|
||||
}
|
||||
|
||||
export type RefactorTriggerReason = RefactorInvokedReason;
|
||||
|
||||
export interface RefactorInvokedReason {
|
||||
readonly kind: 'invoked';
|
||||
}
|
||||
export type RefactorTriggerReason = 'implicit' | 'invoked';
|
||||
|
||||
export interface GetApplicableRefactorsRequestArgs extends Proto.FileRangeRequestArgs {
|
||||
readonly triggerReason?: RefactorTriggerReason;
|
||||
@@ -275,11 +271,11 @@ class TypeScriptRefactorProvider implements vscode.CodeActionProvider {
|
||||
return this.appendInvalidActions(actions);
|
||||
}
|
||||
|
||||
private toTsTriggerReason(context: vscode.CodeActionContext): Experimental.RefactorInvokedReason | undefined {
|
||||
private toTsTriggerReason(context: vscode.CodeActionContext): Experimental.RefactorTriggerReason | undefined {
|
||||
if (!context.only) {
|
||||
return;
|
||||
}
|
||||
return { kind: 'invoked' };
|
||||
return 'invoked';
|
||||
}
|
||||
|
||||
private convertApplicableRefactors(
|
||||
|
||||
Reference in New Issue
Block a user