Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>AMPL HighlightingNew to Visual Studio Code? Get it now.
AMPL Highlighting

AMPL Highlighting

Miriam Keller

| (0) | Free
Syntax highlighting for the AMPL modeling language (.mod, .dat, .run, .ampl).
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

AMPL Syntax Highlighting

Syntax highlighting for the AMPL modeling language.

This extension colors keywords, declarations, comments, strings, numbers, built-in functions and operators in AMPL files. It is a lightweight, highlighting-only extension: it does not run AMPL and does not require a local AMPL installation, so it also works in the browser version of VS Code (vscode.dev) on any device, including tablets.

Supported files

.mod, .dat, .run, .ampl

What is highlighted

  • Objective and constraint keywords (minimize, maximize, subject to)
  • Declarations (set, param, var, ...) and modifiers (integer, binary, ...)
  • Commands (model, data, solve, display, option, ...)
  • Control flow (if, then, else, for, repeat, ...)
  • Aggregation and set operators (sum, prod, forall, union, ...)
  • Built-in functions (sqrt, log, exp, ...)
  • Comments (# and /* ... */), strings, and numbers

Usage

Open any .mod, .dat, .run or .ampl file and the highlighting is applied automatically.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft