-
Notifications
You must be signed in to change notification settings - Fork 201
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
more expansive help? #507
Comments
First of all, let me say what an exquisitely beautiful Emacs. I am working on significant enhancements for the documentation capabilities of Emacs Unfortunately, there doesn't seem to be such a thing in the language server protocol (LSP) itself as "get me the documentation for this arbitrary identifier that I provide". It is very much the same with the "find definition" scenario, works very much like "find me that thing at point". There is no such thing at the present (unless I'm mistaken and they added it to the spec). |
Why thank you very much 😀. Hmmm... that's a shame, well I don't really need a list of all symbols. Is there some way to use completion instead here with ivy? ivy has support for using a For example, if I run
I choose Does that seam more reasonable? I'm slightly concerned that the S.N. seriously... eldocs gonna get even better 😲. Looking forward to that 👍. |
can you point me to the definition of this function? I doubt it's using much more than a hack , though. |
Also read #506 for a very similar discussion, but based on finding definitions. |
Sorry that was all just hypothetical. I'll try implementing it to see if it's possible. |
I think you'll bump into 2 distinct problems in the LSP protocol (this is all in a "as far as I remember" basis, I haven't looked over the spec in some time, unfortunately).
|
well that second point clinches it, that's a shame. I don't really see any workaround for that. 😭. |
You should go into the LSP repo and complain or suggest alternatives. I was looking at https://microsoft.github.io/language-server-protocol/specification#textDocument_documentSymbol, but it doesn't really do waht you want. Eglot uses it to feed Imenu, which isn't bad. Explore the repo it here, https://github.com/microsoft/language-server-protocol, particularly its issues. If there's no issue yet requesting this feature, open one yourself. |
Dang! spooky 👻 , that makes it 3
Good idea. THough you could also add to that very issue, IMO |
Make a new issue. I see they added something recently that could be seen as a decisive fix to the find definition problem. Maybe there's something for the doc too. |
I landed here while searching for a solution to this. I think the current solution is to run |
@apiraino I think you might be misinterpreting what this issue was asking for. We already had a doc-buffer (before eglot specific, now through eldoc) when I raised this issue. The intention was to have a sort of search engine for lsp symbols that could bring up documentation on demand. Something like workspace/symbols but instead of jump to definition it gives you the documentation buffer for that symbol. I also mention wanting to support eldoc in doc-buffers so you could do |
I've also noticed recently the disappearance of I'm currently the function below, in case it could be useful to others (/cc @mohkale @apiraino ): (defun ers/eglot-help-at-point ()
(interactive)
(let* ((response (jsonrpc-request
(eglot--current-server-or-lose)
:textDocument/hover (eglot--TextDocumentPositionParams)))
(doc-details (eglot--format-markup (plist-get response :contents))))
(set-buffer (get-buffer-create "*EGLOT_HELP*"))
(let ((inhibit-read-only t))
(erase-buffer)
(insert doc-details)
(goto-char (point-min)))
(view-mode 1) ;; good enough for now...
(display-buffer "*EGLOT_HELP*"
'(display-buffer-in-side-window . ((side . bottom) (window-height . 5))))))
(define-key eglot-mode-map (kbd "C-c l .") #'ers/eglot-help-at-point) Often I'm just reading the signature, so I'm immediately invoking |
Write commands that rely on Eglot internals at your own risk. If I'm reading your judgement of Note that you can use |
I did read briefly those
Screenshot of eldoc-doc-buffer
Screenshot of custom function |
Seems like your language server is returning a useless |
I did also previously tried Indeed, it could be an issue with the language server itself ( |
That doesn't make sense to me. Can you confirm that |
I did verify, I wasn't even aware about On an other note (positive/constructive one), I'm glad to report that your assumptions about the LSP server were correct.
|
I'm still intrigued about the previous problem, but I guess it doesn't matter now that the problem is solved 👍 |
Should this issue be closed? |
probably. Let's close it |
Is there any way to get more help about an identifier or type from eglot. For example, say I've got the following rust code.
If I hover over the
open
method eglot shows some type assistance in the minibuffer.If I run
eglot-help-at-point
eglot will pop open a buffer with some more documentation about theopen
method, but what if I wan't to get the docstring or information about the return type, or one of the argument types. What I've been doing so far is manually typing out the type of what I want to know more about just to then calleglot-help-at-point
on it.I'd prefer a function like
eglot-query-identifier
which displays all known types, values or anything for which we have documentation and lets me select one of them to view the doc of. Is this possible or is there another way to get at this information.Also is it possible to associate eglot help buffers with the underlying lsp server. Then I can hover over types in the documentation and run
eglot-help-at-point
on them, saving me the need to type them out. Such as here I have to return to my file buffer just to get back to finding more documentation.The text was updated successfully, but these errors were encountered: