Shopify / ruby-lsp

An opinionated language server for Ruby
https://shopify.github.io/ruby-lsp/
MIT License
1.33k stars 118 forks source link

Add default ruby configuration for visual studio code #1958

Open jenenliu opened 3 weeks ago

jenenliu commented 3 weeks ago

Motivation

I am trying to fix this issue https://github.com/Shopify/ruby-lsp/issues/1619. Add recommand default configurations for Visual Studio code.

Implementation

Add [ruby] configuration to ConfigurationDefault in vscode/package.json

Automated Tests

Not yet

Manual Tests

Not yet

jenenliu commented 3 weeks ago

Hi @vinistock , I am trying to fix issue https://github.com/Shopify/ruby-lsp/issues/1619, could you please help to guide how can I test ? I try to run Ruby-LSP: restart, but seems new configuration is not working. formatOnSave is not working at least. Thanks a lot.

jenenliu commented 3 weeks ago

I have signed the CLA!

vinistock commented 3 weeks ago

could you please help to guide how can I test ?

@jenenliu yes, absolutely. Here are the steps to test this:

  1. Before starting, ensure you don't have any of the recommended settings already configured in your VS Code. We want to verify that you get the recommended defaults automatically. If you have those settings, comment them out temporarily
  2. Now, we need to run the development version of the extension, so that you can verify the changes. First, ensure node dependencies are installed: cd vscode && yarn install
  3. In the run and debug panel, select the Run extension task and click start/run. This will open a second VS Code window, where the development version of the extension is running. It's in that window that you will be able to verify the changes
  4. In that second window, open a Ruby project
  5. Now test to see if the changes are taking effect. Are you seeing auto-formatting? When you type code, is the indentation level 2? If you are seeing those, then the changes work as expected
jenenliu commented 3 weeks ago

could you please help to guide how can I test ?

@jenenliu yes, absolutely. Here are the steps to test this:

  1. Before starting, ensure you don't have any of the recommended settings already configured in your VS Code. We want to verify that you get the recommended defaults automatically. If you have those settings, comment them out temporarily
  2. Now, we need to run the development version of the extension, so that you can verify the changes. First, ensure node dependencies are installed: cd vscode && yarn install
  3. In the run and debug panel, select the Run extension task and click start/run. This will open a second VS Code window, where the development version of the extension is running. It's in that window that you will be able to verify the changes
  4. In that second window, open a Ruby project
  5. Now test to see if the changes are taking effect. Are you seeing auto-formatting? When you type code, is the indentation level 2? If you are seeing those, then the changes work as expected

@vinistock I've tested, it works as expected, thanks a lot. Now if formatOnSave should be included, then I'll update the code, and please help to approve.