fix(ui): sort lsps

Carlos Alexandro Becker created

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

Change summary

internal/ui/model/lsp.go | 6 ++++++
1 file changed, 6 insertions(+)

Detailed changes

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)