@@ -2,7 +2,7 @@ import * as vscode from "vscode";
2
2
3
3
import { AtelierAPI } from "../api/index" ;
4
4
import { ClassDefinition } from "../utils/classDefinition" ;
5
- import { currentFile , onlyUnique } from "../utils/index" ;
5
+ import { currentFile , onlyUnique , notNull } from "../utils/index" ;
6
6
import commands = require( "./completion/commands.json" ) ;
7
7
import structuredSystemVariables = require( "./completion/structuredSystemVariables.json" ) ;
8
8
import systemFunctions = require( "./completion/systemFunctions.json" ) ;
@@ -40,17 +40,19 @@ export class ObjectScriptCompletionItemProvider implements vscode.CompletionItem
40
40
) ;
41
41
}
42
42
}
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 ) ;
52
54
53
- return completions ;
55
+ return Promise . all ( completions ) . then ( ( data ) => data . flatMap ( ( el ) => el . items || el ) ) ;
54
56
}
55
57
56
58
public macro (
0 commit comments