Skip to content

Applying hints fails with HLS 1.0.0 #1443

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
lylek opened this issue Feb 25, 2021 · 3 comments
Closed

Applying hints fails with HLS 1.0.0 #1443

lylek opened this issue Feb 25, 2021 · 3 comments

Comments

@lylek
Copy link

lylek commented Feb 25, 2021

With HLS 0.9.0, applying hints would hang. So I patiently waited for the next release. Now with HLS 1.0.0, it fails instead of hanging. Here's a section of debug output from when I tried to apply a hint. You will see some errors therein, one of which says to "please report". I see that there's a parse error when the server unexpectedly returned a Null. There's also an error about a missing file. Not sure what's most relevant but I hope this helps diagnose the problem. Not sure whether it's an issue with the extension or with the server.

2021-02-25 11:07:42.622326 [ThreadId 5] DEBUG haskell-lsp.parseOne:	---> {"jsonrpc":"2.0","id":78,"method":"workspace/executeCommand","params":{"command":"27652:hlint:applyOne","arguments":[{"file":"file:///Users/lyle/ExaTMS/src/TripShot/Bz/OnDemand/Scheduling/RideCandidates.hs","start_pos":{"character":38,"line":249},"hintTitle":"Use <>"}]}}
2021-02-25 11:07:42.622967 [ThreadId 7] DEBUG haskell-lsp.sendServer:	<--2--{"id":60,"method":"window/workDoneProgress/create","params":{"token":5},"jsonrpc":"2.0"}
2021-02-25 11:07:42.622893 [ThreadId 11743] INFO hls:	hlint:applyOneCmd:file=NormalizedFilePath "/Users/lyle/ExaTMS/src/TripShot/Bz/OnDemand/Scheduling/RideCandidates.hs"
2021-02-25 11:07:42.623077 [ThreadId 7] DEBUG haskell-lsp.sendServer:	<--2--{"method":"$/progress","params":{"token":5,"value":{"title":"Applying hint: Use <>","kind":"begin","cancellable":true}},"jsonrpc":"2.0"}
2021-02-25 11:07:42.623197 [ThreadId 5] DEBUG haskell-lsp.parseOne:	---> {"jsonrpc":"2.0","id":60,"result":null}
2021-02-25 11:07:42.623362 [ThreadId 11744] INFO hls:	hlint:getIdeas:file:NormalizedFilePath "/Users/lyle/ExaTMS/src/TripShot/Bz/OnDemand/Scheduling/RideCandidates.hs"
2021-02-25 11:07:42.623408 [ThreadId 7] DEBUG haskell-lsp.sendServer:	<--2--{"method":"window/logMessage","params":{"message":"haskell-lsp:incoming message parse error. {\"jsonrpc\":\"2.0\",\"id\":60,\"result\":null} Error in $.result: parsing () failed, expected Array, but encountered Null\n","type":1},"jsonrpc":"2.0"}
2021-02-25 11:07:42.623526 [ThreadId 11744] INFO hls:	finish: applyHint (took 0.00s)
[Error - 11:07:42 AM] haskell-lsp:incoming message parse error. {"jsonrpc":"2.0","id":60,"result":null} Error in $.result: parsing () failed, expected Array, but encountered Null

2021-02-25 11:07:42.623528 [ThreadId 11743] INFO hls:	applyHint:apply=[[Replace {rtype = Expr, pos = SrcSpan {startLine = 250, startCol = 39, endLine = 250, endCol = 126}, subts = [("a",SrcSpan {startLine = 250, startCol = 39, endLine = 250, endCol = 74}),("b",SrcSpan {startLine = 250, startCol = 78, endLine = 250, endCol = 126})], orig = "a <> b"}]]
2021-02-25 11:07:43.037141 [ThreadId 11746] INFO hls:	finish: applyHint (took 0.00s)
2021-02-25 11:07:43.037224 [ThreadId 11748] INFO hls:	finish: applyHint (took 0.00s)
2021-02-25 11:07:43.037321 [ThreadId 11750] INFO hls:	finish: applyHint (took 0.00s)
Missing file: /Users/runner/.ghcup/ghc/8.10.4/lib/ghc-8.10.4/settings
2021-02-25 11:07:43.037602 [ThreadId 7] DEBUG haskell-lsp.sendServer:	<--2--{"method":"$/progress","params":{"token":5,"value":{"kind":"end"}},"jsonrpc":"2.0"}
2021-02-25 11:07:43.037611 [ThreadId 11740] ERROR hls:	Unexpected exception on request, please report!
Exception: ExitFailure 1
[Error - 11:07:43 AM] Request workspace/executeCommand failed.
  Message: ExitFailure 1
  Code: -32603 
2021-02-25 11:07:43.037821 [ThreadId 7] DEBUG haskell-lsp.sendServer:	<--2--{"id":78,"jsonrpc":"2.0","error":{"message":"ExitFailure 1","code":-32603}}
@jneira
Copy link
Member

jneira commented Feb 25, 2021

I am afraid this is another manifestation of #591
As mentioned there the workaround is create a symlink from the missing path to the real path of your ghc installation

@jneira jneira transferred this issue from haskell/vscode-haskell Feb 25, 2021
@jneira
Copy link
Member

jneira commented Feb 25, 2021

I am gonna close this one if you don't mind, you can track the solution in the mentioned issue #591

@jneira jneira closed this as completed Feb 25, 2021
@lylek
Copy link
Author

lylek commented Feb 26, 2021

Thanks, got the workaround to work - though it took me a bit of figuring of where my GHC installation was and how to properly symlink it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants