mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
fold curly blocks
This commit is contained in:
parent
8d7e8a175e
commit
23b040962f
3 changed files with 30 additions and 18 deletions
|
@ -446,8 +446,9 @@ pub fn handle_folding_range(
|
|||
.into_iter()
|
||||
.map(|fold| {
|
||||
let kind = match fold.kind {
|
||||
FoldKind::Comment => FoldingRangeKind::Comment,
|
||||
FoldKind::Imports => FoldingRangeKind::Imports,
|
||||
FoldKind::Comment => Some(FoldingRangeKind::Comment),
|
||||
FoldKind::Imports => Some(FoldingRangeKind::Imports),
|
||||
FoldKind::Block => None,
|
||||
};
|
||||
let range = fold.range.conv_with(&line_index);
|
||||
FoldingRange {
|
||||
|
@ -455,7 +456,7 @@ pub fn handle_folding_range(
|
|||
start_character: Some(range.start.character),
|
||||
end_line: range.end.line,
|
||||
end_character: Some(range.start.character),
|
||||
kind: Some(kind),
|
||||
kind,
|
||||
}
|
||||
})
|
||||
.collect(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue