Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions lua/copilot_cmp/source.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ function source:get_keyword_pattern()
end

source.get_trigger_characters = function()
return {'.'}
return { '.' }
end

-- executes before selection
source.resolve = function (self, completion_item, callback)
source.resolve = function(self, completion_item, callback)
for _, fn in ipairs(self.executions) do
completion_item = fn(completion_item)
end
Expand All @@ -20,12 +20,12 @@ end

source.is_available = function(self)
-- client is stopped.
if self.client.is_stopped() or not self.client.name == "copilot" then
if self.client:is_stopped() or not self.client.name == "copilot" then
return false
end


local get_source_client = function ()
local get_source_client = function()
if vim.lsp.get_clients == nil then
return vim.lsp.get_active_clients({
bufnr = vim.api.nvim_get_current_buf(),
Expand All @@ -41,7 +41,7 @@ source.is_available = function(self)
return next(get_source_client()) ~= nil
end

source.execute = function (_, completion_item, callback)
source.execute = function(_, completion_item, callback)
callback(completion_item)
end

Expand Down