当前位置:网站首页>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 ...
边栏推荐
- Several stages of PMP preparation study
- 外部中断实现按键实验
- Detailed learning notes of JVM memory structure (I)
- 2020 year end summary
- Where is the answer? action config/Interceptor/class/servlet
- What is the value of getting a PMP certificate?
- [istio introduction, architecture, components]
- RuntimeError: Calculated padded input size per channel: (1 x 1). Kernel size: (5 x 5). Kernel size c
- STM32 clock system
- (3/8) method parameters of improper use of enumeration (2)
猜你喜欢
随机推荐
Mysql database index study notes
Jemter operation
十二、排序
SAP MM STO单据的外向交货单创建后新加ITEM?
Reading notes of pyramid principle
Systick tick timer
C language pointer (exercises)
PMP Exam Preparation experience, seek common ground while reserving differences, and successfully pass the exam
2022-06-30 unity core 8 - model import
Two schemes of unit test
Simulation volume leetcode [general] 1609 Parity tree
PMP certificate preparation experience sharing
STM32串口寄存器库函数配置方法
[chaosblade: node CPU load, node network delay, node network packet loss, node domain name access exception]
PMP Exam Preparation experience systematically improve project management knowledge through learning
Leetcode daily questions (2316. count unreachable pairs of nodes in an undirected graph)
What are the conditions for applying for NPDP?
Port occupation troubleshooting
串口实验——简单数据收发
Unittest simple project