Introduce `.ruby-lsp.yml` config file
Motivation
We want to have a general purpose configuration mechanism for Ruby LSP that not tied to a particular editor.
Also closes #1295 (but with a slightly different approach)
Implementation
As agreed with @vinistock, we will repurpose the current indexing configuration file, .index.yml.
There will be a new top-level key, indexing, but within that the structure was the same as before.
Automated Tests
Included
Manual Tests
- Check out this branch
- Ensure indexing is working (e.g. the Jump to Definition works for constants)
- Edit
.ruby-lsp.ymland rename theindexingkey. - Restart the LSP and verify that error notification appears (the remaining LSP feature should continue working)
- Copy
.index.ymlfrommain, and delete.ruby-lsp.yml. - Restart the LSP and ensure a deprecation warning about
.index.ymlshows in the output panel. - Ensure an error message is showing but otherwise everything works (e.g. formatting)
- Delete
.index.ymland restart the LSP (so now there are no config files) - Ensure indexing completes successfully (e.g. the Jump to Definition works for constants)
(looks like some tests need a slightl adjustment for Windows)
I think the changes are good, but I wonder if having the configuration file isn't deviating from the LSP approach. We might be better off getting rid of the .index.yml (with a deprecation warning first) and then start accepting all of the configuration from the editor.
After #1818 is shipped, we could have the indexing configuration be a part of the global state and gather the configuration from the initialization options.
I think it's worth ensuring we're following the LSP approach at this point, because otherwise we will have introduced two configuration files (.index.yml and .ruby-lsp.yml), both of which may be not following the standard.
Thoughts?
TODO: update ruby-lsp-doctor to handle new config
This pull request is being marked as stale because there was no activity in the last 2 months
(re-opening for now but really we should create a seperate issue/PR for @vinistock's suggestion).
Closing since we are planning a different approach: https://github.com/Shopify/ruby-lsp/issues/2156