Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhanced enums break highlighting #38

Open
lukepighetti opened this issue Nov 21, 2022 · 4 comments
Open

Enhanced enums break highlighting #38

lukepighetti opened this issue Nov 21, 2022 · 4 comments

Comments

@lukepighetti
Copy link

lukepighetti commented Nov 21, 2022

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));
}
@RobertBrunhage
Copy link

@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

image

@TimWhiting
Copy link
Collaborator

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.

@TimWhiting
Copy link
Collaborator

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.

@TimWhiting
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants