Skip to content

Hover only works the 2nd time #135

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
TomMD opened this issue May 27, 2020 · 5 comments
Closed

Hover only works the 2nd time #135

TomMD opened this issue May 27, 2020 · 5 comments
Labels
component: ghcide status: needs info Not actionable, because there's missing information type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..

Comments

@TomMD
Copy link

TomMD commented May 27, 2020

Using neovim, vim-lsp, haskell-language-server a2b7710

cabal unpack generic-trie
cd generic-trie*
cat <<EOF >hie.yaml
cradle:
  cabal:
    component: "lib:generic-trie"
EOF
nvim src/Data/GenericTrie.hs

Wander to a symbol, such as the expression in the delete declaration. Wait for HLS to get done loading:

2020-05-26 23:17:04.987019 [ThreadId 673] - finish: InitialLoad (took 0.06s)
2020-05-26 23:17:04.987012 [ThreadId 672] - finish: InitialLoad (took 0.06s)
2020-05-26 23:17:04.987233 [ThreadId 406] - finish shakeRun: batch (took 0.06s, completed)

Seems good. Now try to hover (\lh for me):

No hover information found

Oh, I guess all this IDE stuff isn't all it's cracked up to be. Let's stubbornly try again:

Screen Shot 2020-05-26 at 11 19 20 PM

ohh... 2nd time is the charm. And it's consistent - reproducible.

@jneira jneira added component: ghcide type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc.. labels May 27, 2020
@jneira
Copy link
Member

jneira commented May 27, 2020

I've just tried it with this diff:

Log of the first time hover:

2020-05-27 11:03:03.3712098 [ThreadId 2418] - finish: InitialLoad (took 4.05s)
2020-05-27 11:03:03.3712098 [ThreadId 707] - finish shakeRun: batch (took 4.05s, completed)
2020-05-27 11:03:03.3712098 [ThreadId 6] - <--2--{"jsonrpc":"2.0","params":{"value":{"kind":"end"},"token":"8"},"method":"$/progress"}
2020-05-27 11:03:09.2536264 [ThreadId 4] - ---> {"jsonrpc":"2.0","id":3,"method":"textDocument/hover","params":{"textDocument":{"uri":"file:///d%3A/dev/ws/haskell/hls/test/utils/Test/Hls/Util.hs"},"position":{"line":107,"character":44}}}
2020-05-27 11:03:09.2546242 [ThreadId 2421] - GhcIde.hover entered (ideLogger)
2020-05-27 11:03:09.2546242 [ThreadId 2421] - Hover request at position 108:45 in file: d:\dev\ws\haskell\hls\test\utils\Test\Hls\Util.hs
2020-05-27 11:03:09.2546242 [ThreadId 9] - Starting: (2,0):[DelayedAction: C:GetHieFile,DelayedAction: C:GetDocMap]
2020-05-27 11:03:09.2556142 [ThreadId 6] - <--2--{"result":{"contents":{"kind":"markdown","value":"\n```haskell\n_ :: Maybe Bool\n-> Maybe CodeActionLiteralSupport -> CodeActionClientCapabilities\n```\n- \n\n```haskell\nCodeActionClientCapabilities\n```\n\n*Defined in ‘Language.Haskell.LSP.Types.ClientCapabilities’*\n"},"range":{"start":{"line":107,"character":21},"end":{"line":107,"character":51}}},"jsonrpc":"2.0","id":3}
2020-05-27 11:03:09.286619 [ThreadId 2649] - finish: C:GetHieFile (took 0.03s)
2020-05-27 11:03:09.286619 [ThreadId 2652] - finish: C:GetDocMap (took 0.03s)
2020-05-27 11:03:09.2876207 [ThreadId 2423] - finish shakeRun: batch (took 0.03s, completed)

But i have hit that before, in the mpickering/hls branch of ghcide and hls

@jneira
Copy link
Member

jneira commented Nov 9, 2020

Some vim user in the room that can help to reproduce/trace the issue?

@Anrock
Copy link
Contributor

Anrock commented Nov 9, 2020

Not vim, but neovim.

HLS: 93a3b53
Nvim: v0.5.0-nightly-2-gf34eeba
With nvim-lsp-config.
Using cabal 3.2.0.0, no stack.

Checked on my private project and Test/Hls/Util.hs from the same commit in HLS - in both cases hover works from the first time (after waiting some time until HLS settles). Was unable to check generic-trie due to GHC version mismatch.

@jneira
Copy link
Member

jneira commented Nov 17, 2020

@TomMD do you continue experiencing this?

@jneira jneira added the status: needs info Not actionable, because there's missing information label Nov 17, 2020
@TomMD
Copy link
Author

TomMD commented Nov 17, 2020

The bad behavior does not surface in 0.6. Closing.

Thank you!

EDIT: For posterity: I'm also using language client instead of vim-lsp these days. If someone produces this with vim-lsp then that might be part of the difference.

@TomMD TomMD closed this as completed Nov 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: ghcide status: needs info Not actionable, because there's missing information type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..
Projects
None yet
Development

No branches or pull requests

4 participants