When i click on Reformat Code Clion changes my pointers
from:
int* pointer;
to:
int *pointer;
How can i prevent that from happening?
I searched through the settings but couldn't find anything.
The alignment of pointers can be set in the code style settings.
Related
For one of my enum classes I'd like to use non-standard naming:
enum class MyEnum {
I_like_to_use,
This_strange_naming_here
}
The IDE (and code inspection) rightfully complains with:
Enum entry name 'This_strange_naming_here' doesn't match regex '[A-Z]([A-Za-z\d]*|[A-Z_\d]*)'.
This inspection reports enum entry named that do not follow the recommended naming conventions.
However in this case, I would like to actively suppress this warning. I tried with #Suppress("naming"), but to no avail.
For Kotlin/Java add
#Suppress("LocalVariableName", "PropertyName")
above the class name to suppress naming conventions warnings for global and local variables.
#Suppress("EnumEntryName") use these
Please see Suppress inspections. You are not supposed to type it by hand.
Use Alt+Enter to invoke the pop-up menu for the light bulb, select the inspection or the suggested quick fix from the drop-down menu, press the right arrow on the keyboard to open the sub-menu on the right, choose the Suppress option.
Remark: This question is (up to now) not a duplicate. I know how to disable the hints. This is not what I am looking for.
In intelliJ a feature "hides" parts of my code, e.g. variable declarations as "var" or getter methods like in the example below.
The code shows t.message, but the code behind this visual abbrevation is t.getMessage(). How can I disable that feature and always show t.getMessage()?
Abbreviated code:
Real code:
Because I don't know the name of the feature I have no idea what I am looking for. Any ideas?
To disable showing val/var instead of variable type
go to Settings | Editor | General | Code Folding
and UnCheck Variable Declaration
And just next to it
Uncheck Getters and setters
to start showing getter Setter method calls with full method name
refer- https://stackoverflow.com/a/48271952/3661654
How can I suppress the inspection in Kotlin for an unused variable
val xyz = abc
I get the squiggly line but ALT-ENTER is useless for this, I tried also to create in another method several variables unused and they also lack the ALT-ENTER ability to ignore the warning. Although I have definitely used ALT-ENTER for this in the past, although maybe it was only in java, can't remember.
So I must manually construct it by hand. I've been trying several variations but I can't get anything to work. Please tell me the correct //noinspection or #SupressWarnings to use, thanks
In IntelliJ IDEA, a right-side arrow on an ALT+ENTER context menu (like this: ) means that you can use your arrow keys to navigate further along the menu. In this case, it leads to your answer:
#Suppress("UNUSED_VARIABLE")
val unused = ""
If you do not get the initial context menu (Remove variable '...'), you may have disabled the "Unused assignment" inspection in your current project. You can fix this by going to Settings -> Editor -> Inspections.
I am trying out the new AppCode 2.0 for Objective-C development.
It shows me a warning in a bubble I don't know from Xcode if I hover the code it indicates as problematic.
How can I copy this message to the clipboard for googling?
Note, that I don't want information about the warning itself, just about how to copy it, so please don't add comments that I should paste some code.
Actually I just found a way: if the bubble shows up, you need to point with the cursor to it, what is quite difficult, as you must enter it through the arrow it points to the problematic code. than you have to point to the beginning of the message by not leaving the text that is printed inside the bubble. by dragging till the second last char you can mark the text and copy it than, while still holding the mouse key down. But if you also try to mark the last char, it will fail.
So the question is now: how to perform the copying of a warning message more easy?
OK, for the more curious among us:
AppCode yields a warning for the line
self.descriptionLabelSize = [description sizeWithFont:[UIFont fontWithName:#"Helvetica" size:17] constrainedToSize:constraintSize lineBreakMode:UILineBreakModeWordWrap];
it says about UILineBreakModeWordWrap:
Parameter type mismatch: Incompatible enum types 'NSLineBreakMode' and 'anonymous enum'
I am quite sure that we all agree with Xcode that this line is correct. I just want to google for it, and in case i won't find anything, report to the AppCode team.
There is a way to copy the warning message: run the inspections in the batch mode for the current file: Code | Inspect Code and choose the current file scope. Then find your warning in the inspections view below (this one will be under "type checks").
BTW, you shouldn't use "UILineBreakModeWordWrap" - it's deprecated since iOS 6.0 (AppCode should warn you). If you use NSLineBreakByWordWrapping, the warning will go away.
Is there a macro or preference setting that would automatically align method parameters along the columns and colons in Xcode?
Basically a shortcut to turn this:
[object methodWithParam:theParam another:theOtherValue something:theSomethingValue else:theElseValue];
automatically into this:
[object methodWithParam:theParam
another:theOtherValue
something:theSomethingValue
else:theElseValue];
Is it possible to get this working with code completion? In other words when I tab complete a method it would automatically wrap the formatting into this style? And what about preexisting code? Can I put my caret inside a method, press a keyboard shortcut and auto format the parameters?
It has no built in support for this. See the answers in this SO question for some tips.