Skip to content

Commit

Permalink
Avoid exposing CompletionItem data as null
Browse files Browse the repository at this point in the history
  • Loading branch information
dbanck committed Jul 28, 2022
1 parent 3c108b4 commit da74524
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/lsp/completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,13 @@ func toCompletionItem(candidate lang.Candidate, caps lsp.CompletionClientCapabil
TextEdit: textEdit(candidate.TextEdit, snippetSupport),
Command: cmd,
AdditionalTextEdits: TextEdits(candidate.AdditionalTextEdits, snippetSupport),
Data: candidate.ResolveHook,
// TODO set deprecated via `tags` if supported.
}

if candidate.ResolveHook != nil {
item.Data = candidate.ResolveHook
}

if caps.CompletionItem.DeprecatedSupport {
item.Deprecated = candidate.IsDeprecated
}
Expand Down

0 comments on commit da74524

Please sign in to comment.