This repository has been archived by the owner on May 30, 2024. It is now read-only.
allow to use the extension in folders that contain spaces #716
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
The extension does not work for projects in folders, were there is a space somewhere in the path. I often use that and I don't want to rename all my project folders.
Implementation
Just adding spaces around the environment Variable named BUNDLE_GEMFILE is enough.
BUNDLE_GEMFILE="/path with spaces/project/Gemfile" bundle exec ruby-lsp
works just fine, whileBUNDLE_GEMFILE=/path with spaces/project/Gemfile bundle exec ruby-lsp
won't workAutomated Tests
No, I have not included test for this. I was just about writing the tests and working on for Shopify/ruby-lsp#781 when I recognized the extension itself was broken, too.
I might perhaps come back after the ruby-lsp itself works with spaces and add some. Meanwhile I guess the change is quite simple, and since I need to do it, to be able to work on the other issue, I could as well publish the code and add a PR, if somebody else has this.
Manual Tests
Add a space to the folder your test project resides in, and try to start ruby-lsp. It will fail. After this change ruby-lsp can start.