Skip to content

Skip definitions without a source path - #730

Open
SAY-5 wants to merge 1 commit into
python-lsp:developfrom
SAY-5:codex/fix-pathless-definitions-20261005
Open

SAY-5 wants to merge 1 commit into
python-lsp:developfrom
SAY-5:codex/fix-pathless-definitions-20261005

Conversation

@SAY-5

@SAY-5 SAY-5 commented Oct 5, 2026

Copy link
Copy Markdown

Go to definition on a collections.namedtuple field can return file:///None: Jedi supplies a generated definition with a line and column but no source path. Skip those definitions before building LSP locations. The existing position checks remain in place, and navigable source and builtin definitions retain their behavior.

Fixes #696.

Validation on Python 3.13 / Jedi 0.20.0: the real Document/Jedi regression fails before the fix with file:///None; three controls pass. After the fix, all 15 definition and type-definition tests pass, including both follow_builtin_definitions settings and source-backed locations. Ruff 0.9.4 lint and formatting pass for all 70 files in pylsp and test. The full platform/plugin suite was not run locally.

OpenAI Codex assisted with the code, regression tests, and this description. The final patch received an independent AI review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

neovim reacts badly to goto definitions on a namedtuple property

1 participant