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

symbols from newly included header not showing #190

Closed
Aayush04 opened this issue Jan 4, 2019 · 3 comments
Closed

symbols from newly included header not showing #190

Aayush04 opened this issue Jan 4, 2019 · 3 comments

Comments

@Aayush04
Copy link

Aayush04 commented Jan 4, 2019

After staring ccls server if i include a new header in the file then i am unable to find symbols from this newly included header but i can find symbols from the headers which are already included while starting ccls server.

Detailed Description:
I am using ccls lsp with monaco-language client (https://github.com/TypeFox/monaco-languageclient ). Running the ccls server as

ccls --init='{"cacheFormat":"json", "index": {"onChange": true, "trackDependency":2}}'

and project structure is:

MyProject/
MyProject/Script.cpp
MyProject/.ccls

.ccls file content is:

%clang
%c -std=gnu11
%cpp -std=gnu  14
%objective-c %objective-cpp -DGNUSTEP
%c %cpp -DFOO
-pthread

# Includes
-I/usr/include/
-I/usr/local/include/

Script.cpp file content is:

#include<stdio.h>
#include<math.h>

int main( )
{
    printf ( "Hello World");
}

Now, i can able to get function from math.h library for autoCompletion in editor. But if add a new header like string.h in my file. I am unable to get autoCompletions like for function strcmp() .

On running ccls server it is also creating cache files in directoryMyProject/.ccls-cache And on adding string.h in my file, index file for this also getting created in directoryMyProject/.ccls-cache but still autoCompletion not working for this. That is I am unable to get any symbol or funcitons from string.h library in textDocument/completion result.

ls /home/workspace/MyProject/.ccls-cache/\@\@home\@workspace\@MyProject/ | grep string.h
@usr@[email protected]
@usr@[email protected]
@home@lsp@ccls@Release@clang llvm-7.0.0-x86_64-apple-darwin@include@c  @[email protected]
@home@lsp@ccls@Release@clang llvm-7.0.0-x86_64-apple-darwin@include@c  @[email protected]

@MaskRay, Any idea what I am doing wrong here?

@MaskRay
Copy link
Owner

MaskRay commented Jan 7, 2019

Is this issue a duplicate of #191 ? I think this is a misconfiguration on Mac OS X but I don't use Mac thus cannot verify.

@Aayush04
Copy link
Author

Is this issue a duplicate of #191 ? I think this is a misconfiguration on Mac OS X but I don't use Mac thus cannot verify.

I think it's not. As autocompletion working properly while including the header. But symbols or methods from this newly added header are not coming on hitting ctlr space.
Same problem coming when i installed all this in ubuntu docker container. So, this should not an issue with Mac OS X.

@MaskRay
Copy link
Owner

MaskRay commented Jan 13, 2019

I was aware of the issue (imprecise preamble), saving the document would bring the preamble up to date. Language clients may cache completion results (coc.nvim company-lsp ...) thus I choose to rebuild preamble in the CompletionMain if it gets stale to avoid inaccurate results.

May I ask you to do me a favor? Could you please add a wiki page below Editor Configuration about Monaco?

MaskRay added a commit that referenced this issue Jan 15, 2019
Fix #190

If a new header is added, the preamble size changes. Language clients may cache completion results, thus we rebuild preamble to avoid inaccurate results.
MaskRay added a commit that referenced this issue Jan 15, 2019
Fix #190

If a new header is added, the preamble size changes. Language clients may cache completion results, thus we rebuild preamble to avoid inaccurate results.
MaskRay added a commit that referenced this issue Jan 15, 2019
Fix #190

If a new header is added, the preamble size changes. Language clients may cache completion results, thus we rebuild preamble to avoid inaccurate results.
MaskRay added a commit that referenced this issue Jan 27, 2019
Fix #190

If a new header is added, the preamble size changes. Language clients may cache completion results, thus we rebuild preamble to avoid inaccurate results.
MaskRay added a commit that referenced this issue Mar 18, 2019
Fix #190

If a new header is added, the preamble size changes. Language clients may cache completion results, thus we rebuild preamble to avoid inaccurate results.
MaskRay added a commit that referenced this issue Oct 24, 2019
Fix #190

If a new header is added, the preamble size changes. Language clients may cache completion results, thus we rebuild preamble to avoid inaccurate results.
MaskRay added a commit that referenced this issue Oct 24, 2019
Fix #190

If a new header is added, the preamble size changes. Language clients may cache completion results, thus we rebuild preamble to avoid inaccurate results.
MaskRay added a commit that referenced this issue Oct 24, 2019
Fix #190

If a new header is added, the preamble size changes. Language clients may cache completion results, thus we rebuild preamble to avoid inaccurate results.
MaskRay added a commit that referenced this issue Oct 24, 2019
Fix #190

If a new header is added, the preamble size changes. Language clients may cache completion results, thus we rebuild preamble to avoid inaccurate results.
MaskRay added a commit that referenced this issue Oct 24, 2019
Fix #190

If a new header is added, the preamble size changes. Language clients may cache completion results, thus we rebuild preamble to avoid inaccurate results.
MaskRay added a commit that referenced this issue Oct 24, 2019
Fix #190

If a new header is added, the preamble size changes. Language clients may cache completion results, thus we rebuild preamble to avoid inaccurate results.
MaskRay added a commit that referenced this issue Oct 24, 2019
Fix #190

If a new header is added, the preamble size changes. Language clients may cache completion results, thus we rebuild preamble to avoid inaccurate results.
MaskRay added a commit that referenced this issue Oct 24, 2019
Fix #190

If a new header is added, the preamble size changes. Language clients may cache completion results, thus we rebuild preamble to avoid inaccurate results.
MaskRay added a commit that referenced this issue Oct 24, 2019
Fix #190

If a new header is added, the preamble size changes. Language clients may cache completion results, thus we rebuild preamble to avoid inaccurate results.
MaskRay added a commit that referenced this issue Oct 24, 2019
Fix #190

If a new header is added, the preamble size changes. Language clients may cache completion results, thus we rebuild preamble to avoid inaccurate results.
MaskRay added a commit that referenced this issue Oct 24, 2019
Fix #190

If a new header is added, the preamble size changes. Language clients may cache completion results, thus we rebuild preamble to avoid inaccurate results.
MaskRay added a commit that referenced this issue Oct 24, 2019
Fix #190

If a new header is added, the preamble size changes. Language clients may cache completion results, thus we rebuild preamble to avoid inaccurate results.
MaskRay added a commit that referenced this issue Oct 24, 2019
Fix #190

If a new header is added, the preamble size changes. Language clients may cache completion results, thus we rebuild preamble to avoid inaccurate results.
MaskRay added a commit that referenced this issue Oct 25, 2019
Fix #190

If a new header is added, the preamble size changes. Language clients may cache completion results, thus we rebuild preamble to avoid inaccurate results.
MaskRay added a commit that referenced this issue Oct 25, 2019
Fix #190

If a new header is added, the preamble size changes. Language clients may cache completion results, thus we rebuild preamble to avoid inaccurate results.
MaskRay added a commit that referenced this issue Nov 10, 2019
Fix #190

If a new header is added, the preamble size changes. Language clients may cache completion results, thus we rebuild preamble to avoid inaccurate results.
MaskRay added a commit that referenced this issue Apr 22, 2020
Fix #190

If a new header is added, the preamble size changes. Language clients may cache completion results, thus we rebuild preamble to avoid inaccurate results.
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

2 participants