summaryrefslogtreecommitdiffstats
path: root/editor/plugins/script_text_editor.cpp
diff options
context:
space:
mode:
authorEric M <itsjusteza@gmail.com>2022-03-09 00:03:36 +1000
committerEric M <itsjusteza@gmail.com>2022-04-01 20:39:09 +1000
commit4ab605d14d0c18aeeded545e3cc453734df7abd7 (patch)
tree493e281c0dc21436b5c22a1071a086b66985aa2e /editor/plugins/script_text_editor.cpp
parent74b07dd19428ac6991d77aeb26ce0a66bfad4817 (diff)
downloadredot-engine-4ab605d14d0c18aeeded545e3cc453734df7abd7.tar.gz
Improve sorting of Code Completion options.
Done by ordering options by their location in the code - e.g. local, parent class, global, etc.
Diffstat (limited to 'editor/plugins/script_text_editor.cpp')
-rw-r--r--editor/plugins/script_text_editor.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp
index c1b0a32fc7..4626f10b8d 100644
--- a/editor/plugins/script_text_editor.cpp
+++ b/editor/plugins/script_text_editor.cpp
@@ -699,6 +699,9 @@ void ScriptTextEditor::_code_complete_script(const String &p_code, List<ScriptLa
}
String hint;
Error err = script->get_language()->complete_code(p_code, script->get_path(), base, r_options, r_force, hint);
+
+ r_options->sort_custom_inplace<CodeCompletionOptionCompare>();
+
if (err == OK) {
code_editor->get_text_editor()->set_code_hint(hint);
}