Commit Graph

36 Commits

Author SHA1 Message Date
Matt Bierner
00273730e8 Split markdown linkComputer from linkProvider (#152124)
Instead of passing around a full `vscode.DocumentLinkProvider`, we should pass just the more minimal interface that consumers need
2022-06-14 15:34:05 -07:00
Babak K. Shandiz
a8de8e2112 [markdown] Ignore brackets inside link text (#151610)
* 🔨 Allow texts in bracket pairs inside link titles; [text](link)

Signed-off-by: GitHub <noreply@github.com>

* 🔨 Allow texts in bracket pairs inside link titles; [text](<link>)

Signed-off-by: GitHub <noreply@github.com>

* ⚗️ Add tests to verify  link titles can include bracket pairs

Signed-off-by: GitHub <noreply@github.com>
2022-06-09 11:48:50 -07:00
Matt Bierner
9545af80f6 Fix markdown link detection for links with titles (#151459)
Fixes #151458
2022-06-07 20:58:29 +00:00
Justin Chen
bcc7ffae3e bugfix on markdown underlines, addressing part of issue #136073 (#151178)
Co-authored-by: Justin Chen <t-justinchen@microsoft.com>
Co-authored-by: Matt Bierner <matb@microsoft.com>
2022-06-06 17:35:41 +00:00
Matt Bierner
9302343e8e Also ignore star checkboxes (#151029)
Fixes #150672

This makes our md link detection also ignore checkboxes like `* [x]` instead of just `- [x]`
2022-06-01 21:23:29 +00:00
Matt Bierner
7477efd87e Better message for markdown reference links (#151018)
Fixes #151017

Also improves the diagnostic message for invalid reference links to make it clear we are talking about a missing link definition
2022-06-01 19:01:36 +00:00
Matt Bierner
e6fff5ecff Don't parse checkboxes are links in markdown (#150914)
Fixes #150672
2022-05-31 14:57:32 -07:00
Matt Bierner
daf0d5e551 Add skipPaths option for markdown link validation (#149859)
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
2022-05-18 14:37:08 -07:00
Matt Bierner
c2b064538b Don't detect links in markdown code blocks (#149680)
Fixes #149678
2022-05-16 17:35:16 -07:00
Matt Bierner
dd9dca9825 Fixing some html tags detected as autolinks for diagnostics (#149511)
For markdown such as `<scope:tag>b</scope:tag>`, we currently detect `<scope:tag>` as an uri (an autolink) and then try validating it as a file path

This change doesn't fix `<scope:tag>` being detected as a link (which is actually correct if there isn't closing html), but does fix the us trying to validate it by marking the uri as external
2022-05-16 12:19:29 +02:00
Matt Bierner
113287ccc3 Don't treat escaped markdown reference links as links (#149407)
Fixes #149406

Make sure that escaping the leading `[` of a reference link means it is not considered a link

- Picks up new grammar with fixes
- Updates our document link provider to also not consider these as link
2022-05-12 19:35:36 -07:00
Matt Bierner
9e42783398 Don't repeat markdown link validation (#149169)
We currently validate each link in a markdown file individually. This means that if there are multiple links to the same file, we check if that file exists multiple times

With this change, we instead will check that the file exists once and then use this to add diagnostics for all the links to it. This is done by introducing a new `FileLinkMap` which maps file paths to links within that file
2022-05-10 09:14:40 -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
Akat
b499467f9f fix(markdown): avoid considering link references/sources in code sections (#146826) 2022-04-07 14:50:37 -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
55627db338 Move fragment range down into documentLinkProvider 2022-04-05 14:22:57 -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
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
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
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
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
Matt Bierner
ebd490f28e Improve markdown references
For #146277

- Find all references on links
- Better support for links without a file extension
2022-03-30 11:38:50 -07:00
Matt Bierner
8adb42079b Fix slow positionAt impl for markdown references
- Use `vscode-languageserver-textdocument` instead of custom impl
- Reuse `InMemoryDocument`  across tests and working code
- Use `SkinnyTextDocument` in more places
- Fixes some test errors that seem to be caused by bad `InMemoryDocument` impl
2022-03-29 18:19:52 -07:00
Matt Bierner
338ae07ccb Initial work on md references provider
#146277
2022-03-29 18:19:52 -07:00
Matt Bierner
2783263582 Clean up link provider 2022-03-29 18:19:47 -07:00
Matt Bierner
22fb4e9de8 Better align language provider names and export styles
- Use named exports
- use `Md*` for providers
2022-03-29 13:35:48 -07:00
Matt Bierner
d49fc3ca8d Move files to better folders and add better name 2022-03-29 13:25:38 -07:00
Matt Bierner
7736c87cb0 Move markdown preview files to own folder 2022-03-29 13:25:35 -07:00