-
Notifications
You must be signed in to change notification settings - Fork 172
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
Add configuration options for third-party formatters #2092
Conversation
vscode/package.json
Outdated
"Auto", | ||
"RuboCop", | ||
"Syntax Tree", | ||
"Standard (need v0.37 or newer of the standard gem)", |
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.
We'll co-ordinate with @searls
to determine the release version for the work being done in standardrb/standard#630.
I'm not sure about maintaining this list while we don't have any control on the community addons. For example, |
@vinistock mentioned that there are cases where it's not possible to purely rely addons & server to figure out the formatter. For example, if rubocop decided to become a Ruby LSP addon too and register the As an alternative, I'd like to propose a different solution here: for options that are not maintained by us, we make it extra clear and provide minimal context. So instead of:
We simply show:
And we use the same format for any community formatter addons in the future, which will set a clear expectation to the users and save us the need to update descriptions later. |
I'm good with that approach. |
@vinistock are you in agreement? |
Yeah, I'm good with that 👍 |
Co-authored-by: Vinicius Stock <[email protected]>
Co-authored-by: Vinicius Stock <[email protected]>
a4975be
to
52f5444
Compare
Closes #1775
To properly support additional formatters, we need to change how formatters are selected when using VS Code.
Currently we use an
enum
with fixed set of choices. We could change this to a text field, but that result in a poorer user experience.Another option is to add the additional formatters to the enum list.
Although we generally try keep ruby-lsp itself unaware of specific addons, in this case it seems a worthwhile trade-off.
With the new choices being added, there is some additional information we want to show the user. There are two ways we could do this:
Using
enumDescriptions
:Using
enumLabels
: