* 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>
* 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
* add `SnippetController#apply(ISnippetEdit[])`
This replaces the initial ugly trick with a more sound implementation of arbitrary snippet edits. A snippet edit can cover disconnected regions, each will be applied as separate text edit but everything will become a single `OneSnippet` instance
* add integration test for SnippetString-text edit inside workspace edit
* Add a share menu
Fixes#146309
* Add vscod.dev command in github extension
* Make share menu proposed
* Add share submenu into editor context
* Add proposed to editor share menu
* 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
- 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
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
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`
* introduce application config model
- application configuration is active and used only in non default profiles
- read/write application scoped settings only from application layer and not from user layer
- extensions get application scoped values as global values
- settings editor does not show application scoped settings in non default profle
- added unit tests
* fix tests
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`
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
* 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
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
* 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
(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
* Add test for MD diagnostic manager config changes
Add a simple test the enabling/disable diagnostics should make the diagnostic manager recompute diagnostics
* Add `.get`
* Clean up markdown diagnostic tests
This splits the diagnostic compute tests from the test for the diagnostic manager
* Mark internal field as private
This change renames the main markdown reference provider class to `MdReferenceComputer` and then uses this to implement a `vscode.ReferenceProvider`
This more cleanly splits the VS Code part of the logic from the general reference calculation stuff other providers consume
* Fix ranges and validation setting for MD own path + header links
Previously for a `file.md`, links to headers in that file that use paths, such as `[link](./file.md#some-header)` were validated using `markdown.experimental.validate.fragmentLinks.enabled`
This is confusing as that setting was only meant to be used for links such as`[link](#some-header`). It also resulted in the diagnostic having the incorrect range
This change instead makes these links be validated by `markdown.experimental.validate.fileLinks.markdownFragmentLinks`
* Fix compile
Switches simple patterns like:
```ts
if (some.thing) {
some.thing.method();
}
```
to:
```ts
some.thing?.method()
```
This is more concise and avoids having to repeat the `some.thing` part
transpile-only tasks for client and extensions
* extract transpile into its own file
* add transpile-client task, polish transpiler
* add transpile-extensions, improve transpile logic
* move declaration of "const enum" above it usage so that it can be used with const-enum-inlining
* (ugly) make d.ts transpilation configurable because it is needed for extensions but a problem for client
* hack my way around so that `getOwnEmitOutputFilePath` is reusable by our transpile
* honor `noEmit` flag
* Add support for SSH Uri
* Update extensions/git/src/protocolHandler.ts
Co-authored-by: João Moreno <joao.moreno@microsoft.com>
Co-authored-by: João Moreno <joao.moreno@microsoft.com>
Affects #139247
This PR changes Emmet to use inline completions when suggesting completions.
It also provides a boolean setting so that users can opt out.
This PR does not change the "Wrap with Abbreviation" behaviour in Emmet.
Co-authored-by: Henning Dieterichs <notify.henning.dieterichs@live.de>
Clairify markdown validate settings
Fixes#150949
- Rename headerLinks -> fragmentLinks
- Add new `fileLink.markdownFragmentsLinks` to validate the headers on fragment links (inherits the default setting value from `fragmentLinks`)
* Remove the notebookEditorDecorationType API proposal
Fixes#146838
* Remove all the infastructure around the now removed notebookEditorDecorationType api
- use merge editor for conflicts
- expose base resource in resource syncrhonziers
- add baseResourceScheme context to contribute Accept Merge button per feature
- support old way of handling conflicts behind an internal setting
* 🔨 Set ignoreFocusOut to true on PR template selection
Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
* 🔨 Translate PR template paths to relative in quick pick list
Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
* 💄 Shorten line length
Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
* ⚗️ Update tests with latest required args
Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
* ⚗️ Update GitHub extension unit tests
Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
Co-authored-by: João Moreno <joao.moreno@microsoft.com>
This updates the text editor drop proposal (#142990). This change introduces `DocumentDropEdit` which removes the need for `SnippetTextEdit`. This interface may also be extended in the future with additional metadata
* Iterate on paste edit provider api
For #30066
- Pass all selections to paste providers. For #151326
- Introduce `DocumentPasteEdit` as return type. This new type uses an `insertText` that is applied to every paste location (for multicursor), plus an optional additional edit
- Add `DocumentPasteProviderMetadata`. This lets extensions tell us which types of mimetypes they are interested in, letting us avoid round trips if no extensions care about the pasted data
* Correctly batch insertText
This change introduces a `ResoruceMap` map type that is essentially `Map<vscode.Uri, T>`
It also fixes a potential race condition with `MdWorkspaceCache` where two quick calls would both trigger init