Commit graph

908 commits

Author SHA1 Message Date
Matt Bierner 641046a11d
Add commands to insert images/links in markdown (#163706)
* Add commands to insert images/links in markdown

Fixes #162809

* Rename commands and allow passing in uris

* Support selecting many images/files
2022-10-14 16:05:36 -07:00
Matt Bierner 3b255af0cb
Pick up latest vscode-markdown-languageservice (#163681) 2022-10-14 11:46:24 -07:00
Matt Bierner 186d3415a3
Use ??= in more places (#163594) 2022-10-13 14:59:35 -07:00
Matt Bierner e1a373defd
Finalize markdown link updating on file move (#163378)
Fixes #148146
2022-10-11 17:42:10 -07:00
Matt Bierner 6cf68a1f23
Remove .only and fix tests (#163376)
Fixes #162159
2022-10-11 17:41:13 -07:00
Matt Bierner d05d85a78b
Move html rewriting for old webviews to (#163367)
The `asWebviewUri` methods was introduced in VS Code 1.38. It's silly that we still force every single webview to pay the cost of trying to rewrite the old style uris we supported in very old versions of VS Code

Instead I've moved this logic into the extension host and disabled it for all extensions that target VS Code 1.60+ or newer. This means it never applies to internal webviews, notebooks, webview views, or custom editors (these public apis were all introduced after the switch to `asWebviewUri`)
2022-10-11 16:08:17 -07:00
Matt Bierner bfb1a738d1
Fix markdown open preview opening duplicate preview (#162793)
This fixes the markdown 'open preview' command when used with `vscode.ViewColumn.Active` or `vscode.ViewColumn.Beside`
2022-10-06 09:50:10 +02:00
Matt Bierner 4991cf2112
Remove console.log (#162784) 2022-10-05 15:25:52 -07:00
Matt Bierner d47ae7a2e7
Pick up latest markdown language service version (#162777)
Fixes #162776
Fixes #162775
2022-10-05 15:08:51 -07:00
Matt Bierner 3ee9749b35
Remove extra enums (#162686)
`showMessage` returns the selected item, so we don't need to create an enum here and can instead used the returned items directly
2022-10-04 10:46:53 -07:00
Matt Bierner cbb0a982fd
Pick up final markdown language service 0.1 release (#162256)
Just pulling in the stable release
2022-09-28 14:02:26 -07:00
Matt Bierner 5296b0faf3
Add explicit "inherit" setting for fragments links (#162231)
Fixes #162129
2022-09-28 14:08:03 -04:00
Tyler James Leonhardt 29e985eca0
rev vscode-nls to version that doesn't ask for vscode-nls-web-data (#161819)
ref #161297
2022-09-26 11:10:54 -07:00
Matt Bierner b8a7485526
Fix markdown preview refresh from disk (#161800)
Fixes #149974
2022-09-26 09:49:53 -07:00
Matt Bierner 2a4fb40a6e
Align list of supported tags in rendered markdown (#161544)
This expands the list of html tags we allow in markdown. To get this list, I've copied the list of tags from `markdownDocumentRenderer` into `dom` after  reviewing them

For #134514, I've also added `video` to the list of allowed tags
2022-09-22 18:25:48 -07:00
Matt Bierner 82c1bf86bf
Show better error when rename fails in md (#161525)
* Show better error when rename fails in md

* Pick up latest MDLanguage service
2022-09-22 16:27:25 -07:00
Matt Bierner 023930e3dc
Fix extra dot in pasted file names (#161434) 2022-09-21 23:29:21 +02:00
Matt Bierner 07a5d2749f
Allow _ in notebook markdown links (#161437)
Fixes #160853
2022-09-21 14:23:47 -07:00
Matt Bierner 17bb582b85
Finalize markdown diagnostics (#161427)
Fixes #146303

This moves the markdown diagnostic support out of `experimental` and to an official feature (however it remains off by default)
2022-09-21 12:20:25 -07:00
Matt Bierner 333754f29b
Better handle moves of multiple markdown links (#161354)
This makes the markdown language service handle moving/renaming multiple files instead of making multiple calls into the language service
2022-09-20 21:53:58 -07:00
Matt Bierner d03f015931
Clean up structure of markdown extension (#161148)
- Move things related to the client under `client`
- Remove extra abstractions that are no longer used
- Add MdLanguageClient type
2022-09-19 07:16:45 +02:00
Matt Bierner f4bf1f30a2
Skip ul and ol when highlighting selected markdown element (#161139)
Fixes #155552

For lists, the outer ul/ol always has the same source line as the first element in the list. We should prefer using the first element in the list when highlighting the active line

This also fixes a bug where scroll sync would stop working if you added lines to the doc. This was caused by `lineCount` getting out of sync as the document is being updated. I've removed this state and made the reveal logic more robust instead
2022-09-19 07:16:06 +02:00
Matt Bierner a10bdfb49b
Allow underscores in rendered md headers (#161149)
Follow up from https://github.com/microsoft/vscode-markdown-languageservice/pull/49
2022-09-16 20:52:50 -04:00
Matt Bierner 4c9c3f628d
Pick up latest markdown language service (#161142) 2022-09-16 20:52:16 -04:00
Peng Lyu 0f05c6dd4f
Fix #160729. Disable workspace md paste handler for notebook. (#160833)
Co-authored-by: Matt Bierner <matb@microsoft.com>
2022-09-15 09:48:21 -07:00
Matt Bierner 03ada8a3e8
Rework how markdown server works with documents (#160948)
* Rework how markdown server works with documents

This rewrites how the markdown server works with documents. The goal is to better handle switching between in-memory versions of a doc (from `TextDocument`) and versions of the same doc on disk. From the markdown service's POV, there is only one type of document

As part of this, I've also adopted the newest markdown language service version

* Bump package-lock versions
2022-09-15 09:27:02 +02:00
Matt Bierner fa1fee3b21
Pick up latest Markdown language service (#160831) 2022-09-14 09:20:52 -07:00
Matt Bierner 2cf7468289
Fix markdown server deleting documents on close if they still exist on disk (#160859) 2022-09-14 09:16:39 -07:00
Matt Bierner 3729f509b5
Support creating image in workspace when pasting image data into markdown (#160554)
For #157043
2022-09-10 08:56:18 -07:00
Matt Bierner 5d5ea15a65
Allow passing in custom workspace/parser to markdown server (#160429)
For #159805

This splits the markdown server into two main functions:

- `startVsCodeServer` which assumes the client can implement all the functionality of VS Code. It is not specific to VS Code however, the client just need to implement the custom messages that VS Code does

- `startServer` which lets you pass in your own implementation of the parser and workspace. A consumer of the server can then use this to have their own custom server implementation, which might use normal node apis to read files
2022-09-08 11:35:42 -07:00
Matt Bierner 2d27f8db6a
Use MD LS for resolving all document links (#160238)
* Use MD LS for resolving all document links

This switches the markdown extension to use the markdown language service when resolving the link. This lets us delete a lot of code that was duplicated between the extension and the LS

* Pick up new ls version
2022-09-07 20:55:14 -07:00
Matt Bierner 077f5865da
Support latest md ls (#160228)
- Update `looksLikeMarkdownPath` to look at open documents and notebooks, not just the uri
- Register custom command  for document links
2022-09-07 07:17:41 +02:00
Matt Bierner c4722f1bb2
Write markdown link setting change to correct scope (#159816)
Fixes #159084

Also fixes the same issue for JS/TS
2022-09-02 13:38:41 +10:00
Matt Bierner d9fd208c29
Default to workspace root when dropping into untitled md files (#159814)
Fixes #159812
2022-09-01 16:03:40 -07:00
Matt Bierner 21337aed3f
Pick up newest markdown language service (#159619)
This brings support for code actions and source actions, along with some bug fixes

Also fixes `getAllMarkdownDocuments` to prefer open documents instead of those on disk
2022-08-31 09:20:41 +02:00
Matt Bierner 01ea9c11ea
Update extension enabled tsconfig libs (#159631)
Matches what we set for `src/`
2022-08-31 07:57:15 +02:00
Matt Bierner a13e5e1da6
Also apply max-width to videos in webviews (#159500) 2022-08-30 00:52:54 +02:00
Matt Bierner b91533f3d7
Pick up latest vscode-markdown-languageservice (#159341) 2022-08-26 13:08:49 -07:00
Matt Bierner ea6cfdd2ef
Pick up 8.0.2 for MD language client (#159319)
Missed updating this when pulling in new server version

https://github.com/microsoft/vscode-languageserver-node/issues/1064
2022-08-26 11:13:37 -04:00
Matt Bierner 0a7b686a48
Fix markdown not registering find all references support (#159242) 2022-08-26 01:42:52 +02:00
Matt Bierner 940abc9c11
Fix workspace edit format for update md paths on move (#158965)
Unblocks testing #158416
2022-08-23 16:33:00 -07:00
Matt Bierner 3393b785de
Bump server version (#158297) 2022-08-16 14:38:41 -04:00
Matt Bierner 720a61fc28
Fix markdown link diagnostics not updated when directories are renamed / deleted (#157956)
Fix markdown link diagnostics not updated when directories are renamed/deleted

Turns our that `createFileSystemWatcher` will not fire if a parent dir is renamed / deleted. See #60813

To fix this, I believe we have to create watchers for all parent directories too (or watch everything in the entire workspace)
2022-08-12 13:48:40 -04:00
Matt Bierner b731beeef4
Use notebook document uri for drop / copy paste (#157939)
Fixes #157938
2022-08-11 19:52:55 +01:00
Matt Bierner 38ea5c22a6
Pick up new markdown LS version (#157843) 2022-08-10 18:16:24 -07:00
Matt Bierner 8bf82819fc
Add experimental support for update markdown links on file moves/renames (#157209)
* Add experimental support for update markdown links on file moves/renames

Fixes #148146

This adds a new experimental setting that automatically updates markdown

Note that this needs a new version of the vscode-markdown-languageservice so the build is expected to break for now

* Pick up new LS version
2022-08-09 08:31:40 -07:00
Matt Bierner 389938998f
Show error when markdown preview restore fails (#157566)
Fixes #155493
2022-08-09 09:55:40 +02:00
Matt Bierner 0103536a60
Apply editor-font-family to all code in notebooks (#157554)
Apply editor-font-family to all `code` in notebook

Fixes #146696

This matches what we do in the markdown preview
2022-08-08 20:59:16 +02:00
Tyler James Leonhardt d8453c0440
Rev built-in versions of vscode-nls to 5.1.0 (#157530)
* rev version of vscode-nls to 5.1.0

* and yarn lock
2022-08-08 18:43:45 +02:00
Matt Bierner 07e45c5a71
Fix package version (#157202)
Not sure why this was not caught by earlier builds
2022-08-04 21:40:06 -07:00