Repository navigation
feat(BREAKING): let process plugins allow other plugins to change their non-global config - #1457
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #1397, which only let a plugin change the global configuration of every process plugin when formatting text with it (ex. a code block). Most process plugins have no configuration that's dangerous to change, so now the process plugin decides.
PluginInfo.supports_range_formattingis now aboolinstead of anOption<bool>.ProcessPluginInfo, which wrapsPluginInfoand addsallow_plugin_override_config: bool. Whentrue, another plugin may change the plugin's non-global configuration. Whenfalse, it can only change the global configuration (lineWidth,indentWidth,useTabsandnewLineKind). dprint-plugin-exec should keep thisfalsebecause its config says what commands to run.ReceivedPluginInfo, where these areOption<bool>for plugins made with an older dprint-core. A process plugin that doesn't provideallowPluginOverrideConfigis treated asfalse, so older versions of dprint-plugin-exec stay protected.PluginInfoandProcessPluginInfono longer implementDeserialize, since the CLI uses its own type to read them.This is breaking for plugin authors because of the required properties and the new type for process plugins.