@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
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { createComponent as _$createComponent, createIntrinsic as _$createIntrinsic } from "@alloy-js/core/jsx-runtime";
|
|
2
|
+
import { Output, refkey } from "@alloy-js/core";
|
|
3
|
+
import { d } from "@alloy-js/core/testing";
|
|
4
|
+
import { expect, it } from "vitest";
|
|
5
|
+
import { ClassDeclaration } from "./class/declaration.js";
|
|
6
|
+
import { Namespace } from "./namespace.js";
|
|
7
|
+
import { SourceFile } from "./SourceFile.js";
|
|
8
|
+
it("references types in the same namespace", () => {
|
|
9
|
+
const classRef = refkey();
|
|
10
|
+
const tree = _$createComponent(Output, {
|
|
11
|
+
get children() {
|
|
12
|
+
return _$createComponent(Namespace, {
|
|
13
|
+
name: "Test",
|
|
14
|
+
get children() {
|
|
15
|
+
return _$createComponent(SourceFile, {
|
|
16
|
+
path: "test.cs",
|
|
17
|
+
get children() {
|
|
18
|
+
return [_$createComponent(ClassDeclaration, {
|
|
19
|
+
name: "TestClass",
|
|
20
|
+
refkey: classRef
|
|
21
|
+
}), _$createIntrinsic("hbr", {}), classRef, ";"];
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
expect(tree).toRenderTo(d`
|
|
29
|
+
namespace Test;
|
|
30
|
+
|
|
31
|
+
class TestClass;
|
|
32
|
+
TestClass;
|
|
33
|
+
`);
|
|
34
|
+
});
|
|
35
|
+
it("references types in a parent namespace", () => {
|
|
36
|
+
const classRef = refkey();
|
|
37
|
+
const tree = _$createComponent(Output, {
|
|
38
|
+
get children() {
|
|
39
|
+
return _$createComponent(Namespace, {
|
|
40
|
+
name: "Test",
|
|
41
|
+
get children() {
|
|
42
|
+
return _$createComponent(SourceFile, {
|
|
43
|
+
path: "test.cs",
|
|
44
|
+
get children() {
|
|
45
|
+
return [_$createComponent(ClassDeclaration, {
|
|
46
|
+
name: "TestClass",
|
|
47
|
+
refkey: classRef
|
|
48
|
+
}), _$createIntrinsic("hbr", {}), _$createComponent(Namespace, {
|
|
49
|
+
name: "Nested",
|
|
50
|
+
get children() {
|
|
51
|
+
return [classRef, ";"];
|
|
52
|
+
}
|
|
53
|
+
})];
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
expect(tree).toRenderTo(d`
|
|
61
|
+
namespace Test {
|
|
62
|
+
class TestClass;
|
|
63
|
+
namespace Nested {
|
|
64
|
+
TestClass;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
`);
|
|
68
|
+
});
|
|
69
|
+
it("references types in a child namespace", () => {
|
|
70
|
+
const classRef = refkey();
|
|
71
|
+
const tree = _$createComponent(Output, {
|
|
72
|
+
get children() {
|
|
73
|
+
return _$createComponent(Namespace, {
|
|
74
|
+
name: "Test",
|
|
75
|
+
get children() {
|
|
76
|
+
return _$createComponent(SourceFile, {
|
|
77
|
+
path: "test.cs",
|
|
78
|
+
get children() {
|
|
79
|
+
return [classRef, ";", _$createIntrinsic("hbr", {}), _$createComponent(Namespace, {
|
|
80
|
+
name: "Nested",
|
|
81
|
+
get children() {
|
|
82
|
+
return _$createComponent(ClassDeclaration, {
|
|
83
|
+
name: "TestClass",
|
|
84
|
+
refkey: classRef
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
})];
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
expect(tree).toRenderTo(d`
|
|
95
|
+
namespace Test {
|
|
96
|
+
Nested.TestClass;
|
|
97
|
+
namespace Nested {
|
|
98
|
+
class TestClass;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
`);
|
|
102
|
+
});
|
|
103
|
+
it("references types in a different top-level namespace declared in the same file", () => {
|
|
104
|
+
const classRef = refkey();
|
|
105
|
+
const tree = _$createComponent(Output, {
|
|
106
|
+
get children() {
|
|
107
|
+
return _$createComponent(SourceFile, {
|
|
108
|
+
path: "test.cs",
|
|
109
|
+
get children() {
|
|
110
|
+
return [_$createComponent(Namespace, {
|
|
111
|
+
name: "TestCode1",
|
|
112
|
+
children: classRef
|
|
113
|
+
}), _$createIntrinsic("hbr", {}), _$createComponent(Namespace, {
|
|
114
|
+
name: "TestCode2",
|
|
115
|
+
get children() {
|
|
116
|
+
return _$createComponent(ClassDeclaration, {
|
|
117
|
+
name: "TestClass",
|
|
118
|
+
refkey: classRef
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
})];
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
expect(tree).toRenderTo(d`
|
|
127
|
+
using TestCode2;
|
|
128
|
+
|
|
129
|
+
namespace TestCode1 {
|
|
130
|
+
TestClass
|
|
131
|
+
}
|
|
132
|
+
namespace TestCode2 {
|
|
133
|
+
class TestClass;
|
|
134
|
+
}
|
|
135
|
+
`);
|
|
136
|
+
});
|
|
137
|
+
it("references types in a different top-level namespace declared in a different file", () => {
|
|
138
|
+
const classRef = refkey();
|
|
139
|
+
const tree = _$createComponent(Output, {
|
|
140
|
+
get children() {
|
|
141
|
+
return [_$createComponent(SourceFile, {
|
|
142
|
+
path: "test.cs",
|
|
143
|
+
get children() {
|
|
144
|
+
return _$createComponent(Namespace, {
|
|
145
|
+
name: "TestCode1",
|
|
146
|
+
get children() {
|
|
147
|
+
return [classRef, ";"];
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
}), _$createComponent(SourceFile, {
|
|
152
|
+
path: "other.cs",
|
|
153
|
+
get children() {
|
|
154
|
+
return _$createComponent(Namespace, {
|
|
155
|
+
name: "TestCode2",
|
|
156
|
+
get children() {
|
|
157
|
+
return _$createComponent(ClassDeclaration, {
|
|
158
|
+
name: "TestClass",
|
|
159
|
+
refkey: classRef
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
})];
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
expect(tree).toRenderTo({
|
|
168
|
+
"test.cs": d`
|
|
169
|
+
using TestCode2;
|
|
170
|
+
|
|
171
|
+
namespace TestCode1 {
|
|
172
|
+
TestClass;
|
|
173
|
+
}
|
|
174
|
+
`,
|
|
175
|
+
"other.cs": d`
|
|
176
|
+
namespace TestCode2 {
|
|
177
|
+
class TestClass;
|
|
178
|
+
}
|
|
179
|
+
`
|
|
180
|
+
});
|
|
181
|
+
});
|
|
182
|
+
//# sourceMappingURL=namespace.ref.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Output","refkey","d","expect","it","ClassDeclaration","Namespace","SourceFile","classRef","tree","_$createComponent","children","name","path","_$createIntrinsic","toRenderTo"],"sources":["../../../src/components/namespace.ref.test.tsx"],"sourcesContent":[null],"mappings":";AAAA,SAASA,MAAM,EAAEC,MAAM,QAAQ,gBAAgB;AAC/C,SAASC,CAAC,QAAQ,wBAAwB;AAC1C,SA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AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,CAAC;AACJ,CAAC,CAAC;AAEFE,EAAE,CAAC,kFAAkF,EAAE,MAAM;EAC3F,MAAMI,QAAQ,GAAGP,MAAM,CAAC,CAAC;EAEzB,MAAMQ,IAAI,GAAAC,iBAAA,CACPV,MAAM;IAAA,IAAAW,SAAA;MAAA,QAAAD,iBAAA,CACJH,UAAU;QAACM,IAAI;QAAA,IAAAF,SAAA;UAAA,OAAAD,iBAAA,CACbJ,SAAS;YAACM,IAAI;YAAA,IAAAD,SAAA;cAAA,QAAcH,QAAQ;YAAA;UAAA;QAAA;MAAA,IAAAE,iBAAA,CAEtCH,UAAU;QAACM,IAAI;QAAA,IAAAF,SAAA;UAAA,OAAAD,iBAAA,CACbJ,SAAS;YAACM,IAAI;YAAA,IAAAD,SAAA;cAAA,OAAAD,iBAAA,CACZL,gBAAgB;gBAACO,IAAI;gBAAaX,MAAM,EAAEO;cAAQ;YAAA;UAAA;QAAA;MAAA;IAAA;EAAA,EAI1D;EAEDL,MAAM,CAACM,IAAI,CAAC,CAACM,UAAU,CAAC;IACtB,SAAS,EAAEb,CAAC;AAChB;AACA;AACA;AACA;AACA;AACA,KAAK;IACD,UAAU,EAAEA,CAAC;AACjB;AACA;AACA;AACA;EACE,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"namespace.test.d.ts","sourceRoot":"","sources":["../../../src/components/namespace.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
|
|
2
|
+
import { Output } from "@alloy-js/core";
|
|
3
|
+
import { d } from "@alloy-js/core/testing";
|
|
4
|
+
import { expect, it } from "vitest";
|
|
5
|
+
import { ClassDeclaration } from "./class/declaration.js";
|
|
6
|
+
import { Namespace } from "./namespace.js";
|
|
7
|
+
import { SourceFile } from "./SourceFile.js";
|
|
8
|
+
it("defines multiple namespaces and source files with unique content", () => {
|
|
9
|
+
const tree = _$createComponent(Output, {
|
|
10
|
+
get children() {
|
|
11
|
+
return [_$createComponent(Namespace, {
|
|
12
|
+
name: "Namespace1",
|
|
13
|
+
get children() {
|
|
14
|
+
return [_$createComponent(SourceFile, {
|
|
15
|
+
path: "Model1.cs",
|
|
16
|
+
get children() {
|
|
17
|
+
return _$createComponent(ClassDeclaration, {
|
|
18
|
+
"public": true,
|
|
19
|
+
name: "Model1"
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
}), _$createComponent(SourceFile, {
|
|
23
|
+
path: "Model2.cs",
|
|
24
|
+
get children() {
|
|
25
|
+
return _$createComponent(ClassDeclaration, {
|
|
26
|
+
"public": true,
|
|
27
|
+
name: "Model2"
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
})];
|
|
31
|
+
}
|
|
32
|
+
}), _$createComponent(Namespace, {
|
|
33
|
+
name: "Namespace2",
|
|
34
|
+
get children() {
|
|
35
|
+
return [_$createComponent(SourceFile, {
|
|
36
|
+
path: "Model3.cs",
|
|
37
|
+
get children() {
|
|
38
|
+
return _$createComponent(ClassDeclaration, {
|
|
39
|
+
"public": true,
|
|
40
|
+
name: "Model3"
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}), _$createComponent(SourceFile, {
|
|
44
|
+
path: "Model4.cs",
|
|
45
|
+
get children() {
|
|
46
|
+
return _$createComponent(ClassDeclaration, {
|
|
47
|
+
"public": true,
|
|
48
|
+
name: "Model4"
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
})];
|
|
52
|
+
}
|
|
53
|
+
})];
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
expect(tree).toRenderTo({
|
|
57
|
+
"Model1.cs": d`
|
|
58
|
+
namespace Namespace1;
|
|
59
|
+
|
|
60
|
+
public class Model1;
|
|
61
|
+
`,
|
|
62
|
+
"Model2.cs": d`
|
|
63
|
+
namespace Namespace1;
|
|
64
|
+
|
|
65
|
+
public class Model2;
|
|
66
|
+
`,
|
|
67
|
+
"Model3.cs": d`
|
|
68
|
+
namespace Namespace2;
|
|
69
|
+
|
|
70
|
+
public class Model3;
|
|
71
|
+
`,
|
|
72
|
+
"Model4.cs": d`
|
|
73
|
+
namespace Namespace2;
|
|
74
|
+
|
|
75
|
+
public class Model4;
|
|
76
|
+
`
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
//# sourceMappingURL=namespace.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Output","d","expect","it","ClassDeclaration","Namespace","SourceFile","tree","_$createComponent","children","name","path","toRenderTo"],"sources":["../../../src/components/namespace.test.tsx"],"sourcesContent":[null],"mappings":";AAAA,SAASA,MAAM,QAAQ,gBAAgB;AACvC,SAASC,CAAC,QAAQ,wBAAwB;AAC1C,SAASC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AACnC,SAASC,gBAAgB;AACzB,SAASC,SAAS;AAClB,SAASC,UAAU;AAEnBH,EAAE,CAAC,kEAAkE,EAAE,MAAM;EAC3E,MAAMI,IAAI,GAAAC,iBAAA,CACPR,MAAM;IAAA,IAAAS,SAAA;MAAA,QAAAD,iBAAA,CACJH,SAAS;QAACK,IAAI;QAAA,IAAAD,SAAA;UAAA,QAAAD,iBAAA,CACZF,UAAU;YAACK,IAAI;YAAA,IAAAF,SAAA;cAAA,OAAAD,iBAAA,CACbJ,gBAAgB;gBAAA;gBAAQM,IAAI;cAAA;YAAA;UAAA,IAAAF,iBAAA,CAE9BF,UAAU;YAACK,IAAI;YAAA,IAAAF,SAAA;cAAA,OAAAD,iBAAA,CACbJ,gBAAgB;gBAAA;gBAAQM,IAAI;cAAA;YAAA;UAAA;QAAA;MAAA,IAAAF,iBAAA,CAGhCH,SAAS;QAACK,IAAI;QAAA,IAAAD,SAAA;UAAA,QAAAD,iBAAA,CACZF,UAAU;YAACK,IAAI;YAAA,IAAAF,SAAA;cAAA,OAAAD,iBAAA,CACbJ,gBAAgB;gBAAA;gBAAQM,IAAI;cAAA;YAAA;UAAA,IAAAF,iBAAA,CAE9BF,UAAU;YAACK,IAAI;YAAA,IAAAF,SAAA;cAAA,OAAAD,iBAAA,CACbJ,gBAAgB;gBAAA;gBAAQM,IAAI;cAAA;YAAA;UAAA;QAAA;MAAA;IAAA;EAAA,EAIpC;EAEDR,MAAM,CAACK,IAAI,CAAC,CAACK,UAAU,CAAC;IACtB,WAAW,EAAEX,CAAC;AAClB;AACA;AACA;AACA,KAAK;IACD,WAAW,EAAEA,CAAC;AAClB;AACA;AACA;AACA,KAAK;IACD,WAAW,EAAEA,CAAC;AAClB;AACA;AACA;AACA,KAAK;IACD,WAAW,EAAEA,CAAC;AAClB;AACA;AACA;AACA;EACE,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Children, OutputSymbol, Refkey } from "@alloy-js/core";
|
|
1
|
+
import { Children, Namekey, OutputSymbol, Refkey } from "@alloy-js/core";
|
|
2
2
|
export interface ParameterProps {
|
|
3
|
-
name: string;
|
|
3
|
+
name: string | Namekey;
|
|
4
4
|
type: Children;
|
|
5
5
|
/** If the parmaeter is optional(without default value) */
|
|
6
6
|
optional?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parameters.d.ts","sourceRoot":"","sources":["../../../../src/components/parameters/parameters.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"parameters.d.ts","sourceRoot":"","sources":["../../../../src/components/parameters/parameters.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAMR,OAAO,EACP,YAAY,EACZ,MAAM,EACP,MAAM,gBAAgB,CAAC;AAIxB,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,IAAI,EAAE,QAAQ,CAAC;IACf,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,sCAAsC;IACtC,OAAO,CAAC,EAAE,QAAQ,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB;AAED,kEAAkE;AAClE,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,YAe9C;AAED,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,cAAc,EAAE,GAAG,SAAS,CAAC;CAC1C;AAED,wCAAwC;AACxC,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,YAehD"}
|
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { code, Declaration, For, Indent
|
|
3
|
-
import {
|
|
4
|
-
import { CSharpOutputSymbol } from "../../symbols/csharp-output-symbol.js";
|
|
5
|
-
import { useCSharpMemberScope } from "../../symbols/scopes.js";
|
|
1
|
+
import { createComponent as _$createComponent, memo as _$memo, createIntrinsic as _$createIntrinsic } from "@alloy-js/core/jsx-runtime";
|
|
2
|
+
import { code, createSymbolSlot, Declaration, For, Indent } from "@alloy-js/core";
|
|
3
|
+
import { createParameterSymbol } from "../../symbols/factories.js";
|
|
6
4
|
import { Name } from "../Name.js";
|
|
7
5
|
/** Define a parameter to be used in class or interface method. */
|
|
8
6
|
export function Parameter(props) {
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
refkeys: props.refkey ?? refkey(props.name)
|
|
7
|
+
const TypeSlot = createSymbolSlot();
|
|
8
|
+
const memberSymbol = createParameterSymbol(props.name, {
|
|
9
|
+
refkeys: props.refkey,
|
|
10
|
+
type: TypeSlot.firstSymbol
|
|
14
11
|
});
|
|
15
12
|
return _$createComponent(Declaration, {
|
|
16
13
|
symbol: memberSymbol,
|
|
17
14
|
get children() {
|
|
18
|
-
return [_$
|
|
15
|
+
return [_$createComponent(TypeSlot, {
|
|
16
|
+
get children() {
|
|
17
|
+
return props.type;
|
|
18
|
+
}
|
|
19
|
+
}), _$memo(() => props.optional ? "?" : ""), " ", _$createComponent(Name, {}), _$memo(() => props.default ? code` = ${props.default}` : "")];
|
|
19
20
|
}
|
|
20
21
|
});
|
|
21
22
|
}
|
|
@@ -37,4 +38,5 @@ export function Parameters(props) {
|
|
|
37
38
|
})), _$createIntrinsic("softline", {}), ")"];
|
|
38
39
|
}
|
|
39
40
|
});
|
|
40
|
-
}
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=parameters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["code","createSymbolSlot","Declaration","For","Indent","createParameterSymbol","Name","Parameter","props","TypeSlot","memberSymbol","name","refkeys","refkey","type","firstSymbol","_$createComponent","symbol","children","_$memo","optional","default","Parameters","_$createIntrinsic","parameters","softline","each","joiner","param"],"sources":["../../../../src/components/parameters/parameters.tsx"],"sourcesContent":[null],"mappings":";AAAA,SAEEA,IAAI,EACJC,gBAAgB,EAChBC,WAAW,EACXC,GAAG,EACHC,MAAM,QAID,gBAAgB;AACvB,SAASC,qBAAqB,QAAQ,4BAA4B;AAClE,SAASC,IAAI;AAab;AACA,OAAO,SAASC,SAASA,CAACC,KAAqB,EAAE;EAC/C,MAAMC,QAAQ,GAAGR,gBAAgB,CAAC,CAAC;EAEnC,MAAMS,YAAY,GAAGL,qBAAqB,CAACG,KAAK,CAACG,IAAI,EAAE;IACrDC,OAAO,EAAEJ,KAAK,CAACK,MAAM;IACrBC,IAAI,EAAEL,QAAQ,CAACM;EACjB,CAAC,CAAC;EAEF,OAAAC,iBAAA,CACGd,WAAW;IAACe,MAAM,EAAEP,YAAY;IAAA,IAAAQ,SAAA;MAAA,QAAAF,iBAAA,CAC9BP,QAAQ;QAAA,IAAAS,SAAA;UAAA,OAAEV,KAAK,CAACM,IAAI;QAAA;MAAA,IAAAK,MAAA,OACpBX,KAAK,CAACY,QAAQ,GAAG,GAAG,GAAG,EAAE,QAAAJ,iBAAA,CAAGV,IAAI,OAAAa,MAAA,OAChCX,KAAK,CAACa,OAAO,GAAGrB,IAAI,MAAMQ,KAAK,CAACa,OAAO,EAAE,GAAG,EAAE;IAAA;EAAA;AAGrD;AAMA;AACA,OAAO,SAASC,UAAUA,CAACd,KAAsB,EAAE;EACjD,OAAAe,iBAAA;IAAA,IAAAL,SAAA;MAAA,QAEK,GAAG,EAAAC,MAAA,OACHA,MAAA,SAAAX,KAAK,CAACgB,UAAU,OAAAR,iBAAA,CACdZ,MAAM;QAACqB,QAAQ;QAAA,IAAAP,SAAA;UAAA,OAAAF,iBAAA,CACbb,GAAG;YAAA,IAACuB,IAAIA,CAAA;cAAA,OAAElB,KAAK,CAACgB,UAAU;YAAA;YAAEG,MAAM,EAAE,IAAI;YAAAT,QAAA,EACrCU,KAAK,IAAAZ,iBAAA,CAAMT,SAAS,EAAKqB,KAAK;UAAI;QAAA;MAAA,EAGzC,GAAAL,iBAAA,kBAEA,GAAG;IAAA;EAAA;AAGV","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parameters.test.d.ts","sourceRoot":"","sources":["../../../../src/components/parameters/parameters.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { memo as _$memo, createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
|
|
2
|
+
import { ClassDeclaration } from "#components/class/declaration.js";
|
|
3
|
+
import { Method } from "#components/method/method.js";
|
|
4
|
+
import { List, memberRefkey, namekey } from "@alloy-js/core";
|
|
5
|
+
import { expect, it } from "vitest";
|
|
6
|
+
import { TestNamespace } from "../../../test/utils.js";
|
|
7
|
+
const Wrapper = props => _$createComponent(TestNamespace, {
|
|
8
|
+
get children() {
|
|
9
|
+
return _$createComponent(ClassDeclaration, {
|
|
10
|
+
"public": true,
|
|
11
|
+
name: "TestClass",
|
|
12
|
+
get children() {
|
|
13
|
+
return props.children;
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
it("can be referenced", () => {
|
|
19
|
+
const param1Key = namekey("param1");
|
|
20
|
+
const param2Key = namekey("param2");
|
|
21
|
+
expect(_$createComponent(Wrapper, {
|
|
22
|
+
get children() {
|
|
23
|
+
return _$createComponent(Method, {
|
|
24
|
+
name: "MethodOne",
|
|
25
|
+
parameters: [{
|
|
26
|
+
name: param1Key,
|
|
27
|
+
type: "T1"
|
|
28
|
+
}, {
|
|
29
|
+
name: param2Key,
|
|
30
|
+
type: "T2"
|
|
31
|
+
}]
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
})).toRenderTo(`
|
|
35
|
+
public class TestClass
|
|
36
|
+
{
|
|
37
|
+
void MethodOne(T1 param1, T2 param2) {}
|
|
38
|
+
}
|
|
39
|
+
`);
|
|
40
|
+
});
|
|
41
|
+
it("members can be referenced", () => {
|
|
42
|
+
const classKey = namekey("TestType");
|
|
43
|
+
const methodKey = namekey("TestMethod");
|
|
44
|
+
const param1Key = namekey("param1");
|
|
45
|
+
expect(_$createComponent(TestNamespace, {
|
|
46
|
+
get children() {
|
|
47
|
+
return _$createComponent(List, {
|
|
48
|
+
get children() {
|
|
49
|
+
return [_$createComponent(ClassDeclaration, {
|
|
50
|
+
name: classKey,
|
|
51
|
+
get children() {
|
|
52
|
+
return _$createComponent(Method, {
|
|
53
|
+
name: methodKey
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
}), _$createComponent(ClassDeclaration, {
|
|
57
|
+
name: "Test",
|
|
58
|
+
get children() {
|
|
59
|
+
return _$createComponent(Method, {
|
|
60
|
+
name: "Test",
|
|
61
|
+
parameters: [{
|
|
62
|
+
name: param1Key,
|
|
63
|
+
type: classKey
|
|
64
|
+
}],
|
|
65
|
+
get children() {
|
|
66
|
+
return ["return ", _$memo(() => memberRefkey(param1Key, methodKey)), "();"];
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
})];
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
})).toRenderTo(`
|
|
75
|
+
class TestType
|
|
76
|
+
{
|
|
77
|
+
void TestMethod() {}
|
|
78
|
+
}
|
|
79
|
+
class Test
|
|
80
|
+
{
|
|
81
|
+
void Test(TestType param1)
|
|
82
|
+
{
|
|
83
|
+
return param1.TestMethod();
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
`);
|
|
87
|
+
});
|
|
88
|
+
//# sourceMappingURL=parameters.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ClassDeclaration","Method","List","memberRefkey","namekey","expect","it","TestNamespace","Wrapper","props","_$createComponent","children","name","param1Key","param2Key","parameters","type","toRenderTo","classKey","methodKey","_$memo"],"sources":["../../../../src/components/parameters/parameters.test.tsx"],"sourcesContent":[null],"mappings":";AAAA,SAASA,gBAAgB;AACzB,SAASC,MAAM;AACf,SAASC,IAAI,EAAEC,YAAY,EAAEC,OAAO,QAAQ,gBAAgB;AAE5D,SAASC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AACnC,SAASC,aAAa;AAEtB,MAAMC,OAAO,GAAIC,KAA6B,IAAAC,iBAAA,CAC3CH,aAAa;EAAA,IAAAI,SAAA;IAAA,OAAAD,iBAAA,CACXV,gBAAgB;MAAA;MAAQY,IAAI;MAAA,IAAAD,SAAA;QAAA,OAC1BF,KAAK,CAACE,QAAQ;MAAA;IAAA;EAAA;AAAA,EAGpB;AAEDL,EAAE,CAAC,mBAAmB,EAAE,MAAM;EAC5B,MAAMO,SAAS,GAAGT,OAAO,CAAC,QAAQ,CAAC;EACnC,MAAMU,SAAS,GAAGV,OAAO,CAAC,QAAQ,CAAC;EACnCC,MAAM,CAAAK,iBAAA,CACHF,OAAO;IAAA,IAAAG,SAAA;MAAA,OAAAD,iBAAA,CACLT,MAAM;QACLW,IAAI;QACJG,UAAU,EAAE,CACV;UAAEH,IAAI,EAAEC,SAAS;UAAEG,IAAI,EAAE;QAAK,CAAC,EAC/B;UAAEJ,IAAI,EAAEE,SAAS;UAAEE,IAAI,EAAE;QAAK,CAAC;MAChC;IAAA;EAAA,EAGP,CAAC,CAACC,UAAU,CAAC;AACf;AACA;AACA;AACA;AACA,GAAG,CAAC;AACJ,CAAC,CAAC;AAEFX,EAAE,CAAC,2BAA2B,EAAE,MAAM;EACpC,MAAMY,QAAQ,GAAGd,OAAO,CAAC,UAAU,CAAC;EACpC,MAAMe,SAAS,GAAGf,OAAO,CAAC,YAAY,CAAC;EACvC,MAAMS,SAAS,GAAGT,OAAO,CAAC,QAAQ,CAAC;EAEnCC,MAAM,CAAAK,iBAAA,CACHH,aAAa;IAAA,IAAAI,SAAA;MAAA,OAAAD,iBAAA,CACXR,IAAI;QAAA,IAAAS,SAAA;UAAA,QAAAD,iBAAA,CACFV,gBAAgB;YAACY,IAAI,EAAEM,QAAQ;YAAA,IAAAP,SAAA;cAAA,OAAAD,iBAAA,CAC7BT,MAAM;gBAACW,IAAI,EAAEO;cAAS;YAAA;UAAA,IAAAT,iBAAA,CAExBV,gBAAgB;YAACY,IAAI;YAAA,IAAAD,SAAA;cAAA,OAAAD,iBAAA,CACnBT,MAAM;gBACLW,IAAI;gBACJG,UAAU,EAAE,CAAC;kBAAEH,IAAI,EAAEC,SAAS;kBAAEG,IAAI,EAAEE;gBAAS,CAAC,CAAC;gBAAA,IAAAP,SAAA;kBAAA,mBAAAS,MAAA,OAEzCjB,YAAY,CAACU,SAAS,EAAEM,SAAS,CAAC;gBAAA;cAAA;YAAA;UAAA;QAAA;MAAA;IAAA;EAAA,EAKpD,CAAC,CAACF,UAAU,CAAC;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"property.d.ts","sourceRoot":"","sources":["../../../../src/components/property/property.tsx"],"names":[],"mappings":"AAAA,OAAO,EAE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EnB;;;;;;;OAOG;IACH,WAAW,CAAC,EAAE,QAAQ,CAAC;IAEvB;;;;;;;;;;;;;;;OAeG;IACH,UAAU,CAAC,EAAE,cAAc,CAAC;CAC7B;AAED;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,YAiC5C"}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { createComponent as _$createComponent, memo as _$memo } from "@alloy-js/core/jsx-runtime";
|
|
2
|
-
import { Block, code, List, MemberDeclaration,
|
|
2
|
+
import { Block, code, List, MemberDeclaration, MemberName } from "@alloy-js/core";
|
|
3
3
|
import { computeModifiersPrefix, getAccessModifier, makeModifiers } from "../../modifiers.js";
|
|
4
|
-
import {
|
|
5
|
-
import { CSharpOutputSymbol } from "../../symbols/csharp-output-symbol.js";
|
|
6
|
-
import { CSharpMemberScope, useCSharpMemberScope } from "../../symbols/scopes.js";
|
|
4
|
+
import { createPropertySymbol } from "../../symbols/factories.js";
|
|
7
5
|
import { AttributeList } from "../attributes/attributes.js";
|
|
8
6
|
import { DocWhen } from "../doc/comment.js";
|
|
9
7
|
|
|
@@ -23,16 +21,8 @@ const getModifiers = makeModifiers(["new", "static", "virtual", "sealed", "overr
|
|
|
23
21
|
* ```
|
|
24
22
|
*/
|
|
25
23
|
export function Property(props) {
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
const propertySymbol = new CSharpOutputSymbol(name, {
|
|
29
|
-
scope,
|
|
30
|
-
refkeys: props.refkey ?? refkey(props.name)
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
// scope for property declaration
|
|
34
|
-
const propertyScope = new CSharpMemberScope("property-decl", {
|
|
35
|
-
owner: propertySymbol
|
|
24
|
+
const propertySymbol = createPropertySymbol(props.name, {
|
|
25
|
+
refkeys: props.refkey
|
|
36
26
|
});
|
|
37
27
|
const modifiers = computeModifiersPrefix([getAccessModifier(props), getModifiers(props)]);
|
|
38
28
|
if (props.init && props.set) {
|
|
@@ -42,32 +32,28 @@ export function Property(props) {
|
|
|
42
32
|
return _$createComponent(MemberDeclaration, {
|
|
43
33
|
symbol: propertySymbol,
|
|
44
34
|
get children() {
|
|
45
|
-
return _$createComponent(
|
|
46
|
-
|
|
35
|
+
return [_$createComponent(DocWhen, {
|
|
36
|
+
get doc() {
|
|
37
|
+
return props.doc;
|
|
38
|
+
}
|
|
39
|
+
}), _$createComponent(AttributeList, {
|
|
40
|
+
get attributes() {
|
|
41
|
+
return props.attributes;
|
|
42
|
+
},
|
|
43
|
+
endline: true
|
|
44
|
+
}), modifiers, _$memo(() => props.type), _$memo(() => props.nullable && "?"), " ", _$createComponent(MemberName, {}), " ", _$createComponent(Block, {
|
|
45
|
+
newline: true,
|
|
46
|
+
inline: true,
|
|
47
47
|
get children() {
|
|
48
|
-
return
|
|
49
|
-
|
|
50
|
-
return props.doc;
|
|
51
|
-
}
|
|
52
|
-
}), _$createComponent(AttributeList, {
|
|
53
|
-
get attributes() {
|
|
54
|
-
return props.attributes;
|
|
55
|
-
},
|
|
56
|
-
endline: true
|
|
57
|
-
}), modifiers, _$memo(() => props.type), _$memo(() => props.nullable && "?"), " ", name, " ", _$createComponent(Block, {
|
|
58
|
-
newline: true,
|
|
59
|
-
inline: true,
|
|
48
|
+
return _$createComponent(List, {
|
|
49
|
+
joiner: " ",
|
|
60
50
|
get children() {
|
|
61
|
-
return _$
|
|
62
|
-
joiner: " ",
|
|
63
|
-
get children() {
|
|
64
|
-
return [_$memo(() => props.get && "get;"), _$memo(() => props.set && "set;"), _$memo(() => props.init && "init;")];
|
|
65
|
-
}
|
|
66
|
-
});
|
|
51
|
+
return [_$memo(() => props.get && "get;"), _$memo(() => props.set && "set;"), _$memo(() => props.init && "init;")];
|
|
67
52
|
}
|
|
68
|
-
})
|
|
53
|
+
});
|
|
69
54
|
}
|
|
70
|
-
});
|
|
55
|
+
}), _$memo(() => props.initializer && code` = ${props.initializer};`)];
|
|
71
56
|
}
|
|
72
57
|
});
|
|
73
|
-
}
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=property.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Block","code","List","MemberDeclaration","MemberName","computeModifiersPrefix","getAccessModifier","makeModifiers","createPropertySymbol","AttributeList","DocWhen","getModifiers","Property","props","propertySymbol","name","refkeys","refkey","modifiers","init","set","Error","_$createComponent","symbol","children","doc","attributes","endline","_$memo","type","nullable","newline","inline","joiner","get","initializer"],"sources":["../../../../src/components/property/property.tsx"],"sourcesContent":[null],"mappings":";AAAA,SACEA,KAAK,EAELC,IAAI,EACJC,IAAI,EACJC,iBAAiB,EACjBC,UAAU,QAEL,gBAAgB;AACvB,SAEEC,sBAAsB,EACtBC,iBAAiB,EACjBC,aAAa,QACR,oBAAoB;AAC3B,SAASC,oBAAoB,QAAQ,4BAA4B;AACjE,SAASC,aAAa;AACtB,SAASC,OAAO;;AAEhB;;AAiBA,MAAMC,YAAY,GAAGJ,aAAa,CAAoB,CACpD,KAAK,EACL,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,UAAU,EACV,UAAU,EACV,QAAQ,EACR,UAAU,EACV,UAAU,CACX,CAAC;;AAEF;;AA2DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASK,QAAQA,CAACC,KAAoB,EAAE;EAC7C,MAAMC,cAAc,GAAGN,oBAAoB,CAACK,KAAK,CAACE,IAAI,EAAE;IACtDC,OAAO,EAAEH,KAAK,CAACI;EACjB,CAAC,CAAC;EAEF,MAAMC,SAAS,GAAGb,sBAAsB,CAAC,CACvCC,iBAAiB,CAACO,KAAK,CAAC,EACxBF,YAAY,CAACE,KAAK,CAAC,CACpB,CAAC;EAEF,IAAIA,KAAK,CAACM,IAAI,IAAIN,KAAK,CAACO,GAAG,EAAE;IAC3B,MAAM,IAAIC,KAAK,CACb,qDAAqDN,IAAI,GAC3D,CAAC;EACH;EACA;EACA,OAAAO,iBAAA,CACGnB,iBAAiB;IAACoB,MAAM,EAAET,cAAc;IAAA,IAAAU,SAAA;MAAA,QAAAF,iBAAA,CACtCZ,OAAO;QAAA,IAACe,GAAGA,CAAA;UAAA,OAAEZ,KAAK,CAACY,GAAG;QAAA;MAAA,IAAAH,iBAAA,CACtBb,aAAa;QAAA,IAACiB,UAAUA,CAAA;UAAA,OAAEb,KAAK,CAACa,UAAU;QAAA;QAAEC,OAAO;MAAA,IACnDT,SAAS,EAAAU,MAAA,OACTf,KAAK,CAACgB,IAAI,GAAAD,MAAA,OACVf,KAAK,CAACiB,QAAQ,IAAI,GAAG,QAAAR,iBAAA,CAAGlB,UAAU,OAAI,GAAG,EAAAkB,iBAAA,CACzCtB,KAAK;QAAC+B,OAAO;QAACC,MAAM;QAAA,IAAAR,SAAA;UAAA,OAAAF,iBAAA,CAClBpB,IAAI;YAAC+B,MAAM;YAAA,IAAAT,SAAA;cAAA,QAAAI,MAAA,OACTf,KAAK,CAACqB,GAAG,IAAI,MAAM,GAAAN,MAAA,OACnBf,KAAK,CAACO,GAAG,IAAI,MAAM,GAAAQ,MAAA,OACnBf,KAAK,CAACM,IAAI,IAAI,OAAO;YAAA;UAAA;QAAA;MAAA,IAAAS,MAAA,OAGzBf,KAAK,CAACsB,WAAW,IAAIlC,IAAI,MAAMY,KAAK,CAACsB,WAAW,GAAG;IAAA;EAAA;AAG1D","ignoreList":[]}
|
|
@@ -31,7 +31,7 @@ describe("modifiers", () => {
|
|
|
31
31
|
})).toRenderTo(`
|
|
32
32
|
public class TestClass
|
|
33
33
|
{
|
|
34
|
-
|
|
34
|
+
${accessModifier} string TestProp { get; }
|
|
35
35
|
}
|
|
36
36
|
`);
|
|
37
37
|
});
|
|
@@ -51,7 +51,7 @@ describe("modifiers", () => {
|
|
|
51
51
|
})).toRenderTo(`
|
|
52
52
|
public class TestClass
|
|
53
53
|
{
|
|
54
|
-
|
|
54
|
+
${methodModifier} string TestProp { get; }
|
|
55
55
|
}
|
|
56
56
|
`);
|
|
57
57
|
});
|
|
@@ -70,7 +70,7 @@ describe("modifiers", () => {
|
|
|
70
70
|
})).toRenderTo(`
|
|
71
71
|
public class TestClass
|
|
72
72
|
{
|
|
73
|
-
|
|
73
|
+
public new string TestProp { get; }
|
|
74
74
|
}
|
|
75
75
|
`);
|
|
76
76
|
});
|
|
@@ -87,7 +87,7 @@ it("applies PascalCase naming policy", () => {
|
|
|
87
87
|
})).toRenderTo(`
|
|
88
88
|
public class TestClass
|
|
89
89
|
{
|
|
90
|
-
|
|
90
|
+
string TestProp { get; }
|
|
91
91
|
}
|
|
92
92
|
`);
|
|
93
93
|
});
|
|
@@ -103,7 +103,7 @@ it("has getter only", () => {
|
|
|
103
103
|
})).toRenderTo(`
|
|
104
104
|
public class TestClass
|
|
105
105
|
{
|
|
106
|
-
|
|
106
|
+
string TestProp { get; }
|
|
107
107
|
}
|
|
108
108
|
`);
|
|
109
109
|
});
|
|
@@ -119,7 +119,7 @@ it("has setter only", () => {
|
|
|
119
119
|
})).toRenderTo(`
|
|
120
120
|
public class TestClass
|
|
121
121
|
{
|
|
122
|
-
|
|
122
|
+
string TestProp { set; }
|
|
123
123
|
}
|
|
124
124
|
`);
|
|
125
125
|
});
|
|
@@ -136,7 +136,7 @@ it("has getter and setter", () => {
|
|
|
136
136
|
})).toRenderTo(`
|
|
137
137
|
public class TestClass
|
|
138
138
|
{
|
|
139
|
-
|
|
139
|
+
string TestProp { get; set; }
|
|
140
140
|
}
|
|
141
141
|
`);
|
|
142
142
|
});
|
|
@@ -153,7 +153,7 @@ it("has getter and init", () => {
|
|
|
153
153
|
})).toRenderTo(`
|
|
154
154
|
public class TestClass
|
|
155
155
|
{
|
|
156
|
-
|
|
156
|
+
string TestProp { get; init; }
|
|
157
157
|
}
|
|
158
158
|
`);
|
|
159
159
|
});
|
|
@@ -176,8 +176,8 @@ it("specify doc comment", () => {
|
|
|
176
176
|
})).toRenderTo(`
|
|
177
177
|
class Test
|
|
178
178
|
{
|
|
179
|
-
|
|
180
|
-
|
|
179
|
+
/// This is a test
|
|
180
|
+
string Method { get; set; }
|
|
181
181
|
}
|
|
182
182
|
`);
|
|
183
183
|
});
|
|
@@ -195,7 +195,7 @@ it("specify nullable property", () => {
|
|
|
195
195
|
})).toRenderTo(`
|
|
196
196
|
public class TestClass
|
|
197
197
|
{
|
|
198
|
-
|
|
198
|
+
string? TestProp { get; set; }
|
|
199
199
|
}
|
|
200
200
|
`);
|
|
201
201
|
});
|
|
@@ -213,7 +213,7 @@ it("specify initializer", () => {
|
|
|
213
213
|
})).toRenderTo(`
|
|
214
214
|
public class TestClass
|
|
215
215
|
{
|
|
216
|
-
|
|
216
|
+
string TestProp { get; set; } = "abc";
|
|
217
217
|
}
|
|
218
218
|
`);
|
|
219
219
|
});
|
|
@@ -235,8 +235,9 @@ it("specify attributes", () => {
|
|
|
235
235
|
})).toRenderTo(`
|
|
236
236
|
public class TestClass
|
|
237
237
|
{
|
|
238
|
-
|
|
239
|
-
|
|
238
|
+
[Test]
|
|
239
|
+
int Test { get; set; }
|
|
240
240
|
}
|
|
241
241
|
`);
|
|
242
|
-
});
|
|
242
|
+
});
|
|
243
|
+
//# sourceMappingURL=property.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["describe","expect","it","TestNamespace","Attribute","ClassDeclaration","Property","Wrapper","props","_$createComponent","children","name","each","accessModifier","_$mergeProps","type","get","toRenderTo","methodModifier","set","init","doc","nullable","initializer","attributes"],"sources":["../../../../src/components/property/property.test.tsx"],"sourcesContent":[null],"mappings":";AACA,SAASA,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AAC7C,SAASC,aAAa;AACtB,SAASC,SAAS;AAClB,SAASC,gBAAgB;AACzB,SAASC,QAAQ;AAEjB,MAAMC,OAAO,GAAIC,KAA6B,IAAAC,iBAAA,CAC3CN,aAAa;EAAA,IAAAO,SAAA;IAAA,OAAAD,iBAAA,CACXJ,gBAAgB;MAAA;MAAQM,IAAI;MAAA,IAAAD,SAAA;QAAA,OA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