haskell / haskell/haskell-language-server

Unable to format/highlight code: unterminated quasiquotation at end of input

Open
#3,906 4 comments 0 reactions 0 assignees View on GitHub
os: windows type: bug
Dominant language
Haskell
Stars
3k
Forks
455
Avg merge
2d 19h
Merged PRs (30d)
11

Description

### Environment

```
haskell-language-server version: 2.4.0.0 (GHC: 9.0.2) (PATH: C:\tools\haskell\ghcup\bin\haskell-language-server-9.0.2~2.4.0.0.exe)
Tool versions found on the $PATH
cabal: 3.6.2.1
stack: 2.11.1
ghc: 9.4.7
```

Everything is installed from ghcup on Windows.
I am using the VSCode plugin.

### Steps to reproduce

I have this simple script in primes.hs
```haskell
sieve = sx [2..]
where
sx (p:xs) = p : sx [x|x <- xs, x `mod` p > 0]

main = do
print (take 10000 sieve)
```

### Expected behaviour
![image](https://github.com/haskell/haskell-language-server/assets/34541656/0e7d716a-27d3-4fa2-aa13-bbdf0bba1981)
No errors, correct syntax highlighting,

### Actual behaviour

![image](https://github.com/haskell/haskell-language-server/assets/34541656/a760f86c-86f6-4cb0-9758-7d3cbcfc9f1a)
Syntax highlighting doesn't seem to work correctly.

And this error on trying to format the code in Visual Studio code
```
Error condition, please check your setup and/or the [issue tracker](https://github.com/haskell/haskell-language-server/issues): ormolu: Internal Error: ormoluCmd: OrmoluParsingFailed (RealSrcSpan SrcSpanMultiLine "C:\\...\\primes.hs" 3 27 7 1 Nothing) "[GHC-21231] unterminated quasiquotation at end of input"
```
### Debug Information

Unsure if this is supposed to belong here, but I'm opening this issue.

Adding spaces between `x|x` seems to resolve the issue.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.