parent
f858b3223d
commit
beefaee1b6
|
@ -75,6 +75,14 @@ export class LightBulbWidget extends Disposable implements IContentWidget {
|
|||
private _gutterState: LightBulbState.State = LightBulbState.Hidden;
|
||||
private _iconClasses: string[] = [];
|
||||
|
||||
private readonly lightbulbClasses = [
|
||||
'codicon-' + GUTTER_LIGHTBULB_ICON.id,
|
||||
'codicon-' + GUTTER_LIGHTBULB_AIFIX_AUTO_FIX_ICON.id,
|
||||
'codicon-' + GUTTER_LIGHTBULB_AUTO_FIX_ICON.id,
|
||||
'codicon-' + GUTTER_LIGHTBULB_AIFIX_ICON.id,
|
||||
'codicon-' + GUTTER_SPARKLE_FILLED_ICON.id
|
||||
];
|
||||
|
||||
private _preferredKbLabel?: string;
|
||||
private _quickFixKbLabel?: string;
|
||||
|
||||
|
@ -148,15 +156,8 @@ export class LightBulbWidget extends Disposable implements IContentWidget {
|
|||
}));
|
||||
|
||||
this._register(this._editor.onMouseDown(async (e: IEditorMouseEvent) => {
|
||||
const lightbulbClasses = [
|
||||
'codicon-' + GUTTER_LIGHTBULB_ICON.id,
|
||||
'codicon-' + GUTTER_LIGHTBULB_AIFIX_AUTO_FIX_ICON.id,
|
||||
'codicon-' + GUTTER_LIGHTBULB_AUTO_FIX_ICON.id,
|
||||
'codicon-' + GUTTER_LIGHTBULB_AIFIX_ICON.id,
|
||||
'codicon-' + GUTTER_SPARKLE_FILLED_ICON.id
|
||||
];
|
||||
|
||||
if (!e.target.element || !lightbulbClasses.some(cls => e.target.element && e.target.element.classList.contains(cls))) {
|
||||
if (!e.target.element || !this.lightbulbClasses.some(cls => e.target.element && e.target.element.classList.contains(cls))) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -247,7 +248,9 @@ export class LightBulbWidget extends Disposable implements IContentWidget {
|
|||
let hasDecoration = false;
|
||||
if (currLineDecorations) {
|
||||
for (const decoration of currLineDecorations) {
|
||||
if (decoration.options.glyphMarginClassName) {
|
||||
const glyphClass = decoration.options.glyphMarginClassName;
|
||||
|
||||
if (glyphClass && !this.lightbulbClasses.some(className => glyphClass.includes(className))) {
|
||||
hasDecoration = true;
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue