Search code examples
visual-studio-codevscode-extensionsvscode-api

Decoration below line


I want to make an extension that shows error in a similar way to the lsp_lines:

lsp_lines

I looked the DecorationInstanceRenderOptions and only found before and after options, but I think that is no option to render below. Maybe there is a way the render using the after option, but breaking the line and display the content below the original line?


Solution

  • There is no API available for that UI. The decorators won’t create the virtual lines you have but instead, will be presented over the next lines.

    VS Code itself has https://code.visualstudio.com/Docs/editor/editingevolved#_reference-information, which presents kind of the same virtual line, but above the line. Having such feature available, I suppose, is a good start.

    There is also https://code.visualstudio.com/Docs/editor/editingevolved#_errors-warnings, but it is something that only displays one open at a given time, not many like decorators.

    And, there is this feature request https://github.com/microsoft/vscode/issues/3220, which asks for custom peeks.

    If none of this works for you, I suggest you to open a feature request in VS Code repo.

    Hope this helps