Skip to content

Commit 35a0856

Browse files
authored
Merge pull request #3 from cormacrelf/config-tree
Config tree
2 parents ddbdecf + 512295c commit 35a0856

File tree

8 files changed

+709
-5
lines changed

8 files changed

+709
-5
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ nohash-hasher = "0.2.0"
100100
text-size = "1.1.0"
101101
serde = { version = "1.0.156", features = ["derive"] }
102102
serde_json = "1.0.96"
103+
salsa = "0.17.0-pre.2"
103104
triomphe = { version = "0.1.8", default-features = false, features = ["std"] }
104105
# can't upgrade due to dashmap depending on 0.12.3 currently
105106
hashbrown = { version = "0.12.3", features = [

crates/base-db/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ rust-version.workspace = true
1212
doctest = false
1313

1414
[dependencies]
15-
salsa = "0.17.0-pre.2"
15+
salsa.workspace = true
1616
rustc-hash = "1.1.0"
1717

1818
triomphe.workspace = true

crates/paths/src/lib.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ impl AbsPath {
136136
/// # Panics
137137
///
138138
/// Panics if `path` is not absolute.
139-
pub fn assert(path: &Path) -> &AbsPath {
139+
pub fn assert<P: AsRef<Path> + ?Sized>(path: &P) -> &AbsPath {
140+
let path = path.as_ref();
140141
assert!(path.is_absolute());
141142
unsafe { &*(path as *const Path as *const AbsPath) }
142143
}
@@ -194,6 +195,10 @@ impl AbsPath {
194195
self.0.ends_with(&suffix.0)
195196
}
196197

198+
pub fn ancestors(&self) -> impl Iterator<Item = &AbsPath> {
199+
self.0.ancestors().map(AbsPath::assert)
200+
}
201+
197202
pub fn name_and_extension(&self) -> Option<(&str, Option<&str>)> {
198203
Some((
199204
self.file_stem()?.to_str()?,

crates/rust-analyzer/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ toolchain.workspace = true
7575
vfs-notify.workspace = true
7676
vfs.workspace = true
7777
la-arena.workspace = true
78+
salsa.workspace = true
7879

7980
[target.'cfg(windows)'.dependencies]
8081
winapi = "0.3.9"

crates/rust-analyzer/src/config.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ use crate::{
4242
};
4343

4444
mod patch_old_style;
45+
mod tree;
4546

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

2197-
#[derive(Serialize, Deserialize, Debug, Clone)]
2198+
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
21982199
#[serde(untagged)]
21992200
enum DiscriminantHintsDef {
22002201
#[serde(with = "true_or_always")]

0 commit comments

Comments
 (0)