-
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
F5 Hot Reload #52101
F5 Hot Reload #52101
Conversation
@@ -306,7 +324,7 @@ public void DiscardSolutionUpdate() | |||
public async ValueTask<ImmutableArray<ImmutableArray<(LinePositionSpan, ActiveStatementFlags)>>> GetBaseActiveStatementSpansAsync(Solution solution, ImmutableArray<DocumentId> documentIds, CancellationToken cancellationToken) | |||
{ | |||
var editSession = _editSession; | |||
if (editSession == null) | |||
if (editSession == null || !editSession.InBreakState) |
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 editSession ever null here now? Other than when EnC isn't active at all, but these calls shouldn't happen then, right? This could be a contract check perhaps?
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'll follow up with refactoring that cleans up edit session nullability. That can wait for Preview 3 though.
} | ||
|
||
_activeStatementTrackingService.StartTracking(); | ||
} | ||
|
||
public async Task ExitBreakStateAsync(CancellationToken cancellationToken) | ||
public Task ExitBreakStateAsync(CancellationToken cancellationToken) |
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.
Why does this still exist? Isn't this just part of CommitSolutionUpdate now?
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. This is still called by the debugger and signals end of break state. That's now different from end of edit session.
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.
src/Features/Core/Portable/EditAndContinue/EditAndContinueWorkspaceService.cs
Show resolved
Hide resolved
@@ -130,13 +121,19 @@ public void EndEditSession(out ImmutableArray<DocumentId> documentsToReanalyze) | |||
// clear all reported rude edits: | |||
documentsToReanalyze = session.GetDocumentsWithReportedDiagnostics(); | |||
|
|||
_debuggingSessionTelemetry.LogEditSession(_editSessionTelemetry.GetDataAndClear()); | |||
// TODO: report a separate telemetry data for hot reload sessions to preserve the semantics of the current telemetry data |
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 woudl love threading asserts on all these methods (i.e. AssertIsForeground/AssertIsBackground/ThisCanBeCalledOnAnyThread. It makes reading and understanding potential threading/sync/consistency issues more simply.
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.
Why? There is no thread affinity. By default we don't put attributes on methods that don't have affinity.
src/Features/Core/Portable/EditAndContinue/IEditAndContinueWorkspaceService.cs
Show resolved
Hide resolved
src/Features/Core/Portable/EditAndContinue/Remote/IRemoteEditAndContinueService.cs
Show resolved
Hide resolved
* upstream/main: (75 commits) Split BoundInterpolatedString into BoundInterpolatedString and BoundUnconvertedInterpolatedString (dotnet#52061) Combine VB comparers into one, and combine VB and C# comparers together (dotnet#51834) Use OptimizedVSCompletionList in LSP scenarios. F5 Hot Reload (dotnet#52101) Fix typescript shim Add tests for lazy syntax trees coming from the GeneratorDriver React to code review feedback. Simplify the lazy-initalization pattern used in GetRoot Remove an unnecessary override. (dotnet#52140) Update issue number (dotnet#52130) Enable CodeActions support for XAML using its own provider and CodeActionCache. The handlers are actually shared with Roslyn as is. (dotnet#52129) Add RestrictedIVT to dotnet watch to Features (dotnet#52087) Don't try to highlight operators (dotnet#52041) Use `null` instead of empty signature helps in LSP Use member type for relational pattern even in error cases (dotnet#51950) Update src/VisualStudio/Xaml/Impl/Implementation/LanguageServer/Extensions/SymbolExtensions.cs Use new QuickInfoUtilities helper Rebuild API shape (dotnet#52079) Added position parameter name Updated XAML QuickInfo to show more info like C# by using ISymbolDisplayService and adding more documentation parts. ...
Implements Roslyn side of https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1286563.
This change enables the debugger to query for and apply updates while the app being debugged is running, as opposed to when it's at a break state.
Previously Roslyn allowed changes to be made while the app is running but reported a warning that these changes won't be applied until the app is broken and resumed.
The previous Roslyn-debugger protocol required the following operation sequence:
StartDebuggingSession
(StartEditSession
EmitSolutionUpdate
(CommitSolutionUpdate
|DiscardSolutionUpdate
| rude edits reported)EndEditSession
)*EndDebuggingSession
This PR changes the sequence to:
StartDebuggingSession
(EnterBreakState
?EmitSolutionUpdate
(CommitSolutionUpdate
|DiscardSolutionUpdate
| rude edits reported ))*EndDebuggingSession
StartDebuggingSession
now starts run state edit session.EnterBreakState
closes current run state edit session and opens a new, break state edit session with active statements provided by the debuggerCommitSolutionUpdate
closes current edit session and opens a new run state edit session (without active statements)DiscardSolutionUpdate
is called when Reports no rude edits but other EnC providers fail (2-phase commit), it keeps the current edit session open, the user can try to apply the changes again (not changed in this PR)EmitSolutionUpdate
the edit session remains open as well, the user can fix them and try apply again (not changed in this PR)EndDebuggingSession
now closes current edit session.Follow ups: