Alex Hoppen
788c9f6fbf
Merge pull request #63857 from ahoppen/ahoppen/solution-specific-var-types
...
[IDE] Set solution-specific variable types as interface types
2023-03-08 08:30:55 -08:00
Alex Hoppen
614679f73d
[IDE] Set solution-specific variable types as interface types
...
Setting the interface type of a variable, just to reset it to a null type is actually really gross. But quite a few methods further down in the generation of code completion results (such as USR generation) need to get a variable’s type and passing them along in a separate map would be really invasive. So this seems like the least bad solution to me.
2023-03-07 17:48:41 -08:00
Hamish Knight
54c2fbf6f3
[CS] NFC: Add Solution::getTargetFor
2023-03-07 15:16:34 +00:00
Hamish Knight
2976edbe20
[CS] Rename SolutionApplicationTarget -> SyntacticElementTarget
2023-03-06 20:54:06 +00:00
Alex Hoppen
470dcde915
[CodeCompletion] Don't show call pattern completions for overridden functions
2023-02-22 22:33:42 +01:00
Alex Hoppen
390d7a6882
[CodeCompletion] Compute type relations for the function calls selected by ArgumentCompletion
2023-02-22 22:33:40 +01:00
Alex Hoppen
f4986f9b3e
[CodeCompletion] Don't consider calls to initializers on metatypes in argument completion
2023-02-22 22:31:08 +01:00
Alex Hoppen
062eccbbbb
[CodeCompletion] Hide underscored code completion results in argument completion
2023-02-22 22:31:08 +01:00
Alex Hoppen
16af937919
Merge pull request #63515 from ahoppen/ahoppen/look-through-optional
...
[CodeCompletion] Look through optional when determining the function type of a called overload
2023-02-17 17:24:19 +01:00
Alex Hoppen
754e9d7d54
[CodeCompletion] Fix issue when completing inside a switch in a closure
2023-02-14 09:40:56 +01:00
Alex Hoppen
5d986ecdc6
[CodeCompletion] Look through optional when determining the function type of a called overload
...
rdar://97339983
2023-02-08 17:30:02 +01:00
Alex Hoppen
1fb439382e
[IDE] Move getSelectedOverloadInfo to be a function on Solution
...
We will need this for solver-based cursor info.
2022-12-05 23:52:04 +01:00
Doug Gregor
248b72bbff
Track the pre-adjusted "reference" type for declaration reference.
2022-06-30 17:00:32 -07:00
Alex Hoppen
11266ebb25
[CodeCompletion] Look through @dynamicMemberLookup key path functions
...
This enables us to provide proper code completion for the function that is being referenced by the dynamic key path.
rdar://79092371
2022-05-08 12:58:24 +02:00
Alex Hoppen
2d7dbd3f4e
[CodeCompletion] Check if type is function before making call pattern suggestions
2022-03-25 10:42:08 +01:00
Alex Hoppen
080410521c
[CodeCompletion] Don't fail in ArgumentCompltion if no overload was found
2022-03-25 10:42:08 +01:00
Alex Hoppen
2392117a2d
[CodeCompletion] Record solution-specific variable types in argument completion
...
We are doing global completion for function arguments, so we should also record the variable types determined by the solution.
2022-03-25 10:42:08 +01:00
Alex Hoppen
f2230502e4
[CodeCompletion] Compute semantic context based on where the called fucntion is defined
2022-03-25 09:36:06 +01:00
Alex Hoppen
237376b980
[CodeCompletion] Call into simplifyTypeImpl when simplifying a type for code completion
...
This makes sure we e.g. resolve dependent member types after we perform type variable to generic parameter substitutions for code completion
2022-03-25 09:36:05 +01:00
Alex Hoppen
95d39842a9
[CodeCompletion] Don't record solution results twice in ExprCompletion
...
This fixes a performance problem where we were sometimes reporting >1000 solutions but all the relevant parameters of the result were equal.
2022-03-24 09:11:39 +01:00
Alex Hoppen
3597652960
[CodeCompletion] Make sawSolution non-final and override sawSolutionImpl from subclasses
...
This eliminates a source of bugs if subclasses of `TypeCheckCompletionCallback` forget to call the superclass’s implementation of `sawSolution` from their overridden method.
2022-03-21 23:41:26 +01:00
Alex Hoppen
03d819f442
[CodeCompletion] Check whether surrounding context supports async in all solver-based completion kinds
2022-03-21 20:04:32 +01:00
Alex Hoppen
17eb6ea1a2
[CodeCompletion] Unify logic to retrieve completion expr type for all completion callbacks
2022-03-21 20:04:32 +01:00
Alex Hoppen
e2a62f1a60
[CodeCompletion] Migrate expression completions to solver-based
2022-03-21 13:00:33 +01:00
Alex Hoppen
f538d33e5f
[CodeCompletion][Sema] Migrate CallArgurment position completion to the solver-based implementation
...
This hooks up call argument position completion to the typeCheckForCodeCompletion API to generate completions from all the solutions the constraint solver produces (even those requiring fixes), rather than relying on a single solution being applied to the AST (if any).
Co-authored-by: Nathan Hawes <nathan.john.hawes@gmail.com >
2022-03-17 15:15:54 +01:00