Commit Graph

217 Commits

Author SHA1 Message Date
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 eba8ef0547 Add diagnostics for markdown links (#148578)
* 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
2022-05-02 16:06:00 -07:00
Jean Pierre 44e644467d Enable go to definition for markdown links (#148017)
* Enable go to definition for markdown links

* Add markdown definitionProvider tests
2022-05-02 10:07:40 -07:00
Matt Bierner 8449a9f5cb Fix md rename when file does not exist
Fixes #148147

- Don't try renaming non-existent files
- Also fixes a bug where renaming in untitled files would insert `untitled:`
2022-04-30 19:52:44 -04:00
Matt Bierner c41728c479 Fixes #147896 (#148101)
* Fixes #147896

* Replace all

* Fix windows slash check

* Skip test on windows for now
2022-04-26 15:45:15 -04:00
Matt Bierner 59b6227bf3 Use un-encoded file paths are rename placeholder 2022-04-21 22:23:53 -04:00
Matt Bierner 7b1168660a Fix resolving of links on rename
We should resolve relative to the file the rename is triggered in
2022-04-21 22:23:53 -04:00
Matt Bierner 62eebab685 Use uri instead of string 2022-04-21 22:23:52 -04:00
Matt Bierner b438e8438d Fixing rename to use correct file paths relative to containing files 2022-04-21 22:23:52 -04:00
Matt Bierner 0610f195fb Try automatically adding .md file extension to new paths on rename 2022-04-21 22:23:51 -04:00
Matt Bierner 0ac39e800d Add support for renaming files in markdown using F2
This lets you trigger F2 on a file path in a markdown link to both rename the file and also update all references to it
2022-04-21 22:23:51 -04:00
Matt Bierner 9fbd962973 Differentiate md refs request on file path vs on fragment 2022-04-21 22:23:50 -04: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
Akat b499467f9f fix(markdown): avoid considering link references/sources in code sections (#146826) 2022-04-07 14:50:37 -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 b4b7380576 Fix md references not checking authority
Simply compare by string for now
2022-04-05 15:31:43 -07:00
Matt Bierner a56c9f10b7 Enable find all references and rename of auto links and http(s) links in markdown
For #146777, #146277
2022-04-05 15:18:18 -07:00
Matt Bierner c80acef8a1 Mark cached prop readonly 2022-04-05 15:18:17 -07:00
Matt Bierner 55627db338 Move fragment range down into documentLinkProvider 2022-04-05 14:22:57 -07:00
Matt Bierner 9b141e1959 Use clearer logic 2022-04-05 14:22:57 -07:00
Matt Bierner 2154f3d008 Pass through CancellationToken 2022-04-05 11:56:40 -07:00
Matt Bierner 0496c2b3a7 Add basic file references provider for markdown
Fixes #146267
2022-04-05 11:56:40 -07:00
Matt Bierner d0767451a9 Adding test for renaming the definition itself 2022-04-04 15:56:29 -07:00
Matt Bierner 7831ff6a32 Reuse references in rename requests 2022-04-04 15:56:29 -07:00
Matt Bierner baa7434480 Use header text as placeholder for md rename
For #146291
2022-04-04 15:56:28 -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 ca267e3f5e Error on rename in bare file links in definition 2022-04-01 11:15:24 -07:00
Matt Bierner 114b340f7a Fix explicit references to own file 2022-04-01 11:15:24 -07:00
Matt Bierner 8b7086afdb Fixing false positive ref link being detected 2022-03-31 19:09:14 -07:00
Matt Bierner c39d09a4c0 Working on initial support for renaming refs in md
For #146291
2022-03-31 18:28:23 -07:00
Matt Bierner 6b573340bd Fixing references on header when looking at file extensions 2022-03-31 15:31:41 -07:00
Matt Bierner 8a6a300216 Simplify code for dealing with link definitions 2022-03-31 15:11:35 -07:00
Matt Bierner 57dffde3d4 Trying to clean up md link structure by moving defintion up a level 2022-03-31 15:11:35 -07:00
Matt Bierner 0e65adbda8 Initial work on rename in markdown
For #146291

Also fixes references triggered on a definition link
2022-03-31 15:11:34 -07:00
Matt Bierner 6da26a9351 Fix duplicate resources sometimes opened from references 2022-03-31 11:56:37 -07:00
Matt Bierner e32a13be77 Fix references to header to return just the span of the header itself and not its body 2022-03-31 11:56:37 -07:00
Matt Bierner 55719a3dc5 Remove dup type 2022-03-30 16:33:34 -07:00
Matt Bierner 1bb96d5d72 Mark methods private 2022-03-30 16:33:34 -07:00
Matt Bierner afad64c534 Move function to method 2022-03-30 16:33:33 -07:00
Matt Bierner 174924d73c Clean up link data structure 2022-03-30 16:33:33 -07:00
Matt Bierner cfe0b1d480 Extract getReferencesToLink and getReferencesToReferenceLink 2022-03-30 16:33:32 -07:00
Matt Bierner 2510e3dca6 Refactoring md refs provider to prep for re-use 2022-03-30 16:33:32 -07:00
Matt Bierner 6c7ba2de69 Fix refs to own file being included in md ref results from other file
For #146277
2022-03-30 15:22:15 -07:00
Matt Bierner f68db8f6ba Compare normalized fragments for md references
For #146277
2022-03-30 15:14:33 -07:00
Matt Bierner d441406b1e Include invalid references as targets for find all references
For #146277
2022-03-30 14:36:03 -07:00
Matt Bierner 17783a09e5 Add support for reference to ref links in md
For #146277
2022-03-30 14:36:03 -07:00