Commit Graph

12 Commits

Author SHA1 Message Date
Matt Bierner
e4f7f6a9da Add PasteEditProvider (#107283)
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
2022-05-25 12:27:58 +02:00
Matt Bierner
1c7ab35761 Rename to DocumentOnDropEditProvider (#149730)
This change renames `DocumentOnDropProvider` to `DocumentOnDropEditProvider`. This new name aligns with the existing `DocumentFormattingEditProvider`
2022-05-17 09:26:54 -07:00
Matt Bierner
a6dd083a7e Use / for md paths, even on windows (#149120)
Fixes #149010
2022-05-09 15:22:44 -07:00
Matt Bierner
93fd393a0e Add API proposal for reading files in data transfer (#148596)
* Add experimental support for reading files in data transfer

Adds a new `DataTransfer.asFile` method which lets you get file objects from a `DataTransfer`. This is currently only hooked up for drop into editors.

A few follow ups:

- Right now the file data is also read eagerly when it is transfered to the extension host. Before shipping this we would make this happen lazily instead
- The drop into editor api does not provide a nice way to do anything with the dropped files.

    We should at least support returning a `WorkspaceEdit`. However `WorkspaceEdit` only supports text files, so we would also need to add an API that lets it deal with binary files

* Make `asFile` return a value instead of a promise

`asFile().data()` already returns a promise so `asFile` doesn't also need to be async

* Trying resolving data files transfer lazily

* Cleaning up code for lazy drop

* Remove testing code

* Remove unneeded buffer serialize

* 💄
2022-05-04 12:59:27 -07:00
Matt Bierner
08e838cba3 Don't encode paths 2022-04-19 10:13:38 -07:00
Matt Bierner
cba0a0e460 Always encode paths dropped in md 2022-04-14 14:55:22 -07:00
Matt Bierner
bba6c56123 Fix dropping image from webpage into markdown files 2022-04-06 14:27:41 -07:00
Matt Bierner
62d6f38fc2 Auto create image links when dropping an image file into markdown 2022-04-05 15:42:56 -07:00
Matt Bierner
032ee47056 Add setting to enable/disable markdown drop into editor
For #142990
2022-04-05 15:42:56 -07:00
Matt Bierner
44ffeba237 Switch to provider based model for on drop
This simplifies implementing the provider and also give potentially gives us more control over how the drop happens
2022-04-01 15:51:38 -07:00
Matt Bierner
5451119820 Adopt SnippetTextEdit for drop 2022-04-01 15:51:38 -07:00
Matt Bierner
7736c87cb0 Move markdown preview files to own folder 2022-03-29 13:25:35 -07:00