Skip to content

fix intellisense, broken with the release (#225) #226

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 29, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions src/providers/ObjectScriptCompletionItemProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as vscode from "vscode";

import { AtelierAPI } from "../api/index";
import { ClassDefinition } from "../utils/classDefinition";
import { currentFile, onlyUnique } from "../utils/index";
import { currentFile, onlyUnique, notNull } from "../utils/index";
import commands = require("./completion/commands.json");
import structuredSystemVariables = require("./completion/structuredSystemVariables.json");
import systemFunctions = require("./completion/systemFunctions.json");
Expand Down Expand Up @@ -40,17 +40,19 @@ export class ObjectScriptCompletionItemProvider implements vscode.CompletionItem
);
}
}
const completions =
this.classes(document, position, token, context) ||
this.macrolist(document, position, token, context) ||
this.dollarsComplete(document, position) ||
this.commands(document, position) ||
this.entities(document, position, token, context) ||
this.macro(document, position, token, context) ||
this.constants(document, position, token, context) ||
null;
const completions = []
.concat(
this.classes(document, position, token, context),
this.macrolist(document, position, token, context),
this.dollarsComplete(document, position),
this.commands(document, position),
this.entities(document, position, token, context),
this.macro(document, position, token, context),
this.constants(document, position, token, context)
)
.filter(notNull);

return completions;
return Promise.all(completions).then((data) => data.flatMap((el) => el.items || el));
}

public macro(
Expand Down