Skip to content

Commit

Permalink
Merge pull request #299 from VioSea-hub/master
Browse files Browse the repository at this point in the history
Fix the issue where document.getWordRangeAtPosition() returns incorre…
  • Loading branch information
ecmel authored Dec 12, 2024
2 parents 455dda1 + a002857 commit 1046c37
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "vscode-html-css",
"displayName": "HTML CSS Support",
"description": "CSS Intellisense for HTML",
"version": "2.0.11",
"version": "2.0.12",
"license": "MIT",
"publisher": "ecmel",
"author": {
Expand Down
4 changes: 2 additions & 2 deletions src/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ export class Provider implements CompletionItemProvider, DefinitionProvider {
position: Position,
type: StyleType
) {
const map = await this.getCompletionMap(document, type);
const range = document.getWordRangeAtPosition(position, this.wordRange);
const map = await this.getCompletionMap(document, type);
const items = [];

for (const item of map.values()) {
Expand Down Expand Up @@ -164,8 +164,8 @@ export class Provider implements CompletionItemProvider, DefinitionProvider {
}

private async getDefinitions(document: TextDocument, position: Position) {
const styles = await this.getStyles(document);
const range = document.getWordRangeAtPosition(position, this.wordRange);
const styles = await this.getStyles(document);
const selector = document.getText(range);
const locations: Location[] = [];

Expand Down

0 comments on commit 1046c37

Please sign in to comment.