Skip to content

Commit dc148de

Browse files
committed
Fixes
1 parent ccc7041 commit dc148de

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
All notable changes to the extension will be documented in this file.
44

5-
## [1.6.2] -
5+
## [1.6.2] - 2021-01-04
66

7+
- Handle file watcher create events.
78
- Update documentation.
89

910
## [1.6.1] - 2020-12-31

src/completion.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,16 +114,19 @@ export class SelectorCompletionItemProvider implements CompletionItemProvider, D
114114
if (this.cache.has(key)) {
115115
resolve(key);
116116
} else {
117+
const items = new Map<string, CompletionItem>();
117118
const file = Uri.file(this.getRelativePath(uri, key));
118119

119120
workspace.fs.readFile(file).then(content => {
120-
const items = new Map<string, CompletionItem>();
121-
122121
this.parseTextToItems(content.toString(), items);
123122
this.cache.set(key, items);
124-
this.watchFile(file, e => this.cache.delete(key));
125123
resolve(key);
126-
}, () => resolve(this.none));
124+
}, () => {
125+
this.cache.set(key, items);
126+
resolve(key);
127+
});
128+
129+
this.watchFile(file, e => this.cache.delete(key));
127130
}
128131
});
129132
}

0 commit comments

Comments
 (0)