JetBrainsGetSymbolsOverviewTool: Allow to disable compact format for testing

This commit is contained in:
Dominik Jain authored and Dominik Jain committed 2026-01-12 19:36:23 +01:00
1 parent f24073c0c0
commit d7e4f7c689
1 file changed
+7 -2
+7 -2
View File
@@ -101,6 +101,8 @@ class JetBrainsGetSymbolsOverviewTool(Tool, ToolMarkerSymbolicRead, ToolMarkerOp
Retrieves an overview of the top-level symbols within a specified file using the JetBrains backend
"""
USE_COMPACT_FORMAT = True
@staticmethod
def _transform_symbols_to_compact_format(symbols: list[dict[str, Any]]) -> dict[str, list]:
"""
@@ -154,6 +156,9 @@ class JetBrainsGetSymbolsOverviewTool(Tool, ToolMarkerSymbolicRead, ToolMarkerOp
with JetBrainsPluginClient.from_project(self.project) as client:
response_dict = client.get_symbols_overview(relative_path=relative_path, depth=depth)
symbols = response_dict["symbols"]
compact_symbols = self._transform_symbols_to_compact_format(symbols)
result = self._to_json(compact_symbols)
if self.USE_COMPACT_FORMAT:
compact_symbols = self._transform_symbols_to_compact_format(symbols)
result = self._to_json(compact_symbols)
else:
result = self._to_json(symbols)
return self._limit_length(result, max_answer_chars)