From 65544d57d434b02db88b9a304e61eaeea96ad5ad Mon Sep 17 00:00:00 2001 From: MischaPanch Date: Sat, 9 Aug 2025 16:13:43 +0200 Subject: [PATCH] Make restart_language_server optional --- README.md | 2 +- src/serena/tools/symbol_tools.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c30b40c9..145d5498 100644 --- a/README.md +++ b/README.md @@ -792,7 +792,6 @@ Here is the list of Serena's default tools with a short description (output of ` * `read_memory`: Reads the memory with the given name from Serena's project-specific memory store. * `replace_regex`: Replaces content in a file by using regular expressions. * `replace_symbol_body`: Replaces the full definition of a symbol. -* `restart_language_server`: Restarts the language server, may be necessary when edits not through Serena happen. * `search_for_pattern`: Performs a search for a pattern in the project. * `think_about_collected_information`: Thinking tool for pondering the completeness of collected information. * `think_about_task_adherence`: Thinking tool for determining whether the agent is still on track with the current task. @@ -815,5 +814,6 @@ The full list of optional tools is (output of `uv run serena tools list --only-o * `jet_brains_get_symbols_overview`: Retrieves an overview of the top-level symbols within a specified file * `remove_project`: Removes a project from the Serena configuration. * `replace_lines`: Replaces a range of lines within a file with new content. +* `restart_language_server`: Restarts the language server, may be necessary when edits not through Serena happen. * `summarize_changes`: Provides instructions for summarizing the changes made to the codebase. * `switch_modes`: Activates modes by providing a list of their names diff --git a/src/serena/tools/symbol_tools.py b/src/serena/tools/symbol_tools.py index 2a72c973..199db67b 100644 --- a/src/serena/tools/symbol_tools.py +++ b/src/serena/tools/symbol_tools.py @@ -16,6 +16,7 @@ from serena.tools import ( ToolMarkerSymbolicEdit, ToolMarkerSymbolicRead, ) +from serena.tools.tools_base import ToolMarkerOptional from solidlsp.ls_types import SymbolKind @@ -35,7 +36,7 @@ def _sanitize_symbol_dict(symbol_dict: dict[str, Any]) -> dict[str, Any]: return symbol_dict -class RestartLanguageServerTool(Tool): +class RestartLanguageServerTool(Tool, ToolMarkerOptional): """Restarts the language server, may be necessary when edits not through Serena happen.""" def apply(self) -> str: