From 4484908a867fc742104d6ffe63b865a411203276 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 30 Jun 2020 13:03:08 +0200 Subject: Rewrite goto definition tests --- crates/ra_db/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_db/src/lib.rs') diff --git a/crates/ra_db/src/lib.rs b/crates/ra_db/src/lib.rs index 4a3ba57da..1ddacc1f6 100644 --- a/crates/ra_db/src/lib.rs +++ b/crates/ra_db/src/lib.rs @@ -80,7 +80,7 @@ pub struct FilePosition { pub offset: TextSize, } -#[derive(Clone, Copy, Debug)] +#[derive(Clone, Copy, Debug, Eq, PartialEq)] pub struct FileRange { pub file_id: FileId, pub range: TextRange, -- cgit v1.2.3 From 4bbc385277bcab509c321b1374f72f1ef19d7750 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 7 Jul 2020 10:14:48 +0200 Subject: Switch to fully dynamically dispatched salsa This improves compile times quite a bit --- crates/ra_db/src/lib.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'crates/ra_db/src/lib.rs') diff --git a/crates/ra_db/src/lib.rs b/crates/ra_db/src/lib.rs index 1ddacc1f6..590efffa4 100644 --- a/crates/ra_db/src/lib.rs +++ b/crates/ra_db/src/lib.rs @@ -113,7 +113,7 @@ pub trait SourceDatabase: CheckCanceled + FileLoader + std::fmt::Debug { fn crate_graph(&self) -> Arc; } -fn parse_query(db: &impl SourceDatabase, file_id: FileId) -> Parse { +fn parse_query(db: &dyn SourceDatabase, file_id: FileId) -> Parse { let _p = profile("parse_query").detail(|| format!("{:?}", file_id)); let text = db.file_text(file_id); SourceFile::parse(&*text) @@ -136,10 +136,7 @@ pub trait SourceDatabaseExt: SourceDatabase { fn source_root_crates(&self, id: SourceRootId) -> Arc>; } -fn source_root_crates( - db: &(impl SourceDatabaseExt + SourceDatabase), - id: SourceRootId, -) -> Arc> { +fn source_root_crates(db: &dyn SourceDatabaseExt, id: SourceRootId) -> Arc> { let graph = db.crate_graph(); let res = graph .iter() -- cgit v1.2.3 From 35e4bb35062a5e9e72282f33a0feaa9aea2151c5 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 8 Jul 2020 18:17:45 +0200 Subject: Document failed refactor --- crates/ra_db/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/ra_db/src/lib.rs') diff --git a/crates/ra_db/src/lib.rs b/crates/ra_db/src/lib.rs index 590efffa4..183822601 100644 --- a/crates/ra_db/src/lib.rs +++ b/crates/ra_db/src/lib.rs @@ -93,9 +93,9 @@ pub trait FileLoader { fn file_text(&self, file_id: FileId) -> Arc; /// Note that we intentionally accept a `&str` and not a `&Path` here. This /// method exists to handle `#[path = "/some/path.rs"] mod foo;` and such, - /// so the input is guaranteed to be utf-8 string. We might introduce - /// `struct StrPath(str)` for clarity some day, but it's a bit messy, so we - /// get by with a `&str` for the time being. + /// so the input is guaranteed to be utf-8 string. One might be tempted to + /// introduce some kind of "utf-8 path with / separators", but that's a bad idea. Behold + /// `#[path = "C://no/way"]` fn resolve_path(&self, anchor: FileId, path: &str) -> Option; fn relevant_crates(&self, file_id: FileId) -> Arc>; } -- cgit v1.2.3 From 7ae696ba7642aba92c2eed012d9e02c09bab7460 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 8 Jul 2020 18:22:57 +0200 Subject: Remove unwanted dependency --- crates/ra_db/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_db/src/lib.rs') diff --git a/crates/ra_db/src/lib.rs b/crates/ra_db/src/lib.rs index 183822601..3a8fd44c4 100644 --- a/crates/ra_db/src/lib.rs +++ b/crates/ra_db/src/lib.rs @@ -18,7 +18,7 @@ pub use crate::{ }; pub use relative_path::{RelativePath, RelativePathBuf}; pub use salsa; -pub use vfs::{file_set::FileSet, AbsPathBuf, VfsPath}; +pub use vfs::{file_set::FileSet, VfsPath}; #[macro_export] macro_rules! impl_intern_key { -- cgit v1.2.3 From dab7f3d2c6cd035f446fbdcda2442954da4afd3a Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 8 Jul 2020 19:09:42 +0200 Subject: Remove relative_path dependency --- crates/ra_db/src/lib.rs | 1 - 1 file changed, 1 deletion(-) (limited to 'crates/ra_db/src/lib.rs') diff --git a/crates/ra_db/src/lib.rs b/crates/ra_db/src/lib.rs index 3a8fd44c4..f25be24fe 100644 --- a/crates/ra_db/src/lib.rs +++ b/crates/ra_db/src/lib.rs @@ -16,7 +16,6 @@ pub use crate::{ SourceRoot, SourceRootId, }, }; -pub use relative_path::{RelativePath, RelativePathBuf}; pub use salsa; pub use vfs::{file_set::FileSet, VfsPath}; -- cgit v1.2.3