Skip to content

Commit 805ad17

Browse files
committed
Fixes
1 parent ed73630 commit 805ad17

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

src/extension.ts

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,12 @@ export class ClassCompletionItemProvider implements CompletionItemProvider {
2626
readonly findLinkRel = /rel\s*=\s*(["'])((?:(?!\1).)+)\1/si;
2727
readonly findLinkHref = /href\s*=\s*(["'])((?:(?!\1).)+)\1/si;
2828

29-
#remoteStyleSheets: string[] = [];
30-
31-
get remoteStyleSheets(): string[] {
32-
return this.#remoteStyleSheets;
33-
}
34-
35-
set remoteStyleSheets(value: string[]) {
36-
this.#remoteStyleSheets = value;
37-
}
29+
remoteStyleSheets: string[] = [];
3830

3931
parseTextToItems(text: string, items: Map<string, CompletionItem>) {
4032
walk(parse(text), (node) => {
4133
if (node.type === "ClassSelector") {
42-
items.set(node.name, new CompletionItem(node.name, CompletionItemKind.Value));
34+
items.set(node.name, new CompletionItem(node.name, CompletionItemKind.EnumMember));
4335
}
4436
});
4537
}
@@ -105,8 +97,8 @@ export class ClassCompletionItemProvider implements CompletionItemProvider {
10597
const keys = new Set<string>();
10698
const promises = [];
10799

108-
for (let i = 0; i < this.#remoteStyleSheets.length; i++) {
109-
promises.push(this.fetchRemoteStyleSheet(this.#remoteStyleSheets[i])
100+
for (let i = 0; i < this.remoteStyleSheets.length; i++) {
101+
promises.push(this.fetchRemoteStyleSheet(this.remoteStyleSheets[i])
110102
.then(key => keys.add(key)));
111103
}
112104

@@ -145,8 +137,10 @@ export class ClassCompletionItemProvider implements CompletionItemProvider {
145137
this.findRemoteStyles().then(styles => {
146138
this.findDocumentLinks(text).then(links => {
147139
links.forEach(key => styles.add(key));
140+
148141
styles.forEach(key => this.cache.get(key)
149142
?.forEach((value, name) => items.set(name, value)));
143+
150144
resolve([...items.values()]);
151145
});
152146
});

0 commit comments

Comments
 (0)