-
Notifications
You must be signed in to change notification settings - Fork 196
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
Self-versioned documents #10747
Self-versioned documents #10747
Conversation
src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/GeneratedDocumentSynchronizer.cs
Show resolved
Hide resolved
d8a4db3
to
92743cc
Compare
fixup semantic tokens tweask
92743cc
to
374e85c
Compare
Note that I won't give a checkmark (nor should anyone else, honestly 😄) for a draft PR. Happy to leave early feedback though. |
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.
Did a pass through your commits.
src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/DocumentState.cs
Outdated
Show resolved
Hide resolved
src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/IDocumentSnapshot.cs
Show resolved
Hide resolved
...oft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget.cs
Outdated
Show resolved
Hide resolved
...nguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_UpdateCSharpBuffer.cs
Outdated
Show resolved
Hide resolved
...zor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/GeneratedDocumentSynchronizerTest.cs
Show resolved
Hide resolved
src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/ProjectSystem/ProjectStateTest.cs
Outdated
Show resolved
Hide resolved
...or/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/ProjectSystem/TestDocumentSnapshot.cs
Outdated
Show resolved
Hide resolved
...or/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/ProjectSystem/TestDocumentSnapshot.cs
Outdated
Show resolved
Hide resolved
...o.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_SemanticTokens.cs
Outdated
Show resolved
Hide resolved
...oft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget.cs
Outdated
Show resolved
Hide resolved
Should have taken this out of draft a few days ago, sorry. I do still want to get an integration test run with for it though |
…rsionedDocumentSnapshots
@@ -55,7 +55,7 @@ public TextDocumentIdentifier GetTextDocumentIdentifier(FoldingRangeParams reque | |||
|
|||
var requestParams = new RazorFoldingRangeRequestParam | |||
{ | |||
HostDocumentVersion = documentContext.Version, | |||
HostDocumentVersion = documentContext.Snapshot.Version, |
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 can't tell from diff why we need to get version from Snapshot
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.
Simply because that's where it is now. It used to be on DocumentContext
by way of DocumentVersionCache
, but the version cache has been deleted and each document snapshot is responsible for its own version number 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.
LGTM, but seems like some merge conflicts have occurred
…rsionedDocumentSnapshots # Conflicts: # src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/ProjectSystem/DocumentContextExtensions.cs
…use only we understand our version numbers
Integration tests work! Found a bug in code actions from the integration tests, which was also present in the presentation endpoints. And a slight whoopsy in our code action telemetry, which I didn't introduce, but I fixed because I'm nice like that 😛 Running another round of integration tests, and then will have to consider merging, versus holding off until after the snap. |
if (previouslyPublishedData.HostDocumentVersion > hostDocumentVersion) | ||
{ | ||
// We've already published a newer version of this document. No-op. | ||
Debug.Fail("Html document being published that is older than one we've previously published!"); |
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.
@ryzngard reports that removing this line (and the equiv for C#) fixes issues in VS Code, so this bears removal, and subsequent investigation
Alright, I'm merging. Let the chips fall where they may. |
Fixes #9197
A few integration tests to investigate, but the guts are here.
I'm slightly worried this might cause us to recompile files more often, but there is also the chance this fixes a bunch of bugs by recompiling files more often :)
Commit-at-a-time review is highly recommended, as there are lots of flow on effects of API changes