本文介绍了Delphi 2010:有人为格式化程序设置了正确的设置,以不折叠匿名方法吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用默认设置,Delphi 2010代码格式化程序将匿名方法折叠在一行上。
With the default settings, the Delphi 2010 code formatter folds anonymous methods on one line.
是否有人找到设置来规避此设置?
Is there anyone who has found settings to circumvent this?
原始代码:
procedure TUnit.AppendFinalization(const StringBuilder: TStringBuilder);
begin
AppendMemberResults(StringBuilder,
function(Member: TGeneratableInUnit): IStringListWrapper
begin
Result := Member.FinalizationText;
end
);
end;
procedure TUnit.AppendMemberResults(const StringBuilder: TStringBuilder; const GetMemberText: TFunc<TGeneratableInUnit, IStringListWrapper>);
格式化代码:
procedure TUnit.AppendFinalization(const StringBuilder: TStringBuilder);
begin
AppendMemberResults(StringBuilder, function(Member: TGeneratableInUnit): IStringListWrapper begin Result := Member.FinalizationText; end);
end;
procedure TUnit.AppendMemberResults(const StringBuilder: TStringBuilder; const GetMemberText: TFunc<TGeneratableInUnit, IStringListWrapper>);
如您所见,匿名方法被格式化为一行。
As you can see, the anonymous method is being formatted to one line.
我感觉这里缺少某种设置。
I feel I'm missing some kind of setting here.
推荐答案
它已记录为Quality Central中的格式化程序错误:77547。
It's logged as a formatter bug in Quality Central: 77547.
这篇关于Delphi 2010:有人为格式化程序设置了正确的设置,以不折叠匿名方法吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!