# Vort Language Support (VS Code Extension)

Vort Language Support is the official VS Code extension for the **Vort Document Localization Compiler & Workflow Scripting Language**. It integrates the native Vort Language Server (LSP) to provide a rich IDE developer experience.

## Features

1. **Syntax Highlighting**: Complete semantic and token coloring for Vort syntax, comments, variables, types (`String`, `Document`, `List`), and agent/workflow declaration structures.
2. **Diagnostics (Real-time Linter)**: Catch syntax errors, missing braces, or incorrect statement assignments immediately inside the editor with line-by-line red-line indicators.
3. **Autocompletion**: Contextual suggestions for keywords (`agent`, `workflow`, `let`, `return`), built-in filters (`load_document`, `save_document`, `extract_text`, `write_text`, `parallel`, `compute_similarity`, `estimate_row_heights`, `find_active_subtitle`, `load_extension`), and provider paths.
4. **Hover Tooltips**: Mouse-over support displaying detailed Markdown signatures and usage guides for built-in functions.

## Development and Installation

### 1. Prerequisite
Ensure you have built the Vort compiler distribution bundle in the project root:
```bash
node scripts/bundle.js
```
This produces `dist/vort.js` which is invoked by this extension's client launcher.

### 2. Local Installation for Debugging
1. Copy or symlink this directory (`tools/vscode-extension/`) into your VS Code extensions folder:
   - **Windows**: `%USERPROFILE%\.vscode\extensions\vscode-vort`
   - **macOS/Linux**: `~/.vscode/extensions/vscode-vort`
2. Open the extension directory in VS Code and install client dependencies:
   ```bash
   npm install
   ```
3. Restart or reload VS Code. Any `.vort` file opened will now activate this extension and boot the language server automatically.

### 3. Packaging to .vsix
To compile and bundle the extension into a single portable `.vsix` installer:
1. Install VS Code Extension Manager globally:
   ```bash
   npm install -g @vscode/vsce
   ```
2. Package the extension:
   ```bash
   vsce package
   ```
3. Install the generated `.vsix` in VS Code via command palette: `Extensions: Install from VSIX...`.
