Closed al1-ce closed 3 months ago
Yes, the grammar needs to be updated for 2.108. I haven't done that yet.
Some of the things in D 2.108 are going to require a bit larger surgery on the grammar. Part of the reason I've also not done this is that (for other reasons) I'm stuck on D 2.101.
A number of improvements have been made lately. I'm closing this ticket as there is nothing specifically actionable here.
Btw, token strings are very roughly supported. It's impossible to support them well, because the grammar for them is ... well.. incredibly loose.
A lot of your complaints here are a consequence of the limitations of D grammar.
As one example, when looking at struct or union initializers... it's quite impossible to determine that that's what they are not some form of other function call ... unless you have semantic analysis. (So that's far beyond what tree-sitter can do.)
Essentially, with much of D, there is so much ambiguity in the language that you cannot only really resolve many things by doing a full D front end (compiler). I've done what I can here, but it's far short of what you might like, but closing the gap simply isn't possible for D.
If you would like to contribute however, contributions are welcome. Especially the queries can likely be improved for different editors.
Currently tree-sitter-d missing a lot of important things including some new features from 2.108.0 (which was already released) and breaks in many spots
How to reproduce: create test.d and paste in code block from below.
Comments signify what's wrong
Image of highlight on neovim 0.10.0
Same image with incorrect highlight being highlighted
Related:
33
32
31
28
27
26