This repository has been archived by the owner on May 30, 2024. It is now read-only.
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.
This PR updates the "no lock file" warning UX to what I would expect given the original comments. Previously "Don't show again" still resulted in starting a ruby-lsp server for the folder even if there was no lock file. Now if there's no lockfile:
Motivation
My standard workspace includes a ruby and non-ruby root. Prior to this PR, there was no way to tell the extension not to start ruby-lsp for the non-ruby root and not to ask again.
Implementation
I tried to match the behavior of activateWorkspace to the original comment:
If one of the workspaces does not contain a lockfile, then we don't try to start a language server.
Especially, clicking "Don't ask again" doesn't start the ruby-lsp server for the directory and doesn't give a warning.Automated Tests
I honesn't don't know how to write the tests - I'm a devops engineer, not a javascript programmer, and it took me a long time to write this as-is.
Manual Tests
I built and installed my version of the plugin, and now all the possible responses to the "no lockfile" warning behave as expected - importantly, I say "don't ask again" and the ruby-lsp server won't start for the given directory.
Final Thoughts
I kind of expect I'm missing something here, and am preparing myself for a major "D'oh!" moment.