add dynamic annotation, how to ?

Answered

Hi

I'm creating a custom language plugin and I'd like to automatically add computed annotations to functions. You can see an example of what I want to do in this screenshot:

Or when we debug, we get the values at the end of the line

How can I do this ? which classes should I use ?

Is it possible to add this kind of annotation on a line above the function declaration ? ie: the line numbers will be impacted.

thanks

7 comments
Comment actions Permalink
Official comment

See com.intellij.codeInsight.hints.InlayParameterHintsProvider. Please note that this API is marked experimental and might change in backwards incompatible way.

Comment actions Permalink

Thanks, I will look at it

0
Comment actions Permalink

I'm impressed, it's so easy to use.

But unfortunately maybe it's not exactly what I want. I'd like to know what API to use to display inline text like in the following screen (when you debug), and if it's possible to display it above the line and not just at the end:

Thanks

0
Comment actions Permalink

See more com.intellij.openapi.editor.InlayModel, debugger sample is com.intellij.xdebugger.impl.XDebuggerInlayUtil

0
Comment actions Permalink

Actually, I think that second example is the com.intellij.openapi.editor.EditorLinePainter extension.

0
Comment actions Permalink

Thanks for the pointers

0
Comment actions Permalink

Tried EditorLinePainter, but if I understand correctly it only adds information at the end of the line.

Is there a solution to do the same thing but display the additional info above the current line ?

0

Please sign in to leave a comment.