Skip to content

Commit 0f71982

Browse files
pankgeorgclaude
andcommitted
style: prettier formatting for controller, test notebook state
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent d1be612 commit 0f71982

2 files changed

Lines changed: 39 additions & 21 deletions

File tree

src/controller.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -964,8 +964,7 @@ export class PlutoNotebookController {
964964
// Pluto-side state (document revert after Pluto autosaved the file,
965965
// or our own replaceCells) — re-adding them would duplicate cells
966966
const presetId = addedCell.metadata?.pluto_cell_id as
967-
| string
968-
| undefined;
967+
string | undefined;
969968
if (presetId && worker.getState()?.cell_inputs?.[presetId]) {
970969
this.outputChannel.appendLine(
971970
`[VSCodeAdd] Cell ${presetId} already exists in Pluto — skipping echo`
@@ -1060,9 +1059,7 @@ export class PlutoNotebookController {
10601059
// a cell as removed while its identity survives in another cell —
10611060
// deleting it from Pluto would destroy a live cell
10621061
if (
1063-
notebook
1064-
.getCells()
1065-
.some((c) => c.metadata?.pluto_cell_id === cellId)
1062+
notebook.getCells().some((c) => c.metadata?.pluto_cell_id === cellId)
10661063
) {
10671064
this.outputChannel.appendLine(
10681065
`[VSCodeRemove] Cell ${cellId} still present in document — skipping delete`

test.pluto.jl

Lines changed: 37 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,48 @@
44
using Markdown
55
using InteractiveUtils
66

7-
# This Pluto notebook uses @bind for interactivity. When running this notebook outside of Pluto, the following 'mock version' of @bind gives bound variables a default value (instead of an error).
8-
macro bind(def, element)
9-
#! format: off
10-
return quote
11-
local iv = try Base.loaded_modules[Base.PkgId(Base.UUID("6e696c72-6542-2067-7265-42206c756150"), "AbstractPlutoDingetjes")].Bonds.initial_value catch; b -> missing; end
12-
local el = $(esc(element))
13-
global $(esc(def)) = Core.applicable(Base.get, el) ? Base.get(el) : iv(el)
14-
el
15-
end
16-
#! format: on
17-
end
18-
197
# ╔═╡ 024e9237-bd37-4b0f-8f0b-541539d3d3f5
208
using PlutoUI
219

22-
# ╔═╡ ab728b68-2a54-4e99-baed-0456f5df4d1b
23-
@bind x Slider(1:200)
24-
2510
# ╔═╡ 1fa401f5-8a22-4cb6-a4df-d52506e8155a
11+
for i in 1:10
12+
sleep(0.2)
13+
@info "A log reports" i=i
14+
end
2615

27-
1+x
16+
# ╔═╡ ab728b68-2a54-4e99-baed-0456f5df4d1b
17+
# ╠═╡ disabled = true
18+
#=╠═╡
19+
@bind x Slider(1:200)
20+
╠═╡ =#
2821

2922
# ╔═╡ d8f7f570-b4c9-4a0a-8b0f-3ad844626cff
3023
1+2
3124

3225
# ╔═╡ f37f8661-eef4-4454-a9fc-657b6edfa836
3326
7+4
3427

28+
# ╔═╡ 76c4fd26-fc7d-4c8d-b59f-6e2e435baed1
29+
9+4
30+
31+
# ╔═╡ 0d0572fe-8eaf-48e7-8569-a145f3fd0e93
32+
99
33+
34+
# ╔═╡ a12956bc-b34a-48bf-aefa-844835544a8f
35+
1234
36+
37+
# ╔═╡ b2f35bc0-eeb1-4e0a-bdc9-f0fdb61e1672
38+
x = 4
39+
40+
# ╔═╡ dc90a5d2-e77d-4b94-a54b-a91722775f42
41+
z, y, u = 1,2,3
42+
43+
# ╔═╡ 0094d2f2-9893-451d-b28e-2d24adbedc70
44+
u*y*z
45+
46+
# ╔═╡ f5d36126-c1dc-4421-a032-bd27edc5a5c0
47+
48+
3549
# ╔═╡ 00000000-0000-0000-0000-000000000001
3650
PLUTO_PROJECT_TOML_CONTENTS = """
3751
[deps]
@@ -276,5 +290,12 @@ version = "1.64.0+1"
276290
# ╠═ab728b68-2a54-4e99-baed-0456f5df4d1b
277291
# ╠═d8f7f570-b4c9-4a0a-8b0f-3ad844626cff
278292
# ╠═f37f8661-eef4-4454-a9fc-657b6edfa836
293+
# ╠═76c4fd26-fc7d-4c8d-b59f-6e2e435baed1
294+
# ╠═0d0572fe-8eaf-48e7-8569-a145f3fd0e93
295+
# ╠═a12956bc-b34a-48bf-aefa-844835544a8f
296+
# ╠═b2f35bc0-eeb1-4e0a-bdc9-f0fdb61e1672
297+
# ╠═dc90a5d2-e77d-4b94-a54b-a91722775f42
298+
# ╠═0094d2f2-9893-451d-b28e-2d24adbedc70
299+
# ╠═f5d36126-c1dc-4421-a032-bd27edc5a5c0
279300
# ╟─00000000-0000-0000-0000-000000000001
280301
# ╟─00000000-0000-0000-0000-000000000002

0 commit comments

Comments
 (0)