-
Notifications
You must be signed in to change notification settings - Fork 39
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
yield, sync* and async* not being highlighted #18
Comments
Just uploaded a fix, but just to note, I think if you are using neovim, it uses it's own highlight file defined here: I've gone ahead and copied into here (since I believe their highlighting is better than the current highlighting from just this repositor), and added the fixes. |
I added the |
If the highlights file is maintained here it might be worth to add a wget command to the automatic parser update workflow. So it would also update the query file |
@theHamsta when I initially tried using the |
@theHamsta @akinsho In fact if either of you are interested in maintaining the highlights, we should just get you commit access. |
@TimWhiting that's sounds excellent I'm definitely up for that, wasn't sure if you or @UserNobody14 might not be keen. Definitely makes sense to keep things together. As for contributing I work with dart full time using nvim so am pretty invested in making sure it's maintained. @theHamsta I'm guessing this will preclude the use of any nvim directives though which I think the nvim highlights depends on at least on the vim regex directive and all other things like fold and indent will stay in nvim. Not sure how to get round the regex thing but will get back to that when I'm nearer a computer and can have a proper look |
With an automated script we could probably append / replace any nvim specific directives? @UserNobody14 can you add @akinsho as a collaborator for help working with the highlights? |
I'm not sure what is the best solution. The nvim queries for nvim are a bit different from the Atom ones. Until now most maintainers decided to put the nvim queries in the nvim-treesitter repo. I guess the maintainers of their language should decide which fits best for their users. |
I think a lot of the queries are shared. I don't see a lot of nvim specific queries in the highlights.scm currently, I could be wrong, since I haven't touched highlights much. Maybe we can have a highlights.scm, and a nvim_highlights.scm, and concatenate them. |
Hmm 🤔 whilst I'd like to have things maintained here if possible I'm beginning to think it's the harder solution. Looking over A separate general wget -O - https://github.com/UserNobody14/tree-sitter-dart/{highlights.scm,nvim_highlights.scm} > highlights.scm Somewhere in nvim-treesitter..? From what I can see in Alternatively maybe the best approach would be something more manual like backporting changes from nvim's highlights here i.e. those that aren't too specific to nvim |
It could be done here https://github.com/theHamsta/nvim-treesitter/blob/f7422402ca675b753ab404ebb8d1a79300e988c3/.github/workflows/update-parsers-pr.yml#L36 before the workflow creates a PR and after the lockfile has been updated.. But maybe just having a separate config in nvim-treesitter would allow to specialize more for nvim. Combining the queries would work too assuming the order of the queries does not matter. Thinking a bit about it I think having all the queries with nvim-treesitter is not too bad. |
It looks like tree-sitter-dart doesn't highlight the keywords
yield
,sync*
andasync*
here's some code which showcases all 3 of these and compiles:in neovim, using nvim-treesitter, it looks like this:
as you can see, the before mentioned keywords are white, and not pink like other keywords.
The text was updated successfully, but these errors were encountered: