Repository navigation
Markdown: read the markdown.editor.filePaste settings - #350850
Merged
Federico Brancasi (federicobrancasi) merged 1 commit intoNov 28, 2026
Merged
Federico Brancasi (federicobrancasi) merged 1 commit into
Federico Brancasi (federicobrancasi) merged 1 commit into
Conversation
The extension declares markdown.editor.filePaste.enabled and markdown.editor.filePaste.copyIntoWorkspace, but pasting read markdown.editor.paste.enabled and markdown.editor.paste.copyIntoWorkspace, which aren't registered, so both settings had no effect. Read the declared names, also in the Markdown editor's media paste and its error messages. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the Markdown file and media paste setting changes.
No open issues 🎉
What changed in this PR
Fixes Markdown file and media pasting to honor the registered markdown.editor.filePaste.* settings in both the text editor and Markdown editor.
Changes:
- Corrects configuration reads for paste enablement and copying media into the workspace.
- Updates two error messages to reference the registered setting names.
- Adds regression coverage for both settings set to
neveracross both editors.
No actionable issues identified.
| File | Description |
|---|---|
extensions/markdown-language-features/src/test/markdownEditorImagePaste.test.ts |
Tests that both paste paths honor the settings. |
extensions/markdown-language-features/src/preview/markdownEditorImagePaste.ts |
Corrects media-paste setting reads and error messages. |
extensions/markdown-language-features/src/languageFeatures/copyFiles/dropOrPasteResource.ts |
Corrects setting reads in the text editor’s paste provider. |
Review effort: Balanced
Federico Brancasi (federicobrancasi)
marked this pull request as ready for review
November 28, 2026 16:10
Federico Brancasi (federicobrancasi)
enabled auto-merge
November 28, 2026 16:14
Alexandru Dima (alexdima)
approved these changes
Nov 28, 2026
Bhavya U (bhavyaus)
approved these changes
Nov 28, 2026
Bhavya U (bhavyaus)
left a comment
Collaborator
There was a problem hiding this comment.
Approved — small, focused change; CI is green.
Federico Brancasi (federicobrancasi)
deleted the
fbrancasi/markdown-file-paste-settings
branch
November 28, 2026 17:25
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.
The Markdown extension declares
markdown.editor.filePaste.enabledandmarkdown.editor.filePaste.copyIntoWorkspacefor pasting files and images, but the paste code readsmarkdown.editor.paste.enabledandmarkdown.editor.paste.copyIntoWorkspace. Those names aren't registered, so both settings have had no effect since e5f5e91: withmarkdown.editor.filePaste.enabledset tonever, pasting an image still inserts a Markdown link, and withcopyIntoWorkspaceset tonever, the image is still copied into the workspace. In #210400 a user reported that the setting had no effect. The drop settings andmarkdown.editor.filePaste.videoSnippetandaudioSnippetwere already read by their declared names.This PR reads the declared names in the text editor's paste provider (
dropOrPasteResource.ts) and in the Markdown editor's media paste (markdownEditorImagePaste.ts), and fixes the setting names in that file's two error messages.How to test
The new test sets each setting to
neverand checks that neither the text editor's paste provider nor the Markdown editor's media paste creates a link or a file. It fails without the fix: both paste the image.Manually: set
"markdown.editor.filePaste.enabled": "never", copy an image and paste it in a Markdown file. No Markdown link is inserted../scripts/test-integration.sh --suite markdown --grep "Markdown editor image paste"node_modules/.bin/oxlinton the changed filesI compiled the extension with
tsc -p extensions/markdown-language-features/tsconfig.json; it reports no errors in the changed files.