vscode-haskell icon indicating copy to clipboard operation
vscode-haskell copied to clipboard

Incorrect code highlighting

Open ViciousDoormat opened this issue 1 year ago • 2 comments

Your environment

OS: Windows 11

Steps to reproduce

This code block gets highlighted incorrectly. The word "fold" in the type definition gets highlighted blue (as a type variable) instead of yellow. When I remove "Usable a b =>" from the definition of ListCh, it gets highlighted correctly.

data List a = No | One a | Two a (List a) deriving Show
data List_ a b = No_ | One_ a | Two_ a b 
newtype ListCh a = ListCh (forall b. Usable a b => (List_ a b -> b) -> b)

fold :: (List_ a b -> b) -> List a -> b
fold a No = a No_
fold a (One x) = a (One_ x)
fold a (Two x xs) = a (Two_ x (fold a xs))

image

This is the whole code file (as a .txt because .hs is not supported): list.txt

Include debug information

When I add my extension logs, the message gets too long. If desired, I could add them to the issue as a file.

ViciousDoormat avatar Jul 27 '24 23:07 ViciousDoormat

Hi, thank you for the bug report!

I can reproduce the issue, but I think this is issue is caused by https://github.com/JustusAdam/language-haskell. By default, this vscode-haskell plugin (and HLS) do not provide the syntax highlighting.

fendor avatar Jul 29 '24 09:07 fendor

Perhaps this issue? https://github.com/JustusAdam/language-haskell/issues/179

fendor avatar Jul 29 '24 09:07 fendor

Closing as likely not our fault

fendor avatar Nov 11 '24 17:11 fendor