Release version 2021.01.07-12.28.44 which adds a new "add-import-to-namespace" refactoring and if it's a common import clojure-lsp
will suggest to add via code action π
ATM it'll suggest only classes from java.util
package, but my idea is to add a settings to customize that
@ericdallo Is it intended that the file path is shown in hovers? I just noticed this, but feel like I didn't see it before :thinking_face:
This is with version 2021.01.07-12.28.44 (latest, currently)
Yes, It was implemented few releases ago, it's common to show that on hover and it was something that cider documentation had that we didn't have yet
Any issues with that?
Another example of that in other LSPs:
Oh I see, and I had just seen the release+note before reading this π . No issue, just thought it looked odd at first and wanted to make sure it was intended.
I see, in VSCode looks odd indeed, not sure how to improve that on vscode, we could have a flag to disable that, but IMO i't s a nice feature and I'd like to avoid too many feature flags
Letβs run with it for a while and see how odd it looks after that. π
I took a look how Dart VSCode extension handles that, and it looks better indeed:
Somehow when hovering, they hide the docs
We want docs on hover, right?
I think if we can put it in a separate section under the doc string, at the bottom of the hover, that would be ideal. Not saying it needs to be changed immediately
Maybe something to try though
I meant the file path ^
Notice in my screenshot the path is right under the args, then the doc string is in a separate section at the bottom, but I'd expect maybe the opposite
Yeah, but the way clojure-lsp is sending, it's the same way dart is sending, shoudn't this be handled on VSCode?
Perhaps :thinking_face: . I forgot what makes those separate sections. I thought I saw that each was from a different provider, but not sure if that makes sense here. I'll need to look into it
This is how Dart shows to me on Emacs
and this is how clojure-lsp is doing:
I wonder how this behave different in VSCode extension :thinking_face:
@brandon.ringe it's markdown ---
We could change that to add the file path after the ---
, but I only don't understands why it's a different behavior
Oh I see. We can actually intercept the hover and change it to how we want I think.
Oh, that'd be great
It looks like the same behavior between vs code and emacs, it's just slightly different spacing
Well.. I may hold off on intercepting + transforming, because this could break things if clojure-lsp changes what it sends later.
We can only intercept and change if it is very structured, right?
Yeah, not sure Calva change the markdown manually would be a good idea
I mean, I think we can intercept and change no matter what, but it wouldn't be a good idea unless structured
Yeah, it was future comparability I had in mind too.
Exactly
Maybe move on clojure-lsp to after the ---
can works good for both editors π
However, imo I think the doc string directly below the args with the path below the line at the bottom would look better.
^ yeah
It's quite simple to do that, this is the code: https://github.com/clojure-lsp/clojure-lsp/blob/master/src/clojure_lsp/feature/hover.clj#L46-L49 LMK if any of you want to take a look on that
Because how I see it now my brain is used to seeing doc string below the args, so it's like "oh what does this function do... jar:file:///...." o_O
Yeah I can make that change some time and have you review if that's fine with you
np, help is always very welcome π
This way we won't work on the same thing like yesterday π
yes! hahhaah
@ericdallo Is all of this code supposed to be in the hover? It seems it's including the first arity's implementation.
Also something to note is that when
is highlighted. I'm not sure it should be as it's not a link, and the doc string shouldn't be code highlighted I think.
Referring to the doc string, of course, lol
1. Yeah that's how it's implemented right now, we have a setting that IMO i prefer that is https://github.com/ericdallo/dotfiles/blob/master/.lsp/config.edn#L109 but for functions with multiple arity, this behave odd indeed 2. Hum, not sure what is the correct for the docs, with or without markdown
Yeah, I don't think it should be showing an implementation in the hover, odd indeed
Markdown is good for the doc string, but I don't see why it would be highlighting the word "when" if it's not code. But maybe some doc strings include code so it's necessary to wrap with clojure highlighting? Idk
> Yeah, I don't think it should be showing an implementation in the hover, odd indeed Oh, just realized that is showing the implementation, not the arity
I'll take a look on this late today
about the docstring on docs, if when
is highlighted it's because probably is wrapped with
you can debug the LSP response that returns markdown
textDocument/hover
response
Yeah, I'm aware. Must resist getting sidetracked π