how use color picker in custom language plugin?

How can I enable and customize the "color picker" / "color changer" on the editor gutter and auto completion in my custom language plugin to get a functionality which is described here:
The language[1] I am working on has keywords like COLOR, BACKGROUNDCOLOR, OUTLINECOLOR, and so on followed by R-G-B values or a Hex-String.
Thanks for any hint!
Comment actions Permalink

Hi Daniel, for most cases it's enough to implement ColorChooserService. Please try something like this:


<applicationService serviceInterface="com.intellij.ui.ColorChooserService"
serviceImplementation="com.your.implementation.ChooserService" overrides="true"/>

Comment actions Permalink

Thanks for the hint.

Having a serviceImplementation in place like has no effect unfortunately.

In debug-mode no breakpoint gets catch. It seems that a linking to an AstNode / PsiElement is missing.

Whats wrong here?

Comment actions Permalink

> has no effect unfortunately.

What effect? Sorry, I think I don't understand what you're trying to achieve.

Please describe what exactly you want to implement.

Comment actions Permalink

If you want just show an icon on the gutter, then the easiest way it to implement ElementColorProvider extension.

If for some reason it's not fit to your needs, you can implement either LineMarkerProvider (e.g. like ColorLineMarkerProvider) or Annotator and annotate needed elements with info annotation and your implementation of GutterIconRenderer.


Please sign in to leave a comment.