haskell / lsp

Haskell library for the Microsoft Language Server Protocol
366 stars 92 forks source link

Error with a fresh install from haskell-ide-engine master because of initialized message #68

Closed tolgap closed 6 years ago

tolgap commented 6 years ago

This is the error I run into:

2017-12-15 13:22:40.918753 [ThreadId 4] - ---> {"jsonrpc":"2.0","method":"initialized"}
2017-12-15 13:22:40.919144 [ThreadId 5] - <--2--{"jsonrpc":"2.0","method":"window/logMessage","params":{"type":1,"message":"haskell-lsp:parse error. Object (fromList [(\"jsonrpc\",String \"2.0\"),(\"method\",String \"initialized\")]) \"When parsing the record NotificationMessage of type Language.Haskell.LSP.TH.DataTypesJSON.NotificationMessage the key params was not present.\" `stack update` and install new haskell-lsp. Or check information on https://marketplace.visualstudio.com/items?itemName=xxxxxxxxxxxxxxx"}}

which is correct. The initialized notification does not have a "params" key, while the NotificationMessage record needs one.

is this somehow a version mismatch? I've tried changing my stack.yaml in haskell ide engine to the 0.2 release commit

- location:
    git: https://github.com/alanz/haskell-lsp.git
    commit: b747454c06686620762dcb6e35564dd15361c7d4
  extra-dep: true

and rebuild it, but that didn't help either.

robrix commented 6 years ago

I’m getting a similar error on DidChangeWatchedFilesParams:

2018-03-18 17:21:17.918103 [ThreadId 4] - ---> {"jsonrpc":"2.0","method":"workspace/didChangeWatchedFiles","params":{"changes":[{"uri":"file:///Users/rob/Developer/Projects/semilattices/src/Data/Semilattice/Join.hs","type":2}]}}
2018-03-18 17:21:17.918389 [ThreadId 5] - <--2--{"jsonrpc":"2.0","method":"window/logMessage","params":{"type":1,"message":"haskell-lsp:parse error. Object (fromList [(\"jsonrpc\",String \"2.0\"),(\"params\",Object (fromList [(\"changes\",Array [Object (fromList [(\"uri\",String \"file:///Users/rob/Developer/Projects/semilattices/src/Data/Semilattice/Join.hs\"),(\"type\",Number 2.0)])])])),(\"method\",String \"workspace/didChangeWatchedFiles\")]) \"When parsing the record DidChangeWatchedFilesParams of type Language.Haskell.LSP.TH.DataTypesJSON.DidChangeWatchedFilesParams the key params was not present.\" `stack update` and install new haskell-lsp. Or check information on https://marketplace.visualstudio.com/items?itemName=xxxxxxxxxxxxxxx"}}

These errors are also happening for non-Haskell files like .git/FETCH_HEAD.

Edit: Fixed in #72.

lukel97 commented 6 years ago

@alanz I think we can close this?

alanz commented 6 years ago

I think so. The reporter must re-open if it still happens.