Adding additional content inside the editor window

Answered

I've seen some plugins that add additional elements inside the editor window like panels and buttons, where some code is rendered, the panel is rendered, and then the code continues. I can't find any references on how to do this, or what it's called?

0
9 comments

Hi Evan,

Please clarify what you mean. A screenshot will be great.

0

Hey,

 

The BitBucket Pull Requests plugin does a similar panel:

0

Thanks, I'll have a look.

0

The docs recommend using the provider from the `declarative` package - are there any docs for that one, or samples?

0

Unfortunately, there is no documented example (we will update the docs to cover the new interface). I suggest checking the existing implementations in the platform sources, e.g.:
https://github.com/JetBrains/intellij-community/blob/master/java/java-impl/src/com/intellij/codeInsight/hints/JavaMethodChainsDeclarativeInlayProvider.kt

Also, you can search for "declarativeInlayProvider" on IntelliJ Platform Explorer: https://jb.gg/ipe.

0

Could you give a sample of how to add a block element? The older syntax had  sink.addBlockElement, but the new one just has addPresentation and the InlayPosition only seems to have end of line and inline, it's not clear how to make a new one.

0

Hi Evan,

I’m sorry for the delayed reply. I’ve got information that declarative InlayHintsProvider doesn’t and most likely will not support block inlays.

The alternative for block inlays is com.intellij.codeInsight.hints.codeVision.DaemonBoundCodeVisionProvider or com.intellij.codeInsight.codeVision.CodeVisionProvider. It is not documented yet, so please check the existing implementations in the intelli-community source code or on IntelliJ Platform Explorer.

0

Thanks, I'll have a look.

0

Please sign in to leave a comment.