-
Notifications
You must be signed in to change notification settings - Fork 184
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
Handle multiple formatters #2328
Conversation
@@ -780,6 +780,14 @@ | |||
"LSP": { | |||
"type": "object", | |||
"markdownDescription": "The dictionary of your configured language servers or overrides for existing configurations. The keys of this dictionary are free-form. They give a humany-friendly name to the server configuration. They are shown in the bottom-left corner in the status bar once attached to a view (unless you have `\"show_view_status\"` set to `false`).", | |||
"properties": { | |||
"formatters": { |
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.
I guess we can assume that there will be no client config with this name.
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.
Feels weird to mix client configurations and other settings but I suppose this could be considered a bad initial design...
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.
Alternatively we could use a different top-level key under "settings", for example "lsp_formatters". But I'd prefer to keep all LSP settings together under "LSP". And even if there were a config named "formatters" everything should still work fine, because the settings from that config and the formatter scope keys stored under the same name wouldn't influence each other.
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.
I think the FormattingTask
task (the lsp_format_on_save
setting) should also consider the stored formatter preference.
If nothing is stored yet and it's ambiguous which formatter to use then maybe use first like now and post a status message saying "No formatter selected, using default"
@@ -780,6 +780,14 @@ | |||
"LSP": { | |||
"type": "object", | |||
"markdownDescription": "The dictionary of your configured language servers or overrides for existing configurations. The keys of this dictionary are free-form. They give a humany-friendly name to the server configuration. They are shown in the bottom-left corner in the status bar once attached to a view (unless you have `\"show_view_status\"` set to `false`).", | |||
"properties": { | |||
"formatters": { |
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.
Feels weird to mix client configurations and other settings but I suppose this could be considered a bad initial design...
Can you add a section in the docs about the command and setting? |
Well, the command is the same as before ( So I don't think there is anything which needs to be added to the docs. Or is there anything special you had in mind? |
I think it's fine. The new "setting" is not really meant to be manually controlled anyway. |
Closes #2150.