mirror of
https://github.com/tiennm99/serena.git
synced 2026-10-13 10:16:00 +00:00
find_symbol: only pop symbol name if info is included
This commit is contained in:
1 parent
bc67337935
commit
e1d1dc907f
2 files changed
+4
-5
No files matched your search
@@ -617,10 +617,6 @@ class LanguageServerSymbolRetriever:
|
||||
file_hover_lookups = 0
|
||||
|
||||
for sym in file_symbols:
|
||||
line = sym.line
|
||||
column = sym.column
|
||||
assert line is not None and column is not None
|
||||
|
||||
# Check budget before starting new hover request
|
||||
if 0 < hover_budget_seconds <= hover_spent_seconds:
|
||||
skipped_due_to_budget += 1
|
||||
@@ -629,6 +625,9 @@ class LanguageServerSymbolRetriever:
|
||||
if skipped_due_to_budget == 1:
|
||||
log.debug("Skipping further hover operations due to budget exceeded")
|
||||
else:
|
||||
line = sym.line
|
||||
column = sym.column
|
||||
assert line is not None and column is not None # for mypy, we filtered invalid symbols above
|
||||
t0_hover = perf_counter()
|
||||
info = self._request_info(file_path, line, column)
|
||||
hover_spent_seconds += perf_counter() - t0_hover
|
||||
|
||||
@@ -191,7 +191,7 @@ class FindSymbolTool(Tool, ToolMarkerSymbolicRead):
|
||||
for s, s_dict in zip(symbols, symbol_dicts, strict=True):
|
||||
if symbol_info := info_by_symbol.get(s):
|
||||
s_dict["info"] = symbol_info
|
||||
s_dict.pop("name", None) # name is included in the info
|
||||
s_dict.pop("name", None) # name is included in the info
|
||||
result = self._to_json(symbol_dicts)
|
||||
return self._limit_length(result, max_answer_chars)
|
||||
|
||||
|
||||
Reference in new issue
Block a user