StarLang for Visual Studio Code
StarLang language support for VS Code — smart completion, hover info, signature help, debugging with variable expansion.
Features
- Syntax highlighting for
.star files with full keyword and type coverage
- Real-time diagnostics — compiler errors as you type
- Smart completion — context-aware: keywords, types, functions with signatures, variables with types, struct fields, built-in methods after
.
- Hover information — variable types, function signatures, struct definitions
- Signature help — parameter names and types as you type function arguments
- Debug support — breakpoints, step over/into, variable inspection with array/dict/struct expansion
- Run commands — F6 to run, Shift+F6 to run in release mode
Completion
Type . after a variable to get context-aware suggestions:
| Context |
Suggestions |
arr. |
len, push, pop, contains, indexOf, slice |
str. |
len, upper, lower, trim, contains, indexOf, split |
dict. |
len, has, keys, values, delete |
myStruct. |
Field names with types |
| General |
Functions, variables, struct types, keywords, imported modules |
Hover
Hover over any identifier to see its type:
- Variables:
var count: i32
- Functions:
fn add(a: number, b: number): number
- Structs: Full definition with all fields
Debugging
Set breakpoints and step through your code. Expand arrays, dicts, and structs in the Variables panel to inspect their contents:
- Arrays show indexed elements:
[0], [1], ...
- Dicts show key-value pairs
- Structs show named fields from the struct definition
Getting Started
- Install this extension
- The StarLang toolchain (
star-lang and star-lsp) is installed automatically on first activation
- Open or create a
.star file
- Press F6 to run, F5 to debug
The toolchain can also be installed manually:
Linux / macOS:
curl -fsSL https://star-lang.com/install.sh | sh
Windows (PowerShell):
irm https://star-lang.com/install.ps1 | iex
Example
package main
struct Point {
x: number
y: number
}
fn distance(a: Point, b: Point): number {
var dx: number = b.x - a.x
var dy: number = b.y - a.y
return dx * dx + dy * dy
}
fn main():void {
var p1: Point = Point{ x: 1.0, y: 2.0 }
var p2: Point = Point{ x: 4.0, y: 6.0 }
var d: number = distance(p1, p2)
console.log("distance squared: " + d)
}
Creating a Project
star-lang init myproject
Creates:
myproject/
star.mod
main.star
.vscode/launch.json
Keyboard Shortcuts
| Shortcut |
Action |
| F6 |
Run current file |
| Shift+F6 |
Run in release mode |
| F5 |
Start debugging |
Settings
| Setting |
Description |
starlang.lspPath |
Custom path to star-lsp binary |
starlang.compilerPath |
Custom path to star-lang binary |
- Linux x64
- Windows x64
- macOS x64 / ARM64 (coming soon)
Links
| |