Improve how we keep expanded variables in debugger.

This commit is contained in:
Martín Lucas Golini
2025-01-18 20:09:38 -03:00
parent 9a72b484de
commit b0d6e6153d
10 changed files with 95 additions and 38 deletions

View File

@@ -1305,6 +1305,7 @@ void AutoCompletePlugin::resetSignatureHelp() {
}
AutoCompletePlugin::SymbolsList AutoCompletePlugin::getDocumentSymbols( TextDocument* doc ) {
static constexpr auto MAX_LINE_LENGTH = EE_1KB * 10;
LuaPattern pattern( mSymbolPattern );
AutoCompletePlugin::SymbolsList symbols;
if ( doc->linesCount() == 0 || doc->isHuge() || mShuttingDown )
@@ -1312,7 +1313,10 @@ AutoCompletePlugin::SymbolsList AutoCompletePlugin::getDocumentSymbols( TextDocu
std::string current( getPartialSymbol( doc ) );
TextPosition end = doc->getSelection().end();
for ( Int64 i = 0; i < static_cast<Int64>( doc->linesCount() ); i++ ) {
auto string = doc->line( i ).toUtf8();
const auto& line = doc->line( i );
if ( line.size() > MAX_LINE_LENGTH )
continue;
auto string = line.toUtf8();
for ( auto& match : pattern.gmatch( string ) ) {
std::string matchStr( match[0] );
// Ignore the symbol if is actually the current symbol being written