Support custom test commands
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 2k
- Forks
- 281
- Avg merge
- 2h 14m
- Merged PRs (30d)
- 6
Description
I have checked that this feature is not already implemented
- This feature does not exist
Use case
The current LSP attempts to automatically determine the command to run tests using the Test Explorer, however this doesn't work for all scenarios. For example, Rails applications use bin/rails test out of the box.
The current commands generated by the LSP do not work for all codebases, so allowing developers to customize the test command would make the Test Explorer functionality more useful for all codebases.
Description
I would like to be able to customize the command used for the test explorer to run tests, for example bin/rails test
Implementation
In the Code Lens command creation, prefer to read from the extension configuration instead of the base command: https://github.com/Shopify/ruby-lsp/blob/main/lib/ruby_lsp/listeners/code_lens.rb#L210-L225
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in lib/ruby_lsp/listeners/code_lens.rb at the Code Lens command creation around lines 210-225, then trace how extension configuration is read. Verify that a configured test command such as bin/rails test is preferred over the generated base command when the Test Explorer runs tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby, vscode
- Domain
- testing, tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100