feat: updated engine version to 4.4-rc1

This commit is contained in:
Sara 2025-02-23 14:38:14 +01:00
parent ee00efde1f
commit 21ba8e33af
5459 changed files with 1128836 additions and 198305 deletions

View file

@ -45,6 +45,7 @@
#include "core/os/os.h"
#include "editor/editor_help.h"
#include "editor/editor_node.h"
#include "modules/gdscript/gdscript_analyzer.h"
#include "modules/regex/regex.h"
@ -375,6 +376,18 @@ func f():
gd.to_lsp(lines);
}
SUBCASE("special case: zero column for root class") {
GodotPosition gd(1, 0);
lsp::Position expected = lsp_pos(0, 0);
lsp::Position actual = gd.to_lsp(lines);
CHECK_EQ(actual, expected);
}
SUBCASE("special case: zero line and column for root class") {
GodotPosition gd(0, 0);
lsp::Position expected = lsp_pos(0, 0);
lsp::Position actual = gd.to_lsp(lines);
CHECK_EQ(actual, expected);
}
SUBCASE("special case: negative line for root class") {
GodotPosition gd(-1, 0);
lsp::Position expected = lsp_pos(0, 0);
@ -468,6 +481,25 @@ func f():
test_resolve_symbols(uri, all_test_data, all_test_data);
}
memdelete(proto);
finish_language();
}
TEST_CASE("[workspace][document_symbol]") {
GDScriptLanguageProtocol *proto = initialize(root);
REQUIRE(proto);
SUBCASE("selectionRange of root class must be inside range") {
String path = "res://lsp/first_line_comment.gd";
assert_no_errors_in(path);
GDScriptLanguageProtocol::get_singleton()->get_workspace()->parse_local_script(path);
ExtendGDScriptParser *parser = GDScriptLanguageProtocol::get_singleton()->get_workspace()->parse_results[path];
REQUIRE(parser);
lsp::DocumentSymbol cls = parser->get_symbols();
REQUIRE(((cls.range.start.line == cls.selectionRange.start.line && cls.range.start.character <= cls.selectionRange.start.character) || (cls.range.start.line < cls.selectionRange.start.line)));
REQUIRE(((cls.range.end.line == cls.selectionRange.end.line && cls.range.end.character >= cls.selectionRange.end.character) || (cls.range.end.line > cls.selectionRange.end.line)));
}
memdelete(proto);
finish_language();
}