haskell / haskell-language-server

Official haskell ide support via language server (LSP). Successor of ghcide & haskell-ide-engine.
Apache License 2.0
2.65k stars 355 forks source link

Syntax hightlight break when typing some type signature #4396

Closed foxmean closed 2 weeks ago

foxmean commented 2 weeks ago

My environment

Which OS do you use?: MacOS Sonoma 14.6.1, MacBook Air M1 2020

Which version of GHC do you use and how did you install it?: GHC 9.10.1 from GHCup

Which LSP client (editor/plugin) do you use?: Helix 24.7 (079f5442) & Zed 0.151.1. All of them was installed with Homebrew 4.3.19-40-g9659b57.

Which version of HLS do you use and how did you install it?: HLS 2.9.0.1 from GHCup.

Have you configured HLS in any way (especially: a hie.yaml file)?: I only use default setting without config anything

Steps to reproduce

  1. Type some type signature such as in the video below and the syntax highlight would break. It is semi-inconsistent. I mostly encounter with ad-hoc polymorphism or parametric polymorphism but it is not always happen. (Mostly with '=>' or '->') asciicast

https://github.com/user-attachments/assets/bb4a4baf-56a9-4048-a02f-cff86300edde

  1. The syntax highlighting is always solvable by just close & reopen the file with any of editors I use.

ref: https://github.com/helix-editor/helix/issues/11517

fendor commented 2 weeks ago

Hi, thank you for your bug report!

If you did not configure HLS in any way, then I presume you don't have semantic highlighting enabled in HLS?

If that's not the case, then the syntax highlighting is not provided by HLS but Helix. In this case there is nothing we can do to fix this.

foxmean commented 2 weeks ago

Thank you for your reply. So, should I try Semantic highlighting or better waiting for stable release?

fendor commented 2 weeks ago

Sure, give it a try! However, it is experimental, so expect bugs :) Also, I don't know whether helix has support for semantic highlighting.

Closing as "not our fault (this time)". Feel free to ask more questions or open more issues :)

foxmean commented 2 weeks ago

Just for reference, in case someone search for this issue: Helix won't support semantic highlighting for foreseeable future.