Codemirror 6 autocomplete for Groovy

Hi, I am currently trying to enrich code editor experience in our application using angular. I am trying implement autocomplete feature what the user would like to type. Has this been done before with Codemirror 6 for Groovy, and if not, are there any alternatives to this method?
I have been stuck on this for a few days, so any help would be greatly appreciated. Thanks!


If you just want a static list of completions, completeFromList should be able to get you that. Something context-dependent doesn’t exist yet.

How can I do this.

  1. Only static list. How to do this.
    2.Along with static list, the words from editor should be displayed. How can I achieve this.

A small example. Your help would be greatly appreciated. Thanks.

Try the docs.