Ensure GetFirstRelatedDocumentId doesn't return non-source documents#81893
Merged
jasonmalinowski merged 1 commit intodotnet:mainfrom Jan 8, 2026
Merged
Conversation
JoeRobich
reviewed
Jan 7, 2026
JoeRobich
approved these changes
Jan 7, 2026
CyrusNajmabadi
approved these changes
Jan 7, 2026
The expectation of our "related" document helpers seems to be they only operate on regular documents. If we didn't do this, and we have a regular source file also being added as an additional file somewhere, callers of this method get surprised. Fixes https://developercommunity.visualstudio.com/t/Constant-Feature-X-is-currently-unava/11023066
ea43ed8 to
abb6bf7
Compare
Contributor
|
Started backporting to |
jasonmalinowski
added a commit
that referenced
this pull request
Jan 9, 2026
…-source documents (#81923) Backport of #81893 to release/dev18.3 /cc @jasonmalinowski ## Customer Impact If the user adds a .cs file to one of their projects as additional files, we may break when we try to unify syntax trees for them, since the additional files don't actually have syntax trees. ## Regression Unclear; this might have been an older regression when we introduced this mechanism. The customer who reported it said itw as a regression but since they had made a lot of changes to their code around that time that would have exposed it. ## Testing Unit tests were added. They were validated to produce the same exception as is being reported from the customer. ## Risk Low.
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.
The expectation of our "related" document helpers seems to be they only operate on regular documents. If we didn't do this, and we have a regular source file also being added as an additional file somewhere, callers of this method get surprised.
Fixes https://developercommunity.visualstudio.com/t/Constant-Feature-X-is-currently-unava/11023066