gpt4 book ai didi

java - 我如何更改我的 Eclipse 源格式化程序设置来处理以下示例?

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:19:47 26 4
gpt4 key购买 nike

这段代码是我在eclipse中写的

protected void createTables(SQLiteDatabase db) {
db.execSQL(
"create table " + CUSTOMERS_TABLE +" (" +
CustomerId + " text primary key," +
FirstName + " text," +
MiddleName + " text," +
LastName + " text," +
Portrait + " BLOB," +
Gender + " integer," +
Age + " integer," +
Passed + " integer"+
");"

但是当我使用 source->format eclipse 格式化我的代码时,使它们像这样

protected void createTables(SQLiteDatabase db) {
db.execSQL("create table " + CUSTOMERS_TABLE + " (" + CustomerId
+ " text primary key," + FirstName + " text," + MiddleName
+ " text," + LastName + " text," + Portrait + " BLOB," + Gender
+ " integer," + Age + " integer,"
+ Passed
+ " integer" +");"

我希望 eclipse 格式化程序保留我的代码。我应该设置哪些设置?

最佳答案

//@formatter:off//@formatter:on 之间包含您不希望 eclipse 重新格式化的行:

protected void createTables(SQLiteDatabase db) {
// @formatter:off
db.execSQL(
"create table " + CUSTOMERS_TABLE +" (" +
CustomerId + " text primary key," +
FirstName + " text," +
MiddleName + " text," +
LastName + " text," +
Portrait + " BLOB," +
Gender + " integer," +
Age + " integer," +
Passed + " integer"+
");"
// @formatter:on

关于java - 我如何更改我的 Eclipse 源格式化程序设置来处理以下示例?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14058921/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com