haskell / haskell/haskell-language-server
Get rid of the hack needed by the "Expression is `_`" test
- Dominant language
- Haskell
- Stars
- 3k
- Forks
- 455
- Avg merge
- 3d 21h
- Merged PRs (30d)
- 13
Description
Currently, the case-split plugin **_test_** that ensures that the plugin works on `case _ :: Foo of` (where the `_` causes an error, which is fundamental to the test) needs a hack, which consists in using this function:
https://github.com/haskell/haskell-language-server/blob/5ce2a847d255ce6f420da49771711a89eee78541/plugins/hls-case-split-plugin/test/Main.hs#L171-L179
instead of the exiting util:
https://github.com/haskell/haskell-language-server/blob/5ce2a847d255ce6f420da49771711a89eee78541/hls-test-utils/src/Test/Hls/Util.hs#L281-L287
For details, see https://github.com/haskell/haskell-language-server/pull/5014#discussion_r3757061984
This is a hack _**for the test**_, not for the product code, hence no bug label.
Originally considered during [my GSoC 2026 project](https://gist.github.com/Aster89/69a57c364ec2d0cc89f474cc3d194371#future-work--stretch-goals).
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the linked PR discussion, then compare the local helper in plugins/hls-case-split-plugin/test/Main.hs with the existing utility in hls-test-utils/src/Test/Hls/Util.hs. Run the case-split plugin test and confirm the test for `case _ :: Foo of` still passes without the test-specific hack.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- haskell
- Domain
- testing
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 76/100