Open A-Walrus opened 3 months ago
I think the haskell treesitter expects to have the following format when writing functions:
<type>
<function implementation>
I'm getting the following syntax highlighting:
class Foo a where
as_int :: a -> Int
as_int = read as_str
as_str :: a -> String
as_str = show as_int
as_txt :: a -> Text
as_txt = pack as_str
Summary
The syntax highlighting is wrong with multiple default function implementations for a type-class in Haskell (like rust traits).
Tree sitter scopes are identical for both the correctly highlighted and incorrectly highlighted ones:
["haskell", "class", "class_body", "function", "variable"]
But the highlight name for the first one (correct) is
function
and for the rest arevariable
.Reproduction Steps
I tried this: 1. `hx` 2. paste in the exmple code: ```hs class Foo a where as_int :: a -> Int as_str :: a -> String as_txt :: a -> Text as_int = read as_str as_str = show as_int as_txt = pack as_str ``` I expected this to happen: All functions highlighted identically Instead, this happened: Only the first function is highlighted correctly ### Helix log _No response_ ### Platform Linux ### Terminal Emulator kgx (Gnome Console) ### Installation Method Arch (24.3), AUR (24.7) ### Helix Version helix 24.3, helix 24.7