diff --git a/internal/ui/model/lsp.go b/internal/ui/model/lsp.go index 61e9f75d478ef51daee465ca7eeca109acd6c64b..5b0db8e91e21ccaffc517c234b2192451fa76a95 100644 --- a/internal/ui/model/lsp.go +++ b/internal/ui/model/lsp.go @@ -2,6 +2,7 @@ package model import ( "fmt" + "slices" "strings" "charm.land/lipgloss/v2" @@ -39,6 +40,11 @@ func (m *UI) lspInfo(width, maxItems int, isSection bool) string { lsps = append(lsps, LSPInfo{LSPClientInfo: state, Diagnostics: lspErrs}) } + + slices.SortFunc(lsps, func(a, b LSPInfo) int { + return strings.Compare(a.Name, b.Name) + }) + title := t.Subtle.Render("LSPs") if isSection { title = common.Section(t, title, width)