Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WebStorm is not highlighting JS code

WebStorm is not highlighting properly JS code whether its in HTML file or in JS file. It says unresolved variable or type document when I want to get ID of element using document.getElementByiD.

enter image description here

I have also captured settings

enter image description here

enter image description here

like image 300
jack_snipe Avatar asked Jan 27 '26 15:01

jack_snipe


1 Answers

3 Things to try:

  1. Try File | Invalidate Caches and restart IDE. (credits @LazyOne)
  2. File -> Settings > Editor -> File Types, select JavaScript into list of file types and check if you have *.js into list of extensions below. Alternatively try to create new draft (Shift+Ctrl+Alt+Ins) for JavaScript language and take a look if it get highlighted. (credits @Flying)
  3. Go to File | Settings | Languages & Frameworks | JavaScript and Choose ECMAScript 5.1 and press ok. Files shoud now be highlighted correctly. Then, open the menu again and re-select ECMAScript 6+.
like image 103
Hannes Schneidermayer Avatar answered Jan 29 '26 05:01

Hannes Schneidermayer



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!