* Optimize markdown workspace scanning
- Adds cache for markdown file
- Avoid reading non-markdown files from disk (when we expect markdown files)
- Use `range.contains(pos)` instead of `range.intersects(range)`
* Don't remove cached document on change
We only want to invalidate the cached document when it is first opened (since the cached version is the one from disk). Otherwise we can use the live version of the doc
* Improve markdown link regexp
This makes the markdown link regexp more readable and also combines the two regular expressions we were running
* Fixed backtracking
We currently re-compute the same table of contents for markdown files multiple times. This is because multiple language features all need table of contents
With this change, we introduce a new `TableOfContentsProvider` which maintains a cache of the table of contents per file. This provider is then passed into every caller that needs a toc
* Try aligning external drop handling
Tree views provided the first public drag and drop api. We've since also adopted drag and drop for dropping into editors as well, which resulted in some duplicated code between it and the tree view implementation
This PR tried to better align the two by:
- Use `extractEditorsDropData` to add the uriList
- In the tree view, use `toVSDataTransfer` to convert the event to a `VSDataTransfer`
- Remove `convertKnownMimes` as `extractEditorsDropData` handles this now
* Add uriList for drag
* Also handle 'DataTransfers.RESOURCES'
* Fix monaco
(sorry for the size of this PR)
This change cleans up the markdown language features by making the following changes:
- Use `registerXSupport` public functions to register these
- Expose the slugifier the `MarkdownEngine` uses. You never want to use a different one if you already have a markdown engine
- Sort of clean up names. I'd introduced a bunch of confusing names while iterating in this space. What I'm working towards:
- `Computer` — Stateless thing that computer data
- `Provider` — Potentially stateful thing that provides data (which may be cached)
- `VsCodeProvider` — The actual implementation of the various vscode language features (which should only be used by VS Code and in tests, not shared with other features)
- Introduce `MdLinkProvider` to avoid recomputing links for a given document. Also use this to hide more internals of link computation