Commit Graph

35 Commits

Author SHA1 Message Date
Matt Bierner d81d32b940 Re-render markdown preview when linkify setting changes (#200599) 2024-01-11 17:23:13 -08:00
Matt Bierner 19f9f605a9 Correctly reload markdown preview on md contribution change (#188218)
Fixes #184295
2023-07-19 01:47:31 +02:00
Matt Bierner 6aca75d9d0 Fix markdown preview classes (#187501)
For #187234

Got introduced through a bad PR change. Makes more sense to move this styling to the css file instead
2023-07-10 13:04:03 -07:00
Hans 48ff3ffb7c Fix #182013 (#184677)
* Fix #182013

* 💄

* 💄
2023-06-21 17:10:09 +00:00
MeghanKulkarni 67cc0965b3 allow images in markdown preview editor to be copied (#184432)
* allow images in markdown preview editor to be copied

* resolved feedback

* added findPreview method

* removed copy image command from showPreview

* clean up

---------

Co-authored-by: Meghan Kulkarni <t-mekulkarni@microsoft.com>
2023-06-07 18:08:22 +00:00
Matt Bierner 87a6bda310 Fix opening encoded markdown fragment in preview (#178465)
Fixes #178340
2023-03-28 08:59:30 +02:00
Matt Bierner 7800bd3492 Clamp line to > 0 (#176970)
Fixes #176924
2023-03-13 16:37:19 +01:00
Matt Bierner 3ca5284e44 Clean up markdown preview messaging (#176458)
- Add properties directly to message
- Add `ImageInfo` type
- Don't use state to pass around imageInfo
2023-03-07 17:28:13 -08:00
Matt Bierner 6a44101bb1 Type markdown preview webview message (#176444)
Simply types messages. Will clean up types in next pass
2023-03-07 14:23:17 -08:00
Ely Ronnen 59f6d52062 fix #174711 Show Source command in Markdown custom editor (#174712)
fix #174711
2023-02-20 16:01:36 +00:00
Matt Bierner ac88f33e2c Revert "Fix: New md file scrolls to Top. (#164999)" (#168224)
This reverts commit 54543cf5bf.
2022-12-06 22:50:30 +01:00
Debayan Ganguly 54543cf5bf Fix: New md file scrolls to Top. (#164999)
Fixes #164071.
2022-11-09 13:48:39 -08:00
Matt Bierner cd29f751eb Adopt l10n for markdown extension (#165448)
For #164438

Also makes our eslint rules understand `vscode.l10n.t(`
2022-11-04 09:49:49 +01:00
Matt Bierner 33867c55f3 Adopt prefix private with _ in markdown extension (#165088) 2022-10-31 14:22:39 -07:00
Matt Bierner 504c5a768a Avoid extra html write on first markdown preview update (#164201) 2022-10-20 19:40:19 -07:00
Matt Bierner bfb1a738d1 Fix markdown open preview opening duplicate preview (#162793)
This fixes the markdown 'open preview' command when used with `vscode.ViewColumn.Active` or `vscode.ViewColumn.Beside`
2022-10-06 09:50:10 +02:00
Matt Bierner b8a7485526 Fix markdown preview refresh from disk (#161800)
Fixes #149974
2022-09-26 09:49:53 -07:00
Matt Bierner f4bf1f30a2 Skip ul and ol when highlighting selected markdown element (#161139)
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
2022-09-19 07:16:06 +02:00
Matt Bierner 2d27f8db6a Use MD LS for resolving all document links (#160238)
* 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
2022-09-07 20:55:14 -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 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 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 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 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
Matt Bierner 1327d1eb50 Adopt ResourceMap in more places (#151475)
This changes switches to use the new `ResourceMap` type in more places in the markdown extension where we need to have a map/set with uris as the key
2022-06-08 08:34:06 +02:00
Matt Bierner 993c36c920 Fix markdown ext errors accessing disposed webview (#149960)
When reloading windows that need to restore a markdown preview, sometimes I'll see an error when the markdown preview tries accessing a disposed of webview. This seems to be cause caused by `provideTextDocumentContent`, where we end up disposing of the webview before an `await` resumes execution
2022-05-20 09:17:57 -07:00
Matt Bierner 590a9bf8a3 Make sure double click in md preview always reveals target line
Fixes #146333
2022-03-30 15:49:56 -07:00
Matt Bierner 4949f13d13 Organize imports 2022-03-29 13:25:40 -07:00
Matt Bierner 252515e59d 💄 2022-03-29 13:25:40 -07:00
Matt Bierner a2d9157a9a Extract markdown scrolling code to own file 2022-03-29 13:25:39 -07:00
Matt Bierner d49fc3ca8d Move files to better folders and add better name 2022-03-29 13:25:38 -07:00
Matt Bierner 7736c87cb0 Move markdown preview files to own folder 2022-03-29 13:25:35 -07:00