Skip to content

Commit 2ac011f

Browse files
committed
Fixes
1 parent a11d3f6 commit 2ac011f

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

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

5+
## [1.7.1] - 2021-01-09
6+
7+
- Update documentation.
8+
59
## [1.7.0] - 2021-01-09
610

711
- Removed validation.

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.7.0",
5+
"version": "1.7.1",
66
"publisher": "ecmel",
77
"license": "MIT",
88
"homepage": "https://github.com/ecmel/vscode-html-css",

src/completion.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ export class SelectorCompletionItemProvider implements CompletionItemProvider, D
187187
}
188188
}
189189

190-
async findAll(document: TextDocument, kind: CompletionItemKind): Promise<Map<string, CompletionItem>> {
190+
async findAll(document: TextDocument, tag: string): Promise<CompletionItem[]> {
191191
const keys = new Set<string>();
192192
const uri = document.uri;
193193
const text = document.getText();
@@ -199,14 +199,15 @@ export class SelectorCompletionItemProvider implements CompletionItemProvider, D
199199
await this.findExtendedStyles(uri, keys, text);
200200

201201
const items = new Map<string, CompletionItem>();
202+
const kind = tag === "id" ? CompletionItemKind.Value : CompletionItemKind.Enum;
202203

203204
keys.forEach(key => this.cache.get(key)?.forEach((v, k) => {
204205
if (v.kind === kind) {
205206
items.set(k, v);
206207
}
207208
}));
208209

209-
return items;
210+
return [...items.values()];
210211
}
211212

212213
provideCompletionItems(
@@ -224,11 +225,7 @@ export class SelectorCompletionItemProvider implements CompletionItemProvider, D
224225
const canComplete = this.canComplete.exec(text);
225226

226227
if (canComplete) {
227-
const kind = canComplete[1] === "id"
228-
? CompletionItemKind.Value
229-
: CompletionItemKind.Enum;
230-
231-
this.findAll(document, kind).then((items => resolve([...items.values()])));
228+
this.findAll(document, canComplete[1]).then(resolve);
232229
} else {
233230
reject();
234231
}

0 commit comments

Comments
 (0)