Unable to format/highlight code: unterminated quasiquotation at end of input
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
sieve = sx [2..]
where
sx (p:xs) = p : sx [x|x <- xs, x `mod` p > 0]
main = do
print (take 10000 sieve)
Expected behaviour
No errors, correct syntax highlighting,
Actual behaviour
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.
Hi, thank you for the bug report!
Is this happening on a plain .hs file? I can not reproduce on linux :/
I created the file Main.hs:
sieve = sx [2..]
where
sx (p:xs) = p : sx [x|x <- xs, x `mod` p > 0]
main = do
print (take 10000 sieve)
And all these commands
-
ghcup run --ghc 9.0.2 --hls 2.4.0.0 -- haskell-language-server-9.0.2 Main.hs -
ghcup run --ghc 9.4.7 --hls 2.4.0.0 -- haskell-language-server-9.4.7 Main.hs -
ghcup run --ghc 9.6.3 --hls 2.5.0.0 -- haskell-language-server-9.6.3 Main.hs
complete successfully for me.
Yup. Simple .hs file.
I just installed Haskell, and then wanted to test it out with a very simple program and that's what I did.
Please let me know if there's any information I can help you with.
The information from the issue template would be helpful! Please provide the output of haskell-language-server-wrapper --debug primes.hs, executed in the terminal.
If you use vscode-haskell, you may also follow the steps described here: https://github.com/haskell/vscode-haskell#investigating-and-reporting-problems
-
the syntax color part. Seems the
dois missing color. It should be syntax highlighting problem. Since HLS does not provide the syntax highlighting, it is not a problem related to HLS. here: https://github.com/JustusAdam/language-haskell.git -
the format part
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 "/Users/ares/src/extend-property/hls-plugin-api/test/Ide/PluginUtilsTest.hs" 204 27 208 1 Nothing) "[GHC-21231] unterminated quasiquotation at end of input"Considered a
ormolubug?