From 7e72ef30bffaecbea3d02fe913c3925d43d3a585 Mon Sep 17 00:00:00 2001 From: Marius Ailinca Date: Fri, 20 Feb 2026 14:20:34 +0200 Subject: [PATCH] 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 --- src/solidlsp/ls.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/solidlsp/ls.py b/src/solidlsp/ls.py index bce7863a..7e9cd500 100644 --- a/src/solidlsp/ls.py +++ b/src/solidlsp/ls.py @@ -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