Open kanashimia opened 4 years ago
Interesting, maybe related to https://github.com/haskell/haskell-ide-engine/issues/1567?
Yeah, it seems like it.
Can you also try to run in --debug
mode and link the logs of the full process, e.g. first it works, then it doesnt? Either by defining a custom hie-wrapper path that sets the the flag --debug
or by setting in vscode "Haskell Language Server > Language Server Haskell > Trace : Server" to "verbose".
It's normal just as you save, by the time all that logging is finished it's all wrong again.
Also, info still shows sometimes, even after doubling.
The doubling itself is as far as I know alright. It shows you the declared type and the actual type, which in this case is very useful, at least in my opinion. Missing documentation is a bug.
After doing fresh install - same stuff. (deleting everything that i can and just installing stack; i've even tried to do it with or without haskell platform)
Even on the older version of hie, which is very strange because it didnt happen to me before ;$
So i found a way of "fixing" this - it fixes itself when you switch to another haskell file and go back.
--This is bad result:
2020-01-26 10:41:03.7680314 [ThreadId 3] - ---> {"jsonrpc":"2.0","id":10,"method":"textDocument/hover","params":{"textDocument":{"uri":"file:///c%3A/Projects/Boids/app/Main.hs"},"position":{"line":63,"character":6}}}
2020-01-26 10:41:03.7680314 [ThreadId 9] - ****** reactor: got message number:15
2020-01-26 10:41:03.7690303 [ThreadId 9] - reactor:got HoverRequest:RequestMessage {_jsonrpc = "2.0", _id = IdInt 10, _method = TextDocumentHover, _params = TextDocumentPositionParams {_textDocument = TextDocumentIdentifier {_uri = Uri {getUri = "file:///c%3A/Projects/Boids/app/Main.hs"}}, _position = Position {_line = 63, _character = 6}, _workDoneToken = Nothing}}
2020-01-26 10:41:03.7690303 [ThreadId 9] - reactor:HoverRequest done
2020-01-26 10:41:03.7690303 [ThreadId 15] - ideDispatcher: got request 15 with id: IdInt 10
2020-01-26 10:41:03.7690303 [ThreadId 9] - ****** reactor: top of loop
2020-01-26 10:41:03.7690303 [ThreadId 15] - newTypeCmd: (Position {_line = 63, _character = 6},Uri {getUri = "file:///c%3A/Projects/Boids/app/Main.hs"})
2020-01-26 10:41:03.7710321 [ThreadId 15] - ideDispatcher: top of loop
2020-01-26 10:41:03.7720312 [ThreadId 4] - <--2--{"result":{"contents":{"kind":"markdown","value":"\n```haskell\nviewport :: StateVar (Position, Size)\n```\n```haskell\nviewport :: StateVar (Position, Size)\n```\n\n\n\nOpenGL Graphics.Rendering.OpenGL.GL.CoordTrans"},"range":{"start":{"line":63,"character":6},"end":{"line":63,"character":14}}},"jsonrpc":"2.0","id":10}
--This is good one:
2020-01-26 10:47:03.0243117 [ThreadId 3] - ---> {"jsonrpc":"2.0","id":10,"method":"textDocument/hover","params":{"textDocument":{"uri":"file:///c%3A/Projects/Boids/app/Main.hs"},"position":{"line":63,"character":8}}}
2020-01-26 10:47:03.0253307 [ThreadId 9] - ****** reactor: got message number:19
2020-01-26 10:47:03.0253307 [ThreadId 9] - reactor:got HoverRequest:RequestMessage {_jsonrpc = "2.0", _id = IdInt 10, _method = TextDocumentHover, _params = TextDocumentPositionParams {_textDocument = TextDocumentIdentifier {_uri = Uri {getUri = "file:///c%3A/Projects/Boids/app/Main.hs"}}, _position = Position {_line = 63, _character = 8}, _workDoneToken = Nothing}}
2020-01-26 10:47:03.0253307 [ThreadId 9] - reactor:HoverRequest done
2020-01-26 10:47:03.0253307 [ThreadId 9] - ****** reactor: top of loop
2020-01-26 10:47:03.0253307 [ThreadId 15] - ideDispatcher: got request 19 with id: IdInt 10
2020-01-26 10:47:03.0253307 [ThreadId 15] - newTypeCmd: (Position {_line = 63, _character = 8},Uri {getUri = "file:///c%3A/Projects/Boids/app/Main.hs"})
2020-01-26 10:47:03.0263779 [ThreadId 15] - hoogle query: viewport package:OpenGL module:Graphics.Rendering.OpenGL.GL.CoordTrans is:exact
2020-01-26 10:47:03.0773812 [ThreadId 15] - ideDispatcher: top of loop
2020-01-26 10:47:03.0773812 [ThreadId 4] - <--2--{"result":{"contents":{"kind":"markdown","value":"\n```haskell\nviewport :: StateVar (Position, Size)\n```\n```haskell\nviewport :: StateVar (Position, Size)```\n[OpenGL](https://hackage.haskell.org/package/OpenGL) [Graphics.Rendering.OpenGL.GL.CoordTrans](https://hackage.haskell.org/package/OpenGL/docs/Graphics-Rendering-OpenGL-GL-CoordTrans.html)\nControls the affine transformation from normalized device coordinates\nto window coordinates. The viewport state variable consists of the\ncoordinates (*x*, *y*) of the lower left corner of the\nviewport rectangle, (in pixels, initial value (0,0)), and the size\n(*width*, *height*) of the viewport. When a GL context is\nfirst attached to a window, *width* and *height* are set to\nthe dimensions of that window.\n\nLet (*xnd*, *ynd*) be normalized device coordinates. Then\nthe window coordinates (*xw*, *yw*) are computed as follows:\n\n*xw* = (*xnd* + 1) (*width* / 2) + *x*\n\n*yw* = (*ynd* + 1) (*heigth* / 2) + *y*\n\nViewport width and height are silently clamped to a range that depends\non the implementation, see `maxViewportDims`.\n\n[More info](https://hackage.haskell.org/package/OpenGL/docs/Graphics-Rendering-OpenGL-GL-CoordTrans.html#v:viewport)\n\nOpenGL Graphics.Rendering.OpenGL.GL.CoordTrans"},"range":{"start":{"line":63,"character":6},"end":{"line":63,"character":14}}},"jsonrpc":"2.0","id":10}
As you see the only real difference is the result line and this line:
hoogle query: viewport package:OpenGL module:Graphics.Rendering.OpenGL.GL.CoordTrans is:exact
This is log of me:
On reload it quickly fixes itself for one moment (thats how i took that photo). After some time (switching between projects) it goes back to normal but on save is doubles again. GHCIDE works as expected (so i dont think that this is hie-bios related).
This only happends to some of the functions; base and other packages are affected too.
Output
``` 2020-01-23 00:26:04.3421894 [ThreadId 3] - run entered for hie-wrapper(hie-wrapper) Version 1.0.0.0, Git revision b7ce8b8f2fc4a071db2119516aa1dcffc577dca0 (dirty) (3541 commits) x86_64 ghc-8.6.5 2020-01-23 00:26:04.345193 [ThreadId 3] - Current directory:c:\Projects 2020-01-23 00:26:04.345193 [ThreadId 3] - Operating system:mingw32 2020-01-23 00:26:04.3461925 [ThreadId 3] - args:["--lsp"] 2020-01-23 00:26:04.3491904 [ThreadId 3] - Could not find a Project for file: c:\Projects\File.hs 2020-01-23 00:26:04.3501895 [ThreadId 3] - Module "c:\Projects\File.hs" is loaded by Cradle: Cradle {cradleRootDir = "c:\\Projects", cradleOptsProg = CradleAction: Direct} 2020-01-23 00:26:04.3501895 [ThreadId 3] - Cradle directory:c:\Projects 2020-01-23 00:26:04.3511903 [ThreadId 3] - Use Plain GHC 2020-01-23 00:26:04.4221882 [ThreadId 3] - Project GHC version:8.6.5 2020-01-23 00:26:04.423188 [ThreadId 3] - hie exe candidates :["hie-8.6.5.exe","hie-8.6.exe","hie.exe"] 2020-01-23 00:26:04.4261869 [ThreadId 3] - found hie exe at:C:\Users\nikita\AppData\Roaming\local\bin\hie.exe 2020-01-23 00:26:04.4261869 [ThreadId 3] - args:["--lsp"] 2020-01-23 00:26:04.4271929 [ThreadId 3] - launching .... 2020-01-23 00:26:04.4471857 [ThreadId 3] - Run entered for HIE(hie.exe) Version 1.0.0.0, Git revision b7ce8b8f2fc4a071db2119516aa1dcffc577dca0 (dirty) (3541 commits) x86_64 ghc-8.6.5 2020-01-23 00:26:04.4491863 [ThreadId 3] - Operating as a LSP server on stdio 2020-01-23 00:26:04.4491863 [ThreadId 3] - Current directory:c:\Projects 2020-01-23 00:26:04.4491863 [ThreadId 3] - Operating system:mingw32 2020-01-23 00:26:04.4491863 [ThreadId 3] - args:["--lsp"] 2020-01-23 00:26:04.454186 [ThreadId 3] - Could not find a Project for file: c:\Projects\File.hs 2020-01-23 00:26:04.454186 [ThreadId 3] - Module "c:\Projects\File.hs" is loaded by Cradle: Cradle {cradleRootDir = "c:\\Projects", cradleOptsProg = CradleAction: Direct} 2020-01-23 00:26:04.454186 [ThreadId 3] - Use Plain GHC 2020-01-23 00:26:04.5261893 [ThreadId 8] - Use Plain GHC Using hie version: Version 1.0.0.0, Git revision b7ce8b8f2fc4a071db2119516aa1dcffc577dca0 (dirty) (3541 commits) x86_64 ghc-8.6.5 2020-01-23 00:26:04.6742148 [ThreadId 14] - New cradle: C:\Projects\Boids\app\Main.hs 2020-01-23 00:26:04.6751911 [ThreadId 14] - Module "C:\Projects\Boids\app\Main.hs" is loaded by Cradle: Cradle {cradleRootDir = "C:\\Projects\\Boids", cradleOptsProg = CradleAction: stack} 2020-01-23 00:26:04.6751911 [ThreadId 14] - Found cradle: Cradle {cradleRootDir = "C:\\Projects\\Boids", cradleOptsProg = CradleAction: stack} Using hoogle db at: C:\Users\nikita\AppData\Roaming\hoogle\default-haskell-5.0.17.hoo 2020-01-23 00:26:05.8634127 [ThreadId 21] - [0mBuilding all executables for `Boids' once. After a successful build of all of them, only specified executables will be rebuilt.[0m 2020-01-23 00:26:05.8664137 [ThreadId 21] - [0mBoids> initial-build-steps (lib + exe)[0m 2020-01-23 00:26:06.3154736 [ThreadId 21] - [0mConfiguring GHCi with the following packages: Boids[0m 2020-01-23 00:26:07.3131465 [ThreadId 29] - C:\Projects\Boids\.stack-work\install\b6d93af8\pkgdb;C:\sr\snapshots\47eed6bc\pkgdb;C:\Tools\HaskellPlatform\8.6.5\lib\package.conf.d 2020-01-23 00:26:08.1201441 [ThreadId 17] - Cradle set succesfully 2020-01-23 00:26:08.2411491 [ThreadId 14] - New cradle: C:\Projects\Boids\app\Main.hs 2020-01-23 00:26:08.2421456 [ThreadId 14] - Module "C:\Projects\Boids\app\Main.hs" is loaded by Cradle: Cradle {cradleRootDir = "C:\\Projects\\Boids", cradleOptsProg = CradleAction: stack} 2020-01-23 00:26:08.2421456 [ThreadId 14] - Found cradle: Cradle {cradleRootDir = "C:\\Projects\\Boids", cradleOptsProg = CradleAction: stack} 2020-01-23 00:26:09.3223579 [ThreadId 47] - [0mBuilding all executables for `Boids' once. After a successful build of all of them, only specified executables will be rebuilt.[0m 2020-01-23 00:26:09.3253124 [ThreadId 47] - [0mBoids> initial-build-steps (lib + exe)[0m 2020-01-23 00:26:09.751341 [ThreadId 47] - [0mConfiguring GHCi with the following packages: Boids[0m 2020-01-23 00:26:10.5797295 [ThreadId 54] - C:\Projects\Boids\.stack-work\install\b6d93af8\pkgdb;C:\sr\snapshots\47eed6bc\pkgdb;C:\Tools\HaskellPlatform\8.6.5\lib\package.conf.d 2020-01-23 00:26:10.6246825 [ThreadId 43] - Cradle set succesfully ```Photoes
![GOOD](https://lh3.googleusercontent.com/VOoGH8XsfR7Z9H_HZCu14o6MG9uP_L8OWyC1yW6N5eb7fcY3Xa1wA1y02amGkdwMHb53Md352jXjRFRrb3rcFYOom9q-tlUrQNSvrC-oMJc213whyCXnNVx2Hce26qLoxAllkGzmZQ=w1723-h969-no) ![BAD](https://lh3.googleusercontent.com/I2HceuCFwuIbY3jqyNFRgn7GsxiUWhDPBYpENhts4tSaefRWjOd5ffRSF9oE26yBftsyvZUX8ebyenPWy2klKxXM2hGFdWaw9elNvnT8h2WhiVPPSA5UFSFsAAlKGyxspYjfEW3KHw=w1723-h969-no)EDIT: also types are displayed like:
_ :: IO ()
and notmain :: IO ()
(at least some)