Fixes#184980
This refactors much of the logic around markdown paste/drop. PR got a little large but the main highlights are:
- Allow using a custom snippet for inserted audio/video
- Merge the drop/paste resource provider classes since these are so similar
- Enable smart pasting of url text by default
- Refactor url paste logic
- For now, disable the behavior where url paste could paste a combination of markdown and plain uris. In practice this is confusing, especially because our labels for this were wrong. We can always reintroduce this later if multicursor users find it useful
* making markdown link pasting feature smarter
* Update settings description
Co-authored-by: Joyce Er <joyceerhl@gmail.com>
* made checkPaste more concise
* won't paste md link in fenced code or math
* updated the smart md link pasting
* link validation and naming changes
* resolving comments and tests
* resolving comments & writing tests
---------
Co-authored-by: Joyce Er <joyceerhl@gmail.com>
* making markdown link pasting feature smarter
* Update settings description
Co-authored-by: Joyce Er <joyceerhl@gmail.com>
* made checkPaste more concise
* won't paste md link in fenced code or math
---------
Co-authored-by: Joyce Er <joyceerhl@gmail.com>
* turning highlighted Mardown text to link to pasted URL
* resolved comments
* resolved more comments
* preserved behavior of existing file pasting logic
---------
Co-authored-by: Meghan Kulkarni <t-mekulkarni@microsoft.com>
Allow copying files in the workspace on markdown drop / paste
Fixes#157043
Also:
- Renames the markdown paste settings and makes them no longer experimental
- Makes the copyFiles setting no longer experimental
- Adds a `markdown.copyFiles.overwriteBehavior` which lets you control if/how existing files are overwritten
* Revert "Revert "Add experimental setting to define where files should be copied for markdown (#169454)" (#169615)"
This reverts commit b2121c2dbe.
* Fix tests
These paths should always use `/`
* Change descriptions to just say “Enable…”
Previously these said “Enable or disable…”, which in the context of a tick box doesn’t make sense.
* Change “Enable/disable” wording in descriptions
* Rework markdown update link glob
Fixes#164587
This changes the `externalFileGlobs` setting to instead be a include array of globs that should trigger link updates. I've split the globs into markdown files and image/video files
This also makes it easier for users to add their own new globs to the list
* Fix scopes
* Add experimental support for update markdown links on file moves/renames
Fixes#148146
This adds a new experimental setting that automatically updates markdown
Note that this needs a new version of the vscode-markdown-languageservice so the build is expected to break for now
* Pick up new LS version
Turns on pasting of links for easier testing. However `editor.experimental.pasteActions.enabled` is still off by default so this won't be enabled by default
Clairify markdown validate settings
Fixes#150949
- Rename headerLinks -> fragmentLinks
- Add new `fileLink.markdownFragmentsLinks` to validate the headers on fragment links (inherits the default setting value from `fragmentLinks`)
For #30066
This adds a new `documentPaste` api proposal that lets extensions hook into copy and paste.
This can be used to do things such as:
- Create link when pasting an image
- Bring along imports when copy and pasting code
This change renames the experimental skipPaths setting to ignoreLinks. This setting applies to all types of links, and can also be used to ignore links to headers
The new `markdown.experimental.validate.fileLinks.skipPaths` setting lets you specify a list of paths (as globs) that should not be validation
This is useful since markdown is used in a range of environments, and sometimes you may need to link to paths that don't exist on disk but will exist on deployment
A few other changes here:
- Adds a quick fix that adds paths to `skipPaths`
- Rename existing settings to use the `.enabled` prefix
* Initial work on md link diagnostics
* Adding settings to enable/disable validation
* Add delay for recomputing diagnostics
* 💄
* Split test on diagnostics compute vs management
* Validate on file open
* Remove dianostics on file close
* Allow paths to folders
* Add validation configuration option