Delphi 2010: anyone got the right settings for the formatter not to fold anonymous methods?

孤者浪人 提交于 2019-12-10 19:16:42

问题


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?

Original code:

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>);

Formatted code:

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.


回答1:


It's logged as a formatter bug in Quality Central: 77547.



来源:https://stackoverflow.com/questions/1957922/delphi-2010-anyone-got-the-right-settings-for-the-formatter-not-to-fold-anonymo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!