I need to provide a list of web components in the code completions of the monaco editor, I tried writing snippets but those snippets are not getting triggered if i start with '<'
Asked
Active
Viewed 1,146 times
1 Answers
1
I am not sure if there is a ready-to-use solution, I've tried to approach "the hard way" by using XSD (a schema file for defining the syntax and then parsing it). Unfortunately for XML completion the schema direct support is not there as far as I know (please correct me if I am wrong). So puzzled with the same question I've start with custom auto-completion provider.
Here is an article that helped me a lot. https://mono.software/2017/04/11/custom-intellisense-with-monaco-editor/
This is the matching repository: https://github.com/isimic413/monaco-editor-custom-intellisense/tree/master/sample-editor
Please note that it's not updated to the latest version of the API; you may need to make some code corrections to make it work.

Nikolay
- 10,752
- 2
- 23
- 51
-
Upvoted because there is a good point of start, however, repo example isn't working :( – Maciej Pulikowski Jul 12 '20 at 10:05
-
Works only for monaco-editor 0.14.3. Today version - 0.20.0 – Maciej Pulikowski Jul 12 '20 at 10:40
-
Since 0.15.0: "CompletionItemProvider.provideCompletionItems and CompletionItemProvider.resolveCompletionItem have been modified to better reflect the API of VS Code. Both arguments and return type have changed." – Maciej Pulikowski Jul 12 '20 at 10:45