How to make the first three letters of a certain keyword bold in the code in the editor? For example, make "del" in "delete from table_a" bold

Answered

I want to develop a plugin. Implement bolding of del in the delete sql statement in the code editor. How should I implement it? SyntaxHighlighterBase?

0
3 comments

Hi,

Try implementing an com.intellij.lang.annotation.Annotator which will change the style of the text range you want to highlight.

See: https://plugins.jetbrains.com/docs/intellij/syntax-highlighting-and-error-highlighting.html#annotator

1

Karol Lewandowski Thank you for your reply. I tried to implement com.intellij.lang.annotation.Annotator, but I can only modify the color and highlight. How to bold letters?

0

In your schema file, use FONT_TYPE attribute:

<option name="MY_ATTRIBUTES">
    <value>
        ...
        <option name="FONT_TYPE" value="1"/>
    </value>
</option>

1 - bold

2 - italic

3 - italic bold

0

Please sign in to leave a comment.