From 3ba73a2433fd9e667b5366109fb13f7459e7be36 Mon Sep 17 00:00:00 2001 From: PgBiel <9021226+PgBiel@users.noreply.github.com> Date: Mon, 27 Jan 2025 02:17:14 -0300 Subject: [PATCH] fix suggestion of associated values on dot --- server/internal/lsp/search/search_completion_list.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/internal/lsp/search/search_completion_list.go b/server/internal/lsp/search/search_completion_list.go index a125a18..3958d3f 100644 --- a/server/internal/lsp/search/search_completion_list.go +++ b/server/internal/lsp/search/search_completion_list.go @@ -308,7 +308,7 @@ func (s *Search) BuildCompletionList( enumerator := prevIndexable.(*symbols.Enumerator) for _, assoc := range enumerator.AssociatedValues { - if strings.HasPrefix(assoc.GetName(), symbolInPosition.Text()) { + if !filterMembers || strings.HasPrefix(assoc.GetName(), symbolInPosition.Text()) { items = append(items, protocol.CompletionItem{ Label: assoc.GetName(), Kind: &assoc.Kind, @@ -357,7 +357,7 @@ func (s *Search) BuildCompletionList( } else { // This is an enum instance, so we can access associated values. for _, assoc := range enum.GetAssociatedValues() { - if strings.HasPrefix(assoc.GetName(), symbolInPosition.Text()) { + if !filterMembers || strings.HasPrefix(assoc.GetName(), symbolInPosition.Text()) { items = append(items, protocol.CompletionItem{ Label: assoc.GetName(), Kind: &assoc.Kind,