File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
extensions/typescript-language-features/src/features Expand file tree Collapse file tree 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';
1919
2020const localize = nls . loadMessageBundle ( ) ;
2121
22+ interface RefactorActionInfo extends Proto . RefactorActionInfo {
23+ error ?: string
24+ }
2225
2326class ApplyRefactoringCommand implements Command {
2427 public static readonly ID = '_typescript.applyRefactoring' ;
@@ -280,13 +283,20 @@ class TypeScriptRefactorProvider implements vscode.CodeActionProvider {
280283 }
281284
282285 private refactorActionToCodeAction (
283- action : Proto . RefactorActionInfo ,
286+ action : RefactorActionInfo ,
284287 document : vscode . TextDocument ,
285288 info : Proto . ApplicableRefactorInfo ,
286289 rangeOrSelection : vscode . Range | vscode . Selection ,
287290 allActions : readonly Proto . RefactorActionInfo [ ] ,
288291 ) {
289292 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+
290300 codeAction . command = {
291301 title : action . description ,
292302 command : ApplyRefactoringCommand . ID ,
You can’t perform that action at this time.
0 commit comments