Completions appear to be currently broken. I have tried stack and cabal on several different repos including this one. Everything type checks, hover works fine, but no completions.
[Error - 2:52:32 AM] Request textDocument/completion failed.
Message: []
Code: -32602
Is anyone else having this issue, before I go down the bisect route?
@Avi-D-coder Are you using one of the new branches based on my fork of ghcide?
I built from hls master.
I have the exact same issue, running on Emacs (MacOS):
This is the relevant log when run in debug mode:
2020-05-10 23:36:20.695228 [ThreadId 5] - ---> {"jsonrpc":"2.0","method":"textDocument/completion","params":{"textDocument":{"uri":"file:///Users/korayal/prj/acme/src/Acme/Looney/Tunes.hs"},"position":{"line":123,"character":45},"context":{"triggerKind":1}},"id":54}
2020-05-10 23:36:20.695525 [ThreadId 7] - <--2--{"error":{"code":-32602,"message":"[]"},"jsonrpc":"2.0","id":54}
2020-05-10 23:36:29.381015 [ThreadId 5] - ---> {"jsonrpc":"2.0","method":"$/cancelRequest","params":{"id":54}}
@korayal Where did you get GHC from? I use ghcup and I'm wondering if that's related.
@Avi-D-coder I got everything from nixpkgs, but I don't think that would be an issue here. -32602 refers to InvalidParams according to the docs.
The parameters we're providing seems to be sufficient for the request (we have an additional context parameter though)
I should note the ghcide installed with hls is also broken in the same way, I have not test master ghcide.
This issue may also be related to ( or duplicate of) https://github.com/haskell/haskell-language-server/issues/71
Done a bit of a digging, and looks like the error is coming from here
the error is not about invalid parameters as the error code represents, it's just that the rights mhs value is an empty list. Though, in my case the whole mhs was an empty list. So there was no active CompletionProvider available.
This was fixed by #107 right? Closing, but re-open if it is not fixed.
@fendor sadly, I still experience this issue, even though #107 is in master now.
I'm on d2654185eef1b0d703cebc694e85438e20600e37, which has ghcide at 3ee692a4cdb98792c371765c9f8adb5237d0a515.
I've installed like this:
./cabal-hls-install hls-8.8.3
And here is the error I get:
2020-06-20 13:52:54.332521303 [ThreadId 5] - ---> {"jsonrpc":"2.0","id":13,"method":"textDocument/completion","params":{"textDocument":{"uri":"file:///home/maks/Projects/SRK/morley/code/morley-debugger/src/Morley/Debugger/DAP/Input.hs"},"position":{"line":39,"character":85},"context":{"triggerKind":1}}}
2020-06-20 13:52:54.33294268 [ThreadId 7] - <--2--{"error":{"code":-32602,"message":"[]"},"jsonrpc":"2.0","id":13}
And this stuff still happens:
2020-06-20 14:09:43.510095314 [ThreadId 129432] - finish shakeRun: batch (took 0.36s, exception: Error when running Shake build system:
at error, called at ./Data/HashMap/Base.hs:631:16 in unordered-containers-0.2.10.0-HWXSgJ70JGT3CtHLLvyOtp:Data.HashMap.Base
* Raised the exception:
Data.HashMap.Base.(!): key not found
)
Most helpful comment
Done a bit of a digging, and looks like the error is coming from here
the error is not about invalid parameters as the error code represents, it's just that the
rights mhsvalue is an empty list. Though, in my case the wholemhswas an empty list. So there was no activeCompletionProvideravailable.