A Visual Studio Code extension that helps detect simple pattern matching issues in Miranda functions.
Features
Duplicate pattern detection.
Unreachable pattern detection.
Basic list coverage checks.
Integrated diagnostics in VS Code.
Hover details showing pattern evaluation order.
CodeLens summaries with pattern and issue counts.
Command Miranda: Analyze Pattern Matching.
Screenshots
Duplicate Pattern Detection
Detects duplicated patterns and reports them directly in the editor.
Missing List Coverage Detection
Warns when a function handles non-empty lists but does not handle the empty list case.
Detailed Diagnostics
Provides contextual diagnostics describing the detected issue.
Pattern Evaluation Hover
Displays the order in which patterns are evaluated.
Usage
Open a .mir or .m file and:
Edit or save the file to trigger automatic analysis.
Use the Command Palette (Ctrl+Shift+P) and run Miranda: Analyze Pattern Matching.
Hover over function names to inspect pattern evaluation order.
Review diagnostics and CodeLens information directly in the editor.
Available Commands
Command
Description
Miranda: Analyze Pattern Matching
Runs the pattern matching analysis for the active file.
Limitations
This analyzer is lightweight and heuristic-based. It does not implement a full Miranda parser and does not analyze complex expressions, guards, or multiple definitions on the same line.