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
2 changes: 1 addition & 1 deletion lua/copilot_cmp/source.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ 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

Copilot AI Feb 24, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The operator precedence in this condition is incorrect. The expression not self.client.name == "copilot" is evaluated as (not self.client.name) == "copilot", which will always be false. It should be self.client.name ~= "copilot" or not (self.client.name == "copilot") to properly check if the client name is not "copilot".

Suggested change
if self.client:is_stopped() or not self.client.name == "copilot" then
if self.client:is_stopped() or self.client.name ~= "copilot" then

Copilot uses AI. Check for mistakes.
return false
end

Expand Down
Loading