Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>lexicon-intellisenseNew to Visual Studio Code? Get it now.
lexicon-intellisense

lexicon-intellisense

Slices Network

|
2 installs
| (0) | Free
VS Code IntelliSense support for AT Protocol lexicon JSON files
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Lexicon IntelliSense

VS Code extension providing IntelliSense support for AT Protocol lexicon JSON files using the @slices/lexicon validation library.

Features

  • Real-time validation: Validates lexicon files as you type using the WASM-based @slices/lexicon validator
  • JSON Schema support: Provides autocomplete and validation using comprehensive JSON schemas
  • Cross-lexicon validation: Validates references between lexicon files in your workspace
  • Error diagnostics: Shows validation errors directly in the editor with precise location information
  • Workspace validation: Command to validate all lexicon files in your workspace

Installation

  1. Install dependencies:

    npm install
    
  2. Compile the extension:

    npm run compile
    
  3. Install in VS Code:

    • Open VS Code
    • Press F5 to launch a new Extension Development Host window
    • Open a workspace containing lexicon files

Configuration

The extension can be configured in VS Code settings:

  • lexiconIntelliSense.enableValidation: Enable/disable lexicon validation (default: true)
  • lexiconIntelliSense.lexiconDirectory: Directory containing lexicon files relative to workspace root (default: "lexicons")

Usage

Automatic Validation

The extension automatically validates:

  • JSON files in directories containing "lexicons" in the path
  • JSON files that contain lexicon-like structure (have id and defs fields)

Manual Validation

Use the command palette (Ctrl+Shift+P / Cmd+Shift+P):

  • Lexicon: Validate Current File - Validates the currently open lexicon file
  • Lexicon: Validate Workspace - Validates all lexicon files in the workspace

Features in Action

  1. Structure validation: Ensures lexicon files have required id and defs fields
  2. Type checking: Validates that definition types are correct
  3. Reference validation: Checks that references to other lexicons can be resolved
  4. Format validation: Validates string formats like datetime, uri, nsid, etc.

File Structure

packages/lexicon-intellisense/
├── package.json              # Extension manifest
├── src/
│   ├── extension.ts          # Main extension entry point
│   ├── language-server.ts    # Language server implementation
│   └── lexicon-validator.ts  # WASM validator wrapper
├── schemas/
│   └── lexicon-schema.json   # JSON schema for lexicon files
├── wasm/                     # WASM files from lexicon-rs
└── language-configuration.json

Development

Building

npm run compile

Testing

  1. Open the project in VS Code
  2. Press F5 to launch the Extension Development Host
  3. Open a workspace with lexicon files
  4. Test validation and IntelliSense features

WASM Integration

The extension uses WASM files compiled from the Rust-based lexicon-rs package for validation. These files are copied during build and provide the same validation logic used by the CLI tools.

Commands

  • lexiconIntelliSense.validateFile: Validate the current lexicon file
  • lexiconIntelliSense.validateWorkspace: Validate all lexicon files in workspace

License

MIT

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