simplify runnables

This commit is contained in:
Aleksey Kladov 2019-01-02 20:12:38 +03:00
parent ef08b6c084
commit 28f6eedba5
7 changed files with 65 additions and 124 deletions

View file

@ -382,10 +382,6 @@ impl Analysis {
pub fn parent_module(&self, position: FilePosition) -> Cancelable<Vec<NavigationTarget>> {
self.db.parent_module(position)
}
/// Returns `::` separated path to the current module from the crate root.
pub fn module_path(&self, position: FilePosition) -> Cancelable<Option<String>> {
self.db.module_path(position)
}
/// Returns crates this file belongs too.
pub fn crate_for(&self, file_id: FileId) -> Cancelable<Vec<CrateId>> {
self.db.crate_for(file_id)
@ -396,8 +392,7 @@ impl Analysis {
}
/// Returns the set of possible targets to run for the current file.
pub fn runnables(&self, file_id: FileId) -> Cancelable<Vec<Runnable>> {
let file = self.db.source_file(file_id);
Ok(runnables::runnables(self, &file, file_id))
runnables::runnables(&*self.db, file_id)
}
/// Computes syntax highlighting for the given file.
pub fn highlight(&self, file_id: FileId) -> Cancelable<Vec<HighlightedRange>> {