mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Merge pull request #62713 from YuriSizov/docs-scripting-annotations
This commit is contained in:
commit
635d447a69
19 changed files with 462 additions and 17 deletions
|
@ -445,6 +445,16 @@ void GDScriptLanguage::get_public_constants(List<Pair<String, Variant>> *p_const
|
|||
p_constants->push_back(nan);
|
||||
}
|
||||
|
||||
void GDScriptLanguage::get_public_annotations(List<MethodInfo> *p_annotations) const {
|
||||
GDScriptParser parser;
|
||||
List<MethodInfo> annotations;
|
||||
parser.get_annotation_list(&annotations);
|
||||
|
||||
for (const MethodInfo &E : annotations) {
|
||||
p_annotations->push_back(E);
|
||||
}
|
||||
}
|
||||
|
||||
String GDScriptLanguage::make_function(const String &p_class, const String &p_name, const PackedStringArray &p_args) const {
|
||||
#ifdef TOOLS_ENABLED
|
||||
bool th = EditorSettings::get_singleton()->get_setting("text_editor/completion/add_type_hints");
|
||||
|
@ -3380,6 +3390,15 @@ static Error _lookup_symbol_from_base(const GDScriptParser::DataType &p_base, co
|
|||
return OK;
|
||||
}
|
||||
} break;
|
||||
case GDScriptParser::COMPLETION_ANNOTATION: {
|
||||
const String annotation_symbol = "@" + p_symbol;
|
||||
if (parser.annotation_exists(annotation_symbol)) {
|
||||
r_result.type = ScriptLanguage::LOOKUP_RESULT_CLASS_ANNOTATION;
|
||||
r_result.class_name = "@GDScript";
|
||||
r_result.class_member = annotation_symbol;
|
||||
return OK;
|
||||
}
|
||||
} break;
|
||||
default: {
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue