【发布时间】:2015-06-18 19:15:13
【问题描述】:
在我的 DSL 中,我有很多东西,例如 if 条件和一些声明,例如 block(a;b;c;d;);
在我的 configureFormatting 函数中,我按以下顺序执行此操作:
for (Pair<Keyword, Keyword> pair : grammarAccess.findKeywordPairs("(", ")"))
{
c.setNoSpace().after(pair.getFirst());
c.setNoSpace().before(pair.getSecond());
}
c.setIndentation(block.getLeftParenthesisKeyword(),block.getRightParenthesisKeyword());
c.setLinewrap().after(block.getLeftParenthesisKeyword());
c.setLinewrap().before(block.getRightParenthesisKeyword());
预期是:
block (
int z;
int a;
int y;
);
if (a = 1)
实际结果:
block (int z;
int a;
int y;);
if (a = 1)
【问题讨论】:
标签: eclipse formatting dsl xtext xtend