-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'gnatformat-issue_55' into 'master'
Avoid certain cases where 'is' is in its own line Closes eng/ide/gnatformat#55 See merge request eng/libadalang/libadalang!1723
- Loading branch information
Showing
7 changed files
with
130 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
testsuite/tests/unparsing/subp_body/long_subp_spec_no_decls/input.ada
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
function To_Source_Location_Range | ||
(Self : Langkit_Text_Document'Class; A_Range : LSP.Structures.A_Range) | ||
return Langkit_Support.Slocs.Source_Location_Range | ||
is | ||
begin | ||
return | ||
Langkit_Support.Slocs.Make_Range | ||
(Self.To_Source_Location (A_Range.start), | ||
Self.To_Source_Location (A_Range.an_end)); | ||
end To_Source_Location_Range; |
9 changes: 9 additions & 0 deletions
9
testsuite/tests/unparsing/subp_body/long_subp_spec_no_decls/test.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
function To_Source_Location_Range | ||
(Self : Langkit_Text_Document'Class; A_Range : LSP.Structures.A_Range) | ||
return Langkit_Support.Slocs.Source_Location_Range is | ||
begin | ||
return | ||
Langkit_Support.Slocs.Make_Range | ||
(Self.To_Source_Location (A_Range.start), | ||
Self.To_Source_Location (A_Range.an_end)); | ||
end To_Source_Location_Range; |
6 changes: 6 additions & 0 deletions
6
testsuite/tests/unparsing/subp_body/long_subp_spec_no_decls/test.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
driver: unparser | ||
rule: subp_body | ||
description: | | ||
For a `SubpBody` node whose `f_decls` is empty, null `f_aspects` and | ||
`f_subp_spec` breaks, test that the `is` is added to the end of | ||
`f_subp_spec` if it fits. |
10 changes: 10 additions & 0 deletions
10
testsuite/tests/unparsing/subp_body/long_subp_spec_with_decls/input.ada
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
function To_Source_Location_Range | ||
(Self : Langkit_Text_Document'Class; A_Range : LSP.Structures.A_Range) | ||
return Langkit_Support.Slocs.Source_Location_Range is | ||
I : Integer; | ||
begin | ||
return | ||
Langkit_Support.Slocs.Make_Range | ||
(Self.To_Source_Location (A_Range.start), | ||
Self.To_Source_Location (A_Range.an_end)); | ||
end To_Source_Location_Range; |
11 changes: 11 additions & 0 deletions
11
testsuite/tests/unparsing/subp_body/long_subp_spec_with_decls/test.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
function To_Source_Location_Range | ||
(Self : Langkit_Text_Document'Class; A_Range : LSP.Structures.A_Range) | ||
return Langkit_Support.Slocs.Source_Location_Range | ||
is | ||
I : Integer; | ||
begin | ||
return | ||
Langkit_Support.Slocs.Make_Range | ||
(Self.To_Source_Location (A_Range.start), | ||
Self.To_Source_Location (A_Range.an_end)); | ||
end To_Source_Location_Range; |
5 changes: 5 additions & 0 deletions
5
testsuite/tests/unparsing/subp_body/long_subp_spec_with_decls/test.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
driver: unparser | ||
rule: subp_body | ||
description: | | ||
For a `SubpBody` node whose `f_decls` is not empty, null `f_aspects` and | ||
`f_subp_spec` breaks, test that a line break is added before the `is`. |