We generally don't want to override unavailable methods. We already
filter out unavailable decls when completing values, but that's in a
separate visible decl consumer.
rdar://problem/25058233
With the tests updated to account for not having the correct behaviour
for brace-stmt items from after the code-completion point. That part
turns out to be harder to fix.
This reverts commit a5325e6281.
Except for nil literals, we don't want to look at the optional itself,
since the typechecker would implicitly look to the underlying type.
rdar://problem/24707210
We don't want to prioritize the type name for protocols, since they
can't be used (generally) to construct an instance of the type. Ideally
we would prioritize types that conform to the protocol.
For rdar://problem/24873625
for i in <here> // should *not* show 'i'
for i in ... where <here> // should show 'i'
for i in ... { <here> // should show 'i'
Part of rdar://problem/24873625
The three varieties of 'pending callbacks' made it hard to reason about
how callbacks would be presented to subclasses of ASTPrinter. I
recently added new callbacks that would have made this even more complex
to deal with.
Luckily, it turns out they weren't buying us much, and simply forcing
any pending newlines and indentation to be printed ahead of making
callbacks was almost identical to the old behaviour. One complication is
that we now need to check for clang doc comments up front so we will
emit a newline in the right place.
This also incidentally fixed a bug in Loc vs Decl callback order.
Try to match the original spelling of static/class in diagnostics and
when printing the AST. Also fixes cases with
PrintOptions.PrintImplicitAttrs = false, where we would just print
'class', which was not valid code.
This reverts commit 2262bd579a.
This information isn't necessary for field descriptor lookup,
after all. It's only the fields that need to have generic information,
which is already in the field descriptor.
Previously, the mangling didn't include generics, but these are
needed to key off of the new field descriptor metadata, as well
as to construct type references for the nominal type.
When the LHS is an lvalue/assignable tuple and there is no leading
sequence of binary expressions.
It's a bit hacky right now since we don't have a good way to
differentiate general pattern completions from builtin operators.
rdar://problem/23209683
Start threading all keyword (and contextual keyword) printing through
printName, and add a new PrintNameContext for keywords. For now we just
pass this through without changing behaviour.
Also add an operator<< for printing from the tok:: kind for keywords,
which makes it much more convenient for performing the required
callbacks.
rdar://problem/24292226
As the initial step, we remove any synthesized extensions requiring a tuple's conforming to nominals, which
never happens. This will remove multiple useless synthesized extensions for Dictionary.
The swift_name string format now supports "getter:" and "setter:"
prefixes to indicate that a function is the getter or setter of a
Swift-synthesized property. Start parsing these DeclNames and make
sure they're reflected in the Swift name lookup tables.
[Clang update required]
A swift_name attribute on a global declaration can specify a dotted
name (e.g., SomeStruct.member) to map that global into a member of the
(Swift-)named type. Handle this mapping in DeclName parsing, plumb it
through importFullName, and cope with it in the Swift name lookup
tables (tested via the dump) and importing into a Swift DeclContext
(as-yet-untested). Part of SE-0033.
Variables bound in the case item pattern should be available inside the
case body and in the where clause, but not elsewhere within the
statement (e.g. other case items). The added accessor
CaseStmt.getLabelItemsRange() is needed to be able to determine the
difference between a completion location after a colon and one where
the colon doesn’t exist (in both cases this would be in the — implicit
— body statement range).