DavidFeldhoff / al-codeactions

MIT License
17 stars 8 forks source link

Cosmetic change : Add blank line after / before event publishers #129

Closed fvet closed 3 years ago

fvet commented 3 years ago

I find myself always adding a blank line after an OnBefore event has been event or inserting a blank line before the OnAfter event. Just a cosmetic thing.

Would be nice if this could be part of the code action ;)

Before

Procedure MyFunction()
begin
  CodeLine();
end;

After applying the OnBefore / OnAfter code actions (as-is)

Procedure MyFunction()
begin
  OnBeforeMyFunction();
  If IsHandled then
    exit;
  CodeLine();
  OnAfterMyFunction();
end;

Required output (to-be)

Procedure MyFunction()
begin
  OnBeforeMyFunction();
  If IsHandled then
    exit;  // Add blank line after

  CodeLine();

  OnAfterMyFunction();  // Add blank line before
end;
DavidFeldhoff commented 3 years ago

Hi Frédéric. I've just released version 1.0.8. The blank lines are added if after the OnBefore no blank line exists or before the OnAfter no blank line exists. Please try it out and close the ticket, if it works for you