A complete MIDL3 development environment β catch errors as you type, get context-aware completions, and ship correct WinRT APIs faster.
Errors and warnings surface instantly as you type β no build step required. Syntax errors, undefined types, MIDL2/MIDL3 migration issues, and duplicate definitions are caught with precise source locations and actionable messages.
Completions adapt to where your cursor is. Inside an attribute bracket on a runtimeclass? You'll see activatable, composable, contract. Inside a struct body? Only value types that are valid there. Inside attribute arguments like [threading(|? You'll get sta, mta, both.
Includes WinRT primitives, collection/async types, external .winmd types, and trigger characters on . and space.
16 built-in code quality rules with one-click quick fixers β enforce WinRT naming conventions, simplify verbose patterns, and catch common mistakes.
Methods returning IAsyncOperation or IAsyncAction should follow the Async suffix convention. WinMIDL detects violations and offers one-click renames.
F12 on any Windows SDK type jumps to a decompiled IDL view straight from the .winmd β no source code needed.
Rename a symbol and all its references in one shot. Works across interface declarations, requires clauses, and return types.
Type a dot after any Windows namespace and IntelliSense walks you through the hierarchy β Windows. β UI. β Composition, Core, Xamlβ¦
Hover any Windows SDK type to see its documentation inline, with a direct link to Microsoft Learn. The side panel shows full API docs without leaving VS Code.
Full TextMate grammar covering both MIDL3 and classic MIDL syntax:
- Keywords β
namespace,runtimeclass,interface,delegate,struct,enum,event,import,apicontract, and classic keywords likecoclass,library,typedef,union - Types β WinRT primitives (
Boolean,Int32,String,Guid,Object, β¦) and classic types (HRESULT,BSTR,IUnknown,IDispatch, β¦) - Qualified type names β Dotted names like
Windows.Foundation.Urihighlighted as types - Attributes β Keywords inside
[...]brackets (e.g.,uuid,contract,activatable,composable,threading,deprecated, and many more) - GUIDs β Inline GUID literals colorized as constants
- Strings, numbers, comments β Double-quoted strings with escape sequences, hex (
0xFF) and decimal literals, line (//) and block (/* */) comments - Storage modifiers β
static,partial,unsealed,protected,overridable,get,set,out,ref,const
19 snippets for common MIDL3 patterns β type a prefix and press Tab:
| Prefix | Description |
|---|---|
namespace |
Namespace declaration |
runtimeclass |
Runtime class with default constructor |
unsealedruntimeclass |
Unsealed (composable) runtime class with base class |
staticruntimeclass |
Static-only runtime class |
interface |
Interface declaration |
interfacerequires |
Interface with requires clause |
delegate |
Delegate type |
struct |
Struct with fields |
enum |
Enumeration |
flagsenum |
Flags enumeration with [flags] attribute |
propget |
Read-only property ({ get; }) |
proprw |
Read-write property (shorthand) |
event |
Typed event (TypedEventHandler) |
asyncmethod |
Async method returning IAsyncOperation<T> |
asyncaction |
Async method returning IAsyncAction |
contract |
Contract version attribute |
apicontract |
API contract definition with [contractversion] |
versionedblock |
Versioned member block with contract attribute |
import |
Import directive |
Hover over any token for contextual documentation β keywords, built-in types, user-defined types, and external .winmd symbols.
Ctrl+Click or F12 on any type or member name to jump to its declaration. Also works on attribute names β F12 on [threading] or [contract] navigates to the SDK attribute type definition (decompiled from .winmd).
Shift+F12 to find every usage of a symbol in the document.
Parameter hints triggered by ( and , β shows full method/constructor/delegate signatures with active parameter highlighting. Also works inside attribute arguments: [contract(| shows (ContractName, version), [composable(| shows (FactoryType, access, version), etc.
Collapse namespaces, runtime classes, interfaces, structs, enums, and versioned blocks using the editor fold controls.
14 semantic token types with declaration/static modifiers β identifiers resolved against the compilation for precise highlighting.
Shift+Alt+F β consistent 4-space indentation, normalized spacing, blank lines between declarations, trailing whitespace cleanup.
Hierarchical symbol tree in Outline view and Breadcrumbs β namespaces, types, and members.
Each namespace block shows a summary of its contained types β e.g., 2 enums, 3 classes, 1 interface.
Triple-slash comments are parsed as XML doc comments:
- Hover shows
<summary>text for documented types and members - Autocomplete generates
<param>and<returns>skeletons /docCLI switch emits.xdcXML doc comment files
Code inside #ifdef / #ifndef blocks that are inactive (based on defined macros) is rendered with reduced opacity. Configure active defines via midl.defines in settings.
Command: MIDL: Show Class Diagram
Generates a UML-style class diagram from the current IDL file:
- Color-coded type boxes (enum, struct, interface, class, delegate)
- UML inheritance and implementation arrows
- Drag nodes to rearrange the layout
- Right-click β Copy as PNG to clipboard
- Ctrl+scroll to zoom in/out
Comment toggling, bracket matching, auto-closing pairs, smart indentation, and doc comment continuation β all configured out of the box.
| Setting | Type | Default | Description |
|---|---|---|---|
midl.strictMode |
boolean |
true |
Enable strict MIDL3 mode. Classic MIDL constructs (coclass, library, typedef, etc.) produce warnings. Disable for mixed MIDL2/MIDL3 codebases. |
midl.codeQualityHints |
boolean |
true |
Show code quality hints (naming conventions, empty types, etc.) |
midl.useWindowsSdk |
boolean |
true |
Automatically reference Windows.winmd from the installed Windows SDK for type completion and F12 navigation. |
midl.windowsSdkVersion |
string |
"latest" |
Windows SDK version to use. Use the MIDL: Select Windows SDK Version command to pick from installed versions. |
midl.flatSdkTypeCompletions |
boolean |
false |
Show all SDK types by short name in completions (e.g. Button, Control). When off, only namespace names appear and you drill in with dot notation. |
midl.fetchSdkDocs |
boolean |
true |
Fetch type descriptions from Microsoft Learn on hover. Requires internet access. |
midl.inlineDocsBrowser |
boolean |
true |
Open Microsoft Learn documentation in a VS Code side panel instead of the external browser. |
midl.defines |
array |
[] |
Preprocessor defines for inactive region detection (e.g., ["FEATURE_X", "DEBUG"]). |
midl.serverPath |
string |
"midl" |
Path to the MIDL CLI executable. The extension ships its own copy β you shouldn't need to change this unless using a custom build. |
Install MIDL Language Support from the VS Code marketplace or from a .vsix package.
The extension activates automatically when you open any .idl file. All features β syntax highlighting, diagnostics, completions, hover, and more β are available immediately.
- VS Code 1.85+ β Minimum supported VS Code version
The extension ships a self-contained Native AOT binary β no .NET SDK or runtime installation required.
- Go to Definition β Works within the current file, across
.idlfiles (viawinmidl.jsonor// @ref:directives), and for external.winmdtypes (decompiled view) - Full document sync β The entire document is re-sent and reparsed on every keystroke (incremental text sync planned)
- No refactoring β Code actions are available but full refactoring support is still growing
MIT








