diff options
author | Aleksey Kladov <[email protected]> | 2018-12-18 14:22:48 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-12-20 09:15:38 +0000 |
commit | cb6205c09da9fd6fc0bd9f88106f5e9bd3f471aa (patch) | |
tree | ceff920e800aff83b23df5d75eb07a993a6a1b9f /crates/ra_db | |
parent | a422d480a188a28c6b5e7862fbf07817eb2c7447 (diff) |
use relpaths for module resolve
Diffstat (limited to 'crates/ra_db')
-rw-r--r-- | crates/ra_db/src/input.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/crates/ra_db/src/input.rs b/crates/ra_db/src/input.rs index ac144b991..b09014dc6 100644 --- a/crates/ra_db/src/input.rs +++ b/crates/ra_db/src/input.rs | |||
@@ -1,6 +1,7 @@ | |||
1 | use std::sync::Arc; | 1 | use std::sync::Arc; |
2 | 2 | ||
3 | use rustc_hash::{FxHashSet, FxHashMap}; | 3 | use rustc_hash::{FxHashSet, FxHashMap}; |
4 | use relative_path::RelativePathBuf; | ||
4 | use ra_syntax::SmolStr; | 5 | use ra_syntax::SmolStr; |
5 | use salsa; | 6 | use salsa; |
6 | 7 | ||
@@ -85,10 +86,23 @@ salsa::query_group! { | |||
85 | type FileTextQuery; | 86 | type FileTextQuery; |
86 | storage input; | 87 | storage input; |
87 | } | 88 | } |
89 | /// Path to a file, relative to the root of its source root. | ||
90 | fn file_relative_path(file_id: FileId) -> RelativePathBuf { | ||
91 | type FileRelativePathQuery; | ||
92 | storage input; | ||
93 | } | ||
88 | fn file_source_root(file_id: FileId) -> SourceRootId { | 94 | fn file_source_root(file_id: FileId) -> SourceRootId { |
89 | type FileSourceRootQuery; | 95 | type FileSourceRootQuery; |
90 | storage input; | 96 | storage input; |
91 | } | 97 | } |
98 | fn source_root_files(id: SourceRootId) -> Arc<FxHashSet<FileId>> { | ||
99 | type SourceRootFilesQuery; | ||
100 | storage input; | ||
101 | } | ||
102 | fn source_root_file_by_path(id: SourceRootId, path: RelativePathBuf) -> Option<FileId> { | ||
103 | type SourceRootFilesByPathQuery; | ||
104 | storage input; | ||
105 | } | ||
92 | fn source_root(id: SourceRootId) -> Arc<SourceRoot> { | 106 | fn source_root(id: SourceRootId) -> Arc<SourceRoot> { |
93 | type SourceRootQuery; | 107 | type SourceRootQuery; |
94 | storage input; | 108 | storage input; |