swift-syntax
swift-syntax copied to clipboard
[Macros] Add 'LibraryPluginProvider'
LibraryPluginProvider
is a PluginProvider
that can load shared library plugins at runtime.
in the near future, combined with https://github.com/apple/swift-syntax/pull/2301, in ASTGen
, we can easily create in-process "plugin server" like
@_spi(Compiler) import SwiftCompilerPluginMessageHandling
let inProcPlugins = CompilerPluginMessageHandler(provider: LibraryPluginProvier.shared)
// Load in-process plugins.
let response = inProcPlugins.handleMessage(
HostToPluginMessage.loadPluginLibrary(libraryPath: path, moduleName: module)
)
// Expand macros.
let response = inProcPlugins.handleMessage(
HostToPluginMessage.expandFreestandingMacro(...)
)
so we can treat in-process plugins as just another plugin server
@swift-ci Please smoke test
https://github.com/apple/swift/pull/69236 @swift-ci Please test
@swift-ci Please test
@swift-ci Please test Windows
@swift-ci Please test
@swift-ci Please test Windows
@swift-ci Please test Windows
@swift-ci Please test
@swift-ci Please test Windows
@swift-ci Please test macOS
@swift-ci Please test
@swift-ci Please test Windows