Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
xunux opened this issue Feb 19, 2022 · 0 comments · May be fixed by #877

Comments

@xunux
Copy link

xunux commented Feb 19, 2022

Rule content

eclipse-codetemplate.xml 第 19-23 行

<template autoinsert="true" context="newtype_context" deleted="false" description="Newly created files" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.newtype" name="newtype">${filecomment}
 ${package_declaration}

 ${typecomment}
 ${type_declaration}</template>

Problem description

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

image

正确应该是:

package com.ngailab;

public class Test {

}

Advice

建议改为如下,去掉行首的空格

<template autoinsert="true" context="newtype_context" deleted="false" description="Newly created files" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.newtype" name="newtype">${filecomment}
${package_declaration}

${typecomment}
${type_declaration}</template>
xunux pushed a commit to xunux/p3c that referenced this issue Feb 19, 2022
xunux added a commit to xunux/p3c that referenced this issue Feb 19, 2022
xunux added a commit to xunux/p3c that referenced this issue Feb 19, 2022
@xunux xunux linked a pull request Feb 19, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant