Provides syntax highlighting, snippets, language server integration, debugging, and testing for the Skink programming language.
-
Language Server (LSP) — Full IDE features via
skink-lsp(written in Skink itself):- Diagnostics — Real-time error checking as you type
- Completion — Keywords, snippets, identifiers, and built-in types/functions
- Hover — Type information and function signatures on hover
- Go to Definition — Jump to symbol definitions
- Document Symbols — Outline view of functions, structs, enums, and constants
- Semantic Tokens — Enhanced syntax highlighting based on semantic analysis
- Document Highlights — Highlight all occurrences of a symbol
- References — Find all references to a symbol
- Rename — Rename symbols across the document
-
Formatting — The extension registers itself as a VS Code formatter for
.skinkfiles, so it works just like any other formatter:- Use Format Document (
Shift+Alt+F) or Format Selection (Ctrl+K Ctrl+F) - Enable Format on Save with
"editor.formatOnSave": true - Set it as the default formatter with
"editor.defaultFormatter": "skink-lang.skink-lang" - Pick it from the Format Document With... context menu
- Runs in the extension host — no language server required
- Consistent 4-space indentation, trailing-whitespace trimming, and
bracket-based indent adjustment (mirrors
skink-lsp's formatting)
- Use Format Document (
-
Syntax Highlighting — Full TextMate grammar covering:
- Keywords (
fn,pub,struct,enum,if,for,match,defer,unsafe,async,await,spawn,select,comptime,ruleset,service,extern, etc.) - Primitive types (
int,int8–int64,uint,uint8–uint64,float,bool,string,bytes,void) - Collection types (
chan,tensor,set,[]T,map) - Attributes (
[packed],[cuda],[inline], etc.) - String interpolation with
{expression}inside double-quoted strings - Numeric literals (decimal, hex
0x, binary0b, octal0o, floats with exponent) - Comments (
//,/* */,///documentation) - Operators (arithmetic, bitwise, logical, comparison, assignment, channel
<-)
- Keywords (
-
Code Snippets — Quickly scaffold common Skink constructs:
fn/pubfn— function declarationsstruct/gstruct— struct and generic structenum— enumerationif/ife/forin/forc/while/until/match— control flowservice/ruleset— service and ruleset definitionsselect/chan/spawn/async— concurrency primitivesdefer/unsafe/with/comptime— statementsimport/importb/module/extern— module systemtensor— tensor declarationerrret/errprop— error handlingdoc— documentation comment block
-
Debugging — Compile and debug Skink programs with CodeLLDB or the C/C++ extension:
- Press
F5to compile the current.skinkfile and launch the native debugger - Automatically detects CodeLLDB (
vadimcn.vscode-lldb) or C/C++ Tools (ms-vscode.cpptools) - Falls back to prompting to install CodeLLDB if neither is available
- Press
-
Testing — Run
*_test.skinkfiles directly from the VS Code Test Explorer:- Discovers tests automatically from files matching
*_test.skink - Parses
fn Test*(...)functions in each test file - Run all tests, a single file, or individual tests
- Results appear inline in the editor and in the Test Explorer panel
- Uses the
skink testcommand under the hood
- Discovers tests automatically from files matching
-
Language Configuration:
- Auto-closing pairs for brackets, parentheses, and quotes
- Comment toggling (
Ctrl+/) - Indentation rules for
{}blocks - Word pattern for identifier selection
- Doc-comment continuation (
///)
-
Skink compiler — The extension looks for the
skinkexecutable in:skink.compilerPathsettingPATHenvironment variable- Workspace-relative paths (
skink/compiler/cmd/skink/skink) - Extension-relative paths (when running from the repo)
-
skink-lsp language server — The extension looks for the
skink-lspbinary in:skink.lspPathsetting- Workspace-relative paths (
skink-lsp/skink-lsp) - Extension-relative paths (when running from the repo)
PATHenvironment variable- Common install locations (
/usr/local/bin/skink-lsp,~/.local/bin/skink-lsp)
-
Native debugger (for debugging) — Install one of:
| Setting | Description |
|---|---|
skink.compilerPath |
Absolute path to the skink compiler executable |
skink.skinkHome |
Directory containing lib/ and std/ (sets SKINK_HOME env var) |
skink.lspPath |
Absolute path to the skink-lsp language server binary |
skink.enableLSP |
Enable/disable the language server (default: true) |
skink.format.enable |
Register the extension as a formatter for .skink files (default: true) |
skink.format.indentSize |
Spaces per indent level (defaults to the editor's tabSize) |
skink.format.insertSpaces |
Indent with spaces instead of tabs (defaults to the editor's insertSpaces) |
skink.format.trimTrailingWhitespace |
Remove trailing whitespace from each line (default: true) |
skink.format.ensureFinalNewline |
Ensure the file ends with a trailing newline (default: true) |
Example settings.json:
{
"skink.compilerPath": "/home/user/skink/skink",
"skink.skinkHome": "/home/user/skink",
"skink.lspPath": "/home/user/skink-lsp/skink-lsp",
"editor.defaultFormatter": "skink-lang.skink-lang",
"editor.formatOnSave": true,
"skink.format.indentSize": 4
}Add to your workspace .vscode/launch.json:
{
"type": "Skink",
"request": "launch",
"name": "Debug Skink File",
"program": "${file}",
"compilerPath": "${workspaceFolder}/skink/compiler/cmd/skink/skink",
"skinkHome": "${workspaceFolder}/skink/compiler"
}- Clone the repository
- Open the
Skink-vscodefolder in VS Code - Press
F5to launch a new Extension Development Host window with the extension loaded
cd Skink-vscode
npm install -g @vscode/vsce
vsce packageThen install the generated .vsix file via the Extensions panel (Install from VSIX...).
Files with the .skink extension are automatically recognized as Skink source files.
module example
/// Clamps a value between a minimum and maximum.
pub fn clamp(val: float, min: float, max: float) -> float {
if val < min { return min }
if val > max { return max }
return val
}
fn main() -> int {
result := clamp(15.0, 0.0, 10.0)
print("Clamped: {result}")
return 0
}
MIT