fix(ts): Indentation in functions (Closes #111)
This commit is contained in:
@@ -282,7 +282,7 @@ end
|
|||||||
--- with multiple annotation conventions.
|
--- with multiple annotation conventions.
|
||||||
---@tag neogen-changelog
|
---@tag neogen-changelog
|
||||||
---@toc_entry Changes in neogen plugin
|
---@toc_entry Changes in neogen plugin
|
||||||
neogen.version = "2.9.0"
|
neogen.version = "2.9.1"
|
||||||
--minidoc_afterlines_end
|
--minidoc_afterlines_end
|
||||||
|
|
||||||
return neogen
|
return neogen
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
local ts_utils = require("nvim-treesitter.ts_utils")
|
|
||||||
local default_locator = require("neogen.locators.default")
|
local default_locator = require("neogen.locators.default")
|
||||||
|
|
||||||
return function(node_info, nodes_to_match)
|
return function(node_info, nodes_to_match)
|
||||||
local found_node = default_locator(node_info, nodes_to_match)
|
local found_node = default_locator(node_info, nodes_to_match)
|
||||||
|
|
||||||
if found_node and found_node:type() == "class_declaration" then
|
if found_node and vim.tbl_contains({ "class_declaration", "function_declaration" }, found_node:type()) then
|
||||||
local parent = found_node:parent()
|
local parent = found_node:parent()
|
||||||
if parent and parent:type() == "export_statement" then
|
if parent and parent:type() == "export_statement" then
|
||||||
return parent
|
return parent
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ return {
|
|||||||
|
|
||||||
return vim.tbl_keys(language.parent)
|
return vim.tbl_keys(language.parent)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
split = function(s, sep, plain)
|
split = function(s, sep, plain)
|
||||||
return vim.fn.has("nvim-0.6") == 1 and vim.split(s, sep, { plain = plain }) or vim.split(s, sep, plain)
|
return vim.fn.has("nvim-0.6") == 1 and vim.split(s, sep, { plain = plain }) or vim.split(s, sep, plain)
|
||||||
end,
|
end,
|
||||||
|
|||||||
Reference in New Issue
Block a user