Improve sorting of Code Completion options.

Done by ordering options by their location in the code - e.g. local, parent class, global, etc.
This commit is contained in:
Eric M 2022-03-09 00:03:36 +10:00
parent 74b07dd194
commit 4ab605d14d
7 changed files with 196 additions and 24 deletions

View file

@ -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);
}