GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — neovim reacts badly to goto definitions on a namedtuple property · Issue #696 · python-lsp/python-lsp-server

neovim reacts badly to goto definitions on a namedtuple property #696

New issue
Copy link
New issue
Copy link
Open
#730
Open
neovim reacts badly to goto definitions on a namedtuple property#696
#730
Copy link

Description

@kaddkaka
kaddkaka
opened on Feb 6, 2026
Issue body actions

When my cursor is position marked below, calling vim.lsp.buf.definition() in Neovim will result in an error reply.

from collections import namedtuple

Access = namedtuple("Access", ["address", "type"])

a = Access(100, "w")
a.address
#   ^------ With the cursor here

Results in this Neovim error:

Error executing vim.schedule lua callback: ...nt_nvimhJLLgB/usr/share/nvim/runtime/lua/vim/lsp/buf.lua:226: Cursor position outside buffer
stack traceback:
        [C]: in function 'nvim_win_set_cursor'
        ...nt_nvimhJLLgB/usr/share/nvim/runtime/lua/vim/lsp/buf.lua:226: in function 'on_response'
        ...nt_nvimhJLLgB/usr/share/nvim/runtime/lua/vim/lsp/buf.lua:245: in function 'handler'
        ...nvimhJLLgB/usr/share/nvim/runtime/lua/vim/lsp/client.lua:682: in function ''
        vim/_editor.lua: in function <vim/_editor.lua:0>
Press ENTER or type command to continue

And after pressing opening a new buffer called /None with no content. (None is the null value in python)

Is this an issue in solely in Neovim or some bad interaction between Neovim and pylsp?

Environment:

  • python-lsp-server (pylsp) 1.14.0
  • python 3.13.7
  • nvim 0.11.5

I also posted similar comment with more Neovim details at neovim/neovim#30908

Activity

  1. kaddkaka commented on Feb 6, 2026

    @kaddkaka
    kaddkaka
    on Feb 6, 2026
    Author
    More actions

    On a similar setup but with different python version I got this traceback from inside pylsp:

    """
    WARNING - pylsp.config.config - Failed to load hook pylsp_definitions: unsupported operand type(s) for -: 'NoneType' and 'int'
    Traceback (most recent call last):
      File \"/home/david/.local/share/pipx/venvs/python-lsp-server/lib/python3.12/site-packages/pylsp/config/config.py\", line 40, in _hookexec
        return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File \"/nix/store/2zjymfkfbrxqz7cxj9pvrd3ci0s8rjgr-python3.10-pluggy-1.5.0/lib/python3.10/site-packages/pluggy/_manager.py\", line 480, in traced_hookexec
        return outcome.get_result()
               ^^^^^^^^^^^^^^^^^^^^
      File \"/nix/store/2zjymfkfbrxqz7cxj9pvrd3ci0s8rjgr-python3.10-pluggy-1.5.0/lib/python3.10/site-packages/pluggy/_result.py\", line 100, in get_result
        raise exc.with_traceback(exc.__traceback__)
      File \"/nix/store/2zjymfkfbrxqz7cxj9pvrd3ci0s8rjgr-python3.10-pluggy-1.5.0/lib/python3.10/site-packages/pluggy/_result.py\", line 62, in from_call
        result = func()
                 ^^^^^^
      File \"/nix/store/2zjymfkfbrxqz7cxj9pvrd3ci0s8rjgr-python3.10-pluggy-1.5.0/lib/python3.10/site-packages/pluggy/_manager.py\", line 477, in <lambda>
        lambda: oldcall(hook_name, hook_impls, caller_kwargs, firstresult)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File \"/nix/store/2zjymfkfbrxqz7cxj9pvrd3ci0s8rjgr-python3.10-pluggy-1.5.0/lib/python3.10/site-packages/pluggy/_callers.py\", line 139, in _multicall    raise exception.with_traceback(exception.__traceback__)
      File \"/nix/store/2zjymfkfbrxqz7cxj9pvrd3ci0s8rjgr-python3.10-pluggy-1.5.0/lib/python3.10/site-packages/pluggy/_callers.py\", line 103, in _multicall    res = hook_impl.function(*args)
              ^^^^^^^^^^^^^^^^^^^^^^^^^
      File \"/home/david/.local/share/pipx/venvs/python-lsp-server/lib/python3.12/site-packages/pylsp/plugins/definition.py\", line 69, in pylsp_definitions
        \"start\": {\"line\": d.line - 1, \"character\": d.column},
                          ~~~~~~~^~~
    TypeError: unsupported operand type(s) for -: 'NoneType' and 'int'
    """
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.