Skip to content

Commit

Permalink
Code Lens using Octicon cannot be triggered microsoft#85007
Browse files Browse the repository at this point in the history
  • Loading branch information
vyu113 committed Dec 8, 2019
1 parent 5c8acf3 commit ee06cf5
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions src/vs/editor/contrib/codelens/codelensController.ts
Expand Up @@ -223,15 +223,22 @@ export class CodeLensContribution implements editorCommon.IEditorContribution {
}
}));
this._localToDispose.add(this._editor.onMouseUp(e => {

for (const lens of this._lenses) {
let command = lens.getCommand(target as HTMLLinkElement);
if (command) {
this._commandService.executeCommand(command.id, ...(command.arguments || [])).catch(err => this._notificationService.error(err));
break;
if (e.target.type !== editorBrowser.MouseTargetType.CONTENT_WIDGET) {
return;
}
let target = e.target.element;
if (target?.tagName === 'SPAN') {
target = target.parentElement;
}
if (target?.tagName === 'A') {
for (const lens of this._lenses) {
let command = lens.getCommand(target as HTMLLinkElement);
if (command) {
this._commandService.executeCommand(command.id, ...(command.arguments || [])).catch(err => this._notificationService.error(err));
break;
}
}
}

}));
scheduler.schedule();
}
Expand Down

0 comments on commit ee06cf5

Please sign in to comment.