scalameta / metals-feature-requests

Issue tracker for Metals feature requests
37 stars 4 forks source link

Add gutter icons indicators #255

Open kpodsiad opened 2 years ago

kpodsiad commented 2 years ago

Is your feature request related to a problem? Please describe.

When browsing source code it's great to have such indicators available in UI, having them helps with understanding code. gutter icons are helpful for:

Describe the solution you'd like

IntelliJ Idea does a wonderful job when it comes to gutter icons, Metals & vscode can aim to achieve a comparable level of support.

From vscode perspective there is a extension sample which uses TextEditor.setDecorations and vscode.window.createTextEditorDecorationType APIs. There is type called DecorationRenderOptions which have gutterIconPath and https://github.com/microsoft/vscode-extension-samples/tree/main/decorator-sample.

Unfortunately from what I see, although it is possible to create a gutter icon, the click action on it isn't exposed in vscode's API https://github.com/microsoft/vscode/issues/5455, it's used internally in https://github.com/microsoft/vscode/issues/5455#issuecomment-583404130 or https://github.com/microsoft/vscode/issues/5455#issuecomment-911687604

Describe alternatives you've considered

Overridden functions for instance are handled using code lenses. However, code lenses introduce a bit of noise in text editor since they are displayed in a new line.the

Additional contex

No response

Search terms

vscode gutter icons

niander commented 11 months ago

It seems VSCode has added support for creating action on gutter icons: https://github.com/microsoft/vscode/issues/175945

tgodzik commented 11 months ago

Looks like this could work, though it's not super easy. Would be awesome if there would be a way to convert them automatically from code lenses.