ruby-lsp icon indicating copy to clipboard operation
ruby-lsp copied to clipboard

Send notification to user if rubyLsp.formatter setting isn't in enum

Open jscharf opened this issue 2 years ago • 1 comments

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.

jscharf avatar Nov 24 '23 15:11 jscharf

This issue is being marked as stale because there was no activity in the last 2 months

github-actions[bot] avatar Jan 24 '24 12:01 github-actions[bot]

Related: https://github.com/Shopify/ruby-lsp/pull/2092

andyw8 avatar May 27 '24 19:05 andyw8

I think this issue no longer applies now that we decided to keep the enum.

vinistock avatar May 27 '24 20:05 vinistock

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.

andyw8 avatar May 27 '24 20:05 andyw8

Resolved by https://github.com/Shopify/ruby-lsp/pull/2092

andyw8 avatar Jun 23 '24 15:06 andyw8