Ensure memory-efficient high-level document symbol cache #944

* Introduce SymbolBody representation (compact), from which the
    body can be reconstructed, rendering body computation lazy
  * Introduce SymbolBodyFactory for the creation of such instances,
    ensuring that instances created from the same factory share
    the same file content, allowing the in-memory and on-disk caches
    to have a significantly smaller memory footprint
  * Change type of "body" key in UnifiedSymbolRepresentation to use
    SymbolBody instead of str
  * Adjust all usages of the "body" key
This commit is contained in:
Dominik Jain authored and Dominik Jain committed 2026-01-22 01:39:59 +01:00
1 parent fe0cc7bb0c
commit c2e795fce4
13 files changed
+108 -56

No files matched your search

+2 -1
View File
@@ -212,7 +212,8 @@ class TestDartLanguageServer:
assert containing_symbol["name"] == "add"
assert containing_symbol["kind"] == SymbolKind.Method
if "body" in containing_symbol:
assert "add" in containing_symbol["body"] or "final result" in containing_symbol["body"]
body = containing_symbol["body"].get_text()
assert "add" in body or "final result" in body
@pytest.mark.parametrize("language_server", [Language.DART], indirect=True)
def test_request_containing_symbol_class(self, language_server: SolidLanguageServer) -> None: