diff --git a/extensions/default_unparsing_config.json b/extensions/default_unparsing_config.json index 73a5bc690..fcdd5dddc 100644 --- a/extensions/default_unparsing_config.json +++ b/extensions/default_unparsing_config.json @@ -5833,8 +5833,14 @@ "field": "f_has_constant" }, { - "kind": "recurse_field", - "field": "f_subtype_indication" + "kind": "continuationLineIndent", + "contents": [ + "line", + { + "kind": "recurse_field", + "field": "f_subtype_indication" + } + ] } ] } diff --git a/testsuite/tests/unparsing/anonymous_type_decl/access_type/long_not_null_access/input.ada b/testsuite/tests/unparsing/anonymous_type_decl/access_type/long_not_null_access/input.ada new file mode 100644 index 000000000..4af6189f2 --- /dev/null +++ b/testsuite/tests/unparsing/anonymous_type_decl/access_type/long_not_null_access/input.ada @@ -0,0 +1,5 @@ +procedure Initialize + (Self : in out Default_Message_Handler'Class; + Handler : + not null access LSP.Server_Message_Visitors.Server_Message_Visitor'Classss; + Priority : LSP.Server_Jobs.Job_Priority := LSP.Server_Jobs.Fence); diff --git a/testsuite/tests/unparsing/anonymous_type_decl/access_type/long_not_null_access/test.out b/testsuite/tests/unparsing/anonymous_type_decl/access_type/long_not_null_access/test.out new file mode 100644 index 000000000..425957686 --- /dev/null +++ b/testsuite/tests/unparsing/anonymous_type_decl/access_type/long_not_null_access/test.out @@ -0,0 +1,6 @@ +procedure Initialize + (Self : in out Default_Message_Handler'Class; + Handler : + not null access + LSP.Server_Message_Visitors.Server_Message_Visitor'Classss; + Priority : LSP.Server_Jobs.Job_Priority := LSP.Server_Jobs.Fence); diff --git a/testsuite/tests/unparsing/anonymous_type_decl/access_type/long_not_null_access/test.yaml b/testsuite/tests/unparsing/anonymous_type_decl/access_type/long_not_null_access/test.yaml new file mode 100644 index 000000000..d8c810364 --- /dev/null +++ b/testsuite/tests/unparsing/anonymous_type_decl/access_type/long_not_null_access/test.yaml @@ -0,0 +1,6 @@ +driver: unparser +rule: subp_decl +description: | + This test checks the formatting of a long not null anonymous access type + declaration. It is expected a line break after the `access` token and that + `f_subtype_indication` is continuation line indented. diff --git a/testsuite/tests/unparsing/anonymous_type_decl/access_type/not_null_access/input.ada b/testsuite/tests/unparsing/anonymous_type_decl/access_type/not_null_access/input.ada deleted file mode 100644 index c85ef6365..000000000 --- a/testsuite/tests/unparsing/anonymous_type_decl/access_type/not_null_access/input.ada +++ /dev/null @@ -1 +0,0 @@ -not null access Bbbbbbbbbbbbbbb diff --git a/testsuite/tests/unparsing/anonymous_type_decl/access_type/not_null_access/test.out b/testsuite/tests/unparsing/anonymous_type_decl/access_type/not_null_access/test.out deleted file mode 100644 index c85ef6365..000000000 --- a/testsuite/tests/unparsing/anonymous_type_decl/access_type/not_null_access/test.out +++ /dev/null @@ -1 +0,0 @@ -not null access Bbbbbbbbbbbbbbb diff --git a/testsuite/tests/unparsing/anonymous_type_decl/access_type/not_null_access/test.yaml b/testsuite/tests/unparsing/anonymous_type_decl/access_type/not_null_access/test.yaml deleted file mode 100644 index 7e0c26842..000000000 --- a/testsuite/tests/unparsing/anonymous_type_decl/access_type/not_null_access/test.yaml +++ /dev/null @@ -1,7 +0,0 @@ -description: | - This test checks the formatting of a simple not null - anonymous access type declaration. - It is expected the declaration stays on a single line. - -driver: unparser -rule: anonymous_type_decl diff --git a/testsuite/tests/unparsing/anonymous_type_decl/access_type/short_not_null_access/input.ada b/testsuite/tests/unparsing/anonymous_type_decl/access_type/short_not_null_access/input.ada new file mode 100644 index 000000000..a45e0b59d --- /dev/null +++ b/testsuite/tests/unparsing/anonymous_type_decl/access_type/short_not_null_access/input.ada @@ -0,0 +1,6 @@ +procedure Initialize + (Self : in out Default_Message_Handler'Class; + Handler : + not null access LSP.Server_Message_Visitors.Server_Message_Visitor'Class; + Priority : LSP.Server_Jobs.Job_Priority := LSP.Server_Jobs.Fence); + diff --git a/testsuite/tests/unparsing/anonymous_type_decl/access_type/short_not_null_access/test.out b/testsuite/tests/unparsing/anonymous_type_decl/access_type/short_not_null_access/test.out new file mode 100644 index 000000000..7b392e04e --- /dev/null +++ b/testsuite/tests/unparsing/anonymous_type_decl/access_type/short_not_null_access/test.out @@ -0,0 +1,5 @@ +procedure Initialize + (Self : in out Default_Message_Handler'Class; + Handler : + not null access LSP.Server_Message_Visitors.Server_Message_Visitor'Class; + Priority : LSP.Server_Jobs.Job_Priority := LSP.Server_Jobs.Fence); diff --git a/testsuite/tests/unparsing/anonymous_type_decl/access_type/short_not_null_access/test.yaml b/testsuite/tests/unparsing/anonymous_type_decl/access_type/short_not_null_access/test.yaml new file mode 100644 index 000000000..40c65b199 --- /dev/null +++ b/testsuite/tests/unparsing/anonymous_type_decl/access_type/short_not_null_access/test.yaml @@ -0,0 +1,5 @@ +driver: unparser +rule: subp_decl +description: | + This test checks the formatting of a simple not null anonymous access type + declaration. It is expected the declaration stays on a single line. diff --git a/testsuite/tests/unparsing/type_def/type_access_def/long_subtype_indication/test.out b/testsuite/tests/unparsing/type_def/type_access_def/long_subtype_indication/test.out index 00eceb746..c7f691611 100644 --- a/testsuite/tests/unparsing/type_def/type_access_def/long_subtype_indication/test.out +++ b/testsuite/tests/unparsing/type_def/type_access_def/long_subtype_indication/test.out @@ -1,2 +1,3 @@ type Aaaaaaaa is - access BBBBBBBBBBBbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb; + access + BBBBBBBBBBBbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb; diff --git a/testsuite/tests/unparsing/type_def/type_access_def/long_subtype_indication/test.yaml b/testsuite/tests/unparsing/type_def/type_access_def/long_subtype_indication/test.yaml index 9e7675bf5..54078c7c8 100644 --- a/testsuite/tests/unparsing/type_def/type_access_def/long_subtype_indication/test.yaml +++ b/testsuite/tests/unparsing/type_def/type_access_def/long_subtype_indication/test.yaml @@ -1,8 +1,8 @@ -description: | - This test checks the formatting of a simple access type declaration - having a long subtype indication. - It is expected the declaration be splitted after `is` keyword and - the new line be indented with a line continuation indentation. - driver: unparser rule: type_decl +description: | + This test checks the formatting of a simple access type declaration having a + long subtype indication. It is expected the declaration be splitted after + `is` keyword and the new line be indented with a line continuation + indentation. It is also expected a line break before `f_subtype_indication` + and for it to also be continuation line indented.