From 920997d0c841f4f749a842b5fb24c4b09cc68cde Mon Sep 17 00:00:00 2001 From: HolonProduction Date: Sat, 5 Apr 2025 17:35:06 +0200 Subject: [PATCH] LSP: Fix relative path handling for document links --- .../gdscript/language_server/gdscript_extend_parser.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/gdscript/language_server/gdscript_extend_parser.cpp b/modules/gdscript/language_server/gdscript_extend_parser.cpp index 0c2c5912c4d..f8df46b256f 100644 --- a/modules/gdscript/language_server/gdscript_extend_parser.cpp +++ b/modules/gdscript/language_server/gdscript_extend_parser.cpp @@ -208,11 +208,11 @@ void ExtendGDScriptParser::update_document_links(const String &p_code) { const Variant &const_val = token.literal; if (const_val.get_type() == Variant::STRING) { String scr_path = const_val; - bool exists = fs->file_exists(scr_path); - if (!exists) { - scr_path = get_path().get_base_dir() + "/" + scr_path; - exists = fs->file_exists(scr_path); + if (scr_path.is_relative_path()) { + scr_path = get_path().get_base_dir().path_join(scr_path).simplify_path(); } + bool exists = fs->file_exists(scr_path); + if (exists) { String value = const_val; LSP::DocumentLink link;