Send notification to user if rubyLsp.formatter setting isn't in enum
I have checked that this feature is not already implemented
- [X] This feature does not exist
Use case
If the user wants to add a formatting option that isn't in the existing enum (found on package.json#L234), we should throw up a notification to the user.
Description
This feature was mentioned as part of the discussion on https://github.com/Shopify/ruby-lsp/issues/1775
Implementation
Quotes from @vinistock from the other issue
We could display an information message from the server if it is initialized with a formatter and it cannot find it in the registry.
The server can push dialogues for the editor to display through notifications. Here we show an error is there's a problem with formatting.
What we'd need to do is after loading addons is complete here, we check if the registry includes the formatter saved in the store (example). If it does not, we push a window/showMessage notification warning the user. Probably as a warning and not an error dialogue though.
This issue is being marked as stale because there was no activity in the last 2 months
Related: https://github.com/Shopify/ruby-lsp/pull/2092
I think this issue no longer applies now that we decided to keep the enum.
I was thinking that we could still do something similar: If the users selects a formatter that isn't available due to a lack of gem (e.g. rubyfmt), we can show a suitable notification.
Resolved by https://github.com/Shopify/ruby-lsp/pull/2092