Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>SabertoothNew to Visual Studio Code? Get it now.
Sabertooth

Sabertooth

Storage Engines

|
192 installs
| (1) | Free
A VSCode extension for WiredTiger development.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Sabertooth

A VSCode extension integrating tools used by the WiredTiger team into the editor.

Requirements

Many features rely on the wt utility binary. This can be built automatically with WiredTiger or can be built using the MongoDB build command.

The extension will attempt to find the utility in your workspace, alternatively you can specify it's location in the settings: Sabertooth › Paths: Wt Tool.
Other features rely on the tools in the WiredTiger repo they will only function if the workspace is a WiredTiger repo or the location of a local WiredTiger repo is specified in the settings. We recommend specifying the following settings:
Sabertooth › Paths: Callgraph
Sabertooth › Paths: Python
Sabertooth › Paths: Wiredtiger

Features

Tools

  • A sidebar view for WiredTiger database files
  • WT utility tool built into the command palette and sidebar view
  • GUI access to WiredTiger tools such as binary decode and file layout graphs.

WiredTiger Development

  • Create and view call graphs
  • Tasks for running tests, and builds
  • Common snippets available in the intellisense
  • Commands for automatically configuring the debugger
  • Settings for configuring the build and test tools

Sidebar View

The extension provides a sidebar view that will list all the database files found in the specified directory and group them by their home directory.

Switch to Catalog Namespace

Dump BSON

Quick Access Tools

Sidebar Context Menu

WT Testing Treeview

The extension provides a dedicated treeview in the WiredTiger sidebar for running various test suites. Each test category includes:

  • Buttons to run individual tests or test suites
  • Settings buttons for quick access to test suite configuration options

This makes it easy to configure and run tests directly from the sidebar without navigating through menus or command palette.

WT Utility Commands

The wt tool is a command-line utility that provides access to various pieces of the WiredTiger functionality. This extension exposes the utility through VSCode commands that can be accessed through the command palette. The command palette will prompt the user for configurations through input fields and selection items. Currently only dump and verify are partially supported, however, future updates will add support for additional commands.

Usage

  1. Open the command palette using Cmd/Ctrl + Shift + P
  2. Type WT: to filter the extension commands.
dump-1

WiredTiger Development

Building WiredTiger

You can use the extension to build wiredtiger with the build tasks provided. These tasks can be access through the Tasks: Run Task command or through keybindings. These are the available build tasks:

  • build-clean: A build task that recreates a build directory.
  • build-clean-configure: A build task that recreates a build directory and opens ccmake.
  • build-reconfigure: Open ccmake in the task shell window.
  • ninja: Runs ninja.

The tasks will have paths to the build tools set by default, however, these can be changed in the settings which can be access by Cmd+, and searching for Sabertooth.

Callgraph

Access to the WiredTiger callgraph tool for plotting function calls in WiredTiger. The location of the callgraph script must be specified in the extension settings.

Snippets

The extension provides common snippets useful for WiredTiger developers.

snippet-1

Tests

Python Tests

Similar to the build tasks the python test suite can be run as tasks using the Run Tasks command or using the keybindings mentioned above. These are the python tasks available:

  • python-test: Runs specified python test from the settings.
  • python-test-all: Runs all python tests in the suite.
  • python-test-current: Run the currently open python test.
  • python-test-all-open: Runs all the python tests open the tab group.

You can quickly access these tests and their settings through the WT Testing treeview in the sidebar.

python-test

Test Format

Test format can also be run as a task. The task will use the format.sh script to run the tests and can be configured in the "format" section of the extension settings.

  • test-format: Runs test format with the configurations in the settings.

The extension also provides a Test Explorer integration for format tests, which discovers and displays all CONFIG.* files in the test/format directory. You can run individual format test configurations or all of them at once from the Test Explorer.

The extension also provides a command WT: Print Format Traces for dumping ops tracing from a test format run. The command will provide a drop down menu where you can select which database directory produced by test format to dump. Ops tracing can be enabled and configured in the settings.

CTests

The extension integrates with CTest (CMake's test runner) to discover and run C/C++ tests in the build directory. Tests are discovered automatically and displayed in the Test Explorer panel.

Features:

  • Automatic discovery of tests using ctest -N in the build directory
  • Run individual tests or the entire test suite
  • Regular and verbose output modes
  • Test results are displayed in the Test Explorer UI

Tests are refreshed when the extension activates and can be manually refreshed through the Test Explorer interface.

Keybindings

Keybindings can be used to quickly access tasks from the extension. The default keybindings for the extension use a key chord starting with Cmd+M followed by a key for that task.

Task Keybinding
build-clean Cmd+M shift+B
build Cmd+M B
test-format Cmd+M F
python-test-current Cmd+M P
python-test-all Cmd+M Shift+P
s_all Cmd+M S

Users can also configure their own key bindings in the VSCode Preferences: Cmd+K Cmd+S

Settings

You can change the settings for many of the tasks and commands listed above. The settings will use the mongodbtoolchain for many of the tasks and commands by default. However, these can be changed to use different binaries for python, cmake and other tools.

settings

Contributing

Requirements

  • Node.js

Steps

  1. Install Node.js
  2. Clone the Sabertooth repo.
  3. Run npm install inside the Sabertooth repository to install the node package dependencies.
  4. Open Sabertooth in VSCode.
  5. Make your changes.
  6. Run the debugger with F5 or using the Run and Debug sidebar.
  7. Open a wiredtiger as a workspace in the debugger window.
  8. Test your changes.

Resources

  • VSCode Extension API


Enjoy!

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft