Language Server Protocol implementation for HED (Hierarchical Event Descriptors), providing intelligent editing support for annotating neuroimaging data in BIDS datasets.
Validates HED strings against the official HED schema with inline error and warning markers.
Context-aware tag suggestions from the HED hierarchy with semantic search.
Navigate from Def/Name references to their Definition/Name declarations with Go to Definition (F12).
View tag descriptions, full paths, and related tags on hover.
Type natural language terms to find relevant HED tags. Warnings help catch deviations from HED, like tag extension.
- JSON sidecars (
*_events.json,dataset_description.json) - TSV files (
*_events.tsv)
- Open VS Code
- Go to Extensions (Ctrl+Shift+X / Cmd+Shift+X)
- Search for "HED Language Support"
- Click Install
Download the .vsix file from GitHub Releases and install:
code --install-extension hed-lsp-0.3.0.vsixConfigure the HED schema version in your VS Code settings:
{
"hed.schemaVersion": "8.3.0"
}The extension automatically detects schema versions from dataset_description.json when present.
- Standard Schema: HED 8.x (default: 8.3.0)
- Library Schemas: SCORE, LANG, and other HED libraries
- Type
/after a tag to see child tags - Type
,or(to see top-level tags - Type natural language terms (e.g., "button press") for semantic suggestions
- After
Def/, see definitions from the current document
- Errors appear as red squiggles with diagnostic messages
- Warnings appear as yellow squiggles
{column}placeholders are automatically skipped during validation
- Hover: View tag documentation
- Go to Definition (F12): Jump from
Def/NametoDefinition/Name
The hed-suggest CLI provides HED tag suggestions for external tools and scripts.
cd server
npm install
npm run compile
# Option 1: Use directly with node
node ./out/cli.js "button press"
# Option 2: Install globally
npm link # Makes hed-suggest available in PATH# Basic usage
hed-suggest "button press"
# Button, Response-button, Mouse-button, Press, Push
# Multiple queries
hed-suggest "button" "stimulus" "response"
# JSON output for programmatic use
hed-suggest --json "button press" "visual flash"
# {"button press": ["Button", ...], "visual flash": ["Flash", ...]}
# Limit results
hed-suggest --top 5 "stimulus"
# Use specific schema version
hed-suggest --schema 8.3.0 "response"
# Enable semantic search (requires model download on first use)
hed-suggest --semantic "participant action"| Option | Description |
|---|---|
-j, --json |
Output results as JSON |
-s, --schema VER |
Use specific schema version (default: 8.4.0) |
-n, --top N |
Return top N suggestions (default: 10) |
--semantic |
Use semantic search with embeddings |
-h, --help |
Show help message |
# Clone the repository
git clone https://github.com/hed-standard/hed-lsp.git
cd hed-lsp
# Install dependencies
npm install
# Compile
npm run compile
# Run tests
cd server && npm test
# Package extension
npx @vscode/vsce packagehed-lsp/
├── client/ # VS Code extension client
│ └── src/
│ └── extension.ts
├── server/ # LSP server implementation
│ └── src/
│ ├── server.ts # LSP connection and handlers
│ ├── cli.ts # hed-suggest CLI tool
│ ├── validation.ts # HED validation
│ ├── completion.ts # Autocomplete provider
│ ├── hover.ts # Hover documentation
│ ├── embeddings.ts # Semantic search
│ └── definitionProvider.ts
├── docs/ # Architecture documentation
└── .github/ # CI/CD workflows
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
Use the issue templates for bug reports and feature requests.
MIT License. See LICENSE for details.
- HED Resources - HED documentation and tutorials
- hed-python - Python HED tools (
hedtoolson PyPI) - hed-javascript - JavaScript HED validator (
hed-validatoron npm) - hed-schemas - HED schema definitions
Developed by Seyed Yahya Shirazi for the HED Working Group.




