From c4207dec75e470bdaea640cb70cf37171f8e6239 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Thu, 15 Jan 2026 21:38:12 +0100 Subject: [PATCH] Allow attaching source code to LLM in simple view. --- profiler/src/profiler/TracySourceView.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/profiler/src/profiler/TracySourceView.cpp b/profiler/src/profiler/TracySourceView.cpp index 404bf5f4..666b6706 100644 --- a/profiler/src/profiler/TracySourceView.cpp +++ b/profiler/src/profiler/TracySourceView.cpp @@ -1067,6 +1067,19 @@ void SourceView::Render( Worker& worker, View& view ) stream.write( m_source.data(), m_source.data_size() ); ImGui::SetClipboardText( stream.str().c_str() ); } + if( s_config.llm ) + { + ImGui::SameLine(); + if( ImGui::SmallButton( ICON_FA_ROBOT ) ) + { + nlohmann::json json = { + { "type", "source", }, + { "file", m_source.filename(), }, + { "code", std::string( m_source.data(), m_source.data_size() ) } + }; + view.AddLlmAttachment( json ); + } + } ImGui::PopFont(); ImGui::SameLine(); ImGui::Spacing();