Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>MiniZinc InteractiveNew to Visual Studio Code? Get it now.
MiniZinc Interactive

MiniZinc Interactive

SoNar Labs

|
14 installs
| (1) | Free
A VS Code extension that brings interactive development, real-time diagnostics, quick fixes, and visual analytics to your MiniZinc workflow.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Features

Direct Compilation & Execution (Standard Run)

Compile and run models instantly without leaving your code editor.

  • Top-Right Quick-Access Icon: Click the Play (▶) icon on the top-right editor bar to execute your model immediately, or the dropdown arrow (∨) next to it to run it with data.
  • Keyboard Shortcuts: Run models directly using the default keyboard shortcut Ctrl+R (or Cmd+R on macOS) or Ctrl+F5.
  • Run with Data File Picker: Prompt and select .dzn data files interactively from your workspace using a fast search dropdown list.
  • Associated Data File Status Indicator: Displays the currently associated .dzn data file for your active .mzn model in the status bar. Clicking it opens a quick menu to change or clear the association.
  • Standard Output Terminal: Visualizes all solver outputs and execution statistics in a dedicated "MiniZinc Standard Run" output panel.

Solver Dashboard

For a more advanced interface, launch the interactive Solver Dashboard webview.

  • Top-Right Quick-Access Icon: Click the circular Dashboard icon on the top-right editor bar to open the dashboard webview.
  • Custom Solvers: Select dynamically from any locally installed MiniZinc solver (e.g., Gecode, Chuffed, COIN-OR CBC, etc.).
  • Interactive Control: Stop, restart, or run models dynamically.
  • Real-Time Stream: Visualizes solution streaming, search statistics, and solver exit statuses.
  • Data File Configuration: Easily choose separate .dzn datasets directly from the dashboard workspace.
  • Solving Flags: Toggle finding all solutions (-a), exporting solver statistics (-s), and specifying custom time limits or arguments.

Real-Time Diagnostics (Linter)

Never guess compilation or syntax errors again.

  • Debounced Validation: Checks model validity in the background on file change or save.
  • Inline Highlighting: Surfaces precise syntax and type error line numbers, columns, and compiler messages directly in your editor.

Quick Fixes (Code Actions)

Accelerate modeling with context-aware automated quick fixes (Ctrl+. or Cmd+.):

  • Missing Library Auto-Include: Automatically inserts standard imports (e.g., include "alldifferent.mzn";) when using global constraints.
  • Workspace-Wide Dependency Resolving: Scans other workspace files for definitions and suggests relative includes.
  • Keyword Typo Correction: Corrects typos in MiniZinc keywords (e.g., solve, constraint, predicate, satisfy).
  • Predicate & Function Stub Generation: Generate placeholder stubs at the end of the file when calling an undefined function or predicate.

Advanced IDE Intelligence

Rich language client features:

  • Go to Definition (F12): Instantly jump to variables, constants, predicates, or function declarations.
  • Find References (Shift+F12): Locate all occurrences of a symbol across your model.
  • Rename Symbol (F2): Rename identifiers safely across the entire document.
  • Outline view (Ctrl+Shift+O or Cmd+Shift+O): Explore and navigate model declarations with structured symbols outline.

Auto-Complete Snippets

Includes standard templates for writing MiniZinc structures efficiently:

  • constraint: Standard constraint declarations
  • forall / sum: Loop quantifiers
  • varint / varbool / varfloat / arrayvarint: Decision variables and arrays
  • solvesat / solvemin / solvemax: Objective configurations
  • output: Output rendering blocks

Installation & Setup

Prerequisites

  1. MiniZinc: Ensure the minizinc compiler is installed and available in your environment's PATH. You can check this by running:
    minizinc --version
    

Extension Commands

Command Title Default Shortcuts Description
minizinc.runModel MiniZinc: Run Model Directly Ctrl+R / Cmd+R / Ctrl+F5 Compiles and runs the active model directly with default settings.
minizinc.runModelWithData MiniZinc: Run Model with Data File... - Prompts for a workspace .dzn file and runs the model.
minizinc.openDashboard MiniZinc: Open Interactive Solver Dashboard - Launches the graphical webview solver dashboard.
minizinc.statusBarClicked MiniZinc: Status Bar Menu - Opens options to select or clear the DZN file associated with the active MZN model.

You can trigger these commands from the Command Palette, the editor tab title bar (using the shortcut icons), the editor context menu (right-click), or by clicking the status bar component.


Resources

  • Source Code: GitHub Repository
  • Issue Tracker: Report Bugs or Request Features
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft