From 1f4b2dd45fac2caf254d78fef5d9289656b2d34d Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 25 Jan 2026 02:07:25 +0100 Subject: [PATCH] Try to show some search results, if no space for full data. --- profiler/src/profiler/TracyLlmTools.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/profiler/src/profiler/TracyLlmTools.cpp b/profiler/src/profiler/TracyLlmTools.cpp index 314d62ed..23ffa60a 100644 --- a/profiler/src/profiler/TracyLlmTools.cpp +++ b/profiler/src/profiler/TracyLlmTools.cpp @@ -890,7 +890,14 @@ std::string TracyLlmTools::SourceSearch( std::string query, bool caseInsensitive if( total == 0 ) return "No matches found."; auto ret = json.dump( 2, ' ', false, nlohmann::json::error_handler_t::replace ); - if( ret.size() > CalcMaxSize() ) return "Too many matches found."; + if( json.size() > 1 && ret.size() > CalcMaxSize() ) + { + for( auto& item : json ) item.erase( "matches" ); + json["hint"] = "Too many matches found to show all data. Narrow down the search to get line numbers."; + + ret = json.dump( 2, ' ', false, nlohmann::json::error_handler_t::replace ); + if( ret.size() > CalcMaxSize() ) return "Too many matches found."; + } return ret; }