Skip to content

bytecodealliance/vscode-wit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

To install from source, follow these steps:

  • Clone the repository: git clone https://github.com/bytecodealliance/vscode-wit.git && cd vscode-wit
  • Run npm commands to install: npm ci && npm run install-plugin

About

Visual Studio Code extension to recognize and highlight the WebAssembly Interface Type (WIT) IDL.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 10