-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 SourceRoot
s
#16742
Conversation
1eabeb4
to
349a0b6
Compare
ccf7081
to
cbe938b
Compare
SourceRoot
sSourceRoot
s
☔ The latest upstream changes (presumably #16747) made this pull request unmergeable. Please resolve the merge conflicts. |
1300cf1
to
5860374
Compare
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.
5860374
to
9c50d12
Compare
There was a problem hiding this 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
@bors r+ |
☀️ Test successful - checks-actions |
This commit adds the said relation by keeping a map of type
FxHashMap<SourceRootId,Option<SourceRootId>>
inside theGlobalState
. Its primary use case is readingrust-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.