This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Fix function-arg-placeholder suppression with macros.
ClosedPublic

Authored by sammccall on Nov 12 2021, 6:03 AM.

Details

Summary

While here, unhide function-arg-placeholders flag. It's reasonable to want and
maybe we should consider making it default.

Diff Detail

Event Timeline

sammccall created this revision.Nov 12 2021, 6:03 AM
sammccall requested review of this revision.Nov 12 2021, 6:03 AM
kadircet added inline comments.Nov 12 2021, 6:30 AM
clang-tools-extra/clangd/CodeComplete.cpp
476

while here, i suppose we should perform drop arguments and parentheses magic for macros as well?

517

again while here, maybe introduce constructors into this condition. (Even better, what about a bool isFunctionLikeCompletion(const CompletionItem&) that we can use both here and above?)

sammccall updated this revision to Diff 386873.Nov 12 2021, 9:32 AM
sammccall marked 2 inline comments as done.

Address review comments.
While here, condense some long comments that repeated the code and seemed confusing.

clang-tools-extra/clangd/CodeComplete.cpp
517

Done, though I didn't want to extract the variable too far away as there are some wrinkles (macros may not be function-like, template args...) that we can get away without resolving here.

kadircet accepted this revision.Nov 13 2021, 10:31 AM
kadircet added inline comments.
clang-tools-extra/clangd/CodeComplete.cpp
517

thanks! yes that makes sense.

This revision is now accepted and ready to land.Nov 13 2021, 10:31 AM