Open files related to your current one.
Currently, this is a bare-bones, primitive implementation of a command that shows files related to your current one. It does so by pre-populating VSCode's Quick Open
command, but may be improved upon in the future with a custom menu that finds and creates files (when they don't already exist).
Note: by default, this highlights peer or descendent files. If, however, you are already in a descendent file (e.g.
/__tests__/MyFile.test.ts
), it will show related files from the folder above it (e.g.../MyFile
).
Open your keybindings.json and add a keybinding like:
{
"key": "cmd+shift+o",
"command": "extension.openRelated",
"when": "editorTextFocus"
}
Identify subdirectories to the root file of a related groups by adding to your settings.json something like:
"extension.openRelated.subdirectories": ["__tests__", "__stories__"]
Above's configuration will work well with a folder structure like:
MyFile.tsx
/__tests__/MyFile.test.tsx
/__stories__/MyFile.stories.tsx
Initial release
- How to Make A Visual Studio Code Extension [to Generate Ducks] | by Van Huynh
- How to write file if parent folder doesn't exist?
- nocksock/vscode-quick-open-create
- vscode-open-related-files/relatedFiles.ts
- GeorgeSG/vscode-open-related-files: VSCode extension that allows you to quickly open files that are in the same folder and have the same name as the one you're currently editing.
- suchitadoshi1987/related-files-hopper: Get easy access to all the related files in your app
- eamodio/vscode-find-related: Finds files related to the current file based on user-defined configuration rules in VS Code
- AdrianWilczynski/Switcher: Visual Studio Code extension. Switch between related files (same name, different extensions) using keybindings, context menu or command palette. Configured out of box to work with Angular, Razor Pages, TypeScript, Sass and minified JS or CSS files.
- File Switcher - Visual Studio Marketplace
- bryanthomaschen/vscode-open-related-file: VS Code extension to open files that have the same name as the currently opened file, but with a different extension
- schreifels/vscode-quick-open-related-files: Instantly jump to related files using the Quick Open menu in VS Code