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

@@ -119,6 +119,10 @@ namespace swift {
/// Should access control be respected?
bool EnableAccessControl = true;
/// Whether to include initializers when code-completing a postfix
/// expression.
bool CodeCompleteInitsInPostfixExpr = false;
/// Should we check the target OSs of serialized modules to see that they're
/// new enough?
bool EnableTargetOSChecking = true;

View File

@@ -147,6 +147,9 @@ def disable_access_control : Flag<["-"], "disable-access-control">,
def enable_access_control : Flag<["-"], "enable-access-control">,
HelpText<"Respect access control restrictions">;
def code_complete_inits_in_postfix_expr : Flag<["-"], "code-complete-inits-in-postfix-expr">,
HelpText<"Include initializers when completing a postfix expression">;
def disable_diagnostic_passes : Flag<["-"], "disable-diagnostic-passes">,
HelpText<"Don't run diagnostic passes">;