Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>WIT IDLNew to Visual Studio Code? Get it now.
WIT IDL

WIT IDL

Bytecode Alliance

|
4,212 installs
| (1) | Free
WebAssembly Interface Type (WIT) IDL Extension for VSCode
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

WIT IDL for VSCode

This package is a Visual Studio Code extension to recognize and highlight the WebAssembly Interface Type (WIT) Interface Definition Language (IDL). It can also be used as a bundle in TextMate.

The description of the WIT format can be found at: https://github.com/WebAssembly/component-model/blob/main/design/mvp/WIT.md

Features

Screenshot

This extension provides:

  • Basic syntax highlighting of ".wit" files.
  • Snippets for worlds and interfaces.
  • Basic markdown highlighting in comments.
  • Simple list-based autocomplete.
  • WIT Syntax Checking: Validate WIT files for common syntax errors and provide diagnostics.

Syntax Validation and Error Display

The extension provides comprehensive WIT syntax validation with error display in VS Code's PROBLEMS pane:

Automatic Validation

  • On File Save: Automatically validates WIT files when saved
  • On File Open: Validates WIT files when opened in the editor
  • Real-time Feedback: Errors appear immediately in the PROBLEMS pane

Manual Commands

  • WIT: Check Syntax (Ctrl+Shift+P → "WIT: Check Syntax")

    • Validates the currently active WIT file
    • Shows detailed error information in notifications
    • Displays errors in the PROBLEMS pane
  • WIT: Check Syntax in Workspace (Ctrl+Shift+P → "WIT: Check Syntax in Workspace")

    • Validates all WIT files in the workspace
    • Shows progress notification during validation
    • Provides summary of results
    • Creates detailed report in output channel

Error Information

When validation fails, the extension displays:

  • Error location: Precise line and column numbers
  • Error message: Detailed description of the syntax error
  • Context: Additional information about the error
  • Related information: Links to relevant documentation or context

PROBLEMS Pane Integration

  • Errors appear automatically in VS Code's PROBLEMS pane
  • Click on any error to jump directly to the problematic line
  • Errors are cleared automatically when files are fixed or closed
  • Supports multiple files with errors simultaneously

Code Completion

The extension offers intelligent code completion for WIT files:

  • Context-aware suggestions: Provides completion items based on the current context
  • Keyword snippets: Includes common WIT keywords and constructs
  • Custom snippets: User-defined snippets for faster coding

Command Palette Integration

Easily access extension features through the Command Palette:

  • WIT: Check Syntax: Validate the current file's syntax
  • WIT: Check Syntax in Workspace: Validate all WIT files in the workspace
  • WIT: Show Output Channel: Display the extension's output channel

Installation

From Marketplace

This extension is available on:

  • Visual Studio Marketplace: For VS Code users

    • Install directly from VS Code: Search for "WIT IDL" in the Extensions view
    • Or visit: https://marketplace.visualstudio.com/items?itemName=bytecodealliance.wit-idl
  • Open VSX Registry: For VSCodium and other compatible editors

    • Install from Open VSX: https://open-vsx.org/extension/bytecodealliance/wit-idl
    • Or install via CLI: ovsx get bytecodealliance.wit-idl

Prerequisites

This extension includes a WebAssembly component that requires the following tools for building:

  • Rust (with cargo): Required for building the WebAssembly module
  • wasm-pack v0.13.1: Used specifically for the wit-bindgen-wasm subproject

You can install these dependencies by running:

# Install Rust (if not already installed)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# Run the setup script to install build tools
npm run setup-wasm

From Source

To install from source, follow these steps:

  • Clone the repository: git clone https://github.com/bytecodealliance/vscode-wit.git && cd vscode-wit
  • Install build dependencies: npm run setup-wasm
  • Run npm commands to install: npm ci && npm run install-extension

Publishing (for maintainers)

This extension is automatically published to both Visual Studio Marketplace and Open VSX Registry through GitHub Actions when a release is created.

Required secrets:

  • PAT_VSCE: Personal Access Token for Visual Studio Marketplace
  • OVSX_PAT: Personal Access Token for Open VSX Registry

To obtain an Open VSX token:

  1. Create an account at https://open-vsx.org/
  2. Generate a Personal Access Token from your account settings
  3. Add the token as OVSX_PAT in the repository secrets
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft