-
Notifications
You must be signed in to change notification settings - Fork 71
Configurable Command Plugin Build Configuration #1409
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
Configurable Command Plugin Build Configuration #1409
Conversation
Packages can define their own plugins either directly or through their dependencies. These plugins define commands, and the extension exposes a list of these when you use `> Swift: Run Command Plugin`. It may be desirable to build and run these plugins with specific arguments. This patch introduces a new setting that can be specified globally or on a per workspace folder basis that allows users to configure arguments to pass to plugin command invocations. The setting is defined under `swift.pluginArguments`, and is specified as an object in the following form: ```json { "PluginCommandName:intent-name": ["--some", "--args"] } ``` - The top level string key is the command id in the form `PluginCommandName:intent-name`. For instance, swift-format's format-source-code command would be specified as `swift-format:format-source-code` - Specifying `PluginCommandName` will apply the arguments to all intents in the command plugin - Specifying `*` will apply the arguments to all commands. This patch also adds this wildcard functionality to the `swift.pluginPermissions` setting. Issue: swiftlang#1365
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.
Thank you, looks good.
Maybe it would be nicer to have a combined "pluginSettings" instead of pluginPermissions and pluginArguments?
@MahdiBM I think because for backwards compatibility sake, because we've already released with pluginPermissions, we shouldn't roll it in to the more generic pluginArguments. It would also make the settings validation more tricky since it could be either one of the permissions values, or a freeform argument. |
Co-authored-by: Rishi <[email protected]>
Verified with 82fb69c |
Packages can define their own plugins either directly or through their dependencies. These plugins define commands, and the extension exposes a list of these when you use
> Swift: Run Command Plugin
.It may be desirable to build and run these plugins with specific arguments. This patch introduces a new setting that can be specified globally or on a per workspace folder basis that allows users to configure arguments to pass to plugin command invocations.
The setting is defined under
swift.pluginArguments
, and is specified as an object in the following form:PluginCommandName:intent-name
. For instance, swift-format's format-source-code command would be specified asswift-format:format-source-code
PluginCommandName
will apply the arguments to all intents in the command plugin*
will apply the arguments to all commands.This patch also adds this wildcard functionality to the
swift.pluginPermissions
setting.Issue: #1365