提交 98d5a9d4 编写于 作者: J Johannes Rieken

prepare for different icon when showing light bulb for warning/error than for a word, #16911

上级 6b4611f2
......@@ -8,6 +8,8 @@
display: flex;
align-items: center;
justify-content: center;
height: 16px;
width: 16px;
}
.monaco-editor .lightbulb-glyph:hover {
......@@ -16,12 +18,18 @@
.monaco-editor.vs .lightbulb-glyph {
background: url('lightbulb.svg') center center no-repeat;
height: 16px;
width: 16px;
}
.monaco-editor.vs-dark .lightbulb-glyph, .monaco-editor.hc-black .lightbulb-glyph {
.monaco-editor.vs .lightbulb-glyph[data-severity="high"]{
background: url('lightbulb.svg') center center no-repeat;
}
.monaco-editor.vs-dark .lightbulb-glyph,
.monaco-editor.hc-black .lightbulb-glyph {
background: url('lightbulb-dark.svg') center center no-repeat;
}
.monaco-editor.vs-dark .lightbulb-glyph[data-severity="high"],
.monaco-editor.hc-black .lightbulb-glyph[data-severity="high"] {
background: url('lightbulb-dark.svg') center center no-repeat;
height: 16px;
width: 16px;
}
......@@ -7,6 +7,7 @@
import 'vs/css!./lightBulbWidget';
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
import Event, { Emitter, any } from 'vs/base/common/event';
import Severity from 'vs/base/common/severity';
import * as dom from 'vs/base/browser/dom';
import { ICodeEditor, IOverlayWidget, IOverlayWidgetPosition } from 'vs/editor/browser/editorBrowser';
import { QuickFixComputeEvent } from 'vs/editor/contrib/quickFix/common/quickFixModel';
......@@ -86,7 +87,7 @@ export class LightBulbWidget implements IOverlayWidget, IDisposable {
const modelNow = this._model;
e.fixes.done(fixes => {
if (modelNow === this._model && fixes && fixes.length > 0) {
this.show(e.range.startLineNumber);
this.show(e);
} else {
this.hide();
}
......@@ -99,7 +100,8 @@ export class LightBulbWidget implements IOverlayWidget, IDisposable {
return this._model;
}
show(line: number): void {
show(e: QuickFixComputeEvent): void {
const line = e.range.startLineNumber;
if (!this._hasSpaceInGlyphMargin(line)) {
return;
}
......@@ -107,6 +109,7 @@ export class LightBulbWidget implements IOverlayWidget, IDisposable {
this._line = line;
this._visible = true;
this._layout();
this._domNode.dataset['severity'] = e.severity >= Severity.Warning ? 'high' : '';
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册