AI Assistant UI refactor.

Fixes in debugger an autocomplete plugin (from some of the new changes in both cases).
Fix UITextView not updating the aligment after padding change.
This commit is contained in:
Martín Lucas Golini
2025-03-14 21:56:05 -03:00
parent c05dcd2c80
commit 9e6a29653f
11 changed files with 224 additions and 143 deletions

View File

@@ -58,7 +58,8 @@ fuzzyMatchSymbols( const std::vector<const AutoCompletePlugin::SymbolsList*>& sy
( score = String::fuzzyMatch( pattern, symbol.text ) ) >
std::numeric_limits<int>::min() ) {
if ( std::find( matches.begin(), matches.end(), symbol ) == matches.end() ) {
symbol.setScore( score );
symbol.setScore( score +
( symbol.kind != LSPCompletionItemKind::Text ? 100 : 0 ) );
matches.push_back( symbol );
if ( matches.size() > max )
@@ -71,11 +72,10 @@ fuzzyMatchSymbols( const std::vector<const AutoCompletePlugin::SymbolsList*>& sy
break;
}
std::sort( matches.begin(), matches.end(),
[]( const AutoCompletePlugin::Suggestion& left,
const AutoCompletePlugin::Suggestion& right ) {
return left.score > right.score && left.kind != LSPCompletionItemKind::Text;
} );
std::sort(
matches.begin(), matches.end(),
[]( const AutoCompletePlugin::Suggestion& left,
const AutoCompletePlugin::Suggestion& right ) { return left.score > right.score; } );
return matches;
}