EnC: Track documents that do not match the debuggee#38905
Merged
tmat merged 6 commits intodotnet:masterfrom Oct 4, 2019
Merged
EnC: Track documents that do not match the debuggee#38905tmat merged 6 commits intodotnet:masterfrom
tmat merged 6 commits intodotnet:masterfrom
Conversation
Member
Author
Member
Author
|
@dotnet/roslyn-compiler For compiler changes - simple refactoring so that we can share source hash algorithms with the IDE. |
jcouv
approved these changes
Sep 30, 2019
Member
jcouv
left a comment
There was a problem hiding this comment.
Compiler change LGTM Thanks (iteration 3)
ivanbasov
reviewed
Sep 30, 2019
src/Features/Core/Portable/EditAndContinue/CommittedSolution.cs
Outdated
Show resolved
Hide resolved
jasonmalinowski
approved these changes
Oct 3, 2019
Member
jasonmalinowski
left a comment
There was a problem hiding this comment.
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.
src/EditorFeatures/CSharpTest/EditAndContinue/CSharpEditAndContinueAnalyzerTests.cs
Outdated
Show resolved
Hide resolved
src/EditorFeatures/Core/Extensibility/Commands/PredefinedCommandHandlerNames.cs
Outdated
Show resolved
Hide resolved
src/EditorFeatures/Core/Implementation/EditAndContinue/ActiveStatementTrackingService.cs
Show resolved
Hide resolved
src/EditorFeatures/Core/Implementation/EditAndContinue/ActiveStatementTrackingService.cs
Show resolved
Hide resolved
src/EditorFeatures/Core/Implementation/EditAndContinue/EditAndContinueSaveFileCommandHandler.cs
Outdated
Show resolved
Hide resolved
src/EditorFeatures/Test/EditAndContinue/EditSessionActiveStatementsTests.cs
Outdated
Show resolved
Hide resolved
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 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.csfile 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.