make it compile

This commit is contained in:
Aleksey Kladov 2018-12-19 10:26:24 +03:00
parent dea1a69e1c
commit b6ce7a6d34
4 changed files with 6 additions and 9 deletions

View File

@ -61,7 +61,10 @@ salsa::database_storage! {
pub(crate) struct RootDatabaseStorage for RootDatabase {
impl ra_db::FilesDatabase {
fn file_text() for ra_db::FileTextQuery;
fn file_relative_path() for ra_db::FileRelativePathQuery;
fn file_source_root() for ra_db::FileSourceRootQuery;
fn source_root_files() for ra_db::SourceRootFilesQuery;
fn source_root_file_by_path() for ra_db::SourceRootFileByPathQuery;
fn source_root() for ra_db::SourceRootQuery;
fn libraries() for ra_db::LibrariesQuery;
fn crate_graph() for ra_db::CrateGraphQuery;

View File

@ -51,9 +51,6 @@ impl AnalysisHostImpl {
.set(file_id, Arc::new(text))
}
if !(change.files_added.is_empty() && change.files_removed.is_empty()) {
let file_resolver = change
.file_resolver
.expect("change resolver when changing set of files");
let mut source_root = SourceRoot::clone(&self.db.source_root(WORKSPACE));
for (file_id, text) in change.files_added {
self.db
@ -70,7 +67,6 @@ impl AnalysisHostImpl {
.set(file_id, Arc::new(String::new()));
source_root.files.remove(&file_id);
}
source_root.file_resolver = file_resolver;
self.db
.query_mut(ra_db::SourceRootQuery)
.set(WORKSPACE, Arc::new(source_root))
@ -95,10 +91,7 @@ impl AnalysisHostImpl {
.query_mut(ra_db::FileTextQuery)
.set_constant(file_id, Arc::new(text));
}
let source_root = SourceRoot {
files,
file_resolver: library.file_resolver,
};
let source_root = SourceRoot { files };
self.db
.query_mut(ra_db::SourceRootQuery)
.set(source_root_id, Arc::new(source_root));

View File

@ -98,7 +98,7 @@ salsa::query_group! {
storage input;
}
fn source_root_file_by_path(id: SourceRootId, path: RelativePathBuf) -> Option<FileId> {
type SourceRootFilesByPathQuery;
type SourceRootFileByPathQuery;
storage input;
}
fn source_root(id: SourceRootId) -> Arc<SourceRoot> {

View File

@ -28,6 +28,7 @@ pub use crate::{
input::{
FilesDatabase, FileId, CrateId, SourceRoot, SourceRootId, CrateGraph, WORKSPACE,
FileTextQuery, FileSourceRootQuery, SourceRootQuery, LibrariesQuery, CrateGraphQuery,
FileRelativePathQuery, SourceRootFilesQuery, SourceRootFileByPathQuery,
},
loc2id::{LocationIntener, NumericId},
};