haskell / haskell/haskell-language-server

List comprehensions are treated as quasiquotes

Open
#3,122 8 comments 0 reactions 0 assignees View on GitHub
component: hls-hlint-plugin type: bug
Dominant language
Haskell
Stars
3k
Forks
455
Avg merge
3d 21h
Merged PRs (30d)
13

Description

### Your environment

Which OS do you use?
- WSL 2 (Ubuntu)

Which version of GHC do you use and how did you install it?
- 9.0.2 ghcup

Which LSP client (editor/plugin) do you use?
- VSCode/Haskell

Which version of HLS do you use and how did you install it?

- 1.7.0.0 from ghcup.

Have you configured HLS in any way (especially: a `hie.yaml` file)?
- No.
### Steps to reproduce
Create a haskell file in vscode, with the contents:
```
main = print [x| x <- [1..10]]
```
the same behavior occurs even when ```{-#LANGUAGE NoQuasiQuotes#-}``` is added.

### Expected behaviour
HLS treats this as a list comprehension, and displays the appropriate suggestions (such as "redundant list comprehension"), when quasiquotes are disabled.

### Actual behaviour
HLS gives an error when there is no space before the ```|``` in the list comprehension, claiming that it is an ```unterminated quasiquotation at end of input``` when QuasiQuotes are not enabled.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the issue in a Haskell file opened through VSCode/Haskell, using the reported list comprehension with and without NoQuasiQuotes. Compare the diagnostics and suggestions with the expected list-comprehension behavior; done means no unterminated-quasiquotation error and the appropriate suggestions appear when quasiquotes are disabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.