Commit Graph

10 Commits

Author SHA1 Message Date
Ben Langmuir
ce3c2de4a6 [CodeCompletion] Convert optionals when checking for literal protocol conformance
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
2016-03-08 09:39:04 -08:00
Ben Langmuir
a927dc8a5a [CodeCompletion] Hide literals that don't match the type context in SourceKit
If there is a type context, hide literal suggesetions that don't match
it, unless they are keywords and we have filtered to their names.

Incidentally fix an output buffering issue when combining filtering with
the -raw flag in complete-test.

Part of rdar://problem/23865118
2016-02-03 10:51:07 -08:00
Ben Langmuir
e75402e49e [CodeCompletion] Add image literal similar to color
Part of rdar://problem/23865118
2016-02-03 07:55:07 -08:00
Ben Langmuir
c33f2faad2 [CodeCompletion] Tweak literal suggestion text
For rdar://problem/23865118
2016-02-03 07:33:50 -08:00
Ben Langmuir
838131dd2f [CodeCompletion] Remove 0.0 suggestion
In practice things that are float literal convertible are also integer
literal convertible so this isn't pulling its weight.

Part of rdar://problem/23865118
2016-02-03 07:20:05 -08:00
Ben Langmuir
978267b09e [CodeCompletion] Fix source text inserted for literal completions
Put the right content into the placeholders. Embarassingly this wasn't
tested at all.

rdar://problem/23439483
2015-11-06 18:24:23 -08:00
Ben Langmuir
54a28a40db [CodeCompletion] Split literals out into their own completion kind
For rdar://problem/21923069

Swift SVN r32906
2015-10-27 13:34:54 +00:00
Ben Langmuir
880ef5e9fd [CodeCompletion] Add _ColorLiteralConvertible completion
For rdar://problem/21923069

Swift SVN r32891
2015-10-26 20:41:57 +00:00
Ben Langmuir
7fda8964db [CodeCompletion] Add several more literal completions
Go beyond the existing keyword completions to include more literal
suggestions: 0, 0.0, "text", [item], [key: value], (item, item)

For rdar://problem/21923069

Swift SVN r32890
2015-10-26 20:41:56 +00:00
Ben Langmuir
ba7db29113 [CodeCompletion] Add type relation to literals
So that e.g. `true` gets prioritizied in
    let x: Bool = <complete-here>

For rdar://problem/21923069

Swift SVN r32889
2015-10-26 20:41:55 +00:00