@@ -110,7 +110,7 @@ return {
|
|||||||
-- Check if function is a static method. If so, will not remove the first parameter
|
-- Check if function is a static method. If so, will not remove the first parameter
|
||||||
if node:parent():type() == "decorated_definition" then
|
if node:parent():type() == "decorated_definition" then
|
||||||
local decorator = nodes_utils:matching_child_nodes(node:parent(), "decorator")
|
local decorator = nodes_utils:matching_child_nodes(node:parent(), "decorator")
|
||||||
decorator = helpers.get_node_text(decorator[1])
|
decorator = helpers.get_node_text(decorator[1])[1]
|
||||||
if decorator == "@staticmethod" then
|
if decorator == "@staticmethod" then
|
||||||
remove_identifier = false
|
remove_identifier = false
|
||||||
end
|
end
|
||||||
@@ -185,7 +185,7 @@ return {
|
|||||||
for _, assignment in pairs(nodes["assignment"]) do
|
for _, assignment in pairs(nodes["assignment"]) do
|
||||||
local left_side = assignment:field("left")[1]
|
local left_side = assignment:field("left")[1]
|
||||||
local left_attribute = left_side:field("attribute")[1]
|
local left_attribute = left_side:field("attribute")[1]
|
||||||
left_attribute = helpers.get_node_text(left_attribute)
|
left_attribute = helpers.get_node_text(left_attribute)[1]
|
||||||
if left_attribute and not vim.startswith(left_attribute, "_") then
|
if left_attribute and not vim.startswith(left_attribute, "_") then
|
||||||
table.insert(results[i.ClassAttribute], left_attribute)
|
table.insert(results[i.ClassAttribute], left_attribute)
|
||||||
end
|
end
|
||||||
@@ -233,7 +233,7 @@ return {
|
|||||||
if child:type() == "comment" then
|
if child:type() == "comment" then
|
||||||
local start_row = child:start()
|
local start_row = child:start()
|
||||||
if start_row == 0 then
|
if start_row == 0 then
|
||||||
if vim.startswith(helpers.get_node_text(node), "#!") then
|
if vim.startswith(helpers.get_node_text(node)[1], "#!") then
|
||||||
return 1, 0
|
return 1, 0
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ return {
|
|||||||
return node:type()
|
return node:type()
|
||||||
end
|
end
|
||||||
local get_text = function(node)
|
local get_text = function(node)
|
||||||
return helpers.get_node_text(node)
|
return helpers.get_node_text(node)[1]
|
||||||
end
|
end
|
||||||
if opts.type then
|
if opts.type then
|
||||||
result[k] = vim.tbl_map(get_type, v)
|
result[k] = vim.tbl_map(get_type, v)
|
||||||
|
|||||||
Reference in New Issue
Block a user