当前位置:网站首页>The configuration and options of save actions are explained in detail, and you won't be confused after reading it
The configuration and options of save actions are explained in detail, and you won't be confused after reading it
2022-07-07 09:20:00 【Wow, it's a small dish】
Save Actions yes idea A format automation plug-in , Very easy to use , But in setting up Sava Actions Sometimes I'm confused , So I studied the meaning of each option .
My settings
Setup details
General Basic settings
Activate save actions on save(before saving each file,performs the configured actions below)
Format automatically when savingActivate save actions on shortcut
Automatically format when saving with shortcut keys
Use scenarios : Received a badly formatted document , You can use this shortcut to automatically formatActivate save actions on batch(Code>Save Actions>Execute on multiple files)
Batch format when saving
This one didn't work , Because sometimes your formatting settings are different from those of your colleagues , Formatting together will lead to conflict during merging
Formatting Actions Format trigger settings
Optimize imports
Optimize import ( Unused classes are automatically deleted import, This is usually checked )Reformat file
Reformat the file ( As long as you save the file, it will be automatically formatted )Reformat only change code
Reformat only when the code changes
The above two settings are mutually exclusive , intend , Or trigger when the code changes , Or trigger when the file changes
I usually check the one above , Feel better to useRerrange fields and methods(configured in “File>Setting>Editor>Code Style>(…)>Arragement”)
Readjust the scope of fields and methods
Do not know what that mean? , Never used
Build Actions build Set up
Is in build Settings used in the project , I won't discuss it here
Java Inspection and Quick Fix Specific formatting settings
Add final modifier to field
Add... To the field final Modifier
I haven't used it. I don't know what it meansAdd final modifier to local variable or parameter
Add... To a local variable or parameter final Modifier
The effect is as follows , All local parameters have been added final Modifier
public void printStr(final String str1, final String str2, final String str3) {
System.out.println(str1 + str2 + str3);
}
I won't check this option , Because sometimes the formal parameters will change
Add final modifier to local variable or parameter except if it is implicit
Add to a non implicit local variable or parameter final Modifier
I don't quite understand what this non implicit meansAdd static modifier to methods
Add... To the method static Modifier
The effect is as follows , Don't check
public static void testStatic(String str) {
System.out.println(str);
}
Add this to field access
Use of fields plus “this” The pointer
You can check it or not , Look at personal usage habits .Add this to method access
Method use plus this
The meaning is similar to that of the above option , You can check it or not , Look at the code habitAdd class qualifier to static member access
Static member access adds a class qualifier
That is, static methods access static variables , Will automatically add classes . Variable name , Can pointAdd class qualifier to static member access outside declaring class
Declare static member access outside the class and add a class qualifier
I don't quite understand what the class outside this declaration means , Anyway, they are mutually exclusive with the one aboveAdd missing @Override annotions
Add missing @Override annotation
Can tickAdd blocks to if/while/for statements
to if/while/for Add braces to the statement
public String judgeIt(int a) throws Exception {
if (a == 3) {
return "yes";
}
throw new Exception();
}
- Remove blocks from if/while/for statements
to if/while/for Statement to remove braces
public String judgeIt(int a) throws Exception {
if (a == 3) return "yes";
throw new Exception();
}
I'll check the one below , As if java6 If there is no other code in the future , Can directly return, It's cool
- Remove unnessary this to field and method
Remove unnecessary... From a field or method “this”
Personal habits , I don't like to use this, So I'll check this
-Remove final from private method
Private methods remove final keyword
private final String getStr(final String str) {
// After setting final Keywords will be removed when saving
return str;
}
In fact, I personally don't know why private methods should be added in front of final keyword , If there is java The great God with a better foundation saw my article , Please tell me by comment or private letter ~
Remove explicit generic type for diamond
Remove angle brackets for explicit generic types
I don't know what that means , There is no tickRemove unused suppress warning annotation
Remove useless Suppress WarningRemove unnecessary semicolon
Remove unnecessary semicolonsChange visibility of field or method to lower access
Change the visibility of a field or method to reduce access
I don't know that either ...
边栏推荐
- 華為HCIP-DATACOM-Core_03day
- When inputting an expression in the input box, an error is reported: incorrect string value:'\xf0\x9f... ' for column 'XXX' at row 1
- How can I apply for a PMP certificate?
- 端口复用和重映像
- Serial port experiment - simple data sending and receiving
- Some pit avoidance guidelines for using Huawei ECS
- Entity of cesium data visualization (Part 1)
- Simulation volume leetcode [general] 1557 The minimum number of points that can reach all points
- Cesium load vector data
- NVIC interrupt priority management
猜你喜欢
Why is access to the external network prohibited for internal services of the company?
Pytest installation (command line installation)
Huawei hcip datacom core_ 03day
Unityshader introduction essentials personal summary -- Basic chapter (I)
Variable parameter of variable length function
Expérience de port série - simple réception et réception de données
Three updates to build applications for different types of devices | 2022 i/o key review
Connecting mobile phone with ADB
[istio introduction, architecture, components]
C语言指针(下篇)
随机推荐
Data association between two interfaces of postman
What are the suggestions for PMP candidates?
Count the number of words C language
MySQL master-slave delay solution
[istio introduction, architecture, components]
C language pointer (special article)
PMP Exam Preparation experience systematically improve project management knowledge through learning
2022-06-30 unity core 8 - model import
Cesium load vector data
Test Engineer Interview Questions 2022
Two schemes of unit test
Do you have any certificates with high gold content?
Variable parameter of variable length function
MySQL common statements
C language pointer (exercises)
PMP examination experience sharing
Upgrade Alibaba cloud RDS (relational database service) instance to com mysql. jdbc. exceptions. Troubleshooting of jdbc4.communicationsexception
OpenGL 3D graphics rendering
Yapi test plug-in -- cross request
【云原生】DevOps(一):DevOps介绍及Code工具使用