Page MenuHomePhabricator

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

Authored by sammccall on Fri, Nov 12, 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.Fri, Nov 12, 6:03 AM
sammccall requested review of this revision.Fri, Nov 12, 6:03 AM
kadircet added inline comments.Fri, Nov 12, 6:30 AM
clang-tools-extra/clangd/CodeComplete.cpp
468–469

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

511

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.Fri, Nov 12, 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
511

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.Sat, Nov 13, 10:31 AM
kadircet added inline comments.
clang-tools-extra/clangd/CodeComplete.cpp
511

thanks! yes that makes sense.

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