mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 04:53:34 +00:00
Rename ra_db -> base_db
This commit is contained in:
parent
902f74c269
commit
ed20a857f4
111 changed files with 183 additions and 183 deletions
50
Cargo.lock
generated
50
Cargo.lock
generated
|
@ -83,6 +83,21 @@ version = "0.12.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff"
|
checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "base_db"
|
||||||
|
version = "0.0.0"
|
||||||
|
dependencies = [
|
||||||
|
"cfg",
|
||||||
|
"profile",
|
||||||
|
"rustc-hash",
|
||||||
|
"salsa",
|
||||||
|
"stdx",
|
||||||
|
"syntax",
|
||||||
|
"test_utils",
|
||||||
|
"tt",
|
||||||
|
"vfs",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bitflags"
|
name = "bitflags"
|
||||||
version = "1.2.1"
|
version = "1.2.1"
|
||||||
|
@ -956,12 +971,12 @@ version = "0.0.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"arena",
|
"arena",
|
||||||
|
"base_db",
|
||||||
"cargo_metadata",
|
"cargo_metadata",
|
||||||
"cfg",
|
"cfg",
|
||||||
"log",
|
"log",
|
||||||
"paths",
|
"paths",
|
||||||
"proc_macro_api",
|
"proc_macro_api",
|
||||||
"ra_db",
|
|
||||||
"rustc-hash",
|
"rustc-hash",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
|
@ -982,10 +997,10 @@ dependencies = [
|
||||||
name = "ra_assists"
|
name = "ra_assists"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"base_db",
|
||||||
"either",
|
"either",
|
||||||
"itertools",
|
"itertools",
|
||||||
"profile",
|
"profile",
|
||||||
"ra_db",
|
|
||||||
"ra_hir",
|
"ra_hir",
|
||||||
"ra_ide_db",
|
"ra_ide_db",
|
||||||
"rustc-hash",
|
"rustc-hash",
|
||||||
|
@ -995,31 +1010,16 @@ dependencies = [
|
||||||
"text_edit",
|
"text_edit",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "ra_db"
|
|
||||||
version = "0.1.0"
|
|
||||||
dependencies = [
|
|
||||||
"cfg",
|
|
||||||
"profile",
|
|
||||||
"rustc-hash",
|
|
||||||
"salsa",
|
|
||||||
"stdx",
|
|
||||||
"syntax",
|
|
||||||
"test_utils",
|
|
||||||
"tt",
|
|
||||||
"vfs",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ra_hir"
|
name = "ra_hir"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"arrayvec",
|
"arrayvec",
|
||||||
|
"base_db",
|
||||||
"either",
|
"either",
|
||||||
"itertools",
|
"itertools",
|
||||||
"log",
|
"log",
|
||||||
"profile",
|
"profile",
|
||||||
"ra_db",
|
|
||||||
"ra_hir_def",
|
"ra_hir_def",
|
||||||
"ra_hir_expand",
|
"ra_hir_expand",
|
||||||
"ra_hir_ty",
|
"ra_hir_ty",
|
||||||
|
@ -1034,6 +1034,7 @@ version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anymap",
|
"anymap",
|
||||||
"arena",
|
"arena",
|
||||||
|
"base_db",
|
||||||
"cfg",
|
"cfg",
|
||||||
"drop_bomb",
|
"drop_bomb",
|
||||||
"either",
|
"either",
|
||||||
|
@ -1045,7 +1046,6 @@ dependencies = [
|
||||||
"mbe",
|
"mbe",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"profile",
|
"profile",
|
||||||
"ra_db",
|
|
||||||
"ra_hir_expand",
|
"ra_hir_expand",
|
||||||
"rustc-hash",
|
"rustc-hash",
|
||||||
"smallvec",
|
"smallvec",
|
||||||
|
@ -1060,12 +1060,12 @@ name = "ra_hir_expand"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"arena",
|
"arena",
|
||||||
|
"base_db",
|
||||||
"either",
|
"either",
|
||||||
"log",
|
"log",
|
||||||
"mbe",
|
"mbe",
|
||||||
"parser",
|
"parser",
|
||||||
"profile",
|
"profile",
|
||||||
"ra_db",
|
|
||||||
"rustc-hash",
|
"rustc-hash",
|
||||||
"syntax",
|
"syntax",
|
||||||
"test_utils",
|
"test_utils",
|
||||||
|
@ -1078,6 +1078,7 @@ version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"arena",
|
"arena",
|
||||||
"arrayvec",
|
"arrayvec",
|
||||||
|
"base_db",
|
||||||
"chalk-ir",
|
"chalk-ir",
|
||||||
"chalk-recursive",
|
"chalk-recursive",
|
||||||
"chalk-solve",
|
"chalk-solve",
|
||||||
|
@ -1086,7 +1087,6 @@ dependencies = [
|
||||||
"itertools",
|
"itertools",
|
||||||
"log",
|
"log",
|
||||||
"profile",
|
"profile",
|
||||||
"ra_db",
|
|
||||||
"ra_hir_def",
|
"ra_hir_def",
|
||||||
"ra_hir_expand",
|
"ra_hir_expand",
|
||||||
"rustc-hash",
|
"rustc-hash",
|
||||||
|
@ -1104,6 +1104,7 @@ dependencies = [
|
||||||
name = "ra_ide"
|
name = "ra_ide"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"base_db",
|
||||||
"cfg",
|
"cfg",
|
||||||
"either",
|
"either",
|
||||||
"expect",
|
"expect",
|
||||||
|
@ -1113,7 +1114,6 @@ dependencies = [
|
||||||
"oorandom",
|
"oorandom",
|
||||||
"profile",
|
"profile",
|
||||||
"ra_assists",
|
"ra_assists",
|
||||||
"ra_db",
|
|
||||||
"ra_hir",
|
"ra_hir",
|
||||||
"ra_ide_db",
|
"ra_ide_db",
|
||||||
"ra_ssr",
|
"ra_ssr",
|
||||||
|
@ -1128,12 +1128,12 @@ dependencies = [
|
||||||
name = "ra_ide_db"
|
name = "ra_ide_db"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"base_db",
|
||||||
"either",
|
"either",
|
||||||
"fst",
|
"fst",
|
||||||
"log",
|
"log",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"profile",
|
"profile",
|
||||||
"ra_db",
|
|
||||||
"ra_hir",
|
"ra_hir",
|
||||||
"rayon",
|
"rayon",
|
||||||
"rustc-hash",
|
"rustc-hash",
|
||||||
|
@ -1147,8 +1147,8 @@ dependencies = [
|
||||||
name = "ra_ssr"
|
name = "ra_ssr"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"base_db",
|
||||||
"expect",
|
"expect",
|
||||||
"ra_db",
|
|
||||||
"ra_hir",
|
"ra_hir",
|
||||||
"ra_ide_db",
|
"ra_ide_db",
|
||||||
"rustc-hash",
|
"rustc-hash",
|
||||||
|
@ -1230,6 +1230,7 @@ name = "rust-analyzer"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
|
"base_db",
|
||||||
"cfg",
|
"cfg",
|
||||||
"crossbeam-channel",
|
"crossbeam-channel",
|
||||||
"env_logger",
|
"env_logger",
|
||||||
|
@ -1248,7 +1249,6 @@ dependencies = [
|
||||||
"proc_macro_srv",
|
"proc_macro_srv",
|
||||||
"profile",
|
"profile",
|
||||||
"project_model",
|
"project_model",
|
||||||
"ra_db",
|
|
||||||
"ra_hir",
|
"ra_hir",
|
||||||
"ra_hir_def",
|
"ra_hir_def",
|
||||||
"ra_hir_ty",
|
"ra_hir_ty",
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
[package]
|
[package]
|
||||||
edition = "2018"
|
name = "base_db"
|
||||||
name = "ra_db"
|
version = "0.0.0"
|
||||||
version = "0.1.0"
|
|
||||||
authors = ["rust-analyzer developers"]
|
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
|
authors = ["rust-analyzer developers"]
|
||||||
|
edition = "2018"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
doctest = false
|
doctest = false
|
|
@ -1,4 +1,4 @@
|
||||||
//! ra_db defines basic database traits. The concrete DB is defined by ra_ide.
|
//! base_db defines basic database traits. The concrete DB is defined by ra_ide.
|
||||||
mod cancellation;
|
mod cancellation;
|
||||||
mod input;
|
mod input;
|
||||||
pub mod fixture;
|
pub mod fixture;
|
|
@ -18,7 +18,7 @@ anyhow = "1.0.26"
|
||||||
|
|
||||||
arena = { path = "../arena" }
|
arena = { path = "../arena" }
|
||||||
cfg = { path = "../cfg" }
|
cfg = { path = "../cfg" }
|
||||||
ra_db = { path = "../ra_db" }
|
base_db = { path = "../base_db" }
|
||||||
toolchain = { path = "../toolchain" }
|
toolchain = { path = "../toolchain" }
|
||||||
proc_macro_api = { path = "../proc_macro_api" }
|
proc_macro_api = { path = "../proc_macro_api" }
|
||||||
paths = { path = "../paths" }
|
paths = { path = "../paths" }
|
||||||
|
|
|
@ -9,9 +9,9 @@ use std::{
|
||||||
|
|
||||||
use anyhow::{Context, Result};
|
use anyhow::{Context, Result};
|
||||||
use arena::{Arena, Idx};
|
use arena::{Arena, Idx};
|
||||||
|
use base_db::Edition;
|
||||||
use cargo_metadata::{BuildScript, CargoOpt, Message, MetadataCommand, PackageId};
|
use cargo_metadata::{BuildScript, CargoOpt, Message, MetadataCommand, PackageId};
|
||||||
use paths::{AbsPath, AbsPathBuf};
|
use paths::{AbsPath, AbsPathBuf};
|
||||||
use ra_db::Edition;
|
|
||||||
use rustc_hash::FxHashMap;
|
use rustc_hash::FxHashMap;
|
||||||
|
|
||||||
use crate::cfg_flag::CfgFlag;
|
use crate::cfg_flag::CfgFlag;
|
||||||
|
|
|
@ -12,9 +12,9 @@ use std::{
|
||||||
};
|
};
|
||||||
|
|
||||||
use anyhow::{bail, Context, Result};
|
use anyhow::{bail, Context, Result};
|
||||||
|
use base_db::{CrateGraph, CrateId, CrateName, Edition, Env, FileId};
|
||||||
use cfg::CfgOptions;
|
use cfg::CfgOptions;
|
||||||
use paths::{AbsPath, AbsPathBuf};
|
use paths::{AbsPath, AbsPathBuf};
|
||||||
use ra_db::{CrateGraph, CrateId, CrateName, Edition, Env, FileId};
|
|
||||||
use rustc_hash::{FxHashMap, FxHashSet};
|
use rustc_hash::{FxHashMap, FxHashSet};
|
||||||
|
|
||||||
use crate::cfg_flag::CfgFlag;
|
use crate::cfg_flag::CfgFlag;
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|
||||||
|
use base_db::{CrateId, CrateName, Dependency, Edition};
|
||||||
use paths::{AbsPath, AbsPathBuf};
|
use paths::{AbsPath, AbsPathBuf};
|
||||||
use ra_db::{CrateId, CrateName, Dependency, Edition};
|
|
||||||
use rustc_hash::FxHashMap;
|
use rustc_hash::FxHashMap;
|
||||||
use serde::{de, Deserialize};
|
use serde::{de, Deserialize};
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ stdx = { path = "../stdx" }
|
||||||
syntax = { path = "../syntax" }
|
syntax = { path = "../syntax" }
|
||||||
text_edit = { path = "../text_edit" }
|
text_edit = { path = "../text_edit" }
|
||||||
profile = { path = "../profile" }
|
profile = { path = "../profile" }
|
||||||
ra_db = { path = "../ra_db" }
|
base_db = { path = "../base_db" }
|
||||||
ra_ide_db = { path = "../ra_ide_db" }
|
ra_ide_db = { path = "../ra_ide_db" }
|
||||||
hir = { path = "../ra_hir", package = "ra_hir" }
|
hir = { path = "../ra_hir", package = "ra_hir" }
|
||||||
test_utils = { path = "../test_utils" }
|
test_utils = { path = "../test_utils" }
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
use std::mem;
|
use std::mem;
|
||||||
|
|
||||||
use algo::find_covering_element;
|
use algo::find_covering_element;
|
||||||
|
use base_db::{FileId, FileRange};
|
||||||
use hir::Semantics;
|
use hir::Semantics;
|
||||||
use ra_db::{FileId, FileRange};
|
|
||||||
use ra_ide_db::{
|
use ra_ide_db::{
|
||||||
source_change::{SourceChange, SourceFileEdit},
|
source_change::{SourceChange, SourceFileEdit},
|
||||||
RootDatabase,
|
RootDatabase,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
|
use base_db::FileId;
|
||||||
use hir::{EnumVariant, Module, ModuleDef, Name};
|
use hir::{EnumVariant, Module, ModuleDef, Name};
|
||||||
use ra_db::FileId;
|
|
||||||
use ra_ide_db::{defs::Definition, search::Reference, RootDatabase};
|
use ra_ide_db::{defs::Definition, search::Reference, RootDatabase};
|
||||||
use rustc_hash::FxHashSet;
|
use rustc_hash::FxHashSet;
|
||||||
use syntax::{
|
use syntax::{
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
|
use base_db::FileId;
|
||||||
use hir::{db::HirDatabase, HasSource, HasVisibility, PathResolution};
|
use hir::{db::HirDatabase, HasSource, HasVisibility, PathResolution};
|
||||||
use ra_db::FileId;
|
|
||||||
use syntax::{ast, AstNode, TextRange, TextSize};
|
use syntax::{ast, AstNode, TextRange, TextSize};
|
||||||
|
|
||||||
use crate::{utils::vis_offset, AssistContext, AssistId, AssistKind, Assists};
|
use crate::{utils::vis_offset, AssistContext, AssistId, AssistKind, Assists};
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
|
use base_db::FileId;
|
||||||
use hir::HirDisplay;
|
use hir::HirDisplay;
|
||||||
use ra_db::FileId;
|
|
||||||
use rustc_hash::{FxHashMap, FxHashSet};
|
use rustc_hash::{FxHashMap, FxHashSet};
|
||||||
use syntax::{
|
use syntax::{
|
||||||
ast::{
|
ast::{
|
||||||
|
|
|
@ -17,8 +17,8 @@ mod tests;
|
||||||
pub mod utils;
|
pub mod utils;
|
||||||
pub mod ast_transform;
|
pub mod ast_transform;
|
||||||
|
|
||||||
|
use base_db::FileRange;
|
||||||
use hir::Semantics;
|
use hir::Semantics;
|
||||||
use ra_db::FileRange;
|
|
||||||
use ra_ide_db::{source_change::SourceChange, RootDatabase};
|
use ra_ide_db::{source_change::SourceChange, RootDatabase};
|
||||||
use syntax::TextRange;
|
use syntax::TextRange;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
mod generated;
|
mod generated;
|
||||||
|
|
||||||
|
use base_db::{fixture::WithFixture, FileId, FileRange, SourceDatabaseExt};
|
||||||
use hir::Semantics;
|
use hir::Semantics;
|
||||||
use ra_db::{fixture::WithFixture, FileId, FileRange, SourceDatabaseExt};
|
|
||||||
use ra_ide_db::RootDatabase;
|
use ra_ide_db::RootDatabase;
|
||||||
use syntax::TextRange;
|
use syntax::TextRange;
|
||||||
use test_utils::{assert_eq_text, extract_offset, extract_range};
|
use test_utils::{assert_eq_text, extract_offset, extract_range};
|
||||||
|
|
|
@ -18,7 +18,7 @@ itertools = "0.9.0"
|
||||||
|
|
||||||
stdx = { path = "../stdx" }
|
stdx = { path = "../stdx" }
|
||||||
syntax = { path = "../syntax" }
|
syntax = { path = "../syntax" }
|
||||||
ra_db = { path = "../ra_db" }
|
base_db = { path = "../base_db" }
|
||||||
profile = { path = "../profile" }
|
profile = { path = "../profile" }
|
||||||
hir_expand = { path = "../ra_hir_expand", package = "ra_hir_expand" }
|
hir_expand = { path = "../ra_hir_expand", package = "ra_hir_expand" }
|
||||||
hir_def = { path = "../ra_hir_def", package = "ra_hir_def" }
|
hir_def = { path = "../ra_hir_def", package = "ra_hir_def" }
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
use std::{iter, sync::Arc};
|
use std::{iter, sync::Arc};
|
||||||
|
|
||||||
use arrayvec::ArrayVec;
|
use arrayvec::ArrayVec;
|
||||||
|
use base_db::{CrateId, Edition, FileId};
|
||||||
use either::Either;
|
use either::Either;
|
||||||
use hir_def::{
|
use hir_def::{
|
||||||
adt::ReprKind,
|
adt::ReprKind,
|
||||||
|
@ -30,7 +31,6 @@ use hir_ty::{
|
||||||
method_resolution, ApplicationTy, CallableDefId, Canonical, FnSig, GenericPredicate,
|
method_resolution, ApplicationTy, CallableDefId, Canonical, FnSig, GenericPredicate,
|
||||||
InEnvironment, Substs, TraitEnvironment, Ty, TyDefId, TypeCtor,
|
InEnvironment, Substs, TraitEnvironment, Ty, TyDefId, TypeCtor,
|
||||||
};
|
};
|
||||||
use ra_db::{CrateId, Edition, FileId};
|
|
||||||
use rustc_hash::FxHashSet;
|
use rustc_hash::FxHashSet;
|
||||||
use stdx::impl_from;
|
use stdx::impl_from;
|
||||||
use syntax::{
|
use syntax::{
|
||||||
|
|
|
@ -29,7 +29,7 @@ macro_rules! from_id {
|
||||||
}
|
}
|
||||||
|
|
||||||
from_id![
|
from_id![
|
||||||
(ra_db::CrateId, crate::Crate),
|
(base_db::CrateId, crate::Crate),
|
||||||
(hir_def::ModuleId, crate::Module),
|
(hir_def::ModuleId, crate::Module),
|
||||||
(hir_def::StructId, crate::Struct),
|
(hir_def::StructId, crate::Struct),
|
||||||
(hir_def::UnionId, crate::Union),
|
(hir_def::UnionId, crate::Union),
|
||||||
|
|
|
@ -4,6 +4,7 @@ mod source_to_def;
|
||||||
|
|
||||||
use std::{cell::RefCell, fmt, iter::successors};
|
use std::{cell::RefCell, fmt, iter::successors};
|
||||||
|
|
||||||
|
use base_db::{FileId, FileRange};
|
||||||
use hir_def::{
|
use hir_def::{
|
||||||
resolver::{self, HasResolver, Resolver},
|
resolver::{self, HasResolver, Resolver},
|
||||||
AsMacroCall, FunctionId, TraitId, VariantId,
|
AsMacroCall, FunctionId, TraitId, VariantId,
|
||||||
|
@ -11,7 +12,6 @@ use hir_def::{
|
||||||
use hir_expand::{hygiene::Hygiene, name::AsName, ExpansionInfo};
|
use hir_expand::{hygiene::Hygiene, name::AsName, ExpansionInfo};
|
||||||
use hir_ty::associated_type_shorthand_candidates;
|
use hir_ty::associated_type_shorthand_candidates;
|
||||||
use itertools::Itertools;
|
use itertools::Itertools;
|
||||||
use ra_db::{FileId, FileRange};
|
|
||||||
use rustc_hash::{FxHashMap, FxHashSet};
|
use rustc_hash::{FxHashMap, FxHashSet};
|
||||||
use syntax::{
|
use syntax::{
|
||||||
algo::{find_node_at_offset, skip_trivia_token},
|
algo::{find_node_at_offset, skip_trivia_token},
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
//! Maps *syntax* of various definitions to their semantic ids.
|
//! Maps *syntax* of various definitions to their semantic ids.
|
||||||
|
|
||||||
|
use base_db::FileId;
|
||||||
use hir_def::{
|
use hir_def::{
|
||||||
child_by_source::ChildBySource,
|
child_by_source::ChildBySource,
|
||||||
dyn_map::DynMap,
|
dyn_map::DynMap,
|
||||||
|
@ -9,7 +10,6 @@ use hir_def::{
|
||||||
ModuleId, StaticId, StructId, TraitId, TypeAliasId, TypeParamId, UnionId, VariantId,
|
ModuleId, StaticId, StructId, TraitId, TypeAliasId, TypeParamId, UnionId, VariantId,
|
||||||
};
|
};
|
||||||
use hir_expand::{name::AsName, AstId, MacroDefKind};
|
use hir_expand::{name::AsName, AstId, MacroDefKind};
|
||||||
use ra_db::FileId;
|
|
||||||
use rustc_hash::FxHashMap;
|
use rustc_hash::FxHashMap;
|
||||||
use stdx::impl_from;
|
use stdx::impl_from;
|
||||||
use syntax::{
|
use syntax::{
|
||||||
|
|
|
@ -31,7 +31,7 @@ use crate::{
|
||||||
MacroDef, ModPath, ModuleDef, Path, PathKind, Static, Struct, Trait, Type, TypeAlias,
|
MacroDef, ModPath, ModuleDef, Path, PathKind, Static, Struct, Trait, Type, TypeAlias,
|
||||||
TypeParam,
|
TypeParam,
|
||||||
};
|
};
|
||||||
use ra_db::CrateId;
|
use base_db::CrateId;
|
||||||
|
|
||||||
/// `SourceAnalyzer` is a convenience wrapper which exposes HIR API in terms of
|
/// `SourceAnalyzer` is a convenience wrapper which exposes HIR API in terms of
|
||||||
/// original source files. It should not be used inside the HIR itself.
|
/// original source files. It should not be used inside the HIR itself.
|
||||||
|
|
|
@ -23,7 +23,7 @@ smallvec = "1.4.0"
|
||||||
stdx = { path = "../stdx" }
|
stdx = { path = "../stdx" }
|
||||||
|
|
||||||
arena = { path = "../arena" }
|
arena = { path = "../arena" }
|
||||||
ra_db = { path = "../ra_db" }
|
base_db = { path = "../base_db" }
|
||||||
syntax = { path = "../syntax" }
|
syntax = { path = "../syntax" }
|
||||||
profile = { path = "../profile" }
|
profile = { path = "../profile" }
|
||||||
hir_expand = { path = "../ra_hir_expand", package = "ra_hir_expand" }
|
hir_expand = { path = "../ra_hir_expand", package = "ra_hir_expand" }
|
||||||
|
|
|
@ -6,11 +6,11 @@ pub mod scope;
|
||||||
use std::{mem, ops::Index, sync::Arc};
|
use std::{mem, ops::Index, sync::Arc};
|
||||||
|
|
||||||
use arena::{map::ArenaMap, Arena};
|
use arena::{map::ArenaMap, Arena};
|
||||||
|
use base_db::CrateId;
|
||||||
use cfg::CfgOptions;
|
use cfg::CfgOptions;
|
||||||
use drop_bomb::DropBomb;
|
use drop_bomb::DropBomb;
|
||||||
use either::Either;
|
use either::Either;
|
||||||
use hir_expand::{ast_id_map::AstIdMap, hygiene::Hygiene, AstId, HirFileId, InFile, MacroDefId};
|
use hir_expand::{ast_id_map::AstIdMap, hygiene::Hygiene, AstId, HirFileId, InFile, MacroDefId};
|
||||||
use ra_db::CrateId;
|
|
||||||
use rustc_hash::FxHashMap;
|
use rustc_hash::FxHashMap;
|
||||||
use syntax::{ast, AstNode, AstPtr};
|
use syntax::{ast, AstNode, AstPtr};
|
||||||
use test_utils::mark;
|
use test_utils::mark;
|
||||||
|
@ -320,7 +320,7 @@ impl BodySourceMap {
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use ra_db::{fixture::WithFixture, SourceDatabase};
|
use base_db::{fixture::WithFixture, SourceDatabase};
|
||||||
use test_utils::mark;
|
use test_utils::mark;
|
||||||
|
|
||||||
use crate::ModuleDefId;
|
use crate::ModuleDefId;
|
||||||
|
|
|
@ -169,8 +169,8 @@ fn compute_expr_scopes(expr: ExprId, body: &Body, scopes: &mut ExprScopes, scope
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
|
use base_db::{fixture::WithFixture, FileId, SourceDatabase};
|
||||||
use hir_expand::{name::AsName, InFile};
|
use hir_expand::{name::AsName, InFile};
|
||||||
use ra_db::{fixture::WithFixture, FileId, SourceDatabase};
|
|
||||||
use syntax::{algo::find_node_at_offset, ast, AstNode};
|
use syntax::{algo::find_node_at_offset, ast, AstNode};
|
||||||
use test_utils::{assert_eq_text, extract_offset, mark};
|
use test_utils::{assert_eq_text, extract_offset, mark};
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
//! Defines database & queries for name resolution.
|
//! Defines database & queries for name resolution.
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
|
use base_db::{salsa, CrateId, SourceDatabase, Upcast};
|
||||||
use hir_expand::{db::AstDatabase, HirFileId};
|
use hir_expand::{db::AstDatabase, HirFileId};
|
||||||
use ra_db::{salsa, CrateId, SourceDatabase, Upcast};
|
|
||||||
use syntax::SmolStr;
|
use syntax::SmolStr;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
|
|
|
@ -292,8 +292,8 @@ fn find_local_import_locations(
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
|
use base_db::fixture::WithFixture;
|
||||||
use hir_expand::hygiene::Hygiene;
|
use hir_expand::hygiene::Hygiene;
|
||||||
use ra_db::fixture::WithFixture;
|
|
||||||
use syntax::ast::AstNode;
|
use syntax::ast::AstNode;
|
||||||
use test_utils::mark;
|
use test_utils::mark;
|
||||||
|
|
||||||
|
|
|
@ -5,12 +5,12 @@
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use arena::{map::ArenaMap, Arena};
|
use arena::{map::ArenaMap, Arena};
|
||||||
|
use base_db::FileId;
|
||||||
use either::Either;
|
use either::Either;
|
||||||
use hir_expand::{
|
use hir_expand::{
|
||||||
name::{name, AsName, Name},
|
name::{name, AsName, Name},
|
||||||
InFile,
|
InFile,
|
||||||
};
|
};
|
||||||
use ra_db::FileId;
|
|
||||||
use syntax::ast::{self, GenericParamsOwner, NameOwner, TypeBoundsOwner};
|
use syntax::ast::{self, GenericParamsOwner, NameOwner, TypeBoundsOwner};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
|
|
||||||
use std::{cmp::Ordering, fmt, hash::BuildHasherDefault, sync::Arc};
|
use std::{cmp::Ordering, fmt, hash::BuildHasherDefault, sync::Arc};
|
||||||
|
|
||||||
|
use base_db::CrateId;
|
||||||
use fst::{self, Streamer};
|
use fst::{self, Streamer};
|
||||||
use indexmap::{map::Entry, IndexMap};
|
use indexmap::{map::Entry, IndexMap};
|
||||||
use ra_db::CrateId;
|
|
||||||
use rustc_hash::{FxHashMap, FxHasher};
|
use rustc_hash::{FxHashMap, FxHasher};
|
||||||
use smallvec::SmallVec;
|
use smallvec::SmallVec;
|
||||||
use syntax::SmolStr;
|
use syntax::SmolStr;
|
||||||
|
@ -327,8 +327,8 @@ pub fn search_dependencies<'a>(
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
|
use base_db::{fixture::WithFixture, SourceDatabase, Upcast};
|
||||||
use expect::{expect, Expect};
|
use expect::{expect, Expect};
|
||||||
use ra_db::{fixture::WithFixture, SourceDatabase, Upcast};
|
|
||||||
|
|
||||||
use crate::{test_db::TestDB, AssocContainerId, Lookup};
|
use crate::{test_db::TestDB, AssocContainerId, Lookup};
|
||||||
|
|
||||||
|
|
|
@ -3,9 +3,9 @@
|
||||||
|
|
||||||
use std::collections::hash_map::Entry;
|
use std::collections::hash_map::Entry;
|
||||||
|
|
||||||
|
use base_db::CrateId;
|
||||||
use hir_expand::name::Name;
|
use hir_expand::name::Name;
|
||||||
use once_cell::sync::Lazy;
|
use once_cell::sync::Lazy;
|
||||||
use ra_db::CrateId;
|
|
||||||
use rustc_hash::{FxHashMap, FxHashSet};
|
use rustc_hash::{FxHashMap, FxHashSet};
|
||||||
use test_utils::mark;
|
use test_utils::mark;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
|
use base_db::fixture::WithFixture;
|
||||||
use expect::{expect, Expect};
|
use expect::{expect, Expect};
|
||||||
use hir_expand::{db::AstDatabase, HirFileId, InFile};
|
use hir_expand::{db::AstDatabase, HirFileId, InFile};
|
||||||
use ra_db::fixture::WithFixture;
|
|
||||||
use rustc_hash::FxHashSet;
|
use rustc_hash::FxHashSet;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use stdx::format_to;
|
use stdx::format_to;
|
||||||
|
|
|
@ -53,11 +53,11 @@ mod test_db;
|
||||||
use std::hash::{Hash, Hasher};
|
use std::hash::{Hash, Hasher};
|
||||||
|
|
||||||
use arena::Idx;
|
use arena::Idx;
|
||||||
|
use base_db::{impl_intern_key, salsa, CrateId};
|
||||||
use hir_expand::{
|
use hir_expand::{
|
||||||
ast_id_map::FileAstId, eager::expand_eager_macro, hygiene::Hygiene, AstId, HirFileId, InFile,
|
ast_id_map::FileAstId, eager::expand_eager_macro, hygiene::Hygiene, AstId, HirFileId, InFile,
|
||||||
MacroCallId, MacroCallKind, MacroDefId, MacroDefKind,
|
MacroCallId, MacroCallKind, MacroDefId, MacroDefKind,
|
||||||
};
|
};
|
||||||
use ra_db::{impl_intern_key, salsa, CrateId};
|
|
||||||
use syntax::ast;
|
use syntax::ast;
|
||||||
|
|
||||||
use crate::builtin_type::BuiltinType;
|
use crate::builtin_type::BuiltinType;
|
||||||
|
|
|
@ -57,8 +57,8 @@ mod tests;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use arena::Arena;
|
use arena::Arena;
|
||||||
|
use base_db::{CrateId, Edition, FileId};
|
||||||
use hir_expand::{diagnostics::DiagnosticSink, name::Name, InFile};
|
use hir_expand::{diagnostics::DiagnosticSink, name::Name, InFile};
|
||||||
use ra_db::{CrateId, Edition, FileId};
|
|
||||||
use rustc_hash::FxHashMap;
|
use rustc_hash::FxHashMap;
|
||||||
use stdx::format_to;
|
use stdx::format_to;
|
||||||
use syntax::ast;
|
use syntax::ast;
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
//! `DefCollector::collect` contains the fixed-point iteration loop which
|
//! `DefCollector::collect` contains the fixed-point iteration loop which
|
||||||
//! resolves imports and expands macros.
|
//! resolves imports and expands macros.
|
||||||
|
|
||||||
|
use base_db::{CrateId, FileId, ProcMacroId};
|
||||||
use cfg::CfgOptions;
|
use cfg::CfgOptions;
|
||||||
use hir_expand::{
|
use hir_expand::{
|
||||||
ast_id_map::FileAstId,
|
ast_id_map::FileAstId,
|
||||||
|
@ -12,7 +13,6 @@ use hir_expand::{
|
||||||
proc_macro::ProcMacroExpander,
|
proc_macro::ProcMacroExpander,
|
||||||
HirFileId, MacroCallId, MacroDefId, MacroDefKind,
|
HirFileId, MacroCallId, MacroDefId, MacroDefKind,
|
||||||
};
|
};
|
||||||
use ra_db::{CrateId, FileId, ProcMacroId};
|
|
||||||
use rustc_hash::FxHashMap;
|
use rustc_hash::FxHashMap;
|
||||||
use syntax::ast;
|
use syntax::ast;
|
||||||
use test_utils::mark;
|
use test_utils::mark;
|
||||||
|
@ -1209,7 +1209,7 @@ fn is_macro_rules(path: &ModPath) -> bool {
|
||||||
mod tests {
|
mod tests {
|
||||||
use crate::{db::DefDatabase, test_db::TestDB};
|
use crate::{db::DefDatabase, test_db::TestDB};
|
||||||
use arena::Arena;
|
use arena::Arena;
|
||||||
use ra_db::{fixture::WithFixture, SourceDatabase};
|
use base_db::{fixture::WithFixture, SourceDatabase};
|
||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
//! This module resolves `mod foo;` declaration to file.
|
//! This module resolves `mod foo;` declaration to file.
|
||||||
|
use base_db::FileId;
|
||||||
use hir_expand::name::Name;
|
use hir_expand::name::Name;
|
||||||
use ra_db::FileId;
|
|
||||||
use syntax::SmolStr;
|
use syntax::SmolStr;
|
||||||
|
|
||||||
use crate::{db::DefDatabase, HirFileId};
|
use crate::{db::DefDatabase, HirFileId};
|
||||||
|
|
|
@ -12,8 +12,8 @@
|
||||||
|
|
||||||
use std::iter::successors;
|
use std::iter::successors;
|
||||||
|
|
||||||
|
use base_db::Edition;
|
||||||
use hir_expand::name::Name;
|
use hir_expand::name::Name;
|
||||||
use ra_db::Edition;
|
|
||||||
use test_utils::mark;
|
use test_utils::mark;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
|
|
|
@ -6,8 +6,8 @@ mod primitives;
|
||||||
|
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
|
use base_db::{fixture::WithFixture, SourceDatabase};
|
||||||
use expect::{expect, Expect};
|
use expect::{expect, Expect};
|
||||||
use ra_db::{fixture::WithFixture, SourceDatabase};
|
|
||||||
use test_utils::mark;
|
use test_utils::mark;
|
||||||
|
|
||||||
use crate::{db::DefDatabase, nameres::*, test_db::TestDB};
|
use crate::{db::DefDatabase, nameres::*, test_db::TestDB};
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use ra_db::SourceDatabaseExt;
|
use base_db::SourceDatabaseExt;
|
||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
|
|
|
@ -8,11 +8,11 @@ use std::{
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::body::LowerCtx;
|
use crate::body::LowerCtx;
|
||||||
|
use base_db::CrateId;
|
||||||
use hir_expand::{
|
use hir_expand::{
|
||||||
hygiene::Hygiene,
|
hygiene::Hygiene,
|
||||||
name::{AsName, Name},
|
name::{AsName, Name},
|
||||||
};
|
};
|
||||||
use ra_db::CrateId;
|
|
||||||
use syntax::ast;
|
use syntax::ast;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
//! Name resolution façade.
|
//! Name resolution façade.
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
|
use base_db::CrateId;
|
||||||
use hir_expand::{
|
use hir_expand::{
|
||||||
name::{name, Name},
|
name::{name, Name},
|
||||||
MacroDefId,
|
MacroDefId,
|
||||||
};
|
};
|
||||||
use ra_db::CrateId;
|
|
||||||
use rustc_hash::FxHashSet;
|
use rustc_hash::FxHashSet;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
|
|
|
@ -5,15 +5,15 @@ use std::{
|
||||||
sync::{Arc, Mutex},
|
sync::{Arc, Mutex},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
use base_db::{salsa, CrateId, FileId, FileLoader, FileLoaderDelegate, Upcast};
|
||||||
use hir_expand::db::AstDatabase;
|
use hir_expand::db::AstDatabase;
|
||||||
use ra_db::{salsa, CrateId, FileId, FileLoader, FileLoaderDelegate, Upcast};
|
|
||||||
use rustc_hash::FxHashSet;
|
use rustc_hash::FxHashSet;
|
||||||
|
|
||||||
use crate::db::DefDatabase;
|
use crate::db::DefDatabase;
|
||||||
|
|
||||||
#[salsa::database(
|
#[salsa::database(
|
||||||
ra_db::SourceDatabaseExtStorage,
|
base_db::SourceDatabaseExtStorage,
|
||||||
ra_db::SourceDatabaseStorage,
|
base_db::SourceDatabaseStorage,
|
||||||
hir_expand::db::AstDatabaseStorage,
|
hir_expand::db::AstDatabaseStorage,
|
||||||
crate::db::InternDatabaseStorage,
|
crate::db::InternDatabaseStorage,
|
||||||
crate::db::DefDatabaseStorage
|
crate::db::DefDatabaseStorage
|
||||||
|
|
|
@ -14,7 +14,7 @@ either = "1.5.3"
|
||||||
rustc-hash = "1.0.0"
|
rustc-hash = "1.0.0"
|
||||||
|
|
||||||
arena = { path = "../arena" }
|
arena = { path = "../arena" }
|
||||||
ra_db = { path = "../ra_db" }
|
base_db = { path = "../base_db" }
|
||||||
syntax = { path = "../syntax" }
|
syntax = { path = "../syntax" }
|
||||||
parser = { path = "../parser" }
|
parser = { path = "../parser" }
|
||||||
profile = { path = "../profile" }
|
profile = { path = "../profile" }
|
||||||
|
|
|
@ -253,8 +253,8 @@ fn partial_ord_expand(
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
|
use base_db::{fixture::WithFixture, CrateId, SourceDatabase};
|
||||||
use name::{known, Name};
|
use name::{known, Name};
|
||||||
use ra_db::{fixture::WithFixture, CrateId, SourceDatabase};
|
|
||||||
|
|
||||||
use crate::{test_db::TestDB, AstId, MacroCallId, MacroCallKind, MacroCallLoc};
|
use crate::{test_db::TestDB, AstId, MacroCallId, MacroCallKind, MacroCallLoc};
|
||||||
|
|
||||||
|
|
|
@ -4,10 +4,10 @@ use crate::{
|
||||||
MacroDefId, MacroDefKind, TextSize,
|
MacroDefId, MacroDefKind, TextSize,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
use base_db::FileId;
|
||||||
use either::Either;
|
use either::Either;
|
||||||
use mbe::parse_to_token_tree;
|
use mbe::parse_to_token_tree;
|
||||||
use parser::FragmentKind;
|
use parser::FragmentKind;
|
||||||
use ra_db::FileId;
|
|
||||||
use syntax::ast::{self, AstToken, HasStringValue};
|
use syntax::ast::{self, AstToken, HasStringValue};
|
||||||
|
|
||||||
macro_rules! register_builtin {
|
macro_rules! register_builtin {
|
||||||
|
@ -426,7 +426,7 @@ mod tests {
|
||||||
name::AsName, test_db::TestDB, AstNode, EagerCallLoc, MacroCallId, MacroCallKind,
|
name::AsName, test_db::TestDB, AstNode, EagerCallLoc, MacroCallId, MacroCallKind,
|
||||||
MacroCallLoc,
|
MacroCallLoc,
|
||||||
};
|
};
|
||||||
use ra_db::{fixture::WithFixture, SourceDatabase};
|
use base_db::{fixture::WithFixture, SourceDatabase};
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use syntax::ast::NameOwner;
|
use syntax::ast::NameOwner;
|
||||||
|
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
|
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
|
use base_db::{salsa, SourceDatabase};
|
||||||
use mbe::{ExpandResult, MacroRules};
|
use mbe::{ExpandResult, MacroRules};
|
||||||
use parser::FragmentKind;
|
use parser::FragmentKind;
|
||||||
use ra_db::{salsa, SourceDatabase};
|
|
||||||
use syntax::{algo::diff, AstNode, GreenNode, Parse, SyntaxKind::*, SyntaxNode};
|
use syntax::{algo::diff, AstNode, GreenNode, Parse, SyntaxKind::*, SyntaxNode};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
|
|
|
@ -25,8 +25,8 @@ use crate::{
|
||||||
EagerCallLoc, EagerMacroId, InFile, MacroCallId, MacroCallKind, MacroDefId, MacroDefKind,
|
EagerCallLoc, EagerMacroId, InFile, MacroCallId, MacroCallKind, MacroDefId, MacroDefKind,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
use base_db::CrateId;
|
||||||
use parser::FragmentKind;
|
use parser::FragmentKind;
|
||||||
use ra_db::CrateId;
|
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use syntax::{algo::SyntaxRewriter, SyntaxNode};
|
use syntax::{algo::SyntaxRewriter, SyntaxNode};
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
//!
|
//!
|
||||||
//! Specifically, `ast` + `Hygiene` allows you to create a `Name`. Note that, at
|
//! Specifically, `ast` + `Hygiene` allows you to create a `Name`. Note that, at
|
||||||
//! this moment, this is horribly incomplete and handles only `$crate`.
|
//! this moment, this is horribly incomplete and handles only `$crate`.
|
||||||
|
use base_db::CrateId;
|
||||||
use either::Either;
|
use either::Either;
|
||||||
use ra_db::CrateId;
|
|
||||||
use syntax::ast;
|
use syntax::ast;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
|
|
|
@ -18,7 +18,7 @@ pub mod eager;
|
||||||
use std::hash::Hash;
|
use std::hash::Hash;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use ra_db::{impl_intern_key, salsa, CrateId, FileId};
|
use base_db::{impl_intern_key, salsa, CrateId, FileId};
|
||||||
use syntax::{
|
use syntax::{
|
||||||
algo,
|
algo,
|
||||||
ast::{self, AstNode},
|
ast::{self, AstNode},
|
||||||
|
|
|
@ -115,7 +115,7 @@ impl AsName for ast::FieldKind {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl AsName for ra_db::Dependency {
|
impl AsName for base_db::Dependency {
|
||||||
fn as_name(&self) -> Name {
|
fn as_name(&self) -> Name {
|
||||||
Name::new_text(SmolStr::new(&*self.name))
|
Name::new_text(SmolStr::new(&*self.name))
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
//! Proc Macro Expander stub
|
//! Proc Macro Expander stub
|
||||||
|
|
||||||
use crate::{db::AstDatabase, LazyMacroId};
|
use crate::{db::AstDatabase, LazyMacroId};
|
||||||
use ra_db::{CrateId, ProcMacroId};
|
use base_db::{CrateId, ProcMacroId};
|
||||||
use tt::buffer::{Cursor, TokenBuffer};
|
use tt::buffer::{Cursor, TokenBuffer};
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, Eq, PartialEq, Hash)]
|
#[derive(Debug, Clone, Copy, Eq, PartialEq, Hash)]
|
||||||
|
|
|
@ -5,12 +5,12 @@ use std::{
|
||||||
sync::{Arc, Mutex},
|
sync::{Arc, Mutex},
|
||||||
};
|
};
|
||||||
|
|
||||||
use ra_db::{salsa, CrateId, FileId, FileLoader, FileLoaderDelegate};
|
use base_db::{salsa, CrateId, FileId, FileLoader, FileLoaderDelegate};
|
||||||
use rustc_hash::FxHashSet;
|
use rustc_hash::FxHashSet;
|
||||||
|
|
||||||
#[salsa::database(
|
#[salsa::database(
|
||||||
ra_db::SourceDatabaseExtStorage,
|
base_db::SourceDatabaseExtStorage,
|
||||||
ra_db::SourceDatabaseStorage,
|
base_db::SourceDatabaseStorage,
|
||||||
crate::db::AstDatabaseStorage
|
crate::db::AstDatabaseStorage
|
||||||
)]
|
)]
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
|
|
|
@ -21,7 +21,7 @@ stdx = { path = "../stdx" }
|
||||||
hir_def = { path = "../ra_hir_def", package = "ra_hir_def" }
|
hir_def = { path = "../ra_hir_def", package = "ra_hir_def" }
|
||||||
hir_expand = { path = "../ra_hir_expand", package = "ra_hir_expand" }
|
hir_expand = { path = "../ra_hir_expand", package = "ra_hir_expand" }
|
||||||
arena = { path = "../arena" }
|
arena = { path = "../arena" }
|
||||||
ra_db = { path = "../ra_db" }
|
base_db = { path = "../base_db" }
|
||||||
profile = { path = "../profile" }
|
profile = { path = "../profile" }
|
||||||
syntax = { path = "../syntax" }
|
syntax = { path = "../syntax" }
|
||||||
test_utils = { path = "../test_utils" }
|
test_utils = { path = "../test_utils" }
|
||||||
|
|
|
@ -5,10 +5,10 @@
|
||||||
|
|
||||||
use std::iter::successors;
|
use std::iter::successors;
|
||||||
|
|
||||||
|
use base_db::CrateId;
|
||||||
use hir_def::lang_item::LangItemTarget;
|
use hir_def::lang_item::LangItemTarget;
|
||||||
use hir_expand::name::name;
|
use hir_expand::name::name;
|
||||||
use log::{info, warn};
|
use log::{info, warn};
|
||||||
use ra_db::CrateId;
|
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
db::HirDatabase,
|
db::HirDatabase,
|
||||||
|
|
|
@ -3,11 +3,11 @@
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use arena::map::ArenaMap;
|
use arena::map::ArenaMap;
|
||||||
|
use base_db::{impl_intern_key, salsa, CrateId, Upcast};
|
||||||
use hir_def::{
|
use hir_def::{
|
||||||
db::DefDatabase, expr::ExprId, DefWithBodyId, FunctionId, GenericDefId, ImplId, LocalFieldId,
|
db::DefDatabase, expr::ExprId, DefWithBodyId, FunctionId, GenericDefId, ImplId, LocalFieldId,
|
||||||
TypeParamId, VariantId,
|
TypeParamId, VariantId,
|
||||||
};
|
};
|
||||||
use ra_db::{impl_intern_key, salsa, CrateId, Upcast};
|
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
method_resolution::{InherentImpls, TraitImpls},
|
method_resolution::{InherentImpls, TraitImpls},
|
||||||
|
|
|
@ -208,12 +208,12 @@ impl Diagnostic for MismatchedArgCount {
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
|
use base_db::{fixture::WithFixture, FileId, SourceDatabase, SourceDatabaseExt};
|
||||||
use hir_def::{db::DefDatabase, AssocItemId, ModuleDefId};
|
use hir_def::{db::DefDatabase, AssocItemId, ModuleDefId};
|
||||||
use hir_expand::{
|
use hir_expand::{
|
||||||
db::AstDatabase,
|
db::AstDatabase,
|
||||||
diagnostics::{Diagnostic, DiagnosticSinkBuilder},
|
diagnostics::{Diagnostic, DiagnosticSinkBuilder},
|
||||||
};
|
};
|
||||||
use ra_db::{fixture::WithFixture, FileId, SourceDatabase, SourceDatabaseExt};
|
|
||||||
use rustc_hash::FxHashMap;
|
use rustc_hash::FxHashMap;
|
||||||
use syntax::{TextRange, TextSize};
|
use syntax::{TextRange, TextSize};
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,7 @@ mod test_db;
|
||||||
|
|
||||||
use std::{iter, mem, ops::Deref, sync::Arc};
|
use std::{iter, mem, ops::Deref, sync::Arc};
|
||||||
|
|
||||||
|
use base_db::{salsa, CrateId};
|
||||||
use hir_def::{
|
use hir_def::{
|
||||||
expr::ExprId,
|
expr::ExprId,
|
||||||
type_ref::{Mutability, Rawness},
|
type_ref::{Mutability, Rawness},
|
||||||
|
@ -33,7 +34,6 @@ use hir_def::{
|
||||||
TypeParamId,
|
TypeParamId,
|
||||||
};
|
};
|
||||||
use itertools::Itertools;
|
use itertools::Itertools;
|
||||||
use ra_db::{salsa, CrateId};
|
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
db::HirDatabase,
|
db::HirDatabase,
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
use std::{iter, sync::Arc};
|
use std::{iter, sync::Arc};
|
||||||
|
|
||||||
use arena::map::ArenaMap;
|
use arena::map::ArenaMap;
|
||||||
|
use base_db::CrateId;
|
||||||
use hir_def::{
|
use hir_def::{
|
||||||
adt::StructKind,
|
adt::StructKind,
|
||||||
builtin_type::BuiltinType,
|
builtin_type::BuiltinType,
|
||||||
|
@ -20,7 +21,6 @@ use hir_def::{
|
||||||
UnionId, VariantId,
|
UnionId, VariantId,
|
||||||
};
|
};
|
||||||
use hir_expand::name::Name;
|
use hir_expand::name::Name;
|
||||||
use ra_db::CrateId;
|
|
||||||
use smallvec::SmallVec;
|
use smallvec::SmallVec;
|
||||||
use stdx::impl_from;
|
use stdx::impl_from;
|
||||||
use test_utils::mark;
|
use test_utils::mark;
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
use std::{iter, sync::Arc};
|
use std::{iter, sync::Arc};
|
||||||
|
|
||||||
use arrayvec::ArrayVec;
|
use arrayvec::ArrayVec;
|
||||||
|
use base_db::CrateId;
|
||||||
use hir_def::{
|
use hir_def::{
|
||||||
builtin_type::{IntBitness, Signedness},
|
builtin_type::{IntBitness, Signedness},
|
||||||
lang_item::LangItemTarget,
|
lang_item::LangItemTarget,
|
||||||
|
@ -12,7 +13,6 @@ use hir_def::{
|
||||||
AssocContainerId, AssocItemId, FunctionId, HasModule, ImplId, Lookup, TraitId,
|
AssocContainerId, AssocItemId, FunctionId, HasModule, ImplId, Lookup, TraitId,
|
||||||
};
|
};
|
||||||
use hir_expand::name::Name;
|
use hir_expand::name::Name;
|
||||||
use ra_db::CrateId;
|
|
||||||
use rustc_hash::{FxHashMap, FxHashSet};
|
use rustc_hash::{FxHashMap, FxHashSet};
|
||||||
|
|
||||||
use super::Substs;
|
use super::Substs;
|
||||||
|
|
|
@ -5,16 +5,16 @@ use std::{
|
||||||
sync::{Arc, Mutex},
|
sync::{Arc, Mutex},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
use base_db::{salsa, CrateId, FileId, FileLoader, FileLoaderDelegate, SourceDatabase, Upcast};
|
||||||
use hir_def::{db::DefDatabase, ModuleId};
|
use hir_def::{db::DefDatabase, ModuleId};
|
||||||
use hir_expand::db::AstDatabase;
|
use hir_expand::db::AstDatabase;
|
||||||
use ra_db::{salsa, CrateId, FileId, FileLoader, FileLoaderDelegate, SourceDatabase, Upcast};
|
|
||||||
use rustc_hash::{FxHashMap, FxHashSet};
|
use rustc_hash::{FxHashMap, FxHashSet};
|
||||||
use syntax::TextRange;
|
use syntax::TextRange;
|
||||||
use test_utils::extract_annotations;
|
use test_utils::extract_annotations;
|
||||||
|
|
||||||
#[salsa::database(
|
#[salsa::database(
|
||||||
ra_db::SourceDatabaseExtStorage,
|
base_db::SourceDatabaseExtStorage,
|
||||||
ra_db::SourceDatabaseStorage,
|
base_db::SourceDatabaseStorage,
|
||||||
hir_expand::db::AstDatabaseStorage,
|
hir_expand::db::AstDatabaseStorage,
|
||||||
hir_def::db::InternDatabaseStorage,
|
hir_def::db::InternDatabaseStorage,
|
||||||
hir_def::db::DefDatabaseStorage,
|
hir_def::db::DefDatabaseStorage,
|
||||||
|
|
|
@ -10,6 +10,7 @@ mod display_source_code;
|
||||||
|
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
|
use base_db::{fixture::WithFixture, FileRange, SourceDatabase, SourceDatabaseExt};
|
||||||
use expect::Expect;
|
use expect::Expect;
|
||||||
use hir_def::{
|
use hir_def::{
|
||||||
body::{BodySourceMap, SyntheticSyntax},
|
body::{BodySourceMap, SyntheticSyntax},
|
||||||
|
@ -21,7 +22,6 @@ use hir_def::{
|
||||||
AssocItemId, DefWithBodyId, LocalModuleId, Lookup, ModuleDefId,
|
AssocItemId, DefWithBodyId, LocalModuleId, Lookup, ModuleDefId,
|
||||||
};
|
};
|
||||||
use hir_expand::{db::AstDatabase, InFile};
|
use hir_expand::{db::AstDatabase, InFile};
|
||||||
use ra_db::{fixture::WithFixture, FileRange, SourceDatabase, SourceDatabaseExt};
|
|
||||||
use stdx::format_to;
|
use stdx::format_to;
|
||||||
use syntax::{
|
use syntax::{
|
||||||
algo,
|
algo,
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
//! Trait solving using Chalk.
|
//! Trait solving using Chalk.
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
|
use base_db::CrateId;
|
||||||
use chalk_ir::cast::Cast;
|
use chalk_ir::cast::Cast;
|
||||||
use chalk_solve::Solver;
|
use chalk_solve::Solver;
|
||||||
use hir_def::{lang_item::LangItemTarget, TraitId};
|
use hir_def::{lang_item::LangItemTarget, TraitId};
|
||||||
use ra_db::CrateId;
|
|
||||||
|
|
||||||
use crate::{db::HirDatabase, DebruijnIndex, Substs};
|
use crate::{db::HirDatabase, DebruijnIndex, Substs};
|
||||||
|
|
||||||
|
|
|
@ -6,11 +6,11 @@ use log::debug;
|
||||||
use chalk_ir::{fold::shift::Shift, CanonicalVarKinds, GenericArg, TypeName};
|
use chalk_ir::{fold::shift::Shift, CanonicalVarKinds, GenericArg, TypeName};
|
||||||
use chalk_solve::rust_ir::{self, OpaqueTyDatumBound, WellKnownTrait};
|
use chalk_solve::rust_ir::{self, OpaqueTyDatumBound, WellKnownTrait};
|
||||||
|
|
||||||
|
use base_db::{salsa::InternKey, CrateId};
|
||||||
use hir_def::{
|
use hir_def::{
|
||||||
lang_item::{lang_attr, LangItemTarget},
|
lang_item::{lang_attr, LangItemTarget},
|
||||||
AssocContainerId, AssocItemId, HasModule, Lookup, TypeAliasId,
|
AssocContainerId, AssocItemId, HasModule, Lookup, TypeAliasId,
|
||||||
};
|
};
|
||||||
use ra_db::{salsa::InternKey, CrateId};
|
|
||||||
|
|
||||||
use super::ChalkContext;
|
use super::ChalkContext;
|
||||||
use crate::{
|
use crate::{
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
//! representation of the various objects Chalk deals with (types, goals etc.).
|
//! representation of the various objects Chalk deals with (types, goals etc.).
|
||||||
|
|
||||||
use super::tls;
|
use super::tls;
|
||||||
|
use base_db::salsa::InternId;
|
||||||
use chalk_ir::{GenericArg, Goal, GoalData};
|
use chalk_ir::{GenericArg, Goal, GoalData};
|
||||||
use hir_def::TypeAliasId;
|
use hir_def::TypeAliasId;
|
||||||
use ra_db::salsa::InternId;
|
|
||||||
use std::{fmt, sync::Arc};
|
use std::{fmt, sync::Arc};
|
||||||
|
|
||||||
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
|
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
|
||||||
|
|
|
@ -9,8 +9,8 @@ use chalk_ir::{
|
||||||
};
|
};
|
||||||
use chalk_solve::rust_ir;
|
use chalk_solve::rust_ir;
|
||||||
|
|
||||||
|
use base_db::salsa::InternKey;
|
||||||
use hir_def::{type_ref::Mutability, AssocContainerId, GenericDefId, Lookup, TypeAliasId};
|
use hir_def::{type_ref::Mutability, AssocContainerId, GenericDefId, Lookup, TypeAliasId};
|
||||||
use ra_db::salsa::InternKey;
|
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
db::HirDatabase,
|
db::HirDatabase,
|
||||||
|
|
|
@ -23,7 +23,7 @@ stdx = { path = "../stdx" }
|
||||||
|
|
||||||
syntax = { path = "../syntax" }
|
syntax = { path = "../syntax" }
|
||||||
text_edit = { path = "../text_edit" }
|
text_edit = { path = "../text_edit" }
|
||||||
ra_db = { path = "../ra_db" }
|
base_db = { path = "../base_db" }
|
||||||
ra_ide_db = { path = "../ra_ide_db" }
|
ra_ide_db = { path = "../ra_ide_db" }
|
||||||
cfg = { path = "../cfg" }
|
cfg = { path = "../cfg" }
|
||||||
profile = { path = "../profile" }
|
profile = { path = "../profile" }
|
||||||
|
|
|
@ -137,7 +137,7 @@ impl CallLocations {
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use ra_db::FilePosition;
|
use base_db::FilePosition;
|
||||||
|
|
||||||
use crate::mock_analysis::analysis_and_position;
|
use crate::mock_analysis::analysis_and_position;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
//! FIXME: write short doc here
|
//! FIXME: write short doc here
|
||||||
|
|
||||||
|
use base_db::SourceDatabase;
|
||||||
use hir::{Semantics, SemanticsScope, Type};
|
use hir::{Semantics, SemanticsScope, Type};
|
||||||
use ra_db::SourceDatabase;
|
|
||||||
use ra_ide_db::RootDatabase;
|
use ra_ide_db::RootDatabase;
|
||||||
use syntax::{
|
use syntax::{
|
||||||
algo::{find_covering_element, find_node_at_offset},
|
algo::{find_covering_element, find_node_at_offset},
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
|
|
||||||
use std::cell::RefCell;
|
use std::cell::RefCell;
|
||||||
|
|
||||||
|
use base_db::SourceDatabase;
|
||||||
use hir::{diagnostics::DiagnosticSinkBuilder, Semantics};
|
use hir::{diagnostics::DiagnosticSinkBuilder, Semantics};
|
||||||
use itertools::Itertools;
|
use itertools::Itertools;
|
||||||
use ra_db::SourceDatabase;
|
|
||||||
use ra_ide_db::RootDatabase;
|
use ra_ide_db::RootDatabase;
|
||||||
use syntax::{
|
use syntax::{
|
||||||
ast::{self, AstNode},
|
ast::{self, AstNode},
|
||||||
|
|
|
@ -2,12 +2,12 @@
|
||||||
//! The same module also has all curret custom fixes for the diagnostics implemented.
|
//! The same module also has all curret custom fixes for the diagnostics implemented.
|
||||||
use crate::Fix;
|
use crate::Fix;
|
||||||
use ast::{edit::IndentLevel, make};
|
use ast::{edit::IndentLevel, make};
|
||||||
|
use base_db::FileId;
|
||||||
use hir::{
|
use hir::{
|
||||||
db::AstDatabase,
|
db::AstDatabase,
|
||||||
diagnostics::{Diagnostic, MissingFields, MissingOkInTailExpr, NoSuchField, UnresolvedModule},
|
diagnostics::{Diagnostic, MissingFields, MissingOkInTailExpr, NoSuchField, UnresolvedModule},
|
||||||
HasSource, HirDisplay, Semantics, VariantDef,
|
HasSource, HirDisplay, Semantics, VariantDef,
|
||||||
};
|
};
|
||||||
use ra_db::FileId;
|
|
||||||
use ra_ide_db::{
|
use ra_ide_db::{
|
||||||
source_change::{FileSystemEdit, SourceFileEdit},
|
source_change::{FileSystemEdit, SourceFileEdit},
|
||||||
RootDatabase,
|
RootDatabase,
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
//! FIXME: write short doc here
|
//! FIXME: write short doc here
|
||||||
|
|
||||||
|
use base_db::{FileId, SourceDatabase};
|
||||||
use either::Either;
|
use either::Either;
|
||||||
use hir::{original_range, AssocItem, FieldSource, HasSource, InFile, ModuleSource};
|
use hir::{original_range, AssocItem, FieldSource, HasSource, InFile, ModuleSource};
|
||||||
use ra_db::{FileId, SourceDatabase};
|
|
||||||
use ra_ide_db::{defs::Definition, RootDatabase};
|
use ra_ide_db::{defs::Definition, RootDatabase};
|
||||||
use syntax::{
|
use syntax::{
|
||||||
ast::{self, DocCommentsOwner, NameOwner},
|
ast::{self, DocCommentsOwner, NameOwner},
|
||||||
|
|
|
@ -100,7 +100,7 @@ pub(crate) fn reference_definition(
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use ra_db::FileRange;
|
use base_db::FileRange;
|
||||||
use syntax::{TextRange, TextSize};
|
use syntax::{TextRange, TextSize};
|
||||||
|
|
||||||
use crate::mock_analysis::MockAnalysis;
|
use crate::mock_analysis::MockAnalysis;
|
||||||
|
|
|
@ -74,7 +74,7 @@ fn impls_for_trait(
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use ra_db::FileRange;
|
use base_db::FileRange;
|
||||||
|
|
||||||
use crate::mock_analysis::MockAnalysis;
|
use crate::mock_analysis::MockAnalysis;
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,7 @@ fn pick_best(tokens: TokenAtOffset<SyntaxToken>) -> Option<SyntaxToken> {
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use ra_db::FileRange;
|
use base_db::FileRange;
|
||||||
|
|
||||||
use crate::mock_analysis::MockAnalysis;
|
use crate::mock_analysis::MockAnalysis;
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
|
use base_db::SourceDatabase;
|
||||||
use hir::{
|
use hir::{
|
||||||
Adt, AsAssocItem, AssocItemContainer, Documentation, FieldSource, HasSource, HirDisplay,
|
Adt, AsAssocItem, AssocItemContainer, Documentation, FieldSource, HasSource, HirDisplay,
|
||||||
Module, ModuleDef, ModuleSource, Semantics,
|
Module, ModuleDef, ModuleSource, Semantics,
|
||||||
};
|
};
|
||||||
use itertools::Itertools;
|
use itertools::Itertools;
|
||||||
use ra_db::SourceDatabase;
|
|
||||||
use ra_ide_db::{
|
use ra_ide_db::{
|
||||||
defs::{classify_name, classify_name_ref, Definition},
|
defs::{classify_name, classify_name_ref, Definition},
|
||||||
RootDatabase,
|
RootDatabase,
|
||||||
|
@ -352,8 +352,8 @@ fn pick_best(tokens: TokenAtOffset<SyntaxToken>) -> Option<SyntaxToken> {
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
|
use base_db::FileLoader;
|
||||||
use expect::{expect, Expect};
|
use expect::{expect, Expect};
|
||||||
use ra_db::FileLoader;
|
|
||||||
|
|
||||||
use crate::mock_analysis::analysis_and_position;
|
use crate::mock_analysis::analysis_and_position;
|
||||||
|
|
||||||
|
|
|
@ -47,11 +47,11 @@ mod typing;
|
||||||
|
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use cfg::CfgOptions;
|
use base_db::{
|
||||||
use ra_db::{
|
|
||||||
salsa::{self, ParallelDatabase},
|
salsa::{self, ParallelDatabase},
|
||||||
CheckCanceled, Env, FileLoader, FileSet, SourceDatabase, VfsPath,
|
CheckCanceled, Env, FileLoader, FileSet, SourceDatabase, VfsPath,
|
||||||
};
|
};
|
||||||
|
use cfg::CfgOptions;
|
||||||
use ra_ide_db::{
|
use ra_ide_db::{
|
||||||
symbol_index::{self, FileSymbol},
|
symbol_index::{self, FileSymbol},
|
||||||
LineIndexDatabase,
|
LineIndexDatabase,
|
||||||
|
@ -81,12 +81,12 @@ pub use crate::{
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
pub use hir::{Documentation, Semantics};
|
pub use base_db::{
|
||||||
pub use ra_assists::{Assist, AssistConfig, AssistId, AssistKind, ResolvedAssist};
|
|
||||||
pub use ra_db::{
|
|
||||||
Canceled, CrateGraph, CrateId, Edition, FileId, FilePosition, FileRange, SourceRoot,
|
Canceled, CrateGraph, CrateId, Edition, FileId, FilePosition, FileRange, SourceRoot,
|
||||||
SourceRootId,
|
SourceRootId,
|
||||||
};
|
};
|
||||||
|
pub use hir::{Documentation, Semantics};
|
||||||
|
pub use ra_assists::{Assist, AssistConfig, AssistId, AssistKind, ResolvedAssist};
|
||||||
pub use ra_ide_db::{
|
pub use ra_ide_db::{
|
||||||
change::AnalysisChange,
|
change::AnalysisChange,
|
||||||
line_index::{LineCol, LineIndex},
|
line_index::{LineCol, LineIndex},
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
//! FIXME: write short doc here
|
//! FIXME: write short doc here
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
|
use base_db::{CrateName, FileSet, SourceRoot, VfsPath};
|
||||||
use cfg::CfgOptions;
|
use cfg::CfgOptions;
|
||||||
use ra_db::{CrateName, FileSet, SourceRoot, VfsPath};
|
|
||||||
use test_utils::{
|
use test_utils::{
|
||||||
extract_annotations, extract_range_or_offset, Fixture, RangeOrOffset, CURSOR_MARKER,
|
extract_annotations, extract_range_or_offset, Fixture, RangeOrOffset, CURSOR_MARKER,
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
|
use base_db::{CrateId, FileId, FilePosition};
|
||||||
use hir::Semantics;
|
use hir::Semantics;
|
||||||
use ra_db::{CrateId, FileId, FilePosition};
|
|
||||||
use ra_ide_db::RootDatabase;
|
use ra_ide_db::RootDatabase;
|
||||||
use syntax::{
|
use syntax::{
|
||||||
algo::find_node_at_offset,
|
algo::find_node_at_offset,
|
||||||
|
@ -63,8 +63,8 @@ pub(crate) fn crate_for(db: &RootDatabase, file_id: FileId) -> Vec<CrateId> {
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
|
use base_db::Env;
|
||||||
use cfg::CfgOptions;
|
use cfg::CfgOptions;
|
||||||
use ra_db::Env;
|
|
||||||
use test_utils::mark;
|
use test_utils::mark;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
//! FIXME: write short doc here
|
//! FIXME: write short doc here
|
||||||
|
|
||||||
|
use base_db::SourceDatabaseExt;
|
||||||
use hir::{Module, ModuleDef, ModuleSource, Semantics};
|
use hir::{Module, ModuleDef, ModuleSource, Semantics};
|
||||||
use ra_db::SourceDatabaseExt;
|
|
||||||
use ra_ide_db::{
|
use ra_ide_db::{
|
||||||
defs::{classify_name, classify_name_ref, Definition, NameClass, NameRefClass},
|
defs::{classify_name, classify_name_ref, Definition, NameClass, NameRefClass},
|
||||||
RootDatabase,
|
RootDatabase,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
use ra_db::{FilePosition, FileRange};
|
use base_db::{FilePosition, FileRange};
|
||||||
use ra_ide_db::RootDatabase;
|
use ra_ide_db::RootDatabase;
|
||||||
|
|
||||||
use crate::SourceFileEdit;
|
use crate::SourceFileEdit;
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
use std::{fmt, iter::FromIterator, sync::Arc};
|
use std::{fmt, iter::FromIterator, sync::Arc};
|
||||||
|
|
||||||
use hir::MacroFile;
|
use base_db::{
|
||||||
use profile::{memory_usage, Bytes};
|
|
||||||
use ra_db::{
|
|
||||||
salsa::debug::{DebugQueryTable, TableEntry},
|
salsa::debug::{DebugQueryTable, TableEntry},
|
||||||
FileTextQuery, SourceRootId,
|
FileTextQuery, SourceRootId,
|
||||||
};
|
};
|
||||||
|
use hir::MacroFile;
|
||||||
|
use profile::{memory_usage, Bytes};
|
||||||
use ra_ide_db::{
|
use ra_ide_db::{
|
||||||
symbol_index::{LibrarySymbolsQuery, SymbolIndex},
|
symbol_index::{LibrarySymbolsQuery, SymbolIndex},
|
||||||
RootDatabase,
|
RootDatabase,
|
||||||
|
@ -16,7 +16,7 @@ use syntax::{ast, Parse, SyntaxNode};
|
||||||
use crate::FileId;
|
use crate::FileId;
|
||||||
|
|
||||||
fn syntax_tree_stats(db: &RootDatabase) -> SyntaxTreeStats {
|
fn syntax_tree_stats(db: &RootDatabase) -> SyntaxTreeStats {
|
||||||
ra_db::ParseQuery.in_db(db).entries::<SyntaxTreeStats>()
|
base_db::ParseQuery.in_db(db).entries::<SyntaxTreeStats>()
|
||||||
}
|
}
|
||||||
fn macro_syntax_tree_stats(db: &RootDatabase) -> SyntaxTreeStats {
|
fn macro_syntax_tree_stats(db: &RootDatabase) -> SyntaxTreeStats {
|
||||||
hir::db::ParseMacroQuery.in_db(db).entries::<SyntaxTreeStats>()
|
hir::db::ParseMacroQuery.in_db(db).entries::<SyntaxTreeStats>()
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
//! Renders a bit of code as HTML.
|
//! Renders a bit of code as HTML.
|
||||||
|
|
||||||
|
use base_db::SourceDatabase;
|
||||||
use oorandom::Rand32;
|
use oorandom::Rand32;
|
||||||
use ra_db::SourceDatabase;
|
|
||||||
use syntax::{AstNode, TextRange, TextSize};
|
use syntax::{AstNode, TextRange, TextSize};
|
||||||
|
|
||||||
use crate::{syntax_highlighting::highlight, FileId, RootDatabase};
|
use crate::{syntax_highlighting::highlight, FileId, RootDatabase};
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
use ra_db::{FileId, SourceDatabase};
|
use base_db::{FileId, SourceDatabase};
|
||||||
use ra_ide_db::RootDatabase;
|
use ra_ide_db::RootDatabase;
|
||||||
use syntax::{
|
use syntax::{
|
||||||
algo, AstNode, NodeOrToken, SourceFile,
|
algo, AstNode, NodeOrToken, SourceFile,
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
mod on_enter;
|
mod on_enter;
|
||||||
|
|
||||||
use ra_db::{FilePosition, SourceDatabase};
|
use base_db::{FilePosition, SourceDatabase};
|
||||||
use ra_ide_db::{source_change::SourceFileEdit, RootDatabase};
|
use ra_ide_db::{source_change::SourceFileEdit, RootDatabase};
|
||||||
use syntax::{
|
use syntax::{
|
||||||
algo::find_node_at_offset,
|
algo::find_node_at_offset,
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
//! Handles the `Enter` key press. At the momently, this only continues
|
//! Handles the `Enter` key press. At the momently, this only continues
|
||||||
//! comments, but should handle indent some time in the future as well.
|
//! comments, but should handle indent some time in the future as well.
|
||||||
|
|
||||||
use ra_db::{FilePosition, SourceDatabase};
|
use base_db::{FilePosition, SourceDatabase};
|
||||||
use ra_ide_db::RootDatabase;
|
use ra_ide_db::RootDatabase;
|
||||||
use syntax::{
|
use syntax::{
|
||||||
ast::{self, AstToken},
|
ast::{self, AstToken},
|
||||||
|
|
|
@ -23,7 +23,7 @@ stdx = { path = "../stdx" }
|
||||||
|
|
||||||
syntax = { path = "../syntax" }
|
syntax = { path = "../syntax" }
|
||||||
text_edit = { path = "../text_edit" }
|
text_edit = { path = "../text_edit" }
|
||||||
ra_db = { path = "../ra_db" }
|
base_db = { path = "../base_db" }
|
||||||
profile = { path = "../profile" }
|
profile = { path = "../profile" }
|
||||||
test_utils = { path = "../test_utils" }
|
test_utils = { path = "../test_utils" }
|
||||||
|
|
||||||
|
|
|
@ -3,11 +3,11 @@
|
||||||
|
|
||||||
use std::{fmt, sync::Arc, time};
|
use std::{fmt, sync::Arc, time};
|
||||||
|
|
||||||
use profile::{memory_usage, Bytes};
|
use base_db::{
|
||||||
use ra_db::{
|
|
||||||
salsa::{Database, Durability, SweepStrategy},
|
salsa::{Database, Durability, SweepStrategy},
|
||||||
CrateGraph, FileId, SourceDatabase, SourceDatabaseExt, SourceRoot, SourceRootId,
|
CrateGraph, FileId, SourceDatabase, SourceDatabaseExt, SourceRoot, SourceRootId,
|
||||||
};
|
};
|
||||||
|
use profile::{memory_usage, Bytes};
|
||||||
use rustc_hash::FxHashSet;
|
use rustc_hash::FxHashSet;
|
||||||
|
|
||||||
use crate::{symbol_index::SymbolsDatabase, RootDatabase};
|
use crate::{symbol_index::SymbolsDatabase, RootDatabase};
|
||||||
|
@ -146,7 +146,7 @@ impl RootDatabase {
|
||||||
|
|
||||||
let sweep = SweepStrategy::default().discard_values().sweep_all_revisions();
|
let sweep = SweepStrategy::default().discard_values().sweep_all_revisions();
|
||||||
|
|
||||||
ra_db::ParseQuery.in_db(self).sweep(sweep);
|
base_db::ParseQuery.in_db(self).sweep(sweep);
|
||||||
hir::db::ParseMacroQuery.in_db(self).sweep(sweep);
|
hir::db::ParseMacroQuery.in_db(self).sweep(sweep);
|
||||||
|
|
||||||
// Macros do take significant space, but less then the syntax trees
|
// Macros do take significant space, but less then the syntax trees
|
||||||
|
@ -201,14 +201,14 @@ impl RootDatabase {
|
||||||
}
|
}
|
||||||
sweep_each_query![
|
sweep_each_query![
|
||||||
// SourceDatabase
|
// SourceDatabase
|
||||||
ra_db::ParseQuery
|
base_db::ParseQuery
|
||||||
ra_db::CrateGraphQuery
|
base_db::CrateGraphQuery
|
||||||
|
|
||||||
// SourceDatabaseExt
|
// SourceDatabaseExt
|
||||||
ra_db::FileTextQuery
|
base_db::FileTextQuery
|
||||||
ra_db::FileSourceRootQuery
|
base_db::FileSourceRootQuery
|
||||||
ra_db::SourceRootQuery
|
base_db::SourceRootQuery
|
||||||
ra_db::SourceRootCratesQuery
|
base_db::SourceRootCratesQuery
|
||||||
|
|
||||||
// AstDatabase
|
// AstDatabase
|
||||||
hir::db::AstIdMapQuery
|
hir::db::AstIdMapQuery
|
||||||
|
|
|
@ -13,19 +13,19 @@ mod wasm_shims;
|
||||||
|
|
||||||
use std::{fmt, sync::Arc};
|
use std::{fmt, sync::Arc};
|
||||||
|
|
||||||
use hir::db::{AstDatabase, DefDatabase, HirDatabase};
|
use base_db::{
|
||||||
use ra_db::{
|
|
||||||
salsa::{self, Durability},
|
salsa::{self, Durability},
|
||||||
Canceled, CheckCanceled, CrateId, FileId, FileLoader, FileLoaderDelegate, SourceDatabase,
|
Canceled, CheckCanceled, CrateId, FileId, FileLoader, FileLoaderDelegate, SourceDatabase,
|
||||||
Upcast,
|
Upcast,
|
||||||
};
|
};
|
||||||
|
use hir::db::{AstDatabase, DefDatabase, HirDatabase};
|
||||||
use rustc_hash::FxHashSet;
|
use rustc_hash::FxHashSet;
|
||||||
|
|
||||||
use crate::{line_index::LineIndex, symbol_index::SymbolsDatabase};
|
use crate::{line_index::LineIndex, symbol_index::SymbolsDatabase};
|
||||||
|
|
||||||
#[salsa::database(
|
#[salsa::database(
|
||||||
ra_db::SourceDatabaseStorage,
|
base_db::SourceDatabaseStorage,
|
||||||
ra_db::SourceDatabaseExtStorage,
|
base_db::SourceDatabaseExtStorage,
|
||||||
LineIndexDatabaseStorage,
|
LineIndexDatabaseStorage,
|
||||||
symbol_index::SymbolsDatabaseStorage,
|
symbol_index::SymbolsDatabaseStorage,
|
||||||
hir::db::InternDatabaseStorage,
|
hir::db::InternDatabaseStorage,
|
||||||
|
@ -111,8 +111,8 @@ impl RootDatabase {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn update_lru_capacity(&mut self, lru_capacity: Option<usize>) {
|
pub fn update_lru_capacity(&mut self, lru_capacity: Option<usize>) {
|
||||||
let lru_capacity = lru_capacity.unwrap_or(ra_db::DEFAULT_LRU_CAP);
|
let lru_capacity = lru_capacity.unwrap_or(base_db::DEFAULT_LRU_CAP);
|
||||||
ra_db::ParseQuery.in_db_mut(self).set_lru_capacity(lru_capacity);
|
base_db::ParseQuery.in_db_mut(self).set_lru_capacity(lru_capacity);
|
||||||
hir::db::ParseMacroQuery.in_db_mut(self).set_lru_capacity(lru_capacity);
|
hir::db::ParseMacroQuery.in_db_mut(self).set_lru_capacity(lru_capacity);
|
||||||
hir::db::MacroExpandQuery.in_db_mut(self).set_lru_capacity(lru_capacity);
|
hir::db::MacroExpandQuery.in_db_mut(self).set_lru_capacity(lru_capacity);
|
||||||
}
|
}
|
||||||
|
@ -129,7 +129,7 @@ impl salsa::ParallelDatabase for RootDatabase {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[salsa::query_group(LineIndexDatabaseStorage)]
|
#[salsa::query_group(LineIndexDatabaseStorage)]
|
||||||
pub trait LineIndexDatabase: ra_db::SourceDatabase + CheckCanceled {
|
pub trait LineIndexDatabase: base_db::SourceDatabase + CheckCanceled {
|
||||||
fn line_index(&self, file_id: FileId) -> Arc<LineIndex>;
|
fn line_index(&self, file_id: FileId) -> Arc<LineIndex>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
|
|
||||||
use std::{convert::TryInto, mem};
|
use std::{convert::TryInto, mem};
|
||||||
|
|
||||||
|
use base_db::{FileId, FileRange, SourceDatabaseExt};
|
||||||
use hir::{DefWithBody, HasSource, Module, ModuleSource, Semantics, Visibility};
|
use hir::{DefWithBody, HasSource, Module, ModuleSource, Semantics, Visibility};
|
||||||
use once_cell::unsync::Lazy;
|
use once_cell::unsync::Lazy;
|
||||||
use ra_db::{FileId, FileRange, SourceDatabaseExt};
|
|
||||||
use rustc_hash::FxHashMap;
|
use rustc_hash::FxHashMap;
|
||||||
use syntax::{ast, match_ast, AstNode, TextRange, TextSize};
|
use syntax::{ast, match_ast, AstNode, TextRange, TextSize};
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
//!
|
//!
|
||||||
//! It can be viewed as a dual for `AnalysisChange`.
|
//! It can be viewed as a dual for `AnalysisChange`.
|
||||||
|
|
||||||
use ra_db::FileId;
|
use base_db::FileId;
|
||||||
use text_edit::TextEdit;
|
use text_edit::TextEdit;
|
||||||
|
|
||||||
#[derive(Default, Debug, Clone)]
|
#[derive(Default, Debug, Clone)]
|
||||||
|
|
|
@ -28,12 +28,12 @@ use std::{
|
||||||
sync::Arc,
|
sync::Arc,
|
||||||
};
|
};
|
||||||
|
|
||||||
use fst::{self, Streamer};
|
use base_db::{
|
||||||
use hir::db::DefDatabase;
|
|
||||||
use ra_db::{
|
|
||||||
salsa::{self, ParallelDatabase},
|
salsa::{self, ParallelDatabase},
|
||||||
CrateId, FileId, SourceDatabaseExt, SourceRootId,
|
CrateId, FileId, SourceDatabaseExt, SourceRootId,
|
||||||
};
|
};
|
||||||
|
use fst::{self, Streamer};
|
||||||
|
use hir::db::DefDatabase;
|
||||||
use rayon::prelude::*;
|
use rayon::prelude::*;
|
||||||
use rustc_hash::{FxHashMap, FxHashSet};
|
use rustc_hash::{FxHashMap, FxHashSet};
|
||||||
use syntax::{
|
use syntax::{
|
||||||
|
|
|
@ -13,7 +13,7 @@ doctest = false
|
||||||
[dependencies]
|
[dependencies]
|
||||||
text_edit = { path = "../text_edit" }
|
text_edit = { path = "../text_edit" }
|
||||||
syntax = { path = "../syntax" }
|
syntax = { path = "../syntax" }
|
||||||
ra_db = { path = "../ra_db" }
|
base_db = { path = "../base_db" }
|
||||||
ra_ide_db = { path = "../ra_ide_db" }
|
ra_ide_db = { path = "../ra_ide_db" }
|
||||||
hir = { path = "../ra_hir", package = "ra_hir" }
|
hir = { path = "../ra_hir", package = "ra_hir" }
|
||||||
rustc-hash = "1.1.0"
|
rustc-hash = "1.1.0"
|
||||||
|
|
|
@ -18,8 +18,8 @@ use crate::errors::bail;
|
||||||
pub use crate::errors::SsrError;
|
pub use crate::errors::SsrError;
|
||||||
pub use crate::matching::Match;
|
pub use crate::matching::Match;
|
||||||
use crate::matching::MatchFailureReason;
|
use crate::matching::MatchFailureReason;
|
||||||
|
use base_db::{FileId, FilePosition, FileRange};
|
||||||
use hir::Semantics;
|
use hir::Semantics;
|
||||||
use ra_db::{FileId, FilePosition, FileRange};
|
|
||||||
use ra_ide_db::source_change::SourceFileEdit;
|
use ra_ide_db::source_change::SourceFileEdit;
|
||||||
use resolving::ResolvedRule;
|
use resolving::ResolvedRule;
|
||||||
use rustc_hash::FxHashMap;
|
use rustc_hash::FxHashMap;
|
||||||
|
@ -71,7 +71,7 @@ impl<'db> MatchFinder<'db> {
|
||||||
|
|
||||||
/// Constructs an instance using the start of the first file in `db` as the lookup context.
|
/// Constructs an instance using the start of the first file in `db` as the lookup context.
|
||||||
pub fn at_first_file(db: &'db ra_ide_db::RootDatabase) -> Result<MatchFinder<'db>, SsrError> {
|
pub fn at_first_file(db: &'db ra_ide_db::RootDatabase) -> Result<MatchFinder<'db>, SsrError> {
|
||||||
use ra_db::SourceDatabaseExt;
|
use base_db::SourceDatabaseExt;
|
||||||
use ra_ide_db::symbol_index::SymbolsDatabase;
|
use ra_ide_db::symbol_index::SymbolsDatabase;
|
||||||
if let Some(first_file_id) = db
|
if let Some(first_file_id) = db
|
||||||
.local_roots()
|
.local_roots()
|
||||||
|
@ -105,7 +105,7 @@ impl<'db> MatchFinder<'db> {
|
||||||
|
|
||||||
/// Finds matches for all added rules and returns edits for all found matches.
|
/// Finds matches for all added rules and returns edits for all found matches.
|
||||||
pub fn edits(&self) -> Vec<SourceFileEdit> {
|
pub fn edits(&self) -> Vec<SourceFileEdit> {
|
||||||
use ra_db::SourceDatabaseExt;
|
use base_db::SourceDatabaseExt;
|
||||||
let mut matches_by_file = FxHashMap::default();
|
let mut matches_by_file = FxHashMap::default();
|
||||||
for m in self.matches().matches {
|
for m in self.matches().matches {
|
||||||
matches_by_file
|
matches_by_file
|
||||||
|
@ -150,7 +150,7 @@ impl<'db> MatchFinder<'db> {
|
||||||
/// them, while recording reasons why they don't match. This API is useful for command
|
/// them, while recording reasons why they don't match. This API is useful for command
|
||||||
/// line-based debugging where providing a range is difficult.
|
/// line-based debugging where providing a range is difficult.
|
||||||
pub fn debug_where_text_equal(&self, file_id: FileId, snippet: &str) -> Vec<MatchDebugInfo> {
|
pub fn debug_where_text_equal(&self, file_id: FileId, snippet: &str) -> Vec<MatchDebugInfo> {
|
||||||
use ra_db::SourceDatabaseExt;
|
use base_db::SourceDatabaseExt;
|
||||||
let file = self.sema.parse(file_id);
|
let file = self.sema.parse(file_id);
|
||||||
let mut res = Vec::new();
|
let mut res = Vec::new();
|
||||||
let file_text = self.sema.db.file_text(file_id);
|
let file_text = self.sema.db.file_text(file_id);
|
||||||
|
|
|
@ -6,8 +6,8 @@ use crate::{
|
||||||
resolving::{ResolvedPattern, ResolvedRule, UfcsCallInfo},
|
resolving::{ResolvedPattern, ResolvedRule, UfcsCallInfo},
|
||||||
SsrMatches,
|
SsrMatches,
|
||||||
};
|
};
|
||||||
|
use base_db::FileRange;
|
||||||
use hir::Semantics;
|
use hir::Semantics;
|
||||||
use ra_db::FileRange;
|
|
||||||
use rustc_hash::FxHashMap;
|
use rustc_hash::FxHashMap;
|
||||||
use std::{cell::Cell, iter::Peekable};
|
use std::{cell::Cell, iter::Peekable};
|
||||||
use syntax::ast::{AstNode, AstToken};
|
use syntax::ast::{AstNode, AstToken};
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
use crate::errors::error;
|
use crate::errors::error;
|
||||||
use crate::{parsing, SsrError};
|
use crate::{parsing, SsrError};
|
||||||
|
use base_db::FilePosition;
|
||||||
use parsing::Placeholder;
|
use parsing::Placeholder;
|
||||||
use ra_db::FilePosition;
|
|
||||||
use rustc_hash::FxHashMap;
|
use rustc_hash::FxHashMap;
|
||||||
use syntax::{ast, SmolStr, SyntaxKind, SyntaxNode, SyntaxToken};
|
use syntax::{ast, SmolStr, SyntaxKind, SyntaxNode, SyntaxToken};
|
||||||
use test_utils::mark;
|
use test_utils::mark;
|
||||||
|
|
|
@ -5,7 +5,7 @@ use crate::{
|
||||||
resolving::{ResolvedPath, ResolvedPattern, ResolvedRule},
|
resolving::{ResolvedPath, ResolvedPattern, ResolvedRule},
|
||||||
Match, MatchFinder,
|
Match, MatchFinder,
|
||||||
};
|
};
|
||||||
use ra_db::{FileId, FileRange};
|
use base_db::{FileId, FileRange};
|
||||||
use ra_ide_db::{
|
use ra_ide_db::{
|
||||||
defs::Definition,
|
defs::Definition,
|
||||||
search::{Reference, SearchScope},
|
search::{Reference, SearchScope},
|
||||||
|
@ -145,7 +145,7 @@ impl<'db> MatchFinder<'db> {
|
||||||
fn search_files_do(&self, mut callback: impl FnMut(FileId)) {
|
fn search_files_do(&self, mut callback: impl FnMut(FileId)) {
|
||||||
if self.restrict_ranges.is_empty() {
|
if self.restrict_ranges.is_empty() {
|
||||||
// Unrestricted search.
|
// Unrestricted search.
|
||||||
use ra_db::SourceDatabaseExt;
|
use base_db::SourceDatabaseExt;
|
||||||
use ra_ide_db::symbol_index::SymbolsDatabase;
|
use ra_ide_db::symbol_index::SymbolsDatabase;
|
||||||
for &root in self.sema.db.local_roots().iter() {
|
for &root in self.sema.db.local_roots().iter() {
|
||||||
let sr = self.sema.db.source_root(root);
|
let sr = self.sema.db.source_root(root);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
use crate::{MatchFinder, SsrRule};
|
use crate::{MatchFinder, SsrRule};
|
||||||
|
use base_db::{salsa::Durability, FileId, FilePosition, FileRange, SourceDatabaseExt};
|
||||||
use expect::{expect, Expect};
|
use expect::{expect, Expect};
|
||||||
use ra_db::{salsa::Durability, FileId, FilePosition, FileRange, SourceDatabaseExt};
|
|
||||||
use rustc_hash::FxHashSet;
|
use rustc_hash::FxHashSet;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use test_utils::{mark, RangeOrOffset};
|
use test_utils::{mark, RangeOrOffset};
|
||||||
|
@ -62,7 +62,7 @@ fn parser_undefined_placeholder_in_replacement() {
|
||||||
/// `code` may optionally contain a cursor marker `<|>`. If it doesn't, then the position will be
|
/// `code` may optionally contain a cursor marker `<|>`. If it doesn't, then the position will be
|
||||||
/// the start of the file. If there's a second cursor marker, then we'll return a single range.
|
/// the start of the file. If there's a second cursor marker, then we'll return a single range.
|
||||||
pub(crate) fn single_file(code: &str) -> (ra_ide_db::RootDatabase, FilePosition, Vec<FileRange>) {
|
pub(crate) fn single_file(code: &str) -> (ra_ide_db::RootDatabase, FilePosition, Vec<FileRange>) {
|
||||||
use ra_db::fixture::WithFixture;
|
use base_db::fixture::WithFixture;
|
||||||
use ra_ide_db::symbol_index::SymbolsDatabase;
|
use ra_ide_db::symbol_index::SymbolsDatabase;
|
||||||
let (mut db, file_id, range_or_offset) = if code.contains(test_utils::CURSOR_MARKER) {
|
let (mut db, file_id, range_or_offset) = if code.contains(test_utils::CURSOR_MARKER) {
|
||||||
ra_ide_db::RootDatabase::with_range_or_offset(code)
|
ra_ide_db::RootDatabase::with_range_or_offset(code)
|
||||||
|
@ -83,7 +83,7 @@ pub(crate) fn single_file(code: &str) -> (ra_ide_db::RootDatabase, FilePosition,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let mut local_roots = FxHashSet::default();
|
let mut local_roots = FxHashSet::default();
|
||||||
local_roots.insert(ra_db::fixture::WORKSPACE);
|
local_roots.insert(base_db::fixture::WORKSPACE);
|
||||||
db.set_local_roots_with_durability(Arc::new(local_roots), Durability::HIGH);
|
db.set_local_roots_with_durability(Arc::new(local_roots), Durability::HIGH);
|
||||||
(db, position, selections)
|
(db, position, selections)
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,7 +46,7 @@ cfg = { path = "../cfg" }
|
||||||
toolchain = { path = "../toolchain" }
|
toolchain = { path = "../toolchain" }
|
||||||
|
|
||||||
# This should only be used in CLI
|
# This should only be used in CLI
|
||||||
ra_db = { path = "../ra_db" }
|
base_db = { path = "../base_db" }
|
||||||
ra_ide_db = { path = "../ra_ide_db" }
|
ra_ide_db = { path = "../ra_ide_db" }
|
||||||
ra_ssr = { path = "../ra_ssr" }
|
ra_ssr = { path = "../ra_ssr" }
|
||||||
hir = { path = "../ra_hir", package = "ra_hir" }
|
hir = { path = "../ra_hir", package = "ra_hir" }
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
use std::{env, path::PathBuf, str::FromStr, sync::Arc, time::Instant};
|
use std::{env, path::PathBuf, str::FromStr, sync::Arc, time::Instant};
|
||||||
|
|
||||||
use anyhow::{bail, format_err, Result};
|
use anyhow::{bail, format_err, Result};
|
||||||
use ra_db::{
|
use base_db::{
|
||||||
salsa::{Database, Durability},
|
salsa::{Database, Durability},
|
||||||
FileId,
|
FileId,
|
||||||
};
|
};
|
||||||
|
|
|
@ -6,6 +6,10 @@ use std::{
|
||||||
time::{SystemTime, UNIX_EPOCH},
|
time::{SystemTime, UNIX_EPOCH},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
use base_db::{
|
||||||
|
salsa::{self, ParallelDatabase},
|
||||||
|
SourceDatabaseExt,
|
||||||
|
};
|
||||||
use hir::{
|
use hir::{
|
||||||
db::{AstDatabase, DefDatabase, HirDatabase},
|
db::{AstDatabase, DefDatabase, HirDatabase},
|
||||||
original_range, AssocItem, Crate, HasSource, HirDisplay, ModuleDef,
|
original_range, AssocItem, Crate, HasSource, HirDisplay, ModuleDef,
|
||||||
|
@ -14,10 +18,6 @@ use hir_def::FunctionId;
|
||||||
use hir_ty::{Ty, TypeWalk};
|
use hir_ty::{Ty, TypeWalk};
|
||||||
use itertools::Itertools;
|
use itertools::Itertools;
|
||||||
use oorandom::Rand32;
|
use oorandom::Rand32;
|
||||||
use ra_db::{
|
|
||||||
salsa::{self, ParallelDatabase},
|
|
||||||
SourceDatabaseExt,
|
|
||||||
};
|
|
||||||
use rayon::prelude::*;
|
use rayon::prelude::*;
|
||||||
use rustc_hash::FxHashSet;
|
use rustc_hash::FxHashSet;
|
||||||
use stdx::format_to;
|
use stdx::format_to;
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue