haskell / haskell-language-server

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

output error brittany at code has list comprehension #1528

Closed insight1111 closed 3 years ago

insight1111 commented 6 years ago

version: 1.28.0-insider (user setup) commit: 431ef9da3cf88a7e164f9d33bf62695e07c6c2a9 date: 2018-10-03T12:44:29.343Z Electron: 2.0.9 Chrome: 61.0.3163.100 Node.js: 8.9.3 V8: 6.1.534.41 Architecture: x64

hie verison: Version 0.2.2.0, Git revision 881f2b3b737c34f72fffa3bec94f08f256f0d6fe (2000 commits) x86_64 ghc-8.4.2

code example:

a::[Int]
a=[x|x<-[1..3]]

get output

[Error - 7:19:30 AM] Request textDocument/formatting failed.
  Message: brittanyCmd: RealSrcSpan SrcSpanMultiLine "stdin" 2 6 3 1: unterminated quasiquotation at end of input

  Code: -32603 

but when i use brittany that separately install, no error occurs.(version brittany version 0.9.0.0) is it a brittany bug? or hie? or vscode-hie-server?

dustinheestand commented 5 years ago

I have the same bug, running hie from the Kakoune editor. So not a vscode-hie-server issue.

You can get around this by adding spaces around the | in your comprehension.

patrickaldis commented 5 years ago

This issue still hasn't been fixed.

jneira commented 4 years ago

I can reproduce in windows with latest versions of hie and vscode extension:

[Error - 9:10:55] Request textDocument/rangeFormatting failed.
  Message: brittanyCmd: RealSrcSpan SrcSpanMultiLine "stdin" 2 6 3 1: unterminated quasiquotation at end of input

  Code: -32603 
jneira commented 3 years ago

@insight1111 @patrickaldis is this still being reproduced with last hls?

jneira commented 3 years ago

I cant reproduce with last hls version, fomatting with brittany gives me:

a :: [Int]
a = [ x | x <- [1 .. 3] ]

so i am gonna close it, feel free to reopen if you continue experiencing it