Monk Language VS Code Extension
Complete language support for Monk - a modern statically-typed language with memory safety, powerful built-ins, and professional development tools.
Features
🎨 Comprehensive Syntax Highlighting
- Full syntax highlighting for
.monk
and .mnk
files
- Support for Monk code blocks in Markdown files
- Enhanced highlighting for v0.0.6 features:
- Optional types with
?
syntax
- Module imports with
as
aliases
- Template literals with interpolation
- Type annotations and declarations
- All built-in functions and operators
📝 Rich Code Snippets
Over 30 intelligent code snippets for:
- Variable declarations (
let
, const
, lett
, letopt
)
- Function definitions (
func
, funcp
, asyncfunc
)
- Control flow structures (
if
, while
, for
)
- Type declarations (
type
, typeopt
)
- Module imports (
use
, useas
)
- Error handling (
guard
, guardlet
)
- Array operations (
map
, filter
, reduce
)
- And much more!
- Context menu commands for formatting and linting
- Keyboard shortcuts for common operations
- Configuration options for development tools
- Support for strict mode and enhanced static analysis
📋 IntelliSense Features
- Smart auto-closing pairs for brackets, quotes, and template literals
- Intelligent indentation rules
- Code folding support
- Word pattern recognition for better text manipulation
Installation
From VS Code Marketplace
- Open VS Code
- Go to Extensions (Ctrl+Shift+X)
- Search for "Monk Language"
- Click Install
Manual Installation
- Download the
.vsix
file from releases
- Open VS Code
- Press Ctrl+Shift+P and type "Extensions: Install from VSIX"
- Select the downloaded file
Usage
Basic Syntax Highlighting
The extension automatically provides syntax highlighting for .monk
and .mnk
files:
// Variables with type inference
let name = "Monk Language"
let version = 0.06
// Type annotations (space-separated syntax)
let count int = 42
let active boolean = true
// Optional types (v0.0.6)
let optional_value int? = 42
optional_value = none
// Type declarations
type User = {
id: int,
name: string,
email: string?
}
Code Snippets
Type any of these prefixes and press Tab:
let
→ Variable declaration
func
→ Function declaration
type
→ Type declaration
use
→ Module import
guard
→ Error handling
template
→ Template literal
Markdown Support
Monk code blocks in Markdown files are fully highlighted:
```monk
let greet = (name string) string {
return `Hello, ${name}!`
}
```
Configuration
Extension Settings
Configure the extension in VS Code settings:
{
"monk.linting.enabled": true,
"monk.formatting.enabled": true,
"monk.strictMode.enabled": false,
"monk.executablePath": "monk"
}
Available Commands
- Monk: Format Code (
Shift+Alt+F
) - Format current file
- Monk: Lint Code - Run linting on current file
- Monk: Run Script - Execute current Monk script
Language Features Supported
Core Language (v0.0.1-v0.0.5)
✅ Variables and constants
✅ Data types (int, string, float, bool, none)
✅ Arrays and records
✅ Functions with closures
✅ Control flow (if/else, while, for)
✅ Error handling (guard/against/throw)
✅ Module system (use/export)
✅ Template literals
✅ Built-in functions
Static Semantics (v0.0.6)
✅ Optional types with ?
syntax
✅ First-assignment type inference
✅ Module import aliases
✅ Enhanced type annotations
✅ Borrow checker integration
✅ Strict mode support
✅ Professional development tools
The extension integrates with Monk's development tools:
Linting
monk lint --fix src/
monk format src/
Strict Mode
monk run --strict script.monk
File Associations
The extension automatically activates for:
.monk
files
.mnk
files
- Markdown files with Monk code blocks
Troubleshooting
Syntax Highlighting Not Working
- Ensure the file has a
.monk
or .mnk
extension
- Reload VS Code (Ctrl+Shift+P → "Developer: Reload Window")
- Check that the extension is enabled
Snippets Not Appearing
- Verify that IntelliSense is enabled
- Check language mode in status bar (should show "Monk")
- Try typing snippet prefix and pressing Ctrl+Space
Markdown Code Blocks
Ensure fenced code blocks use monk
or mnk
language identifier:
```monk
// Your Monk code here
```
Contributing
Found a bug or want to request a feature?
Changelog
v0.0.6
- ✨ Added comprehensive
.mnk
extension support
- 🎨 Enhanced syntax highlighting for optional types
- 📦 Added module import aliases highlighting
- 🔧 Added 30+ code snippets
- 🛠️ Integrated development tools support
- 📋 Added configuration options
- 🔄 Enhanced markdown code block support
v0.0.3
- 🎨 Added markdown syntax highlighting
- 📝 Improved TextMate grammar
- 🔧 Enhanced auto-closing pairs
v0.0.2
- 📦 Initial VS Code Marketplace release
- 🎨 Basic syntax highlighting
- 📋 Language configuration
License
MIT License - see LICENSE for details.
Links
Enjoy coding in Monk! 🐒