开发者

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

开发者 https://www.devze.com 2022-12-14 23:24 出处:网络
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?

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);
开发者_StackOverflow中文版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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消