{"record":{"id":"46b4fc2ad491a50a","repo":"oraios/serena","slug":"language-server-for-lang-server-language-id-retu","errorCode":null,"errorMessage":"Language server for {lang_server.language_id} returned no rename edits for symbol '{name_path}'. The symbol might not support renaming.","messagePattern":"Language server for (.+?) returned no rename edits for symbol '(.+?)'\\. The symbol might not support renaming\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/serena/code_editor.py","lineNumber":403,"sourceCode":"        :param name_path: the name path of the symbol to rename\n        :param relative_path: the relative path of the file containing the symbol.\n        :param new_name: the new name\n        :return: a status message\n        \"\"\"\n        symbol = self._find_unique_symbol(name_path, relative_path)\n        if not symbol.location.has_position_in_file():\n            raise ValueError(f\"Symbol '{name_path}' does not have a valid position in file for renaming\")\n\n        # After has_position_in_file check, line and column are guaranteed to be non-None\n        assert symbol.location.line is not None\n        assert symbol.location.column is not None\n\n        lang_server = self._get_language_server(relative_path)\n        rename_result = lang_server.request_rename_symbol_edit(\n            relative_file_path=relative_path, line=symbol.location.line, column=symbol.location.column, new_name=new_name\n        )\n        if rename_result is None:\n            raise ValueError(\n                f\"Language server for {lang_server.language_id} returned no rename edits for symbol '{name_path}'. \"\n                f\"The symbol might not support renaming.\"\n            )\n        num_changes = self._apply_workspace_edit(rename_result)\n\n        if num_changes == 0:\n            raise ValueError(\n                f\"Renaming symbol '{name_path}' to '{new_name}' resulted in no changes being applied; renaming may not be supported.\"\n            )\n\n        msg = f\"Successfully renamed '{name_path}' to '{new_name}' ({num_changes} changes applied)\"\n        return msg\n\n\nclass JetBrainsCodeEditor(CodeEditor[JetBrainsSymbol]):\n    def __init__(self, project: Project) -> None:\n        self._project = project\n        super().__init__(project)","sourceCodeStart":385,"sourceCodeEnd":421,"githubUrl":"https://github.com/oraios/serena/blob/7fcbca7e62555ec2287ddb2f083caee805848ea6/src/serena/code_editor.py#L385-L421","documentation":"After requesting a rename from the language server (request_rename_symbol_edit), Serena expects a WorkspaceEdit back. A None result means the server refused or could not produce rename edits for that symbol, so ValueError is raised telling the caller the symbol may not support renaming.","triggerScenarios":"rename_symbol on a symbol the language server cannot rename: keywords, built-ins, dynamic/anonymous constructs, or a server that returns null for prepareRename/rename on that position.","commonSituations":"Renaming language keywords or import aliases the server treats as non-renamable; language server misconfigured or not fully indexed; symbol resolved via name_path maps to a non-declaration (e.g. a comment/string hit).","solutions":["Confirm the symbol is a renamable definition (class/function/variable), not a keyword or builtin","Retry after the language server finishes indexing the project","Test a rename in the IDE with the same server; if it also fails, the symbol is not renamable","Upgrade or reconfigure the language server for the file's language"],"exampleFix":"// before: renaming a keyword-ish symbol returns None -> error\n// after: pick the actual definition\neditor.rename_symbol(\"MyClass\", \"src/app.py\", \"RenamedClass\")  # definition symbol renames fine","handlingStrategy":"retry","validationCode":"if not is_concrete_definition_symbol(name_path, rel_path):\n    raise ValueError(\"Refusing to rename non-definition symbol\")","typeGuard":"def supports_rename(lang_server, rel_path, line, col) -> bool:\n    return lang_server.request_prepare_rename_edit(rel_path, line, col) is not None if hasattr(lang_server, 'request_prepare_rename_edit') else True","tryCatchPattern":"try:\n    editor.rename_symbol(name_path, rel_path, new_name)\nexcept ValueError as e:\n    if \"returned no rename edits\" in str(e):\n        wait_for_indexing(lang_server)\n        editor.rename_symbol(name_path, rel_path, new_name)  # one retry\n    else:\n        raise","preventionTips":["Let the language server finish indexing before renaming","Only rename concrete definitions (classes/functions/variables)","Confirm renamability in the IDE with the same server first"],"tags":["rename","lsp","unsupported-operation"],"backgroundTag":"rename-not-supported","analyzedSha":"7fcbca7e62555ec2287ddb2f083caee805848ea6","analyzedAt":"2026-08-29T00:04:09.619Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}