Skip to content

Add prepareRename support for Jedi renames - #738

Open
Boulea7 wants to merge 1 commit into
python-lsp:developfrom
Boulea7:feature/prepare-rename
Open

Boulea7 wants to merge 1 commit into
python-lsp:developfrom
Boulea7:feature/prepare-rename

Conversation

@Boulea7

@Boulea7 Boulea7 commented Nov 30, 2026

Copy link
Copy Markdown

Closes #695.

Eglot uses textDocument/prepareRename before prompting for a new name. The server previously returned JSON-RPC -32601. Jedi checks the current file and returns its range in UTF-16 columns. Ordinary rename uses the same coordinates. Older clients and third-party plugins that implement only rename keep their existing workflow.

Tested both requests over stdio, including identifiers after emoji, string literals, comments and punctuation. The related Python suites passed 63 tests with 5 skips. All four rename tests also passed on Python 3.9 with Jedi 0.17.2. Ruff lint and format checks passed. In a separate language-server run, test_missing_message hit the same teardown error on the baseline and this branch.

Prepared and tested with OpenAI Codex.

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.

Support "textDocument/prepareRename" appearantly missing

1 participant