装饰线下方

huangapple go评论66阅读模式
英文:

Decoration below line

问题

I want to make an extension that shows error in a similar way to the 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?

英文:

I want to make an extension that shows error in a similar way to the 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?

答案1

得分: 0

对于该UI,目前没有可用的API。装饰器不会创建您所需的“虚拟行”,而是会出现在接下来的行之上。

VS Code本身有https://code.visualstudio.com/Docs/editor/editingevolved#_reference-information,这提供了一种“有点像”的虚拟行,但位于该行的上方。有了这样的功能,我想这是一个不错的开始。

还有https://code.visualstudio.com/Docs/editor/editingevolved#_errors-warnings,但它只会显示一个当前打开的,而不像装饰器那样显示多个。

此外,还有这个功能请求https://github.com/microsoft/vscode/issues/3220,它要求自定义的查看。

如果这些方法都不适用于您,建议您在VS Code存储库中提出功能请求。

希望这有所帮助。

英文:

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

huangapple
  • 本文由 发表于 2023年4月4日 10:11:33
  • 转载请务必保留本文链接:https://go.coder-hub.com/75925007.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定