Closed wyattlefevre closed 1 year ago
@wyattlefevre ello, can you have a look at #4086, and use the queries in your files to check if in works or not? You can branch to that or paste the below into init.lua Just wanna check if it works on your end or not (or is this the intended behavior, sorry i have little jsx knowledge, but the issue seems similar to #4076), then I'll add some tests to ask for approval
vim.treesitter.query.set_query("jsx", "indents", [[
; query
[
(jsx_fragment)
(jsx_element)
(jsx_self_closing_element)
] @indent
(parenthesized_expression) @indent
(jsx_closing_element ">" @indent_end)
(jsx_self_closing_element ">" @indent_end)
(
jsx_fragment
("<" ">" "<" "/" ">" @indent_end) @branch ;this is to replicate the fragment so that we can mark the indent end
)
[
(jsx_closing_element)
">"
] @branch
]])
@lucario387 sorry I'm just getting to this. The new update seems to have fixed things on my end. Thank you so much!
Describe the bug
In tsx/jsx files, treesitter appears to be indenting incorrectly on lines directly beneath closing tags where the closing tag is own its own line.
To Reproduce
Create a simple tsx or jsx file and create a new line beneath a closing tag that is on its own line.
Expected behavior
Indentation should be in line with closing tag. Instead, the cursor is indented one too many times.
Output of
:checkhealth nvim-treesitter
Output of
nvim --version
Additional context
https://user-images.githubusercontent.com/25963718/208246624-eeecd829-5c41-4ca5-84be-435c44a63edb.mov