This is an archive of the discontinued LLVM Phabricator instance.

[CodeCompletion] Signature help for braced constructor calls
ClosedPublic

Authored by sammccall on Dec 27 2021, 11:42 AM.

Details

Summary

Implementation is based on the "expected type" as used for
designated-initializers in braced init lists. This means it can deduce the type
in some cases where it's not written:

void foo(Widget);
foo({ /*help here*/ });

Only basic constructor calls are in scope of this patch, excluded are:

  • aggregate initialization (no help is offered for aggregates)
  • initializer_list initialization (no help is offered for these constructors)

Fixes https://github.com/clangd/clangd/issues/306

Diff Detail

Event Timeline

sammccall created this revision.Dec 27 2021, 11:42 AM
sammccall requested review of this revision.Dec 27 2021, 11:42 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptDec 27 2021, 11:42 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript

Fix lldb build

Herald added a project: Restricted Project. · View Herald TranscriptDec 27 2021, 11:44 AM
sammccall edited the summary of this revision. (Show Details)

Revert some unintended changes, clean up tests.

sammccall updated this revision to Diff 396362.Dec 27 2021, 7:18 PM

Fix clangd tests.

nridge added a subscriber: nridge.Jan 1 2022, 4:56 PM
kadircet accepted this revision.Jan 3 2022, 10:36 AM

thanks, lgtm!

lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
995 ↗(On Diff #396362)

why not just drop the method? it is not pure, and no-op in base too.

This revision is now accepted and ready to land.Jan 3 2022, 10:36 AM
sammccall added inline comments.Jan 3 2022, 10:50 AM
lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
995 ↗(On Diff #396362)

That's a reasonable question, but it's not my code so IDK if it's a style thing.
(I was tempted to remove it but it seems gratuitous for this kind of change)

This revision was landed with ongoing or failed builds.Jan 3 2022, 11:15 AM
This revision was automatically updated to reflect the committed changes.