Vscode: OnClick event on Gutter

Created on 18 Apr 2016  路  11Comments  路  Source: microsoft/vscode

How could I handle OnClick events on _Gutter_, similar to how _breakpoints_ does?

The intention was to connect it with a _decorator_ (previously created with vscode.window.createTextEditorDecorationType) so the user should _Click_ on the Gutter and create/destroy the decorator assigned to the line where the user clicked.

Thanks in advance

api editor feature-request

Most helpful comment

This would be really useful. Any information about if this will happen? I'm making an extension where I want to click on a gutter icon that my extension creates and run a command and/or show a drop down menu.

All 11 comments

Cross refs;
1.This, Right click in vscode edge, mentioned: "visual studio code - Add right click menu item inside gutter of vscode" - Stack Overflow ; ; https://stackoverflow.com/questions/41821174/add-right-click-menu-item-inside-gutter-of-vscode
2.Right click on file in Opsys ;
Add shortcut for file right click context menu. #15939
3.Right click in editor:
Custom menu entires, context menu entries, and action bar items #3192
3.1.Within the bgse/relative-path-and-line extension , their first request;
Feature Request: add actions to context menu #1
4.Click in Menu Bar of editor; this appears to be the item merged as a result of [3]
menu bar extensions #7704

@AnneTheAgile just for clarification: the origin of this feature request wasn't the possibility to expose a whole context menu, this is already working some pixels to the right of the gutter. So the user has a very similar possibility already.
The origin was here: https://github.com/alefragnani/vscode-bookmarks/issues/24
It is just about the mentioned decorator. It is about a single left-click feature like toggling a breakpoint.

There now is an onclick event on the gutter, when editing settings.json.

It doesn't seem exposed through the API though.

Capture du 2020-02-07 12-24-41

This would be really useful. Any information about if this will happen? I'm making an extension where I want to click on a gutter icon that my extension creates and run a command and/or show a drop down menu.

I started working on an extension assuming this was already exposed and now I am stuck.

I got misled by breakpoint and the edit icon appearing in the gutter of settings page.

@sudhagar10 can you check this https://marketplace.visualstudio.com/items?itemName=ryanluker.vscode-coverage-gutters

Thanks @chakraborty-slx. Took a look at it.

I was able to place icons in gutter. But click event there is not exposed and that is where I am stuck.

onHover would be useful too. For example in AREPL it would be cool if the user could hover over the error icon in the gutter to see the full exception message.

(commenting on this issue instead of a new one because I'm assuming it would be easy to add a onHover event along with onClick)

Hey guys, perhaps Codelens could be used as an alternative way to implement our requirements

Has anyone begun working on this?

It would be a nice feature to have!

Was this page helpful?
0 / 5 - 0 ratings