swift-syntax icon indicating copy to clipboard operation
swift-syntax copied to clipboard

Implement BasicMacroExpansionContext.buildConfiguration

Open jmschonfeld opened this issue 2 weeks ago • 2 comments

While testing out the new buildConfiguration property on the macro expansion context, I noticed that when my macro was expanding in unit tests the macro was not receiving the build configuration. The root cause was that BasicMacroExpansionContext did not implement var buildConfiguration directly and was instead picking up the default implementation which always returns nil. This change implements the property by returning the value from the shared state.

I couldn't find existing tests that exercise the build configuration as part of an expansion context, but if there's a good place to add a unit test let me know and I can try to add that.

jmschonfeld avatar Nov 20 '25 22:11 jmschonfeld

@swift-ci please test

jmschonfeld avatar Nov 20 '25 22:11 jmschonfeld

@swift-ci Please test Windows

ahoppen avatar Nov 21 '25 13:11 ahoppen