@@ -19,7 +19,7 @@ import {
1919 workspace
2020} from "vscode" ;
2121
22- export type Completion = {
22+ export type Selector = {
2323 ids : Map < string , CompletionItem > ,
2424 classes : Map < string , CompletionItem >
2525} ;
@@ -197,7 +197,7 @@ export class SelectorCompletionItemProvider implements CompletionItemProvider, D
197197 }
198198 }
199199
200- async findAll ( document : TextDocument ) : Promise < Completion > {
200+ async findAll ( document : TextDocument ) : Promise < Selector > {
201201 const keys = new Set < string > ( ) ;
202202 const uri = document . uri ;
203203 const text = document . getText ( ) ;
@@ -218,7 +218,7 @@ export class SelectorCompletionItemProvider implements CompletionItemProvider, D
218218 }
219219
220220 async validate ( document : TextDocument ) : Promise < Diagnostic [ ] > {
221- const completion = await this . findAll ( document ) ;
221+ const selector = await this . findAll ( document ) ;
222222 const text = document . getText ( ) ;
223223 const diagnostics : Diagnostic [ ] = [ ] ;
224224 const findAttribute = / ( i d | c l a s s | c l a s s N a m e ) \s * = \s * ( " | ' ) ( .* ?) \2/ gsi;
@@ -240,13 +240,13 @@ export class SelectorCompletionItemProvider implements CompletionItemProvider, D
240240 const start = document . positionAt ( anchor - value [ 1 ] . length ) ;
241241
242242 if ( attribute [ 1 ] === "id" ) {
243- if ( ! completion . ids . has ( value [ 1 ] ) ) {
243+ if ( ! selector . ids . has ( value [ 1 ] ) ) {
244244 diagnostics . push ( new Diagnostic ( new Range ( start , end ) ,
245245 `CSS id selector '${ value [ 1 ] } ' not found.` ,
246246 DiagnosticSeverity . Information ) ) ;
247247 }
248248 } else {
249- if ( ! completion . classes . has ( value [ 1 ] ) ) {
249+ if ( ! selector . classes . has ( value [ 1 ] ) ) {
250250 diagnostics . push ( new Diagnostic ( new Range ( start , end ) ,
251251 `CSS class selector '${ value [ 1 ] } ' not found.` ,
252252 DiagnosticSeverity . Information ) ) ;
@@ -270,10 +270,10 @@ export class SelectorCompletionItemProvider implements CompletionItemProvider, D
270270 const canComplete = this . canComplete . exec ( text ) ;
271271
272272 if ( canComplete ) {
273- this . findAll ( document ) . then ( completion => resolve ( [
274- ...( canComplete [ 1 ] === "id"
275- ? completion . ids
276- : completion . classes ) . values ( ) ] ) ) ;
273+ this . findAll ( document ) . then ( selector => resolve (
274+ [ ...( canComplete [ 1 ] === "id"
275+ ? selector . ids
276+ : selector . classes ) . values ( ) ] ) ) ;
277277 } else {
278278 reject ( ) ;
279279 }
0 commit comments