From 4bed588001a1d6cd5c83a3eefc6ef77c439de40b Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Fri, 28 Aug 2020 21:28:30 +0300 Subject: First steps for mod<|> completion --- crates/base_db/src/lib.rs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'crates/base_db/src') diff --git a/crates/base_db/src/lib.rs b/crates/base_db/src/lib.rs index ee3415850..71e85c6ac 100644 --- a/crates/base_db/src/lib.rs +++ b/crates/base_db/src/lib.rs @@ -96,6 +96,7 @@ pub trait FileLoader { /// `#[path = "C://no/way"]` fn resolve_path(&self, anchor: FileId, path: &str) -> Option; fn relevant_crates(&self, file_id: FileId) -> Arc>; + fn list_some_random_files_todo(&self, anchor: FileId) -> Vec<(FileId, String)>; } /// Database which stores all significant input facts: source code and project @@ -155,8 +156,8 @@ impl FileLoader for FileLoaderDelegate<&'_ T> { } fn resolve_path(&self, anchor: FileId, path: &str) -> Option { // FIXME: this *somehow* should be platform agnostic... - let source_root = self.0.file_source_root(anchor); - let source_root = self.0.source_root(source_root); + // self.source_root(anchor) + let source_root = self.source_root(anchor); source_root.file_set.resolve_path(anchor, path) } @@ -164,4 +165,15 @@ impl FileLoader for FileLoaderDelegate<&'_ T> { let source_root = self.0.file_source_root(file_id); self.0.source_root_crates(source_root) } + + fn list_some_random_files_todo(&self, anchor: FileId) -> Vec<(FileId, String)> { + self.source_root(anchor).file_set.list_some_random_files_todo(anchor) + } +} + +impl FileLoaderDelegate<&'_ T> { + fn source_root(&self, anchor: FileId) -> Arc { + let source_root = self.0.file_source_root(anchor); + self.0.source_root(source_root) + } } -- cgit v1.2.3