FLIP — File-Linked Intelligent PairingVS Code extension to quickly switch between source and test files. Works out of the box with common conventions and is fully configurable for custom project structures. Keybindings
How It Works
|
| Field | Type | Description |
|---|---|---|
source |
string |
Source path template with {name} (one segment) or {path} (multi-segment) placeholders |
test |
string |
Test path template using the same placeholders |
filePrefix |
string |
Filename prefix for related files (e.g. at_, e2e_) |
searchPaths |
string[] |
Glob patterns that scope the fuzzy search to specific directories |
"flip.relatedMappings": [
{
"source": "components/{comp}/src/modules/{path}",
"test": "test/at_components/{comp}/{path}",
"filePrefix": "at_",
"searchPaths": ["**/test/at_components/**"]
},
{
"source": "components/{comp}/src",
"test": "test/at_components/{comp}",
"filePrefix": "at_",
"searchPaths": ["**/test/at_components/**"]
}
]
Examples
Ruby/RSpec
{
"flip.pathMappings": [{ "source": "lib", "test": "spec" }],
"flip.testFilePrefixes": [],
"flip.testFileSuffixes": ["_spec"],
"flip.javaStyle": false
}
Python/pytest
{
"flip.pathMappings": [{ "source": "src", "test": "tests" }],
"flip.testFilePrefixes": ["test_"],
"flip.testFileSuffixes": [],
"flip.javaStyle": false
}
Scoped smart search with searchPaths only
The simplest way to use Cmd+Shift+A is to provide only searchPaths — no templates needed. The fuzzy keyword search + scoring will find related files within those directories:
{
"flip.relatedMappings": [
{
"searchPaths": ["**/integration/tests/**"]
}
]
}
This makes Cmd+Shift+A search for related files only inside integration/tests/, using filename keywords and scoring to find the best match.
Scoped smart search with full template mapping
For more precise matching, add source/test templates and a filePrefix. This enables exact candidate resolution in addition to fuzzy search:
{
"flip.relatedMappings": [
{
"source": "src/{path}",
"test": "integration/tests/{path}",
"filePrefix": "test_",
"searchPaths": ["**/integration/tests/**"]
}
]
}
With this configuration, Cmd+Shift+A first tries exact template matching, then falls back to fuzzy search scoped to integration/tests/. For example:
src/services/auth.ts→ findsintegration/tests/services/test_auth.ts
Installation
npm install && npm run compile
npm run package
Then install via Extensions → Install from VSIX…
Development
npm run watch # compile on change
npm test # run unit tests
Press F5 in VS Code to launch an Extension Development Host.