Skip to content

Commit 3decfc9

Browse files
committed
fix: multiple css lint warnings should all list on hover
1 parent 69b8071 commit 3decfc9

File tree

4 files changed

+22
-22
lines changed

4 files changed

+22
-22
lines changed

src/editor/EditorManager.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -825,4 +825,5 @@ define(function (require, exports, module) {
825825
exports.focusEditor = focusEditor;
826826
exports.getCurrentlyViewedPath = getCurrentlyViewedPath;
827827
exports.setEditorHolder = setEditorHolder;
828+
window.ed = exports;
828829
});

src/language/CodeInspection.js

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -394,21 +394,7 @@ define(function (require, exports, module) {
394394
console.warn("CodeInspector: Invalid error position: ", error);
395395
return false;
396396
}
397-
// now we only apply a style if there is not already a higher priority style applied to it.
398-
// Ie. If an error style is applied, we don't apply an info style over it as error takes precedence.
399-
let markings = editor.findMarksAt(error.pos, CODE_MARK_TYPE_INSPECTOR);
400-
let MarkToApplyPriority = _getMarkTypePriority(error.type);
401-
let shouldMark = true;
402-
for(let mark of markings){
403-
let markTypePriority = _getMarkTypePriority(mark.type);
404-
if(markTypePriority<=MarkToApplyPriority){
405-
mark.clear();
406-
} else {
407-
// there's something with a higher priority marking the token
408-
shouldMark = false;
409-
}
410-
}
411-
return shouldMark;
397+
return true;
412398
}
413399

414400
/**
@@ -498,7 +484,7 @@ define(function (require, exports, module) {
498484
let codeInspectionMarks = editor.findMarksAt(pos, CODE_MARK_TYPE_INSPECTOR) || [];
499485
let hoverMessage = '';
500486
for(let mark of codeInspectionMarks){
501-
hoverMessage = `${hoverMessage}${mark.message}\n`;
487+
hoverMessage = `${hoverMessage}${mark.message}<br/>`;
502488
}
503489
if(hoverMessage){
504490
resolve({

src/styles/brackets.less

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,10 @@ html, body {
125125
}
126126
}
127127

128+
.code-inspection-item {
129+
text-align: left;
130+
}
131+
128132
.editor-text-fragment-hover{
129133
text-decoration-style: solid;
130134
text-decoration-line: underline;
@@ -151,13 +155,17 @@ html, body {
151155
border-right: 2px @bc-primary-btn-border solid;
152156
}
153157

154-
.editor-text-fragment-error{
158+
// error class has highest visual precedence, followed by warning, spell error and info.
159+
// .error.error: This selector has 4x the class name, which increases its specificity compared to single class
160+
// selectors like .warning or .info. Even if error, warning, and info are used on the same div in any order,
161+
// the style for .error.error will take precedence due to its higher specificity.
162+
.editor-text-fragment-error.editor-text-fragment-error.editor-text-fragment-error.editor-text-fragment-error{
155163
border-bottom:2px dotted @error-underline-text;
156164
display: inline-block;
157165
position: relative;
158166
}
159167

160-
.editor-text-fragment-error:after{
168+
.editor-text-fragment-error.editor-text-fragment-error.editor-text-fragment-error.editor-text-fragment-error:after{
161169
content: '';
162170
width: 100%;
163171
border-bottom:2px dotted @error-underline-text;
@@ -167,13 +175,13 @@ html, body {
167175
left: 2px;
168176
}
169177

170-
.editor-text-fragment-warn{
178+
.editor-text-fragment-warn.editor-text-fragment-warn.editor-text-fragment-warn{
171179
border-bottom:2px dotted @warn-underline-text;
172180
display: inline-block;
173181
position: relative;
174182
}
175183

176-
.editor-text-fragment-warn:after{
184+
.editor-text-fragment-warn.editor-text-fragment-warn.editor-text-fragment-warn:after{
177185
content: '';
178186
width: 100%;
179187
border-bottom:2px dotted @warn-underline-text;
@@ -199,13 +207,13 @@ html, body {
199207
left: 2px;
200208
}
201209

202-
.editor-text-fragment-spell-error{
210+
.editor-text-fragment-spell-error.editor-text-fragment-spell-error{
203211
border-bottom:2px dotted @spell-underline-text;
204212
display: inline-block;
205213
position: relative;
206214
}
207215

208-
.editor-text-fragment-spell-error:after{
216+
.editor-text-fragment-spell-error.editor-text-fragment-spell-error:after{
209217
content: '';
210218
width: 100%;
211219
border-bottom:2px dotted @spell-underline-text;

test/spec/Extn-CSSCodeHints-integ-test.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,11 @@ define(function (require, exports, module) {
144144
await checkCSSWarningAtPos("@font-face rule must define 'src' and 'font-family' properties (fontFaceProperties)",
145145
39, 8);
146146
});
147+
148+
it("Should show unknown vendor prefix warning", async function () {
149+
await checkCSSWarningAtPos("Unknown vendor specific property. (unknownVendorSpecificProperties)Also define the standard property 'border-radius' for compatibility (vendorPrefix)",
150+
43, 8);
151+
});
147152
});
148153

149154
});

0 commit comments

Comments
 (0)