当前位置:网站首页>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 ...
边栏推荐
- Pytest+request+allure+excel interface automatic construction from 0 to 1 [familiar with framework structure]
- Pycharm importing third-party libraries
- NVIC中断优先级管理
- 二叉树高频题型
- STM32 serial port register library function configuration method
- E-commerce campaign Guide
- MySql数据库-事务-学习笔记
- Original collection of hardware bear (updated on June 2022)
- Port occupation troubleshooting
- Huawei hcip datacom core_ 03day
猜你喜欢
【Istio Network CRD VirtualService、Envoyfilter】
[istio introduction, architecture, components]
C语言指针(下篇)
Summary of PMP learning materials
What are the conditions for applying for NPDP?
Port multiplexing and re imaging
C语言指针(中篇)
2020 year end summary
On December 8th, 2020, the memory of marketing MRC application suddenly increased, resulting in system oom
Full link voltage test of the e-commerce campaign Guide
随机推荐
Data association between two interfaces of postman
Locust performance test 5 (analysis)
Why is access to the external network prohibited for internal services of the company?
Jenkins modifies the system time
Postman data driven
Mysql database lock learning notes
超十万字_超详细SSM整合实践_手动实现权限管理
OpenGL 3D graphics rendering
Leetcode刷题记录(数组)组合总和、组合总和 II
MySQL master-slave delay solution
Several stages of PMP preparation study
stm32和电机开发(从单机版到网络化)
信息安全实验四:Ip包监视程序实现
Yapi test plug-in -- cross request
(3/8) method parameters of improper use of enumeration (2)
Locust performance test 4 (custom load Policy)
徽商期货公司评级是多少?开户安全吗?我想开户,可以吗?
Two schemes of unit test
Detailed learning notes of JVM memory structure (I)
C language pointer (Part 2)