Move folding_ranges to ra_ide_api
This commit is contained in:
parent
708a7d24c5
commit
47c501bcfb
3 changed files with 5 additions and 5 deletions
|
@ -20,7 +20,7 @@ pub struct Fold {
|
|||
pub kind: FoldKind,
|
||||
}
|
||||
|
||||
pub fn folding_ranges(file: &SourceFile) -> Vec<Fold> {
|
||||
pub(crate) fn folding_ranges(file: &SourceFile) -> Vec<Fold> {
|
||||
let mut res = vec![];
|
||||
let mut visited_comments = FxHashSet::default();
|
||||
let mut visited_imports = FxHashSet::default();
|
|
@ -34,6 +34,7 @@ mod assists;
|
|||
mod diagnostics;
|
||||
mod syntax_tree;
|
||||
mod line_index;
|
||||
mod folding_ranges;
|
||||
mod line_index_utils;
|
||||
|
||||
#[cfg(test)]
|
||||
|
@ -64,9 +65,10 @@ pub use crate::{
|
|||
hover::{HoverResult},
|
||||
line_index::{LineIndex, LineCol},
|
||||
line_index_utils::translate_offset_with_edit,
|
||||
folding_ranges::{Fold, FoldKind},
|
||||
};
|
||||
pub use ra_ide_api_light::{
|
||||
Fold, FoldKind, HighlightedRange, Severity, StructureNode, LocalEdit,
|
||||
HighlightedRange, Severity, StructureNode, LocalEdit,
|
||||
};
|
||||
pub use ra_db::{
|
||||
Canceled, CrateGraph, CrateId, FileId, FilePosition, FileRange, SourceRootId,
|
||||
|
@ -314,7 +316,7 @@ impl Analysis {
|
|||
/// Returns the set of folding ranges.
|
||||
pub fn folding_ranges(&self, file_id: FileId) -> Vec<Fold> {
|
||||
let file = self.db.parse(file_id);
|
||||
ra_ide_api_light::folding_ranges(&file)
|
||||
folding_ranges::folding_ranges(&file)
|
||||
}
|
||||
|
||||
/// Fuzzy searches for a symbol.
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
//! This usually means functions which take syntax tree as an input and produce
|
||||
//! an edit or some auxiliary info.
|
||||
|
||||
mod folding_ranges;
|
||||
mod structure;
|
||||
#[cfg(test)]
|
||||
mod test_utils;
|
||||
|
@ -20,7 +19,6 @@ use ra_syntax::{
|
|||
};
|
||||
|
||||
pub use crate::{
|
||||
folding_ranges::{folding_ranges, Fold, FoldKind},
|
||||
structure::{file_structure, StructureNode},
|
||||
join_lines::join_lines,
|
||||
typing::{on_enter, on_dot_typed, on_eq_typed},
|
||||
|
|
Loading…
Add table
Reference in a new issue