additionalTextAttributes marked with @ApiStatus.Internal, how to provide additional colors to color schemes?

Answered

I am customizing the colors for the keywords of a custom language, but when I try to use additionalTextAttributes to add a new TextAttributesKey according to the documentation, I find that it is marked with @ApiStatus.Internal.

How should I add a new TextAttributesKey and provide additional colors to color schemes?

0
5 comments

Hi,

Could you please clarify what the problem is?

Only the extension point bean is internal, which shouldn't affect its usage.

0

Hi,

In my plugin.xml file, the tag for the additionalTextAttributes label shows a tilde prompt, indicating that this is an Internal API, although it does not affect the functionality implementation. I know that Internal APIs should not be used, but the official documentation guides me to use this label, and I cannot find a suitable alternative to achieve the same functionality.

What I really want to know is whether this label is available. If it is not available, what should be used as a substitute? If it is available, is the tilde prompt misleading and does it need correction?

0

To add additional colors to color schemes, you can extend the existing color scheme by implementing the EditorColorsScheme interface or using a custom TextAttributesKey. Define your custom colors in the plugin's XML and register them in plugin.xml. Since @ApiStatus.Internal elements aren't intended for public use, avoid relying on them for production code. Instead, use the officially supported APIs for customization.

0

Hi,

I can't reproduce this.

Could you please share your sources to reproduce it and provide information about the IDE you use for developing the plugin?

0

Please sign in to leave a comment.