@@ -98,7 +98,7 @@ pluto_server_options = Pluto.Configuration.from_flat_kwargs(;
9898 launch_browser = false ,
9999 # show_file_system=false,
100100 dismiss_update_notification = true ,
101- auto_reload_from_file = true ,
101+ auto_reload_from_file = false ,
102102 (Symbol (k) => v for (k, v) in JSON. parse (pluto_launch_params)). .. )
103103pluto_server_session = Pluto. ServerSession (;
104104 secret = secret,
@@ -113,9 +113,9 @@ extensionData = PlutoExtensionSessionData(
113113 joinpath (asset_output_dir, " jlfiles/" )
114114)
115115
116- function whenNotebookUpdates (jlfile , newString)
117- filename = splitpath (jlfile)[ end ]
118- sendCommand (filename , newString)
116+ function whenNotebookUpdates (path , newString)
117+ write (path, newString)
118+ sendCommand (path , newString)
119119end
120120
121121# ##
@@ -168,7 +168,7 @@ try ## Note: This is to assist with co-developing Pluto & this Extension
168168catch
169169end
170170
171- function registerOnFileSaveListener (notebook:: Pluto.notebook )
171+ function registerOnFileSaveListener (notebook:: Pluto.Notebook )
172172 function onfilechange (pe:: Pluto.PlutoEvent )
173173 if pe isa Pluto. FileSaveEvent
174174 whenNotebookUpdates (pe. path, pe. fileContent)
@@ -200,28 +200,15 @@ command_task = Pluto.@asynclog while true
200200 end
201201 frontend_params = get (detail, " frontend_params" , Dict ())
202202
203-
204- jlpath = joinpath (extensionData. jlfilesroot, detail[" jlfile" ])
205- extensionData. textRepresentations[detail[" jlfile" ]] = detail[" text" ]
206- open (jlpath, " w" ) do f
207- write (f, detail[" text" ])
208- end
203+ jlpath = detail[" fsPath" ] # joinpath(extensionData.jlfilesroot, detail["jlfile"])
209204 nb = Pluto. SessionActions. open (pluto_server_session, jlpath; notebook_id = UUID (detail[" notebook_id" ]))
210-
211205 registerOnFileSaveListener (nb)
212-
213206 filenbmap[detail[" jlfile" ]] = nb
214207 generate_output (nb, editor_html_filename, vscode_proxy_root, frontend_params)
215208
216209 elseif type == " update"
217210 nb = filenbmap[detail[" jlfile" ]]
218- jlpath = joinpath (extensionData. jlfilesroot, detail[" jlfile" ])
219- open (jlpath, " w" ) do f
220- write (f, detail[" text" ])
221- end
222211 Pluto. update_from_file (pluto_server_session, nb)
223- extensionData. textRepresentations[detail[" jlfile" ]] = detail[" text" ]
224-
225212 elseif type == " shutdown"
226213 nb = get (filenbmap, detail[" jlfile" ], nothing )
227214 ! isnothing (nb) && Pluto. SessionActions. shutdown (
0 commit comments