Skip to content

Commit

Permalink
fix(comp): error when no schema is available
Browse files Browse the repository at this point in the history
  • Loading branch information
gorillamoe committed Aug 17, 2024
1 parent 4fd85d0 commit 5238753
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lua/kulala-cmp-graphql/completions/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ end
---@param params cmp.SourceCompletionApiParams
---@param callback fun(response: lsp.CompletionResponse|nil)
function M.complete(self, params, callback)
local schema = self:_get_schema()
if schema == nil then
return callback({})
end
vim.defer_fn(function()
local bufnr = vim.fn.bufnr("%")
local node = Utils.get_ts_node_under_cursor()
Expand Down
2 changes: 1 addition & 1 deletion lua/kulala-cmp-graphql/globals/init.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local M = {}

M.VERSION = "1.0.1"
M.VERSION = "1.0.2"

return M

0 comments on commit 5238753

Please sign in to comment.