How to display inline values in the editor?
Answered
I'm implementing a custom debugger for a custom language and during the debug session I would like to display inline values in the editor, in a same way java debugger displays values in grey italic style. I found this post: https://intellij-support.jetbrains.com/hc/en-us/community/posts/360002834320-How-to-achieve-inline-values-similar-to-debugger-?input_string=How%20to%20display%20inline%20values%20in%20the%20editor%3F but I can't quite understand how to pass the values to the EditorLinePainter from the debugger code. Are there any more comprehensive examples?
Please sign in to leave a comment.
How do you implement debugger in your plugin? If you use XDebugger API from IntelliJ Platform, it will create corresponding Inlays (https://plugins.jetbrains.com/docs/intellij/inlay-hints.html) automatically, see
com.intellij.xdebugger.impl.inline.XDebuggerInlayUtil
Aha, thanks, Yann, I figured out why the default functionality was not invoked, I had a bug in my
computeSourcePosition()
implementation, it works now! The only issue is that when I click on the inlay, instead of a name it saysvalueName
. Inline it does display name correctly, so I'm not sure where to look for it.On a side note, I don't mean to be too demanding, but I think that the Compiler and Debugger sections of your Platform SDK documentation are way overdue :)
Nm, figured it out, apparently I had to extend
XNamedValue
instead ofXValue
, that is sorted out, thank you again for the help!