emacs-lsp / emacs-ccls

Emacs client for ccls, a C/C++ language server
200 stars 29 forks source link

Wrong completion items #54

Closed theFool32 closed 5 years ago

theFool32 commented 5 years ago

Hi, I'm using doom-emacs with (cc +lsp). The completion items seem mixed as below: image or image

I use a clean doom-emacs without extra configuration on macos. ccls is installed by brew.

I also try nvim with coc.nvim. Wrong completion items show up and flash into correct ones. I am new to emacs and have no idea about how to deal with it.

Thanks.

MaskRay commented 5 years ago

The completion items are correct. All of a, b and c are valid.

theFool32 commented 5 years ago

Why are they correct? v is vector<int> while completion items are from struct Abc

MaskRay commented 5 years ago

Sorry for my oversight. You typed a., deleted ., then added v. In that case, the stale completion cache will be reused. I have thought about false positives while adding the cache, but your case is convincing enough to justify a change. Fixed by https://github.com/MaskRay/ccls/pull/489