Skip to content

How to implement autocompletion? #1620

Answered by cdietrich
boxer-code asked this question in Q&A
Discussion options

You must be logged in to vote
export class HelloWorldCompletionProvider extends DefaultCompletionProvider {

    protected override  async  completionFor(context: CompletionContext, next: NextFeature, acceptor: CompletionAcceptor): Promise<void> {
        await super.completionFor(context, next, acceptor);
        if (next.property === "simulator" && context.node?.$type === "FlexModel") {
            acceptor(context, {
                label: "fssim",
                kind: CompletionItemKind.Value,
            })
        }
    }

}

Replies: 2 comments 11 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
11 replies
@cdietrich
Comment options

Answer selected by boxer-code
@boxer-code
Comment options

@msujew
Comment options

@boxer-code
Comment options

@cdietrich
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants