tree-sitter-dart
tree-sitter-dart copied to clipboard
Enhanced enums break highlighting
In helix-editor/helix (which uses UserNobody14/tree-sitter-dart), enhanced enums break syntax highlighting in the remainder of the file
enum TapActionButton {
right('right'),
left('left');
final String keys;
const TapActionButton(this.keys);
static TapActionButton fromKey(String key) =>
TapActionButton.values.singleWhere((e) => e.keys.contains(key));
}
@lukepighetti is this still an issue for you? I tried the same in NeoVim which also uses this parser for dart, and seems to work in my case
NeoVim uses a different highlights file for various reasons (including that they have some rules that are NeoVim specific and wouldn't work in the general highlights file). I'm happy to merge PRs, but right now I'll be trying to get the newer features of dart working for the parser and trying to clean up some old issues that are more functional in nature rather than highlighting.
In this particular case it would be probably straightforward to look at what rules NeoVim has in terms of the highlights file and see what subset can be upstreamed into this repo.
I just realized enhanced enums were previously not supported. I don't know what NeoVim is using. Maybe their own fork.
I just added parsing support.
Just checked the neovim-treesitter library, it seems to still be pointing to this repo, so I don't think enhanced enums should have been working previously.