alibaba / alibaba/p3c

使用“eclipse-codetemplate.xml”后,eclipse 新建 java 类文件样式不对,需要单独 format 一遍

Open
#876 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Kotlin
Stars
30.9k
Forks
8k
PR merge metrics
No merged PRs in 30d

Description

## Rule content

eclipse-codetemplate.xml 第 19-23 行
```
${filecomment}
${package_declaration}

${typecomment}
${type_declaration}
```
## Problem description
使用“eclipse-codetemplate.xml”后,eclipse 新建 java 类文件样式不对,需要单独 format 一遍

![image](https://user-images.githubusercontent.com/5608413/154790096-5ede3d67-111e-45cd-9db0-f5224f803b3f.png)

正确应该是:
```
package com.ngailab;

public class Test {

}
```

## Advice

建议改为如下,去掉行首的空格
```
${filecomment}
${package_declaration}

${typecomment}
${type_declaration}
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Open eclipse-codetemplate.xml and inspect lines 19-23, especially the leading spaces around ${package_declaration}, ${typecomment}, and ${type_declaration}. Remove the unintended indentation and verify that a newly created Eclipse Java class has the expected package and class layout without requiring manual formatting.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
developer-experience
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.