From 02924174bb084d73cab67af6665ddf00e91983f6 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 28 Dec 2018 18:03:03 +0300 Subject: introduce FileRange --- crates/ra_analysis/src/lib.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'crates/ra_analysis/src/lib.rs') diff --git a/crates/ra_analysis/src/lib.rs b/crates/ra_analysis/src/lib.rs index b26e9e9ff..3fa4189ce 100644 --- a/crates/ra_analysis/src/lib.rs +++ b/crates/ra_analysis/src/lib.rs @@ -38,7 +38,7 @@ pub use ra_editor::{ pub use hir::FnSignatureInfo; pub use ra_db::{ - Canceled, Cancelable, FilePosition, + Canceled, Cancelable, FilePosition, FileRange, CrateGraph, CrateId, SourceRootId, FileId }; @@ -287,9 +287,9 @@ impl Analysis { let file = self.imp.file_syntax(file_id); ra_editor::syntax_tree(&file) } - pub fn join_lines(&self, file_id: FileId, range: TextRange) -> SourceChange { - let file = self.imp.file_syntax(file_id); - SourceChange::from_local_edit(file_id, ra_editor::join_lines(&file, range)) + pub fn join_lines(&self, frange: FileRange) -> SourceChange { + let file = self.imp.file_syntax(frange.file_id); + SourceChange::from_local_edit(frange.file_id, ra_editor::join_lines(&file, frange.range)) } pub fn on_enter(&self, position: FilePosition) -> Option { let file = self.imp.file_syntax(position.file_id); @@ -346,8 +346,8 @@ impl Analysis { pub fn completions(&self, position: FilePosition) -> Cancelable>> { self.imp.completions(position) } - pub fn assists(&self, file_id: FileId, range: TextRange) -> Cancelable> { - Ok(self.imp.assists(file_id, range)) + pub fn assists(&self, frange: FileRange) -> Cancelable> { + Ok(self.imp.assists(frange)) } pub fn diagnostics(&self, file_id: FileId) -> Cancelable> { self.imp.diagnostics(file_id) @@ -358,8 +358,8 @@ impl Analysis { ) -> Cancelable)>> { self.imp.resolve_callable(position) } - pub fn type_of(&self, file_id: FileId, range: TextRange) -> Cancelable> { - self.imp.type_of(file_id, range) + pub fn type_of(&self, frange: FileRange) -> Cancelable> { + self.imp.type_of(frange) } } -- cgit v1.2.3