-
Notifications
You must be signed in to change notification settings - Fork 414
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reload the notebook when the file changes on disk #2675
Comments
yes, big benefit of marimo being just python is that it easily integrates with other tooling and normal code editing environment. In addition to being nice to edit with a normal code editor, this also means that a notebook may sometimes be automatically edited by these other tools (eg when moving or changing a symbol name in an imported file). In these cases it seems especially important to pick up the changes, rather than just silently overwrite (which seems to be the default behavior today?) |
Related to #1511 |
FWIW #1511 is not fully related, that's file changes in general- not the working notebooks Reloading the notebook when file changes is not a great solution, as edit changes are decoupled from the backend- so there's the potential to have inconsistent state. The real solution is to build a plugin such that marimo frontend, backend, and editor are in sync. The VsCode Plugin does this already: https://github.com/marimo-team/vscode-marimo Something that directly follows the VsCode plugin could work. RelatedI wrote this proposal: marimo-team/meps#6 I just didn't want to do the work twice (make a vim plugin like the VSCode Plugin, get multiplayer working, and then change the plugin to work with that). Some progress on the proposal front has been made. The kiosk mode for instance, which would be great for an interim vim plugin. |
@dmadisetti you mention that the VSCode plugin does this. Can you explain a bit more how that works? I'd love to be able to just edit the .py file in VSCode and have a kiosk mode updated with the granular (cell-level) execution, but afaict that doesn't work today? this could be automatically on save, or the same way it works when re-running in the notebook interface where save and run are separate (ie cell outputs can be "dirty") |
@gabrielgrant That should work today? The VSCode plugin is very similar to the jupyter notebook experience Mind opening an issue in https://github.com/marimo-team/vscode-marimo/issues if the problem persists? |
I haven't been able to use the VScode plugin notebook experience (seem to be having the same issue as marimo-team/vscode-marimo#61 ), so what I was talking about was just editing the .py file directly. Are you saying that is expected to stay in sync with what I'm seeing in the browser? It doesn't seem to -- even after refreshing the notebook in the browser, new changes added to the .py file don't seem to appear |
Hmm, it may be that the plugin is currently broken. What is supposed to happen is very similar to the jupyter experience (none of the generated Just editing a file will not keep it in sync, only through the plugin interface that seems to currently have an issue. |
Description
Neovim is my editor. When I edit a marimo notebook file and save it in vim, I would like marimo to reload with my changes.
Note that I am not editing external modules, but the marimo notebook directly.
It's not necessary to auto-run cells. I'm happy to run them manually.
Note that I think listening to file changes on disk is better than a direct neovim integration, because listening to file changes would allow integration with other tools.
Related to #998, however only module reloading was implemented.
Suggested solution
Watch file changes to the notebook file on disk. When a change is detected update cells and mark which cells are outdated.
Alternative
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: