Commit Graph

778 Commits

Author SHA1 Message Date
Matt Bierner
a4e529c759 Add basic markdown link completions
For #140602

Only normal links for now. Will add reference links later. Should support the forms:

- `[](dir/file.md)`
- `[](./dir/file.md)`
- `[](/root-dir/file.md)`
- `[](#header)`
- `[](./dir/file.md#header)`
2022-01-12 18:13:21 -08:00
Matt Bierner
43c5bc4795 Always add dirname of current md document to localResourceRoots
Fixes #139907

Previously we only added this dir on `file` file system
2022-01-11 12:39:54 -08:00
Matt Bierner
f528f1a415 Make sure markdown refresh forces the preview to be updated 2022-01-08 17:30:37 -08:00
Matt Bierner
ef69c9c8d8 Fix markdown pinning test 2022-01-05 14:49:00 -08:00
Mohammad Sadegh Salimi
2a0d371ca3 Adding support for RTL languages for readme markdown preview. (#139644)
* [markdown preview] dir "auto" added to the markdown-body class.

* fix markdown preview for RTL languages
2022-01-05 14:14:32 -08:00
Matt Bierner
5cbc8ed825 Enable find widget in markdown preview custom editors
Fixes #139148
2021-12-14 18:37:47 -08:00
Matt Bierner
9f454a39b3 Fix md preview trying to update its content on dispose 2021-12-14 18:37:47 -08:00
Hans
3abcabd4e8 fix generates different html content for the same markdown (#138935)
fix generates different html content for the same markdown when get the cached token
2021-12-13 16:55:54 -08:00
Matt Bierner
e88394000f Fix markdown outline for cases without a space after #
Fixes #138027
2021-12-06 15:58:11 -08:00
Joyce Er
efd055b8ba Refresh markdown preview on all file changes (#138301)
* Refresh markdown preview on all file changes

* Don't watch `https`, `http`, and `data` uris
2021-12-06 12:36:22 -08:00
Matt Bierner
c8a321ae17 Skip document link test on web
Fixes #136738

Cant figure out why these tests sometimes timeout in safari on web. Only in ci too it seems :/
2021-11-15 13:27:04 -08:00
Matt Bierner
40fbc4e89e Unskip test 2021-11-11 09:20:58 -08:00
Johannes Rieken
edb91ace89 Merge branch 'main' into joh/vscode-dts 2021-11-11 09:30:36 +01:00
Matt Bierner
3a79384dbf Tempoary skip sometimes flaky tests 2021-11-10 20:28:43 -08:00
Matt Bierner
4c00e6de08 Adding logging to test
For #136738
2021-11-10 16:07:35 -08:00
Johannes Rieken
d90dd1355b Merge branch 'main' into joh/vscode-dts 2021-11-10 08:40:26 +01:00
Matt Bierner
23090cfde3 Force update the md preview when a file on disk changes 2021-11-09 16:14:04 -08:00
Johannes Rieken
68e819043c use tsconfig.json#include for vscode.d.ts and vscode.proposed.d.ts, enables to remove most ref.d.ts-files 2021-11-09 15:53:35 +01:00
Johannes Rieken
9254a8cd27 move vscode.d.ts and vscode.proposed.d.ts into src/vscode-dts-folder, https://github.com/microsoft/vscode/issues/131165 2021-11-09 15:00:03 +01:00
Matt Bierner
516bc19e99 Fix md preview reverting to original version when switching away 2021-11-03 20:54:21 -07:00
Alex Dima
a704a69394 Enforce that source code uses a small subset of Unicode 2021-11-03 23:34:41 +01:00
Matt Bierner
a046cfb481 Revert "Remove image stabilizer code"
This reverts commit 69e8e3c091263a2e00592cca06bf1dba96b70c7e.
2021-11-03 14:48:48 -07:00
Matt Bierner
1f3f74f4ea Clear this._fileWatchersBySrc 2021-11-03 14:48:47 -07:00
Matt Bierner
86c446baee Don't update icon path so much
We only need to update this on creation, never every time something changes
2021-11-03 14:48:47 -07:00
Matt Bierner
9c2b239e2e Remove image stabilizer code
Should not be required with incremental dom updates
2021-11-03 14:48:46 -07:00
Matt Bierner
359cd4330d clean up onDidChangeActiveTextEditor
Also fixes potential bug if line === 0
2021-11-03 14:48:46 -07:00
Matt Bierner
97e646c0da Update preview if text document is reopened
Fixes #135568
2021-11-03 14:48:45 -07:00
Matt Bierner
7d46b77c31 Disable fuzzy links in md preview
Fixes #136198
2021-11-01 17:41:40 -07:00
Matt Bierner
8f672cac62 Use morphdom to reduce number of full page updates to md preview
This should help improve scroll sync and also reduce the number of times we go out to the network if images are in the preview
2021-11-01 15:33:00 -07:00
Matt Bierner
a9bc0553f7 Support definition links with spaces
For #136073
2021-11-01 09:23:03 -07:00
Matt Bierner
b7c340f119 Simplify import path 2021-10-14 09:32:35 -07:00
Matt Bierner
c986aef642 Remove .only and fix fragment used when opening file
Keeping the fragment causes a duplicated file to be opened
2021-10-13 19:33:56 -07:00
Matt Bierner
830987eac3 Refactor document link opening
- Extract out of command
- Try to preserve uri instead of converting to path
- Better handle case with absolute file path when there is no workspace
2021-10-13 19:27:35 -07:00
Matt Bierner
d1f72b5420 Try to clairify how md links are resolved
For #101203

The current logic ends up tossing out the uri scheme and other important info when opening md links. This PR tries to avoid that
2021-10-13 19:00:19 -07:00
Matt Bierner
8b2b819f55 Update test case 2021-10-12 17:29:53 -07:00
Matt Bierner
5d60bcd241 Fix null type error 2021-10-12 17:02:06 -07:00
Lemmingh
d3ceb35bec Add source map for every possible element in the Markdown preview (#134799)
* Update markdown-it and type definitions

* Refresh the source map mechanism in `markdownEngine.ts`
2021-10-12 16:25:56 -07:00
Matt Bierner
0dae77d06e Enable markdown links with line numbers to non-md files
Fixes #125320
2021-10-07 18:35:09 -07:00
Matt Bierner
ecae847b95 Fix navigate in untitled files 2021-10-07 18:14:16 -07:00
Matt Bierner
d8507236f1 Rewrite logic for opening markdown document links
Fixes #133823

This rewrites openDocumentLink to use `stat` to check if files exists before trying to open them. This lets us avoid showing extra error popups while trying to open resources
2021-10-07 18:10:05 -07:00
Logan Rasmussen
35ea6c0cf5 Remove angle brackets when checking the scheme (#133419)
* Remove angle brackets when checking the scheme

This only removes the brackets during the scheme check if the initial link provided actually has angle brackets.

* Move angle bracket logic to document link file

Change to use replace instead of match for easier reading
2021-10-04 08:31:52 -07:00
Matt Bierner
4c78259529 Revert 75e1fa6c43
Fixes #132741

Let's keep the outline extensible. Instead, a markdown extension could contribute support for the syntax in the original issue in #131427
2021-09-14 16:36:53 -07:00
Matt Bierner
e43d47e852 Add missing await
Doesn't seem to cause any issues currently
2021-09-14 09:54:05 -07:00
Matt Bierner
d3585388be Make sure markdown.showSource correctly awaits opening the document
Fixes #132914
2021-09-14 09:54:05 -07:00
Matt Bierner
c62f59fcae Fix map func not having this bound
Fixes #132703
2021-09-09 15:03:30 -07:00
Matt Bierner
277f6ef132 Log errors when loading markdown-it plugins 2021-09-08 15:12:46 -07:00
Matt Bierner
0e52275271 Introduce WebviewOptions.forms
Fixes #132157
2021-09-02 13:24:49 -07:00
John Murray
75e1fa6c43 fix #131427 ignore extension contributions when populating Outline for markdown file (#131572) 2021-08-30 14:13:17 -07:00
Benjamin Pasero
68daa9669e fix #131535 (#131630) 2021-08-25 10:53:38 -07:00
Jean Pierre
c094fcf995 Fixes #113475 (#130815) 2021-08-16 16:47:23 -07:00