You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
eglot with ccls: M-. can only find and jump to func definitions if they are in buffers #663
Hi all,
I'm excited that eglot+ccls works for my C project (linux kernel). It's much more convenient than TAGS, but after a while I found it fails to find func definitions that is not in current buffer, or not in other buffers (opened C/header files).
I commented out projectile functions, otherwise emacs reports error that projectile-project-root is void.
According to ccls eglot doc:https://github.com/MaskRay/ccls/wiki/eglot), ccls defaults to use builtin project, so I think it probably doesn't matter.
I googled a lot, still fails to solve the problem. Am I missing something? Please help give some directions:-) Thanks!
I believe this is a problem with ccls and @MaskRay could help you with that. As an Eglot issue, this is missing many elements pointed to by the template that you probably deleted. I've reworked that template: if you try to create a new issue in Eglot you should be presented with more clear instructions on how to make an issue that I can help you with. It'll help you find the Events transcript and other important elements. Until then, I'm going to close this one, but we can keep discussing.
The likely issue is that you do not provide a compile_commands.json/.ccls so ccls does not know the initial set of files to index.
If neither compile_commands.json nor .ccls is provided, ccls can only find cross references for files where textDocument/open has been sent.
That seems like a usage error, unrelated to eglot.
Activity
joaotavora commentedon Apr 12, 2021
I believe this is a problem with ccls and @MaskRay could help you with that. As an Eglot issue, this is missing many elements pointed to by the template that you probably deleted. I've reworked that template: if you try to create a new issue in Eglot you should be presented with more clear instructions on how to make an issue that I can help you with. It'll help you find the Events transcript and other important elements. Until then, I'm going to close this one, but we can keep discussing.
MaskRay commentedon Apr 12, 2021
The likely issue is that you do not provide a
compile_commands.json/.cclsso ccls does not know the initial set of files to index.If neither
compile_commands.jsonnor.cclsis provided, ccls can only find cross references for files wheretextDocument/openhas been sent.That seems like a usage error, unrelated to eglot.
joaotavora commentedon Apr 12, 2021
Thanks @MaskRay.
renzhengeek commentedon Apr 13, 2021
@joaotavora Thanks! Will try @MaskRay 's suggestion later:-)
renzhengeek commentedon Apr 13, 2021
Hello @MaskRay ,
I'm very new to eglot and ccls. Is there any link to explain what they are and how to configure/make them?
Thanks! But, I do follow the doc: https://github.com/MaskRay/ccls/wiki/eglot
renzhengeek commentedon Apr 14, 2021
https://github.com/MaskRay/ccls/wiki/Project-Setup#ccls-file
renzhengeek commentedon Apr 22, 2021
See: https://github.com/MaskRay/ccls/wiki/Project-Setup#ccls-examples
The
.cclsconfig solves my problem:Thanks!