Skip to content
This repository has been archived by the owner on Oct 7, 2020. It is now read-only.

No output/effect in neo-vim, no obvious errors #1090

Open
drewboardman opened this issue Feb 17, 2019 · 8 comments
Open

No output/effect in neo-vim, no obvious errors #1090

drewboardman opened this issue Feb 17, 2019 · 8 comments

Comments

@drewboardman
Copy link

drewboardman commented Feb 17, 2019

I'm running LanguageClient-neovim and hie-wrapper. The command I've configured in my init.vim is hie-wrapper -d -l /home/myuser/tmp/hie.log.

When I enter a project and execute a hover request, I get the below output also here in this pastebin.

There isn't an obvious error, however nothing at all happens inside neovim. There are no popups or output with any meaningful information.


2019-02-16 20:06:27.390425774 [ThreadId 4] - run entered for hie-wrapper(hie-wrapper) Version 0.6.0.0, Git revision 7dd6fd7ab2191734ab21b502dcf6189689196cc7 (2406 commits) x86_64 ghc-8.6.3
2019-02-16 20:06:27.390770684 [ThreadId 4] - Current directory:/home/myusername/code/dummy
2019-02-16 20:06:27.526552402 [ThreadId 4] - Cradle directory:/home/myusername/code/dummy
2019-02-16 20:06:27.526833276 [ThreadId 4] - Using stack GHC version
2019-02-16 20:06:27.663049603 [ThreadId 4] - Project GHC version:8.6.3
2019-02-16 20:06:27.663194276 [ThreadId 4] - hie exe candidates :["hie-8.6.3","hie-8.6","hie"]
2019-02-16 20:06:27.663530806 [ThreadId 4] - found hie exe at:/home/myusername/.local/bin/hie-8.6.3
2019-02-16 20:06:27.663610543 [ThreadId 4] - args:["-d","-l","/home/myusername/tmp/hie.log"]
2019-02-16 20:06:27.663668168 [ThreadId 4] - launching ....



2019-02-16 20:06:27.6668457 [ThreadId 4] - Using stack GHC version
2019-02-16 20:06:27.799178941 [ThreadId 4] - Run entered for HIE(hie-8.6.3) Version 0.6.0.0, Git revision 7dd6fd7ab2191734ab21b502dcf6189689196cc7 (2406 commits) x86_64 ghc-8.6.3
2019-02-16 20:06:27.799432254 [ThreadId 4] - Current directory:/home/myusername/code/dummy
2019-02-16 20:06:27.799628951 [ThreadId 4] - 




haskell-lsp:Starting up server ...
2019-02-16 20:06:27.800241066 [ThreadId 4] - ---> {"jsonrpc":"2.0","method":"initialize","params":{"capabilities":{"textDocument":{"colorProvider":null,"completion":{"completionItem":{"snippetSupport":false}},"signatureHelp":{"signatureInformation":{"parameterInformation":{"labelOffsetSupport":true}}}},"workspace":{"applyEdit":true,"didChangeWatchedFiles":{"dynamicRegistration":true}}},"processId":7793,"rootPath":"/home/myusername/code/dummy","rootUri":"file:///home/myusername/code/dummy","trace":"off"},"id":1}
2019-02-16 20:06:27.801073 [ThreadId 4] - haskell-lsp:initializeRequestHandler: setting current dir to project root:/home/myusername/code/dummy
2019-02-16 20:06:27.822635422 [ThreadId 10] - ****** reactor: top of loop
2019-02-16 20:06:27.823234485 [ThreadId 6] - <--2--{"result":{"capabilities":{"textDocumentSync":{"openClose":true,"change":2,"willSave":false,"willSaveWaitUntil":false,"save":{"includeText":false}},"workspace":{},"documentRangeFormattingProvider":true,"documentHighlightProvider":true,"executeCommandProvider":{"commands":["7841:applyrefact:applyOne","7841:applyrefact:applyAll","7841:applyrefact:lint","7841:base:version","7841:base:plugins","7841:base:commands","7841:base:commandDetail","7841:brittany:format","7841:build:prepare","7841:build:isConfigured","7841:build:configure","7841:build:listTargets","7841:build:listFlags","7841:build:buildDirectory","7841:build:buildTarget","7841:ghcmod:check","7841:ghcmod:lint","7841:ghcmod:info","7841:ghcmod:type","7841:ghcmod:casesplit","7841:hare:demote","7841:hare:dupdef","7841:hare:iftocase","7841:hare:liftonelevel","7841:hare:lifttotoplevel","7841:hare:rename","7841:hare:deletedef","7841:hare:genapplicative","7841:hare:casesplit","7841:hoogle:info","7841:hoogle:lookup","7841:hsimport:import","7841:liquid:sayHello","7841:liquid:sayHelloTo","7841:package:add","7841:pragmas:addPragma"]},"renameProvider":true,"definitionProvider":true,"hoverProvider":true,"codeActionProvider":true,"completionProvider":{"triggerCharacters":["."],"resolveProvider":true},"documentSymbolProvider":true,"documentFormattingProvider":true,"referencesProvider":true}},"jsonrpc":"2.0","id":1}
2019-02-16 20:06:27.823411201 [ThreadId 13] - ideDispatcher: top of loop
2019-02-16 20:06:27.823472366 [ThreadId 4] - ---> {"jsonrpc":"2.0","method":"initialized","params":{}}
2019-02-16 20:06:27.823818107 [ThreadId 4] - ---> {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"languageId":"haskell","text":"{-# LANGUAGE DataKinds                  #-}\n{-# LANGUAGE DeriveGeneric              #-}\n{-# LANGUAGE FlexibleInstances          #-}\n{-# LANGUAGE GeneralizedNewtypeDeriving #-}\n{-# LANGUAGE MultiParamTypeClasses      #-}\n{-# LANGUAGE OverloadedStrings          #-}\n{-# LANGUAGE RankNTypes                 #-}\n{-# LANGUAGE ScopedTypeVariables        #-}\n{-# LANGUAGE TypeOperators              #-}\n\nmodule Server where\n\nimport           Prelude                       ()\nimport           Prelude.Compat\n\nimport           Control.Monad.Except\nimport           Control.Monad.Reader\nimport           Data.Aeson\nimport qualified Data.Aeson.Parser\nimport           Data.Aeson.Types\nimport           Data.Attoparsec.ByteString\nimport           Data.ByteString               (ByteString)\nimport           Data.List\nimport           Data.Maybe\nimport           Data.String.Conversions\nimport           Data.Time.Calendar\nimport           GHC.Generics\nimport           Lucid\nimport           Network.HTTP.Media            ((//), (/:))\nimport           Network.Wai\nimport           Network.Wai.Handler.Warp\nimport           Servant\nimport           Servant.Types.SourceT         (source)\nimport           System.Directory\nimport           Text.Blaze\nimport qualified Text.Blaze.Html\nimport           Text.Blaze.Html.Renderer.Utf8\n\ntype UserAPI1 = \"users\" :> Get '[ JSON] [User]\n\ndata User = User\n  { name              :: String\n  , age               :: Int\n  , email             :: String\n  , registration_date :: Day\n  } deriving (Eq, Show, Generic)\n\ninstance ToJSON User\n\nusers1 :: [User]\nusers1 =\n  [ User \"Isaac Newton\"    372 \"[email protected]\" (fromGregorian 1683 3 1)\n  , User \"Albert Einstein\" 136 \"[email protected]\"         (fromGregorian 1905 12 1)\n  , User \"myusername Boardman\"   31  \"[email protected]\"     (fromGregorian 2019 02 07)\n  ]\n\nserver1 :: Server UserAPI1\nserver1 = return users1\n\nuserAPI :: Proxy UserAPI1\nuserAPI = Proxy\n\n-- 'serve' comes from servant and hands you a WAI Application,\n-- -- which you can think of as an \"abstract\" web application,\n-- -- not yet a webserver.\napp1 = serve userAPI server1\n\nmainServer :: IO ()\nmainServer = run 8081 app1\n","uri":"file:///home/myusername/code/dummy/src/Server.hs","version":0}}}
2019-02-16 20:06:27.824056178 [ThreadId 10] - ****** reactor: got message number:0
2019-02-16 20:06:27.824089631 [ThreadId 10] - ****** reactor: processing Initialized Notification
2019-02-16 20:06:27.824248825 [ThreadId 10] - Using stack GHC version
2019-02-16 20:06:27.82453141 [ThreadId 6] - <--2--{"jsonrpc":"2.0","params":{"type":4,"message":"Using hie version: Version 0.6.0.0, Git revision 7dd6fd7ab2191734ab21b502dcf6189689196cc7 (2406 commits) x86_64 ghc-8.6.3"},"method":"window/logMessage"}
2019-02-16 20:06:27.965735849 [ThreadId 12] - ghcDispatcher: top of loop
2019-02-16 20:06:27.981502788 [ThreadId 10] - ****** reactor: top of loop
2019-02-16 20:06:27.98163883 [ThreadId 10] - ****** reactor: got message number:1
2019-02-16 20:06:27.981718867 [ThreadId 10] - ****** reactor: processing NotDidOpenTextDocument
2019-02-16 20:06:27.98186173 [ThreadId 10] - requestDiagnostics: no diagFunc for:DiagnosticOnOpen
2019-02-16 20:06:27.981935706 [ThreadId 10] - ****** reactor: top of loop
2019-02-16 20:06:27.982053667 [ThreadId 12] - ghcDispatcher:got request 0 with id: Nothing
2019-02-16 20:06:27.982345233 [ThreadId 12] - ghcDispatcher: top of loop
2019-02-16 20:06:27.982420479 [ThreadId 12] - ghcDispatcher:got request 1 with id: Nothing
2019-02-16 20:06:27.984355491 [ThreadId 6] - <--2--{"jsonrpc":"2.0","params":{"type":4,"message":"Using hoogle db at: /home/myusername/.hoogle/default-haskell-5.0.17.hoo"},"method":"window/logMessage"}
2019-02-16 20:06:28.118604794 [ThreadId 12] - file mapping state is: fromList [("/home/myusername/code/dummy/src/Server.hs",FileMapping {fmPath = "/tmp/ghc-mod7842/Server7841-0.hs", fmTemp = True})]
2019-02-16 20:06:28.118777959 [ThreadId 12] - ghcDispatcher: top of loop
2019-02-16 20:06:28.118848265 [ThreadId 12] - ghcDispatcher:got request 1 with id: Nothing
2019-02-16 20:06:28.118914951 [ThreadId 12] - ghcDispatcher:Processing request as version matches
2019-02-16 20:06:42.494834584 [ThreadId 4] - ---> {"jsonrpc":"2.0","method":"textDocument/hover","params":{"position":{"character":0,"line":68},"textDocument":{"uri":"file:///home/myusername/code/dummy/src/Server.hs"}},"id":2}
2019-02-16 20:06:42.495104508 [ThreadId 10] - ****** reactor: got message number:2
2019-02-16 20:06:42.495215138 [ThreadId 10] - reactor:got HoverRequest:RequestMessage {_jsonrpc = "2.0", _id = IdInt 2, _method = TextDocumentHover, _params = TextDocumentPositionParams {_textDocument = TextDocumentIdentifier {_uri = Uri {getUri = "file:///home/myusername/code/dummy/src/Server.hs"}}, _position = Position {_line = 68, _character = 0}}}
2019-02-16 20:06:42.495337369 [ThreadId 10] - reactor:HoverRequest done
2019-02-16 20:06:42.495436098 [ThreadId 10] - ****** reactor: top of loop
2019-02-16 20:06:55.089652818 [ThreadId 4] - ---> {"jsonrpc":"2.0","method":"exit","params":null}
2019-02-16 20:06:55.089848075 [ThreadId 4] - haskell-lsp:Got exit, exiting
@alanz
Copy link
Collaborator

alanz commented Feb 17, 2019

It's odd, it receives the hover request, claims to have processed it, but does not actually send a reply message.

Does the code currently compile? i.e. using stack build on the command line?

Are you able to share the project you are running hie against?

@Anrock
Copy link
Collaborator

Anrock commented Feb 17, 2019

Looks similar to #983
@drewboardman there is a workaround/fix described in #983 (comment). Can you try it?

@drewboardman
Copy link
Author

@alanz thanks for the quick response! Here is the project, it's just a sample Servant app for testing out tooling. It does currently compile.

@drewboardman
Copy link
Author

@Anrock I've tested HIE in VSCode and it works there. I'm not having the issue for unresponsiveness in that IDE.

@lukel97
Copy link
Collaborator

lukel97 commented Feb 18, 2019

@alanz Did a bit of browsing, the reactor:HoverRequest done line is just sent whenever the request has been put into the scheduler, not when it has actually sent anything back to the client

@epeery
Copy link

epeery commented Mar 7, 2019

For me this issue doesn't happen immediately. I install HIE and everything works fine but after a day or two it just stops. I've reinstalled it a couple of times and this has happened every time.

@boblehest
Copy link

boblehest commented Sep 30, 2019

I'm reinstalling HIE daily, because it seems to stop working shortly after (possibly after every reboot? I'm not sure). I'm using NeoVim with coc.

Edit: Looks like deleting the repository folder is what breaks HIE for me. I thought it was OK to delete after installing (via stack ./install.hs stack-hie-{version}).

@nponeccop
Copy link
Contributor

deleting the repository folder is what breaks HIE for me

It's a known issue, see #400 and related issues. However, the biggest problem here is that HIE/coc/nvim don't detect when the HIE gets broken. Is it possible to improve in this area prior to fixing #400?

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

No branches or pull requests

7 participants