-
Notifications
You must be signed in to change notification settings - Fork 231
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
46c5f81
commit 1f42ff5
Showing
7 changed files
with
149 additions
and
88 deletions.
There are no files selected for viewing
80 changes: 70 additions & 10 deletions
80
packages/compiler/test/formatter/scenarios/inputs/alias.tsp
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 |
---|---|---|
@@ -1,20 +1,80 @@ | ||
alias UnionOfType = Foo | Bar; | ||
|
||
alias UnionOfManyType = "one" | "two" | "three" | "four" | "five" | "six" | "seven" | "height" | "nine" | "ten"; | ||
alias UnionOfManyType = | ||
| "one" | ||
| "two" | ||
| "three" | ||
| "four" | ||
| "five" | ||
| "six" | ||
| "seven" | ||
| "height" | ||
| "nine" | ||
| "ten"; | ||
|
||
alias UnionOfObject = {foo: string} | {bar: string}; | ||
alias UnionOfObject = { | ||
foo: string; | ||
} | { | ||
bar: string; | ||
}; | ||
|
||
alias UnionOfManyObject = {one: string} | {two: string} | {three: string} | {four: string} | {five: string}; | ||
alias UnionOfManyObject = | ||
| { | ||
one: string; | ||
} | ||
| { | ||
two: string; | ||
} | ||
| { | ||
three: string; | ||
} | ||
| { | ||
four: string; | ||
} | ||
| { | ||
five: string; | ||
}; | ||
|
||
alias UnionOfMix = Foo | { bar: string}; | ||
alias UnionOfMix = Foo | { | ||
bar: string; | ||
}; | ||
|
||
alias UnionOfManyMix = Foo | { bar: string} | Bar | Other | {other: string}; | ||
alias UnionOfManyMix = | ||
| Foo | ||
| { | ||
bar: string; | ||
} | ||
| Bar | ||
| Other | ||
| { | ||
other: string; | ||
}; | ||
|
||
alias InterOfObject = {foo: string} & {bar: string}; | ||
alias InterOfObject = { | ||
foo: string; | ||
} & { | ||
bar: string; | ||
}; | ||
|
||
alias InterOfManyObject = {one: string} & {two: string} & {three: string} & {four: string} & {five: string}; | ||
alias InterOfManyObject = { | ||
one: string; | ||
} & { | ||
two: string; | ||
} & { | ||
three: string; | ||
} & { | ||
four: string; | ||
} & { | ||
five: string; | ||
}; | ||
|
||
alias InterOfMix = Foo & { bar: string}; | ||
|
||
alias InterOfManyMix = Foo & { bar: string} & Bar & Other & {other: string}; | ||
alias InterOfMix = Foo & { | ||
bar: string; | ||
}; | ||
|
||
alias InterOfManyMix = Foo & { | ||
bar: string; | ||
} & Bar & | ||
Other & { | ||
other: string; | ||
}; |
25 changes: 8 additions & 17 deletions
25
packages/compiler/test/formatter/scenarios/inputs/interface.tsp
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 |
---|---|---|
@@ -1,30 +1,21 @@ | ||
interface | ||
Foo { | ||
x ( | ||
n: int32 | ||
) : | ||
string, | ||
y (x: int32, y: int32): int32 | ||
interface Foo { | ||
x(n: int32): string; | ||
y(x: int32, y: int32): int32; | ||
} | ||
|
||
interface Bar extends | ||
ResourceOperations<BarResource> { | ||
interface Bar extends ResourceOperations<BarResource> { | ||
blerp(n: int32): string; | ||
} | ||
|
||
interface Baz extends ResourceRead<BarResource>, | ||
|
||
ResourceCreate<BarResource>, ResourceDelete<BarResource> | ||
{ | ||
interface Baz | ||
extends ResourceRead<BarResource>, | ||
ResourceCreate<BarResource>, | ||
ResourceDelete<BarResource> { | ||
glorp(n: int32): string; | ||
} | ||
|
||
|
||
interface WithMultipleOperation { | ||
|
||
keepSeparation1(): string; | ||
|
||
|
||
|
||
keepSeperation2(): string; | ||
} |
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
31 changes: 13 additions & 18 deletions
31
packages/compiler/test/formatter/scenarios/inputs/model.tsp
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 |
---|---|---|
@@ -1,29 +1,24 @@ | ||
model Empty { | ||
} | ||
model Empty {} | ||
|
||
model WithProps { | ||
foo: string; | ||
bar: string | ||
model WithProps { | ||
foo: string; | ||
bar: string; | ||
} | ||
|
||
model WithSpreadAndProps { | ||
foo: string; | ||
... WithProps | ||
|
||
|
||
other: | ||
int16; | ||
foo: string; | ||
...WithProps; | ||
other: int16; | ||
} | ||
|
||
model GenericExtension<T> extends Parent<T> { | ||
|
||
} | ||
model GenericExtension<T> extends Parent<T> {} | ||
|
||
model Foo< | ||
T extends string, | ||
K extends { | ||
foo: int32; | ||
some: string; | ||
eveneveneveneveneveneven: string; | ||
someveryveryveryveryverylong: string; | ||
}> {} | ||
some: string; | ||
eveneveneveneveneveneven: string; | ||
someveryveryveryveryverylong: string; | ||
} | ||
> {} |
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
union Foo | ||
<x, y> { x: int32 } | ||
union Foo<x, y> { | ||
x: int32, | ||
} |
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
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