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`)
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
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
* 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
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
* 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
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
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)
* 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