Kraken Language Support for VS Code
Provides rich language support for the Kraken programming language.
Version: v0.2.0 — Aligned with Kraken language v0.9.2.
Features
- Syntax Highlighting — Full highlighting for
.kr files
- Code Snippets — Quick templates for functions, structs, enums, classes, traits, and control flow
- Auto-Completion — Smart bracket, quote, and parenthesis pairing
- Code Folding — Collapse and expand code blocks
- Comment Support — Line (
//), block (/* */), and doc comments (///, //!)
- Attribute Support — Highlighting for
#[...] attributes
Syntax Highlighting
- Keywords:
fn, let, mut, const, if, else, while, for, match, return, break, continue, defer, struct, enum, union, class, interface, trait, impl, type, pub, import, module, async, await, spawn, unsafe, where, static_assert, move, dyn, in
- Types:
int, float, bool, string, str, bytes, void, i8–i64, u8–u64, f32, f64, char
- Operators: Arithmetic, comparison, logical, bitwise, assignment, and compound assignment
- Literals: Numbers (decimal, hex, binary, octal, float), strings, characters, booleans,
null
- Comments: Line, block, and doc comments
- Attributes:
#[...] annotations
- Functions: Function names and declarations
Code Snippets
Type these prefixes and press Tab to expand:
fn — Function declaration
pubfn — Public function
main — Main function
asyncfn — Async function
struct — Struct definition
enum — Enum definition
union — Union definition
class — Class definition
interface — Interface definition
trait — Trait definition
impl — Impl block
if — If statement
ifelse — If-else statement
while — While loop
for — For loop
match — Match expression
let — Variable declaration
letmut — Mutable variable
defer — Defer block
import — Import declaration
module — Module declaration
spawn — Spawn async task
Example
import std.io;
fn main() -> int {
let message = "Hello, Kraken!";
io.println(message);
return 0;
}
Requirements
No additional requirements. This extension provides editor support only.
To compile Kraken code, you need the Kraken compiler.
Installation
From VS Code Marketplace
- Open VS Code
- Go to Extensions (Ctrl+Shift+X / Cmd+Shift+X)
- Search for "Kraken Language"
- Click Install
From VSIX
- Download the
.vsix file from Releases
- Open VS Code
- Go to Extensions
- Click "..." menu → "Install from VSIX"
- Select the downloaded file
Development
npm install
npm run package
code --install-extension kraken-lang-0.2.0.vsix
Contributing
Contributions are welcome. Please submit a Pull Request.
License
Apache-2.0 — See LICENSE for details.
Links
| |