From baae1b6d0e03f6db36c13a2915d8ef379bbb0564 Mon Sep 17 00:00:00 2001 From: Andrey Nering Date: Wed, 8 Apr 2026 16:54:44 -0300 Subject: [PATCH] fix(lsp): clone slice to avoid mutation --- internal/lsp/client.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/lsp/client.go b/internal/lsp/client.go index 7125b352b6c2d5e841c0687bdedd50a93cc1ae22..a219de40da82b76a42b40ff35696d545bb1427a9 100644 --- a/internal/lsp/client.go +++ b/internal/lsp/client.go @@ -8,6 +8,7 @@ import ( "maps" "os" "path/filepath" + "slices" "sync" "sync/atomic" "time" @@ -288,7 +289,7 @@ func (c *Client) GetName() string { // FileTypes returns the file types this LSP client handles func (c *Client) FileTypes() []string { - return c.fileTypes + return slices.Clone(c.fileTypes) } // SetDiagnosticsCallback sets the callback function for diagnostic changes