Improving VSCode extension for Motoko

Project highlights

We are thrilled to announce that we (Serokell Company) have finished our third Dfinity grant, which means more improvements to the Motoko ecosystem. This time, we are enhancing the VSCode Extension for the Motoko language.

New features

  • Autocompletion now works for symbols from imported modules.
  • Finding references is supported for fields of modules, actors, and classes, along with improving goto-definition.
  • Syntax errors now have an example of valid code at that point.
  • The parser of the moc compiler now supports error recovery, allowing you to see all syntax errors at once and use more IDE features while editing. Drawing from our experience with other smart contract compilers, we implemented this with minimal changes (see our fork of ocaml-recovery-parser).
Screenshots with new features

Bug fixes

  • Overall performance has been improved by caching type information from the moc compiler. This enhancement is especially beneficial for large projects. Additionally, the extension repository now includes an automated benchmark for investigating performance issues.
  • Fixed bugs related to the “go to definition” functionality

How to try

All these features will be available in the next release of the VSCode extension for Motoko.

12 Likes

giphy
Looks great!!!

2 Likes

Thank you so much. This will be a game changer

2 Likes

Great stuff, can’t wait to use this :heart_eyes:

1 Like

Hey DFINITY folks noticed the official Motoko VSCode extension is now showing as “no longer available on the Extension Marketplace” in VSCode (still works if already installed, but blocks new installs/discovery). Screenshot attached:

Same issue hit my Colorful Dark+ theme extension (tagged for Motoko/Candid support). Proof screenshot:

Thoughts on a fix? Happy to help.

Turns out it’s a known VS Code bug they’re fixing: Some extensions that are available on the Marketplace are showing up as "no longer available" · Issue #269737 · microsoft/vscode · GitHub .

Good news: A simple patch republish (bumping the version in package.json and running vsce publish) cleared it right up for my Colorful Dark+ theme—no code changes needed. It’s back to full installs/discoverability now.

Worth a shot for Motoko to get it searchable again ASAP!

3 Likes

Thanks, @b3hr4d! Republished the extension (v0.18.11). If anyone continues to encounter this issue, please let me know so we can investigate further.

Confirmed—Motoko extension is fully visible now, no warnings, 80k+ installs showing.

Thanks for the quick republish.

3 Likes

That’s awesome news! These updates sound really useful, especially the improved autocompletion and error recovery. Having better performance and clearer syntax feedback will make coding in Motoko a lot smoother. Great work to the Serokell team for continuing to polish the developer experience!

1 Like