1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

LSP: Fix relative path handling for document links

This commit is contained in:
HolonProduction
2025-04-05 17:35:06 +02:00
parent 4b36c0491e
commit 920997d0c8

View File

@@ -208,11 +208,11 @@ void ExtendGDScriptParser::update_document_links(const String &p_code) {
const Variant &const_val = token.literal; const Variant &const_val = token.literal;
if (const_val.get_type() == Variant::STRING) { if (const_val.get_type() == Variant::STRING) {
String scr_path = const_val; String scr_path = const_val;
bool exists = fs->file_exists(scr_path); if (scr_path.is_relative_path()) {
if (!exists) { scr_path = get_path().get_base_dir().path_join(scr_path).simplify_path();
scr_path = get_path().get_base_dir() + "/" + scr_path;
exists = fs->file_exists(scr_path);
} }
bool exists = fs->file_exists(scr_path);
if (exists) { if (exists) {
String value = const_val; String value = const_val;
LSP::DocumentLink link; LSP::DocumentLink link;