From 7d00857e4c549ddc067a30c16e97e580bb3c0d50 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Mon, 9 Feb 2026 15:37:50 -0300 Subject: [PATCH] perf: track and start lsp on command (#2176) Signed-off-by: Carlos Alexandro Becker --- internal/ui/model/ui.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/internal/ui/model/ui.go b/internal/ui/model/ui.go index 77dfc9a726f466fafaacede483438629e293ae2f..d4f2d4f7309d7f1f4e68546b96c49009bf6f8624 100644 --- a/internal/ui/model/ui.go +++ b/internal/ui/model/ui.go @@ -2723,10 +2723,13 @@ func (m *UI) sendMessage(content string, attachments ...message.Attachment) tea. } ctx := context.Background() - for _, path := range m.sessionFileReads { - m.com.App.FileTracker.RecordRead(ctx, m.session.ID, path) - m.com.App.LSPManager.Start(ctx, path) - } + cmds = append(cmds, func() tea.Msg { + for _, path := range m.sessionFileReads { + m.com.App.FileTracker.RecordRead(ctx, m.session.ID, path) + m.com.App.LSPManager.Start(ctx, path) + } + return nil + }) // Capture session ID to avoid race with main goroutine updating m.session. sessionID := m.session.ID