mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 13:51:31 +00:00
Move most of the logic into the completion module
This commit is contained in:
parent
6ba479cd05
commit
f9c14ac720
8 changed files with 107 additions and 118 deletions
|
@ -12,7 +12,7 @@ use cfg::CfgOptions;
|
|||
use rustc_hash::{FxHashMap, FxHashSet};
|
||||
use syntax::SmolStr;
|
||||
use tt::TokenExpander;
|
||||
use vfs::file_set::FileSet;
|
||||
use vfs::{file_set::FileSet, VfsPath};
|
||||
|
||||
pub use vfs::FileId;
|
||||
|
||||
|
@ -43,6 +43,12 @@ impl SourceRoot {
|
|||
pub fn new_library(file_set: FileSet) -> SourceRoot {
|
||||
SourceRoot { is_library: true, file_set }
|
||||
}
|
||||
pub fn path_for_file(&self, file: &FileId) -> Option<&VfsPath> {
|
||||
self.file_set.path_for_file(file)
|
||||
}
|
||||
pub fn file_for_path(&self, path: &VfsPath) -> Option<&FileId> {
|
||||
self.file_set.file_for_path(path)
|
||||
}
|
||||
pub fn iter(&self) -> impl Iterator<Item = FileId> + '_ {
|
||||
self.file_set.iter()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue