You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-12-03 16:55:53 +00:00
Replace Array return types with TypedArray
This commit is contained in:
@@ -66,12 +66,12 @@ String EditorSyntaxHighlighter::_get_name() const {
|
||||
return "Unnamed";
|
||||
}
|
||||
|
||||
Array EditorSyntaxHighlighter::_get_supported_languages() const {
|
||||
Array ret;
|
||||
PackedStringArray EditorSyntaxHighlighter::_get_supported_languages() const {
|
||||
PackedStringArray ret;
|
||||
if (GDVIRTUAL_CALL(_get_supported_languages, ret)) {
|
||||
return ret;
|
||||
}
|
||||
return Array();
|
||||
return PackedStringArray();
|
||||
}
|
||||
|
||||
Ref<EditorSyntaxHighlighter> EditorSyntaxHighlighter::_create() const {
|
||||
@@ -1732,7 +1732,7 @@ void ScriptEditor::get_breakpoints(List<String> *p_breakpoints) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Array bpoints = se->get_breakpoints();
|
||||
PackedInt32Array bpoints = se->get_breakpoints();
|
||||
for (int j = 0; j < bpoints.size(); j++) {
|
||||
p_breakpoints->push_back(base + ":" + itos((int)bpoints[j] + 1));
|
||||
}
|
||||
@@ -2380,8 +2380,8 @@ bool ScriptEditor::edit(const Ref<Resource> &p_resource, int p_line, int p_col,
|
||||
se->add_syntax_highlighter(highlighter);
|
||||
|
||||
if (script != nullptr && !highlighter_set) {
|
||||
Array languages = highlighter->_get_supported_languages();
|
||||
if (languages.find(script->get_language()->get_name()) > -1) {
|
||||
PackedStringArray languages = highlighter->_get_supported_languages();
|
||||
if (languages.has(script->get_language()->get_name())) {
|
||||
se->set_syntax_highlighter(highlighter);
|
||||
highlighter_set = true;
|
||||
}
|
||||
|
||||
@@ -59,11 +59,11 @@ protected:
|
||||
static void _bind_methods();
|
||||
|
||||
GDVIRTUAL0RC(String, _get_name)
|
||||
GDVIRTUAL0RC(Array, _get_supported_languages)
|
||||
GDVIRTUAL0RC(PackedStringArray, _get_supported_languages)
|
||||
|
||||
public:
|
||||
virtual String _get_name() const;
|
||||
virtual Array _get_supported_languages() const;
|
||||
virtual PackedStringArray _get_supported_languages() const;
|
||||
|
||||
void _set_edited_resource(const Ref<Resource> &p_res) { edited_resourse = p_res; }
|
||||
Ref<RefCounted> _get_edited_resource() { return edited_resourse; }
|
||||
@@ -156,7 +156,7 @@ public:
|
||||
virtual void ensure_focus() = 0;
|
||||
virtual void tag_saved_version() = 0;
|
||||
virtual void reload(bool p_soft) {}
|
||||
virtual Array get_breakpoints() = 0;
|
||||
virtual PackedInt32Array get_breakpoints() = 0;
|
||||
virtual void set_breakpoint(int p_line, bool p_enabled) = 0;
|
||||
virtual void clear_breakpoints() = 0;
|
||||
virtual void add_callback(const String &p_function, PackedStringArray p_args) = 0;
|
||||
|
||||
@@ -596,7 +596,7 @@ void ScriptTextEditor::_update_bookmark_list() {
|
||||
bookmarks_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/goto_next_bookmark"), BOOKMARK_GOTO_NEXT);
|
||||
bookmarks_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/goto_previous_bookmark"), BOOKMARK_GOTO_PREV);
|
||||
|
||||
Array bookmark_list = code_editor->get_text_editor()->get_bookmarked_lines();
|
||||
PackedInt32Array bookmark_list = code_editor->get_text_editor()->get_bookmarked_lines();
|
||||
if (bookmark_list.size() == 0) {
|
||||
return;
|
||||
}
|
||||
@@ -751,7 +751,7 @@ void ScriptTextEditor::_update_breakpoint_list() {
|
||||
breakpoints_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/goto_next_breakpoint"), DEBUG_GOTO_NEXT_BREAKPOINT);
|
||||
breakpoints_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/goto_previous_breakpoint"), DEBUG_GOTO_PREV_BREAKPOINT);
|
||||
|
||||
Array breakpoint_list = code_editor->get_text_editor()->get_breakpointed_lines();
|
||||
PackedInt32Array breakpoint_list = code_editor->get_text_editor()->get_breakpointed_lines();
|
||||
if (breakpoint_list.size() == 0) {
|
||||
return;
|
||||
}
|
||||
@@ -1264,7 +1264,7 @@ void ScriptTextEditor::_edit_option(int p_op) {
|
||||
EditorDebuggerNode::get_singleton()->set_breakpoint(script->get_path(), line + 1, dobreak);
|
||||
} break;
|
||||
case DEBUG_REMOVE_ALL_BREAKPOINTS: {
|
||||
Array bpoints = tx->get_breakpointed_lines();
|
||||
PackedInt32Array bpoints = tx->get_breakpointed_lines();
|
||||
|
||||
for (int i = 0; i < bpoints.size(); i++) {
|
||||
int line = bpoints[i];
|
||||
@@ -1274,7 +1274,7 @@ void ScriptTextEditor::_edit_option(int p_op) {
|
||||
}
|
||||
} break;
|
||||
case DEBUG_GOTO_NEXT_BREAKPOINT: {
|
||||
Array bpoints = tx->get_breakpointed_lines();
|
||||
PackedInt32Array bpoints = tx->get_breakpointed_lines();
|
||||
if (bpoints.size() <= 0) {
|
||||
return;
|
||||
}
|
||||
@@ -1300,7 +1300,7 @@ void ScriptTextEditor::_edit_option(int p_op) {
|
||||
|
||||
} break;
|
||||
case DEBUG_GOTO_PREV_BREAKPOINT: {
|
||||
Array bpoints = tx->get_breakpointed_lines();
|
||||
PackedInt32Array bpoints = tx->get_breakpointed_lines();
|
||||
if (bpoints.size() <= 0) {
|
||||
return;
|
||||
}
|
||||
@@ -1441,7 +1441,7 @@ void ScriptTextEditor::reload(bool p_soft) {
|
||||
scr->get_language()->reload_tool_script(scr, soft);
|
||||
}
|
||||
|
||||
Array ScriptTextEditor::get_breakpoints() {
|
||||
PackedInt32Array ScriptTextEditor::get_breakpoints() {
|
||||
return code_editor->get_text_editor()->get_breakpointed_lines();
|
||||
}
|
||||
|
||||
|
||||
@@ -229,7 +229,7 @@ public:
|
||||
virtual void clear_executing_line() override;
|
||||
|
||||
virtual void reload(bool p_soft) override;
|
||||
virtual Array get_breakpoints() override;
|
||||
virtual PackedInt32Array get_breakpoints() override;
|
||||
virtual void set_breakpoint(int p_line, bool p_enabled) override;
|
||||
virtual void clear_breakpoints() override;
|
||||
|
||||
|
||||
@@ -994,7 +994,7 @@ void ShaderEditor::_update_bookmark_list() {
|
||||
bookmarks_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/goto_next_bookmark"), BOOKMARK_GOTO_NEXT);
|
||||
bookmarks_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/goto_previous_bookmark"), BOOKMARK_GOTO_PREV);
|
||||
|
||||
Array bookmark_list = shader_editor->get_text_editor()->get_bookmarked_lines();
|
||||
PackedInt32Array bookmark_list = shader_editor->get_text_editor()->get_bookmarked_lines();
|
||||
if (bookmark_list.size() == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -128,8 +128,8 @@ Control *TextEditor::get_base_editor() const {
|
||||
return code_editor->get_text_editor();
|
||||
}
|
||||
|
||||
Array TextEditor::get_breakpoints() {
|
||||
return Array();
|
||||
PackedInt32Array TextEditor::get_breakpoints() {
|
||||
return PackedInt32Array();
|
||||
}
|
||||
|
||||
void TextEditor::reload_text() {
|
||||
@@ -165,7 +165,7 @@ void TextEditor::_update_bookmark_list() {
|
||||
bookmarks_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/goto_next_bookmark"), BOOKMARK_GOTO_NEXT);
|
||||
bookmarks_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/goto_previous_bookmark"), BOOKMARK_GOTO_PREV);
|
||||
|
||||
Array bookmark_list = code_editor->get_text_editor()->get_bookmarked_lines();
|
||||
PackedInt32Array bookmark_list = code_editor->get_text_editor()->get_bookmarked_lines();
|
||||
if (bookmark_list.size() == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ public:
|
||||
virtual Variant get_edit_state() override;
|
||||
virtual void set_edit_state(const Variant &p_state) override;
|
||||
virtual Vector<String> get_functions() override;
|
||||
virtual Array get_breakpoints() override;
|
||||
virtual PackedInt32Array get_breakpoints() override;
|
||||
virtual void set_breakpoint(int p_line, bool p_enabled) override{};
|
||||
virtual void clear_breakpoints() override{};
|
||||
virtual void goto_line(int p_line, bool p_with_error = false) override;
|
||||
|
||||
@@ -242,7 +242,7 @@ void VersionControlEditorPlugin::_view_file_diff() {
|
||||
}
|
||||
|
||||
void VersionControlEditorPlugin::_display_file_diff(String p_file_path) {
|
||||
Array diff_content = EditorVCSInterface::get_singleton()->get_file_diff(p_file_path);
|
||||
TypedArray<Dictionary> diff_content = EditorVCSInterface::get_singleton()->get_file_diff(p_file_path);
|
||||
|
||||
diff_file_name->set_text(p_file_path);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user