Commit Graph

8 Commits

Author SHA1 Message Date
Hamish Knight
52d8b36af4 [Completion] Suggest trivial trailing closures for macros
Follow the same logic as function decl completion and suggest a
trailing closure for trivial cases.

rdar://150550747
2025-05-22 11:16:10 +01:00
Hamish Knight
0f30a1ab35 [Completion] Handle body macro attribute completion
Add support for function-attached macros, and
complete body and preamble macros in those
positions.

rdar://130740590
2024-07-02 09:44:32 +01:00
Rintaro Ishizaki
fcaae5cc9b [CodeCompletion] Add fake type annotation to custom attributes
Macros and custom attribute types (i.e. `@resultBuilder`,
`@propertyWrapper`, and `@globalActor`) now have fake type
annotations. This would be useful to recognize which candidates are
actually usable in code completions after `@`.

rdar://109062582
2023-09-18 14:07:01 -07:00
Holly Borla
61e5811d73 [NFC] Update IDE, Index, ModuleInterface, and SourceKit tests to remove
conformance macros.
2023-07-19 12:38:52 -07:00
Alex Hoppen
c140fe480c [CodeCompletion] Only show type annotations for macros that return non-void
Showing the type annotation only makes sense if they are not `Void`. That’s consistent with functions where we also don’t show a `Void` return type. Most importantly, we shouldn’t be showing a `Void` type annotation for attached macros.

rdar://108870970
2023-05-04 18:02:26 -07:00
Alex Hoppen
01cebd68a8 [CodeComplete] Offer code completion for attached macro attributes
We need to teach code completion how to invoke the type checker for attached macro attributes. After that, everything started working.

rdar://105232015
2023-05-01 21:11:24 -07:00
Ben Barham
f7d1cc8426 [Completion] Add convertible type relation for attached macros
Resolves rdar://108678938.
2023-04-28 16:15:51 -07:00
Ben Barham
31dee1ce1c [Completion] Only provide macro completions when they are valid
Only return macros that are valid in their current position, ie. an
attached macro is not valid on a nominal.

Also return freestanding expression macros in code block item position
and handle the new freestanding code item macros.

Resolves rdar://105563583.
2023-04-07 18:43:06 -07:00