-
Notifications
You must be signed in to change notification settings - Fork 440
[CompilerPlugin] Factor out message handling logic to a module #1403
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
479f43d
to
fb67f74
Compare
@swift-ci Please test |
fb67f74
to
5dfa39d
Compare
@swift-ci Please test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a huge fan of Impl
. CompilerPluginAPI
or something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about naming the module SwiftCompilerPluginMessageHandling
or something like that. I think that’s more descriptive than Impl
. Also, I’m not sure whether we should underscore it because it seems equally useful to users as the other modules in swift-syntax.
Package.swift
Outdated
@@ -43,6 +43,7 @@ let package = Package( | |||
.library(name: "SwiftSyntaxParser", type: .static, targets: ["SwiftSyntaxParser"]), | |||
.library(name: "SwiftSyntaxBuilder", type: .static, targets: ["SwiftSyntaxBuilder"]), | |||
.library(name: "SwiftSyntaxMacros", type: .static, targets: ["SwiftSyntaxMacros"]), | |||
.library(name: "_SwiftCompilerPluginBase", type: .static, targets: ["_SwiftCompilerPluginImpl"]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The library is named differently than the target. Is that intentional?
Create a module '_SwiftCompilerPluginImpl' that abstracts the low level message connection/serilaization. 'CompilerPlugin' is now a implementation of the message connection, and adapts the concrete type to the message handler. This make it possible to make a plugin with a different messaging connection and serialization.
5dfa39d
to
db609d6
Compare
Thank for naming idea. Let me go with |
@swift-ci Please test |
Create a module
_SwiftCompilerPluginImpl
that abstracts the low level message connection/serialization.CompilerPlugin
is now an implementation of the message connection, and adapts the concrete type to the message handler.This make it possible to make a plugin with a different messaging connection and serialization.