diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-06-20 00:39:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-20 00:39:18 +0200 |
commit | 60dcc4f39c0e6289dba691225c002cd6e77be6ba (patch) | |
tree | ad6b95863100430248ca159b2b6bf819f030782a | |
parent | 9b7c963d19cc0df53792d33b127f7a7356996030 (diff) | |
parent | ab49ea032cd682ce18a2ac8654e1474a37e42fe1 (diff) |
Merge pull request #49742 from Paulb23/remove_keywords_textedit
Remove redundant keywords from TextEdit
-rw-r--r-- | editor/plugins/script_text_editor.cpp | 42 | ||||
-rw-r--r-- | scene/gui/text_edit.cpp | 8 | ||||
-rw-r--r-- | scene/gui/text_edit.h | 3 |
3 files changed, 0 insertions, 53 deletions
diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index 012011ef4a..04d8c1d555 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -166,7 +166,6 @@ void ScriptTextEditor::enable_editor() { void ScriptTextEditor::_load_theme_settings() { CodeEdit *text_edit = code_editor->get_text_editor(); - text_edit->clear_keywords(); Color updated_marked_line_color = EDITOR_GET("text_editor/highlighting/mark_color"); Color updated_safe_line_number_color = EDITOR_GET("text_editor/highlighting/safe_line_number_color"); @@ -220,47 +219,6 @@ void ScriptTextEditor::_set_theme_for_script() { String end = comment.get_slice_count(" ") > 1 ? comment.get_slice(" ", 1) : String(); text_edit->add_comment_delimiter(beg, end, end == ""); } - - /* add keywords for auto completion */ - // singleton autoloads (as types, just as engine singletons are) - Map<StringName, ProjectSettings::AutoloadInfo> autoloads = ProjectSettings::get_singleton()->get_autoload_list(); - for (Map<StringName, ProjectSettings::AutoloadInfo>::Element *E = autoloads.front(); E; E = E->next()) { - const ProjectSettings::AutoloadInfo &info = E->value(); - if (info.is_singleton) { - text_edit->add_keyword(info.name); - } - } - - // engine types - List<StringName> types; - ClassDB::get_class_list(&types); - for (List<StringName>::Element *E = types.front(); E; E = E->next()) { - String n = E->get(); - if (n.begins_with("_")) { - n = n.substr(1, n.length()); - } - text_edit->add_keyword(n); - } - - // user types - List<StringName> global_classes; - ScriptServer::get_global_class_list(&global_classes); - for (List<StringName>::Element *E = global_classes.front(); E; E = E->next()) { - text_edit->add_keyword(E->get()); - } - - List<String> keywords; - script->get_language()->get_reserved_words(&keywords); - for (List<String>::Element *E = keywords.front(); E; E = E->next()) { - text_edit->add_keyword(E->get()); - } - - // core types - List<String> core_types; - script->get_language()->get_core_type_words(&core_types); - for (List<String>::Element *E = core_types.front(); E; E = E->next()) { - text_edit->add_keyword(E->get()); - } } void ScriptTextEditor::_show_errors_panel(bool p_show) { diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 6f78d586f1..369bc0fd26 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -4625,14 +4625,6 @@ Color TextEdit::get_line_background_color(int p_line) { return text.get_line_background_color(p_line); } -void TextEdit::add_keyword(const String &p_keyword) { - keywords.insert(p_keyword); -} - -void TextEdit::clear_keywords() { - keywords.clear(); -} - void TextEdit::set_auto_indent(bool p_auto_indent) { auto_indent = p_auto_indent; } diff --git a/scene/gui/text_edit.h b/scene/gui/text_edit.h index c04d758abb..00a3b8c531 100644 --- a/scene/gui/text_edit.h +++ b/scene/gui/text_edit.h @@ -744,9 +744,6 @@ public: void set_insert_mode(bool p_enabled); bool is_insert_mode() const; - void add_keyword(const String &p_keyword); - void clear_keywords(); - double get_v_scroll() const; void set_v_scroll(double p_scroll); |