Add initializers to postfix-expr code completions

Previously, the only way to get initializers was completing after the
name of the type:
    Foo#^complete_here^#
    Foo(#^or_here^#

And now it will also work in unadorned expressions:
    #^a_top_level_completion^#
    bar(a, #^walked_into_a_bar^#

Unfortunately, not all our clients handle this well yet, so it's
protected by a language option.
    -code-complete-inits-in-postfix-expr

Swift SVN r27275
This commit is contained in:
Ben Langmuir
2015-04-14 14:54:08 +00:00
parent 03d393ef5c
commit f778836934
6 changed files with 194 additions and 5 deletions

View File

@@ -623,7 +623,10 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
Opts.EnableAccessControl
= A->getOption().matches(OPT_enable_access_control);
}
Opts.CodeCompleteInitsInPostfixExpr |=
Args.hasArg(OPT_code_complete_inits_in_postfix_expr);
if (auto A = Args.getLastArg(OPT_enable_target_os_checking,
OPT_disable_target_os_checking)) {
Opts.EnableTargetOSChecking