Miranda Dev HelperA professional, feature-complete VS Code extension for the Miranda functional programming language. Features🔍 Advanced ESLint-style Linter10 configurable lint rules with individual severity levels (
⚡ Quick Fixes (Auto-fixable)The lightbulb
📝 Syntax HighlightingFull TextMate grammar covering:
🔤 Hover DocumentationHover over any keyword or operator for inline docs:
📐 Document Formatter (
|
| Prefix | Expands to |
|---|---|
fun |
Function with type annotation |
fung |
Function with guards |
ite |
if-then-else expression |
where |
Expression with where clause |
letin |
let-in expression |
type |
Type synonym |
abstype |
Algebraic type declaration |
lc |
List comprehension |
rec |
Recursive function |
map |
map via list comprehension |
filter |
filter via list comprehension |
foldr / foldl |
Fold definitions |
header |
Script file header |
📊 Status Bar
Live error/warning count in the status bar. Click it for a full lint summary showing issues by rule.
Installation
Development Mode (Recommended for testing)
# 1. Install dependencies
npm install
# 2. Compile TypeScript
npm run compile
# 3. Open project in VS Code
code .
# 4. Press F5 to open Extension Development Host
# 5. Open test-files/test.miranda in the new window
Package as VSIX
npm install -g @vscode/vsce
vsce package
# Produces: miranda-linter-1.0.0.vsix
# Install:
code --install-extension miranda-linter-1.0.0.vsix
Configuration
All settings are under miranda.* in VS Code settings (Ctrl+,):
{
// Enable/disable linter entirely
"miranda.linter.enabled": true,
// Indentation size (spaces)
"miranda.linter.indentSize": 4,
// Max line length (0 = disabled)
"miranda.linter.maxLineLength": 80,
// Per-rule severity: "off" | "warn" | "error"
"miranda.linter.rules.missingEquals": "error",
"miranda.linter.rules.unbalancedParens": "error",
"miranda.linter.rules.incompleteConditional": "warn",
"miranda.linter.rules.unusedVariables": "warn",
"miranda.linter.rules.typeAnnotations": "warn",
"miranda.linter.rules.lineLength": "warn",
"miranda.linter.rules.trailingWhitespace": "warn",
"miranda.linter.rules.mixedIndentation": "error",
"miranda.linter.rules.guardStyle": "warn",
"miranda.linter.rules.listComprehension": "warn",
"miranda.linter.rules.whereIndent": "warn",
// Formatter
"miranda.formatter.enabled": true,
"miranda.formatter.normalizeOperators": true
}
Keyboard Shortcuts
| Shortcut | Action |
|---|---|
Shift+Alt+F |
Format document |
Shift+Alt+X |
Fix all auto-fixable issues |
Commands (Command Palette Ctrl+Shift+P)
Miranda: Format DocumentMiranda: Run LinterMiranda: Show Lint SummaryMiranda: Fix All Auto-Fixable Issues
Test File
Open test-files/test.miranda to see all lint rules in action. It contains:
- ✅ Section 1 — 13 correct Miranda functions (no issues)
- ❌ Section 2 —
missing-equalstriggers - ❌ Section 3 —
unbalanced-parenstriggers - ⚠️ Section 4 —
incomplete-conditionaltriggers - ⚠️ Section 5 —
trailing-whitespace(auto-fixable) - ⚠️ Section 6 —
type-annotationsmissing - ⚠️ Section 7 —
guard-styleissues (auto-fixable) - ⚠️ Section 8 —
line-lengthexceeded - ❌ Section 9 —
mixed-indentation(tabs, auto-fixable) - ⚠️ Section 10 —
where-indentwrong spacing (auto-fixable) - 📖 Section 11 — Hover documentation examples
- ✂️ Section 12 — All snippet prefixes listed
- 📐 Section 13 — Formatter test (use
Shift+Alt+F) - 🔬 Section 14 — Complex realistic Miranda programs
Language Notes
Miranda uses || for line comments, = for both equality in patterns and function bodies, :: for type annotations, and -> for function types. Layout (indentation) is significant for where and let blocks.
Built with ❤️ for Miranda programmers.