@@ -2,7 +2,7 @@ import * as vscode from "vscode";
22
33import { AtelierAPI } from "../api/index" ;
44import { ClassDefinition } from "../utils/classDefinition" ;
5- import { currentFile , onlyUnique } from "../utils/index" ;
5+ import { currentFile , onlyUnique , notNull } from "../utils/index" ;
66import commands = require( "./completion/commands.json" ) ;
77import structuredSystemVariables = require( "./completion/structuredSystemVariables.json" ) ;
88import 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