Skip to content
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

Haskell Syntax highlight break when write a type signature with "=>" sign #11517

Open
foxmean opened this issue Aug 18, 2024 · 2 comments
Open
Labels
A-language-support Area: Support for programming/text languages C-bug Category: This is a bug

Comments

@foxmean
Copy link

foxmean commented Aug 18, 2024

Summary

Around 95% up when I write a type signature with "=>" sign, the syntax highlight is break. Everything is recover when I quite and reopen the helix as show below.
asciicast

Reproduction Steps

I tried this:

  1. Open the helix editor and write some Haskell script
  2. Everything worked just fine except when I wrote a type signature that included "=>" sign (mostly). I usually not happen when I haven't included "=>".
  3. When I save and restart helix, everything fixed. But it is annoying.

I expected this to happen:
The syntax highlighter maybe break due to incomplete writing since it haven't happened if I wrote the function definition before type signature as show below
asciicast

Instead, this happened:
When I wrote a type signature before the function definition
asciicast

Helix log

A copy of ~/.cache/helix/helix.log here (with RUST_BACKTRAACE=1 hx -vv when reproducing bug. I have no idea how to summary these lines but I have selected only line that I reproduced the bug here.

Platform

MacOS Sonoma 14.6.1; on MacBook Air M1, 2020

Terminal Emulator

iTerm2, Build 3.5.0 (without terminal multiplex); and Alacritty Version 0.13.2 (1) with Zellij 0.40.1. Both terminal was installed via homebrew cask. Zellij was installed via nixpkgs (nix-darwin)

Installation Method

nixpkgs through nix-darwin flake

Helix Version

helix 24.7 (079f544)

@foxmean foxmean added the C-bug Category: This is a bug label Aug 18, 2024
@kirawi kirawi added the A-language-support Area: Support for programming/text languages label Aug 27, 2024
@kirawi
Copy link
Member

kirawi commented Aug 27, 2024

We disable highlighting on a buffer if highlighting takes longer than half a second to compute. It sounds to me like => has some buggy behavior here. We could see if a newer commit for the grammar has resolved this issue.

@foxmean
Copy link
Author

foxmean commented Sep 5, 2024

Sorry for the last archived video. I can reproduce some of the bug related to just "->" too like.
asciicast
BTW, I think the bug is from HLS itself due to I can reproduce it in Zed editor.
I use GHC 9.10.1 with HLS 2.9.0.1 from GHCup

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-language-support Area: Support for programming/text languages C-bug Category: This is a bug
Projects
None yet
Development

No branches or pull requests

2 participants