Skip to content

Store client's version for open docs in LSP#80064

Merged
dibarbet merged 2 commits intodotnet:mainfrom
dibarbet:store_lsp_version
Sep 6, 2025
Merged

Store client's version for open docs in LSP#80064
dibarbet merged 2 commits intodotnet:mainfrom
dibarbet:store_lsp_version

Conversation

@dibarbet
Copy link
Copy Markdown
Member

@dibarbet dibarbet commented Aug 28, 2025

The client tells us the version of the text associated with each didOpen and didChange request. This PR updates our open document tracker to remember that version and allow subsequent requests to access the current snapshot's LSP version(s).

I'm planning on using this version in a followup on to improve scenarios where we send the client edits to apply (e.g. complex completion edits) to better track why edits may not be applying correctly.

@dibarbet dibarbet marked this pull request as ready for review August 28, 2025 23:34
@dibarbet dibarbet requested a review from a team as a code owner August 28, 2025 23:34

namespace Microsoft.CodeAnalysis.LanguageServer;

internal record struct TrackedDocumentInfo(SourceText SourceText, string LanguageId, int LspVersion);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider docing.

@dibarbet dibarbet merged commit 8008e0c into dotnet:main Sep 6, 2025
25 checks passed
@dibarbet dibarbet deleted the store_lsp_version branch September 6, 2025 05:41
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Sep 6, 2025
@akhera99 akhera99 modified the milestones: Next, 18.0 P1, 18.0 P2 Sep 22, 2025
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