mirror of
https://github.com/godotengine/godot.git
synced 2026-02-13 19:05:21 +00:00
GDScript: Add warning if non-@tool class extends @tool class
This commit is contained in:
parent
6a13fdcae3
commit
3f52871f70
9 changed files with 55 additions and 0 deletions
|
|
@ -109,6 +109,8 @@ String GDScriptWarning::get_message() const {
|
|||
case STATIC_CALLED_ON_INSTANCE:
|
||||
CHECK_SYMBOLS(2);
|
||||
return vformat(R"*(The function "%s()" is a static function but was called from an instance. Instead, it should be directly called from the type: "%s.%s()".)*", symbols[0], symbols[1], symbols[0]);
|
||||
case MISSING_TOOL:
|
||||
return R"(The base class script has the "@tool" annotation, but this script does not have it.)";
|
||||
case REDUNDANT_STATIC_UNLOAD:
|
||||
return R"(The "@static_unload" annotation is redundant because the file does not have a class with static variables.)";
|
||||
case REDUNDANT_AWAIT:
|
||||
|
|
@ -219,6 +221,7 @@ String GDScriptWarning::get_name_from_code(Code p_code) {
|
|||
"UNSAFE_VOID_RETURN",
|
||||
"RETURN_VALUE_DISCARDED",
|
||||
"STATIC_CALLED_ON_INSTANCE",
|
||||
"MISSING_TOOL",
|
||||
"REDUNDANT_STATIC_UNLOAD",
|
||||
"REDUNDANT_AWAIT",
|
||||
"ASSERT_ALWAYS_TRUE",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue