From 50895eca4b90914307b0a9d706ca8bdda17c9fe6 Mon Sep 17 00:00:00 2001 From: Mitchell Hanberg Date: Thu, 23 May 2024 08:57:11 -0400 Subject: [PATCH] fix: better completions for function references Removes `&` as a trigger character, which will allow completions to trigger as normal once you start typing after. This shouldn't be a problem as the only two completions offered by that are `&` and `&&`, and operators like `||` don't complete anyway. --- lib/next_ls.ex | 2 +- lib/next_ls/autocomplete.ex | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/next_ls.ex b/lib/next_ls.ex index 81a4dcd5..5ac719e7 100644 --- a/lib/next_ls.ex +++ b/lib/next_ls.ex @@ -159,7 +159,7 @@ defmodule NextLS do completion_provider: if init_opts.experimental.completions.enable do %GenLSP.Structures.CompletionOptions{ - trigger_characters: [".", "@", "&", "%", "^", ":", "!", "-", "~", "/", "{"], + trigger_characters: [".", "@", "%", "^", ":", "!", "-", "~", "/", "{"], resolve_provider: true } end, diff --git a/lib/next_ls/autocomplete.ex b/lib/next_ls/autocomplete.ex index b119bdd2..a00a6021 100644 --- a/lib/next_ls/autocomplete.ex +++ b/lib/next_ls/autocomplete.ex @@ -72,7 +72,8 @@ defmodule NextLS.Autocomplete do hint = List.to_string(local_or_var) expand_container_context(code, :expr, hint, runtime, env) || - expand_local_or_var(hint, List.to_string(local_or_var), runtime, env) + expand_local_or_var(hint, hint, runtime, env) + {:local_arity, local} -> expand_local(List.to_string(local), true, runtime, env)