Open freeman42x opened 6 years ago
test :: [Char] -> [Char]
test = reverse
Apply hint: Use String works fine in this case.
Hmm, honestly no idea on atm how to solve this.
I can get the following output from HIE --debug
,
2018-04-02 01:06:31.200618 [ThreadId 7] - got request with id: Just (IdInt 133)
2018-04-02 01:06:31.201491 [ThreadId 7] - processing request: IdInt 133
2018-04-02 01:06:31.252347 [ThreadId 7] - applyHint:ideas=[/private/var/folders/7w/pg1bypcn3c9_lb_4gtp8swhm0000gn/T/ghc-mod93811/Main93810-33.hs:1:1: Ignore: Use module export list
Found:
module Main where
Why not:
module Main (module Main) where
Note: an explicit list is usually better
,/private/var/folders/7w/pg1bypcn3c9_lb_4gtp8swhm0000gn/T/ghc-mod93811/Main93810-33.hs:20:1: Warning: Eta reduce
Found:
test xs = map (+ 3) xs
Why not:
test = map (+ 3)
,/private/var/folders/7w/pg1bypcn3c9_lb_4gtp8swhm0000gn/T/ghc-mod93811/Main93810-33.hs:22:10: Suggestion: Use String
Found:
[Char] -> [Char]
Why not:
String -> String
,/private/var/folders/7w/pg1bypcn3c9_lb_4gtp8swhm0000gn/T/ghc-mod93811/Main93810-33.hs:23:1: Warning: Eta reduce
Found:
test2 s = reverse s
Why not:
test2 = reverse
]
2018-04-02 01:06:31.294872 [ThreadId 7] - applyHint:diff=WorkspaceEdit {_changes = Just (fromList [(Uri {getUri = "file:///Users/tehnix/GitHub/Tehnix/miso-isomorphic-stack/backend/src/Main.hs"},List [])]), _documentChanges = Nothing}
2018-04-02 01:06:31.330026 [ThreadId 7] - applyOneCmd:file="/Users/tehnix/GitHub/Tehnix/miso-isomorphic-stack/backend/src/Main.hs"
2018-04-02 01:06:31.33015 [ThreadId 7] - applyOneCmd:res=Right (WorkspaceEdit {_changes = Just (fromList [(Uri {getUri = "file:///Users/tehnix/GitHub/Tehnix/miso-isomorphic-stack/backend/src/Main.hs"},List [])]), _documentChanges = Nothing})
2018-04-02 01:06:31.330255 [ThreadId 7] - ExecuteCommand response got:r=WorkspaceEdit
2018-04-02 01:06:31.330319 [ThreadId 7] - ExecuteCommand sending edit: RequestMessage {_jsonrpc = "2.0", _id = IdInt 50, _method = WorkspaceApplyEdit, _params = ApplyWorkspaceEditParams {_edit = WorkspaceEdit {_changes = Just (fromList [(Uri {getUri = "file:///Users/tehnix/GitHub/Tehnix/miso-isomorphic-stack/backend/src/Main.hs"},List [])]), _documentChanges = Nothing}}}
2018-04-02 01:06:31.3304 [ThreadId 7] - ghcDispatcher: top of loop
2018-04-02 01:06:31.330543 [ThreadId 5] - <--2--{"result":{},"jsonrpc":"2.0","id":133}
2018-04-02 01:06:31.330644 [ThreadId 5] - <--2--{"jsonrpc":"2.0","id":50,"method":"workspace/applyEdit","params":{"edit":{"changes":{"file:///Users/tehnix/GitHub/Tehnix/miso-isomorphic-stack/backend/src/Main.hs":[]}}}}
2018-04-02 01:06:31.336027 [ThreadId 4] - ---> {"jsonrpc":"2.0","id":50,"result":{"applied":true}}
2018-04-02 01:06:31.336307 [ThreadId 4] - haskell-lsp:Got reply message:"{\"jsonrpc\":\"2.0\",\"id\":50,\"result\":{\"applied\":true}}"
Okay, testing in VSCode, applying hints/code actions seem to be broken at the moment :/ I take it this means that the problem lies with HIE itself.
@Tehnix Doesn't this work for you:
test :: [Char] -> [Char]
test = reverse
Apply hint: Use String works fine in this case.
It works on my machine with both VSCode and Atom. HIE Version 0.1.0.0 x86_64 ghc-8.2.2
It seems it's working again, at least in VSCode.
Btw, if you would like more debug information, you can set a custom executable for HIE in ide-haskell-hie
's settings.
One I usually use for debuggin, is,
#!/usr/bin/env bash
DEBUG=1
indent=""
function debug {
if [[ $DEBUG == 1 ]]; then
echo "$indent$@" >> /tmp/hie-custom-wrapper.log
fi
}
curDir=`pwd`
debug "Launching HIE for project located at $curDir"
indent=" "
# Launch the hie for the LTS compiler (assuming built with --copy-compiler-tools).
debug `stack exec -- which hie`
stack exec -- hie --lsp --vomit --debug -l /tmp/hie.log
which enables --vomit on ghc-mod, and logs to /tmp/hie.log
, with the debug
statements going to /tmp/hie-custom-wrapper.log
.
As for what's causing it, I'm still not really sure.
Having following code:
The following messages are printed from LSP debug: