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

Self-versioned documents #10747

Merged
merged 18 commits into from
Aug 27, 2024
Merged

Conversation

davidwengier
Copy link
Contributor

@davidwengier davidwengier commented Aug 15, 2024

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

@davidwengier davidwengier requested a review from a team as a code owner August 15, 2024 20:15
@davidwengier davidwengier marked this pull request as draft August 16, 2024 01:11
@davidwengier davidwengier force-pushed the dev/dawengie/SelfVersionedDocumentSnapshots branch 4 times, most recently from d8a4db3 to 92743cc Compare August 16, 2024 05:07
@davidwengier davidwengier force-pushed the dev/dawengie/SelfVersionedDocumentSnapshots branch from 92743cc to 374e85c Compare August 16, 2024 05:11
@DustinCampbell
Copy link
Member

DustinCampbell commented Aug 19, 2024

Commit-at-a-time review is highly recommended, as there are lots of flow on effects of API changes.

Note that I won't give a checkmark (nor should anyone else, honestly 😄) for a draft PR. Happy to leave early feedback though.

Copy link
Member

@DustinCampbell DustinCampbell left a 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.

@davidwengier davidwengier marked this pull request as ready for review August 19, 2024 22:11
@davidwengier
Copy link
Contributor Author

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

@@ -55,7 +55,7 @@ public TextDocumentIdentifier GetTextDocumentIdentifier(FoldingRangeParams reque

var requestParams = new RazorFoldingRangeRequestParam
{
HostDocumentVersion = documentContext.Version,
HostDocumentVersion = documentContext.Snapshot.Version,
Copy link
Member

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

Copy link
Contributor Author

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.

Copy link
Member

@maryamariyan maryamariyan left a 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
@davidwengier
Copy link
Contributor Author

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!");
Copy link
Contributor Author

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

@davidwengier
Copy link
Contributor Author

Alright, I'm merging. Let the chips fall where they may.

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

Successfully merging this pull request may close these issues.

Stop using VS buffer version numbers in the language server
5 participants