From e9cca73889ebe8af3021541575027da6ce1acc24 Mon Sep 17 00:00:00 2001 From: Roman Nikulenkov Date: Mon, 19 Jan 2026 14:06:58 +0300 Subject: [PATCH] Improve docstring for LanguageServerSymbolRetriever to clarify symbol processing criteria --- src/serena/symbol.py | 2 +- src/solidlsp/ls.py | 20 +++++++------------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/src/serena/symbol.py b/src/serena/symbol.py index 3c6d50e6..e0b08727 100644 --- a/src/serena/symbol.py +++ b/src/serena/symbol.py @@ -549,7 +549,7 @@ class LanguageServerSymbolRetriever: requests. If exceeded, remaining symbols get info=None (partial results). :param symbols: list of symbols to get info for - :return: a dict mapping each symbol to its info (or None if unavailable) + :return: a dict mapping each processable symbol to its info (or None if unavailable). Symbols with missing location attributes (relative_path/line/column is None) are skipped and omitted from the result. """ if not symbols: return {} diff --git a/src/solidlsp/ls.py b/src/solidlsp/ls.py index fe5de74a..0dd83264 100644 --- a/src/solidlsp/ls.py +++ b/src/solidlsp/ls.py @@ -1050,21 +1050,18 @@ class SolidLanguageServer(ABC): def get_cached_raw_document_symbols(cache_key: str, fd: LSPFileBuffer) -> list[SymbolInformation] | list[DocumentSymbol] | None: file_hash_and_result = self._raw_document_symbols_cache.get(cache_key) if file_hash_and_result is None: - log.debug("No cache hit for raw document symbols symbols in %s", relative_file_path) - if log.isEnabledFor(logging.DEBUG): - log.debug("perf: raw_document_symbols_cache MISS path=%s", relative_file_path) + log.debug("No cache hit for raw document symbols in %s", relative_file_path) + log.debug("perf: raw_document_symbols_cache MISS path=%s", relative_file_path) return None file_hash, result = file_hash_and_result if file_hash == fd.content_hash: log.debug("Returning cached raw document symbols for %s", relative_file_path) - if log.isEnabledFor(logging.DEBUG): - log.debug("perf: raw_document_symbols_cache HIT path=%s", relative_file_path) + log.debug("perf: raw_document_symbols_cache HIT path=%s", relative_file_path) return result log.debug("Document content for %s has changed (raw symbol cache is not up-to-date)", relative_file_path) - if log.isEnabledFor(logging.DEBUG): - log.debug("perf: raw_document_symbols_cache STALE path=%s", relative_file_path) + log.debug("perf: raw_document_symbols_cache STALE path=%s", relative_file_path) return None def get_raw_document_symbols(fd: LSPFileBuffer) -> list[SymbolInformation] | list[DocumentSymbol] | None: @@ -1111,19 +1108,16 @@ class SolidLanguageServer(ABC): file_hash_and_result = self._document_symbols_cache.get(cache_key) if file_hash_and_result is None: log.debug("No cache hit for document symbols in %s", relative_file_path) - if log.isEnabledFor(logging.DEBUG): - log.debug("perf: document_symbols_cache MISS path=%s", relative_file_path) + log.debug("perf: document_symbols_cache MISS path=%s", relative_file_path) else: file_hash, document_symbols = file_hash_and_result if file_hash == file_data.content_hash: log.debug("Returning cached document symbols for %s", relative_file_path) - if log.isEnabledFor(logging.DEBUG): - log.debug("perf: document_symbols_cache HIT path=%s", relative_file_path) + log.debug("perf: document_symbols_cache HIT path=%s", relative_file_path) return document_symbols log.debug("Cached document symbol content for %s has changed", relative_file_path) - if log.isEnabledFor(logging.DEBUG): - log.debug("perf: document_symbols_cache STALE path=%s", relative_file_path) + log.debug("perf: document_symbols_cache STALE path=%s", relative_file_path) # no cached result: request the root symbols from the language server root_symbols = self._request_document_symbols(relative_file_path, file_data)