Skip to content

Missing error handling on cell type typos #47

@bvolkmer

Description

@bvolkmer

It took me some time to find the issue, as there does not seem to be an error handling for unknown cell types.

For example:

# %% [markdwn]
print("Hello World")

Will lead to the following behavior:

The cell position sync works (which cell is selected) as well as running cells, but the content does not update in Jupyter. This is expected, as it does not know what to do with this kind of cell. But the errors are non-descriptive. The status, though, says everything is nominal, even though the connect command fails.

Error on any input in InsertMode:

Error executing vim.schedule lua callback: ...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:18: The coroutine failed with this message: vim/shared.lua:0: s: expected string, got nil
                                                                                                                                                                                                
stack traceback:                                                                                                                                                                                
        [C]: in function 'error'                                                                                                                                                                
        ...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:18: in function 'callback_or_next'                                                                                          
        ...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:45: in function <...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:44>   

:Neopyter connect

Error executing Lua callback: ...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:18: The coroutine failed with this message: ...kmer/.local/share/nvim/lazy/neopyter/plugin/neopyter.lu
a:10: attempt to concatenate local 'address' (a nil value)                                                                                                                                      
stack traceback:                                                                                                                                                                                
        [C]: in function 'error'                                                                                                                                                                
        ...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:18: in function 'callback_or_next'                                                                                          
        ...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:45: in function 'step'                                                                                                      
        ...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:48: in function 'execute'                                                                                                   
        ...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:108: in function 'run'                                                                                                      
        ...kmer/.local/share/nvim/lazy/neopyter/plugin/neopyter.lua:110: in function <...kmer/.local/share/nvim/lazy/neopyter/plugin/neopyter.lua:106>

:Neopyter status

==============================================================================
neopyter:                                                                   ✅

neopyter: config ~
- {
    auto_attach = true,
    auto_connect = true,
    file_pattern = { "*.ju.*" },
    filename_mapper = <function 1>,
    highlight = {
      enable = true,
      mode = "separator"
    },
    injection = {
      enable = true
    },
    jupyter = {
      auto_activate_file = true,
      partial_sync = false,
      scroll = {
        align = "center",
        enable = true
      }
    },
    mode = "direct",
    on_attach = <function 2>,
    parser = {
      python = {},
      r = {},
      trim_whitespace = true
    },
    remote_address = "127.0.0.1:9001",
    textobject = {
      enable = true,
      queries = { "cellseparator" }
    }
  }

neopyter: treesitter ~
- ✅ OK parser: python parser is installed
- ✅ OK parser: r parser is installed
- ✅ OK parser: markdown parser is installed

neopyter: version ~
- os platform of neovim: Linux
- neovim version: 0.11.6+v0.11.6
- neovim plugin(neopyter@0.3.2) status: active
- jupyter lab extension(neopyter@0.3.2): active

neopyter: status ~
- attach: tracking with neopyter
  connect: synchronizing with jupyter lab

- file                           attach     connect    remote_path
  * notebooks/Exploration.ju.py    true       true       notebooks/Exploration.ipynb

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions