提交 c94be6c5 编写于 作者: M Matt Bierner

Don't reject when we have no code actions

上级 02006fe9
......@@ -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)));
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册