Skip to content
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

consult-lsp--file-symbols-candidates: No symbols #33

Closed
Peter-Chou opened this issue Sep 24, 2022 · 6 comments
Closed

consult-lsp--file-symbols-candidates: No symbols #33

Peter-Chou opened this issue Sep 24, 2022 · 6 comments

Comments

@Peter-Chou
Copy link

Peter-Chou commented Sep 24, 2022

when I run consult-lsp-file-symbols, it showed no symbols. but I got right infos with consult-imenu.

image

consult-lsp-file-symbols has a big advantage to consult-imenu due to the narrowing mechanism. I really hope this command could run as expected. thx.

@gagbo
Copy link
Owner

gagbo commented Sep 24, 2022

Hello,

It looks like your LSP server either hasn't been started, or that it cannot deal with the current file. consult-imenu only uses imenu, which is basically a regexp-based feature. The "No symbols" message means the LSP server didn't give any response to the documentSymbols request.

Cheers

@Peter-Chou
Copy link
Author

Peter-Chou commented Sep 24, 2022

@gagbo, thanks for the quick reply. I used pyright python language server and it works well with consult-lsp-symbols.

image

Does consult-lsp-symbols also use documentSymbols request? If so, consult-lsp-file-symbols should also works.

@gagbo
Copy link
Owner

gagbo commented Sep 26, 2022

No, there are 2 calls,

I didn't check the protocol in a while to see if it changed, but theoretically that should not be a problem, so somehow pyright doesn't want to answer the documentSymbols call it seems

@sebastiansturm
Copy link
Contributor

just today I noticed I'd get the same error (with a language server that definitely returned symbols), but in my case it was because consult-lsp--flatten-document-symbols doesn't respect lsp-use-plists. Can open a small PR the next few days though for my personal use I'd also have to change the default filtering because having all levels of symbols presented as a flat list seems overwhelming to me. (also, there was some error trying to invoke consult-lsp--file-symbols--transformer if symbols spanned multiple lines; in that case cend can be smaller than cbeg)

@gagbo
Copy link
Owner

gagbo commented Oct 19, 2022

All good points, it's indeed more likely that the heart of the issue is the use of lsp-use-plists, I forgot to check the code for compatibility, and the bug with cend < cbeg is also an issue because we try to use the same line for everything. Thanks for the report

@gagbo gagbo closed this as completed in c2ec2c5 Oct 19, 2022
@gagbo
Copy link
Owner

gagbo commented Oct 19, 2022

Both issues should be fixed now with the commit above ^. I also tagged it so eventually it'll also hit MELPA stable for the mad lads who trust it.

Don't hesitate to comment if that doesn't work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants