test/support/factory.ex is a specific file that will be searched
test/support/factories is a directory - all Elixir files within it will be searched
test/support/**/factory.ex is a glob pattern that will find all factory.ex files in the test/support directory and all of its subdirectories (at any depth)
Glob Pattern Examples
**/*.ex - All Elixir files in the workspace
test/**/*_factory.ex - All files ending with _factory.ex in the test directory and its subdirectories
{test,lib}/**/*.ex - All Elixir files in either the test or lib directories
Troubleshooting
If the extension doesn't find a factory definition:
Make sure your cursor is placed directly on the factory name (the text after the colon in insert(:factory_name, ...))
Check that the factory definition exists in one of the configured factory paths
Verify that the factory definition follows the naming convention: def factory_name_factory do or def factory_name_factory(...) do
Open the Developer Tools console (Help -> Toggle Developer Tools) to see debug logs which can help identify issues
Installation
From VS Code Marketplace
Coming soon...
From VSIX File
Download the .vsix file from the repository releases
Open VS Code
Go to the Extensions view (Ctrl+Shift+X)
Click on the "..." (More Actions) button in the top-right corner of the Extensions view
Select "Install from VSIX..." and choose the downloaded file
Building from Source
Clone the repository
Run npm install to install dependencies
Run npm run package to create the VSIX package
Install the generated VSIX file as described above
Requirements
Visual Studio Code 1.60.0 or higher
Known Issues
The extension currently only supports factory references in the format insert(:factory_name, ...) or build(:factory_name, ...)
Multi-root workspaces: The extension will look for factory definitions in the first workspace folder