How to convert a String from a macro to a value that can be used in the implementation of this plugin.

I'm trying to make a macro that has the following structure:

@SampleDataProviding(decoder: JSONDecoder(), bundlePath: Bundle.module.bundlePath, fileExtension: "json")

The primary issue that I am having is that I need to be able to scan a subdirectory of the bundlePath for files that match a certain criteria. However, when I try to access the Bundle.module.bundlePath it literally spits back at me "Bundle.module.bundlePath" which obviously doesn't get me anywhere. I've looked all over for a way to convert what I enter at the macro call site to an actual path that I can put in code that isn't generated. (This macro goes through a specific subdirectory looking for sample data files which it then generates a variable expression for each of them so that it is easy to access this sample data (for UI work or testing).) Each time I try this it fails stating that the folder doesn't exist because it's looking for "Bundle.module.bundlePath/[subdirectory]" when I want it to look for the subdirectory in the bundle path, not "Bundle.module.bundlePath". I've been able to get this to work in testing by wrapping the call in an interpolation from a string but this does not work in the real world because the compiler complains that the interpolation cannot be modified (it is also more clunky, I would prefer to avoid having to wrap the entire thing in an interpolation).

The MemberAccessExprSyntax (the type of syntax returned to me) does not (on it own from SwiftSyntax at least) provide an obvious way to take the member access and transpose it into the value of that member.

The primary issue with this that I'm having is that I need in order to generate the accessors for the sample data files that are in the bundle directory, I need to know where to look for the files. At the moment I'm using the FileManager type from foundation to perform the searches. I'm trying to find a way to do this, thus it isn't strictly necessary for me to ask for the path.

try FileManager.default.contentsOfDirectory(atPath: "\(sampleDataDirectoryPath)/\(fetcherName)")
How to convert a String from a macro to a value that can be used in the implementation of this plugin.
 
 
Q