Skip to content
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

Capture file content on open instead of save (#54643) #54667

Merged
merged 1 commit into from
Jul 8, 2021

Conversation

tmat
Copy link
Member

@tmat tmat commented Jul 7, 2021

Port #54643 to Preview 2

EnC analyzer needs to compare the original content of a source file, which the compiler used to emit the baseline dll, with the current snapshot.
To ensure the original content is compared, the EnC analyzer compares the checksum of the document with the checksum stored in PDB. If they don't match the document is "out of sync" and analysis can't be performed until the analyzer gets ahold of the original content.

The solution snapshot captured at the start of debugging or Hot Reload session doesn't necessarily reflect the original content since workspace is updated based on file watcher events and updates in editor buffers.

Previously we attempted to capture the original file content when an editor buffer is saved (looking at the content on disk before the save). However the current implementation is just best effort (race condition) and the editor currently does not provide APIs that would give us a chance to asynchronously read the content of the file before the save operation without blocking UI.

Instead, we check the checksum of the content of a source file on disk when the file is opened.

Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1348122

@tmat tmat requested a review from a team as a code owner July 7, 2021 21:52
@tmat
Copy link
Member Author

tmat commented Jul 7, 2021

@jinujoseph

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants