Skip to content

fix deprecation warning for client.is_stopped()#133

Open
fstp wants to merge 1 commit intozbirenbaum:masterfrom
fstp:master
Open

fix deprecation warning for client.is_stopped()#133
fstp wants to merge 1 commit intozbirenbaum:masterfrom
fstp:master

Conversation

@fstp
Copy link
Copy Markdown

@fstp fstp commented Feb 24, 2026

No description provided.

Copilot AI review requested due to automatic review settings February 24, 2026 10:40
@fstp fstp closed this Feb 24, 2026
@fstp fstp reopened this Feb 24, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a deprecation warning by converting the is_stopped() method call from dot notation to colon notation in Lua. The change ensures that the method is called with the proper syntax that automatically passes self as the first argument, which is the correct Lua convention for method calls.

Changes:

  • Updated self.client.is_stopped() to self.client:is_stopped() to use proper Lua method call syntax

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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
Copy link

Copilot AI Feb 24, 2026

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants