Full-featured Language Server Protocol implementation for MOHAA Morpheus Script (.scr files), with integrated debugging support for OpenMOHAA.
- Completions: 1,279 built-in functions + 94 Reborn/NightFall community functions
- Hover Documentation: Function syntax, descriptions, and examples
- Signature Help: Parameter hints as you type
- Inlay Hints: See parameter names inline
- Go to Definition: Thread, label, and variable navigation (including cross-file)
- Find All References: Variable and thread usage tracking across the workspace
- Rename: Safe symbol renaming for variables, threads, and labels
- Document Symbols: Thread and label outline
- Workspace Symbols: Search symbols across all files
- Call Hierarchy: View incoming/outgoing call relationships
- Semantic Highlighting: Rich syntax coloring distinguishing parameters, local variables, properties, and functions
- Code Actions: Quick fixes for common issues (e.g., correcting
==assignments, replacing deprecated functions) - Code Lens: See reference counts for functions
- Diagnostics: Tree-sitter syntax validation + semantic checks
- Formatting: AST-aware code formatting
- Document Links: Clickable file references in exec/local commands
- Attach to OpenMOHAA: Connect to running game's debug server
- Breakpoints: Set, remove, and manage breakpoints
- Call Stack: View execution stack when paused
- Variables: Inspect local and level variables
- Path Translation: Automatic workspace <-> game path conversion
- Morfuse Integration: Validate scripts with the actual game compiler
- Task Provider: Auto-detected validation tasks
- Problem Matcher: Parse morfuse errors into VS Code problems
Filter completions by game version:
- AA: Allied Assault (base game)
- SH: Spearhead expansion
- BT: Breakthrough expansion
- OPM: OpenMOHAA community remake
- Reborn: Reborn community patch
- NightFall: NightFall community patch
- Open VS Code
- Go to Extensions (Ctrl+Shift+X)
- Search for "Morpheus Script"
- Click Install
- Download the
.vsixfile from Releases - In VS Code, go to Extensions > ... > Install from VSIX...
- Select the downloaded file
git clone https://github.com/mohaa-community/mohaa-lsp.git
cd mohaa-lsp
pnpm install
pnpm build
pnpm package- Install the extension
- Open any
.scrfile - Start coding with full IntelliSense support!
{
"morpheus.gameVersion": ["AA", "SH", "BT"],
"morpheus.validation.mfusePath": "/path/to/mfuse_exec",
"morpheus.validation.trigger": "onSave",
"morpheus.formatting.enable": true,
"morpheus.trace.server": "off"
}Only supported in DAP Enabled OPM builds.
Create a .vscode/launch.json:
{
"version": "0.2.0",
"configurations": [
{
"type": "openmohaa",
"request": "attach",
"name": "Attach to OpenMOHAA",
"port": 4711,
"host": "localhost"
}
]
}Then:
- Start OpenMOHAA with debug mode enabled
- Press F5 in VS Code to attach
- Set breakpoints in your .scr files
- Run the script in-game - execution will pause at breakpoints
The extension auto-detects morfuse tasks when morpheus.validation.mfusePath is configured. Run with:
Ctrl+Shift+B> Select "Morfuse: Validate Project"- Or: Terminal > Run Task > morfuse
| Action | Windows/Linux | macOS |
|---|---|---|
| Go to Definition | F12 or Ctrl+Click | F12 or Cmd+Click |
| Peek Definition | Alt+F12 | Option+F12 |
| Find All References | Shift+F12 | Shift+F12 |
| Go to Symbol in File | Ctrl+Shift+O | Cmd+Shift+O |
| Go to Symbol in Workspace | Ctrl+T | Cmd+T |
| Rename Symbol | F2 | F2 |
| Trigger Suggestions | Ctrl+Space | Ctrl+Space |
| Show Hover | Ctrl+K Ctrl+I | Cmd+K Cmd+I |
- Node.js 18+
- pnpm
- Emscripten (optional, for rebuilding WASM)
pnpm install
pnpm build
pnpm testmohaa-lsp/
+-- packages/
| +-- tree-sitter-morpheus/ # Grammar
| +-- morpheus-lsp/ # Server
| +-- vscode-morpheus/ # VS Code
+-- editors/
| +-- neovim/ # Neovim config
| +-- claude-code/ # Claude Code config
+-- scripts/
+-- build.sh # Build automation
+-- verify-scr.sh # Parser verification
- Tree-sitter grammar and initial LSP by Feho
- DAP debugger and morfuse integration from morpheus-vscode
- Function documentation sourced from SublimeMOHAA
- OpenMOHAA community for testing and feedback

