@alloy-js/csharp 0.20.0-dev.3 → 0.20.0-dev.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/components/Declaration.d.ts +2 -2
- package/dist/src/components/Declaration.d.ts.map +1 -1
- package/dist/src/components/Declaration.js +5 -14
- package/dist/src/components/Declaration.js.map +1 -0
- package/dist/src/components/Name.js +2 -1
- package/dist/src/components/Name.js.map +1 -0
- package/dist/src/components/ProjectDirectory.js +2 -1
- package/dist/src/components/ProjectDirectory.js.map +1 -0
- package/dist/src/components/Reference.d.ts.map +1 -1
- package/dist/src/components/Reference.js +7 -2
- package/dist/src/components/Reference.js.map +1 -0
- package/dist/src/components/SourceFile.d.ts +8 -9
- package/dist/src/components/SourceFile.d.ts.map +1 -1
- package/dist/src/components/SourceFile.js +71 -46
- package/dist/src/components/SourceFile.js.map +1 -0
- package/dist/src/components/UsingDirective.d.ts +5 -1
- package/dist/src/components/UsingDirective.d.ts.map +1 -1
- package/dist/src/components/UsingDirective.js +5 -2
- package/dist/src/components/UsingDirective.js.map +1 -0
- package/dist/src/components/attributes/attributes.js +2 -1
- package/dist/src/components/attributes/attributes.js.map +1 -0
- package/dist/src/components/attributes/attributes.test.js +2 -1
- package/dist/src/components/attributes/attributes.test.js.map +1 -0
- package/dist/src/components/class/declaration.d.ts +2 -2
- package/dist/src/components/class/declaration.d.ts.map +1 -1
- package/dist/src/components/class/declaration.js +20 -33
- package/dist/src/components/class/declaration.js.map +1 -0
- package/dist/src/components/class/declaration.test.js +173 -194
- package/dist/src/components/class/declaration.test.js.map +1 -0
- package/dist/src/components/constructor/constructor.d.ts.map +1 -1
- package/dist/src/components/constructor/constructor.js +13 -17
- package/dist/src/components/constructor/constructor.js.map +1 -0
- package/dist/src/components/constructor/constructor.test.js +12 -20
- package/dist/src/components/constructor/constructor.test.js.map +1 -0
- package/dist/src/components/doc/comment.js +2 -1
- package/dist/src/components/doc/comment.js.map +1 -0
- package/dist/src/components/doc/comment.test.js +2 -1
- package/dist/src/components/doc/comment.test.js.map +1 -0
- package/dist/src/components/doc/from-markdown.js +2 -1
- package/dist/src/components/doc/from-markdown.js.map +1 -0
- package/dist/src/components/doc/from-markdown.test.js +2 -1
- package/dist/src/components/doc/from-markdown.test.js.map +1 -0
- package/dist/src/components/{EnumDeclaration.d.ts → enum/declaration.d.ts} +6 -11
- package/dist/src/components/enum/declaration.d.ts.map +1 -0
- package/dist/src/components/enum/declaration.js +55 -0
- package/dist/src/components/enum/declaration.js.map +1 -0
- package/dist/src/components/enum/declaration.ref.test.d.ts +2 -0
- package/dist/src/components/enum/declaration.ref.test.d.ts.map +1 -0
- package/dist/src/components/enum/declaration.ref.test.js +121 -0
- package/dist/src/components/enum/declaration.ref.test.js.map +1 -0
- package/dist/src/components/enum/declaration.test.d.ts +2 -0
- package/dist/src/components/enum/declaration.test.d.ts.map +1 -0
- package/dist/src/components/enum/declaration.test.js +40 -0
- package/dist/src/components/enum/declaration.test.js.map +1 -0
- package/dist/src/components/enum/member.d.ts +7 -0
- package/dist/src/components/enum/member.d.ts.map +1 -0
- package/dist/src/components/enum/member.js +30 -0
- package/dist/src/components/enum/member.js.map +1 -0
- package/dist/src/components/enum/member.test.d.ts +2 -0
- package/dist/src/components/enum/member.test.d.ts.map +1 -0
- package/dist/src/components/enum/member.test.js +29 -0
- package/dist/src/components/enum/member.test.js.map +1 -0
- package/dist/src/components/field/field.d.ts.map +1 -1
- package/dist/src/components/field/field.js +11 -15
- package/dist/src/components/field/field.js.map +1 -0
- package/dist/src/components/field/field.test.js +9 -8
- package/dist/src/components/field/field.test.js.map +1 -0
- package/dist/src/components/index.d.ts +5 -2
- package/dist/src/components/index.d.ts.map +1 -1
- package/dist/src/components/index.js +7 -3
- package/dist/src/components/index.js.map +1 -0
- package/dist/src/components/interface/declaration.d.ts.map +1 -1
- package/dist/src/components/interface/declaration.js +21 -22
- package/dist/src/components/interface/declaration.js.map +1 -0
- package/dist/src/components/interface/declaration.test.js +28 -36
- package/dist/src/components/interface/declaration.test.js.map +1 -0
- package/dist/src/components/interface/method.d.ts.map +1 -1
- package/dist/src/components/interface/method.js +9 -16
- package/dist/src/components/interface/method.js.map +1 -0
- package/dist/src/components/interface/method.test.js +40 -48
- package/dist/src/components/interface/method.test.js.map +1 -0
- package/dist/src/components/interface/property.d.ts.map +1 -1
- package/dist/src/components/interface/property.js +23 -37
- package/dist/src/components/interface/property.js.map +1 -0
- package/dist/src/components/interface/property.test.js +13 -12
- package/dist/src/components/interface/property.test.js.map +1 -0
- package/dist/src/components/lexical-scope.d.ts +8 -0
- package/dist/src/components/lexical-scope.d.ts.map +1 -0
- package/dist/src/components/lexical-scope.js +25 -0
- package/dist/src/components/lexical-scope.js.map +1 -0
- package/dist/src/components/method/method.d.ts +5 -2
- package/dist/src/components/method/method.d.ts.map +1 -1
- package/dist/src/components/method/method.js +9 -14
- package/dist/src/components/method/method.js.map +1 -0
- package/dist/src/components/method/method.test.js +13 -12
- package/dist/src/components/method/method.test.js.map +1 -0
- package/dist/src/components/method-scope.d.ts +8 -0
- package/dist/src/components/method-scope.d.ts.map +1 -0
- package/dist/src/components/method-scope.js +25 -0
- package/dist/src/components/method-scope.js.map +1 -0
- package/dist/src/components/namespace-scopes.d.ts +13 -0
- package/dist/src/components/namespace-scopes.d.ts.map +1 -0
- package/dist/src/components/namespace-scopes.js +45 -0
- package/dist/src/components/namespace-scopes.js.map +1 -0
- package/dist/src/components/namespace.d.ts +7 -0
- package/dist/src/components/namespace.d.ts.map +1 -0
- package/dist/src/components/namespace.js +47 -0
- package/dist/src/components/namespace.js.map +1 -0
- package/dist/src/components/namespace.ref.test.d.ts +2 -0
- package/dist/src/components/namespace.ref.test.d.ts.map +1 -0
- package/dist/src/components/namespace.ref.test.js +182 -0
- package/dist/src/components/namespace.ref.test.js.map +1 -0
- package/dist/src/components/namespace.test.d.ts.map +1 -0
- package/dist/src/components/namespace.test.js +79 -0
- package/dist/src/components/namespace.test.js.map +1 -0
- package/dist/src/components/parameters/parameters.d.ts +2 -2
- package/dist/src/components/parameters/parameters.d.ts.map +1 -1
- package/dist/src/components/parameters/parameters.js +14 -12
- package/dist/src/components/parameters/parameters.js.map +1 -0
- package/dist/src/components/parameters/parameters.test.d.ts +2 -0
- package/dist/src/components/parameters/parameters.test.d.ts.map +1 -0
- package/dist/src/components/parameters/parameters.test.js +88 -0
- package/dist/src/components/parameters/parameters.test.js.map +1 -0
- package/dist/src/components/property/property.d.ts.map +1 -1
- package/dist/src/components/property/property.js +23 -37
- package/dist/src/components/property/property.js.map +1 -0
- package/dist/src/components/property/property.test.js +16 -15
- package/dist/src/components/property/property.test.js.map +1 -0
- package/dist/src/components/record/declaration.d.ts.map +1 -1
- package/dist/src/components/record/declaration.js +10 -13
- package/dist/src/components/record/declaration.js.map +1 -0
- package/dist/src/components/record/declaration.test.js +8 -14
- package/dist/src/components/record/declaration.test.js.map +1 -0
- package/dist/src/components/stc/index.js +2 -1
- package/dist/src/components/stc/index.js.map +1 -0
- package/dist/src/components/struct/declaration.d.ts.map +1 -1
- package/dist/src/components/struct/declaration.js +6 -7
- package/dist/src/components/struct/declaration.js.map +1 -0
- package/dist/src/components/struct/declaration.test.js +32 -40
- package/dist/src/components/struct/declaration.test.js.map +1 -0
- package/dist/src/components/type-parameters/type-parameter-constraints.js +2 -1
- package/dist/src/components/type-parameters/type-parameter-constraints.js.map +1 -0
- package/dist/src/components/type-parameters/type-parameter-constraints.test.js +2 -1
- package/dist/src/components/type-parameters/type-parameter-constraints.test.js.map +1 -0
- package/dist/src/components/type-parameters/type-parameter.d.ts.map +1 -1
- package/dist/src/components/type-parameters/type-parameter.js +9 -11
- package/dist/src/components/type-parameters/type-parameter.js.map +1 -0
- package/dist/src/components/type-parameters/type-parameters.js +2 -1
- package/dist/src/components/type-parameters/type-parameters.js.map +1 -0
- package/dist/src/components/type-parameters/type-parameters.test.js +5 -4
- package/dist/src/components/type-parameters/type-parameters.test.js.map +1 -0
- package/dist/src/components/var/declaration.d.ts.map +1 -1
- package/dist/src/components/var/declaration.js +8 -9
- package/dist/src/components/var/declaration.js.map +1 -0
- package/dist/src/components/var/declaration.test.js +13 -21
- package/dist/src/components/var/declaration.test.js.map +1 -0
- package/dist/src/contexts/global-namespace.d.ts +5 -0
- package/dist/src/contexts/global-namespace.d.ts.map +1 -0
- package/dist/src/contexts/global-namespace.js +25 -0
- package/dist/src/contexts/global-namespace.js.map +1 -0
- package/dist/src/contexts/namespace.d.ts +8 -0
- package/dist/src/contexts/namespace.d.ts.map +1 -0
- package/dist/src/contexts/namespace.js +6 -0
- package/dist/src/contexts/namespace.js.map +1 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +3 -1
- package/dist/src/index.js.map +1 -0
- package/dist/src/modifiers.d.ts +11 -0
- package/dist/src/modifiers.d.ts.map +1 -1
- package/dist/src/modifiers.js +2 -1
- package/dist/src/modifiers.js.map +1 -0
- package/dist/src/name-policy.js +2 -1
- package/dist/src/name-policy.js.map +1 -0
- package/dist/src/scopes/class.d.ts +10 -0
- package/dist/src/scopes/class.d.ts.map +1 -0
- package/dist/src/scopes/class.js +11 -0
- package/dist/src/scopes/class.js.map +1 -0
- package/dist/src/scopes/contexts.d.ts +9 -0
- package/dist/src/scopes/contexts.d.ts.map +1 -0
- package/dist/src/scopes/contexts.js +34 -0
- package/dist/src/scopes/contexts.js.map +1 -0
- package/dist/src/scopes/csharp.d.ts +8 -0
- package/dist/src/scopes/csharp.d.ts.map +1 -0
- package/dist/src/scopes/csharp.js +12 -0
- package/dist/src/scopes/csharp.js.map +1 -0
- package/dist/src/scopes/factories.d.ts +9 -0
- package/dist/src/scopes/factories.d.ts.map +1 -0
- package/dist/src/scopes/factories.js +24 -0
- package/dist/src/scopes/factories.js.map +1 -0
- package/dist/src/scopes/index.d.ts +10 -0
- package/dist/src/scopes/index.d.ts.map +1 -0
- package/dist/src/scopes/index.js +10 -0
- package/dist/src/scopes/index.js.map +1 -0
- package/dist/src/scopes/lexical.d.ts +7 -0
- package/dist/src/scopes/lexical.d.ts.map +1 -0
- package/dist/src/scopes/lexical.js +8 -0
- package/dist/src/scopes/lexical.js.map +1 -0
- package/dist/src/scopes/method.d.ts +9 -0
- package/dist/src/scopes/method.d.ts.map +1 -0
- package/dist/src/scopes/method.js +14 -0
- package/dist/src/scopes/method.js.map +1 -0
- package/dist/src/scopes/named-type.d.ts +22 -0
- package/dist/src/scopes/named-type.d.ts.map +1 -0
- package/dist/src/scopes/named-type.js +33 -0
- package/dist/src/scopes/named-type.js.map +1 -0
- package/dist/src/scopes/namespace.d.ts +11 -0
- package/dist/src/scopes/namespace.d.ts.map +1 -0
- package/dist/src/scopes/namespace.js +39 -0
- package/dist/src/scopes/namespace.js.map +1 -0
- package/dist/src/scopes/source-file.d.ts +16 -0
- package/dist/src/scopes/source-file.d.ts.map +1 -0
- package/dist/src/scopes/source-file.js +44 -0
- package/dist/src/scopes/source-file.js.map +1 -0
- package/dist/src/symbols/csharp.d.ts +76 -0
- package/dist/src/symbols/csharp.d.ts.map +1 -0
- package/dist/src/symbols/csharp.js +223 -0
- package/dist/src/symbols/csharp.js.map +1 -0
- package/dist/src/symbols/factories.d.ts +25 -0
- package/dist/src/symbols/factories.d.ts.map +1 -0
- package/dist/src/symbols/factories.js +87 -0
- package/dist/src/symbols/factories.js.map +1 -0
- package/dist/src/symbols/index.d.ts +5 -2
- package/dist/src/symbols/index.d.ts.map +1 -1
- package/dist/src/symbols/index.js +6 -2
- package/dist/src/symbols/index.js.map +1 -0
- package/dist/src/symbols/method.d.ts +13 -0
- package/dist/src/symbols/method.d.ts.map +1 -0
- package/dist/src/symbols/method.js +16 -0
- package/dist/src/symbols/method.js.map +1 -0
- package/dist/src/symbols/named-type.d.ts +19 -0
- package/dist/src/symbols/named-type.d.ts.map +1 -0
- package/dist/src/symbols/named-type.js +31 -0
- package/dist/src/symbols/named-type.js.map +1 -0
- package/dist/src/symbols/namespace.d.ts +22 -0
- package/dist/src/symbols/namespace.d.ts.map +1 -0
- package/dist/src/symbols/namespace.js +45 -0
- package/dist/src/symbols/namespace.js.map +1 -0
- package/dist/src/symbols/reference.d.ts +2 -2
- package/dist/src/symbols/reference.d.ts.map +1 -1
- package/dist/src/symbols/reference.js +38 -44
- package/dist/src/symbols/reference.js.map +1 -0
- package/dist/test/project-directory.test.js +14 -17
- package/dist/test/project-directory.test.js.map +1 -0
- package/dist/test/sourcefile.test.js +8 -19
- package/dist/test/sourcefile.test.js.map +1 -0
- package/dist/test/using.test.js +20 -17
- package/dist/test/using.test.js.map +1 -0
- package/dist/test/utils.js +4 -3
- package/dist/test/utils.js.map +1 -0
- package/dist/test/vitest.setup.js +2 -1
- package/dist/test/vitest.setup.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -3
- package/src/components/Declaration.tsx +3 -6
- package/src/components/Reference.tsx +3 -1
- package/src/components/SourceFile.tsx +68 -55
- package/src/components/UsingDirective.tsx +12 -2
- package/src/components/class/declaration.test.tsx +120 -143
- package/src/components/class/declaration.tsx +19 -32
- package/src/components/constructor/constructor.test.tsx +10 -16
- package/src/components/constructor/constructor.tsx +13 -27
- package/src/components/enum/declaration.ref.test.tsx +93 -0
- package/src/components/enum/declaration.test.tsx +34 -0
- package/src/components/enum/declaration.tsx +65 -0
- package/src/components/enum/member.test.tsx +24 -0
- package/src/components/enum/member.tsx +36 -0
- package/src/components/field/field.test.tsx +7 -7
- package/src/components/field/field.tsx +12 -14
- package/src/components/index.ts +5 -2
- package/src/components/interface/declaration.test.tsx +26 -32
- package/src/components/interface/declaration.tsx +16 -18
- package/src/components/interface/method.test.tsx +38 -44
- package/src/components/interface/method.tsx +7 -19
- package/src/components/interface/property.test.tsx +11 -11
- package/src/components/interface/property.tsx +15 -33
- package/src/components/lexical-scope.tsx +29 -0
- package/src/components/method/method.test.tsx +11 -11
- package/src/components/method/method.tsx +12 -18
- package/src/components/method-scope.tsx +27 -0
- package/src/components/namespace-scopes.tsx +44 -0
- package/src/components/namespace.ref.test.tsx +139 -0
- package/src/components/namespace.test.tsx +52 -0
- package/src/components/namespace.tsx +45 -0
- package/src/components/parameters/parameters.test.tsx +71 -0
- package/src/components/parameters/parameters.tsx +9 -16
- package/src/components/property/property.test.tsx +14 -14
- package/src/components/property/property.tsx +17 -38
- package/src/components/record/declaration.test.tsx +5 -12
- package/src/components/record/declaration.tsx +10 -11
- package/src/components/struct/declaration.test.tsx +16 -22
- package/src/components/struct/declaration.tsx +4 -6
- package/src/components/type-parameters/type-parameter.tsx +14 -11
- package/src/components/type-parameters/type-parameters.test.tsx +4 -4
- package/src/components/var/declaration.test.tsx +8 -14
- package/src/components/var/declaration.tsx +12 -6
- package/src/contexts/global-namespace.ts +29 -0
- package/src/contexts/namespace.ts +13 -0
- package/src/index.ts +1 -0
- package/src/modifiers.ts +14 -0
- package/src/scopes/class.ts +12 -0
- package/src/scopes/contexts.ts +45 -0
- package/src/scopes/csharp.ts +18 -0
- package/src/scopes/factories.ts +45 -0
- package/src/scopes/index.ts +9 -0
- package/src/scopes/lexical.ts +10 -0
- package/src/scopes/method.ts +22 -0
- package/src/scopes/named-type.ts +44 -0
- package/src/scopes/namespace.ts +59 -0
- package/src/scopes/source-file.ts +67 -0
- package/src/symbols/csharp.ts +307 -0
- package/src/symbols/factories.ts +199 -0
- package/src/symbols/index.ts +5 -2
- package/src/symbols/method.ts +26 -0
- package/src/symbols/named-type.ts +54 -0
- package/src/symbols/namespace.ts +62 -0
- package/src/symbols/reference.ts +47 -50
- package/temp/api.json +6251 -2454
- package/test/project-directory.test.tsx +12 -16
- package/test/sourcefile.test.tsx +7 -21
- package/test/using.test.tsx +18 -16
- package/test/utils.tsx +1 -1
- package/tsconfig.json +4 -1
- package/dist/src/components/EnumDeclaration.d.ts.map +0 -1
- package/dist/src/components/EnumDeclaration.js +0 -82
- package/dist/src/components/Namespace.d.ts +0 -11
- package/dist/src/components/Namespace.d.ts.map +0 -1
- package/dist/src/components/Namespace.js +0 -33
- package/dist/src/symbols/csharp-output-symbol.d.ts +0 -8
- package/dist/src/symbols/csharp-output-symbol.d.ts.map +0 -1
- package/dist/src/symbols/csharp-output-symbol.js +0 -19
- package/dist/src/symbols/scopes.d.ts +0 -20
- package/dist/src/symbols/scopes.d.ts.map +0 -1
- package/dist/src/symbols/scopes.js +0 -42
- package/dist/test/enum.test.d.ts +0 -2
- package/dist/test/enum.test.d.ts.map +0 -1
- package/dist/test/enum.test.js +0 -178
- package/dist/test/namespace.test.d.ts.map +0 -1
- package/dist/test/namespace.test.js +0 -81
- package/src/components/EnumDeclaration.tsx +0 -98
- package/src/components/Namespace.tsx +0 -35
- package/src/symbols/csharp-output-symbol.ts +0 -22
- package/src/symbols/scopes.ts +0 -61
- package/test/enum.test.tsx +0 -149
- package/test/namespace.test.tsx +0 -55
- /package/dist/{test → src/components}/namespace.test.d.ts +0 -0
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { createComponent as _$createComponent, mergeProps as _$mergeProps, createIntrinsic as _$createIntrinsic } from "@alloy-js/core/jsx-runtime";
|
|
2
|
+
import { Constructor } from "#components/constructor/constructor.js";
|
|
3
|
+
import { EnumDeclaration } from "#components/enum/declaration.js";
|
|
4
|
+
import { EnumMember } from "#components/enum/member.js";
|
|
2
5
|
import { code, createNamePolicy, List, NamePolicyContext, Output, refkey, render } from "@alloy-js/core";
|
|
3
6
|
import * as coretest from "@alloy-js/core/testing";
|
|
4
7
|
import { describe, expect, it } from "vitest";
|
|
@@ -7,21 +10,14 @@ import { createCSharpNamePolicy } from "../../name-policy.js";
|
|
|
7
10
|
import { Attribute } from "../attributes/attributes.js";
|
|
8
11
|
import { Field } from "../field/field.js";
|
|
9
12
|
import { Method } from "../method/method.js";
|
|
10
|
-
import { Namespace } from "../Namespace.js";
|
|
11
13
|
import { Property } from "../property/property.js";
|
|
12
14
|
import { SourceFile } from "../SourceFile.js";
|
|
13
|
-
import { Constructor, EnumDeclaration, EnumMember } from "../stc/index.js";
|
|
14
15
|
import { ClassDeclaration } from "./declaration.js";
|
|
15
16
|
function Wrapper({
|
|
16
17
|
children
|
|
17
18
|
}) {
|
|
18
19
|
return _$createComponent(TestNamespace, {
|
|
19
|
-
|
|
20
|
-
return _$createComponent(SourceFile, {
|
|
21
|
-
path: "Test.cs",
|
|
22
|
-
children: children
|
|
23
|
-
});
|
|
24
|
-
}
|
|
20
|
+
children: children
|
|
25
21
|
});
|
|
26
22
|
}
|
|
27
23
|
it("declares class with no members", () => {
|
|
@@ -138,63 +134,65 @@ describe("base", () => {
|
|
|
138
134
|
});
|
|
139
135
|
});
|
|
140
136
|
it("declares class with some members", () => {
|
|
141
|
-
const
|
|
142
|
-
"public": true,
|
|
143
|
-
name: "TestClass",
|
|
137
|
+
const tree = _$createComponent(TestNamespace, {
|
|
144
138
|
get children() {
|
|
145
|
-
return _$createComponent(
|
|
139
|
+
return _$createComponent(ClassDeclaration, {
|
|
140
|
+
"public": true,
|
|
141
|
+
name: "TestClass",
|
|
146
142
|
get children() {
|
|
147
|
-
return
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
143
|
+
return _$createComponent(List, {
|
|
144
|
+
get children() {
|
|
145
|
+
return [_$createComponent(Field, {
|
|
146
|
+
"public": true,
|
|
147
|
+
name: "MemberOne",
|
|
148
|
+
type: "string"
|
|
149
|
+
}), _$createComponent(Field, {
|
|
150
|
+
"public": true,
|
|
151
|
+
name: "MemberTwo",
|
|
152
|
+
type: "int"
|
|
153
|
+
})];
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
156
|
}
|
|
157
157
|
});
|
|
158
158
|
}
|
|
159
|
-
})
|
|
160
|
-
expect(
|
|
161
|
-
|
|
159
|
+
});
|
|
160
|
+
expect(tree).toRenderTo(coretest.d`
|
|
161
|
+
public class TestClass
|
|
162
162
|
{
|
|
163
|
-
public
|
|
164
|
-
|
|
165
|
-
public string MemberOne;
|
|
166
|
-
public int MemberTwo;
|
|
167
|
-
}
|
|
163
|
+
public string MemberOne;
|
|
164
|
+
public int MemberTwo;
|
|
168
165
|
}
|
|
169
166
|
`);
|
|
170
167
|
});
|
|
171
168
|
it("declares class with some methods", () => {
|
|
172
|
-
const
|
|
173
|
-
"public": true,
|
|
174
|
-
name: "TestClass",
|
|
169
|
+
const tree = _$createComponent(TestNamespace, {
|
|
175
170
|
get children() {
|
|
176
|
-
return _$createComponent(
|
|
171
|
+
return _$createComponent(ClassDeclaration, {
|
|
172
|
+
"public": true,
|
|
173
|
+
name: "TestClass",
|
|
177
174
|
get children() {
|
|
178
|
-
return
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
175
|
+
return _$createComponent(List, {
|
|
176
|
+
get children() {
|
|
177
|
+
return [_$createComponent(Method, {
|
|
178
|
+
"public": true,
|
|
179
|
+
name: "MethodOne"
|
|
180
|
+
}), _$createComponent(Method, {
|
|
181
|
+
"private": true,
|
|
182
|
+
virtual: true,
|
|
183
|
+
name: "MethodTwo"
|
|
184
|
+
})];
|
|
185
|
+
}
|
|
186
|
+
});
|
|
186
187
|
}
|
|
187
188
|
});
|
|
188
189
|
}
|
|
189
|
-
})
|
|
190
|
-
expect(
|
|
191
|
-
|
|
190
|
+
});
|
|
191
|
+
expect(tree).toRenderTo(coretest.d`
|
|
192
|
+
public class TestClass
|
|
192
193
|
{
|
|
193
|
-
public
|
|
194
|
-
{
|
|
195
|
-
public void MethodOne() {}
|
|
196
|
-
private virtual void MethodTwo() {}
|
|
197
|
-
}
|
|
194
|
+
public void MethodOne() {}
|
|
195
|
+
private virtual void MethodTwo() {}
|
|
198
196
|
}
|
|
199
197
|
`);
|
|
200
198
|
});
|
|
@@ -214,79 +212,71 @@ it("uses refkeys for members, params, and return type", () => {
|
|
|
214
212
|
return createCSharpNamePolicy();
|
|
215
213
|
},
|
|
216
214
|
get children() {
|
|
217
|
-
return _$createComponent(
|
|
218
|
-
|
|
215
|
+
return _$createComponent(SourceFile, {
|
|
216
|
+
path: "Test.cs",
|
|
219
217
|
get children() {
|
|
220
|
-
return _$createComponent(
|
|
221
|
-
|
|
218
|
+
return [_$createComponent(EnumDeclaration, {
|
|
219
|
+
"public": true,
|
|
220
|
+
name: "TestEnum",
|
|
221
|
+
refkey: enumTypeRefkey,
|
|
222
222
|
get children() {
|
|
223
|
-
return
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
refkey: enumTypeRefkey,
|
|
223
|
+
return _$createComponent(List, {
|
|
224
|
+
comma: true,
|
|
225
|
+
hardline: true,
|
|
227
226
|
get children() {
|
|
228
|
-
return _$createComponent(
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
name: "One"
|
|
234
|
-
}), _$createComponent(EnumMember, {
|
|
235
|
-
name: "Two"
|
|
236
|
-
})];
|
|
237
|
-
}
|
|
238
|
-
});
|
|
227
|
+
return [_$createComponent(EnumMember, {
|
|
228
|
+
name: "One"
|
|
229
|
+
}), _$createComponent(EnumMember, {
|
|
230
|
+
name: "Two"
|
|
231
|
+
})];
|
|
239
232
|
}
|
|
240
|
-
})
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
}), _$createIntrinsic("hbr", {}), _$createComponent(ClassDeclaration, {
|
|
236
|
+
"public": true,
|
|
237
|
+
name: "TestInput",
|
|
238
|
+
refkey: inputTypeRefkey
|
|
239
|
+
}), _$createIntrinsic("hbr", {}), _$createComponent(ClassDeclaration, {
|
|
240
|
+
"public": true,
|
|
241
|
+
name: "TestResult",
|
|
242
|
+
refkey: testResultTypeRefkey
|
|
243
|
+
}), _$createIntrinsic("hbr", {}), _$createComponent(ClassDeclaration, {
|
|
244
|
+
"public": true,
|
|
245
|
+
name: "TestClass",
|
|
246
|
+
get children() {
|
|
247
|
+
return [_$createComponent(Field, {
|
|
248
|
+
"private": true,
|
|
249
|
+
name: "MemberOne",
|
|
250
|
+
type: enumTypeRefkey
|
|
251
|
+
}), _$createIntrinsic("hbr", {}), _$createComponent(Method, {
|
|
249
252
|
"public": true,
|
|
250
|
-
name: "
|
|
253
|
+
name: "MethodOne",
|
|
254
|
+
parameters: params,
|
|
255
|
+
returns: testResultTypeRefkey,
|
|
251
256
|
get children() {
|
|
252
|
-
return [
|
|
253
|
-
"private": true,
|
|
254
|
-
name: "MemberOne",
|
|
255
|
-
type: enumTypeRefkey
|
|
256
|
-
}), _$createIntrinsic("hbr", {}), _$createComponent(Method, {
|
|
257
|
-
"public": true,
|
|
258
|
-
name: "MethodOne",
|
|
259
|
-
parameters: params,
|
|
260
|
-
returns: testResultTypeRefkey,
|
|
261
|
-
get children() {
|
|
262
|
-
return ["return new ", testResultTypeRefkey, "();"];
|
|
263
|
-
}
|
|
264
|
-
})];
|
|
257
|
+
return ["return new ", testResultTypeRefkey, "();"];
|
|
265
258
|
}
|
|
266
259
|
})];
|
|
267
260
|
}
|
|
268
|
-
});
|
|
261
|
+
})];
|
|
269
262
|
}
|
|
270
263
|
});
|
|
271
264
|
}
|
|
272
265
|
}));
|
|
273
266
|
expect(findFile(res, "Test.cs").contents).toBe(coretest.d`
|
|
274
|
-
|
|
267
|
+
public enum TestEnum
|
|
268
|
+
{
|
|
269
|
+
One,
|
|
270
|
+
Two
|
|
271
|
+
}
|
|
272
|
+
public class TestInput;
|
|
273
|
+
public class TestResult;
|
|
274
|
+
public class TestClass
|
|
275
275
|
{
|
|
276
|
-
|
|
276
|
+
private TestEnum _memberOne;
|
|
277
|
+
public TestResult MethodOne(int intParam, TestInput bodyParam)
|
|
277
278
|
{
|
|
278
|
-
|
|
279
|
-
Two
|
|
280
|
-
}
|
|
281
|
-
public class TestInput;
|
|
282
|
-
public class TestResult;
|
|
283
|
-
public class TestClass
|
|
284
|
-
{
|
|
285
|
-
private TestEnum _memberOne;
|
|
286
|
-
public TestResult MethodOne(int intParam, TestInput bodyParam)
|
|
287
|
-
{
|
|
288
|
-
return new TestResult();
|
|
289
|
-
}
|
|
279
|
+
return new TestResult();
|
|
290
280
|
}
|
|
291
281
|
}
|
|
292
282
|
`);
|
|
@@ -302,46 +292,38 @@ describe("with type parameters", () => {
|
|
|
302
292
|
}];
|
|
303
293
|
expect(_$createComponent(TestNamespace, {
|
|
304
294
|
get children() {
|
|
305
|
-
return _$createComponent(
|
|
306
|
-
|
|
295
|
+
return _$createComponent(ClassDeclaration, {
|
|
296
|
+
"public": true,
|
|
297
|
+
name: "TestClass",
|
|
298
|
+
typeParameters: typeParameters,
|
|
307
299
|
get children() {
|
|
308
|
-
return _$createComponent(
|
|
309
|
-
"public": true,
|
|
310
|
-
name: "TestClass",
|
|
311
|
-
typeParameters: typeParameters,
|
|
300
|
+
return _$createComponent(List, {
|
|
312
301
|
get children() {
|
|
313
|
-
return _$createComponent(
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
set: true
|
|
329
|
-
})];
|
|
330
|
-
}
|
|
331
|
-
});
|
|
302
|
+
return [_$createComponent(Property, {
|
|
303
|
+
name: "PropA",
|
|
304
|
+
get type() {
|
|
305
|
+
return typeParameters[0].refkey;
|
|
306
|
+
},
|
|
307
|
+
get: true,
|
|
308
|
+
set: true
|
|
309
|
+
}), _$createComponent(Property, {
|
|
310
|
+
name: "PropB",
|
|
311
|
+
get type() {
|
|
312
|
+
return typeParameters[1].refkey;
|
|
313
|
+
},
|
|
314
|
+
get: true,
|
|
315
|
+
set: true
|
|
316
|
+
})];
|
|
332
317
|
}
|
|
333
318
|
});
|
|
334
319
|
}
|
|
335
320
|
});
|
|
336
321
|
}
|
|
337
322
|
})).toRenderTo(`
|
|
338
|
-
|
|
323
|
+
public class TestClass<T, U>
|
|
339
324
|
{
|
|
340
|
-
|
|
341
|
-
{
|
|
342
|
-
T PropA { get; set; }
|
|
343
|
-
U PropB { get; set; }
|
|
344
|
-
}
|
|
325
|
+
T PropA { get; set; }
|
|
326
|
+
U PropB { get; set; }
|
|
345
327
|
}
|
|
346
328
|
`);
|
|
347
329
|
});
|
|
@@ -364,10 +346,10 @@ describe("with type parameters", () => {
|
|
|
364
346
|
}
|
|
365
347
|
})).toRenderTo(`
|
|
366
348
|
public class TestClass<T, U>
|
|
367
|
-
|
|
368
|
-
|
|
349
|
+
where T : IFoo
|
|
350
|
+
where U : IBar
|
|
369
351
|
{
|
|
370
|
-
|
|
352
|
+
// Body
|
|
371
353
|
}
|
|
372
354
|
`);
|
|
373
355
|
});
|
|
@@ -384,26 +366,27 @@ it("declares class with invalid members", () => {
|
|
|
384
366
|
})];
|
|
385
367
|
}
|
|
386
368
|
});
|
|
387
|
-
expect(() => toSourceText(decl)).toThrow("
|
|
369
|
+
expect(() => toSourceText(decl)).toThrow("EnumMember must be used within an EnumDeclaration.");
|
|
388
370
|
});
|
|
389
371
|
describe("constructor", () => {
|
|
390
372
|
it("declares with constructor", () => {
|
|
391
|
-
const
|
|
392
|
-
"public": true,
|
|
393
|
-
name: "TestClass",
|
|
373
|
+
const tree = _$createComponent(TestNamespace, {
|
|
394
374
|
get children() {
|
|
395
|
-
return _$createComponent(
|
|
396
|
-
"public": true
|
|
375
|
+
return _$createComponent(ClassDeclaration, {
|
|
376
|
+
"public": true,
|
|
377
|
+
name: "TestClass",
|
|
378
|
+
get children() {
|
|
379
|
+
return _$createComponent(Constructor, {
|
|
380
|
+
"public": true
|
|
381
|
+
});
|
|
382
|
+
}
|
|
397
383
|
});
|
|
398
384
|
}
|
|
399
|
-
})
|
|
400
|
-
expect(
|
|
401
|
-
|
|
385
|
+
});
|
|
386
|
+
expect(tree).toRenderTo(coretest.d`
|
|
387
|
+
public class TestClass
|
|
402
388
|
{
|
|
403
|
-
public
|
|
404
|
-
{
|
|
405
|
-
public TestClass() {}
|
|
406
|
-
}
|
|
389
|
+
public TestClass() {}
|
|
407
390
|
}
|
|
408
391
|
`);
|
|
409
392
|
});
|
|
@@ -421,44 +404,45 @@ describe("constructor", () => {
|
|
|
421
404
|
type: "int",
|
|
422
405
|
refkey: paramSizeRefkey
|
|
423
406
|
}];
|
|
424
|
-
const
|
|
425
|
-
"public": true,
|
|
426
|
-
name: "TestClass",
|
|
407
|
+
const tree = _$createComponent(TestNamespace, {
|
|
427
408
|
get children() {
|
|
428
|
-
return
|
|
429
|
-
"private": true,
|
|
430
|
-
name: "name",
|
|
431
|
-
type: "string",
|
|
432
|
-
refkey: thisNameRefkey
|
|
433
|
-
}), _$createIntrinsic("hbr", {}), _$createComponent(Field, {
|
|
434
|
-
"private": true,
|
|
435
|
-
name: "size",
|
|
436
|
-
type: "int",
|
|
437
|
-
refkey: thisSizeRefkey
|
|
438
|
-
}), _$createIntrinsic("hbr", {}), _$createComponent(Constructor, {
|
|
409
|
+
return _$createComponent(ClassDeclaration, {
|
|
439
410
|
"public": true,
|
|
440
|
-
|
|
411
|
+
name: "TestClass",
|
|
441
412
|
get children() {
|
|
442
|
-
return [
|
|
413
|
+
return [_$createComponent(Field, {
|
|
414
|
+
"private": true,
|
|
415
|
+
name: "name",
|
|
416
|
+
type: "string",
|
|
417
|
+
refkey: thisNameRefkey
|
|
418
|
+
}), _$createIntrinsic("hbr", {}), _$createComponent(Field, {
|
|
419
|
+
"private": true,
|
|
420
|
+
name: "size",
|
|
421
|
+
type: "int",
|
|
422
|
+
refkey: thisSizeRefkey
|
|
423
|
+
}), _$createIntrinsic("hbr", {}), _$createComponent(Constructor, {
|
|
424
|
+
"public": true,
|
|
425
|
+
parameters: ctorParams,
|
|
426
|
+
get children() {
|
|
427
|
+
return [thisNameRefkey, " = ", paramNameRefkey, ";", _$createIntrinsic("hbr", {}), thisSizeRefkey, " = ", paramSizeRefkey, ";"];
|
|
428
|
+
}
|
|
429
|
+
})];
|
|
443
430
|
}
|
|
444
|
-
})
|
|
431
|
+
});
|
|
445
432
|
}
|
|
446
|
-
})
|
|
433
|
+
});
|
|
447
434
|
|
|
448
435
|
// TODO: assignments to members should have this. prefix
|
|
449
436
|
// e.g. this.name = name;
|
|
450
|
-
expect(
|
|
451
|
-
|
|
437
|
+
expect(tree).toRenderTo(coretest.d`
|
|
438
|
+
public class TestClass
|
|
452
439
|
{
|
|
453
|
-
|
|
440
|
+
private string _name;
|
|
441
|
+
private int _size;
|
|
442
|
+
public TestClass(string name, int size)
|
|
454
443
|
{
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
public TestClass(string name, int size)
|
|
458
|
-
{
|
|
459
|
-
_name = name;
|
|
460
|
-
_size = size;
|
|
461
|
-
}
|
|
444
|
+
_name = name;
|
|
445
|
+
_size = size;
|
|
462
446
|
}
|
|
463
447
|
}
|
|
464
448
|
`);
|
|
@@ -492,12 +476,9 @@ describe("constructor", () => {
|
|
|
492
476
|
});
|
|
493
477
|
}
|
|
494
478
|
})).toRenderTo(`
|
|
495
|
-
|
|
479
|
+
public class TestClass(string name, int size)
|
|
496
480
|
{
|
|
497
|
-
|
|
498
|
-
{
|
|
499
|
-
string PrettyName { get; } = $"{name} {size}";
|
|
500
|
-
}
|
|
481
|
+
string PrettyName { get; } = $"{name} {size}";
|
|
501
482
|
}
|
|
502
483
|
`);
|
|
503
484
|
});
|
|
@@ -528,12 +509,9 @@ describe("constructor", () => {
|
|
|
528
509
|
});
|
|
529
510
|
}
|
|
530
511
|
})).toRenderTo(`
|
|
531
|
-
|
|
512
|
+
public class TestClass(string name)
|
|
532
513
|
{
|
|
533
|
-
|
|
534
|
-
{
|
|
535
|
-
string name_2;
|
|
536
|
-
}
|
|
514
|
+
string name_2;
|
|
537
515
|
}
|
|
538
516
|
`);
|
|
539
517
|
});
|
|
@@ -571,8 +549,8 @@ it("supports class member doc comments", () => {
|
|
|
571
549
|
/// This is a test
|
|
572
550
|
class Test
|
|
573
551
|
{
|
|
574
|
-
|
|
575
|
-
|
|
552
|
+
/// This is a member
|
|
553
|
+
public int Member;
|
|
576
554
|
}
|
|
577
555
|
`);
|
|
578
556
|
});
|
|
@@ -592,4 +570,5 @@ it("specify attributes", () => {
|
|
|
592
570
|
[Test]
|
|
593
571
|
class Test;
|
|
594
572
|
`);
|
|
595
|
-
});
|
|
573
|
+
});
|
|
574
|
+
//# sourceMappingURL=declaration.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Constructor","EnumDeclaration","EnumMember","code","createNamePolicy","List","NamePolicyContext","Output","refkey","render","coretest","describe","expect","it","findFile","TestNamespace","toSourceText","createCSharpNamePolicy","Attribute","Field","Method","Property","SourceFile","ClassDeclaration","Wrapper","children","_$createComponent","name","toRenderTo","each","mod","_$mergeProps","abstract","partial","sealed","attributes","baseType","interfaceTypes","tree","type","d","virtual","inputTypeRefkey","testResultTypeRefkey","enumTypeRefkey","params","res","namePolicy","path","comma","hardline","_$createIntrinsic","parameters","returns","contents","toBe","typeParameters","get","set","constraints","decl","toThrow","thisNameRefkey","thisSizeRefkey","paramNameRefkey","paramSizeRefkey","ctorParams","primaryConstructor","initializer","Provider","value","x","doc"],"sources":["../../../../src/components/class/declaration.test.tsx"],"sourcesContent":[null],"mappings":";AAAA,SAASA,WAAW;AACpB,SAASC,eAAe;AACxB,SAASC,UAAU;AACnB,SAEEC,IAAI,EACJC,gBAAgB,EAChBC,IAAI,EACJC,iBAAiB,EACjBC,MAAM,EACNC,MAAM,EACNC,MAAM,QACD,gBAAgB;AACvB,OAAO,KAAKC,QAAQ,MAAM,wBAAwB;AAClD,SAASC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AAC7C,SAASC,QAAQ,EAAEC,aAAa,EAAEC,YAAY;AAC9C,SAASC,sBAAsB,QAAQ,sBAAsB;AAC7D,SAASC,SAAS;AAClB,SAASC,KAAK;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,CAAC,oBAAoB,EAAE,MAAM;EAC7BD,MAAM,CAAAc,iBAAA,CACHX,aAAa;IAAA,IAAAU,SAAA;MAAA,OAAAC,iBAAA,CACXH,gBAAgB;QAACI,IAAI;QAAA,IAAQQ,UAAUA,CAAA;UAAA,OAAE,CAAAT,iBAAA,CAAER,SAAS;YAACS,IAAI;UAAA,GAAW;QAAA;MAAA;IAAA;EAAA,EAEzE,CAAC,CAACC,UAAU,CAAC;AACf;AACA;AACA,GAAG,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constructor.d.ts","sourceRoot":"","sources":["../../../../src/components/constructor/constructor.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"constructor.d.ts","sourceRoot":"","sources":["../../../../src/components/constructor/constructor.tsx"],"names":[],"mappings":"AACA,OAAO,EAAwC,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAC9E,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EACL,eAAe,EAGhB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,cAAc,EAAc,MAAM,8BAA8B,CAAC;AAE1E;;GAEG;AACH,MAAM,WAAW,gBAAiB,SAAQ,eAAe;IACvD,6BAA6B;IAC7B,UAAU,CAAC,EAAE,cAAc,EAAE,CAAC;IAE9B,aAAa;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,uBAAuB;IACvB,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,YAqBlD"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { MethodScope } from "#components/method-scope.js";
|
|
3
|
+
import { Block, MemberDeclaration, MemberName } from "@alloy-js/core";
|
|
3
4
|
import { computeModifiersPrefix, getAccessModifier } from "../../modifiers.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { CSharpMemberScope, useCSharpMemberScope } from "../../symbols/scopes.js";
|
|
5
|
+
import { useNamedTypeScope } from "../../scopes/contexts.js";
|
|
6
|
+
import { MethodSymbol } from "../../symbols/method.js";
|
|
7
7
|
import { Parameters } from "../parameters/parameters.js";
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -11,23 +11,18 @@ import { Parameters } from "../parameters/parameters.js";
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
export function Constructor(props) {
|
|
14
|
-
const scope =
|
|
15
|
-
const name =
|
|
16
|
-
const ctorSymbol = new
|
|
17
|
-
|
|
18
|
-
refkeys: props.refkey ?? refkey(name)
|
|
19
|
-
});
|
|
20
|
-
const ctorDeclScope = new CSharpMemberScope("constructor-decl", {
|
|
21
|
-
owner: ctorSymbol
|
|
14
|
+
const scope = useNamedTypeScope();
|
|
15
|
+
const name = scope.ownerSymbol.name;
|
|
16
|
+
const ctorSymbol = new MethodSymbol(name, scope.members, "constructor", {
|
|
17
|
+
refkeys: props.refkey
|
|
22
18
|
});
|
|
23
19
|
const modifiers = computeModifiersPrefix([getAccessModifier(props)]);
|
|
24
|
-
return _$createComponent(
|
|
20
|
+
return _$createComponent(MemberDeclaration, {
|
|
25
21
|
symbol: ctorSymbol,
|
|
26
22
|
get children() {
|
|
27
|
-
return _$createComponent(
|
|
28
|
-
value: ctorDeclScope,
|
|
23
|
+
return _$createComponent(MethodScope, {
|
|
29
24
|
get children() {
|
|
30
|
-
return [modifiers, _$createComponent(
|
|
25
|
+
return [modifiers, _$createComponent(MemberName, {}), _$createComponent(Parameters, {
|
|
31
26
|
get parameters() {
|
|
32
27
|
return props.parameters;
|
|
33
28
|
}
|
|
@@ -41,4 +36,5 @@ export function Constructor(props) {
|
|
|
41
36
|
});
|
|
42
37
|
}
|
|
43
38
|
});
|
|
44
|
-
}
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=constructor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["MethodScope","Block","MemberDeclaration","MemberName","computeModifiersPrefix","getAccessModifier","useNamedTypeScope","MethodSymbol","Parameters","Constructor","props","scope","name","ownerSymbol","ctorSymbol","members","refkeys","refkey","modifiers","_$createComponent","symbol","children","parameters","newline"],"sources":["../../../../src/components/constructor/constructor.tsx"],"sourcesContent":[null],"mappings":";AAAA,SAASA,WAAW;AACpB,SAASC,KAAK,EAAEC,iBAAiB,EAAEC,UAAU,QAAgB,gBAAgB;AAE7E,SAEEC,sBAAsB,EACtBC,iBAAiB,QACZ,oBAAoB;AAC3B,SAASC,iBAAiB,QAAQ,0BAA0B;AAC5D,SAASC,YAAY,QAAQ,yBAAyB;AACtD,SAAyBC,UAAU;;AAEnC;AACA;AACA;;AAYA,OAAO,SAASC,WAAWA,CAACC,KAAuB,EAAE;EACnD,MAAMC,KAAK,GAAGL,iBAAiB,CAAC,CAAC;EAEjC,MAAMM,IAAI,GAAGD,KAAK,CAACE,WAAW,CAACD,IAAI;EAEnC,MAAME,UAAU,GAAG,IAAIP,YAAY,CAACK,IAAI,EAAED,KAAK,CAACI,OAAO,EAAE,aAAa,EAAE;IACtEC,OAAO,EAAEN,KAAK,CAACO;EACjB,CAAC,CAAC;EAEF,MAAMC,SAAS,GAAGd,sBAAsB,CAAC,CAACC,iBAAiB,CAACK,KAAK,CAAC,CAAC,CAAC;EAEpE,OAAAS,iBAAA,CACGjB,iBAAiB;IAACkB,MAAM,EAAEN,UAAU;IAAA,IAAAO,SAAA;MAAA,OAAAF,iBAAA,CAClCnB,WAAW;QAAA,IAAAqB,SAAA;UAAA,QACTH,SAAS,EAAAC,iBAAA,CACThB,UAAU,OAAAgB,iBAAA,CACVX,UAAU;YAAA,IAACc,UAAUA,CAAA;cAAA,OAAEZ,KAAK,CAACY,UAAU;YAAA;UAAA,IAAAH,iBAAA,CACvClB,KAAK;YAACsB,OAAO;YAAA,IAAAF,SAAA;cAAA,OAAEX,KAAK,CAACW,QAAQ;YAAA;UAAA;QAAA;MAAA;IAAA;EAAA;AAItC","ignoreList":[]}
|
|
@@ -3,7 +3,6 @@ import { refkey } from "@alloy-js/core";
|
|
|
3
3
|
import { expect, it } from "vitest";
|
|
4
4
|
import { TestNamespace } from "../../../test/utils.js";
|
|
5
5
|
import { ClassDeclaration } from "../class/declaration.js";
|
|
6
|
-
import { SourceFile } from "../SourceFile.js";
|
|
7
6
|
import { Constructor } from "./constructor.js";
|
|
8
7
|
it("reference constructor parameters in body", () => {
|
|
9
8
|
const paramNameRefkey = refkey();
|
|
@@ -19,36 +18,29 @@ it("reference constructor parameters in body", () => {
|
|
|
19
18
|
}];
|
|
20
19
|
expect(_$createComponent(TestNamespace, {
|
|
21
20
|
get children() {
|
|
22
|
-
return _$createComponent(
|
|
23
|
-
|
|
21
|
+
return _$createComponent(ClassDeclaration, {
|
|
22
|
+
"public": true,
|
|
23
|
+
name: "TestClass",
|
|
24
24
|
get children() {
|
|
25
|
-
return _$createComponent(
|
|
25
|
+
return _$createComponent(Constructor, {
|
|
26
26
|
"public": true,
|
|
27
|
-
|
|
27
|
+
parameters: ctorParams,
|
|
28
28
|
get children() {
|
|
29
|
-
return _$
|
|
30
|
-
"public": true,
|
|
31
|
-
parameters: ctorParams,
|
|
32
|
-
get children() {
|
|
33
|
-
return [paramNameRefkey, ";", _$createIntrinsic("hbr", {}), paramSizeRefkey, ";"];
|
|
34
|
-
}
|
|
35
|
-
});
|
|
29
|
+
return [paramNameRefkey, ";", _$createIntrinsic("hbr", {}), paramSizeRefkey, ";"];
|
|
36
30
|
}
|
|
37
31
|
});
|
|
38
32
|
}
|
|
39
33
|
});
|
|
40
34
|
}
|
|
41
35
|
})).toRenderTo(`
|
|
42
|
-
|
|
36
|
+
public class TestClass
|
|
43
37
|
{
|
|
44
|
-
public
|
|
38
|
+
public TestClass(string name, int size)
|
|
45
39
|
{
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
name;
|
|
49
|
-
size;
|
|
50
|
-
}
|
|
40
|
+
name;
|
|
41
|
+
size;
|
|
51
42
|
}
|
|
52
43
|
}
|
|
53
44
|
`);
|
|
54
|
-
});
|
|
45
|
+
});
|
|
46
|
+
//# sourceMappingURL=constructor.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["refkey","expect","it","TestNamespace","ClassDeclaration","Constructor","paramNameRefkey","paramSizeRefkey","ctorParams","name","type","_$createComponent","children","parameters","_$createIntrinsic","toRenderTo"],"sources":["../../../../src/components/constructor/constructor.test.tsx"],"sourcesContent":[null],"mappings":";AAAA,SAASA,MAAM,QAAQ,gBAAgB;AACvC,SAASC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AACnC,SAASC,aAAa;AACtB,SAASC,gBAAgB;AACzB,SAASC,WAAW;AAEpBH,EAAE,CAAC,0CAA0C,EAAE,MAAM;EACnD,MAAMI,eAAe,GAAGN,MAAM,CAAC,CAAC;EAChC,MAAMO,eAAe,GAAGP,MAAM,CAAC,CAAC;EAEhC,MAAMQ,UAAU,GAAG,CACjB;IAAEC,IAAI,EAAE,MAAM;IAAEC,IAAI,EAAE,QAAQ;IAAEV,MAAM,EAAEM;EAAgB,CAAC,EACzD;IAAEG,IAAI,EAAE,MAAM;IAAEC,IAAI,EAAE,KAAK;IAAEV,MAAM,EAAEO;EAAgB,CAAC,CACvD;EAEDN,MAAM,CAAAU,iBAAA,CACHR,aAAa;IAAA,IAAAS,SAAA;MAAA,OAAAD,iBAAA,CACXP,gBAAgB;QAAA;QAAQK,IAAI;QAAA,IAAAG,SAAA;UAAA,OAAAD,iBAAA,CAC1BN,WAAW;YAAA;YAAQQ,UAAU,EAAEL,UAAU;YAAA,IAAAI,SAAA;cAAA,QACvCN,eAAe,OAAAQ,iBAAA,aACfP,eAAe;YAAA;UAAA;QAAA;MAAA;IAAA;EAAA,EAIxB,CAAC,CAACQ,UAAU,CAAC;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|