Motoko VS code plugin: no code inspection

I am using the Motoko VS Code Plugin.

In miscellaneous videos, notably those of the Motoko school, I noticed that the plugin does seem to detect errors and typos in the code but, in my environment, it has never been the case.

Except syntax highlighting, it does not do anything else.

Am I missing something, does it needs a specific configuration to enable the code checker?

A couple of possibilities:

You currently need to set the language server to point to a single canister at a time, VSCode should prompt you to choose a canister when you open a project, or you can show the prompt by manually restarting the language server—search the command palette (Ctrl+Shift+P) for Motoko.

Check you have imports leading to files from your canister’s main. The type checker follows the imports down from here.

Also note that if you have multiple errors, you may find that type errors deeper in the code don’t show up until the earlier errors are fixed.

Thanks, it did the job :+1:

1 Like