chore: formatting and clarification comment

This commit is contained in:
roy.crippen4 2024-07-14 17:36:32 -04:00
parent 2553ac5520
commit 33a38a53b1
2 changed files with 5 additions and 9 deletions

View File

@ -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 {}

View File

@ -145,7 +145,7 @@ local data = {
linenr = 12,
key = [[>]],
before = [[<|<div></div>]],
after = [[<>|</><div></div>]]
after = [[<>|</><div></div>]],
},
{
name = "17 javascript autoclose fragment",
@ -154,7 +154,7 @@ local data = {
linenr = 12,
key = [[>]],
before = [[<|<div></div>]],
after = [[<>|</><div></div>]]
after = [[<>|</><div></div>]],
},
{
name = "18 vue auto close tag",