Skip to content

Commit 3c41b49

Browse files
Merge pull request #226 from intersystems-community/fix-intellisense
fix intellisense, broken with the release (#225)
2 parents 3e12f77 + 8b0a300 commit 3c41b49

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

src/providers/ObjectScriptCompletionItemProvider.ts

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as vscode from "vscode";
22

33
import { AtelierAPI } from "../api/index";
44
import { ClassDefinition } from "../utils/classDefinition";
5-
import { currentFile, onlyUnique } from "../utils/index";
5+
import { currentFile, onlyUnique, notNull } from "../utils/index";
66
import commands = require("./completion/commands.json");
77
import structuredSystemVariables = require("./completion/structuredSystemVariables.json");
88
import systemFunctions = require("./completion/systemFunctions.json");
@@ -40,17 +40,19 @@ export class ObjectScriptCompletionItemProvider implements vscode.CompletionItem
4040
);
4141
}
4242
}
43-
const completions =
44-
this.classes(document, position, token, context) ||
45-
this.macrolist(document, position, token, context) ||
46-
this.dollarsComplete(document, position) ||
47-
this.commands(document, position) ||
48-
this.entities(document, position, token, context) ||
49-
this.macro(document, position, token, context) ||
50-
this.constants(document, position, token, context) ||
51-
null;
43+
const completions = []
44+
.concat(
45+
this.classes(document, position, token, context),
46+
this.macrolist(document, position, token, context),
47+
this.dollarsComplete(document, position),
48+
this.commands(document, position),
49+
this.entities(document, position, token, context),
50+
this.macro(document, position, token, context),
51+
this.constants(document, position, token, context)
52+
)
53+
.filter(notNull);
5254

53-
return completions;
55+
return Promise.all(completions).then((data) => data.flatMap((el) => el.items || el));
5456
}
5557

5658
public macro(

0 commit comments

Comments
 (0)