Commit Graph

13 Commits

Author SHA1 Message Date
Slava Pestov
f7e39447a7 LookupVisibleDecls: Find generic parameters in methods inside extensions
The logic here had diverged from UnqualifiedLookup. One day we'll merge
the two, for now clean it up a bit to match.

Note that all generic parameters now have 'Reason' reported as 'Local'.
I don't believe this really matters.

Fixes <rdar://problem/20530021>.
2019-01-08 16:51:20 -05:00
Slava Pestov
7d33177b84 LookupVisibleDecls: Don't use getReasonForSuper() for members of protocols and superclass constraints on an archetype
Semantically, these are not superclass/refined-protocol members.
If I have a generic parameter <T : P & Q>, then when looking at
a value of type T, members of P and Q are at the same "level" as
if I had a value of type (P & Q).
2019-01-08 00:14:52 -05:00
Slava Pestov
7626eb1571 AST: Use getSelfTypeInContext() consistently in typo correction
We actually want to not use types at all here and instead refactor
this code to use the various decl-level requests instead... but for
now lets be consistent between typo corrections inside function
and type context.
2018-10-15 20:34:08 -07:00
Slava Pestov
4051246932 Merge pull request #16811 from AnthonyLatsis/code-compl-dup-restated-requirements
[CodeCompletion] Duplicate existential requirements when restated
2018-06-15 14:46:26 -07:00
fischertony
f3fed2e5b8 remove self completion from new test on type identifier 2018-06-12 18:07:04 +03:00
fischertony
9d5302e1eb [CodeCompletion] Remove 'self' from type identifier completions 2018-06-03 18:28:25 +03:00
fischertony
ede3ba207b [CodeCompletion] Duplicate existential requirements when restated 2018-05-24 03:54:05 +03:00
fischertony
ee4587f6cb added tests for failures & fixed the issue for subscript decls 2018-05-14 07:26:20 +03:00
fischertony
561ad16c22 [CodeCompletion][SR-7670] Duplicate generic param completions
fixed duplicate completions for generic parameters in non-generic members
this also fixed the SemanticContextKind for some tests
2018-05-13 13:00:46 +03:00
Ben Langmuir
46504db7a7 [code-completion] Partly fix completion of associatedtypes in where clauses
This gets us to the point where we will complete 'T' here:
    associatedtype T where #^A^#
And when completing here, we now at least find the correct declaration:
    associatedtype T: P where T.#^A^#

There is a remaining issue that in the second example we will not find
members of `P`; we seem to be missing the conformance from the archetype
we get for `T`.

rdar://problem/20582394
2017-08-01 14:16:03 -07:00
Ben Langmuir
534c0cc2cb [code-completion] Generic where clauses
Complete generic parameters and their members inside generic where
clauses on structs, classes, enums, extensions, typealiases, funcs,
subscripts and inits.

Still not handled correctly are associatedtypes.

rdar://problem/20582394
2017-07-31 09:57:00 -07:00
Dmitri Gribenko
d175b3b66d Migrate FileCheck to %FileCheck in tests 2016-08-10 23:52:02 -07:00
Xi Ge
0f4e7a5ea5 [CodeCompletion] Add code completion for where clauses. rdar://24245022
When completing at "extension A where #^HERE^#", we suggest the generic params of A to users.
2016-01-19 14:17:15 -08:00