Reputation: 143
New to WebStorm. Trying to determine why WebStorm does not always display highlights in source code, even though weak warnings are reported? As an example, there may be "2 weak warnings found", but only 1 line highlighted in the source editor window.
Is there another way to get a list of warnings, with warning explanations and links to the problem code? Or at the very least, with line number for reference?
Thanks.
Upvotes: 14
Views: 2678
Reputation: 57378
This was happening to me on a Javascript file app.js
.
Ed Cottrell's answer seemed promising:
The short version is that you have to "kick" the IDE and get it to reset something internally.
But his workaround did not work for me (2016.2.2), nor did the following:
So I thought I would carve down what piece of Javascript was triggering the fake error. To begin with I made an identical copy of app.js (Ctrl-C + Ctrl-V in the Files tree). I planned on removing code until I got rid of that pesky weak warning.
The new file (identical - same MD5 even) had no warnings and the green checkmark.
Okay, so I thought "I'll just delete app.js and rename appcopy.js. This will not go well with SVN but what the heck".
Then I thought I was first going to rename app.js, and I did. That triggered the refactor dialog. Silly me, I don't want to do that, and I hit Cancel. Then hit Refactor->Rename again but unchecked all refactorings.
And it was at that point that I noticed the green checkmark had appeared in app.js too.
So I hit Cancel again, and deleted the appcopy.js file.
The weak warning returned on the surviving app.js file!
Okay. Let's start again...
appunisci.js
file identical to my app.js
. Green checkmark on both. If only it were that easy...app.js
without refactoring and app.js
becomes spunisci.js
. My app is now broken but no changes to the code are performed.appunisci.js
without refactoring into app.js
. My app now works again, I have an extra file and a SVN mess.app.js
with the green check markspunisci.js
to get rid of the extra file.app.js
is still OK!app.js
(otherwise a simple revert would have fixed SVN)
app.js
to app.bak
svn revert app.js
to reset Subversion historyapp.bak
to app.js
to recover my changessvn status
and confirm that app.js
is "M" and not "R +"Upvotes: 0
Reputation: 44823
I'm still not sure why this happens, but I have a fix. The short version is that you have to "kick" the IDE and get it to reset something internally. (I'm not sure what changes or where the IDE saves the change because I forgot to put the internal configuration under version control before playing with it, so I can't see what files it changed.)
This fix is tested in PHPStorm versions 10.0.1, 2016.1, and 2016.2 on OS X versions 10.10 (Yosemite), 10.11.2 (El Capitan), and 10.12 (Sierra).
Follow these steps:
You should now get the magical green checkmark:
This glitch has driven me crazy for a while now, and it seems to have driven a few other people crazy, too, but the above steps seem to have fixed it for good.
Upvotes: 14
Reputation: 165088
Trying to determine why WebStorm does not always display highlights in source code, even though weak warnings are reported?
Usually such warnings have very "light" colors that are rather hardly visible. You may want to change them to better colors in your Settings | Preferences | Editor | Colors & Fonts | General
Is there another way to get a list of warnings, with warning explanations and links to the problem code? Or at the very least, with line number for reference?
Code | Inspect Code...
where you can choose the scope (only current file; certain folder/scope etc).
If you need particular inspection only -- Code | Run Inspection by Name...
Upvotes: 0