The auto Complete is not working for Motoko

I started learning web3 and motoko. In the instructor’s video, I noticed autosuggestion. When I typed my code I noticed autocomplete doesn’t work although I have already downloaded the Motoko extension from Difinity Foundation.

It’s been a while since I’ve used it myself, but it used to be the case that you need to be in a dfx project, with a dfx.json file nearby for the plugin to have enough information to do its job.

Something like:

dfx new myproj
cd myproj
code .

But perhaps that’s not required anymore or something else is wrong.

Are you on Linux, Mac or Windows/
WSL?

I am using Windows and dfx the code works fine. But there are no suggestions when I type.

Hi @KIsaac85, thanks for reaching out. Here are a few debugging questions:

  1. Does this happen for other languages or just Motoko?
  2. Do you see any error messages when opening VS Code?
  3. Presumably you are using WSL on Windows. Is that correct?
  4. Would you be able to send a screenshot of what this looks like?

Thanks for you reply.
No just Motoko. Other languages work fine. I am using WSL on windows and the code works fine.
I posted the same question on stackoverflow with screenshots.
I tried to upload pics and link for the stackoverflow link here and got an error you can not upload a picture in a post :frowning:

Is this your StackOverflow post? The autocompletion should work without any extra configuration, so this may be caused by an error in the language server.

Can you send me a direct message with your “Motoko Language Server” console output? This is what it looks like on my machine for reference:

Would you also mind sending the dfx version that you are using? This can be found by running the command dfx --version.

Until you get the extension working locally, you could also try using an online Gitpod environment:

Thanks for your help. Yes, that’s my post. I can not upload a picture in a post, I’d appreciate it if you could send me your email address. I am using dfx version 0.9.3

I am using dfx version 0.9.3

This might be the issue. The latest version of dfx is 0.18.0, so I would encourage following these instructions to reinstall dfx. I’ll send you a direct message with more information.