We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 80a7ed9 commit 4fc9831Copy full SHA for 4fc9831
src/services/codeFixProvider.ts
@@ -36,12 +36,19 @@ namespace ts {
36
37
export function getFixes(context: CodeFixContext): CodeAction[] {
38
const fixes = codeFixes[context.errorCode];
39
- let allActions: CodeAction[] = [];
+ const allActions: CodeAction[] = [];
40
41
forEach(fixes, f => {
42
const actions = f.getCodeActions(context);
43
if (actions && actions.length > 0) {
44
- allActions = allActions.concat(actions);
+ for (const action of actions) {
45
+ if (action === undefined) {
46
+ context.host.log(`Action for error code ${context.errorCode} added an invalid action entry; please log a bug`);
47
+ }
48
+ else {
49
+ allActions.push(action);
50
51
52
}
53
});
54
0 commit comments