EmranMR / tree-sitter-blade

tree-sitter grammar for Laravel blade files
MIT License
175 stars 8 forks source link

HTML tags indentation doesn't work correctly in nvim #68

Open greg-grigorjevs opened 1 month ago

greg-grigorjevs commented 1 month ago

So when I am in an html file and I have something like this <div>|</div> and I press enter it expands to this:

<div>
    |
</div>

but when I am in a blade file the same action expands to this:

<div>
|</div>

At the same time when if I put the cursor here:

<div>|
</div>

It expands correctly to this:

<div>
    |
</div>

And it also expands correctly if I press o/O in normal mode

I have already tried copy-pasting the contents of https://github.com/nvim-treesitter/nvim-treesitter/blob/1aad04ecde5ebf8f2b3eea5c6f39d38b251757f5/queries/html_tags/indents.scm into after/queries/blade/indents.scm and indent is enabled inside my treesitter config but that didn't change anything.

Does anyone has the same issue ?

EmranMR commented 2 weeks ago

Hi, so I just tried this in helix, and this is also the case there. wonder if this is the case in other languages that inject html. So I am not sure if this is the issue with this parser or it is just the way tree-sitter handles things. For example, the text editors have a hard time, where you use the shortcut for comments. They inject html comments, even if the blade comments are fully configured