Commit Graph

417 Commits

Author SHA1 Message Date
Matt Bierner
cfcc5c8121 Annotate param with jsdoc type 2018-02-26 17:46:25 -08:00
Matt Bierner
68c21cde76 Prevent out of range line acecss on markdown preview scrolling when user scrolls to end of document 2018-02-26 17:17:22 -08:00
Matt Bierner
6b85d3afdc Fix markdown show preview 2018-02-26 17:09:23 -08:00
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
Martin Aeschlimann
292a290e3f Rename built-in syntax and snippet extensions to "Language Basics". Fixes #44241 2018-02-26 21:27:22 +01: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
Ramya Achutha Rao
c1ee104fd4 Use latest version of telemetry module 2018-02-23 14:57:27 -08:00
Matt Bierner
ed8aa7702b Provide real name and description for markdown extension
#43978
2018-02-22 15:12:09 -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
e05609d5ec Fix markdown style load error 2018-02-21 11:57:01 -08:00
Ramya Achutha Rao
ad06c9c609 Update telemetry module 2018-02-17 17:27:09 -08:00
Matt Bierner
cc19497c49 Remove unnecessary toLowerCase 2018-02-16 17:26:13 -08:00
Matt Bierner
f5849bebec Fix markdown preview links back to workspace resource
Fixes #43869
2018-02-16 17:19:36 -08:00
Matt Bierner
e44ca4211c Add jscheck casts 2018-02-16 13:50:09 -08:00
Matt Bierner
f9765ffb9f Fix bad old command form being sent from markdown preview 2018-02-16 13:49:09 -08:00
Matt Bierner
7398d3be89 Clean up reveal line logic 2018-02-16 13:48:02 -08:00
Keisuke KATO
d17652218a Fixed an error when previewing the first line with Markdown extension (#43835) 2018-02-16 12:59:33 -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
Ramya Achutha Rao
994bfe6903 Update telemetry module to fix issue of missing version in events 2018-02-13 17:07:30 -08:00
Matt Bierner
4d12201733 Update markdown grammar 2018-02-12 18:08:22 -08:00
Matt Bierner
38cfb0438e Update markdown grammar 2018-02-12 18:08:22 -08:00
Martin Aeschlimann
8fdf170a08 update grammar script: remove unused properties 2018-02-12 16:54:46 +01:00
Matt Bierner
3b8696579f Make markdown show preview command multiselect aware
Fixes #42583
2018-02-09 15:16:10 -08:00
Matt Bierner
5394c43363 Revert commands title change 2018-02-09 15:09:36 -08:00
Joao Moreno
1e456712cb missing yarn.lock changes 2018-02-09 12:35:07 +01:00
Matt Bierner
8e88f8cf03 Update markdown grammar
Fixes #43150
2018-02-08 15:57:20 -08:00
Matt Bierner
9030f132e3 Use extracted markdown grammar
Fixes #43141
2018-02-08 12:59:25 -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