mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
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:
parent
fb10f45efe
commit
006e899bb3
11 changed files with 291 additions and 202 deletions
|
@ -955,7 +955,7 @@ void CodeTextEditor::_complete_request() {
|
|||
} else if (e.insert_text.begins_with("#") || e.insert_text.begins_with("//")) {
|
||||
font_color = completion_comment_color;
|
||||
}
|
||||
text_editor->add_code_completion_option((CodeEdit::CodeCompletionKind)e.kind, e.display, e.insert_text, font_color, _get_completion_icon(e), e.default_value);
|
||||
text_editor->add_code_completion_option((CodeEdit::CodeCompletionKind)e.kind, e.display, e.insert_text, font_color, _get_completion_icon(e), e.default_value, e.location);
|
||||
}
|
||||
text_editor->update_code_completion_options(forced);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue