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; }