[ty] Apply workspace settings to virtual files#23228
Merged
BurntSushi merged 3 commits intoastral-sh:mainfrom Feb 11, 2026
Merged
[ty] Apply workspace settings to virtual files#23228BurntSushi merged 3 commits intoastral-sh:mainfrom
BurntSushi merged 3 commits intoastral-sh:mainfrom
Conversation
daba328 to
342f461
Compare
BurntSushi
reviewed
Feb 11, 2026
Member
BurntSushi
left a comment
There was a problem hiding this comment.
This LGTM with a nit on the naming. Nice fix!
crates/ty_server/src/session.rs
Outdated
| // need to figure out which project should this virtual path | ||
| // belong to: https://github.com/astral-sh/ty/issues/794 (e.g. | ||
| // look for the first project with an overlapping search path?) | ||
| fn first_project_state(&self) -> &ProjectState { |
Member
There was a problem hiding this comment.
I think I'd prefer that this be called something like project_state_virtual_fallback or something similar. And then apply that name to first_project_state_mut and also first_settings. That way, the name makes its intended use somewhat clearer.
Contributor
Author
There was a problem hiding this comment.
Much clearer yes! Done :)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes astral-sh/ty#2783
[ty] centralize virtual project fallback:Sessionto centralize the "first project" virtual fallback heuristic used by project selection.[ty] apply workspace settings to virtual files:DocumentSnapshotworkspace settings resolution for virtual documents (for exampleuntitled://...).project_state, then resolve workspace settings from that owner.Test Plan
cargo test -p ty_server --test e2e inlay_hints