Syntax highlighting for Yaml
Answered
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?
Please sign in to leave a comment.
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!