-
Notifications
You must be signed in to change notification settings - Fork 274
always use complete path as index lookup #304
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
Conversation
|
Adding |
a728086 to
5e15f51
Compare
This is a stacktrace to a FindOrFail when it is looking for the "friendly" non-absolute pathname. The lookup fails because the "full" filename was used to index the file. I can do additional logging or more breakpoints as needed note: /home/s4c5 is a symlink to a more convoluted gpfs pathname |
|
Hm... this might be the same problem I'm seeing with issue #242 (still happening as of this past weekend although I totally understand why you closed it given that I've not had anything useful to say). I just realized that my Git repository path contains a symlink to a different location. Maybe I'll try without that and see if I still get the same behavior. |
| // use this opportunity to get full path | ||
| char *rpbuf = NULL; | ||
| std::string fullpath; | ||
| rpbuf = realpath(path.c_str(), NULL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would say that since project is based on c++17 it worth to use std::filesystem
|
You can see evidence of the problem if you look in the .ccls-cache directory in your project. |
It'd be worth a try. I haven't tracked down where the two different path versions are coming from. I suppose its possible that the client itself references the file by different pathnames at various times when communicating with ccls, in which case ccls would still need to normalize the two paths. |
|
See my updated comment in #304 (comment)
It'd be better if you clearly state which is the real path and which is the symlink. |
a22044a to
925ef82
Compare
|
Superseded by #314 |
When using ccls from emacs LSP, I would constantly get "not indexed" errors.
The source code being indexed is on a GPFS filesystem that has a "friendly" pathname, and the actual (more convoluted) gpfs pathname.
ccls would index the file under the convoluted pathname, then try to retrieve it using the friendly pathname, resulting in constant "not indexed" errors. By forcing ccls to use the full pathname with this patch, it will always uses the same key to reference the source code index, and always gets the correct result.
ccls was completely borken for me and with this patch it is working flawlessly. I would guess that this multiple-pathname problem would also be an issue for anyone with symlinks in their projects, this patch should fix those cases as well.