-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gnatpp: Feature suggestion #11
Comments
Why not indeed, with the same reserved as for #10 (proliferation of options). Another possible option would be a general --favor-line-breaks-over-long-lines which would basically systematically break lines after each parameter, condition, aggregate element, subprogram call, ... |
Thank you for your answer. ;) I tried to solve the problem myself. I found the following line: libadalang-tools/src/pp-actions.adb Line 1572 in af084d0
And replaced it by: Nonvertical_Agg_Alt => L ("$(?~~ with #~?~,$ ~~)"), The example procedure calls two to six are formatted as expected but unfortunately this change also introduces a new line in the first procedure call:
I figured out that this template definition is only used in the following procedure: libadalang-tools/src/pp-actions.adb Lines 3482 to 3489 in af084d0
My question: Is I am thinking about something like this: procedure Do_Aggregate is
begin
if Is_Vertical_Aggregate (Tree) then
Interpret_Alt_Template (Vertical_Agg_Alt);
else
-- Question: Is such a function available?
if Number_Of_Children (Tree) = 1 then
Interpret_Alt_Template (Nonvertical_Agg_Alt);
-- old template version: L ("#(?~~ with #~?~,# ~~)")
else
Interpret_Alt_Template (Nonvertical_Agg_Alt_New);
-- new template version: L ("$(?~~ with #~?~,$ ~~)")
end if;
end if;
end Do_Aggregate; |
Happy New Year! |
Assuming --no-compact is addressing the need. |
…master' Resolve "Multiple gnatrefactor regressions on Windows" Closes #11 See merge request eng/ide/libadalang-tools!29
…master' Resolve "Multiple gnatrefactor regressions on Windows" Closes #11 See merge request eng/ide/libadalang-tools!41
Example Ada code formatted using
gnatpp --call_threshold=1 input.adb
:Why not add an option to force each element of the arrays (parameter
Another_Param
) on a new line like in the last example (otherwise the line would become to long):Expected output:
Maybe this change is as simple as updating/replacing a few defined templates (replace
#
with$
)?The text was updated successfully, but these errors were encountered: