Motoko language support for VS Code.
46
stars
443
commits
JavaScript
primary language
Sep 9, 2026
updated
Motoko language support for Visual Studio Code.
Motoko is a high-level smart contract language for the Internet Computer.
This IDE extension provides type checking, formatting, snippets, and more for Motoko canister development.
Get this extension through the VS Marketplace, or alternatively the Extensions panel in your VS Code project.
VSCodium users can download the extension through Open VSX or the GitHub releases page.
Below are the default key bindings for commonly used features supported in the extension:
Shift + Alt + F): format a Motoko file using prettier-plugin-motoko.Shift + Alt + O): group and sort imports at the top of your Motoko file.Ctrl/Cmd + . while hovering over an unresolved variable): show quick-fix options.F12): jump to the definition of a local or imported identifier.Ctrl + Space): view all available autocompletions and code snippets.array-2-buffer or principal-2-text.dfx, the Motoko VS Code extension works standalone on all major operating systems (including Windows).dfx.json config files.Motoko: Restart language server: Starts (or restarts) the language serverMotoko: Deploy (20 minutes): Temporarily deploys the currently open file to the Internet ComputerMotoko: Import Mops Package...: Search, install and import a package from Mopsmotoko.dfx: The location of the dfx binarymotoko.canister: The default canister name to use in multi-canister projectsmotoko.formatter: The formatter used by the language servermotoko.mocJsPath: Path to moc.js file for using a custom Motoko versionIf you want VS Code to automatically format Motoko files on save, consider adding the following to your settings.json configuration:
{
"[motoko]": {
"editor.defaultFormatter": "dfinity-foundation.vscode-motoko",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": true
}
}
}
Ensure that Node.js >= 24.x and Cargo are installed on your system.
git clone https://github.com/caffeinelabs/vscode-motoko
cd vscode-motoko
npm install
npm test
npm run package
This generates a file named vscode-motoko-*.*.*.vsix in the project root.
code --install-extension vscode-motoko-*.*.*.vsix
Alternatively, right-click the .vsix file and then select the "Install Extension VSIX" option.
Community PRs are welcome! Be sure to check the list of open issues in case anything catches your eye.
JavaScript
95.0%
TypeScript
4.8%
Motoko language support for VS Code.
46
stars
443
commits
JavaScript
primary language
Sep 9, 2026
updated
Motoko language support for Visual Studio Code.
Motoko is a high-level smart contract language for the Internet Computer.
This IDE extension provides type checking, formatting, snippets, and more for Motoko canister development.
Get this extension through the VS Marketplace, or alternatively the Extensions panel in your VS Code project.
VSCodium users can download the extension through Open VSX or the GitHub releases page.
Below are the default key bindings for commonly used features supported in the extension:
Shift + Alt + F): format a Motoko file using prettier-plugin-motoko.Shift + Alt + O): group and sort imports at the top of your Motoko file.Ctrl/Cmd + . while hovering over an unresolved variable): show quick-fix options.F12): jump to the definition of a local or imported identifier.Ctrl + Space): view all available autocompletions and code snippets.array-2-buffer or principal-2-text.dfx, the Motoko VS Code extension works standalone on all major operating systems (including Windows).dfx.json config files.Motoko: Restart language server: Starts (or restarts) the language serverMotoko: Deploy (20 minutes): Temporarily deploys the currently open file to the Internet ComputerMotoko: Import Mops Package...: Search, install and import a package from Mopsmotoko.dfx: The location of the dfx binarymotoko.canister: The default canister name to use in multi-canister projectsmotoko.formatter: The formatter used by the language servermotoko.mocJsPath: Path to moc.js file for using a custom Motoko versionIf you want VS Code to automatically format Motoko files on save, consider adding the following to your settings.json configuration:
{
"[motoko]": {
"editor.defaultFormatter": "dfinity-foundation.vscode-motoko",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": true
}
}
}
Ensure that Node.js >= 24.x and Cargo are installed on your system.
git clone https://github.com/caffeinelabs/vscode-motoko
cd vscode-motoko
npm install
npm test
npm run package
This generates a file named vscode-motoko-*.*.*.vsix in the project root.
code --install-extension vscode-motoko-*.*.*.vsix
Alternatively, right-click the .vsix file and then select the "Install Extension VSIX" option.
Community PRs are welcome! Be sure to check the list of open issues in case anything catches your eye.
JavaScript
95.0%
TypeScript
4.8%