Is there any way to highlight words of Code Style setting example file?
已回答
I'm now working on a custom language plugin. My highlighting annotator works fine except for my Code Style setting example file.
Not like the Color Scheme setting example file, I can't assign TextAttributesKey with html tag neither(e.g. <keyword>MyWord</keyword>).
Is there any way that I could use highlighting annotator in my custom LanguageCodeStyleSettingsProvider to highlight the example file?
请先登录再写评论。
Do you provide corresponding mapping from tag names to TextAttributesKey in com.intellij.openapi.options.colors.ColorSettingsPage#getAdditionalHighlightingTagToDescriptorMap?
Thanks Yann
com.intellij.openapi.options.colors.ColorSettingsPage#getAdditionalHighlightingTagToDescriptorMap works fine in my plugin. But the question is that I can't find a similar way to highlight words of Code Style Settings (not Color Scheme setting). I was wondering is there any existed way to highlight words of Code Style setting example file?
Thanks anyway :)
Looking at the Kotlin code style, some of the keywords ('public', 'private', 'catch', 'finally', etc.) in the example files are not highlighted correctly either.
This would be useful for my XQuery plugin, as keywords can be used as identifiers, in addition to have statically-known highlighting (i.e. not dependent on the index or external files). I've taken the approach of defaulting to keyword highlighting and erasing that in the annotator.
Oh sorry, I completely misread.
There is some way via providing a dedicated EditorHighlighter from com.intellij.application.options.CodeStyleAbstractPanel#createHighlighter, possibly using LayeredLexerEditorHighlighter.
That's very helpful. Thanks so much.