[Bug] Completions loaded from cache after file save.
I have this problem since I installed EasyClangComplete. Here's an example:

the weird thing is that after change test to ::test the completion is work very well

Ok, I know the reason. It should be easy to fix too. We cache the completions in a specific position of the document. We just need to invalidate this cache on file save.
To make sure you understand my problem, here's Xcode version of my first gif:

Yep, I totally understand the issue. I hope I will have the time to fix this during this week. It should not be too hard.
Ugh. It appeared to be harder than I expected. I have changed what I assumed was the error, but it seems that in case of the completion being triggered by " " or in case of "autocomplete_all": true libclang does not do a proper job at completing.
I invalidate the cache on file save just to be sure, but libclang generates the completions with old function nevertheless. The strange part is that it generates correct completions if I trigger them with "." or "->".
I have no idea why this happens for now... :confused:
UPD: I think I will have to put it in the backlog for now. Fixing something that is wrong inside of libclang is definitely out of score for me for now. :(
The only way I see to fix this is to invalidate the whole translation unit, forcing it to be parsed as opposed to being reparsed only. The problem with this is that it takes twice the time and as it only happens when there is no trigger before the input, I would just leave this as it is now.
So the problem fixed??
Nope. Unfortunetely not. But it is unfixable at this point as it comes from libclang itself and not from the plugin.
But why some IDE like Xcode doesn't have this problem ?
I don't really know. I should probably keep this issue open though.
What I am sure of is that the completions come from libclang itself. Just the way they do when I complete with a dot, but they don't get updated properly.
I have an idea, maybe you can just add an command to tell ECC check every function, if have any function modified, then reload the completion of that function.
Or reload all completion when file save.
I will look into the atom's plugin, thanks for reference. As for your suggestions that is essentially what I thought. I thought, that we skip interfacing with libclang at all when this happens, so I thought that reloading all completions would help. It doesn't as it is libclang that gives us the wrong completions. I have one more idea on what we can do, but I don't expect too much as it should work as it is.
The plugin you refer to in Atom does not use libclang. It uses clang and parses the output from it. The bug seems to be related to the upstream of libclang. I will try to create a minimal example to submit a bug report there. There is really nothing else I can do now.
There is a workaround I can suggest - add a quick panel action to hard clean the translation unit. This can take some time if your code is heavy on headers and will take roughly twice the time needed for a reparse of the translation unit on save. Would you need this functionality?
Yes.
Ok, will happen soon.
So It could be twice slower, right?
I will add an option that will be callable through Ctrl+Shift+P called smth like "Hard Reparse". It will essentially delete current translation unit and will recreate it. This way you will get the proper completions when completing after a space. It will take twice the time of an ordinary reparse that is currently done on file save.
Okay, I get it.
Here's more example:
EasyClangComplete:

In the case, completion all work well when file saved, but it should be work well without file saving.
Xcode:

