tree-sitter / tree-sitter-haskell

Haskell grammar for tree-sitter.
MIT License
152 stars 36 forks source link

Improve Haskell highlight queries #40

Closed farbodsz closed 3 years ago

farbodsz commented 3 years ago

This PR makes improvements to the highlights.scm file in tree-sitter-haskell.

It's partly based off the one by @elianiva from https://github.com/nvim-treesitter/nvim-treesitter/pull/1210. (I'm aware that PR is still in the works, so wasn't sure whether to open the PR here or on the nvim-treesitter repo).

Here are the changes I've made compared to the one from the nvim-treesitter PR:

There's also a comparison of each of the aforementioned highlights, so you can see the results visually.

Example 1

tree-sitter-haskell nvim-treesitter PR This PR
screenshot_20210618_213617 screenshot_20210618_214054 screenshot_20210618_215022

Example 2

tree-sitter-haskell nvim-treesitter PR This PR
screenshot_20210618_213740 screenshot_20210618_214235 screenshot_20210618_215113
tek commented 3 years ago

wait, this is rendered by nvim? any clue if there was some recent change that made this possible? I've been having issues like this one https://github.com/tree-sitter/tree-sitter-haskell/issues/35

anyways, looks good!

farbodsz commented 3 years ago

Thanks for merging! Yes, it is rendered by nvim.

While I haven't been able to reproduce the exact issue you mentioned, I have noticed Playground not updating at all (for all languages). Not sure if those issues are related but I might look into it further in the near future.

theHamsta commented 3 years ago

@elianiva shouldn't qualified be also @include for us?

elianiva commented 3 years ago

@elianiva shouldn't qualified be also @include for us?

I think it should, but isn't it already the case though?