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

Merged
merged 1 commit into from
Jul 7, 2021
Merged

Conversation

tmat
Copy link
Member

@tmat tmat commented Jul 6, 2021

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 6, 2021 21:58
@tmat
Copy link
Member Author

tmat commented Jul 6, 2021

@davidwengier

@tmat tmat merged commit dddf21a into dotnet:main Jul 7, 2021
@ghost ghost added this to the Next milestone Jul 7, 2021
@tmat tmat deleted the EncOpenFile branch July 7, 2021 16:05
@tmat tmat modified the milestones: Next, 17.0.P3 Jul 7, 2021
tmat added a commit to tmat/roslyn that referenced this pull request Jul 7, 2021
333fred added a commit to 333fred/roslyn that referenced this pull request Jul 8, 2021
* upstream/main: (559 commits)
  Remove a few unused error codes (dotnet#54663)
  Use specific error message for wrong arity in async builder (dotnet#54632)
  Update azure-pipelines-richnav.yml (dotnet#54662)
  Capture file content on open instead of save (dotnet#54643)
  Add docs
  Further FAR simplifications
  Handle enhanced #line directive in DirectiveTriviaSyntax.DirectiveNameToken (dotnet#54636)
  move server name outside of loop
  Fix functionid
  Reduce telemetry output from find document in workspace
  Ensure we don't try and build an empty table when modifying entries with no values (dotnet#54639)
  Feedback
  Ensure we don't try and build an empty table when modifying entries with no values (dotnet#54639)
  No need to specialized logic for determining set of projects to search
  Defer group computation till reporting time
  Handle FAR for global suppressions in a consistent fashion
  Update status for enhanced `#line` directive (dotnet#54581)
  Split IOperationTests into one part per type
  [LSP] Revert semantic tokens change in main (dotnet#54570)
  Add exceptionutilities unreachable to catch blocks that should not be hit
  ...
ryzngard added a commit that referenced this pull request Jul 8, 2021
Capture file content on open instead of save (#54643)
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.

3 participants