LSP: Fix class documentation to include brief
This commit is contained in:
parent
42c7f14422
commit
30672ffce7
3 changed files with 22 additions and 1 deletions
7
modules/gdscript/tests/scripts/lsp/doc_comments.gd
Normal file
7
modules/gdscript/tests/scripts/lsp/doc_comments.gd
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
## brief
|
||||
##
|
||||
## description
|
||||
##
|
||||
## @tutorial(t1): https://example.com/t2
|
||||
## @tutorial: https://example.com/t3
|
||||
extends Node
|
||||
|
|
@ -509,6 +509,20 @@ func f():
|
|||
}
|
||||
}
|
||||
|
||||
SUBCASE("Documentation is correctly set") {
|
||||
String path = "res://lsp/doc_comments.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.documentation.contains("brief"));
|
||||
REQUIRE(cls.documentation.contains("description"));
|
||||
REQUIRE(cls.documentation.contains("t1"));
|
||||
REQUIRE(cls.documentation.contains("t2"));
|
||||
REQUIRE(cls.documentation.contains("t3"));
|
||||
}
|
||||
|
||||
memdelete(proto);
|
||||
finish_language();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue