From 1fd18f020dcf01a441925ac0a368a31f3ddf4047 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 25 Jan 2019 23:27:16 +0300 Subject: :arrow_up: salsa --- crates/ra_hir/Cargo.toml | 1 - crates/ra_hir/src/db.rs | 2 +- crates/ra_hir/src/mock.rs | 8 ++++++-- 3 files changed, 7 insertions(+), 4 deletions(-) (limited to 'crates/ra_hir') diff --git a/crates/ra_hir/Cargo.toml b/crates/ra_hir/Cargo.toml index 3d802ade4..57a4b155b 100644 --- a/crates/ra_hir/Cargo.toml +++ b/crates/ra_hir/Cargo.toml @@ -12,7 +12,6 @@ rustc-hash = "1.0" parking_lot = "0.7.0" ena = "0.11" join_to_string = "0.1.3" -salsa = "0.10.0-alpha3" ra_syntax = { path = "../ra_syntax" } ra_arena = { path = "../ra_arena" } diff --git a/crates/ra_hir/src/db.rs b/crates/ra_hir/src/db.rs index 3c82262a2..dfbf41bd6 100644 --- a/crates/ra_hir/src/db.rs +++ b/crates/ra_hir/src/db.rs @@ -18,7 +18,7 @@ use crate::{ generics::{GenericParams, GenericDef}, }; -#[salsa::query_group] +#[salsa::query_group(HirDatabaseStorage)] pub trait HirDatabase: SyntaxDatabase + AsRef { #[salsa::invoke(HirFileId::hir_source_file)] fn hir_source_file(&self, file_id: HirFileId) -> TreeArc; diff --git a/crates/ra_hir/src/mock.rs b/crates/ra_hir/src/mock.rs index 36b174cd6..2dc252b1e 100644 --- a/crates/ra_hir/src/mock.rs +++ b/crates/ra_hir/src/mock.rs @@ -2,7 +2,7 @@ use std::{sync::Arc, panic}; use parking_lot::Mutex; use ra_db::{ - BaseDatabase, FilePosition, FileId, CrateGraph, SourceRoot, SourceRootId, FilesDatabase, + BaseDatabase, FilePosition, FileId, CrateGraph, SourceRoot, SourceRootId, FilesDatabase, salsa, }; use relative_path::RelativePathBuf; use test_utils::{parse_fixture, CURSOR_MARKER, extract_offset}; @@ -11,7 +11,11 @@ use crate::{db, HirInterner}; pub const WORKSPACE: SourceRootId = SourceRootId(0); -#[salsa::database(ra_db::FilesDatabase, ra_db::SyntaxDatabase, db::HirDatabase)] +#[salsa::database( + ra_db::FilesDatabaseStorage, + ra_db::SyntaxDatabaseStorage, + db::HirDatabaseStorage +)] #[derive(Debug)] pub(crate) struct MockDatabase { events: Mutex>>>, -- cgit v1.2.3