File tree 1 file changed +11
-1
lines changed
extensions/typescript-language-features/src/features
1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,9 @@ import FormattingOptionsManager from './fileConfigurationManager';
19
19
20
20
const localize = nls . loadMessageBundle ( ) ;
21
21
22
+ interface RefactorActionInfo extends Proto . RefactorActionInfo {
23
+ error ?: string
24
+ }
22
25
23
26
class ApplyRefactoringCommand implements Command {
24
27
public static readonly ID = '_typescript.applyRefactoring' ;
@@ -280,13 +283,20 @@ class TypeScriptRefactorProvider implements vscode.CodeActionProvider {
280
283
}
281
284
282
285
private refactorActionToCodeAction (
283
- action : Proto . RefactorActionInfo ,
286
+ action : RefactorActionInfo ,
284
287
document : vscode . TextDocument ,
285
288
info : Proto . ApplicableRefactorInfo ,
286
289
rangeOrSelection : vscode . Range | vscode . Selection ,
287
290
allActions : readonly Proto . RefactorActionInfo [ ] ,
288
291
) {
289
292
const codeAction = new vscode . CodeAction ( action . description , TypeScriptRefactorProvider . getKind ( action ) ) ;
293
+
294
+ // https://github.com/microsoft/TypeScript/pull/37871
295
+ if ( action . error ) {
296
+ codeAction . disabled = { reason : action . error } ;
297
+ return codeAction ;
298
+ }
299
+
290
300
codeAction . command = {
291
301
title : action . description ,
292
302
command : ApplyRefactoringCommand . ID ,
You can’t perform that action at this time.
0 commit comments