mirror of
https://github.com/godotengine/godot.git
synced 2025-11-01 06:01:14 +00:00
Merge pull request #105081 from dalexeev/gds-add-export-tool-button-autocompletion
GDScript: Add autocompletion for `@export_tool_button`
This commit is contained in:
commit
3b963ab8b6
1 changed files with 15 additions and 0 deletions
|
|
@ -48,7 +48,9 @@
|
|||
#ifdef TOOLS_ENABLED
|
||||
#include "core/config/project_settings.h"
|
||||
#include "editor/editor_file_system.h"
|
||||
#include "editor/editor_node.h"
|
||||
#include "editor/editor_settings.h"
|
||||
#include "editor/editor_string_names.h"
|
||||
#endif
|
||||
|
||||
Vector<String> GDScriptLanguage::get_comment_delimiters() const {
|
||||
|
|
@ -945,6 +947,19 @@ static void _find_annotation_arguments(const GDScriptParser::AnnotationNode *p_a
|
|||
option.insert_text = option.display.quote(p_quote_style);
|
||||
r_result.insert(option.display, option);
|
||||
}
|
||||
} else if (p_annotation->name == SNAME("@export_tool_button")) {
|
||||
if (p_argument == 1) {
|
||||
const Ref<Theme> theme = EditorNode::get_singleton()->get_editor_theme();
|
||||
if (theme.is_valid()) {
|
||||
List<StringName> icon_list;
|
||||
theme->get_icon_list(EditorStringName(EditorIcons), &icon_list);
|
||||
for (const StringName &E : icon_list) {
|
||||
ScriptLanguage::CodeCompletionOption option(E, ScriptLanguage::CODE_COMPLETION_KIND_CLASS);
|
||||
option.insert_text = option.display.quote(p_quote_style);
|
||||
r_result.insert(option.display, option);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (p_annotation->name == SNAME("@export_custom")) {
|
||||
switch (p_argument) {
|
||||
case 0: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue