Closed kiennq closed 1 year ago
Hi and thanks for this report!
Yes, this is a known bug - there is no node to indent, so it aligns with the braces. The author of the tree-sitter-indent-mode does not think this is a bug - see https://codeberg.org/FelipeLema/tree-sitter-indent.el/issues/8.
I have not had time yet to sort this out properly. In general the indentation still needs work. This should be fixed first over at codeberg, then this mode should follow suit.
If you have time and energy, I would be happy to test and help out with prs :)
Oh and one more thing. If you start typing then indent now, it should indent, right?
Oh and one more thing. If you start typing then indent now, it should indent, right?
Yeah, that's true.
Do we have any hope? :slightly_smiling_face:
Not sure if that is of any help but if you're using lsp-mode you can turn M-x lsp-toggle-on-type-formatting
which ask the LSP server to do the formatting.
@kirill-gerasimenko-da no, I don't think so. I am waiting for the native emacs tree-sitter implementation, which AFAICT supports the missing node as a child. If you really want this feature, either use aggressive indent mode or make a pr to the tree-sitter-indent package.
@razzmatazz IIUC is is not formatting that is missing, but rather the absent node after opening a scope. It aligns with the parent node, not as a child until a child is made.
Is this ticket still in limbo waiting for a native emacs tree-sitter? I find this bug extremely frustrating, but I'm not even sure what to ask of the tree-sitter-indent folks if I wanted to open a ticket there?
Yes, sorry. You can use M-i
to indent manually one stop.
Things are happening with tree-sitter, albeit slowly:)
Do you think this is going to be fixed in emacs 29, since that has tree-sitter?
Yes, i believe it is fixed already. If not, feel free to open a bug at the Emacs tracker 👍
csharp-mode is now developed as part of core emacs.
If you still have any issues, file a bug-report with the GNU Emacs bug-tracker :)
When using
csharp-tree-sitter-mode
withtree-sitter-indent
, when press Enter according to this code, the indent on new line is wrong.Expectation:
This is working okay if disable
tree-sitter-indent-mode
.