-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Fix crash in FAR helpers when only part of a linked-document set has been updated #66805
Conversation
// It's possible for us to have a solution snapshot where only part of a linked set of documents has | ||
// been updated. As such, the other linked docs may have different contents/sizes than the original | ||
// doc we started with. Skip those files as there's no sensible way to say that we have linked | ||
// symbols here when the contents are not the same. |
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.
❔ Can we take this one step further and check that the SourceText
is the same? While the syntax trees might differ, I would expect linked documents to at least share the SourceText
internally.
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.
i'd prefer to not accidentally cause us to break where someone legally updates the different forks with different source-texts :)
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.
Is there another way to do content validation efficiently? Or perhaps the number of cases of mismatched SourceText is so rare that we can do checksum comparison if the length is the same but the instance is different?
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.
generally speaking, i think this check, along with the check below (For name/kind) is sufficient.
@@ -271,7 +272,15 @@ public static IEnumerable<TSymbol> FindSimilarSymbols<TSymbol>(TSymbol symbol, C | |||
foreach (var linkedDocumentId in originalDocument.GetLinkedDocumentIds()) | |||
{ | |||
var linkedDocument = solution.GetRequiredDocument(linkedDocumentId); | |||
|
|||
// It's possible for us to have a solution snapshot where only part of a linked set of documents has |
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.
I'm wondering if we need to handle this in completion as well. Here for example: https://sourceroslyn.io/#Microsoft.CodeAnalysis.Features/Completion/Providers/AbstractSymbolCompletionProvider.cs,324
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.
ANy place that assume the files must have the same content is definitely in error and needs to be fixed up.
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.
No description provided.