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

Overloaded operator-> issue #99

Closed
mpajkowski opened this issue Oct 23, 2018 · 2 comments
Closed

Overloaded operator-> issue #99

mpajkowski opened this issue Oct 23, 2018 · 2 comments
Labels
client question Further information is requested

Comments

@mpajkowski
Copy link

mpajkowski commented Oct 23, 2018

Hi @MaskRay,

It seems that ccls doesn't take operator-> into consideration - it can be easy spotted when using smart pointers.

"|" indicates current cursor position.

#include <memory>

struct Dummy
{
  int a = 10;
};

auto main(int argc, char** argv) -> int
{
   auto pointer = std::make_unique<Dummy>();
   pointer->| 

   return 0;
}

Currently langserver provides completions for:

  • underlying type (aka Dummy) - which is good
  • std::unique_ptr class members - which is semantically incorrect.

Version:
Installed from AUR, ccls-git 1758.e101e478-1

Anyway, thanks for great tool, it improved my C++ development experience quite a lot :)

@MaskRay
Copy link
Owner

MaskRay commented Oct 23, 2018

If you use clang >= 7, FixIts are available in completion items (clang::CodeCompleteOptions::IncludeFixIts). I pushed a commit to deprioritize completion items with such AccessOpFixIt (. to -> and its converse)

I'm thinking if an initialization option is necessary.

If you use Emacs company-lsp, you probably want (setq company-transformers nil company-lsp-cache-candidates nil) to disable client-side sorting. (company-prescient cannot be used, etc)

@MaskRay MaskRay closed this as completed Oct 30, 2018
@MaskRay MaskRay added question Further information is requested client labels Dec 16, 2018
@MaskRay MaskRay reopened this Jan 16, 2019
@MaskRay
Copy link
Owner

MaskRay commented Feb 24, 2019

Fixed by #210

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants