Commit Graph

602 Commits

Author SHA1 Message Date
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
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
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
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
b012216211 Fix markdown images having duplicate ids (#157177)
Fixes #153144
2022-08-05 06:31:42 +02:00
Matt Bierner
784de60319 Add activeWebviewPanelId context key (#156944)
Fixes #156942

This context tracks the id of the active webviewPanel
2022-08-03 07:03:33 +02:00
Matt Bierner
b2daf1af82 Add MD server tracing and update diagnostics on files changes (#155797) 2022-07-21 10:07:06 -07:00
Matt Bierner
924dde5c1e Documenting markdown LS (#155789) 2022-07-21 11:48:30 +02:00
Matt Bierner
32f5e49082 Move MD diagnostics to language server (#155653)
* Move MD diagnostics to language server

This switches us to using the LSP pull diagnostic model with a new version of the language service

* Bump package version

* Delete unused file
2022-07-19 16:34:09 -07:00
Matt Bierner
394eaa9fa3 Fix md document links for untitled files (#155248) 2022-07-14 18:15:13 -07:00
Matt Bierner
9ee8961347 Move MD references, rename, and definition support to md LS (#155127) 2022-07-14 08:32:27 +02:00
Matt Bierner
bec36ce756 Move md path completions and document links to language server (#155100) 2022-07-13 12:49:37 -07:00
Matt Bierner
75e231ad82 Clean up document link resolve (#154959)
- Move vscode scheme normalization to the DocumentLinkProvider
- Remove extra function since we already recognize uri-like links
2022-07-12 15:55:21 -07:00
Matt Bierner
eeb8d49317 Move md workspace symbol search to language service (#154874)
* Move md workspace symbol search to language service

Also implements more of IWorkspace for the server

* Revert extra change
2022-07-12 10:04:25 -04:00
Matt Bierner
c9bf4393d5 Rename drop API interface (#154876)
Makes the names more consistent
2022-07-12 11:33:13 +02:00
Matt Bierner
e02c71e3c6 Fix range of reference links (#154819)
Fixes #150921
2022-07-11 17:46:15 +02:00
Matt Bierner
2b3912fa29 Fix markdown extension path (#154656)
Fixes #154645
Fixes #154653
2022-07-10 14:25:45 +02:00
Matt Bierner
2fb56e9d62 Move smart select and folding to md language server (#154334)
* Move smart select and folding to md language server

Also fixes a few minor issues:

- Don't log to web console
- Remove convert code since it is no longer needed
- Use correct extension id

* bump cache

* Bump package version

Co-authored-by: João Moreno <joao.moreno@microsoft.com>
2022-07-07 07:30:03 -07:00
Matt Bierner
ad9675f099 Scaffold out basic markdown language server (#154293)
* Scaffold out basic markdown lsp

This scaffolds out a new markdown language server and then uses it to implement document symbols. After the change, the markdown extension will have the following structure:

- languageService — Where all the LSP language stuff will eventually land
- server — The actual language server. Consumes ` languageService`
- src — The current extension that launches the server and implements VS Code specific functions

* Adding build scripts

* a

* Use language service from github

* Remove ls build scripts

* Bump versions

* Only build ext

* Enable for web

* Fixing for browser
2022-07-06 16:03:24 -07:00
Matt Bierner
f6271dd82e Fix angle bracket path completions for link defs (#154182)
Fixes #153866
2022-07-05 11:55:20 -07:00
Matt Bierner
fc0bd9d377 Remove reliance on document.lineAt (#154191)
* Remove reliance on document.lineAt

This helps aligning more with the LSP types: https://github.com/microsoft/vscode-languageserver-node/issues/146

* Strip newline
2022-07-05 11:52:47 -07:00
Matt Bierner
e44361365e Don't include reference links that are inside other links (#153864)
Fixes #150921
2022-06-30 15:43:31 -07:00
Matt Bierner
bbce24d8bb Handle fs error in markdown path completions (#153869)
Fixes #153867
2022-06-30 22:32:32 +00:00
Matt Bierner
e13feea6ae Only compute diagnostics for opened md files (#153395)
* Only compute diagnostics for opened md files

For #152494

* Make tests stable for result ordering
2022-06-27 15:55:38 -07:00
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
da0f64881a Dispose in markdown tests (#153345)
Updates the markdown tests to dispose of disposables created during the test
2022-06-27 15:52:59 -04:00
Matt Bierner
d1b4630a50 Fix Markdown tests on windows (#153212)
Fix windows tests
2022-06-25 18:59:25 +02:00
Matt Bierner
3b549009fe Markdown path completions tests use mocked out fs (#153045)
* Markdown path completions tests use mocked out fs

This updates the path completion tests to stop depending on the actual fs and instead use `IMdWorkspace`

* Update remaining tests
2022-06-24 23:01:24 +00:00
Matt Bierner
64305a732e Better handling of text/uri-list in built-in extensions (#153163)
- When splitting `text/uri-list`, we should split on `\n` to handle against spec versions of `text/uri-list`
- However when constructing a `text/uri-list`, we should use `\r\n` to align with the spec
2022-06-24 15:24:16 -07:00
Matt Bierner
7fd834b64f Enable angle bracket path completions in markdown (#153158)
Fixes #152510
2022-06-24 15:04:40 -07:00
Matt Bierner
8acfd0ae60 Exclude empty links from md results (#153161)
These are technically valid links but we don't care about them since they take up no space
2022-06-24 21:42:00 +00:00
Matt Bierner
00ad6bc3d4 Markdown document links should reveal cell in notebook (#153147)
Fixes #141024
2022-06-24 15:49:15 -04:00
Matt Bierner
d6497d3db1 Use ResourceMap (#153051)
Replaces `Set` of uris with a `ResourceMap`
2022-06-24 01:00:05 +00:00
Matt Bierner
9b7696cc9c Fix notebook links to other docs in edited markdown cells (#153052)
Fixes #148199

This makes us resolve links in notebooks relative to the notebook document instead of relaitve to the cell
2022-06-23 20:55:08 -04:00
Matt Bierner
ab7bc9fb0b Split up MD link tests (#153048)
This splits the markdown link tests in two:

- Tests for detecting links in md files (`MdLinkComputer`)
- Tests for the actual vs code editor link provider

Also fixes a few cases splitting these tests up caught
2022-06-23 17:53:56 -07:00
Matt Bierner
385bf5036b Optimize NoLinkRanges lookup (#153010)
This switches us to use a map to check if a position exists inside the no link ranges
2022-06-23 11:38:13 -07: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
be1ee5d9f1 Re-validate md files when a linked to file is created or deleted (#152520) 2022-06-22 19:02:46 +00:00
Matt Bierner
321423db2b Standardize text/uri-list handling (#152756)
This creates a common set of functions for creating and parsing the `text/uri-list` mime type. As part of this, I also aligned us with the standard, which uses `\r\n` between lines instead of just `\n`
2022-06-22 13:53:37 +02:00
Matt Bierner
5437480941 Enable md paste actions by default (#152810)
Turns on pasting of links for easier testing. However `editor.experimental.pasteActions.enabled` is still off by default so this won't be enabled by default
2022-06-22 08:19:52 +02:00
Matt Bierner
c84655d123 Reduce recomputation of state in markdown extension (#152804)
* Reduce recomputation of state in markdown extension

- Use `getForDocument` more often to avoid refetching documents
- Debounce `MdTableOfContentsWatcher`. We don't want this to trigger on every keystroke :)

* Cache LinkDefinitionSet

* Add test file change

* Fix toc watcher for tests
2022-06-21 16:25:10 -07:00
Matt Bierner
389aa8a935 Fix MdDocumentInfoCache computing values twice (#152799)
* Fix MdDocumentInfoCache computing values twice

Fixes a race where values could be computed twice before being cached

* Remove only
2022-06-21 16:22:07 -07:00
Matt Bierner
d5a75f2ceb Add logging for MD language features (#152792)
This verbose logging will help track down inefficient calling patterns (such as recomputing stuff)
2022-06-21 14:18:36 -07:00
Matt Bierner
bbe7b54cf4 Remove custom editor tests (#152777)
These tests are not actively being run or maintained. Removing them for now
2022-06-21 15:37:19 -04:00
Matt Bierner
fa53aa6fec Cleanup pass for md extension (#152760)
Clean up names in md extension
2022-06-21 15:36:32 -04: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