From 3c77e362caddc956dc280038f4c3f9b8c6c569d9 Mon Sep 17 00:00:00 2001 From: Michael Panchenko Date: Fri, 3 Apr 2026 16:57:19 +0200 Subject: [PATCH] JB client: added version check to new methods, renamed move_symbol to move --- src/serena/jetbrains/jetbrains_plugin_client.py | 7 ++++++- src/serena/tools/jetbrains_tools.py | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/serena/jetbrains/jetbrains_plugin_client.py b/src/serena/jetbrains/jetbrains_plugin_client.py index f3ed6dc9..810618ba 100644 --- a/src/serena/jetbrains/jetbrains_plugin_client.py +++ b/src/serena/jetbrains/jetbrains_plugin_client.py @@ -425,13 +425,14 @@ class JetBrainsPluginClient(ToStringMixin): self._postprocess_symbol_collection_response(symbol_collection) return symbol_collection - def move_symbol( + def move( self, name_path: str | None, relative_path: str | None, target_parent_name_path: str | None, target_relative_path: str | None, ) -> dict[str, Any]: + self._require_version_at_least(2023, 2, 14) request_data = { "namePath": name_path, "relativePath": relative_path, @@ -527,6 +528,7 @@ class JetBrainsPluginClient(ToStringMixin): :param relative_path: the relative path to the file containing the symbol :param delete_even_if_used: if True, delete the symbol even if it has usages """ + self._require_version_at_least(2023, 2, 14) request_data = { "namePath": name_path, "relativePath": relative_path, @@ -548,6 +550,7 @@ class JetBrainsPluginClient(ToStringMixin): :param relative_path: the relative path to the file containing the method :param keep_definition: if True, keep the original method definition after inlining """ + self._require_version_at_least(2023, 2, 14) request_data = { "namePath": name_path, "relativePath": relative_path, @@ -599,6 +602,7 @@ class JetBrainsPluginClient(ToStringMixin): :param include_body: whether to include the symbol body :param include_quick_info: whether to include quick info about the symbol """ + self._require_version_at_least(2023, 2, 14) request_data = { "relativePath": relative_path, "line": line, @@ -618,6 +622,7 @@ class JetBrainsPluginClient(ToStringMixin): :param name_path: the name path of the symbol :param include_quick_info: whether to include quick info about the symbol """ + self._require_version_at_least(2023, 2, 14) request_data = { "relativePath": relative_path, "namePath": name_path, diff --git a/src/serena/tools/jetbrains_tools.py b/src/serena/tools/jetbrains_tools.py index 1c4ef63f..00ae3a51 100644 --- a/src/serena/tools/jetbrains_tools.py +++ b/src/serena/tools/jetbrains_tools.py @@ -146,7 +146,7 @@ class JetBrainsMoveTool(Tool, ToolMarkerSymbolicEdit, ToolMarkerOptional, ToolMa :param target_parent_name_path: the name path of the target parent symbol. """ with JetBrainsPluginClient.from_project(self.project) as client: - response_dict = client.move_symbol( + response_dict = client.move( name_path=name_path, relative_path=relative_path, target_parent_name_path=target_parent_name_path,