Support new TS proposed API for refactorings
For https://github.com/microsoft/TypeScript/pull/38378/files#diff-121b46a8c0f71b73817f429b57e27e61R553
This commit is contained in:
parent
f4a8d2e0b1
commit
05d6fb6634
|
@ -25,11 +25,7 @@ namespace Experimental {
|
||||||
readonly error?: string
|
readonly error?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export type RefactorTriggerReason = RefactorInvokedReason;
|
export type RefactorTriggerReason = 'implicit' | 'invoked';
|
||||||
|
|
||||||
export interface RefactorInvokedReason {
|
|
||||||
readonly kind: 'invoked';
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface GetApplicableRefactorsRequestArgs extends Proto.FileRangeRequestArgs {
|
export interface GetApplicableRefactorsRequestArgs extends Proto.FileRangeRequestArgs {
|
||||||
readonly triggerReason?: RefactorTriggerReason;
|
readonly triggerReason?: RefactorTriggerReason;
|
||||||
|
@ -275,11 +271,11 @@ class TypeScriptRefactorProvider implements vscode.CodeActionProvider {
|
||||||
return this.appendInvalidActions(actions);
|
return this.appendInvalidActions(actions);
|
||||||
}
|
}
|
||||||
|
|
||||||
private toTsTriggerReason(context: vscode.CodeActionContext): Experimental.RefactorInvokedReason | undefined {
|
private toTsTriggerReason(context: vscode.CodeActionContext): Experimental.RefactorTriggerReason | undefined {
|
||||||
if (!context.only) {
|
if (!context.only) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
return { kind: 'invoked' };
|
return 'invoked';
|
||||||
}
|
}
|
||||||
|
|
||||||
private convertApplicableRefactors(
|
private convertApplicableRefactors(
|
||||||
|
|
Loading…
Reference in a new issue