Skip to content

Commit 9999312

Browse files
committed
Fixes
1 parent f75f065 commit 9999312

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

src/completion.ts

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -254,18 +254,10 @@ export class SelectorCompletionItemProvider implements CompletionItemProvider, D
254254
const end = document.positionAt(anchor);
255255
const start = document.positionAt(anchor - value[1].length);
256256

257-
if (attribute[1] === "id") {
258-
if (!context.ids.has(value[1])) {
259-
diagnostics.push(new Diagnostic(new Range(start, end),
260-
`CSS id selector '${value[1]}' not found.`,
261-
DiagnosticSeverity.Information));
262-
}
263-
} else {
264-
if (!context.classes.has(value[1])) {
265-
diagnostics.push(new Diagnostic(new Range(start, end),
266-
`CSS class selector '${value[1]}' not found.`,
267-
DiagnosticSeverity.Information));
268-
}
257+
if (!(attribute[1] === "id" ? context.ids : context.classes).has(value[1])) {
258+
diagnostics.push(new Diagnostic(new Range(start, end),
259+
`CSS selector '${value[1]}' not found.`,
260+
DiagnosticSeverity.Information));
269261
}
270262
}
271263
}

0 commit comments

Comments
 (0)