Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

internal: Implement parent-child relation for SourceRoots #16742

Merged
merged 2 commits into from
Mar 7, 2024

Conversation

alibektas
Copy link
Member

This commit adds the said relation by keeping a map of type FxHashMap<SourceRootId,Option<SourceRootId>> inside the GlobalState. Its primary use case is reading rust-analyzer.toml(#13529) files that can be placed in every local source root. As a config will be found by traversing this "tree" we need the parent information for every local source root. This commit omits defining this relation for library source roots entirely.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 3, 2024
@alibektas alibektas force-pushed the 13529/source_root_tree branch 2 times, most recently from ccf7081 to cbe938b Compare March 3, 2024 16:32
@alibektas alibektas changed the title internal: internal: Implement parent-child relation for SourceRoots internal: Implement parent-child relation for SourceRoots Mar 3, 2024
@bors
Copy link
Collaborator

bors commented Mar 4, 2024

☔ The latest upstream changes (presumably #16747) made this pull request unmergeable. Please resolve the merge conflicts.

crates/load-cargo/src/lib.rs Outdated Show resolved Hide resolved
crates/load-cargo/src/lib.rs Outdated Show resolved Hide resolved
crates/vfs/src/file_set.rs Outdated Show resolved Hide resolved
crates/load-cargo/src/lib.rs Outdated Show resolved Hide resolved
crates/load-cargo/src/lib.rs Outdated Show resolved Hide resolved
crates/load-cargo/src/lib.rs Outdated Show resolved Hide resolved
crates/load-cargo/src/lib.rs Outdated Show resolved Hide resolved
crates/load-cargo/src/lib.rs Outdated Show resolved Hide resolved
@alibektas alibektas force-pushed the 13529/source_root_tree branch 3 times, most recently from 1300cf1 to 5860374 Compare March 5, 2024 01:06
crates/load-cargo/src/lib.rs Outdated Show resolved Hide resolved
crates/load-cargo/src/lib.rs Outdated Show resolved Hide resolved
crates/load-cargo/src/lib.rs Outdated Show resolved Hide resolved
@Veykril Veykril added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 5, 2024
This commit adds the said relation by keeping a map of type `FxHashMap<SourceRootId,Option<SourceRootId>>`
inside the `GlobalState`. Its primary use case is reading the rust-analyzer.toml files that can be
placed under every local source root. As a config will be found by traversing this "tree" we need the parent information
for every local source root. This commit omits defining this relation for library source roots entirely.
@alibektas alibektas added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 6, 2024
Copy link
Member

@Veykril Veykril left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit annoying that source_root_parent_map is quadratic over the roots, but I think that shouldn't really be a problem in practice

@Veykril
Copy link
Member

Veykril commented Mar 7, 2024

@bors r+

@bors
Copy link
Collaborator

bors commented Mar 7, 2024

📌 Commit 9c50d12 has been approved by Veykril

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Mar 7, 2024

⌛ Testing commit 9c50d12 with merge a1fda64...

@bors
Copy link
Collaborator

bors commented Mar 7, 2024

☀️ Test successful - checks-actions
Approved by: Veykril
Pushing a1fda64 to master...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants