dlvandenberg / tree-sitter-angular

Tree Sitter Grammar for Angular
MIT License
29 stars 8 forks source link

Does indentation work? #24

Closed maxrzaw closed 1 week ago

maxrzaw commented 3 months ago

Does this grammar include support for indentation?

Unless I have it set up incorrectly the indentation does not work with the new control flow syntax. I don't think I have it set up incorrectly, because the highlighting is working correctly.

This is what the indentation should be:

<div>
  @if (true) {
    <p>tree sitter indentation does not work for this line</p>
  }
</div>

But this is what tree sitter indentation results in:

<div>
  @if (true) {
  <p>tree sitter indentation does not work for this line</p>
  }
</div>
dlvandenberg commented 3 months ago

Currently it does not. Personally I use prettier for the indentations. I could look into indentation support.

Zaxiure commented 3 months ago

I'm also having this issue, gets kinda annoying to deal with when not using a formatter especially if there's a lot of nested if/for statements. When inserting a new line inside a if/for statement it also doesn't put the cursor on the right place resulting in constant corrections.

dlvandenberg commented 3 weeks ago

I've added indentation support to https://github.com/nvim-treesitter/nvim-treesitter/pull/6848

dlvandenberg commented 1 week ago

Merged in https://github.com/nvim-treesitter/nvim-treesitter/pull/6928

maxrzaw commented 1 week ago

Just updated and it is working great. Thanks so much!!!