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 — rename issue · Issue #694 · python-lsp/python-lsp-server

rename issue #694

New issue
Copy link
New issue
Copy link
Open
Open
rename issue#694
Copy link

Description

@sancelot
sancelot
opened on Jan 12, 2026
Issue body actions

Hi,

using this request, i get an empty result []

file :

def hello():
    print('Hello World')

class MyClass:
    def method(self):
        pass

def to_be_deleted():
    return True

file_uri: file:///E:/WORKSPACE/devagents/tests/tests/mcp_refactor_data/refactor_target.py

position '{'line': 0, 'character': 0}'
"symbol_name": "hello",
"new_name": "greetings"

 result = await self._send_request("textDocument/rename", {
            "textDocument": {"uri": file_uri},
            "position": position,
            "newName": new_name
        })

logging stderr, I get this :
WARNING - pylsp.config.config - Failed to load hook pylsp_rename: There is no name under the cursor
2026-01-12 12:20:54,173 - main - INFO - LSP stderr: Traceback (most recent call last):
2026-01-12 12:20:54,173 - main - INFO - LSP stderr: File "E:\WORKSPACE\devagents.venv\Lib\site-packages\pylsp\config\config.py", line 40, in _hookexec
2026-01-12 12:20:54,173 - main - INFO - LSP stderr: return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
2026-01-12 12:20:54,173 - main - INFO - LSP stderr: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2026-01-12 12:20:54,173 - main - INFO - LSP stderr: File "E:\WORKSPACE\devagents.venv\Lib\site-packages\pluggy_manager.py", line 475, in traced_hookexec
2026-01-12 12:20:54,173 - main - INFO - LSP stderr: return outcome.get_result()
2026-01-12 12:20:54,173 - main - INFO - LSP stderr: ^^^^^^^^^^^^^^^^^^^^
2026-01-12 12:20:54,173 - main - INFO - LSP stderr: File "E:\WORKSPACE\devagents.venv\Lib\site-packages\pluggy_result.py", line 103, in get_result
2026-01-12 12:20:54,173 - main - INFO - LSP stderr: raise exc.with_traceback(tb)
2026-01-12 12:20:54,173 - main - INFO - LSP stderr: File "E:\WORKSPACE\devagents.venv\Lib\site-packages\pluggy_result.py", line 62, in from_call
2026-01-12 12:20:54,174 - main - INFO - LSP stderr: result = func()
2026-01-12 12:20:54,174 - main - INFO - LSP stderr: ^^^^^^
2026-01-12 12:20:54,174 - main - INFO - LSP stderr: File "E:\WORKSPACE\devagents.venv\Lib\site-packages\pluggy_manager.py", line 472, in
2026-01-12 12:20:54,174 - main - INFO - LSP stderr: lambda: oldcall(hook_name, hook_impls, caller_kwargs, firstresult)
2026-01-12 12:20:54,174 - main - INFO - LSP stderr: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2026-01-12 12:20:54,174 - main - INFO - LSP stderr: File "E:\WORKSPACE\devagents.venv\Lib\site-packages\pluggy_callers.py", line 167, in _multicall
2026-01-12 12:20:54,174 - main - INFO - LSP stderr: raise exception
2026-01-12 12:20:54,174 - main - INFO - LSP stderr: File "E:\WORKSPACE\devagents.venv\Lib\site-packages\pluggy_callers.py", line 121, in multicall
2026-01-12 12:20:54,174 - main - INFO - LSP stderr: res = hook_impl.function(*args)
2026-01-12 12:20:54,174 - main - INFO - LSP stderr: ^^^^^^^^^^^^^^^^^^^^^^^^^
2026-01-12 12:20:54,174 - main - INFO - LSP stderr: File "E:\WORKSPACE\devagents.venv\Lib\site-packages\pylsp\plugins\jedi_rename.py", line 19, in pylsp_rename
2026-01-12 12:20:54,174 - main - INFO - LSP stderr: refactoring = document.jedi_script().rename(**kwargs)
2026-01-12 12:20:54,174 - main - INFO - LSP stderr: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2026-01-12 12:20:54,174 - main - INFO - LSP stderr: File "E:\WORKSPACE\devagents.venv\Lib\site-packages\jedi\api_init
.py", line 592, in rename
2026-01-12 12:20:54,174 - main - INFO - LSP stderr: return refactoring.rename(self.inference_state, definitions, new_name)
2026-01-12 12:20:54,174 - main - INFO - LSP stderr: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2026-01-12 12:20:54,174 - main - INFO - LSP stderr: File "E:\WORKSPACE\devagents.venv\Lib\site-packages\jedi\api\refactoring_init
.py", line 152, in rename
2026-01-12 12:20:54,174 - main - INFO - LSP stderr: raise RefactoringError("There is no name under the cursor")
2026-01-12 12:20:54,174 - main - INFO - LSP stderr: jedi.api.exceptions.RefactoringError: There is no name under the cursor

Activity

  1. jakubbortlik commented on Mar 16, 2026

    @jakubbortlik
    jakubbortlik
    on Mar 16, 2026
    More actions

    To me it looks like the problem lies in position '{'line': 0, 'character': 0}' - shouldn't that be rather something like position '{'line': 0, 'character': 4}'? That would position the cursor on the first character of the symbol hello.

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.