dccsillag / magma-nvim

Interact with Jupyter from NeoVim.
GNU General Public License v3.0
988 stars 50 forks source link

[Bug] execution_count is missing #51

Closed tzachar closed 2 years ago

tzachar commented 2 years ago

Describe the bug

This is what I get on save:

Error detected while processing BufWritePre Autocommands for "*.jupyter":                                                        Error executing lua callback: /home/tzachar/.config/nvim/lua/au.lua:74: Vim(let):Error invoking '/home/tzachar/.local/share/nvim/site/pack/packer/start/magma-nvim/rplugin/python3/magma:command:MagmaSave' on channel 4 (python3-rplugin-host):                  error caught in request handler '/home/tzachar/.local/share/nvim/site/pack/packer/start/magma-nvim/rplugin/python3/magma:command:MagmaSave [[]]':                                                                                                                 Traceback (most recent call last):                                                                                                 File "/home/tzachar/.local/share/nvim/site/pack/packer/start/magma-nvim/rplugin/python3/magma/utils.py", line 14, in inner         func(self, *args, **kwargs)                                                                                                    File "/home/tzachar/.local/share/nvim/site/pack/packer/start/magma-nvim/rplugin/python3/magma/__init__.py", line 296, in command_save                                                                                                                               json.dump(save(magma), file)                                                                                                   File "/home/tzachar/.local/share/nvim/site/pack/packer/start/magma-nvim/rplugin/python3/magma/io.py", line 92, in save             "cells": [                                                                                                                     File "/home/tzachar/.local/share/nvim/site/pack/packer/start/magma-nvim/rplugin/python3/magma/io.py", line 98, in <listcomp>       "execution_count": output.execution_count,                                                                                   AttributeError: 'OutputBuffer' object has no attribute 'execution_count'                                                         stack traceback:                                                                                                                         [C]: in function 'cmd'               

To Reproduce Steps to reproduce the behavior: Start magma, execute a cell and try to save the buffer

Expected behavior no bug...

dccsillag commented 2 years ago

Ah, that's what I get for not having setup any form of static typing. Sorry for the inconvenience.

Fixed in 0ab5ef297bf98d69f03bb069533444c14cd53383; however, I noticed that the outputs don't seem to be brought in on :MagmaLoad, but it looks like that was already the case for a little while... nevertheless, I'm looking into it.