mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-02 12:59:12 +00:00
Switch to home-made db attaching infrastructure
Instead of using Salsa's, as we can no longer can a `dyn HirDatabase` from the `dyn salsa::Database` Salsa provides.
This commit is contained in:
parent
a7234f8b3a
commit
c6ef51e550
52 changed files with 499 additions and 418 deletions
|
|
@ -6,7 +6,7 @@ use hir::setup_tracing;
|
|||
use ide_db::{
|
||||
LineIndexDatabase, RootDatabase,
|
||||
assists::{AssistResolveStrategy, ExprFillDefaultMode},
|
||||
base_db::{SourceDatabase, salsa},
|
||||
base_db::SourceDatabase,
|
||||
};
|
||||
use itertools::Itertools;
|
||||
use stdx::trim_indent;
|
||||
|
|
@ -74,7 +74,7 @@ fn check_nth_fix_with_config(
|
|||
let after = trim_indent(ra_fixture_after);
|
||||
|
||||
let (db, file_position) = RootDatabase::with_position(ra_fixture_before);
|
||||
let diagnostic = salsa::attach(&db, || {
|
||||
let diagnostic = hir::attach_db(&db, || {
|
||||
super::full_diagnostics(
|
||||
&db,
|
||||
&config,
|
||||
|
|
@ -129,7 +129,7 @@ pub(crate) fn check_has_fix(
|
|||
let (db, file_position) = RootDatabase::with_position(ra_fixture_before);
|
||||
let mut conf = DiagnosticsConfig::test_sample();
|
||||
conf.expr_fill_default = ExprFillDefaultMode::Default;
|
||||
let fix = salsa::attach(&db, || {
|
||||
let fix = hir::attach_db(&db, || {
|
||||
super::full_diagnostics(
|
||||
&db,
|
||||
&conf,
|
||||
|
|
@ -170,7 +170,7 @@ pub(crate) fn check_has_fix(
|
|||
/// Checks that there's a diagnostic *without* fix at `$0`.
|
||||
pub(crate) fn check_no_fix(#[rust_analyzer::rust_fixture] ra_fixture: &str) {
|
||||
let (db, file_position) = RootDatabase::with_position(ra_fixture);
|
||||
let diagnostic = salsa::attach(&db, || {
|
||||
let diagnostic = hir::attach_db(&db, || {
|
||||
super::full_diagnostics(
|
||||
&db,
|
||||
&DiagnosticsConfig::test_sample(),
|
||||
|
|
@ -212,7 +212,7 @@ pub(crate) fn check_diagnostics_with_config(
|
|||
.iter()
|
||||
.copied()
|
||||
.flat_map(|file_id| {
|
||||
salsa::attach(&db, || {
|
||||
hir::attach_db(&db, || {
|
||||
super::full_diagnostics(
|
||||
&db,
|
||||
&config,
|
||||
|
|
@ -288,12 +288,12 @@ fn test_disabled_diagnostics() {
|
|||
let (db, file_id) = RootDatabase::with_single_file(r#"mod foo;"#);
|
||||
let file_id = file_id.file_id(&db);
|
||||
|
||||
let diagnostics = salsa::attach(&db, || {
|
||||
let diagnostics = hir::attach_db(&db, || {
|
||||
super::full_diagnostics(&db, &config, &AssistResolveStrategy::All, file_id)
|
||||
});
|
||||
assert!(diagnostics.is_empty());
|
||||
|
||||
let diagnostics = salsa::attach(&db, || {
|
||||
let diagnostics = hir::attach_db(&db, || {
|
||||
super::full_diagnostics(
|
||||
&db,
|
||||
&DiagnosticsConfig::test_sample(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue