Skip to content

Commit 0bdec05

Browse files
committed
fix: go to definition
1 parent 411d272 commit 0bdec05

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

.changeset/tiny-pigs-invite.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"css-variables-language-server": patch
3+
---
4+
5+
Fix go to definition

packages/css-variables-language-server/src/CSSVariableManager.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export default class CSSVariableManager {
7171

7272
if (match) {
7373
const url = `${match.groups.protocol}://${match.groups.url}`;
74-
74+
7575
importUrls.push(url);
7676
}
7777
}
@@ -81,7 +81,7 @@ export default class CSSVariableManager {
8181
importUrls.map(async (url) => {
8282
try {
8383
const response = await axios(url, {
84-
responseType: "text"
84+
responseType: 'text',
8585
});
8686

8787
const cssText = await response.data;
@@ -107,10 +107,13 @@ export default class CSSVariableManager {
107107
uri: fileURI,
108108
range: Range.create(
109109
Position.create(
110-
decl.source.start.line,
111-
decl.source.start.column
110+
decl.source.start.line - 1,
111+
decl.source.start.column - 1
112112
),
113-
Position.create(decl.source.end.line, decl.source.end.column)
113+
Position.create(
114+
decl.source.end.line - 1,
115+
decl.source.end.column - 1
116+
)
114117
),
115118
},
116119
};

0 commit comments

Comments
 (0)