mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 11:31:15 +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() {
|
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 {
|
res.push(Fold {
|
||||||
range: TextRange::new(
|
range: TextRange::new(fn_start, node.text_range().end()),
|
||||||
node.text_range().start(),
|
|
||||||
node.text_range().end(),
|
|
||||||
),
|
|
||||||
kind: FoldKind::Function,
|
kind: FoldKind::Function,
|
||||||
});
|
});
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user