From f05e4256918a19dd97b85c0b1d578dd033ff46e6 Mon Sep 17 00:00:00 2001 From: Dominik Jain Date: Tue, 13 Jan 2026 12:44:55 +0100 Subject: [PATCH] Improve logical clarity of inclusion logic, improve documentation of flags --- src/serena/tools/jetbrains_plugin_client.py | 12 +++++++----- src/serena/tools/jetbrains_tools.py | 13 +++++++++++-- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/serena/tools/jetbrains_plugin_client.py b/src/serena/tools/jetbrains_plugin_client.py index 76b4af7b..a2eef52d 100644 --- a/src/serena/tools/jetbrains_plugin_client.py +++ b/src/serena/tools/jetbrains_plugin_client.py @@ -260,11 +260,13 @@ class JetBrainsPluginClient(ToStringMixin): :param name_path: the name path to match :param relative_path: the relative path to which to restrict the search - :param include_body: whether to include symbol body content - :param include_quick_info: whether to include quick info - :param include_documentation: whether to include documentation - :param include_num_usages: whether to include number of usages - :param depth: depth of children to include (0 = no children) + :param include_body: whether to include symbol body content (should typically not be combined with `include_quick_info` + or `include_documentation` because the body includes everything) + :param include_quick_info: whether to include quick info (typically the signature) + :param include_documentation: whether to include documentation; note that this includes the quick info, so one should + not pass both `include_quick_info` and this + :param include_num_usages: whether to include the number of usages + :param depth: depth up to which to include children (0 = no children) :param include_location: whether to include symbol location information :param search_deps: whether to also search in dependencies """ diff --git a/src/serena/tools/jetbrains_tools.py b/src/serena/tools/jetbrains_tools.py index 0d8bd6ba..096cd1e2 100644 --- a/src/serena/tools/jetbrains_tools.py +++ b/src/serena/tools/jetbrains_tools.py @@ -62,8 +62,17 @@ class JetBrainsFindSymbolTool(Tool, ToolMarkerSymbolicRead, ToolMarkerOptional): if relative_path == ".": relative_path = None with JetBrainsPluginClient.from_project(self.project) as client: - include_documentation = include_info and not include_body - include_quick_info = not include_documentation and not include_info + if include_body: + include_quick_info = False + include_documentation = False + else: + if include_info: + include_documentation = True + include_quick_info = False + else: + # If no additional information is requested, we still include the quick info (type signature) + include_documentation = False + include_quick_info = True response_dict = client.find_symbol( name_path=name_path_pattern, relative_path=relative_path,