Not getting auto-complete for JavaScript in new VsCode version
M

4

8

I used to get auto-complete and intellisence hints earlier but now I don't get auto-complete, nor do I get squiggly red line for errors. What do I do? Please help. I already spent 2 hours searching on google but can't find answer.

enter image description here

Others are getting proper suggestions like above. I ain't getting that. Below is my VsCode editor.

enter image description here

Maressa answered 15/5, 2022 at 19:29 Comment(6)
can you post your settings.json file?Drescher
You're gonna need to post a bit more about your configurationsSonya
I just now cleared my settings.json file because I wanted to reset to default. Therefore that settings file is empty now. { }Maressa
you should install JS helper Extensions in your VS Code. for example: "IntelliCode" and etc. also check your file extension be .js.Caxton
Thanks for the replies. I had some problem in TypeScript settings where maybe by mistake I had unchecked autocomplete support i guess. I had fixed the issue now.Maressa
Please provide enough code so others can better understand or reproduce the problem.Ronaronal
M
12

After surfing a lot in settings of VsCode, I finally figured out two things that might be causing this problem. Solved both of them and now the auto-complete is working fine for my nodeJs files in VsCode.

  1. Install ESLint and JavaScript (ES6) code snippets extensions for providing intellisense for js code.

enter image description here

  1. Enable auto-complete if you disabled it by mistake. This should fix the problem. settings > search javascript/typescript > search auto-complete in the extension settings and turn it on.

enter image description here

Maressa answered 16/5, 2022 at 5:54 Comment(1)
am using codeium and its not working in .ts but working in .tsx why! although it shows the hints but when pressing tab it just do the tab without insertint the codeDisgust
G
1

if you have script as below get rid of the type. then it will work

<script type="text/Javascript">
doucument.write("test");
</script>

get rid of the "text/Javascript" part enjoy

Gesellschaft answered 12/5 at 17:1 Comment(0)
M
0

You need to install types/node in order to get the autocomplete. https://www.npmjs.com/package/@types/node

Misguidance answered 1/9 at 10:42 Comment(0)
B
0

I was getting partial autocompletion. The issue for me was that I accidentally added this to my settings.json:

"editor.suggest.showConstants": false

Removing it solved the issue.

Brechtel answered 19/9 at 8:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.