mirror of
https://github.com/tiennm99/serena.git
synced 2026-10-13 04:15:11 +00:00
fix: avoid unnecessary didOpen/didClose LSP calls for cached files in full symbol tree
request_full_symbol_tree was opening every file in the language server (sending didOpen + didClose notifications) even when document symbols were already cached. For a ~600 file Kotlin project, this caused 1198 unnecessary pipe writes to the LSP process, taking ~9 seconds. By passing open_in_ls=False, files are only read locally for cache validation. The LSP is only notified when a cache miss requires re-parsing. This reduces full-project symbol tree time from ~9.5s to ~0.5s (19x improvement) on cached runs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
d66152bc29
commit
7e72ef30bf
1 file changed
+1
-1
+1
-1
@@ -1406,7 +1406,7 @@ class SolidLanguageServer(ABC):
|
||||
child["parent"] = package_symbol
|
||||
|
||||
elif os.path.isfile(contained_dir_or_file_abs_path):
|
||||
with self._open_file_context(contained_dir_or_file_rel_path) as file_data:
|
||||
with self._open_file_context(contained_dir_or_file_rel_path, open_in_ls=False) as file_data:
|
||||
document_symbols = self.request_document_symbols(contained_dir_or_file_rel_path, file_data)
|
||||
file_root_nodes = document_symbols.root_symbols
|
||||
|
||||
|
||||
Reference in new issue
Block a user