Highly ambitious ATProtocol AppView service and sdks
README.md

Lexicon IntelliSense#

VS Code extension providing IntelliSense support for AT Protocol lexicon JSON files.

Features#

  • Real-time validation: Validates lexicon files as you type
  • 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 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

Validation#

The extension provides comprehensive AT Protocol lexicon validation including structure validation, type checking, reference validation, and format validation.

Commands#

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

License#

MIT