Skip to content

Commit 9023167

Browse files
committed
refactor: use simpler method to get head location
1 parent c856e86 commit 9023167

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
@@ -1444,14 +1444,7 @@ impl<'ast> ast::visit::Visit<'ast> for AnnotateTopLevelDefinitions<'_> {
14441444
let mut printer = Printer::new_without_type_variables(&self.module.ast.names);
14451445
collect_type_variables(&mut printer, fun);
14461446

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

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

0 commit comments

Comments
 (0)