fix deprecation warning for client.is_stopped()#133
fix deprecation warning for client.is_stopped()#133fstp wants to merge 1 commit intozbirenbaum:masterfrom
Conversation
There was a problem hiding this comment.
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()toself.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 |
There was a problem hiding this comment.
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".
| if self.client:is_stopped() or not self.client.name == "copilot" then | |
| if self.client:is_stopped() or self.client.name ~= "copilot" then |
No description provided.