{"id":13621501,"url":"https://github.com/st0012/ruby-lsp-rspec","last_synced_at":"2025-05-14T21:06:46.296Z","repository":{"id":195383320,"uuid":"689773129","full_name":"st0012/ruby-lsp-rspec","owner":"st0012","description":"A Ruby LSP addon for RSpec tests","archived":false,"fork":false,"pushed_at":"2025-05-10T13:00:53.000Z","size":21837,"stargazers_count":164,"open_issues_count":14,"forks_count":11,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-05-10T14:19:00.932Z","etag":null,"topics":["rspec","ruby-lsp","vscode-extension"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/st0012.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-09-10T21:09:54.000Z","updated_at":"2025-05-05T18:34:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"1b61cb0a-78eb-4a7e-ac24-bf76193cc86f","html_url":"https://github.com/st0012/ruby-lsp-rspec","commit_stats":{"total_commits":56,"total_committers":7,"mean_commits":8.0,"dds":0.1607142857142857,"last_synced_commit":"d02eb583a1c3270067c44332418151edfb01dce1"},"previous_names":["st0012/ruby-lsp-rspec"],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/st0012%2Fruby-lsp-rspec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/st0012%2Fruby-lsp-rspec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/st0012%2Fruby-lsp-rspec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/st0012%2Fruby-lsp-rspec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/st0012","download_url":"https://codeload.github.com/st0012/ruby-lsp-rspec/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254227612,"owners_count":22035669,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["rspec","ruby-lsp","vscode-extension"],"created_at":"2024-08-01T21:01:07.162Z","updated_at":"2025-05-14T21:06:41.283Z","avatar_url":"https://github.com/st0012.png","language":"Ruby","funding_links":[],"categories":["Standalone Gems","Ruby","Developer Tooling","Open Source codebases using Sorbet"],"sub_categories":["Testing"],"readme":"# Ruby LSP RSpec\n\n[![Gem Version](https://badge.fury.io/rb/ruby-lsp-rspec.svg)](https://badge.fury.io/rb/ruby-lsp-rspec)\n\nRuby LSP RSpec is a [Ruby LSP](https://github.com/Shopify/ruby-lsp) addon for displaying CodeLens for RSpec tests.\n\n## Installation\n\nTo install, add the following line to your application's Gemfile:\n\n```ruby\n# Gemfile\ngroup :development do\n  gem \"ruby-lsp-rspec\", require: false\nend\n```\n\n\u003e [!IMPORTANT]\n\u003e Make sure the relevant features are [enabled](https://github.com/Shopify/ruby-lsp/tree/main/vscode#enable-or-disable-features) under your VSCode's `rubyLsp.enabledFeatures` setting, such as `codeLens`.\n\nAfter running `bundle install`, restart Ruby LSP and you should start seeing CodeLens in your RSpec test files.\n\n## Features\n\n### CodeLens\n\n1. When clicking `Run`, the test(s) will be executed via the Test Explorer\n    - However, deeply nested tests may not be displayed correctly at the moment\n2. When clicking `Run In Terminal`, a test command will be generated in the terminal\n3. When clicking `Debug`, the test(s) will be executed with VS Code debugger enabled (requires the [`debug`](https://github.com/ruby/debug) gem)\n    - [Learn how to set breakpoints in VS Code](https://code.visualstudio.com/docs/editor/debugging#_breakpoints)\n\n\u003cimg src=\"misc/code-lens.gif\" alt=\"CodeLens\" width=\"75%\"\u003e\n\n### Document Symbols\n\nDocument Symbols can be triggered by:\n\n- Typing `@` in VS Code's command palette\n- Pressing `Cmd+Shift+O`\n\n\u003cimg src=\"misc/document-symbol.gif\" alt=\"Document Symbols\" width=\"75%\"\u003e\n\n### Go to definition\n\n`ruby-lsp-rspec` supports go-to-definition on methods defined through `let` and `subject` DSLs in spec files.\n\nIn VS Code this feature can be triggered by one of the following methods:\n\n- `Right click` on the target, and then select `Go to Definition`\n- Placing the cursor on the target, and then hit `F12`\n- `Command + click` the target\n\n\u003e [!Note]\n\u003e This feature requires indexing your spec files so they can't be excluded from Ruby LSP's indexing.\n\n\u003cimg src=\"misc/go-to-definition.gif\" alt=\"Go to definition\" width=\"75%\"\u003e\n\n### VS Code Configuration\n\n`ruby-lsp-rspec` can be configured through VS Code's `settings.json` file.\n\nAll configuration options must be nested under the `Ruby LSP RSpec` addon within `rubyLsp.addonSettings`:\n\n```json\n{\n  // ...\n  \"rubyLsp.addonSettings\": {\n    \"Ruby LSP RSpec\": {\n      // Configuration options go here\n    }\n  }\n}\n```\n\n#### `rspecCommand`\n\n**Description:**\n\nCustomize the command used to run tests via CodeLens. If not set, the command will be inferred based on the presence of a binstub or Gemfile.\n\n**Default Value**: `nil`\n\n**Example:**\n\n```json\n{\n  // ...\n  \"rubyLsp.addonSettings\": {\n    \"Ruby LSP RSpec\": {\n      \"rspecCommand\": \"rspec -f d\"\n    }\n  }\n}\n```\n\n#### `debug`\n\n**Description:**\n\nEnable debug logging. Currently, this only logs the RSpec command used by CodeLens to stderr, which can be viewed in VS Code's `OUTPUT` panel under `Ruby LSP`.\n\n**Default Value**: `false`\n\n**Example:**\n\n```json\n{\n  \"rubyLsp.addonSettings\": {\n    \"Ruby LSP RSpec\": {\n      \"debug\": true\n    }\n  }\n}\n```\n\n### Container Development\n\nWhen developing in containers, use the official [`Dev Containers`](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension. This ensures Ruby LSP and Ruby LSP RSpec run inside the container, allowing correct spec path resolution.\n\nFor detailed container setup instructions, see the [Ruby LSP documentation](https://github.com/Shopify/ruby-lsp/blob/main/vscode/README.md?tab=readme-ov-file#developing-on-containers).\n\nMake sure to configure Ruby LSP to run inside the container by adding it to your `.devcontainer.json`:\n\n```json\n{\n  \"name\": \"my-app\",\n  // ...\n  \"customizations\": {\n    \"vscode\": {\n      \"extensions\": [\n        \"Shopify.ruby-lsp\",\n        // ...\n      ]\n    }\n  }\n}\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/st0012/ruby-lsp-rspec. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/st0012/ruby-lsp-rspec/blob/main/CODE_OF_CONDUCT.md).\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Code of Conduct\n\nEveryone interacting in the Ruby::Lsp::Rspec project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/st0012/ruby-lsp-rspec/blob/main/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fst0012%2Fruby-lsp-rspec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fst0012%2Fruby-lsp-rspec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fst0012%2Fruby-lsp-rspec/lists"}