PhpStorm. Highlight file in project tree on inspection error (e.g. Strict type checking rules violation) - phpstorm

Is it possible to highlight a file in the project tree on inspection error (e.g. Strict type checking rules violation) in PhpStorm?
I would like to highlight it as a serious error. Couldn't find anything in settings and documentation.
Now it just highlighted the wrong property and mark the line on the right.
v

I thought it would be possible by changing the Inspection Severity to the highest Error level (see the official doc page on how to configure Inspection Severity)... but apparently this will not work.
It seems that right now only certain hardcoded error types (that come from lower level Lexer/Parser as I understand) can display the "red underwave" in the Project View panel.
Watch the following ticket: PhpStorm's WI-33552 --> platform-wide IDEA-96288 (star/vote/comment) to get notified with any progress.
It's not the same of course, but will give yo an overview on a most-important errors (for your filtering level/inspection profile).
As a possible alternative: Run Inspect Code manually (Code | Inspect Code from the Main Menu; you can invoke it for a specific folder/custom scope to limit the number of files to be processed) and then filter you results in the Problems toolwindow to only see the errors with required severity.
https://www.jetbrains.com/help/phpstorm/running-inspections.html#run-inspections-manually
https://www.jetbrains.com/help/phpstorm/problems-tool-window.html#854a2648

Related

PhpStorm Custom Severity Levels No Longer Function with CodeSniffer

UPDATE (2020/12/03):
This has been fixed in PHP Storm 2020.3
I utilize PHP CodeSniffer and PHP Mess Detector to lint my code in PhpStorm. Until recently, I have been able to create custom severity levels (as shown below) and it will highlight my code accordingly if there is a violation.
What I found is that if I used one of the built in severity levels (e.g. Weak Error, Error, Sever Problem), the inspections and highlighting appear as I would expect, so it is not a problem with the installation of CodeSniffer or Mess Detector.
What I do to replicate the problem
Go under Inspections -> Quality Tools -> PHP_CodeSniffer Validation
Choose "Error" severity (all scopes)
Linting works as configured -- see below.
Click Edit Severity -> "Edit Severities" and create a custom Profile (e.g. CS Violation)
Set Colors and promote severity level to the top.
Click Apply
Editor now says "No Violations Found" and Syntax highlighting, feedback is missing as show below.
Question:
Is this a known bug or are there now additional tasks that must be completed in order to use custom severity levels in PhpStorm?
It's a known issue (if I'm getting your description correctly): https://youtrack.jetbrains.com/issue/WI-52633
Watch that ticket (star/vote/comment) to get notified on any progress.

Hide warning messages in console window

The Chrome console window is full of warning messages that I like to hide.
Is it possible to hide the warning logs?
I only want to show my custom logs e.g. console.log('mymessage');
This is how the console windowbar looks like:
Just recently there was a Chrome update. Now filtering single message types is possible (Verbose, Info, Warnings, Errors)! (My Version: Version 60.0.3112.90)
When opening the console, instead of selecting a "filter level", you can now check or uncheck each message type.
As of Chrome version 78 (Dec 2019), in the "Console" tab, click on the "Default levels" pulldown, and uncheck the types of messages you don't want displayed.
At the top bar of the console log you can select what kind of messages should be shown.
All is selected by default. Select error to see only error.
You can press ctrl + click to select multiple message types.
First off: you can hide all warnings and show only console.log output if you are using Microsoft Edge. In the console, there are a couple of icons representing the different levels of log output you may be using - error, warning, and info. If you just want to hide warnings, you can simply toggle the warning icon to off.
Also, if you are on firefox, you can set the log to only display info, in which case the warnings will also be hidden.
Next, to elaborate on the other answer, and phrase what I said (above in my comment) in the form of an answer:
For chrome, you cannot toggle specific levels off individually (newer versions of Chrome). Instead, you have to set an overall verbosity level for the log. By using the strictest level (i.e. the level that displays the least), you can minimize console messages that are created by portions of code that you did not write. In this case, that is the error level.
If you are just trying to hide warning messages for testing purposes, you can, for the time being, switch over to only logging messages at the error level. In production, this is not good practice, as it doesn't let you differentiate between helpful info log messages or actual errors.
To log a message as an error, use:
console.error('mymessage');
Then, as mentioned above, you can change the Level of your console output to error, which will only show you error messages. It will ignore console.log as well as any warning messages.
Be sure to change your calls to console.error back to console.log when you are done with the development phase of your work, for any instances where you are calling console.error with some message that does not describe an error.
Now, if you are getting warnings due to something you are doing in your code, you may want to consider spending time trying to correct whatever is causing those warnings to appear. Warnings are generally well thought out, and are there to help you prevent issues in your code that you may not be aware of. Correcting any issues in your code would also cause the warning messages to go away.
NOTE: you cannot tell the console to only display messages you print out, even at the level of verbosity you set your console to. This is because the console would have no way of knowing which statements you are logging out, versus which statements code your webpage is running that was written by someone else is logging out. The steps mentioned in this answer as well as the other are workarounds that may improve your situation.
UPDATE: It seems like Chrome has reintroduced the ability to enable/disable different levels of console logging individually. Now, when clicking on log level, you can toggle whether certain log levels are enabled or disabled.
Under the console tab it is now possible to highlight the message type as a general filter. There is also a filter box right next to the eyeball. So if you put a unique flag in your console.log then it will show only your messages with this flag.
But in general. I think you want to click the 'Info' item as highlighted below to just obtain the console.log messages
There is a drop down next to filter, where can you select only things you require.
Note : ReactJS warnings are actually displayed in red as errors. So to remove them you need to uncheck errors too.

How to get a list of files with errors in PhpStorm

In PhpStorm I get a read mark on the upper right side of the code window if there's a PHP bug in the file. That's great. What I like to have is a list of all files which have this read mark.
Any ideas?
To get the list of all files with errors and warnings use Code | Inspect Code. It's possible to specify what inspection profile to use, which directories to scan. Custom Scope provides a flexible way to include/exclude certain directories or files from the inspection results.
Slightly off-topic, but may be helpful. If you need to jump through all the errors in a file (for example, CSS file), open up the file and and hit the F2 button on the keyboard. Repeat it to cycle through all the errors. To navigate back to the previous error, hit Shift + F2

Get file name and line number for warnings and errors on vizzy flash tracer

What's the simplest way to see where warnings and errors come from, on vizzy?
Here's a few instances I see on my mac. Quite different from the screenshots we can see on its wiki:
Warning: 'flash' has no property 'prototype'
Warning: 'StageVideo' has no property 'prototype'
Warning: 'AsBroadcaster' has no property 'addListener'
Warning: 'AsBroadcaster' has no property 'removeListener'
Warning: 'flash' has no property 'prototype'
Warning: 'flash' has no property 'prototype'
Warning: Ignoring 'secure' attribute in policy file from http://fpdownload.adobe.com/pub/swz/crossdomain.xml. The 'secure' attribute is only permitted in HTTPS and socket policy files. See http://www.adobe.com/go/strict_policy_files for details.
Thanks to the last answer, I can now see VizzyTrace.swc is required for many vizzy functionality. But even after considering all that (and enabling debug flag on the FLA, replacing trace for trc, setting up the "extra options" and adding the SWC) I still see nothing.
Now every trc line is prepended with an almost useless (I can control traces just all right and easily induce where they came from) file name and line number under Flash Professional's own output when I "Test Movie" but not even then will Vizzy show those lines. Not to say after the SWF is compiled and I'm tracing on the browser.
The warnings and errors you see are internal flash player things, so don't bother about them. you are not able to explore them. What concerns last error (cevure attribute), explore that in Vizzy, check policy log in the bottom right corner.
What concerns VizzyTrace.swc, you should enable that in Vizzy by Extra - Options - Trace Parser - Connect VizzyTrace library. Once done, you would be able to right click (for code snippet) and double click (for opening file) on every line that you trace.

How can I disable "HTML Checking" in NetBeans?

I'm using NetBean's Compile on Save setting, and it's really handy when I'm editing a single file. But when I'm dealing with a pair of (or more) class files and am switching between the files, I have a problem:
The Task tab is nearly worthless since it is littered by HTML "error" messages(+) from many dozens of HTML files in the project that are generated by some external tool. The number of HTML errors swamps out any actual Java errors.
What I want is one of:
A way to tell NB to ignore the directory with the HTML files ("help").
A way to turn off HTML "errors" or even to specify HTML2.
A way to filter "Task" errors by file type, parent folder: all Java is under "com".
I've perused the settings and properties, but found nothing that helps.
<rant> Yet another reason I hate an IDE that use the "Take Everything in the Folder" approach.... </rant>
+ = The files are valid HTML but probably not XHTML. Plus, half the messages end abruptly, with something like: "Unexpected tag <TD> found, expecting one of
I found the answer, or at least one that works for me (NB 6.8, YMMV):
In the Tasks tab, click the filter button in the left,
Choose Edit...
In the Task List Filter dialog:
Click New
Enter a value for Name (such as "No Script Messages"),
Uncheck the Scripting Language Tasks option
Click OK.
If the filter doesn't work immediately, you may wish to close/open the Task window or Netbeans.
Hope that helps someone else.
You can go to Tools->options->Editor->Hint .
You can easily select the right options from there .
I want to use task list to only track my To Do list and It can be a real pain when Netbeans starts showing me #todos from included libraries and all sort of compile errors that I am not interested in. If your use case is like me (not interested in compile errors etc. in task window) then you can do following:- (Netbeans 7.1.2)
1) Tasks window | Right click filter | Edit
To edit the default filter.
Click default filter in left hand panel.
Right hand panel, under Type tab - un-check compile errors and issues
2) You can go to Tools | Options | Miscellaneous
Go to Tasks tab now.
Here you can add/remove the To Do strings that you want.
You can create your own custom todo string or make sure that only one of them is listed (what you use)
Now apply default filter and you will only see your #todo tasks. sane and sweet :D