You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So this is sort of a discussion, but also something that I think we'll need to change if we want to support indents. The issue is that in the above code sample the tree at that point would look like this:
The project is that this won't match here since the ERROR node isn't a child of the object_definition and : is actually a child of the current ERROR node.
Realistically even if you have an opening { you have the same issue:
@ckipp01 🖖🏻
I haven't found a way to influence the position of ERROR node in the tree.
However, we can write a query for what we have now, i.e. match the ERROR node! The following one seems to solve the described issue:
One problem I run into is that after inserting the :, if I hit return, the node detected at point can be either no node, or an (ERROR ":") node, which is kinda weird. This is on emacs, and I'm kinda sure it's Emacs doing something. Will look into it further Seems to be an emacs thing, please disregard
Commit of tree-sitter-scala you tested this on
97d5e7c
A code sample showing the error
Show the error node
So this is sort of a discussion, but also something that I think we'll need to change if we want to support indents. The issue is that in the above code sample the tree at that point would look like this:
If your cursor is here:
And you hit
<enter>
then you'd expect it to be indented. An indent query for this would look like this:From the
nvim-treesitter
docs it says:The project is that this won't match here since the
ERROR
node isn't a child of theobject_definition
and:
is actually a child of the currentERROR
node.Realistically even if you have an opening
{
you have the same issue:But since the vast majority of editors will give you a closing
}
by default it will really look like this:Meaning that you're in
object_definition
, so the<enter>
will indent like you'd expect.What do you expect the tree to look like
I'd expect that when you have the following:
And I hit
<enter>
there is a way that we can indent correctly.Where are you experiencing this error?
nvim-treesitter
The text was updated successfully, but these errors were encountered: