@@ -1,4 +1,3 @@
|
||||
local ts_utils = require("nvim-treesitter.ts_utils")
|
||||
local nodes_utils = require("neogen.utilities.nodes")
|
||||
local extractors = require("neogen.utilities.extractors")
|
||||
local locator = require("neogen.locators.default")
|
||||
@@ -110,7 +109,7 @@ return {
|
||||
-- Check if function is a static method. If so, will not remove the first parameter
|
||||
if node:parent():type() == "decorated_definition" then
|
||||
local decorator = nodes_utils:matching_child_nodes(node:parent(), "decorator")
|
||||
decorator = ts_utils.get_node_text(decorator[1])[1]
|
||||
decorator = vim.treesitter.query.get_node_text(decorator[1], 0)
|
||||
if decorator == "@staticmethod" then
|
||||
remove_identifier = false
|
||||
end
|
||||
@@ -185,7 +184,7 @@ return {
|
||||
for _, assignment in pairs(nodes["assignment"]) do
|
||||
local left_side = assignment:field("left")[1]
|
||||
local left_attribute = left_side:field("attribute")[1]
|
||||
left_attribute = ts_utils.get_node_text(left_attribute)[1]
|
||||
left_attribute = vim.treesitter.query.get_node_text(left_attribute, 0)
|
||||
if left_attribute and not vim.startswith(left_attribute, "_") then
|
||||
table.insert(results[i.ClassAttribute], left_attribute)
|
||||
end
|
||||
@@ -233,7 +232,7 @@ return {
|
||||
if child:type() == "comment" then
|
||||
local start_row = child:start()
|
||||
if start_row == 0 then
|
||||
if vim.startswith(ts_utils.get_node_text(node, 0)[1], "#!") then
|
||||
if vim.startswith(vim.treesitter.query.get_node_text(node, 0), "#!") then
|
||||
return 1, 0
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user