mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-25 11:17:13 +00:00
fix fold doc comment for multiline param list fn
This commit is contained in:
parent
51e77c9d7b
commit
a0c7a4ab83
@ -73,11 +73,13 @@ pub(crate) fn folding_ranges(file: &SourceFile) -> Vec<Fold> {
|
||||
}
|
||||
|
||||
if fn_node.body().is_some() {
|
||||
// Get the actual start of the function (excluding doc comments)
|
||||
let fn_start = fn_node
|
||||
.fn_token()
|
||||
.map(|token| token.text_range().start())
|
||||
.unwrap_or(node.text_range().start());
|
||||
res.push(Fold {
|
||||
range: TextRange::new(
|
||||
node.text_range().start(),
|
||||
node.text_range().end(),
|
||||
),
|
||||
range: TextRange::new(fn_start, node.text_range().end()),
|
||||
kind: FoldKind::Function,
|
||||
});
|
||||
continue;
|
||||
|
Loading…
x
Reference in New Issue
Block a user