-
Notifications
You must be signed in to change notification settings - Fork 200
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
"[eglot] cannot (yet) provide reliable completion table for LSP symbols" #506
Comments
Well, the message is telling you how it is! :-D LSP doesn't allow this, and Eglot can't do anything about it. @dgutov is aware of this, I think. |
OK, to be fair, it doesn't allow a reliable way to do this. There are some ugly workarounds, but they don't work like normal |
I see. Is there any way to just make it not fail there, so I can just type any identifier (without completions)? Perhaps this isn't an eglot question but more an xref question, for @dgutov perhaps. |
Eglot doesn't have anything reasonable or consistent to do with whatever you type there, so it's best that it fails. I understand the frustration, though. Curiously, this is closely related to an issue opened just now too, #507. That is requesting the same but for documentation, not definition. As I said, there are some workarounds like a |
I see -- you're saying the LSP server can only look up definitions for an identifier in the document, but has no way to look up a string. Sad, but makes sense I guess. |
Let's reopen this: a recent development in LSP 3.15 is the opening I have been waiting for: See microsoft/language-server-protocol#1033 Now the hard work has to be done. Make a completion table based on |
I've actually been meaning to suggest this. But there are pitfalls. Not every LS supports it, and when they do, support varies. For instance, In any case, something would still need to be done if the server doesn't support this capability. |
This is the story of LSP. There are normally "capability" flags to control this, but I haven't checked here. It should allow us to carefully support incrementally and gracefully degrade. We should find a "good" server that implements this fully and perfectly and a "crappy" server that doesn't :-) |
Try |
The new specification seems to be propagating nicely: |
@dgutov: If you want to propose changes to Eglot to support this, go ahead. I don't have time to tackle this particular problem right now. You can of course propose changes to
We must still somehow acommodate for the fact that the "identifier at point" may simply in the space that |
If I get to it, when I get to it. Not right this moment either, sorry. Just collecting the relevant information here.
Of course. But that's something the user will be made aware of through practice: not all symbols are available. "Why?" "You can ask the authors of the language server you are using". The main difficulty is defining a symbol completion table that allows choosing the symbol at point (and retains the info that it's not just an arbitrary symbol), or any symbol from |
As an alternative, would it be possible for xref.el (and/or eglot) to fall
back to a manually constructed tags table? Just a suggestion.
…On Wed, Jul 1, 2020 at 4:29 PM Dmitry Gutov ***@***.***> wrote:
If you want to propose changes to Eglot to support this, go ahead. I don't
have time to tackle this particular problem right now.
If I get to it, when I get to it. Not right this moment either, sorry.
Just collecting the relevant information here.
We must still somehow acommodate for the fact that the "identifier at
point" may simply in the space that workspace/symbol gives us. So M-. for
arbitrary identifiers is still out, I think.
Of course. But that's something the user will be made aware of through
practice: not all symbols are available. "Why?" "You can ask the authors of
the language server you are using".
The main difficulty is defining a symbol completion table that allows
choosing the symbol at point (and retains the info that it's not just an
arbitrary symbol), or any symbol from workspace/symbols.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#506 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABCFRYB2EPJO7OX6PTS6U3RZOMDJANCNFSM4OHIQGDA>
.
--
Gary Oberbrunner
Founder & CEO
Dark Star Systems, Inc <https://darkstarsystems.com>.
|
Something like that, yes. If you're into |
Okay I've recently been experimenting with consult-lsp and I've adapted it to work with eglot as well. It uses the same Also could you open the wiki so that I can share my Also here's a screenshot because asciinema doesn't do justice to true color terminals. |
@dgutov is the xref expert and maintainer. You can work with him to recover context in this issue and try to solve it according to #506 (comment) |
That's what it is indeed, but may be a bit dry for beginners. @mohkale make sure you understand the problem first and then look at Eglot's existing xref backend. Then maybe try to write (failing) automatic tests for what you'd want to do with the new thing. Then show those tests. If we agree on the spec, you work to make them pass. |
I'm using latest eglot, and when I do
C-u M-x xref-find-definitions
, which normally (without eglot) prompts for a symbol to find definitions for, instead I get this error message: "[eglot] cannot (yet) provide reliable completion table for LSP symbols", and then it returns to toplevel so I can't search for my desired symbol.Here's the backtrace:
The text was updated successfully, but these errors were encountered: