Commit Graph

1242 Commits

Author SHA1 Message Date
Matt Bierner
04ecb1d42f Normalize markdown links in notebooks (#148827)
Fixes #146352

This ensures we pass links in markdown cells through the same normalization function we use to assign headers ids
2022-05-05 18:33:38 +00:00
Matt Bierner
c08941b87c Ignore bulkedit previews for markdown references / renames (#148744)
Makes sure we don't pick up the fake documents created by the bulkedit-preview
2022-05-04 16:03:35 -07:00
Matt Bierner
9dab79d9c8 Fix markdown web extensions (#148739)
We're currently importing a file from `test/util`, which is not supported on web. Move the noop cancellation token into the `util` folder instead
2022-05-04 14:02:38 -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
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
Matt Bierner
e3e4bfacc3 Remove blank 2022-05-02 15:50:41 -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
Yuki Hattori
82ad6afd36 Fixes microsoft/vscode#147936 (#148503)
By changing output esbuild setting for Markdown preview scripts to iife,
prevents global namespace pollution and reduces possibility of breaking
the preview by contributions from other extensions.
2022-05-02 09:33:51 -07:00
Matt Bierner
892d6ec2a2 Fix md workspace cache for untitled files
Makes sure we also add all text documents to the list of md docs
2022-04-30 20:15:40 -04: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
3e182633c7 Adding some more tests for markdown references 2022-04-30 19:14:03 -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
Benjamin Pasero
72b4be55fa skip markdown rename tests (#147896) 2022-04-22 08:07:49 +02: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
800eec5645 Mark setting as experimental again
Will finalize along when we actually ship this api
2022-04-19 13:08:47 -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
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
27759c6e03 Use limiter instead of custom batcher 2022-04-06 14:16:06 -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
rebornix
024e40fb31 💄 2022-04-04 14:20:07 -07:00
rebornix
ab2a987919 fix #146750. 2022-04-04 14:19:15 -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