当前位置:网站首页>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 ...
边栏推荐
- PMP examination experience sharing
- Unity shader beginner's Essentials (I) -- basic lighting notes
- 2022-06-30 unity core 8 - model import
- Simulation volume leetcode [general] 1567 Length of the longest subarray whose product is a positive number
- STM32 serial port register library function configuration method
- LeetCode每日一题(2316. Count Unreachable Pairs of Nodes in an Undirected Graph)
- PMP Exam Preparation experience, seek common ground while reserving differences, and successfully pass the exam
- How to use Arthas to view class variable values
- Interview question: general layout and wiring principles of high-speed PCB
- Serializer & modelserializer of DRF serialization and deserialization
猜你喜欢
随机推荐
Unity shader beginner's Essentials (I) -- basic lighting notes
[chaosblade: node CPU load, node network delay, node network packet loss, node domain name access exception]
Huawei hcip datacom core_ 03day
Pytest+request+allure+excel interface automatic construction from 0 to 1 [familiar with framework structure]
Full link voltage test of the e-commerce campaign Guide
What is the rating of Huishang futures company? Is it safe to open an account? I want to open an account, OK?
Two schemes of unit test
MySql数据库-索引-学习笔记
2021 year end summary
华为HCIP-DATACOM-Core_03day
What are the suggestions for PMP candidates?
串口实验——简单数据收发
What are the conditions for applying for NPDP?
Reflections on the way of enterprise IT architecture transformation (Alibaba's China Taiwan strategic thought and architecture practice)
How can I apply for a PMP certificate?
Entity of cesium data visualization (Part 1)
数据在内存中的存储
OpenGL 3D graphics rendering
Interpretation of MySQL optimization principle
Unittest simple project