sort code completions with rules
Fixups Add levenshtein distance for comparisons, remove kind sort order, try to improve as many different use cases as possible Trying again to improve code completion Sort code autocompletion options by similarity based on input To make it really brief, uses a combination `String.similiary`, the category system introduced in a previous PR, and some filtering to yield more predictable results, instead of scattering every completion option at seemingly random. It also gives much higher priority to strings that contain the base in full, closer to the beginning or are perfect matches. Also moves CodeCompletionOptionCompare to code_edit.cpp Co-Authored-By: Micky <66727710+Mickeon@users.noreply.github.com> Co-Authored-By: Eric M <41730826+EricEzaM@users.noreply.github.com>
This commit is contained in:
@ -753,8 +753,6 @@ 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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user