From c94be6c5b29eda76847a8fa85820738f78c25aaa Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 21 Feb 2017 14:29:42 -0800 Subject: [PATCH] Don't reject when we have no code actions --- extensions/typescript/src/features/codeActionProvider.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/extensions/typescript/src/features/codeActionProvider.ts b/extensions/typescript/src/features/codeActionProvider.ts index 8ea985625f7..92a5b342ec7 100644 --- a/extensions/typescript/src/features/codeActionProvider.ts +++ b/extensions/typescript/src/features/codeActionProvider.ts @@ -59,7 +59,7 @@ export default class TypeScriptCodeActionProvider implements CodeActionProvider return this.getSupportedCodeActions(context) .then(supportedActions => { if (!supportedActions.length) { - return Promise.reject('no actions'); + return []; } return this.client.execute('getCodeFixes', { file: file, @@ -68,9 +68,8 @@ export default class TypeScriptCodeActionProvider implements CodeActionProvider startOffset: range.start.character + 1, endOffset: range.end.character + 1, errorCodes: supportedActions - }, token); + }, token).then(response => response.body || []); }) - .then(response => response.body || []) .then(codeActions => codeActions.map(action => this.actionToEdit(source, action))); }