From ffefbd27ba983d408c2e184ed56f878265d74a88 Mon Sep 17 00:00:00 2001 From: danymat Date: Thu, 12 Jan 2023 22:30:28 +0100 Subject: [PATCH] ref: Use typed parameters --- lua/neogen/configurations/python.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lua/neogen/configurations/python.lua b/lua/neogen/configurations/python.lua index 2fc141e..e1b49d2 100644 --- a/lua/neogen/configurations/python.lua +++ b/lua/neogen/configurations/python.lua @@ -127,7 +127,7 @@ return { -- Check if the function is inside a class -- If so, remove reference to the first parameter (that can be `self`, `cls`, or a custom name) - if res.parameters and locator({ current = node }, parent.class) then + if res[i.Parameter] and locator({ current = node }, parent.class) then local remove_identifier = true -- Check if function is a static method. If so, will not remove the first parameter if node:parent():type() == "decorated_definition" then @@ -138,9 +138,9 @@ return { end end if remove_identifier then - table.remove(res.parameters, 1) - if vim.tbl_isempty(res.parameters) then - res.parameters = nil + table.remove(res[i.Parameter], 1) + if vim.tbl_isempty(res[i.Parameter]) then + res[i.Parameter] = nil end end end