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
Structure validation: Ensures lexicon files have required id and defs fields
Type checking: Validates that definition types are correct
Reference validation: Checks that references to other lexicons can be resolved
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
Open the project in VS Code
Press F5 to launch the Extension Development Host
Open a workspace with lexicon files
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