PhpStorm Newcomer Here - Variables Different Colours? - ide

I have only just come to PhpStorm and I'm a little stumped at some settings.
I can not understand why one of my variables have a different colour to the rest of them. However I can not work out why this is happening. Any help? I expect the variable to be grey.

First of all some description for your colors:
grey (with underwave effect) means that parameter/variable is unused.
that dark red color means that parameter is used (so normal color for parameter)
Now ... you are using custom color scheme that is NOT up to date (not meant to be used with this IDE version). Basically -- that color scheme does not have color defined for that specific style and IDE uses default one (color of a parent style in appropriate styles inheritance hierarchy).
To fix that you will have to adjust your Color Scheme:
Settings/Preferences | Editor | Color Scheme | PHP
The rest -- depends on the element.
for function parameter it should be Functions and Methods | Parameter
but it could also be something else -- cannot say for sure without having your actual color scheme here on my computer.

I am assuming the red color is indicating that the variable is used in the compact method. To verify remove it from using it in the compact method and it should turn grey like your other method parameters.
If you don't like this, you can either change the color scheme or overwrite it.

Related

How to find the name for indentation of object-attributes in .tsx-file in PhpStorm

I'm editting a .tsx-file and are reaching upon this bonkers file-formatting:
... If I enlarge the window a bit, then it makes more sense:
But I would still like to change it, so value and onClick aren't aligned all that way to the right. Ideally, it would try to align them with the opening bracket (as they do), unless the opening bracket is more than 35 characters, from the line start. Or something like that.
Now, I assume that it's the TypeScript-formatting that dictates the Code Style for a .tsx-file. But when I open the settings: Editor >> Code Style >> TypeScript then there are BAZILLIONS of settings.
Which leads me to three questions:
Does anyone know what I need to change, so object-attributes doesn't follow the opening-brackets width?
Could I find the name of what I'm looking for, in some smart way? I tried hovering over the massive space, hoping that the little yellow light-bulb could shine some light on, what I was after.
Are there any presets, to be found somewhere? So I don't need to engineer a new Code Style, if I dislike the default.
Make sure that the following option is disabled:
Settings (Preferences on macOS)
Editor | Code Style | TypeScript | Wrapping and Braces
Function call arguments: Align when multiline
NOTE: It is possible that the default value has been changed somewhere since the previous version as I have seen a few questions for the same option but different language (PHP and JavaScript).
HINT 1: Did you know that you can paste your own code in the preview area and start changing options to see how they will affect it? It helps locating the right option a lot.
HINT 2: There is a special popup that shows formatting rules applied to the code. It does not show all possible options but can give you a hint what to look for. To invoke it:
Use Help | Find Action... (or Action tab on Search Everywhere -- they use to be different popups but are using the same popup nowadays)
Type adjust to filer actions
Select and invoke "Adjust code style settings" action
It will give you a popup with applicable rules (it's a limited set: may not list all).
An example for PHP code:

How can I change the colors of the filenames in the Version Control window in intelliJ?

I know that I can change the color of just about all texts in IntelliJ IDEA by navigating to
Settings -> Editor -> Color Scheme
and then finding the item that I want to change the color of.
I have not, however, been able to find the proper name or category for the controls that would change the color of the filenames listed in the Version Control window.
I have clicked through most every option available there and although I know I missing something super simple, I have been unsuccessful.
Here is a picture to show exactly what I'm talking about.
Settings | Version Control | File Status Colors

Goland color for function names

I have installed a custom theme. I am trying to customize two items. I forgot where I had seen it. I had done it in the past.
func myfunc
the myfunc I want to show up as bold in the editor window. And also, when we are in a function block, for ease, the name of the current function whose block we are in is also shown by intellij. I want to change the color of the function name and background of the bar so that I can read it easily. I am attaching a screenshot to make it easy to understand what I am trying to ask
Go to "Settings (Preferences) | Editor | Color Scheme | Go" and there you can customize the Go code presentation to suit your needs.

Change background color of highlighted HTML elements

When I hover the mouse on a HTML tag in the tiny bar under the file tab, the background of the highlighted element is very bright, and the text becomes unreadable.
I couldn't find a way to customize this in the settings, can somebody help?
Here's what I mean:
It uses your caret row color (it just automatically makes it lighter so it's more visible) and not some separate style which you can disable/modify.
ATM there is no option to disable such behaviour. I mean -- IDEA-139930 ticket is fixed, but not available in 141.xx branch that PhpStorm is currently built on.
If it annoys you a lot then right now I may only suggest to disable that breadcrumbs bar altogether until PhpStorm will move to 142.xx or newer branch. For that: Settings (Preferences on Mac) | Editor | General | Appearance | Show HTML breadcrumbs (you will have to close and reopen that file to see the changes).
You should post more info about specification: exact version of PhpStorm etc.
Try this:
https://www.jetbrains.com/phpstorm/help/configuring-colors-and-fonts.html

In Android Studio 1.1.0, is there a way to change the color of only those method names defined in the current file/class?

I can imagine that this might not (ever) be a feature.
(I wouldn't necessarily want "other" method calls to be blue as shown in the second block; blue is just to emphasize what's different from first block.)
If there's a way to just color methods defined in the current class, please advise.
(I want this because my eyes need all the help they can get.)
No, there is no such feature in IntelliJ IDEA as of version 14.1. It can be implemented as a plugin, but I'm not aware of any such plugin.
Just documenting, as I was looking for a way to do this and I have found a way that is satisfactory enough to me.
There's a way, but it's a workaround, it will have side effects.
How:
Go to File > Settings > Inspections (Choose the Global Profile if necessary).
Type in the search: qualified.
Tick the checkbox next to "Instance method call not qualified with 'this'".
Click on Severity > Edit severities, add new entry by clicking the green + button.
Name it whatever you want.
You must put it at the bottom of the list using the arrows. If you don't, the F2 key will no longer work as you expect it as it will prioritize errors at the top of the list.
Set the Error stripe mark to #FFFFFF, or the same color as the scrollbar.
Set it bold if you wish.
If you want to set a color, you must set a background color to white (or black if you have a black interface). If you don't, the color will appear black in most conditions.
If you really want to, do the same for "Unnecessary 'this' qualifier"; there is an additional checkbox to make it only apply to methods and not fields.
Side effects:
This enables inspections, which is not desired.
Pointing the mouse cursor onto the method calls will cause a hover text to appear describing the inspection.
If your code has no errors, no warnings, and no additional informative inspections, pressing F2 will jump through these calls.