Skip to content

Commit e03bdce

Browse files
committed
Fix regression in go to definition
1 parent 68ed8ed commit e03bdce

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

pkgs/sass_language_services/lib/src/features/go_to_definition/go_to_definition_feature.dart

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ class GoToDefinitionFeature extends LanguageFeature {
8383
}
8484
}
8585

86-
var definition = await findInWorkspace<StylesheetDocumentSymbol>(
86+
var definition =
87+
await findInWorkspace<(StylesheetDocumentSymbol, lsp.Location)>(
8788
lazy: true,
8889
initialDocument: initialDocument,
8990
depth: initialDocument.uri != document.uri ? 1 : 0,
@@ -112,19 +113,25 @@ class GoToDefinitionFeature extends LanguageFeature {
112113
);
113114

114115
if (symbol != null) {
115-
return [symbol];
116+
return [
117+
(
118+
symbol,
119+
lsp.Location(uri: document.uri, range: symbol.selectionRange)
120+
)
121+
];
116122
}
117123

118124
return null;
119125
},
120126
);
121127

122128
if (definition != null && definition.isNotEmpty) {
123-
var symbol = definition.first;
129+
var symbol = definition.first.$1;
130+
var location = definition.first.$2;
124131
return Definition(
125-
name,
126-
kind,
127-
lsp.Location(uri: document.uri, range: symbol.selectionRange),
132+
symbol.name,
133+
symbol.referenceKind,
134+
location,
128135
);
129136
}
130137

0 commit comments

Comments
 (0)