Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

VS Code Extension

The MDL extension for VS Code provides a rich editing experience for .mdl files, bringing IDE-level support for Mendix Definition Language. The extension communicates with the mxcli lsp language server to provide real-time diagnostics, code completion, hover documentation, and navigation.

Feature Summary

FeatureDescription
Syntax highlightingMDL keyword, string, comment, and identifier coloring
Parse diagnosticsReal-time error reporting as you type
Semantic diagnosticsReference validation on save (entities, microflows, pages)
Code completionContext-aware keyword and snippet suggestions
HoverView MDL definitions by hovering over Module.Name references
Go-to-definitionCtrl+click to open element source as a virtual document
Document outlineNavigate MDL statements via the Outline panel
FoldingCollapse statement blocks and widget trees
Context menuRun File, Run Selection, and Check File commands
Project treeBrowse modules and documents in a Mendix-specific tree view

How It Works

The extension spawns mxcli lsp --stdio as a background process and communicates via the Language Server Protocol over standard I/O. This means all analysis, completion, and navigation is performed by the same engine that powers the mxcli command line.

┌──────────────┐     stdio      ┌──────────────────┐     ┌────────────┐
│  VS Code     │◀──────────────▶│  mxcli lsp       │────▶│  .mpr file │
│  Extension   │   LSP JSON-RPC │  --stdio          │     │            │
└──────────────┘                └──────────────────┘     └────────────┘

Requirements

  • VS Code 1.80 or later (or any VS Code fork such as Cursor)
  • mxcli binary on PATH or configured via the mdl.mxcliPath setting
  • A Mendix project (.mpr file) for semantic features

Settings

SettingDefaultDescription
mdl.mxcliPathmxcliPath to the mxcli executable
mdl.mprPath(auto-discovered)Path to .mpr file; if empty, the extension searches the workspace

Getting Started

The fastest way to get started is mxcli init, which automatically installs the extension into your project. See Installation for details, or jump to specific features: