Skip to content

Commit 67662d5

Browse files
committed
Fixes
1 parent a6abee8 commit 67662d5

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "vscode-html-css",
33
"displayName": "HTML CSS Support",
44
"description": "CSS Intellisense for HTML",
5-
"version": "1.8.2",
5+
"version": "1.9.0",
66
"publisher": "ecmel",
77
"license": "MIT",
88
"homepage": "https://github.com/ecmel/vscode-html-css",

src/completion.ts

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export class SelectorCompletionItemProvider implements CompletionItemProvider, D
4343
this.files.clear();
4444
}
4545

46-
watchFile(path: string, listener: (e: Uri) => any) {
46+
watchFile(path: string, listener: () => any) {
4747
if (this.watchers.has(path)) {
4848
return;
4949
}
@@ -194,19 +194,21 @@ export class SelectorCompletionItemProvider implements CompletionItemProvider, D
194194

195195
let text = this.files.get(path);
196196

197-
try {
198-
if (!text) {
197+
if (!text) {
198+
try {
199199
text = (await workspace.fs.readFile(file)).toString();
200-
this.files.set(path, text);
201-
this.watchFile(path, () => this.files.delete(path));
200+
} catch (error) {
201+
text = "";
202202
}
203203

204-
this.findEmbedded(file, keys, text);
205-
206-
await this.findLinks(file, keys, text);
207-
await this.findInherited(file, keys, text, level);
208-
} catch (error) {
204+
this.files.set(path, text);
205+
this.watchFile(path, () => this.files.delete(path));
209206
}
207+
208+
this.findEmbedded(file, keys, text);
209+
210+
await this.findLinks(file, keys, text);
211+
await this.findInherited(file, keys, text, level);
210212
}
211213
}
212214

0 commit comments

Comments
 (0)