markdown: work around pasted link edit range mismatch - #332424
Draft
Dmitriy Vasyura (dmitrivMS) wants to merge 1 commit into
Draft
markdown: work around pasted link edit range mismatch#332424Dmitriy Vasyura (dmitrivMS) wants to merge 1 commit into
Dmitriy Vasyura (dmitrivMS) wants to merge 1 commit into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot started reviewing on behalf of
Dmitriy Vasyura (dmitrivMS)
August 24, 2026 19:58
View session
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a compatibility workaround for Markdown language server 0.5.0’s pasted-link range format.
Changes:
- Serializes pasted-link edit ranges as tuples.
- Explicitly types the compatibility payload.
- Adds focused regression coverage.
Show a summary per file
| File | Description |
|---|---|
src/client/client.ts |
Uses compatibility serialization for pasted-link edits. |
src/client/protocol.ts |
Defines and serializes the server-specific wire format. |
src/test/protocol.test.ts |
Verifies the serialized range shape. |
Review details
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 3/3 changed files
- Comments generated: 0
- Review effort level: Balanced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #323131
Potential upstream fix: microsoft/vscode-markdown-languageserver#25
Summary
Details
vscode-markdown-languageserver0.5.0 reads incoming edit ranges as[start, end], while the client currently sends the standard LSP{ start, end }shape. This causesmarkdown/getUpdatePastedLinksEditto fail while readingedit.range[0].line.This is a compatibility workaround for the currently packaged server. It should be removed when VS Code adopts an upstream server version containing microsoft/vscode-markdown-languageserver#25, which fixes the server to accept standard LSP
TextEditranges directly.Validation
npm --prefix extensions\markdown-language-features run build-ext.\scripts\test-integration.bat --suite markdown --grep "serializes text edits using the server range format"