VS Code Extensions
A

AMPL Highlighting

by miriam-keller-unibe

Syntax highlighting for the AMPL modeling language (.mod, .dat, .run, .ampl).

Downloads

43

Rating

— (0)

Version

0.0.2

Last updated

Jun 12, 2026

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.

Related extensions