Skip to content

Commit

Permalink
fix: completion context can be null (#210)
Browse files Browse the repository at this point in the history
Completion contexts can be nil, but we assumed they had to be present. This adds a reasonable default.
hauleth authored Jun 7, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 1cc39ed commit 5ce7332
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
defmodule Lexical.Server.Provider.Handlers.Completion do
alias Lexical.Protocol.Requests
alias Lexical.Protocol.Responses
alias Lexical.Protocol.Types.Completion
alias Lexical.Server.CodeIntelligence
alias Lexical.Server.Provider.Env

@@ -12,7 +13,7 @@ defmodule Lexical.Server.Provider.Handlers.Completion do
env.project,
request.document,
request.position,
request.context
request.context || Completion.Context.new(trigger_kind: :invoked)
)

response = Responses.Completion.new(request.id, completions)

0 comments on commit 5ce7332

Please sign in to comment.