Commit Graph

241 Commits

Author SHA1 Message Date
Matt Bierner d41997790c Remove CustomDocument.viewType
Fixes #93867
For #77131

This property is no longer needed (or very helpful) with the current api design
2020-03-31 12:00:17 -07:00
Matt Bierner 579dab3196 Update custom editor api
For #77131

- Use a class for `CustomDocument` instead of an interface. Extensions can now add their own data to a `CustomDocument` by sublassing

- Renamed `resolveCustomDocument` to `openCustomDocument` and require that extensions return a `CustomDocument`

- Exposed edits on `CustomDocument`

- Made the third parameter of `registerCustomEditorProvider` a generic options bag that takes a `webviewOptions`
2020-03-23 13:10:49 -07:00
Huachao Mao 9abd38f362 Fix typo of word extension (#93178) 2020-03-23 12:32:32 -07:00
Matt Bierner 9dae408dc3 Switch webview api back to use delegate model
For #77131

Going back the the delegate based model for a few reasons:

- It gives us a better approach to add additional API hooks in the future (such as for rename)

- In practive, the capabilities were almost always the same as the `userData` on the document. It is rather confusing to have both `userData` and the capabilities 'on' the document
2020-03-12 16:54:48 -07:00
Benno 0b3e54edb1 update #91296 allow multiple workspace roots (#92082)
* update #91296 allow multiple workspace roots

* update #92082
2020-03-09 12:56:54 -07:00
Pine Wu 2362584a62 Revert "Fix #73803"
This reverts commit 67e6aef0c8.
2020-03-06 00:30:14 -08:00
Pine Wu 4857a9a746 Revert "Fix integration test"
This reverts commit 5a0ab960f0.
2020-03-06 00:29:57 -08:00
Pine Wu 5a0ab960f0 Fix integration test 2020-03-05 12:41:06 -08:00
Pine Wu 67e6aef0c8 Fix #73803 2020-03-05 11:34:58 -08:00
Matt Bierner 022b6c6d23 Use customtexteditor for markdown editor 2020-03-04 14:14:31 -08:00
Matt Bierner 6e30cf38a7 Mark markdown comment folding regions as comments
Fixes #91271
2020-03-02 11:26:29 -08:00
Matt Bierner 8291f8c152 Polishing of custom editor api proposal for 1.43 release
For #77131
2020-02-25 10:55:41 -08:00
Matt Bierner 99d5733e5f New iteration of webview editor API proposal
For #77131

**Motivation**
While our existing webview editor API proposal more or less works, building an editable webview editor is fairly tricky using it! This is especially true for simple text based editors.

It'd also be nice if we could get bi-directional live editing for text files. For example, if I open the same file in a webview editor and in VS Code's normal editor, edits on either side should be reflected in the other. While this can sort of be implemented using the existing API, it has some big limitations

**Overview of changes**
To address these problems, we've decided have two types of webview editors:

- Text based webview editors. These editors used a `TextDocument` as their data model, which considerably simplifies implementing an editable webview. In almost all cases, this should be what you use for text files

- Complex webview editors. This is basically the existing proposed API. This gives extension hooks into all the VS Code events, such as `save`, `undo`, and so on. These should be used for binary files or in very complex text editor cases.

Both editor types now have an explicit model layer based on documents. Text editor use `TextDocument` for this, while custom editors use `WebviewEditorCustomDocument`. This replaces the delegate based approach previously used.
2020-02-21 16:26:01 -08:00
Benjamin Pasero c2444b42af tests - proper text fixtures dir 2020-02-10 15:33:04 +01:00
Jonathan Carter 780d875d6f Remove scheme restriction for Markdown/Emmet language features (#87541)
* Remove scheme restriction for Markdown/Emmet

* Explicitly marking scheme support
2019-12-29 17:11:38 -07:00
Matt Bierner 8e475f9b24 Implement draft 2 from #86802 (#87117) 2019-12-16 14:18:58 -08:00
Matt Bierner 97855786a0 Fix absolute paths in markdown preview on windows
Fixes #84728

We should use `.fsPath` for both parts of the uri in this case.
2019-12-02 19:45:44 -08:00
Andrew Liu 37eeb3755a quick fix (#85506) 2019-11-25 11:30:04 -08:00
Matt Bierner 0e5a5f6524 Better time logging for js + markdown
We don't need full date, only times
2019-11-19 11:22:08 -08:00
Matt Bierner 5b428d2ec1 Don't use locale strings
For #84803

These can cause issues on node 12
2019-11-18 09:35:35 -08:00
Matt Bierner 40b8c9d073 Allow _ in markdown word definitions 2019-11-14 15:35:46 -08:00
Matt Bierner cbd414ba58 Don't force refresh the markdown preview's html when changing the active document 2019-11-08 17:00:56 -08:00
Matt Bierner 979e2b0387 Remove duplicate call to dispose 2019-11-08 16:56:06 -08:00
Matt Bierner 8236f06bfc Add experimental webview editor based markdown preview
Potentially for #54776, #2766
2019-11-08 10:38:51 -08:00
Matt Bierner 43a2ca8840 Remove forceUpdate property 2019-11-08 10:38:51 -08:00
Matt Bierner 1cdb534185 Try to redeuce duplication for create vs refactor 2019-11-08 10:38:51 -08:00
Matt Bierner 886ea7a8b4 💄 2019-11-08 10:38:51 -08:00
Matt Bierner aafc307dd8 Use set to store preview instead of array 2019-11-08 10:38:51 -08:00
Matt Bierner 884d52f1e7 Extract DynamicPreviewStore 2019-11-08 10:38:51 -08:00
Matt Bierner 7ee9aa4757 Rename and move types around to get ready for webview editor based previews 2019-11-08 10:38:51 -08:00
Alex Dima c9a2de2d9c Improve integration test output on Windows (#84239) 2019-11-08 17:21:35 +01:00
Matt Bierner 78559bf9e6 Normalize vscode links in markdown files to target current vscode version
Fixes #71622

This allows you to use generic `vscode` links inside the markdown preview and still have them work if the preview is viewed in insiders
2019-10-23 20:27:52 -07:00
Matt Bierner ecdba243ff Treat non-spacing marks as part of word in md files
Fixes #82386
2019-10-14 15:59:41 -07:00
Matt Bierner 21ba436c51 Fix one more case of #81320
The markdown link people write may be uri encoded. We need to decode these before trying to open them
2019-10-09 13:01:30 -07:00
Johannes Rieken 32b2861498 workaround - remove as const to make webpack happy... 2019-10-07 14:17:39 +02:00
Matt Bierner 8e944be15c Support jsonc for code block type with highlightjs 2019-10-04 17:57:33 -07:00
Matt Bierner 36aa903d5a Rewrite how we handle links in the md preview
Try to simplify how we resolve links:

- Move most logic out of the preview itself.
- Simplify the amount of rewriting we do in the markdown engine
2019-10-04 17:57:33 -07:00
Matt Bierner ef698fa6cd Make markdown refresh more stable
Fixes #80680

- Always sync the current preview line number with the editor, even when `scrollEditorWithPreview` is false

- If the md file is focused and refresh is called, do not try resetting the current line to match the editor file. This mainly effects the case where `scrollEditorWithPreview` is false
2019-10-03 13:46:31 -07:00
Konstantin Solomatov 316fd807fe remove docIndex in markdown language extension (#80933) 2019-09-16 10:50:20 -07:00
Johannes Rieken 9aab002dea push workaround for ts-loader weirdness 2019-09-12 09:59:31 +02:00
Matt Bierner 153e063486 Fix markdown preview refresh command potentially resetting preview scroll position to top if focused on preview
Fixes #80680
2019-09-11 20:50:52 -07:00
Konstantin Solomatov 5db460d2fe Fix activation of linters on unopened files caused by markdown plugin (#80506)
* Fix bug causing a large number of linters to be activated due to the markdown extension opening TextDocuments during indexing

* indentation problem

* code review by @OmarTawfik

* revert changed file

* Code review: use nodejs' Buffer

* fix ineffcient code
code review comments

* introduce SkinnyTextLine

* refactor redundant code

* revert changed files

* formatting

* remove empty line
2019-09-11 11:39:08 -07:00
Matt Bierner 2fe62e7dfe Use the document that contains the md link as the resource for getting config, not the target document 2019-09-10 16:31:53 -07:00
Matt Bierner 28c5988f47 Renaming setting names 2019-09-10 16:20:01 -07:00
Matt Bierner 728ee3aa73 Extract 2019-09-10 16:06:08 -07:00
Salvador Cabrera Lozano c307d73664 Fix for #26659. (#80227)
* Fix for #26659.

Clicking on a  local file link will open up the editor on a separate editor group (new or reuse existing one).

* Fix for #26659: Add way to open Markdown links in a different editor group

Adding "markdown.editor.openMarkdownLinks" setting to specify where
links to markdown files should open (current editor group by default).
2019-09-10 15:58:27 -07:00
Matt Bierner 7a00ddf9f8 Format files for 3.6
Fixes #80118
2019-09-02 21:29:05 -06:00
Matt Bierner a66e9d4835 Don't dispose markdown preview emitters before firing events
Fixes #79827
2019-08-26 13:40:07 -07:00
Matt Bierner 646d4ddb75 Use _register 2019-08-20 15:07:25 -07:00
Matt Bierner e44d9a2888 Rename parameter 2019-08-20 11:28:31 -07:00