1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-20 14:45:44 +00:00

CodeEdit: Use flag to recalculate characteristics

This commit is contained in:
HolonProduction
2025-10-13 16:17:19 +02:00
parent 4219ce91f2
commit f6ff2216ee
4 changed files with 9 additions and 5 deletions

View File

@@ -617,13 +617,13 @@ TypedArray<int> ScriptLanguage::CodeCompletionOption::get_option_characteristics
// Return characteristics of the match found by order of importance.
// Matches will be ranked by a lexicographical order on the vector returned by this function.
// The lower values indicate better matches and that they should go before in the order of appearance.
if (last_matches == matches) {
if (!matches_dirty) {
return charac;
}
charac.clear();
// Ensure base is not empty and at the same time that matches is not empty too.
if (p_base.length() == 0) {
last_matches = matches;
matches_dirty = false;
charac.push_back(location);
return charac;
}
@@ -642,7 +642,7 @@ TypedArray<int> ScriptLanguage::CodeCompletionOption::get_option_characteristics
charac.push_back(bad_case);
charac.push_back(location);
charac.push_back(matches[0].first);
last_matches = matches;
matches_dirty = false;
return charac;
}
@@ -652,7 +652,7 @@ void ScriptLanguage::CodeCompletionOption::clear_characteristics() {
TypedArray<int> ScriptLanguage::CodeCompletionOption::get_option_cached_characteristics() const {
// Only returns the cached value and warns if it was not updated since the last change of matches.
if (last_matches != matches) {
if (matches_dirty) {
WARN_PRINT("Characteristics are not up to date.");
}