Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS Code Extension: Click event on decoration

Is it possible to register a click event on decorations?

I am rendering an icon on the gutter like this. Is there a way to get click event on what is being rendered on the gutter?

const decoration = vscode.window.createTextEditorDecorationType({
    gutterIconPath: vscode.Uri.file('path/to/icon.svg'),
});

const editor = vscode.window.activeTextEditor;

editor.setDecorations(decoration, [new vscode.Range(
    new vscode.Position(1, 0),
    new vscode.Position(1, 0)
)]);
like image 369
dq-charlie Avatar asked Nov 07 '22 20:11

dq-charlie


1 Answers

VSCode has the capability but does not offer a API for click events on gutter decorations currently. If you would like such an API vote up https://github.com/microsoft/vscode/issues/5455

like image 90
Almenon Avatar answered Dec 07 '22 03:12

Almenon