fonsp / Pluto.jl

🎈 Simple reactive notebooks for Julia
https://plutojl.org/
MIT License
4.91k stars 284 forks source link

CM6 incremental parsing for mixed modes #1893

Open fonsp opened 2 years ago

fonsp commented 2 years ago

My computer was really slow today, and CM6 became glitchy inside JS. I think that CM6 is not using the incremental parse system inside the submodes, only in Julia.

These videos were taken in a really big notebook (https://github.com/ClimateMARGO/interactive) with 6x CPU slowdown (chrome devtools), which is similar to how it felt before rebooting :)

JS

https://user-images.githubusercontent.com/6933510/152447878-6a60e1d3-b231-498f-9e9b-8f62fcc29cad.mov

Julia

https://user-images.githubusercontent.com/6933510/152447922-100f2d08-6232-4cc6-a0f9-d6b48b4b7f81.mov

ilyagr commented 3 months ago

I anyone is looking at this, there is a "secret" JS function to toggle this. If you run window.PLUTO_TOGGLE_CM_MIXED_PARSER() in the JS console, mixed modes will turn on and this will be remembered for future Pluto invocations.

A minor bug report: the mixed parser does not work for sql""" strings. To be more precise, the color of sql""" strings is different than that of normal strings, but there is no SQL syntax highlighting. This is strange, since judging by the code I read it should work.

(But on second look, that file was last changed 2 years ago, so it is not surprising the code got a little stale).