admin管理员组文章数量:1406312
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
.
I have also captured settings
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
.
I have also captured settings
Share Improve this question edited Dec 31, 2017 at 12:09 LazyOne 166k48 gold badges414 silver badges415 bronze badges asked Dec 31, 2017 at 9:20 jack_snipejack_snipe 1292 silver badges11 bronze badges 2-
4
General thought: please try
File | Invalidate Caches...
and restart IDE. Anything interesting inidea.log
file? – LazyOne Commented Dec 31, 2017 at 12:20 -
1
Check
File -> Settings > Editor -> File Types
, selectJavaScript
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. – Flying Commented Dec 31, 2017 at 12:26
4 Answers
Reset to default 53 Things to try:
- Try
File | Invalidate Caches
and restart IDE. (credits @LazyOne) File -> Settings > Editor -> File Types
, selectJavaScript
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)- Go to
File | Settings | Languages & Frameworks | JavaScript
and ChooseECMAScript 5.1
and press ok. Files shoud now be highlighted correctly. Then, open the menu again and re-selectECMAScript 6+
.
I had the same or similar problem. Unresolved variables did not "highlight". But the problem occurred only on a single .mjs -file as far as I could tell. In others it did highlight those errors.
This was a big problem because I had a large set of JavaScript code which took much time to test-run to see how it worked, and having mistyped variable names caused it to fail but only after running it again and again after making any change.
I tried many things which did not help but finally this action got the unresolved variables error-highlighting to work again:
Open the file with missing error-highlights in WebStorm editor.
From the top menu-bar navigate Code -> Analyze Code -> Configure Current File Analysis
Choose "All Problems" (instead of "Syntax")
My problem was that I added an .eslintrc file but our project is using TS Lint. I just disabled eslint and things started working again.
Mine had power save mode on, I turned it off in notifications
本文标签: javascriptWebStorm is not highlighting JS codeStack Overflow
版权声明:本文标题:javascript - WebStorm is not highlighting JS code - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744998862a2636849.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论