@@ -17,12 +17,11 @@ import {
1717 Uri
1818} from "vscode" ;
1919
20- export const NONE = "__!NONE!__" ;
21-
2220export class ClassCompletionItemProvider implements CompletionItemProvider {
2321
2422 readonly start = new Position ( 0 , 0 ) ;
2523 readonly cache = new Map < string , Map < string , CompletionItem > > ( ) ;
24+ readonly none = "__!NONE!__" ;
2625 readonly isRemote = / ^ h t t p s ? : \/ \/ / i;
2726 readonly canComplete = / c l a s s \s * = \s * ( [ " ' ] ) (?: (? ! \1) .) * $ / si;
2827 readonly findLinkRel = / r e l \s * = \s * ( [ " ' ] ) ( (?: (? ! \1) .) + ) \1/ si;
@@ -46,26 +45,26 @@ export class ClassCompletionItemProvider implements CompletionItemProvider {
4645 this . parseTextToItems ( text , items ) ;
4746 this . cache . set ( key , items ) ;
4847 resolve ( key ) ;
49- } , ( ) => resolve ( NONE ) ) ;
48+ } , ( ) => resolve ( this . none ) ) ;
5049 } else {
5150 this . cache . set ( key , items ) ;
5251 resolve ( key ) ;
5352 }
54- } , ( ) => resolve ( NONE ) ) ;
53+ } , ( ) => resolve ( this . none ) ) ;
5554 } ) ;
5655 }
5756
5857 fetchStyleSheet ( key : string ) : Thenable < string > {
5958 return new Promise ( resolve => {
60- if ( key === NONE ) {
61- resolve ( NONE ) ;
59+ if ( key === this . none ) {
60+ resolve ( this . none ) ;
6261 } else {
6362 if ( this . cache . get ( key ) ) {
6463 resolve ( key ) ;
6564 } else if ( this . isRemote . test ( key ) ) {
6665 this . fetchRemote ( key ) . then ( key => resolve ( key ) ) ;
6766 } else {
68- resolve ( NONE ) ;
67+ resolve ( this . none ) ;
6968 }
7069 }
7170 } ) ;
0 commit comments