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

Sabertooth

Storage Engines

|
180 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:

ninja -j200 build/install/bin/wt

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 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.
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 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.

Debugger Configuration

You can use the WT: Create Launch JSON command to create a default launch configuration file useful for debugging most WiredTiger tests. These will include specific test names as examples which can be changed.

launch-json

Once the launch configuration file is created, you can use the WT: Find Core Files to automatically create launch configurations for any core dumps found in the workspace. The debugger can then immediately launch any core dumps listed. If you're debugging from evergreen artifacts, use the WT: Find Cores in Artifacts command instead as there are different configuration requirements for those core dumps.

debug-core

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