Commit Graph

38 Commits

Author SHA1 Message Date
xingsy97
9c566819ae notebook: fix unused cell lookup and broken selection deduplication (#305105)
notebook: remove dead code, fix redundant output search, and fix broken selection dedup

Co-authored-by: Raymond Zhao <7199958+rzhao271@users.noreply.github.com>
2026-03-27 08:36:46 -07:00
Benjamin Pasero
45a35b8049 debt - fix some leaks found by copilot (#293731) 2026-02-09 06:13:06 +00:00
Dmitriy Vasyura
fbef8a93e9 Add eslint rule to prevent Map.has call immediately before Map.delete 2025-11-21 01:12:58 -08:00
Rob Lourens
b9480e9d7d Make type signature of groupBy more accurate (#272395)
See #272263, it currently assumes that all keys of K will be defined. This still isn't perfect, because it says that the returned object might contain a key with value `undefined`, but in reality, if a key is defined, it will have a value. So now usages of this with Object.entries and so on are slighly wrong, but that's preferable IMO.
2025-10-21 06:13:56 +02:00
Matt Bierner
245265d15e Mark most Event properties as readonly
We want to prevent mistaken changes that do something like this:

```ts
foo.onEvent = () => { ... };
```

When they almost always mean:

```ts
foo.onEvent(() => { ... })
```
2025-10-09 13:59:00 -07:00
Aiday Marlen Kyzy
474b70cbb7 Adopting variable fonts (#252308)
Allowing to define variable fonts in the editor
2025-06-30 13:15:48 +00:00
Peng Lyu
2bc9cedc4c Render edits suggestions on notebook overview ruler 2025-03-19 21:24:03 -07:00
Peng Lyu
f9565f0e11 💄 notebook cell decoration type 2025-03-19 17:43:18 -07:00
Aaron Munger
5f1771cb50 SR command to read last REPL execution (#233372)
* SR command to read last REPL execution

* use error details

* just use the values within the error

* test error collection

* combine output helpers

* auto read item executed in REPL

* switch order so universal hotkey is in a11y help

* combine adjacent stream outputs

* self-review
2024-11-08 14:34:33 -08:00
Don Jayamanne
287245b258 Ensure cells in a readonly notebook cannot be edited (#228309) 2024-09-30 15:03:45 -07:00
Aaron Munger
e34ecab75b easier to use show options, notebook repl editor helper (#228577)
* pass repl flag to exthost notebook, more API helpers

* fix parsing label

* pass through viewtype instead of isRepl flag
2024-09-15 17:16:30 -07:00
Benjamin Pasero
6b924c5152 ESM merge to main (#227184)
Co-authored-by: Johannes Rieken <jrieken@microsoft.com>
Co-authored-by: Alexandru Dima <alexdima@microsoft.com>
2024-08-30 10:31:46 +02:00
Michael Lively
9d41b1cefc Support Textual Selections in notebook find widget (#216840)
* support textual selections in notebook find widget

* add textual selection decorations

* union type

* fix passed ranges, clear find scope text range decs

* organize imports pass

* remove auto find explorations
2024-06-24 02:30:46 -07:00
Aaron Munger
608fe4f38c REPL/IW editor only using a notebook text model (#214356)
* registered editor with notebook model

* migrated some stuff from Interactive Editor

* display notebook and input box

* dont always filter kernels by view

* fix restore

* implement some commands

* working copy recovery/discarding

* fix tear down

* do not show last cell

* simplify notebookOptions creation

* reset text model on execute

* fix run button

* set tab name

* use differentiated notebooktype to determine kernel

* allow registering notebooks as other priorities

* conditionally register actions

* move registerAction back to top level

* fix input box message

* naming

* dont register extra repl commands for now

* use jupyter-notebook notebook type

* set scratchpad on backup recovery

* remove unused method
2024-06-14 15:12:29 -07:00
Michael Lively
49eedd7d51 Add Search in Cell Selection to Notebook Find Widget (#213409)
* all search scope functionality except cell decorations

* fix filter icon showing fake useage

* decorations + css tweaking + PR feedback
2024-05-27 22:25:23 -07:00
Matt Bierner
ae91138701 Add eslint rule for potentially unsafe disposable patterns (#209555)
`DisposableStore`/`MutableDisposable` properties should almost always be `readonly`. Otherwise it's easy to accidentally overwrite the property and leak the previous value. This commonly happens with code such as:

```ts
class Foo {
     private disposables = new DisposableStore();

     bar() {
         this.disposables = new DisposableStore(); // leaks old values
         ...
     }
```

This change adds an eslint rule to enforce this and adopts `readonly` for the caught cases. I only needed to add 2 suppression comments, which seems like an acceptable tradeoff for helping catch a common mistake
2024-04-04 10:34:45 -07:00
Michael Lively
88d1e2cbfd Support toolbar in notebook outline pane entries (#207498)
* relocate toggle action, fix toggle verbage, more generic section args

* support toolbar in outline pane entries

* unused imports slipped in with the merge

* css class name fix

* folding action support + css fix

* better typeguard fn
2024-03-14 18:29:29 +01:00
rebornix
3e097d925e Allow empty selections -> index. 2024-02-13 16:19:23 -08:00
Peng Lyu
ef1bd59897 fix #194090. fix cell decoration memory leak (#200786) 2023-12-13 23:03:20 +01:00
rebornix
ecd4f3806f On cell chat 2023-11-13 19:59:55 -08:00
rebornix
47111caea9 Re #190503. Dispose notebook land tests properly. 2023-09-07 12:59:17 -07:00
Rob Lourens
2baf8c51e9 Prevent multiple cell status bar items (#185621)
* Stop running Throttler after class is disposed
Fix microsoft/vscode-jupyter#13537

* Clean up item ID cache

* Add comment
2023-06-20 01:22:42 +02:00
Joyce Er
ba851f909e Add fast path for margin decoration access 2023-04-18 05:53:31 -07:00
Peng Lyu
76781a1a1b Enable markup search hybrid mode (#177542)
* Enable markup search hybrid mode

* Experiment turning all cells into editing mode on replace

* Prepare for minimal find markdown mode

* Add settings for controlling the initial state for find in markdown cells

* Validate initial state
2023-04-14 18:48:51 +01:00
Don Jayamanne
ab3354333d Support for arbitrary notebook kernel execution (#179258)
For https://github.com/microsoft/vscode-jupyter/issues/13275
* Support for arbitrary notebook kernel execution
2023-04-06 02:21:39 +02:00
Peng Lyu
93eaf7cf02 Avoid creating execution state listener for every cell. (#177025) 2023-03-14 02:09:05 +01:00
Peng Lyu
eb08f2aa24 Save cell in-mem line number state (#169063) 2022-12-13 23:57:53 +01:00
Peng Lyu
f730160c5d Notebook Find Match content/webview polish. (#166913)
* Notebook Find Match content/webview polish.

* 💄

* remove irrelevant file
2022-11-21 20:24:23 -08:00
Matt Bierner
dedd8bb62d Mark more fields in notebook types as readonly (#161428)
Ran into these while debugging through notebook code. Adding readonly makes it more clear the objects are not mutable

In one case, we were also reversing an array passed to an event. This is not safe as it reverses in place so all event listeners will now see the reversed array
2022-09-21 13:16:38 -07:00
aamunger
833cbca95b enabled core cell delete for IW and undo operations 2022-09-12 11:02:00 -07:00
Matt Bierner
107162c292 Move reviveWorkspaceEditDto2 (#157572)
Notebook workspace edits currently only work in cases we have explicitly enabled them for. They don't work in code actions or on drop/paste

The root cause is that currently the edits need to be converted before they are passed along to the workbench bulk edit service. This is currently done by `reviveWorkspaceEditDto2`

This change moves the conversion logic into the bulk edit service itself
2022-08-16 12:36:31 -04:00
Peng Lyu
56e21c4c22 manual treeshaking for notebook modules (#158029) 2022-08-12 14:56:13 -04:00
Johannes Rieken
f413297170 joh/plastic fowl (#154275)
* * derive workspace dto with util
* be strict when defining reference version ids (must be set to a value or undefined)

* relax `ResourceNotebookCellEdit`
2022-07-06 18:33:04 +02:00
Peng Lyu
40524ee383 Fix #142756. (#148725) 2022-05-04 11:35:02 -07:00
Rob Lourens
09d3d16f98 Fix "focus last cell" and test 2022-02-07 11:39:21 -08:00
Rob Lourens
663771335a "Focus Last Cell" should focus last visible cell
Fix #142250
2022-02-07 09:49:28 -08:00
Johannes Rieken
4a130c40ed enable @typescript-eslint/member-delimiter-style, https://github.com/microsoft/vscode/issues/140391 2022-02-02 14:35:33 +01:00
rebornix
6188148954 extract notebook view model interfaces 2022-01-24 12:49:33 -08:00