How to set autolayout constraint using visual language to superview with default constant and non-default priority - cocoa-touch

In visual format language a string H:|-[view]-| means: have the standard margins to superview.
If I want these standard margins to have a priority less than the default, I would want to write H:|-#750-[view]-#750-| but that does not work, leaving me the only possibility to write an explicit value for the margin (H:|-8#750-[view]-8#750-|), which I do not want to do (as I have to hard code this margin now).
Is there a way to specify standard margins with a different priority than the default?

(...nope, I don't see any mention of a term representing standard margin in the VFL documentation either.)
What you can do, is generate standard margin constraints, then pick them out from the results of +constraintsWithVisualFormat:options:metrics:views: and then change their priority before activating and adding them, as you cannot change the priority between required and optional once the constraints are active (though you can still change priority between different optional priority values).

Related

Rider C# - Disable "Thread" on the side of the current debug line

I am debugging an application and I want to disable the string with # circled in red in the following image:
Can I do that?
If you simply want to disable the inline view of values, you can do that by going to Settings > Build, Execution, Deployment > Debugger > Data Views and disabling the Show values inline option.
If, however, you want to just remove that value in specific, I don't believe there is a way to do that currently.
Instead, you can use the [DebuggerDisplay] attribute to specify how you want a class of field to be displayed: Microsoft Docs, or use DebuggerBrowsable(DebuggerBrowsableState.Never) to have it not be displayed at all. Note that these attributes affect the variables pane as well, not just the inline view.

IntelliSense and enums

Consider this enum:
Private Enum colors
white = 0
black = 1
End Enum
IntelliSense shows black and then white while I'd prefer to see white and then black.
I don't care about the numbers.
Is there a way to customize the enum sequence of the items shown by IntelliSense?
You could prefix the values to create you custom list order.
if you type "colors." and then the TAB key it writes the first element (black). I'd prefer to put the most used one first for writing it faster.
Don't use TAB for completion then. Type colors.b then hit Ctrl+Space, and it'll either complete to Black (if it's the only member that begins with a B) or moves the autocompletion list selection to Black (or whichever alphabetically comes first), given you also have Blue, and Brown.
Using prefixes merely to control the sort order of members in the IDE's autocompletion list is a rather arbitrary reason for not using clear identifier names and resorting to funky prefixing schemes.
You're not writing code for it to be merely executed. You're reading code for it to be read, and maintained.
"It helps me type faster" is actively harmful if your successor has to squint and stop and think and try to make sense of your prefixing scheme - it's distracting, and slows down reading the code.
Programming is at a minimum, 80% reading, not writing. Learn to type faster instead of making reading harder than it needs to be.

PhpStorm Newcomer Here - Variables Different Colours?

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.

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.

Multiple "right margins" or guides in PHPStorm

PHPStorm has a vertical line on what they call the "right margin" which is set by default to 120 characters or columns...
Given that PSR standards state There MUST NOT be a hard limit on line length; the soft limit MUST be 120 characters; lines SHOULD be 80 characters or less., it'd be nice if I could get another visual indicator at the 80 character mark...
I'm well aware that it says what line/column you're on in the status bar, but I typically hide most panels (status bar included) while coding.
Therefore, is there a way (feature or plugin) that would allow me to add a 2nd vertical line to indicate the 80th column?
It is not currently possible .. and no plugin comes into my mind.
https://youtrack.jetbrains.com/issue/IDEA-99875 -- star/vote/comment to get notified on progress.
P.S. Considering that this is rather PHP/Python specific (other languages do not care about this) .. I would not expect JB to have it implemented in nearest future...
I suggest the following workaround, it works for me on PhpStorm 9.0:
Open Settings page (usually Ctrl+Alt+S), go to Plugins -> Browse Repositories
Find and install BackgroundImage plugin
Restart IDE, it may output an error, something like "unknown protocol d" - don't worry, go forth
Make an image with height=1px, and width=(desired width of additional margin). Give it, say, white background and paint one rightmost pixel to say, black. I took a screenshot of an editor and cropped it in PS, to avoid annoying search and adjustment of the image width. Every change of background image requires to restart PhpStorm.
Open Settings again, goto Other settings -> BackgroundImage
Set Enabled checkbox, browse your created image, and check the FileSystem radio button
Restart IDE again and change the margin and you will get two margins
The image is left-aligned, so when you resize an editor on x-axis (move the splitter between Editor and Project View or File System View, etc.), the margin will remain truthy.
Some side-effects - it appears also on console window, event log, perhaps somewhere else.
If the plugin doesn't work, check out this page (there said that most JetBrains plugins should work on all products on IntelliJ Platform, and some workaround if they does not): http://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/plugin_compatibility.html
ADDED: Doesn't work with scaling an editor (Ctrl + MouseWheel) - the scale of the image (fake margin), remains the same and the margin becomes not truthy.
In the latest PHPStorm, this is now possible. This would be PHPStorm 2017.3. The instructions on the ticket mentioned in the accepted answer explains it quite well:
Will be available in the next EAP build. You can set it up at
Settings|Editor|Code Style|Visual guides for all languages or on
"Wrapping and Braces" tab for a specific language ("Other" tab for
XML/HTML). You can change the visual indent guide color at
Settings|Editor|Color Scheme|General|Guides|Visual guides. Please
submit separate reports if you find any problems.
I personally found the setting in Settings|Editor|Code Style|PHP|Wrapping and Braces|Visual guides. It should be there for every language.