Commit Graph

50 Commits

Author SHA1 Message Date
Matt Bierner
fc709e2d35 Use more standard values for scheme constants (#153367)
This drops the `:` from the scheme constants as it was easy to misuse this
2022-06-27 22:35:17 +02:00
Matt Bierner
07144d22c4 Rename types in the markdown extension (#152905)
Renames in the markdown extension

This renames some types and splits up some files as part of an exploration towards a proper LSP. Changes:

- `SkinnyTextDocument` -> `ITextDocument`
- Moved `ITextDocument` to own file
- `MdWorkspaceContents` -> `IMdWorkspace`
2022-06-22 14:12:48 -07:00
Matt Bierner
2249b171f4 Reduce number of times MD docs are re-tokenized (#152674)
This change reduces the number of times we retokenize a markdown file by doing the following:

- Use `MdTableOfContentsProvider` in more places
- Introduce a `IMarkdownParser` interface that lets us drop in a caching version of the tokenizer
2022-06-21 08:43:01 +02:00
Matt Bierner
3ce5c78cb9 Extract workspaceContents to own file 2022-03-29 18:19:49 -07:00
Matt Bierner
4949f13d13 Organize imports 2022-03-29 13:25:40 -07:00
Matt Bierner
7736c87cb0 Move markdown preview files to own folder 2022-03-29 13:25:35 -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
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
Matt Bierner
d3585388be Make sure markdown.showSource correctly awaits opening the document
Fixes #132914
2021-09-14 09:54:05 -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
Matt Bierner
af39918361 Organize imports in md ext 2021-08-03 13:22:46 -07:00
Matt Bierner
134c345351 Try adding browser specific tsconfig
Trying to add this to catch dependencies we take on node types
2021-07-22 17:00:17 -07:00
Matt Bierner
0a57fd87b1 Enable math in markdown preview
Fixes #124783
2021-06-08 09:58:54 -07:00
Henning Dieterichs
1f8643ef76 Refresh Images In Markdown Preview On Change (#114083)
* Refresh Images In Markdown Preview On Change (implements #65258).

* Fixes tests.

* Implements etags.

* Adds tests for urlToUri.

* Updates doc comment.
2021-01-19 18:01:21 -08:00
Matt Bierner
24b28f57be Always use vscode.open to open markdown links
Fixes #108998

This ensures we use the custom editor if it is the default
2020-11-05 17:00:16 -08:00
Matt Bierner
1cfd3a1b28 Use own version of toJson
This avoids having the uri transformed unexpectedly
2020-07-13 10:56:21 -07:00
Matt Bierner
fdf23dc5f9 Working on supporting markdown links in serverless+web
For #101203
2020-07-10 13:25:55 -07:00
Matt Bierner
eb29e868de Use uri 2020-07-10 13:25:16 -07:00
Matt Bierner
ef02845561 Convert to async 2020-07-10 13:25:16 -07:00
Matt Bierner
e7bc301be6 When clicking on a link to a folder in markdown, reveal the folder
Fixes #91336
2020-04-13 13:02:14 -07:00
Matt Bierner
7ee9aa4757 Rename and move types around to get ready for webview editor based previews 2019-11-08 10:38:51 -08:00
Matt Bierner
2fe62e7dfe Use the document that contains the md link as the resource for getting config, not the target document 2019-09-10 16:31:53 -07:00
Matt Bierner
28c5988f47 Renaming setting names 2019-09-10 16:20:01 -07:00
Matt Bierner
728ee3aa73 Extract 2019-09-10 16:06:08 -07:00
Salvador Cabrera Lozano
c307d73664 Fix for #26659. (#80227)
* Fix for #26659.

Clicking on a  local file link will open up the editor on a separate editor group (new or reuse existing one).

* Fix for #26659: Add way to open Markdown links in a different editor group

Adding "markdown.editor.openMarkdownLinks" setting to specify where
links to markdown files should open (current editor group by default).
2019-09-10 15:58:27 -07:00
Matt Bierner
1802be3b70 Always require an argument to command
#75612
2019-08-20 11:26:49 -07:00
Matt Bierner
f509f7f141 Rename command
#75612
2019-08-20 11:25:42 -07:00
Matt Bierner
7c3aeb10a2 Merge pull request #77151 from connor4312/feat/markdown-render-command
feat(markdown): add render command (fixes #75612)
2019-08-20 11:23:47 -07:00
Connor Peet
3c42f56552 fixup! render a string as well 2019-07-11 11:24:28 -07:00
Connor Peet
7dd109c2df feat(markdown): add render command (fixes #75612)
This adds a command which renders the provided document, or the active
editor if one is provided. Following the pattern of some of the preview
commands, it returned `undefined` if there's no document provided and
no active text editor. Otherwise, seems to work...

```ts
const html = await vscode.commands.executeCommand<string>('markdown.render');
```

A way to render arbitrary strings in addition to documents may be useful at
some point in the future. However, I didn't implement that here as that'd
require some refactoring of the markdown engine. If we're interested though
I could certainly give that a shot.
2019-07-10 15:49:06 -07:00
masliu
173d010b0a Rename sourceViewColumn to resourceColumn 2019-07-04 22:29:23 -04:00
masliu
47f9ed5d22 Save source viewColumn for previews, fixes #74008 2019-07-04 21:37:28 -04:00
Howard Hung
0ddd999172 Fix typo: showSecutitySelectorForResource -> showSecuritySelectorForResource 2019-05-22 01:25:59 +08:00
Vitaliy Mazurenko
e40d72b1b5 re-rendering Markdown preview when updated extra configurations provided by extension 2019-04-01 10:52:23 +03:00
Matt Bierner
c1c3e5eab0 Properly encode markdown file path for open links
Fixes #59523

Double encode the path so that `Uri.parse`'s decoding only strips out the first level of encoding
2019-01-28 15:45:42 -08:00
Rob Lourens
ef2547d547 replace void 0 with undefined 2019-01-03 11:20:19 -08:00
Matt Bierner
6d5214053c Fix local markdown document links for untitled files
Fixes #59523
2018-10-04 19:01:34 -07:00
Matt Bierner
e19c9ba82d Addd option to open markdown preview links in markdown preview
Fixes #19339
2018-09-21 15:08:42 -07:00
Matt Bierner
7185906189 Reduce usage of postCommand in markdown preview 2018-09-21 15:08:41 -07:00
Matt Bierner
ee947947a7 Fix duplicate markdown previews potentially being shown in the same editor group
Fixes #56910
2018-08-21 16:42:11 +02:00
Matt Bierner
749eb1ebcd Make sure we handle line number links correctly in preview
Fixes #51919
2018-06-15 10:09:27 -07:00
Benjamin Pasero
2ec2cf597a API tweaks for grid editor (#51876)
* fix #51001

* add onDidChangeTextEditorViewColumn test that validates moving editor group

* adopt vscode.ViewColumn.Beside

* add vscode.setEditorLayout command
2018-06-14 17:17:39 +02:00
Matt Bierner
2319e47db1 Make sure we use normalized path for compare
Fixes #50760

(the path should already have been normalized at this point so I don't think there is any user impact)
2018-05-30 11:16:16 -07:00
Matt Bierner
0d584a9086 Allow open preview from markdown file title context menu
Part of #37045
2018-04-30 17:30:44 -07:00
Matt Bierner
fd182746cb Fix can't change markdown security level for directly opened file
Fixes #46424
2018-04-02 16:29:49 -07:00
Matt Bierner
18146e8c71 Use activePreview when running markdown commands
Fixes #46216
2018-03-20 14:30:39 -07:00
Matt Bierner
468dc867cd Rename markdown to markdown-language-features 2018-03-19 21:08:39 -07:00