Skip to content

Commit 6e324d3

Browse files
bors[bot]Sergey Parilin
and
Sergey Parilin
committed
Merge #1016
1016: Move folding_ranges to ra_ide_api r=pasa a=pasa folding_ranges part of #1009 Co-authored-by: Sergey Parilin <[email protected]>
2 parents 708a7d2 + 47c501b commit 6e324d3

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

crates/ra_ide_api_light/src/folding_ranges.rs renamed to crates/ra_ide_api/src/folding_ranges.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pub struct Fold {
2020
pub kind: FoldKind,
2121
}
2222

23-
pub fn folding_ranges(file: &SourceFile) -> Vec<Fold> {
23+
pub(crate) fn folding_ranges(file: &SourceFile) -> Vec<Fold> {
2424
let mut res = vec![];
2525
let mut visited_comments = FxHashSet::default();
2626
let mut visited_imports = FxHashSet::default();

crates/ra_ide_api/src/lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ mod assists;
3434
mod diagnostics;
3535
mod syntax_tree;
3636
mod line_index;
37+
mod folding_ranges;
3738
mod line_index_utils;
3839

3940
#[cfg(test)]
@@ -64,9 +65,10 @@ pub use crate::{
6465
hover::{HoverResult},
6566
line_index::{LineIndex, LineCol},
6667
line_index_utils::translate_offset_with_edit,
68+
folding_ranges::{Fold, FoldKind},
6769
};
6870
pub use ra_ide_api_light::{
69-
Fold, FoldKind, HighlightedRange, Severity, StructureNode, LocalEdit,
71+
HighlightedRange, Severity, StructureNode, LocalEdit,
7072
};
7173
pub use ra_db::{
7274
Canceled, CrateGraph, CrateId, FileId, FilePosition, FileRange, SourceRootId,
@@ -314,7 +316,7 @@ impl Analysis {
314316
/// Returns the set of folding ranges.
315317
pub fn folding_ranges(&self, file_id: FileId) -> Vec<Fold> {
316318
let file = self.db.parse(file_id);
317-
ra_ide_api_light::folding_ranges(&file)
319+
folding_ranges::folding_ranges(&file)
318320
}
319321

320322
/// Fuzzy searches for a symbol.

crates/ra_ide_api_light/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
//! This usually means functions which take syntax tree as an input and produce
44
//! an edit or some auxiliary info.
55
6-
mod folding_ranges;
76
mod structure;
87
#[cfg(test)]
98
mod test_utils;
@@ -20,7 +19,6 @@ use ra_syntax::{
2019
};
2120

2221
pub use crate::{
23-
folding_ranges::{folding_ranges, Fold, FoldKind},
2422
structure::{file_structure, StructureNode},
2523
join_lines::join_lines,
2624
typing::{on_enter, on_dot_typed, on_eq_typed},

0 commit comments

Comments
 (0)