Skip to content

Commit 1046c37

Browse files
authored
Merge pull request #299 from VioSea-hub/master
Fix the issue where document.getWordRangeAtPosition() returns incorre…
2 parents 455dda1 + a002857 commit 1046c37

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

package.json

+1-1
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": "2.0.11",
5+
"version": "2.0.12",
66
"license": "MIT",
77
"publisher": "ecmel",
88
"author": {

src/provider.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ export class Provider implements CompletionItemProvider, DefinitionProvider {
129129
position: Position,
130130
type: StyleType
131131
) {
132-
const map = await this.getCompletionMap(document, type);
133132
const range = document.getWordRangeAtPosition(position, this.wordRange);
133+
const map = await this.getCompletionMap(document, type);
134134
const items = [];
135135

136136
for (const item of map.values()) {
@@ -164,8 +164,8 @@ export class Provider implements CompletionItemProvider, DefinitionProvider {
164164
}
165165

166166
private async getDefinitions(document: TextDocument, position: Position) {
167-
const styles = await this.getStyles(document);
168167
const range = document.getWordRangeAtPosition(position, this.wordRange);
168+
const styles = await this.getStyles(document);
169169
const selector = document.getText(range);
170170
const locations: Location[] = [];
171171

0 commit comments

Comments
 (0)