-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Account for missing bundle or lockfile in compose bundle request (#3104)
### Motivation When implementing the new `rubyLsp/composeBundle` request, I had the use case of automated restarts on lockfile changes in mind. However, you can still trigger a restart manually through the commands and restarts are also triggered when a lockfile is deleted. In those two cases, the request was crashing. ### Implementation Since we're already running the LSP, `Bundler.default_lockfile` may return the path to a lockfile that no longer exists (it is based on the `BUNDLE_GEMFILE` environment variable, which is already set at that point). We need to check if the file exists before trying to parse it. Additionally, if the restart command is invoked manually and there's no bundle, we still shouldn't fail because we can compose the bundle regardless. ### Automated Tests Added tests.
- Loading branch information
Showing
6 changed files
with
87 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters