on main help sign in
fix(lsp): clone slice to avoid mutation
commitbaae1b6d0e03f6db36c13a2915d8ef379bbb0564 authorAndrey Nering <andreynering@users.noreply.github.com> dateWed 8 Apr 2026, 16:54 (6 months ago) parent6f7762f
1 file changed+2−1
internal/lsp/client.go+2−1
internal/lsp/client.go+2−1
@@ -8,6 +8,7 @@ import (
88 "maps"
99 "os"
1010 "path/filepath"
11+ "slices"
1112 "sync"
1213 "sync/atomic"
1314 "time"
@@ -288,7 +289,7 @@ func (c *Client) GetName() string {
288289
289290// FileTypes returns the file types this LSP client handles
290291func (c *Client) FileTypes() []string {
291− return c.fileTypes
292+ return slices.Clone(c.fileTypes)
292293}
293294
294295// SetDiagnosticsCallback sets the callback function for diagnostic changes