简体   繁体   中英

How to add custom tag and attributes for code completions in html language of monaco editor?

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 '<'

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM