emacs-lsp / lsp-mode

Emacs client/library for the Language Server Protocol
https://emacs-lsp.github.io/lsp-mode
GNU General Public License v3.0
4.75k stars 869 forks source link

flycheck in haskell mode #39

Closed alanz closed 7 years ago

alanz commented 7 years ago

I am getting the following output for flycheck-verify-setup

Any idea what I need to change?

Syntax checkers for buffer Foo.hs in haskell-mode:

  haskell-stack-ghc
    - may enable: yes
    - executable: Found at /usr/bin/stack

  haskell-ghc
    - may enable: yes
    - executable: Found at /opt/ghc/8.0.2/bin/ghc

  haskell-hlint
    - may enable:         yes
    - executable:         Found at /home/alanz/.cabal/bin/hlint
    - configuration file: Not found

Flycheck Mode is enabled. Use SPC u C-c ! x to enable disabled checkers.

--------------------

Flycheck version: 31snapshot (package: 20170324.340)
Emacs version:    25.1.1
System:           x86_64-pc-linux-gnu
Window system:    x

The messaging leading up to it is

{"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"file:///home/alanz/tmp/haskell-hie-test-project/src/Foo.hs","languageId":"haskell","version":0,"text":"module Foo where\n\nfoo :: Int\nfoo = 5\n\nbaz = do\n  putStrLn \"hello\"\n\n"}}}
Output from language server: {"params":{"uri":"file:///home/alanz/tmp/haskell-hie-test-project/src/Foo.hs","diagnostics":[{"severity":2,"range":{"start":{"line":6,"character":7},"end":{"line":7,"character":19}},"code":"Redundant do","source":"hlint","message":"baz\ndo putStrLn \"hello\"\nputStrLn \"hello\"\n"}]},"jsonrpc":"2.0","method":"textDocument/publishDiagnostics"}
error in process filter: progn: Error parsing language server output: (error Flycheck cannot use lsp in this buffer, type M-x flycheck-verify-setup for more details)
error in process filter: Error parsing language server output: (error Flycheck cannot use lsp in this buffer, type M-x flycheck-verify-setup for more details)
alanz commented 7 years ago

Oops, the original flycheck-verify-setup when it first starts is

Syntax checkers for buffer Foo.hs in haskell-mode:

  haskell-stack-ghc
    - may enable: yes
    - executable: Found at /usr/bin/stack

  haskell-ghc
    - may enable: yes
    - executable: Found at /opt/ghc/8.0.2/bin/ghc

  haskell-hlint
    - may enable:         yes
    - executable:         Found at /home/alanz/.cabal/bin/hlint
    - configuration file: Not found

The following checker is explicitly selected for this buffer:

  lsp
    - major mode: `haskell-mode' not supported

Flycheck Mode is enabled. Use SPC u C-c ! x to enable disabled checkers.

--------------------

Flycheck version: 31snapshot (package: 20170324.340)
Emacs version:    25.1.1
System:           x86_64-pc-linux-gnu
Window system:    x
alanz commented 7 years ago

Fixed via resolution in #44