Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
7c5f33c
ConfigTree
cormacrelf Jan 21, 2024
9c506a9
Start building the tree construction
cormacrelf Jan 23, 2024
c442ea1
Store empty input as None
cormacrelf Jan 23, 2024
18ff646
config tree gets a tree shape
cormacrelf Jan 23, 2024
47c7d45
Make the client config override everything
cormacrelf Jan 23, 2024
69bdf4a
Add failing test for the xdg config being inherited
cormacrelf Jan 23, 2024
ab0149d
fix config invalidation
cormacrelf Jan 23, 2024
851b970
Avoid recomputing the client-config-mixed configs
cormacrelf Jan 23, 2024
77e61f7
Better test for config tree
cormacrelf Jan 23, 2024
9d8cff2
rename read_config to local_config
cormacrelf Jan 23, 2024
ce341dc
delete ConfigParentChange
cormacrelf Jan 23, 2024
09a3888
use salsa for the config tree
cormacrelf Jan 24, 2024
359bf1d
Delte unused vfs method, document set_file_id_contents
cormacrelf Jan 24, 2024
f1cff1e
Add a test that generates a tree from running path.ancestors() on the…
cormacrelf Jan 24, 2024
575ebbc
Add ancestors method to AbsPath
cormacrelf Jan 24, 2024
cc8dce5
Make the public api just "here's a list of source roots and a project…
cormacrelf Jan 24, 2024
cbbfa37
Simplify test code
cormacrelf Jan 24, 2024
fb1149e
Another test where the source roots are changed
cormacrelf Jan 25, 2024
f253aa4
Test changing project root
cormacrelf Jan 25, 2024
4074803
add failing test
cormacrelf Jan 25, 2024
6906ae9
And fix it
cormacrelf Jan 25, 2024
c246135
Fix comment in test
cormacrelf Jan 25, 2024
bf1419a
Make AbsPath::assert work on plain string slices too
cormacrelf Jan 25, 2024
8177b17
Add a failing test for irrelevant vfs changes
cormacrelf Jan 25, 2024
512295c
Fix the failing test for irrelevant vfs changes
cormacrelf Jan 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ nohash-hasher = "0.2.0"
text-size = "1.1.0"
serde = { version = "1.0.156", features = ["derive"] }
serde_json = "1.0.96"
salsa = "0.17.0-pre.2"
triomphe = { version = "0.1.8", default-features = false, features = ["std"] }
# can't upgrade due to dashmap depending on 0.12.3 currently
hashbrown = { version = "0.12.3", features = [
Expand Down
2 changes: 1 addition & 1 deletion crates/base-db/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ rust-version.workspace = true
doctest = false

[dependencies]
salsa = "0.17.0-pre.2"
salsa.workspace = true
rustc-hash = "1.1.0"

triomphe.workspace = true
Expand Down
7 changes: 6 additions & 1 deletion crates/paths/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ impl AbsPath {
/// # Panics
///
/// Panics if `path` is not absolute.
pub fn assert(path: &Path) -> &AbsPath {
pub fn assert<P: AsRef<Path> + ?Sized>(path: &P) -> &AbsPath {
let path = path.as_ref();
assert!(path.is_absolute());
unsafe { &*(path as *const Path as *const AbsPath) }
}
Expand Down Expand Up @@ -194,6 +195,10 @@ impl AbsPath {
self.0.ends_with(&suffix.0)
}

pub fn ancestors(&self) -> impl Iterator<Item = &AbsPath> {
self.0.ancestors().map(AbsPath::assert)
}

pub fn name_and_extension(&self) -> Option<(&str, Option<&str>)> {
Some((
self.file_stem()?.to_str()?,
Expand Down
1 change: 1 addition & 0 deletions crates/rust-analyzer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ toolchain.workspace = true
vfs-notify.workspace = true
vfs.workspace = true
la-arena.workspace = true
salsa.workspace = true

[target.'cfg(windows)'.dependencies]
winapi = "0.3.9"
Expand Down
3 changes: 2 additions & 1 deletion crates/rust-analyzer/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ use crate::{
};

mod patch_old_style;
mod tree;

// Conventions for configuration keys to preserve maximal extendability without breakage:
// - Toggles (be it binary true/false or with more options in-between) should almost always suffix as `_enable`
Expand Down Expand Up @@ -2194,7 +2195,7 @@ enum AdjustmentHintsDef {
Reborrow,
}

#[derive(Serialize, Deserialize, Debug, Clone)]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
#[serde(untagged)]
enum DiscriminantHintsDef {
#[serde(with = "true_or_always")]
Expand Down
Loading