mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 22:31:43 +00:00
internal: Re-arrange ide_db modules
This commit is contained in:
parent
c1f91c93b2
commit
ab21cf2f4f
84 changed files with 667 additions and 681 deletions
|
@ -4,21 +4,38 @@
|
|||
|
||||
mod apply_change;
|
||||
|
||||
pub mod active_parameter;
|
||||
pub mod assists;
|
||||
pub mod defs;
|
||||
pub mod famous_defs;
|
||||
pub mod helpers;
|
||||
pub mod items_locator;
|
||||
pub mod label;
|
||||
pub mod line_index;
|
||||
pub mod symbol_index;
|
||||
pub mod defs;
|
||||
pub mod items_locator;
|
||||
pub mod source_change;
|
||||
pub mod ty_filter;
|
||||
pub mod traits;
|
||||
pub mod helpers;
|
||||
pub mod path_transform;
|
||||
|
||||
pub mod search;
|
||||
pub mod rename;
|
||||
pub mod active_parameter;
|
||||
pub mod rust_doc;
|
||||
pub mod search;
|
||||
pub mod source_change;
|
||||
pub mod symbol_index;
|
||||
pub mod traits;
|
||||
pub mod ty_filter;
|
||||
|
||||
pub mod imports {
|
||||
pub mod import_assets;
|
||||
pub mod insert_use;
|
||||
pub mod merge_imports;
|
||||
}
|
||||
|
||||
pub mod generated {
|
||||
pub mod lints;
|
||||
}
|
||||
|
||||
pub mod syntax_helpers {
|
||||
pub mod node_ext;
|
||||
pub mod insert_whitespace_into_node;
|
||||
pub mod format_string;
|
||||
}
|
||||
|
||||
use std::{fmt, mem::ManuallyDrop, sync::Arc};
|
||||
|
||||
|
@ -42,14 +59,14 @@ pub type FxIndexMap<K, V> =
|
|||
indexmap::IndexMap<K, V, std::hash::BuildHasherDefault<rustc_hash::FxHasher>>;
|
||||
|
||||
#[salsa::database(
|
||||
base_db::SourceDatabaseStorage,
|
||||
base_db::SourceDatabaseExtStorage,
|
||||
LineIndexDatabaseStorage,
|
||||
symbol_index::SymbolsDatabaseStorage,
|
||||
hir::db::InternDatabaseStorage,
|
||||
base_db::SourceDatabaseStorage,
|
||||
hir::db::AstDatabaseStorage,
|
||||
hir::db::DefDatabaseStorage,
|
||||
hir::db::HirDatabaseStorage
|
||||
hir::db::HirDatabaseStorage,
|
||||
hir::db::InternDatabaseStorage,
|
||||
LineIndexDatabaseStorage,
|
||||
symbol_index::SymbolsDatabaseStorage
|
||||
)]
|
||||
pub struct RootDatabase {
|
||||
// We use `ManuallyDrop` here because every codegen unit that contains a
|
||||
|
@ -61,9 +78,7 @@ pub struct RootDatabase {
|
|||
|
||||
impl Drop for RootDatabase {
|
||||
fn drop(&mut self) {
|
||||
unsafe {
|
||||
ManuallyDrop::drop(&mut self.storage);
|
||||
}
|
||||
unsafe { ManuallyDrop::drop(&mut self.storage) };
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -117,7 +132,7 @@ impl RootDatabase {
|
|||
db.set_crate_graph_with_durability(Default::default(), Durability::HIGH);
|
||||
db.set_local_roots_with_durability(Default::default(), Durability::HIGH);
|
||||
db.set_library_roots_with_durability(Default::default(), Durability::HIGH);
|
||||
db.set_enable_proc_attr_macros(Default::default());
|
||||
db.set_enable_proc_attr_macros(false);
|
||||
db.update_lru_capacity(lru_capacity);
|
||||
db
|
||||
}
|
||||
|
@ -204,6 +219,21 @@ impl From<FileSymbolKind> for SymbolKind {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||
pub struct SnippetCap {
|
||||
_private: (),
|
||||
}
|
||||
|
||||
impl SnippetCap {
|
||||
pub const fn new(allow_snippets: bool) -> Option<SnippetCap> {
|
||||
if allow_snippets {
|
||||
Some(SnippetCap { _private: () })
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
mod sourcegen_lints;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue