diff --git a/lua/nvim-ts-autotag/utils.lua b/lua/nvim-ts-autotag/utils.lua index 0fdd0b7..6b5fbdc 100644 --- a/lua/nvim-ts-autotag/utils.lua +++ b/lua/nvim-ts-autotag/utils.lua @@ -11,8 +11,8 @@ function M.is_react_file() elseif ft ~= "javascript" then return false end --- If we are in a `javascript` file, then check the content to see if the --- current file counts as a react file + -- If we are in a `javascript` file, then check the content to see if the + -- current file counts as a react file local ok, buf_parser = pcall(vim.treesitter.get_parser) if not ok then return false @@ -24,7 +24,7 @@ function M.is_react_file() end local root = tree[1]:root() - local queries = { 'jsx_element', 'jsx_self_closing_element' } + local queries = { "jsx_element", "jsx_self_closing_element" } for _, query in ipairs(queries) do if M.node_exists(root, query) then @@ -35,8 +35,6 @@ function M.is_react_file() return false end - - ---@return boolean function M.is_react_fragment() local line = vim.fn.getline(".") @@ -63,8 +61,6 @@ function M.node_exists(node, query) return false end - - M.get_node_text = function(node) local _, txt = pcall(get_node_text, node, vim.api.nvim_get_current_buf()) return vim.split(txt, "\n") or {} diff --git a/tests/specs/closetag_spec.lua b/tests/specs/closetag_spec.lua index c2bda45..4e2284d 100644 --- a/tests/specs/closetag_spec.lua +++ b/tests/specs/closetag_spec.lua @@ -145,7 +145,7 @@ local data = { linenr = 12, key = [[>]], before = [[<|
]], - after = [[<>|
]] + after = [[<>|
]], }, { name = "17 javascript autoclose fragment", @@ -154,7 +154,7 @@ local data = { linenr = 12, key = [[>]], before = [[<|
]], - after = [[<>|
]] + after = [[<>|
]], }, { name = "18 vue auto close tag",