IDEA IDE - disable inspection for one file - intellij-idea

Is there a way to disable inspection for one file opened in the editor? I occasionally open large library file in the editor to inspect its source code, and don't want IDEA to run inspections on this particular file.

Use Hector the Inspector guy. You can access it by clicking on "guy in a hat" icon in Status Bar or via Code | Configure Current File Analysis... from the main menu.
Once there you can move the "Highlighting Level" slider from "Inspections" to "Syntax" .. or even "None" in case of a large or complex file.
Notes:
Settings here affect current file only (excludes "Power Save Mode" option)
Depending on a file, you may have multiple sliders (e.g. in .php file you will see separate sliders for HTML and PHP languages: this may change depending on some other settings):
P.S.
If your file is actually part of the library (PHP or JavaScript; "Library" in terms of IDE, of course) then they by default should not have inspections enabled in them:
UPDATE 2021-06-11:
Hector the Inspector has been removed from the status bar since 2020.2 version or so. You can get it back by installing Hector the Inspector plugin from Settings/Preferences | Plugins

You can set scope for your project and run inspections only for selected scopes.
#see Inspection severity and scopes

Related

Can I customize the "New File" menu in PhpStorm?

I would like to add some other options, like "PHP Enum" or "PHP Interface" directly to this menu. Also, I would like to put PHP-related options first. It is possible tu customize this in PhpStorm? I'm using last version (2022.3.2) with the new UI enabled.
I tried using Appearance & Behaviour -> Menus & Toolbars but that didn't work for me.
Do you know that you can use the universal PHP Class entry and just change the type of the object (and therefore the file template) there? That can be done right away when typing the file or class name -- just use Arrow Up / Down keys:
(GREEN rectangle area is where that Up / Down key will work; RED rectangle shows my custom file templates)
P.S. The template for PHP Enums is also there, it just the screenshot was taken in a project with PHP 8.0 language level (need 8.1 for enums to appear).
P.P.S. The IDE will remember the last used template when you invoke this dialog again.
https://www.jetbrains.com/help/phpstorm/creating-php-classes.html
You can add new entries to this menu by creating custom File Templates at Settings/Preferences | Editor | File and Code Templates
https://www.jetbrains.com/help/phpstorm/settings-file-and-code-templates.html
Here are my test custom file templates:
And this is how they appear in that menu:
Customizing this menu (removing items, changing their order)
This is not possible at the moment. https://youtrack.jetbrains.com/issue/IDEA-143090 -- watch this ticket (star/vote/comment) to get notified with any progress.

IntelliJ 2019 scroll to source missing from project options menu

My question consist of 2 parts:
After update to 2019 version of IntelliJ Scroll to Source option from project panel is missing, after some web search I'm unable to find it. Is it missing? Default?
I'd like to set "scroll to source" so that whenever I'm opening tab it's highlighted in project, but exclude redirect to external libraries like java's or node_modules (they tend to be several classes long and make scrolling time-consuming). Excluding those libraries from project would be kind of a way perhaps?
The actions have been renamed improve an user experience for those who move from other IDEs: Autoscroll to Source -> Open Files with Single Click, Autoscroll from Source -> Always Select Opened File; see IDEA-217044.
Note that Scroll from Source button (currently called Select Opened File) is only available if Always Select Opened FIle is disabled.
There is no way to disable auto-scrolling to libraries; please vote for IDEA-200580 to be notified on any progress with this feature request.

How to customize appearance of "TODO" in Intellij IDEA?

I am using Intellij IDEA 15.03 on a Mac. One of the first things I do after installing Intellij on a new machine is customize the appearance of the code. This question, in particular, is about the customization of the TODO defaults.
In Editor > Color & Fonts > General, I have the following setting:
This definition, along with some other customizations, is saved under a separate Scheme, say S.
Additionally, under Editor > Inspections, the settings are as shown below:
In my code, however, the white-on-red look that I set up is not showing up, and every TODO comment is simply shown as a warning with the standard yellowed background. The severity setting seems to be overwriting my scheme setting. How do I get the setting shown in the first picture here?
Here is a sample from my code, as is being currently displayed by Intellij IDEA:
You can get the highlighting you want by disabling the "TODO Comment" inspection. The inspection is disabled by default, so you must have enabled it yourself.
As the description shown on your screenshot says, the inspection is intended to be used in batch mode (when you run Analyze | Inspect Code manually), and not for on-the-fly editor highlighting.

where to configure phpstorm 7 less compile directory

I'm using Phpstorm7 on mac. When I open one less file, Phpstorm tells me that it can be watched, so I just allow it to be watched. However, I want to compile this less file to another directory, instead of the same directory.
Saying, I need compile sites/all/themes/bic/less/style.less to sites/all/themes/css/style.css.
After a long research, it seems I need to edit some file watcher, but I can't find such file watcher stuff anywehre in Phpstorm7. There's no such 'File watcher' setting when I go to 'File' => 'Default Settings' in Phpstorm7. Now I can't stop this less from compiling either.
Any help would be much appreciated. Thanks!
File | Default Settings is for settings that will be applied to the brand new projects.
All settings (both IDE-wide as well as project specific) are located in the same place as every other Mac program does -- it's called "Preferences" (which you should now where to find, since you are a Mac user).
PhpStorm v7.x has a feature called Search Everywhere (Shift 2 times or by clicking on corresponding icon in toolbar) -- it searches trough settings/preferences as well.

IntelliJ - not asking if I want to save a file

I'm new to the IntelliJ IDE. In the past I was working with Visual Studio or Eclipse.
In those IDEs there was an asterisk * above the name of the file which has been modified.
But in IntelliJ with the default configuration I can't see if the file is modified. What's more the file is saved automatically when I change focus to another window.
I've found some options under Settings -> IDE Settings -> General -> Synchronization:
Synchronize files on frame activation
Save files on frame deactivation
Save files automatically if application is idle for...
After unchecking all that options the file is not saved automatically every time I change focus to another window, which is good. But still I can't:
see if the file is modified (no asterisk)
decide if the file should be saved when I'm closing it (IDE doesn't ask for that)
And when I'm closing IntelliJ file which has been modified is saved without even noticing.
Do you know what can I do to change how IntelliJ behaves?
After unchecking mentioned options go to:
Settings/Editor(IDE Settings)/Editor Tabs:
Check "Mark modified tabs with asterisk"
On 2019.3 Ultimate it's under:
Settings/Editor/General/Editor Tabs:
Mark modified (*)
The exact Save feature like eclipse is not available in IntelliJ.
Because IntelliJ IDEA has the ability to change so many files
simultaneously in large refactoring actions, and change them without
ever opening them, single file saves don't make very much sense. In
recognition of this, IntelliJ IDEA reserves the right to save any of
your files literally whenever it wishes. It's actually quite nice to
never have to worry about your file's save statuses, once you get used
to it.
"What if I don't like some changes I made, and want to roll them
back?", I hear you say. Well, for that IntelliJ IDEA includes this
amazing feature called the Local History. Every time it saves your
files, IntelliJ IDEA actually saves a diff of your file from it's
previous state, and saves that as well. You can see the entire edit
history of your files (going back some number of days), see the
changes you've made, and roll back any change. It rules triumphantly,
and more than makes up for the temporary disorientation caused by lack
of single-file save.
https://intellij-support.jetbrains.com/hc/en-us/community/posts/206336279/comments/207351939
To show an asterisk when a file is modified: open Settings (CTRL+ALT+S), switch to Editor > General > Editor Tabs and select the Mark modified tab with asterisk checkbox.
To remove autosave, uncheck: Appearance & Behavior > System Settings > Save files on frame deactivation