Skip to content

Commit

Permalink
ref: 닫는 태그노드 찾기
Browse files Browse the repository at this point in the history
  • Loading branch information
dorage committed Dec 31, 2024
1 parent 99bd5cd commit c9cf007
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions lua/tree-emmet/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,24 @@ M.get_opening_element = function(element_node)
return nil
end

---comment
---@param element_node TSNode
---@return TSNode?
M.get_closing_element = function(element_node)
if element_node:type() == "jsx_self_closing_element" then
debug("it is self closing element")
return
end

for i = 0, element_node:child_count() do
if element_node:child(i):type() == "jsx_closing_element" then
return element_node:child(i)
end
end

return nil
end

---comment
---@param element_node TSNode
---@return string?
Expand Down

0 comments on commit c9cf007

Please sign in to comment.