-
Notifications
You must be signed in to change notification settings - Fork 4k
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
EnC: Track documents that do not match the debuggee #38905
Conversation
@dotnet/roslyn-compiler For compiler changes - simple refactoring so that we can share source hash algorithms with the IDE. |
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.
Compiler change LGTM Thanks (iteration 3)
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.
Compiler changes LGTM.
src/Features/Core/Portable/EditAndContinue/CommittedSolution.cs
Outdated
Show resolved
Hide resolved
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.
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.
Overall this matches what we've discussed in person as far as how this works. Not being familiar enough with the various implementation details of edit and continue I can't state if it's all correct I didn't see problems.
I found a few random "uh, this looks fishy" which are just local issues and a easy pass would clean things up.
The current Project System design doesn't allow us to capture a solution snapshot at the start of a debug session that would reflect the exact content of the source files on disk the assembly was built with (dotnet/project-system#5457). Roslyn relies on file system watches to detect changes in the source files. Events from the watcher may be handled by Roslyn at any point in time after the debugging started or not at all, since the OS does not guarantee the events to be triggered.
The PR adds a source file content checksum validation before the EnC service starts computation that depends on the content of a document at the start of the debug session. The validation compares the checksum stored in the PDB by the compiler with the current content of the file on disk. Documents are considered out-of-sync until the EnC service observes file content with matching checksum.
Fixes https://dev.azure.com/devdiv/DevDiv/_workitems/edit/970821
Fixes https://dev.azure.com/devdiv/DevDiv/_workitems/edit/992537
TODO:
To fix UWP apps 899910 we would need to implement #38954. UWP generates an
.g.cs
file with an empty class, so the file is not listed in the PDB and also when launched for the first time the document that's added to the workspace is empty. Since there is no checksum to compare to the EnC service considers the empty document a baseline document and then reports rude edit when the file gets updated to the empty class.