Skip to content

Commit 89b9789

Browse files
ankddevlpil
authored andcommitted
refactor: use simpler method to get head location
1 parent 212ab20 commit 89b9789

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

compiler-core/src/language_server/code_action.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1445,14 +1445,7 @@ impl<'ast> ast::visit::Visit<'ast> for AnnotateTopLevelDefinitions<'_> {
14451445
let mut printer = Printer::new_without_type_variables(&self.module.ast.names);
14461446
collect_type_variables(&mut printer, fun);
14471447

1448-
let code_action_range = self.edits.src_span_to_lsp_range(
1449-
fun.body_start
1450-
.map(|body_start| SrcSpan {
1451-
start: fun.location.start,
1452-
end: body_start,
1453-
})
1454-
.unwrap_or(fun.location),
1455-
);
1448+
let code_action_range = self.edits.src_span_to_lsp_range(fun.location);
14561449

14571450
if overlaps(code_action_range, self.params.range) {
14581451
self.is_hovering_definition = true;

0 commit comments

Comments
 (0)