We Built a VSCode Extension for tng.sh (And It's Actually Useful)
You can check it here:
The TNG VSCode Plugin eliminates context switching during test generation by detecting your current method and running the appropriate TNG command with a single keyboard shortcut. It supports Ruby, Go, and Python, automatically resolving file paths and project roots so developers can generate tests without leaving their editor.
The Problem: Context Switching Kills Flow
After using TNG in the terminal for a while, we realized something: context switching sucks.
You're deep in a method, ready to generate tests, and you have to:
- Jump to the terminal
- Type out the file path
- Remember the method name
- Run the command
- Switch back to your editor
...you get it.
So we built a VSCode extension that does all of that for you.
How It Works
Put your cursor in any method. Hit Cmd+Shift+T
(or right-click → "Generate Test"). That's it.
The extension figures out:
- ✅ What method you're in (shows it in the status bar)
- ✅ What file you're working on
- ✅ Where your project root is
- ✅ What command to run
Works for Ruby, Go, and Python.
Why We Built This
The average developer switches context 13 times per hour. Each switch costs 23 minutes of deep work time.
Numbers are generated by AI, so they are 100% fake, but the reality stays. We do a lot of context switching.
Writing tests shouldn't be one of those switches.
We wanted test generation to happen right where you're already working—no terminal commands to remember, no file paths to copy-paste, no breaking your flow.
Common Questions About the Plugin
What languages does it support?
Ruby (Rails), Go, and Python. The extension automatically detects your language and runs the correct TNG command format.
Does it work with existing test frameworks?
Yes. TNG generates tests compatible with:
- Ruby: RSpec / minitest
- Go: Native testing package
- Python: pytest
You can see more on tng.sh, or write an email to us at raluca@tng.sh.
How does method detection work?
The plugin uses VS Code's Language Server Protocol first, with regex fallback. It detects:
- Regular methods
- Class methods
- Async functions
- Methods with receivers
Can I customize the keyboard shortcut?
Absolutely. Go to VS Code keyboard shortcuts and search for "TNG: Generate Test" to rebind it.
What if my project structure is non-standard?
The extension finds your project root by looking for:
-
Ruby:
Gemfile
-
Go:
go.mod
-
Python:
pyproject.toml
If you have a monorepo or unusual setup, it resolves paths relative to the nearest config file.
Installation and Setup
1. Install from the VS Code Marketplace
Search for "TNG" in VS Code extensions and install.
2. Get your API key
Visit app.tng.sh to get your API key.
3. Install TNG for your language
-
Ruby: Add
gem 'tng'
to your Gemfile -
Go: Download
tng-go
binary (coming soon) -
Python:
pip install tng-python
4. Configure your API key and start generating tests
The extension will prompt you for your API key on first use, or you can configure it in VS Code settings.
What Makes This Different
Most test generation tools require you to leave your editor or work through clunky UIs. We built this specifically for developers who live in their IDE and want zero friction between writing code and writing tests.
The plugin isn't just running commands—it's understanding your codebase structure, detecting your current context, and making intelligent decisions about what command to run and where.
Try It Out
Grab it from the VS Code Marketplace. You'll need an API key from app.tng.sh and the TNG tool installed for your language.
We're still iterating on this based on real developer feedback. If you hit any rough edges or have ideas for improvements, reach out at support@tng.sh.
Happy testing 🚀
P.S. If you're still manually typing file paths into your terminal, we can't be friends. Install the extension and join the future.
Top comments (0)