Shopify / ruby-lsp

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

VSCode: Support bundleGemfile locations relative to os.homedir #1974

Open SeanSith opened 3 weeks ago

SeanSith commented 3 weeks ago

I have checked that this feature is not already implemented

Use case

For those of us having to maintain multiple applications which use Ruby versions older than what ruby-lsp supports, we must use bundleGemfile to get the LSP to run. If we could define a bundleGemfile location using ~/[bundleGemfileDir]/Gemfile, that would support a use case where VSCode settings may be synchronized between multiple computers which maintain different home directory structures (e.g. between Linux and macOS or where different usernames are used).

Description

An augmentation of the bundleGemfile path searching to not only handle absolute paths and paths relative to the current project, but using the common UNIX convention of ~ to refer to the user's home directory. Note that currently customRubyCommand works with this convention if that helps.

Implementation

No response

vinistock commented 3 weeks ago

Thank you for the feature suggestion! Is there a reason why you cannot exclude this specific setting from sync and then configure the two machines differently?

SeanSith commented 2 weeks ago

I've found that other extensions (e.g. Project Manager) implement the use of environment variables (like they do with $home in their git.baseFolders setting) to allow for similar situations. Maybe that is an option instead?

For those of us who try to have all of our environments operate in the same fashion, being able to define a configuration in one place and have it automatically synchronize to the other environments is ideal. Having to disable certain settings creates one-offs that need to be dealt with and maintained separately from the core workflow.

Unfortunately my experience with JS/TS is effectively nil, otherwise I'd have accompanied this with my hamfisted attempt at a PR. Thanks for considering the feature, though.