Skip to content

Commit

Permalink
Add UseTypeClause config
Browse files Browse the repository at this point in the history
  • Loading branch information
CKMonika committed Feb 16, 2024
1 parent 062a32f commit 45c7f6e
Show file tree
Hide file tree
Showing 16 changed files with 724 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
{
"id": 23,
"kind": "command",
"command": {
"command": "group",
"id": 0,
"groupContents": {
"id": 22,
"kind": "list",
"list": [
{
"id": 0,
"kind": "text",
"text": "use type "
},
{
"id": 20,
"kind": "command",
"command": {
"command": "align",
"alignData": {
"kind": "innerRoot"
},
"alignContents": {
"id": 19,
"kind": "list",
"list": [
{
"id": 9,
"kind": "command",
"command": {
"command": "align",
"alignData": {
"kind": "innerRoot"
},
"alignContents": {
"id": 8,
"kind": "command",
"command": {
"command": "align",
"alignData": {
"kind": "width",
"n": 2
},
"alignContents": {
"id": 7,
"kind": "command",
"command": {
"command": "group",
"id": 0,
"groupContents": {
"id": 6,
"kind": "list",
"list": [
{
"id": 1,
"kind": "text",
"text": "Aaaaaaaaa"
},
{
"id": 2,
"kind": "command",
"command": {
"command": "line",
"literal": false,
"soft": true,
"hard": false
}
},
{
"id": 3,
"kind": "text",
"text": ".Bbbbbbb"
},
{
"id": 4,
"kind": "command",
"command": {
"command": "line",
"literal": false,
"soft": true,
"hard": false
}
},
{
"id": 5,
"kind": "text",
"text": ".Cccccc"
}
]
},
"break": false,
"expandedStates": null
}
}
}
}
}
},
{
"id": 10,
"kind": "text",
"text": ","
},
{
"id": 11,
"kind": "command",
"command": {
"command": "line",
"literal": false,
"soft": false,
"hard": false
}
},
{
"id": 12,
"kind": "text",
"text": "Dddddddddddddddddddd,"
},
{
"id": 13,
"kind": "command",
"command": {
"command": "line",
"literal": false,
"soft": false,
"hard": false
}
},
{
"id": 14,
"kind": "text",
"text": "eeeeeeeeeeeeeeeeeeeeeeeeee,"
},
{
"id": 15,
"kind": "command",
"command": {
"command": "line",
"literal": false,
"soft": false,
"hard": false
}
},
{
"id": 16,
"kind": "text",
"text": "Fff,"
},
{
"id": 17,
"kind": "command",
"command": {
"command": "line",
"literal": false,
"soft": false,
"hard": false
}
},
{
"id": 18,
"kind": "text",
"text": "Ggg"
}
]
}
}
},
{
"id": 21,
"kind": "text",
"text": ";"
}
]
},
"break": false,
"expandedStates": null
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use type Aaaaaaaaa .Bbbbbbb. Cccccc, Dddddddddddddddddddd, eeeeeeeeeeeeeeeeeeeeeeeeee, Fff, Ggg;
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
use type Aaaaaaaaa.Bbbbbbb.Cccccc,
Dddddddddddddddddddd,
eeeeeeeeeeeeeeeeeeeeeeeeee,
Fff,
Ggg;
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
description: |
This test checks the formatting of a use type clause line
with an exceeding length. Dotted names and simple names are
used to designate the types.
It is expected to break after the first used type and get
all the types aligned afterbased on this element initial
position.
driver: unparser
rule: use_clause
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
{
"id": 23,
"kind": "command",
"command": {
"command": "group",
"id": 0,
"groupContents": {
"id": 22,
"kind": "list",
"list": [
{
"id": 0,
"kind": "text",
"text": "use type "
},
{
"id": 20,
"kind": "command",
"command": {
"command": "align",
"alignData": {
"kind": "innerRoot"
},
"alignContents": {
"id": 19,
"kind": "list",
"list": [
{
"id": 9,
"kind": "command",
"command": {
"command": "align",
"alignData": {
"kind": "innerRoot"
},
"alignContents": {
"id": 8,
"kind": "command",
"command": {
"command": "align",
"alignData": {
"kind": "width",
"n": 2
},
"alignContents": {
"id": 7,
"kind": "command",
"command": {
"command": "group",
"id": 0,
"groupContents": {
"id": 6,
"kind": "list",
"list": [
{
"id": 1,
"kind": "text",
"text": "Aaa"
},
{
"id": 2,
"kind": "command",
"command": {
"command": "line",
"literal": false,
"soft": true,
"hard": false
}
},
{
"id": 3,
"kind": "text",
"text": ".Bbb"
},
{
"id": 4,
"kind": "command",
"command": {
"command": "line",
"literal": false,
"soft": true,
"hard": false
}
},
{
"id": 5,
"kind": "text",
"text": ".C"
}
]
},
"break": false,
"expandedStates": null
}
}
}
}
}
},
{
"id": 10,
"kind": "text",
"text": ","
},
{
"id": 11,
"kind": "command",
"command": {
"command": "line",
"literal": false,
"soft": false,
"hard": false
}
},
{
"id": 12,
"kind": "text",
"text": "Ddd,"
},
{
"id": 13,
"kind": "command",
"command": {
"command": "line",
"literal": false,
"soft": false,
"hard": false
}
},
{
"id": 14,
"kind": "text",
"text": "eeeee,"
},
{
"id": 15,
"kind": "command",
"command": {
"command": "line",
"literal": false,
"soft": false,
"hard": false
}
},
{
"id": 16,
"kind": "text",
"text": "Fff,"
},
{
"id": 17,
"kind": "command",
"command": {
"command": "line",
"literal": false,
"soft": false,
"hard": false
}
},
{
"id": 18,
"kind": "text",
"text": "Ggg"
}
]
}
}
},
{
"id": 21,
"kind": "text",
"text": ";"
}
]
},
"break": false,
"expandedStates": null
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use type Aaa .Bbb. C, Ddd, eeeee, Fff, Ggg;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use type Aaa.Bbb.C, Ddd, eeeee, Fff, Ggg;
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
description: |
This test checks the formatting of a single line use type clause
with a dotted name ada kind used to designate the package.
It is expected to kee everything on the same line and keep the
initial casing as well.
driver: unparser
rule: use_clause
Loading

0 comments on commit 45c7f6e

Please sign in to comment.