Canonical repository: https://git.sr.ht/~klahr/quadrate-vscode
Code - OSS / Visual Studio Code for the Quadrate programming language.
- Syntax Highlighting: Full TextMate grammar for
.qdfiles - LSP Integration: Language server support via quadlsp
- Auto-completion: Built-in instructions and user-defined functions
- Diagnostics: Real-time error and warning detection
- Go to Definition: Navigate to function and variable definitions
- Find References: Find all usages of a symbol
- Rename Symbol: Scoped renaming of variables and functions
- Document Formatting: Format code on demand
- Hover Documentation: View function signatures and documentation
- Signature Help: Function signatures while typing
- Document Highlight: Highlight other occurrences of symbol under cursor
- Code Folding: Fold functions and blocks
- Debugging: GDB/LLDB integration via cppdbg
quadlsp binary from the Quadrate compiler:
git clone https://git.sr.ht/~klahr/quadrate
cd quadrate
make release && sudo make installOr use a local build:
make debug
# Binary at: build/debug/cmd/quadlsp/quadlsp- Node.js and npm
git clone https://git.sr.ht/~klahr/quadrate-vscode
cd quadrate-vscode
./install.shThe install script will:
- Install npm dependencies
- Compile TypeScript
- Symlink the extension to your VS Code extensions directory
- Clone and build:
git clone https://git.sr.ht/~klahr/quadrate-vscode
cd quadrate-vscode
npm install
npm run compile- Install the extension:
Option A - Symlink (recommended for development):
# For VS Code
ln -s "$(pwd)" ~/.vscode/extensions/quadrate-0.1.0
# For VSCodium
ln -s "$(pwd)" ~/.vscode-oss/extensions/quadrate-0.1.0Option B - Package and install:
npm install -g vsce
vsce package
code --install-extension quadrate-0.1.0.vsix- Reload VS Code (Ctrl+Shift+P -> "Developer: Reload Window")
Add to your VS Code settings.json:
{
"quadrate.lsp.path": "quadlsp",
"quadrate.lint.enabled": true,
"quadrate.lint.path": "quadlint"
}{
"quadrate.lsp.path": "/path/to/quadrate/build/debug/cmd/quadlsp/quadlsp"
}The extension includes debugging support via the C/C++ debugger.
-
Install the C/C++ extension
-
Create
.vscode/launch.json:
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug Quadrate",
"type": "quadrate",
"request": "launch",
"program": "${workspaceFolder}/${fileBasenameNoExtension}_debug",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"preLaunchTask": "quadrate: build-debug"
}
]
}- Compile with debug symbols and run:
- Press F5 to build with
-gflag and start debugging - Set breakpoints in your
.qdfiles - Step through code, inspect variables
- Press F5 to build with
Default VS Code LSP key bindings apply:
| Key | Action |
|---|---|
F12 |
Go to definition |
Shift+F12 |
Find references |
F2 |
Rename symbol |
Ctrl+Space |
Trigger completion |
Ctrl+Shift+Space |
Trigger signature help |
Shift+Alt+F |
Format document |
Ctrl+. |
Quick fix / code actions |
The extension provides built-in tasks:
- quadrate: build-debug - Compile current file with debug symbols
Access via: Terminal -> Run Task -> quadrate
- Check if quadlsp is in PATH:
which quadlsp-
Check Output panel: View -> Output -> Quadrate Language Server
-
Verify extension is loaded: Extensions panel should show "Quadrate"
- Ensure file has
.qdextension - Check language mode in status bar (should show "Quadrate")
- Try: Ctrl+Shift+P -> "Change Language Mode" -> "Quadrate"
- Verify LSP is running (check Output panel)
- Try manual trigger: Ctrl+Space
- Check that cursor is in a valid position
npm install
npm run compilenpm run watchnpm install -g vsce
vsce packagePatches welcome!
Email: ~klahr/quadrate@lists.sr.ht GitHub: https://github.com/quadrate-lang/quadrate-vscode
GNU General Public License v3.0
See LICENSE for full terms.
- Quadrate Language: https://git.sr.ht/~klahr/quadrate
- Documentation: https://quad.r8.rs
- VS Code Extension API: https://code.visualstudio.com/api