A VS Code extension to navigate to Factory Bot definitions in Rails projects.
Features
This extension allows you to quickly navigate to Factory Bot definitions in your Rails project. When your cursor is on a create or build method call, the extension will open the corresponding factory file in the ./test/factories/ folder.
Usage
Place your cursor on a line containing a create or build method call, such as create(:user) or build("user").
Run the command Rails Go to Factory from the command palette (Ctrl+Shift+P or Cmd+Shift+P on macOS).
Alternatively, use the keybinding chord Ctrl+g Ctrl+f on Windows/Linux or Cmd+g Cmd+f on macOS to trigger the command.
The extension will open the corresponding factory file in the ./test/factories/ folder if it exists. If the file does not exist, an error message will be displayed.
Installation
Install the extension from the VS Code Marketplace.
Ensure your Rails project has Factory Bot installed and configured.
Configuration
No additional configuration is required.
Contributing
Contributions are welcome! Please open an issue or submit a pull request on the GitHub repository.
License
This project is licensed under the MIT License. See the LICENSE file for details.