Language Server Protocol (LSP) support for Duso in VSCode.
⚠️ Requires Duso InstallationThe LSP features (error diagnostics, hover documentation, go to definition, find references) require the
dusobinary to be installed on your system. Visit duso.rocks for installation instructions.
- Syntax Highlighting - Color coded syntax for Duso scripts
- Error Diagnostics - Real-time parse error detection
- Hover Documentation - View built-in function documentation
- Go to Definition - Jump to function and variable definitions (Ctrl+Click)
- Find References - Find all usages of variables and functions
cd vscode
npm install
code --extensionDevelopmentPath=. .This opens a new VSCode window running the extension in development mode.
Ensure the duso binary is in your PATH:
which duso
duso --versionIf duso is not found, the extension will fail to start. Make sure you've run ./build.sh in the project root.
-
Create a file
test.du:print("Hello, Duso!") function greet(name) do print("Hello, " + name) end greet("World") -
Open the file in VSCode - you should see syntax highlighting
-
Hover over
printandgreetto see documentation -
Ctrl+Click on
greet("World")to jump to the function definition -
Create a syntax error to see diagnostics:
print(1 2) # Missing comma
- Syntax errors shown in real-time with red squiggles
- Error details in the Problems panel
- Hover over built-in functions (print, len, map, etc.) to see docs
- Shows function signatures and descriptions
- Ctrl+Click on a function/variable to jump to its definition
- Works for same-file definitions in Phase 1
- Right-click → Find All References to find all usages
- Highlights all matching identifiers
The extension launches duso -lsp which:
- Reads LSP messages from VSCode over stdin
- Parses documents and analyzes them
- Sends diagnostics, hover info, and definitions back to VSCode
No separate server needed - it's built into the duso binary!
If the server doesn't start:
- Check Output panel: View → Output → Duso Language Server
- Verify
dusois in PATH:which duso - Rebuild:
./build.shin project root - Reload extension: Cmd+Shift+P → Developer: Reload Window
Currently implemented:
- ✅ Syntax highlighting
- ✅ Error diagnostics
- ✅ Hover documentation
- ✅ Go to definition (same-file)
- ✅ Find references (same-file)
Coming in Phase 2:
- Code completion
- Document symbols (outline)
- Rename refactoring
- Cross-file definitions