1

I would like to know if anyone knows how to fix autocompletion in vscode. This is my problem: vscode has a code suggestion, but lately it stopped working in my javascript file I leave a picture of how it doesn't work.

code to show autocomplete not working

On line 31 it should suggest "addEventListener" but it doesn't, does anyone know why?

I already checked that the factory application "typescrit and javascrit language features" was active. Also the file is in JS format. I also reloaded the editor with ctrl + shift + p -> developer: reload window.

From already thank you very much.

3
  • When i code previous the autocomplete it worked, but not now. If that was the case i would not be posting this issue. Commented Dec 13, 2021 at 18:52
  • Seems to work fine on my VSC ..? Is the file you're working with really a .js file, and you're not writing inline script to a html file? Commented Dec 13, 2021 at 18:57
  • Yes, really is a .js file, i not using inline script tag inside html file. Commented Dec 13, 2021 at 19:33

2 Answers 2

2

You are in restricted mode which is a security feature to protect your machine from malicious repositories. A better approach to outright disabling the feature is to trust whatever folder you normally clone your own repositories in. When you initially open a new folder you are presented with this dialog:

enter image description here

You can say yes here to get the functionality working, there's also a checkbox that allows you to trust the parent folder of the folder you opened as it's a common pattern to clone all your repositories in a single folder.

If you need to fine tune which folder you trust you can open "Manage Workspace Trust" from the gear menu:

enter image description here

On this page you can trust the folder you clone your own repositories into, or alternatively the whole drive.

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

0

Just now i learn how to fixed: is the restricted mode. See this post to know how to fixed.

In summary:

  1. Open settings (ctrl+,)
  2. Write in the nav bar: "security.workspace.trust.enabled"
  3. Disable the check box (turn to false)
  4. Done.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.