Commit graph

196 commits

Author SHA1 Message Date
Don Jayamanne 46cd720f83
Drop uuid pkg used to to generate notebook cell id (#198647) 2023-11-20 06:12:55 +01:00
Don Jayamanne cb6c07d46d
Use JSON output object for json mimetype (#197871) 2023-11-10 01:13:42 +01:00
易良 f6790fc1a0
feat: Add the logo of the built-in extension (#192999)
* feat: Add the logo of the built-in extension

* chore(extension): add compressed icon

---------

Co-authored-by: Martin Aeschlimann <martinae@microsoft.com>
2023-10-05 10:40:24 -07:00
Don Jayamanne 9c17df54bd
Ensure orig_nbformat is not written to ipynb file (#192359) 2023-09-06 19:20:07 -07:00
Aaron Munger e2d858ecb0 changed command title and name 2023-08-30 09:32:45 -07:00
Aaron Munger 7ebfc44283 removed formatting changes 2023-08-18 11:04:43 -07:00
Aaron Munger bd60cc529c allow copying cell output images from context menu 2023-08-18 10:43:43 -07:00
Matt Bierner 8c7747252e
Move drop/paste ids onto providers (#189961)
For #179430, #30066

This lets us call just the provider we are interested in
2023-08-08 14:44:03 -07:00
Matt Bierner 39df243d21
priority -> yieldTo for drop/paste API proposals (#189881)
Move await from `priority` for drop/paste API proposals

For #179430, #30066

Switching to use `yieldTo` instead of `priority` to let an extension de-rank itself in the list of edits. `priority` was an arbitrary number while `yieldTo` gives more control over how the ranking takes place
2023-08-07 18:32:03 -07:00
Peng Lyu bce3304e98
Fix vscode-jupyter#13522. Clear attachment if it does not exit. (#186578)
Fix #184630. Clear attachment if it does not exit.
2023-06-29 09:41:01 +10:00
Aaron Munger c5d02335e1 json formatting 2023-06-20 15:02:32 -07:00
aamunger e8b63b2f59
undo package format changes 2023-06-20 09:39:10 -07:00
aamunger 76c8654a95
use the builtin extension activation, temp disable failing tests 2023-06-16 11:55:07 -07:00
aamunger 71a4ab0f49
delegate editorInput ownership to EditorService. Activate ipynb extension for IW 2023-06-16 11:55:05 -07:00
aamunger 2c37a5be5a
use same notebook serializer for IW 2023-06-16 11:52:40 -07:00
Matt Bierner 5a55352cf7
Combine esbuild scripts (#184531)
* Combine esbuild scripts

This combines the various build scripts used for building webview/notebook content. This should make it easier to update settings for them

As part of this, I also fixed the script so that on watch it restarts automatically on syntax errors instead of exiting

* Migrate other build script

* Fixing math build script
2023-06-09 14:55:05 -07:00
Michael Lively 34bde274c1
debt - remove field when no attachments present (#184630) 2023-06-09 00:18:46 +02:00
Matt Bierner bf7ca503c2
Fix drop priorities for notebooks (#182209)
For copy paste, I added logic to prefer using the text content if there's both `image/*` and `text/*` content in the clipboard

This however I also incorrectly applied this logic when dropping. In those cases, we instead want to prefer the image data (at least we do in the case of dragging and dropping from VS Code's explorer)
2023-05-11 13:03:28 -07:00
Matt Bierner 4d38422afe
Add priority to paste / drop apis (#182109)
* Add priority to paste / drop apis

Fixes #181886

Replacement for #181453

* Make notebooks prefer text over creating attachments
2023-05-10 14:18:05 -07:00
Matt Bierner ca51a4b04c
Add paste as command (#181959)
For #30066

This command shows a quick pick that lets you select how to paste content
2023-05-10 06:17:42 -07:00
Michael Lively 8867d20020
Remove ipynb.pasteAsAttachment setting to default to editor.pasteAs.enabled behavior (#181445)
* remove `ipynb.pasteAsAttachment` setting

* change default value to align with package.json

* Revert "remove `ipynb.pasteAsAttachment` setting"

This reverts commit 7471c030af.
2023-05-09 17:25:48 -07:00
Matt Bierner 83c12a2da2
Allow creating multiple files or attachments on paste (#181975) 2023-05-09 17:20:37 -07:00
Michael Lively f198ea9177
Check for attachment: in markdown cell renderer (#181462)
actually check if its json attachment style...
2023-05-03 16:51:22 -07:00
Matt Bierner 37577f6b29
Fix casing on label (#181338) 2023-05-02 17:37:42 +02:00
Don Jayamanne 90bf5a07e4
Check for cell when determining default cell lang (#181079) 2023-05-02 17:05:45 +02:00
Matt Bierner 11ca8d75a1
Add widget to change how content is pasted (#181290)
* Add widget to change how content is pasted

For #30066

This adds a widget that lets you change how content is pasted if there are multiple ways it could be pasted

To do this, I've made the post drop widget generic and reused it for pasting too

* Update types

* More code deduplication
2023-05-02 09:40:04 +02:00
Matt Bierner 2f07466dfc
Allow dropping images into notebook cells to create attachments (#180256)
* Allow dropping images into notebook to create attachments

Fixes #157577

This allows you to drag and drop image files or image data into a notebook cell to create an attachment

As part of this work, I also updated the paste attachment logic so that we can:

- Create multiple attachments in a single operation
- Create attachments of other mime types besides `image/png`
- Create attachments for images that have spaces in the filename

* Also allow pasting uri lists to create attachments

* Fix indent

* Add id
2023-04-19 09:39:04 -07:00
Michael Lively ff55375896
Add support for attachment cleaning on notebook save (#179178)
* support for `onWillSave` + debounce rework

* dispose of delayer + tabs not spaces...

* adjust for API naming change, rm proposal refs
2023-04-05 11:44:52 -07:00
Matt Bierner 6aada102db
Add localization comment (#176272)
Add localization message

Fixes #176140
2023-03-06 09:40:56 -08:00
Don Jayamanne bd77e72bbc
Ensure svg+xml output is split into lines (#175724) 2023-03-01 06:48:50 +01:00
Don Jayamanne 5efc2a498a
Localize ipynb extension commands (#172272)
* Localize ipynb extension commands

* More updates
2023-01-26 22:24:22 +01:00
Matt Bierner 116d314e60
Fix watch script exiting on error (#171552) 2023-01-17 14:53:24 -08:00
Aaron Munger 0294a28ca0
attachment field can be null (#170584) 2023-01-05 10:06:36 -08:00
Matt Bierner 57dd298b47
Add typings for test runner scripts (#169196) 2022-12-15 02:19:24 +01:00
aamunger 888fd835ca
don't clean attachments for a cell that is removed 2022-11-17 10:16:13 -08:00
Matt Bierner 1ccc8d438b
Enable pasting of image attachments by default for ipynb (#166058)
Fixes https://github.com/microsoft/vscode-jupyter/issues/11987
2022-11-10 16:46:31 -08:00
Rob Lourens 98f401e8b9
Fix .ipynb extension name capitalization (#164817)
Towards microsoft/vscode-jupyter#11773
2022-10-27 18:05:28 +02:00
Don Jayamanne 43957ccfe1
Compress streams in notebook outputs (#160946)
* Revert "Compress notebook output streams before rendering (#160667)"

This reverts commit 4230c22a08.

* Compress stream output items

* Minor perf improvements

* Misc

* Comments

* Added tests

* Merge issue

* More merge issues

* Misc

* Address code review comments
2022-10-11 14:43:46 -07:00
Joyce Er 7666d7acd4
Avoid * activating ipynb extension (#163325) 2022-10-11 10:53:07 -07:00
Matt Bierner feb3d2d205
Fix null ref in attachments check (#162396)
Fixes #162391

Also reduces use of `any`
2022-09-29 13:15:01 -07:00
Peng Lyu 6e8bc02be4
Cell attachment cleanup tool improvement in diff editor (#161132)
* Move attachment out of custom metadata, prep for attachment clean up in diff editor

* recover attachments from dirty notebook document

* Allow metadata to be restored when content changed/reverted in nb diff editor
2022-09-16 14:12:53 -07:00
Don Jayamanne 4230c22a08
Compress notebook output streams before rendering (#160667)
* Compress notebook output streams before rendering

* OOps

* Combine the buffers manually

* Address code review

* oops

* Fixes

* We can have multiple stream mimes in an output

* oops
2022-09-13 08:56:32 +10:00
Michael Lively 42238bdaab
notebook image cleaning automation (#159212)
* cache and cleaner complete, needs debounce

* minor renaming and reformatting

* bugfix for paste into new cell

* cleaning functionality complete

* refer to metadata as copy of current cell's

* check undef before reading from cache

* working state, pending cache restructure

* dots -> brackets

* pre-class refactor

* massive cleaner refactor

* cache typing, closed nb check, workspaceEdit only if metadata is changed

* undefined access fix

* proper debouncer

* get it up to work again

* no need to loop

* cell metadata uri parsing regression

* diagnostic

* Show diagnostics on document open

* transfer cache before file renames

* disable word wrap in notebook diff editor

* Avoid early notebook cell metadata deep clone

* No special case empty cell

* rename

* better naming

* Quick fix for invalid image attachment

* cleanup

* Add code action metadata

Co-authored-by: rebornix <penn.lv@gmail.com>
2022-09-09 11:32:10 -07:00
Michael Lively 834ad7365b small fix in logic 2022-08-31 15:41:15 -07:00
Matt Bierner 1895178d00
Finalize notebookWorkspaceEdit api (#159613)
Fixes #155245
2022-08-30 15:36:40 -07:00
Michael Lively 05ae151b7d return object, change placeholder 2022-08-25 15:33:50 -07:00
Michael Lively 16f842ea76 fix for attachment naming within notebook metadata 2022-08-25 15:04:56 -07:00
Michael Lively 6671589cdc fix setting description for #159091 2022-08-24 12:20:38 -07:00
Michael Lively 614c7dd5f4 fix conflict demo 2022-08-24 10:37:37 -07:00
Michael Lively 02cb45c3cb
demo merge conflict 2022-08-23 16:10:56 -07:00
Michael Lively ae1167bd94 refactor with updated metadata properties 2022-08-23 16:09:30 -07:00
Matt Bierner f00fde0f24
Mark that notebook metadata is readonly (#158960)
Mark that metadata is `readonly`

Fixes #158955

We freeze the object here 0656d21d11/src/vs/workbench/api/common/extHostNotebookDocument.ts (L70)
2022-08-23 14:52:00 -07:00
Matt Bierner b72671133b
Fix any types and extract method (#158967)
`currentCell` and `notebookUri` are currently any types, which hides type errors. To fix this and clean up the code, I've extracted a new `getCellFromCellDocument` method
2022-08-23 13:57:44 -07:00
Michael Lively 6f7189b7bb refactor metadata into own fxn 2022-08-18 11:58:44 -07:00
Michael Lively 880fda6ed9 fix pasting image into newly created cell bug 2022-08-17 12:17:39 -07:00
Michael Lively 38477bf5f5
change dir of cellAttachmentRenderer (#157671)
* change dir of cellAttachmentRenderer

* add new directories to `.vscodeignore`

* add the .js directories back in...

* hopefully now understanding `.vscodeignore`
2022-08-09 20:00:24 +02:00
Michael Lively 9225503c85
Support for pasting images into markdown notebook cells (#156847)
* dataflow support for updated metadata

* update cellAttachmentRenderer.ts to reflect metadata being a getter() inside MarkupCell

* document paste additions

* update condition to re-render cells, now includes metadata changes

* paste API working, debugging command added

* paste working with metadata. needs numbering, and cleaning upon delete

* paste screenshot works fully

* remove debugging command. Cleaning.

* notebook cells now re-render upon metadata changes

* changed name validity checking, remove unneeded function

* use _document for cell data, use snippet choice, dto fix

* return subscription, for loop, uri fix, alter metadata in-place, better snippet

* metadata fix, object.equals, fix cellAttRenderer metadata call

* added comment with source of encodeBase64

* gate mkdn image paste behind experimental setting
2022-08-08 13:57:49 -07:00
Matt Bierner 68912bd844
Use 'import type' for '@jupyterlab/nbformat' (#157153)
This is a type only dev dep so we should prevent referencing it as a value
2022-08-04 23:46:53 +02:00
Michael Lively 61e8687fa3
Notebook Cells re-render upon changes to metadata (#156917)
* dataflow support for updated metadata

* update cellAttachmentRenderer.ts to reflect metadata being a getter() inside MarkupCell

* update condition to re-render cells, now includes metadata changes

* notebook cells now re-render upon metadata changes

* fix missing metadata update

Co-authored-by: Peng Lyu <penn.lv@gmail.com>
2022-08-03 09:46:12 -07:00
Michael Lively 6fbee10cc1 more checking for undefined objects, fixed bug casuing markdown renderer to entirely crash 2022-07-28 11:53:51 -07:00
Matt Bierner 241c770203
Exclude esbuild files from build (#156362) 2022-07-27 09:32:07 -04:00
Michael Lively 53c3028c47 add notebook-out to .gitignore 2022-07-26 12:29:23 -07:00
Michael Lively 2077ae5120 fix package.json/esbuild.js for files in publish 2022-07-26 12:19:27 -07:00
Peng Lyu e6ad5f0a6f
Update ipynb yarn lock (#156004) 2022-07-22 23:26:14 +02:00
Michael Lively eaf321d50d formatting 2022-07-20 16:12:32 -07:00
Michael Lively 63142212a1 remove md-it dependency, added undefined check to attachments 2022-07-20 16:10:54 -07:00
Michael Lively ff31f6b577
Update package.json 2022-07-20 15:01:40 -07:00
Michael Lively 3a23dda32c
removed commented code 2022-07-20 13:47:26 -07:00
Michael Lively d7b6596808 yarn.lock with yarnpkg instead of npm 2022-07-20 12:35:42 -07:00
Michael Lively 6a73a0d22d rm package-lock.json 2022-07-20 12:25:57 -07:00
Michael Lively 1b59f566bb rendering of attachment images complete via tokens 2022-07-20 12:23:37 -07:00
Michael Lively 735ead82f5 added attachment and metadata support back in... rebasing is scary 2022-07-20 12:23:37 -07:00
Michael Lively 3981a5804c added build stuff 2022-07-20 12:23:37 -07:00
Michael Lively 0fa857c9a1 okay now things are actually fresh and working 2022-07-20 12:23:24 -07:00
Johannes 0656d21d11
auto-fixed prefer-const violation 2022-06-08 17:49:21 +02:00
Matt Bierner 45304da73d
Finalize NotebookEditor api proposal (#149767)
* Finalize NotebookEditor api proposal

Fixes #149271

This finalizes most parts of the NotebookEditor api proposal. I haven't removed the proposal entirely as there are still a few parts being left behind:

- The deprecated properties/functions
- A few contribution points such as `notebook/cell/executePrimary`

* remove extra quote
2022-05-23 23:27:17 +00:00
Matt Bierner ff975bc211
Update list of enabled APIs (#149838)
We use `notebookWorkspaceEdit` even though it's not enforced
2022-05-18 10:39:40 -07:00
Matt Bierner c9c5990e38
Adopt notebookWorkspaceEdit proposal internally (#149778)
This switches us to use the new `notebookWorkspaceEdit` proposal instead of `notebookEditorEdit`
2022-05-17 18:51:25 -07:00
Johannes 9530dca29d
finalize notebookDocumentEvents-API, https://github.com/microsoft/vscode/issues/144662 2022-04-20 13:58:37 +02:00
Johannes b1faab40de
adopt tests to new notebook change event 2022-03-29 11:58:54 +02:00
Joyce Er 31c338e5fa
Fix https://github.com/microsoft/vscode/issues/146022 2022-03-24 22:31:50 -07:00
rebornix 157cba093c
fix #140673. 2022-03-15 17:01:33 -07:00
aamunger 3b9868b099
include 'create notebook' in the command pallette 2022-03-09 13:39:16 -08:00
rebornix e632f91b35
fix #143966. 2022-03-02 16:55:55 -08:00
rebornix 998ee04a72
update nbformat typings 2022-03-01 12:59:58 -08:00
Peng Lyu 67cca9b62d
Merge pull request #143422 from microsoft/rebornix/nb-json-codelens
Add codelens to ipynb json file to open in notebook editor
2022-02-22 13:18:39 -08:00
rebornix 3567a2f2bc
Show codelens to ipynb json to open in notebook editor 2022-02-18 14:54:40 -08:00
Martin Aeschlimann db9e8fba63 remove unecessary files in build 2022-02-18 20:38:55 +01:00
rebornix 4b17d05668
re #142872. Contribute ipynb notebook to File -> New when no Jupyter extension enabled. 2022-02-16 11:42:45 -08:00
rebornix 8e3c41760e
re #142872. Default language to python. 2022-02-16 11:42:45 -08:00
rebornix cca25256a3
remvoe jupyter(json) 2022-02-15 17:45:09 -08:00
rebornix 7f99539fe7
re #142872. Ignore whitespace only content error. 2022-02-15 17:45:09 -08:00
Johannes Rieken 7ccb868835
make sure to use .eslintignore when running yarn eslint, this will ensure that cli failure and editor squiggles are always equal 2022-02-02 12:37:29 +01:00
Rob Lourens e9ca473f62 Change jupyter language name
to make it more clear that it is for raw JSON, not a notebook
2021-11-17 11:42:42 -08:00
Johannes Rieken 09c9d4c293
use enabledApiProposals instead of wildcard property, also update compilation units to only include d.ts-files that are needed, https://github.com/microsoft/vscode/issues/131165 2021-11-12 11:05:57 +01:00
Johannes Rieken a4d426a1c2
split vscode.proposed.d.ts into a file per proposal, https://github.com/microsoft/vscode/issues/131165 2021-11-12 09:48:17 +01:00
Johannes Rieken 68e819043c
use tsconfig.json#include for vscode.d.ts and vscode.proposed.d.ts, enables to remove most ref.d.ts-files 2021-11-09 15:53:35 +01:00
Johannes Rieken 9254a8cd27
move vscode.d.ts and vscode.proposed.d.ts into src/vscode-dts-folder, https://github.com/microsoft/vscode/issues/131165 2021-11-09 15:00:03 +01:00
Rob Lourens 3df135c388 Fix jupyter version number, #136544 2021-11-05 14:50:10 -07:00
Rob Lourens 29c5f2d394 Show an error when opening an old unsupported jupyter format
Fix #136544
2021-11-05 14:06:39 -07:00