From a1fb9daae1b01ffaf05f8ab7c1e28aef6db64439 Mon Sep 17 00:00:00 2001 From: HolonProduction Date: Sun, 28 Dec 2025 19:11:29 +0100 Subject: [PATCH] LSP: Fix infinite recursion in symbol calculation --- .../gdscript/language_server/gdscript_language_protocol.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/gdscript/language_server/gdscript_language_protocol.cpp b/modules/gdscript/language_server/gdscript_language_protocol.cpp index fb3d35dd17e..7662252c620 100644 --- a/modules/gdscript/language_server/gdscript_language_protocol.cpp +++ b/modules/gdscript/language_server/gdscript_language_protocol.cpp @@ -389,12 +389,15 @@ ExtendGDScriptParser *GDScriptLanguageProtocol::LSPeer::parse_script(const Strin } ExtendGDScriptParser *parser = memnew(ExtendGDScriptParser); + parse_results[p_path] = parser; + parser->parse(content, p_path); if (document != nullptr) { - parse_results[p_path] = parser; GDScriptLanguageProtocol::get_singleton()->get_workspace()->publish_diagnostics(p_path); } else { + // Don't keep cached for further requests since we can't invalidate the cache properly. + parse_results.erase(p_path); stale_parsers[p_path] = parser; }