mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[SourceKit] Add macro expansion support for conformance macros
This commit is contained in:
@@ -8549,6 +8549,14 @@ getMacroExpansionBuffers(MacroDecl *macro, const CustomAttr *attr, Decl *decl) {
|
||||
allBufferIDs.append(bufferIDs.begin(), bufferIDs.end());
|
||||
}
|
||||
|
||||
if (roles.contains(MacroRole::Conformance)) {
|
||||
if (auto nominal = dyn_cast<NominalTypeDecl>(decl)) {
|
||||
auto bufferIDs = evaluateOrDefault(
|
||||
ctx.evaluator, ExpandConformanceMacros{nominal}, { });
|
||||
allBufferIDs.append(bufferIDs.begin(), bufferIDs.end());
|
||||
}
|
||||
}
|
||||
|
||||
// Drop any buffers that come from other macros. We could eliminate this
|
||||
// step by adding more fine-grained requests above, which only expand for a
|
||||
// single custom attribute.
|
||||
|
||||
Reference in New Issue
Block a user