folke / tokyonight.nvim

🏙 A clean, dark Neovim theme written in Lua, with support for lsp, treesitter and lots of plugins. Includes additional themes for Kitty, Alacritty, iTerm and Fish.
Apache License 2.0
6.25k stars 414 forks source link

bug: haskell semantic token coloring error #609

Closed NamelessDev0000 closed 2 months ago

NamelessDev0000 commented 2 months ago

Did you check docs and existing issues?

Neovim version (nvim -v)

0.10.0

Operating system/version

arch

Describe the bug

treesitter code

@lsp.type.enumMember.haskell should be linked to @constructor (as treesitter) instead of Constant.

Steps To Reproduce

  1. install haskell treesitter parser & haskell-language-server
  2. config hls to activate semantic token (it's off by default
  3. open any hs file with value constructor

Expected Behavior

after fixed with vim.api.nvim_set_hl(0, "@lsp.type.enumMember.haskell", { link = "@constructor" }):

image treesitter

Repro

No response

folke commented 2 months ago

Why should an enum be linked to constructor? That's personal preference. Change it in your own config

NamelessDev0000 commented 2 months ago

Why should an enum be linked to constructor? That's personal preference. Change it in your own config

There have some misunderstandings to clarify. In Haskell Context, enumMember is exactly constructor.(you can also see it in its lap config) so why lsp send enum token but not constructor? Because in lsp specification there is no such token exist. (Unbelievable) So I think we should link enumMemeber to constructor in Haskell. But not link any enum to constructor.

Anyway, thanks for your efforts in making this project🎉