Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>MessageFormat 2New to Visual Studio Code? Get it now.
MessageFormat 2

MessageFormat 2

Nicolò Ribaudo

|
57 installs
| (1) | Free
MessageFormat 2 support for Visual Studio Code
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

MessageFormat 2 for VS Code

This extension adds support for MessageFormat 2 in VS Code. MessageFormat 2 is a Unicode standard for localizable dynamic message strings, designed to make it simple to create natural sounding localized messages.

Features

  • Syntax and semantic highlighting (with bracket matching)
  • Diagnostics (syntax errors, early errors)
  • Variable completion
  • Variable rename
  • Go to definition for variables
  • Quick fixes for some errors
  • Formatting

Usage

This extension is automatically enabled on files with the .mf2 extension. To use the extension with different file extensions, you can change the language mode by running the > Change Language Mode command from the Command Palette (Ctrl/Cmd+Shift+P).

In JavaScript files, template strings inside of a new Intl.MessageFormat() expression (or new MessageFormat) will be highlighted. Template strings prefixed with /* mf2 */ are also highlighted. Auto-completion, linked rename, and diagnostics are not available in JavaScript files.

Examples

.input {$pronoun :string}
.input {$name :string}
.match $pronoun
he {{His name is {$name}.}}
she {{Her name is {$name}.}}
* {{Their name is {$name}.}}

screenshot

Syntax highlighting, and formatting

screenshot

Syntax highlighting in Intl.MessageFormat constructor

screenshot

Syntax highlighting in JavaScript template string

screenshot

Variable rename

screenshot

Diagnostics for syntax errors

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