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

[Macros] Add 'LibraryPluginProvider'

Open rintaro opened this issue 1 year ago • 1 comments

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

rintaro avatar Oct 17 '23 19:10 rintaro

@swift-ci Please smoke test

rintaro avatar Oct 18 '23 13:10 rintaro

https://github.com/apple/swift/pull/69236 @swift-ci Please test

rintaro avatar May 01 '24 13:05 rintaro

@swift-ci Please test

rintaro avatar May 01 '24 17:05 rintaro

@swift-ci Please test Windows

rintaro avatar May 01 '24 17:05 rintaro

@swift-ci Please test

rintaro avatar May 01 '24 19:05 rintaro

@swift-ci Please test Windows

rintaro avatar May 01 '24 19:05 rintaro

@swift-ci Please test Windows

rintaro avatar May 01 '24 19:05 rintaro

@swift-ci Please test

rintaro avatar May 01 '24 23:05 rintaro

@swift-ci Please test Windows

rintaro avatar May 01 '24 23:05 rintaro

@swift-ci Please test macOS

rintaro avatar May 02 '24 02:05 rintaro

@swift-ci Please test

rintaro avatar May 05 '24 01:05 rintaro

@swift-ci Please test Windows

rintaro avatar May 05 '24 01:05 rintaro