File tree 1 file changed +15
-7
lines changed
1 file changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -579,7 +579,7 @@ defmodule NextLS do
579
579
_ -> [ ]
580
580
end
581
581
end )
582
- |> Enum . map ( fn % { name: name , kind: kind } = symbol ->
582
+ |> Enum . reduce ( [ ] , fn % { name: name , kind: kind } = symbol , results ->
583
583
{ label , kind , docs } =
584
584
case kind do
585
585
:struct -> { name , GenLSP.Enumerations.CompletionItemKind . struct ( ) , "" }
@@ -592,13 +592,21 @@ defmodule NextLS do
592
592
_ -> { name , GenLSP.Enumerations.CompletionItemKind . text ( ) , "" }
593
593
end
594
594
595
- % GenLSP.Structures.CompletionItem {
596
- label: label ,
597
- kind: kind ,
598
- insert_text: name ,
599
- documentation: docs
600
- }
595
+ completion_item =
596
+ % GenLSP.Structures.CompletionItem {
597
+ label: label ,
598
+ kind: kind ,
599
+ insert_text: name ,
600
+ documentation: docs
601
+ }
602
+
603
+ case NextLS.Snippet . get ( name , nil ) do
604
+ nil -> [ completion_item | results ]
605
+ snippets when is_list ( snippets ) -> results ++ snippets
606
+ snippet -> [ snippet | results ]
607
+ end
601
608
end )
609
+ |> Enum . reverse ( )
602
610
603
611
{ :reply , results , lsp }
604
612
rescue
You can’t perform that action at this time.
0 commit comments