Split folding ranges into editor and lsp parts

This commit is contained in:
Jeremy A. Kolb 2018-09-24 09:52:33 -04:00
parent bd2b2f1b48
commit ff0a706a30
4 changed files with 114 additions and 77 deletions

View file

@ -34,6 +34,7 @@ use imp::{AnalysisImpl, AnalysisHostImpl, FileResolverImp};
pub use ra_editor::{
StructureNode, LineIndex, FileSymbol,
Runnable, RunnableKind, HighlightedRange, CompletionItem,
Fold, FoldKind
};
pub use job::{JobToken, JobHandle};
@ -224,6 +225,10 @@ impl Analysis {
pub fn diagnostics(&self, file_id: FileId) -> Vec<Diagnostic> {
self.imp.diagnostics(file_id)
}
pub fn folding_ranges(&self, file_id: FileId) -> Vec<Fold> {
let file = self.imp.file_syntax(file_id);
ra_editor::folding_ranges(&file)
}
}
#[derive(Debug)]