Commit Graph

211 Commits

Author SHA1 Message Date
Matt Bierner
cfbebc3faf Fix bad merge 2018-02-26 16:52:30 -08:00
Matt Bierner
2279b4d252 Scroll sync markdown editor with markdown preview (#44454)
Fixes #19459

Syncs the markdown preview's viewport with the markdown editor's using the proposed visible ranges API
2018-02-26 16:46:54 -08:00
Matt Bierner
6b743d8c61 Prevent multiple markdown previews of the same type in the same editor group 2018-02-26 16:35:57 -08:00
Matt Bierner
b34585bc6d Make sure we dispose of markdown preview on webview dispose 2018-02-26 15:51:15 -08:00
Matt Bierner
4d95590a81 Use onDid* type event names in webview 2018-02-26 15:51:15 -08:00
Matt Bierner
6f5f757479 Use fspath for reveal line to fix drive letter case differences 2018-02-26 15:11:51 -08:00
Matt Bierner
26cbbea694 Add webview.show method to show a webview in a given group
Fixes #44430
2018-02-26 12:56:23 -08:00
Matt Bierner
205143c088 Move onDidChangeTextEditorSelection into Markdown preview 2018-02-26 12:56:23 -08:00
Matt Bierner
95b3bc9af4 Move onDidChangeTextDocument into MarkdownPreview 2018-02-26 12:56:23 -08:00
Matt Bierner
037747734f Hook up markdown preview onDispose 2018-02-26 12:56:23 -08:00
Matt Bierner
4f00d4c520 Make resource private in markdown preview 2018-02-26 12:56:22 -08:00
Matt Bierner
1d864d8419 Move webview creation into MarkdownPreview 2018-02-26 12:56:22 -08:00
Matt Bierner
e6105ab277 Add a way to 'pin' a markdown preview
Fixes #44429
2018-02-26 12:56:22 -08:00
Matt Bierner
5627c11660 Set markdown context based on scheme 2018-02-26 12:56:22 -08:00
Matt Bierner
2038b8fc7f Webview API prototype 3 (#44307)
* Webview API prototype 3

Part of #43713

Third try at refining the webview api. This pass reworks  #44165.  Major changes:

- Adds an `id` field to webviews. The id is provided by the extension and identifies the webview. It is used with the new event handling apis.

- Adds a new `onDidChangeActiveEditor` api. This is similar to `onDidChangeActiveTextEditor` but is also fired when you change webviews. It replaces the old `onFocus` and `onBlur` events on the webview itself

- Adds an `onDispose` event ot webviews. This is fired when a webview is closed by the user

- Perist webview state when the editor group changes. This is enabled for all webviews, not just those with keep alive.

* Throw error when trying to access disposed webview

* Improving webview documentation

* Clean up dispose management

* Throw if we receive a bad handle

* Move more event handling to input

* Simplify input updating

* Remove extra container property

* Fixing md security alert button

* Remove extra update container call

* Restore syncing of preview to active editor

* Fixing posting to webview

* Debounce preview updates

* Remove previewUri

* Enable direct window.postMessage instead of window.parent.postMessage

* Fixing scroll position not preserved when updating previews

* Revert parent.postMessage change.

Old behavior was correct

* Properly hide webview container on tab switch

* Make sure we only handle scroll events for the correct document

* Don't try setting negative scroll

* Revert vs code whitespace change
2018-02-26 10:06:50 -08:00
Matt Bierner
2d1f6d422b Add localResourceRoots to webview options
Fixes #44039

Add a new option that lets extensions override which root folders a webview can load local resources from. Defaults to allowing any resource in the workspace
2018-02-21 14:05:47 -08:00
Matt Bierner
3412eab2ec Webview Api Prototype (#42690)
* Webview api

* Cleaning up markdown webview

* Hooking up dispose

* Fix some merge errors

* Use custom context key to show markdown title bar contributions

* Add basic on focus and on blur events

* Fixing find widget in webview

* Hookup _isDisposed

* Use new extension resource scheme to load markdown extension resources

* Documenting keep alive
2018-02-14 18:52:26 -08:00
Matt Bierner
3b8696579f Make markdown show preview command multiselect aware
Fixes #42583
2018-02-09 15:16:10 -08:00
Matt Bierner
6e8d4d057b Moving openDocumentLinkCommand to own file
Move OnPreviewStyleLoadErrorCommand to own file

Move commands.ts into new commands directory

Moving show preview commands to own file

Add missing import for tests

Use export from to export commands

Extract tryRevealLine to own method

Extract tryOpen to method

Extract moveCursorToPosition to own file

Extract didClick command to own file

Move RevealLineCommand to own file

Move ShowPreviewSecuritySelectorCommand command to own file

Move refreshPreviewCommand to own file

Move show source command to own file
2018-02-07 16:08:54 -08:00
Matt Bierner
f66c6f9b3f Fixing a few TS 2.7 errors 2018-02-07 16:08:54 -08:00
Matt Bierner
e385fc3e3f Make data2String static 2018-02-07 16:08:54 -08:00
Matt Bierner
e8bc943db4 Adding more tests for toc provider 2018-02-07 16:08:54 -08:00
Matt Bierner
b93fa7bf4c Use find for toc lookup 2018-02-07 16:08:54 -08:00
Matt Bierner
01631fefe4 TOC lookup returns toc entry instead of line number 2018-02-07 16:08:54 -08:00
Matt Bierner
8f497e771c Mark all toc entries properties readonly 2018-02-07 16:08:54 -08:00
Matt Bierner
14b7051664 Adding basic test for markdown 2018-02-07 16:08:54 -08:00
Matt Bierner
5cf57a1b08 Small formatting fix 2018-02-07 16:08:54 -08:00
Matt Bierner
54c037cc65 Make slug a whole value 2018-02-07 16:08:54 -08:00
Matt Bierner
e459b96852 Don't use nan to signal undefined table of contents position 2018-02-07 16:08:54 -08:00
Matt Bierner
31a237f49c Use alwaysStrict in markdown extension 2018-02-07 16:08:54 -08:00
Matt Bierner
2ace8adce1 Mark property reaonly 2018-02-07 16:08:54 -08:00
Royall Spence
c8a22ccead Fix typo (#42364) 2018-01-30 11:27:14 -08:00
Dirk Baeumer
04594c864b Add support for Language Packs 2018-01-25 21:14:34 +01:00
Matt Bierner
20f2d6fe1b Extract markdown preview scheme to constant 2017-12-20 17:24:45 -08:00
Matt Bierner
2652b3f9b8 Support link with line number in md editor
Fixes #40140
2017-12-12 18:11:14 -08:00
Matt Bierner
4d42f3d7af Support extension-less links in the markdown preview
Fixes #39945
2017-12-12 17:04:29 -08:00
Matt Bierner
7656a3af59 Remove unused import 2017-12-07 12:49:20 -08:00
Matt Bierner
ebfd5dc480 Revert c585fc65b7
Fixes #39857
2017-12-07 12:47:57 -08:00
Matt Bierner
c585fc65b7 Fix markdown extension-less links in the markdown preview
Fixes #37400
2017-12-06 13:37:09 -08:00
Matt Bierner
9becd492fc 💄 2017-12-06 13:37:09 -08:00
Matt Bierner
6c4ed74ac4 Use id for markdown open document link command uir 2017-12-06 13:37:09 -08:00
Matt Bierner
565110a940 Move markdown providers into own directory 2017-12-04 15:25:55 -08:00
Matt Bierner
c3275b7ca1 Extract inner functions in loadMarkdownExtensions 2017-12-04 15:24:08 -08:00
Matt Bierner
826f5a82f8 Move markdown extensions logic to own file 2017-12-04 15:24:08 -08:00
Matt Bierner
6b533e7cae Move markdown TelemetryReporter to own class 2017-12-04 15:24:08 -08:00
Matt Bierner
4d1e77d8eb 💄 2017-12-04 15:24:07 -08:00
Matt Bierner
6b6b456257 Extract loadMarkdownExtensions 2017-12-04 15:24:07 -08:00
Matt Bierner
5e856d473b Finish moving commands over to own file 2017-12-04 15:24:07 -08:00
Matt Bierner
b31dc3a359 Continue moving over commands 2017-12-04 15:24:07 -08:00
Matt Bierner
3c5d21030d Extract show source command to commands 2017-12-04 15:24:07 -08:00