Syntax highlighting for Yaml
已回答
I am in process of writing a plugin for yaml. I am using IntelliJ bundled yaml parser, so far everything has worked fine. However with syntax highlighting, I followed the guide from official docs (creating SyntaxHighlighterFactory and SyntaxHighlighter for yaml language with YamlFlexParser). However these classes don't instantiate at all. Is there a way to extend highlighting for existing languages?
请先登录再写评论。
What exactly are you trying to achieve in your plugin? Extending the builtin YAML plugin from IntelliJ? What exactly to you want to customize?
I want to highlight certain YamlSequenceItem based on the parent YamlKeyValue's text. I want to use YAML plugin as it is while I can, and modify the syntax highlighter.
You can use Annotator to provide additional semantic highlighting https://plugins.jetbrains.com/docs/intellij/syntax-highlighting-and-error-highlighting.html#annotator
That looks promising with custom text attributes, I will give it a shot and come back to you if I still face issues. Thank you!