Commit Graph

12 Commits

Author SHA1 Message Date
Ben Barham
72fb01c0e1 [SymbolGraph] Generate symbol graphs for macro declarations 2023-02-16 17:59:29 -08:00
Holly Borla
f4b2b60446 [Macros] Enable global peer macros.
Global peer macro expansions are not injected into the AST. Instead, they
are visited as "auxiliary declarations" when needed, such as in the decl
checker and during SILGen. This is the same mechanism used for local property
wrappers and local lazy variables.
2023-02-14 16:24:25 -08:00
Doug Gregor
3b42b96db7 [Macros] Adjust whitespace for macro expansions that get returned 2023-02-13 16:08:28 -08:00
Doug Gregor
b882e0cb1e Add SourceKit support for expanding peer macros 2023-02-11 12:17:39 -08:00
Doug Gregor
a75b64e034 Add refactoring support for accessor macros 2023-02-11 11:23:28 -08:00
Doug Gregor
96380624db [SourceKit] Implement macro expansion for (some) attached macros.
Extend the macro-expansion refactoring to work with member and
member-attribute attached macros. These expansions can return several
different changes, e.g., adding new members, sprinkling member
attributes around, and so on.
2023-02-11 11:23:28 -08:00
Alex Hoppen
75771c1579 Merge pull request #63387 from ahoppen/ahoppen/macros-swift-5
[Macros] Compile Macros tests with swift-version 5 instead of swift-version 4
2023-02-07 09:16:44 +01:00
Richard Wei
01e4c8df26 [Macros] Use name lookup for lazy declaration macro expansion (#63411)
- Use the name lookup table instead of adding members from a macro expansion to the parent decl context.
- Require declaration macros to specify introduced names and used the declared names to guide macro expansions lazily.
2023-02-07 11:24:42 +08:00
Alex Hoppen
ba5a727983 [Macros] Compile Macros tests with swift-version 5 instead of swift-version 4 2023-02-04 11:10:08 +01:00
Doug Gregor
f78f5729c3 Start requiring expression macros to be marked with @expression 2022-12-22 09:18:05 -08:00
Alastair Houghton
da51c04116 Two of the macros tests are failing to import SwiftDiagnostics.
Disabling these for now, pending a fix.
2022-12-22 09:45:59 +00:00
Rintaro Ishizaki
9f137074af [SourceKit/Refactoring] Macro expansion
Add refactoring "Expand Macro" that expands macro expressions.

rdar://102739026
2022-12-06 16:20:07 -08:00