Skip to content

Commit

Permalink
fix: better completions for function references
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mhanberg committed May 23, 2024
1 parent 5846724 commit a6d5986
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/next_ls.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion lib/next_ls/autocomplete.ex
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ 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)
Expand Down

0 comments on commit a6d5986

Please sign in to comment.