Skip to content

Commit

Permalink
fix #85007
Browse files Browse the repository at this point in the history
  • Loading branch information
jrieken committed Nov 18, 2019
1 parent 07743fd commit c63a8fa
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/vs/editor/contrib/codelens/codelensController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,16 @@ export class CodeLensContribution implements editorCommon.IEditorContribution {
}
}));
this._localToDispose.add(this._editor.onMouseUp(e => {
if (e.target.type === editorBrowser.MouseTargetType.CONTENT_WIDGET && e.target.element && e.target.element.tagName === 'A') {
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(e.target.element as HTMLLinkElement);
let command = lens.getCommand(target as HTMLLinkElement);
if (command) {
this._commandService.executeCommand(command.id, ...(command.arguments || [])).catch(err => this._notificationService.error(err));
break;
Expand Down

0 comments on commit c63a8fa

Please sign in to comment.