Closed googleson78 closed 4 years ago
I believe this question is about LanguageClient-neovim
, not hls
. Check out the docs of to see if there is something about triggering a codelens or create an issue about it in LanguageClient-neovim
repo.
Thanks, it does support "code lens actions"!
My issue is rather that I can't find if it's mentioned anywhere that the evaluate thing is a "code lens" and that you're supposed to use the action associated with it.
Is it documented somewhere, and if not, would it be alright to put it in the README
next to the feature description?
On a side-note if someone is willing to explain/give a pointer: For someone who hasn't programmed/directly used lsp: what's the decision process between deciding that something should be a "code lens" vs a "code action"?
Is it documented somewhere, and if not, would it be alright to put it in the README next to the feature description?
It would make sense for me.
what's the decision process between deciding that something should be a "code lens" vs a "code action"?
Afaik there is no a explicit process to take the decision, it depends on the implementer and varies from case to case.
Quick'n'dirty PR with readme update: https://github.com/haskell/haskell-language-server/pull/428
@googleson78 does anything happen when you run that code lens action thingy? I'm using coc.nvim
, and when I hit code lens action, nothing happens on an Evaluate...
line
@tek
With the following file:
asdf.hs
module Main where
-- >>> 3 + 5
if I do :call LanguageClient#handleCodeLensAction()
I get the option to evaluate it (via LanguageClient
s mechanism for showing options), and if I select it my file changes to this:
module Main where
-- >>> 3 + 5
-- 8
the Main
is there because of some bug (I think?, and I also think it was recently discussed somewhere around here and potentially fixed?)
so I'm guessing either try adding a module declaration, or look at what coc.nvim
does for "code lens action"
I'm seeing this in the hls output:
2020-09-24 12:41:26.209277786 [ThreadId 1442559] - finish: runEvalCmd.ghcSession (took 0.00s)
2020-09-24 12:42:14.50019892 [ThreadId 1442564] - Plugin.makeCodeLens (ideLogger)
2020-09-24 12:42:14.500492612 [ThreadId 1442565] - finish: codeLens (took 0.00s)
2020-09-24 12:42:14.500763445 [ThreadId 1442567] - finish: importLens (took 0.00s)
2020-09-24 12:42:14.500818535 [ThreadId 1442569] - finish: importLens (took 0.00s)
[Error - 12:42:15 PM] Request workspace/executeCommand failed.
Message: BadDependency "GhcSessionDeps"
Code: -32603
2020-09-24 12:42:15.212794328 [ThreadId 1442576] - finish: runEvalCmd.ghcSession (took 0.00s)
My original motivation/issue is now resolved, so I'm closing this.
I'm using
LanguageClient-neovim
.When I write something like, let's say
the only thing that happens is that the string
Evaluate...
pops up on the right of the comment (as nvim virtual text). I don't know how to interact with this - I only tried acodeAction
and nothing pops up.How do I interact with this via the lsp interface?