@alloy-js/csharp 0.20.0-dev.1 → 0.20.0-dev.10
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/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/access-expression/access-expression.d.ts +54 -0
- package/dist/src/components/access-expression/access-expression.d.ts.map +1 -0
- package/dist/src/components/access-expression/access-expression.js +277 -0
- package/dist/src/components/access-expression/access-expression.js.map +1 -0
- package/dist/src/components/access-expression/access-expression.test.d.ts +2 -0
- package/dist/src/components/access-expression/access-expression.test.d.ts.map +1 -0
- package/dist/src/components/access-expression/access-expression.test.js +336 -0
- package/dist/src/components/access-expression/access-expression.test.js.map +1 -0
- package/dist/src/components/access-expression/part-descriptors.d.ts +32 -0
- package/dist/src/components/access-expression/part-descriptors.d.ts.map +1 -0
- package/dist/src/components/access-expression/part-descriptors.js +99 -0
- package/dist/src/components/access-expression/part-descriptors.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 +21 -34
- package/dist/src/components/class/declaration.js.map +1 -0
- package/dist/src/components/class/declaration.test.js +199 -200
- 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 -20
- 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 -18
- 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 +7 -3
- package/dist/src/components/index.d.ts.map +1 -1
- package/dist/src/components/index.js +9 -4
- 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 -19
- 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 -40
- 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/invocation-expression/invocation-expression.d.ts +29 -0
- package/dist/src/components/invocation-expression/invocation-expression.d.ts.map +1 -0
- package/dist/src/components/invocation-expression/invocation-expression.js +70 -0
- package/dist/src/components/invocation-expression/invocation-expression.js.map +1 -0
- package/dist/src/components/invocation-expression/invocation-expression.test.d.ts +2 -0
- package/dist/src/components/invocation-expression/invocation-expression.test.d.ts.map +1 -0
- package/dist/src/components/invocation-expression/invocation-expression.test.js +105 -0
- package/dist/src/components/invocation-expression/invocation-expression.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 -17
- 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 -3
- package/dist/src/components/parameters/parameters.d.ts.map +1 -1
- package/dist/src/components/parameters/parameters.js +15 -15
- 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 +154 -0
- package/dist/src/components/parameters/parameters.test.js.map +1 -0
- package/dist/src/components/property/property.d.ts +2 -2
- package/dist/src/components/property/property.d.ts.map +1 -1
- package/dist/src/components/property/property.js +30 -40
- 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 +18 -0
- package/dist/src/components/record/declaration.d.ts.map +1 -1
- package/dist/src/components/record/declaration.js +21 -14
- package/dist/src/components/record/declaration.js.map +1 -0
- package/dist/src/components/record/declaration.test.js +52 -4
- package/dist/src/components/record/declaration.test.js.map +1 -0
- package/dist/src/components/source-file/source-file.d.ts +19 -0
- package/dist/src/components/source-file/source-file.d.ts.map +1 -0
- package/dist/src/components/source-file/source-file.js +59 -0
- package/dist/src/components/source-file/source-file.js.map +1 -0
- package/dist/src/components/source-file/source-file.test.d.ts +2 -0
- package/dist/src/components/source-file/source-file.test.d.ts.map +1 -0
- package/dist/src/components/source-file/source-file.test.js +136 -0
- package/dist/src/components/source-file/source-file.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/format-options.d.ts +5 -0
- package/dist/src/contexts/format-options.d.ts.map +1 -0
- package/dist/src/contexts/format-options.js +9 -0
- package/dist/src/contexts/format-options.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 +2 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +4 -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 +10 -0
- package/dist/src/scopes/csharp.d.ts.map +1 -0
- package/dist/src/scopes/csharp.js +15 -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 +87 -0
- package/dist/src/symbols/csharp.d.ts.map +1 -0
- package/dist/src/symbols/csharp.js +246 -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 +93 -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 +50 -44
- package/dist/src/symbols/reference.js.map +1 -0
- package/dist/test/project-directory.test.js +20 -19
- package/dist/test/project-directory.test.js.map +1 -0
- package/dist/test/using.test.js +23 -21
- package/dist/test/using.test.js.map +1 -0
- package/dist/test/utils.d.ts.map +1 -1
- package/dist/test/utils.js +7 -4
- 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 +12 -6
- package/src/components/Declaration.tsx +3 -6
- package/src/components/Reference.tsx +3 -1
- package/src/components/UsingDirective.tsx +12 -2
- package/src/components/access-expression/access-expression.test.tsx +284 -0
- package/src/components/access-expression/access-expression.tsx +375 -0
- package/src/components/access-expression/part-descriptors.ts +175 -0
- package/src/components/class/declaration.test.tsx +142 -150
- package/src/components/class/declaration.tsx +20 -32
- package/src/components/constructor/constructor.test.tsx +10 -16
- package/src/components/constructor/constructor.tsx +13 -32
- 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 -22
- package/src/components/index.ts +7 -3
- 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 -20
- package/src/components/interface/property.test.tsx +11 -11
- package/src/components/interface/property.tsx +15 -34
- package/src/components/invocation-expression/invocation-expression.test.tsx +101 -0
- package/src/components/invocation-expression/invocation-expression.tsx +60 -0
- package/src/components/lexical-scope.tsx +29 -0
- package/src/components/method/method.test.tsx +11 -11
- package/src/components/method/method.tsx +12 -23
- 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 +117 -0
- package/src/components/parameters/parameters.tsx +11 -23
- package/src/components/property/property.test.tsx +14 -14
- package/src/components/property/property.tsx +23 -41
- package/src/components/record/declaration.test.tsx +47 -3
- package/src/components/record/declaration.tsx +34 -11
- package/src/components/source-file/source-file.test.tsx +96 -0
- package/src/components/source-file/source-file.tsx +98 -0
- 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/format-options.ts +14 -0
- package/src/contexts/global-namespace.ts +29 -0
- package/src/contexts/namespace.ts +13 -0
- package/src/index.ts +2 -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 +23 -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 +339 -0
- package/src/symbols/factories.ts +215 -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.tsx +64 -0
- package/temp/api.json +6919 -2532
- package/test/project-directory.test.tsx +14 -16
- package/test/using.test.tsx +21 -21
- package/test/utils.tsx +2 -1
- package/tsconfig.json +4 -1
- package/tsdoc-metadata.json +1 -1
- package/dist/src/components/EnumDeclaration.d.ts.map +0 -1
- package/dist/src/components/EnumDeclaration.js +0 -85
- 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/components/SourceFile.d.ts +0 -14
- package/dist/src/components/SourceFile.d.ts.map +0 -1
- package/dist/src/components/SourceFile.js +0 -69
- 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 -14
- package/dist/src/symbols/scopes.d.ts.map +0 -1
- package/dist/src/symbols/scopes.js +0 -31
- 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/dist/test/sourcefile.test.d.ts +0 -2
- package/dist/test/sourcefile.test.d.ts.map +0 -1
- package/dist/test/sourcefile.test.js +0 -58
- package/src/components/EnumDeclaration.tsx +0 -99
- package/src/components/Namespace.tsx +0 -35
- package/src/components/SourceFile.tsx +0 -78
- package/src/symbols/csharp-output-symbol.ts +0 -22
- package/src/symbols/reference.ts +0 -65
- package/src/symbols/scopes.ts +0 -41
- package/test/enum.test.tsx +0 -149
- package/test/namespace.test.tsx +0 -55
- package/test/sourcefile.test.tsx +0 -47
- /package/dist/{test → src/components}/namespace.test.d.ts +0 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ScopePropsWithInfo, ScopePropsWithValue } from "@alloy-js/core";
|
|
2
|
+
export interface MethodScopePropsWithScopeValue extends ScopePropsWithValue {
|
|
3
|
+
}
|
|
4
|
+
export interface MethodScopePropsWithScopeInfo extends ScopePropsWithInfo {
|
|
5
|
+
}
|
|
6
|
+
export type MethodScopeProps = MethodScopePropsWithScopeValue | MethodScopePropsWithScopeInfo;
|
|
7
|
+
export declare function MethodScope(props: MethodScopeProps): import("@alloy-js/core").Children;
|
|
8
|
+
//# sourceMappingURL=method-scope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"method-scope.d.ts","sourceRoot":"","sources":["../../../src/components/method-scope.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAS,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAIhF,MAAM,WAAW,8BAA+B,SAAQ,mBAAmB;CAAG;AAC9E,MAAM,WAAW,6BAA8B,SAAQ,kBAAkB;CAAG;AAE5E,MAAM,MAAM,gBAAgB,GACxB,8BAA8B,GAC9B,6BAA6B,CAAC;AAElC,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,qCAelD"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
|
|
2
|
+
import { Scope } from "@alloy-js/core";
|
|
3
|
+
import { useCSharpScope } from "../scopes/contexts.js";
|
|
4
|
+
import { CSharpMethodScope } from "../scopes/method.js";
|
|
5
|
+
export function MethodScope(props) {
|
|
6
|
+
let scope;
|
|
7
|
+
if ("value" in props) {
|
|
8
|
+
if (!(props.value instanceof CSharpMethodScope)) {
|
|
9
|
+
throw new Error("MethodScope value must be a CSharpMethodScope instance");
|
|
10
|
+
}
|
|
11
|
+
scope = props.value;
|
|
12
|
+
} else {
|
|
13
|
+
const parentScope = useCSharpScope();
|
|
14
|
+
scope = new CSharpMethodScope(props.name ?? "method scope", parentScope, {
|
|
15
|
+
...props
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
return _$createComponent(Scope, {
|
|
19
|
+
value: scope,
|
|
20
|
+
get children() {
|
|
21
|
+
return props.children;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=method-scope.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Scope","useCSharpScope","CSharpMethodScope","MethodScope","props","scope","value","Error","parentScope","name","_$createComponent","children"],"sources":["../../../src/components/method-scope.tsx"],"sourcesContent":[null],"mappings":";AAAA,SAASA,KAAK,QAAiD,gBAAgB;AAC/E,SAASC,cAAc,QAAQ,uBAAuB;AACtD,SAASC,iBAAiB,QAAQ,qBAAqB;AASvD,OAAO,SAASC,WAAWA,CAACC,KAAuB,EAAE;EACnD,IAAIC,KAAK;EACT,IAAI,OAAO,IAAID,KAAK,EAAE;IACpB,IAAI,EAAEA,KAAK,CAACE,KAAK,YAAYJ,iBAAiB,CAAC,EAAE;MAC/C,MAAM,IAAIK,KAAK,CAAC,wDAAwD,CAAC;IAC3E;IACAF,KAAK,GAAGD,KAAK,CAACE,KAAK;EACrB,CAAC,MAAM;IACL,MAAME,WAAW,GAAGP,cAAc,CAAC,CAAC;IACpCI,KAAK,GAAG,IAAIH,iBAAiB,CAACE,KAAK,CAACK,IAAI,IAAI,cAAc,EAAED,WAAW,EAAE;MACvE,GAAGJ;IACL,CAAC,CAAC;EACJ;EAEA,OAAAM,iBAAA,CAAQV,KAAK;IAACM,KAAK,EAAED,KAAK;IAAA,IAAAM,SAAA;MAAA,OAAGP,KAAK,CAACO,QAAQ;IAAA;EAAA;AAC7C","ignoreList":[]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Children } from "@alloy-js/core/jsx-runtime";
|
|
2
|
+
import { NamespaceSymbol } from "../symbols/namespace.js";
|
|
3
|
+
export interface NamespaceScopProps {
|
|
4
|
+
symbol: NamespaceSymbol;
|
|
5
|
+
children: Children;
|
|
6
|
+
}
|
|
7
|
+
export declare function NamespaceScope(props: NamespaceScopProps): Children;
|
|
8
|
+
export interface NamespaceScopesProps {
|
|
9
|
+
symbol: NamespaceSymbol;
|
|
10
|
+
children: Children;
|
|
11
|
+
}
|
|
12
|
+
export declare function NamespaceScopes(props: NamespaceScopesProps): Children;
|
|
13
|
+
//# sourceMappingURL=namespace-scopes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"namespace-scopes.d.ts","sourceRoot":"","sources":["../../../src/components/namespace-scopes.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAGtD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,eAAe,CAAC;IACxB,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,kBAAkB,YAOvD;AAED,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,eAAe,CAAC;IACxB,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,YAkB1D"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { createComponent as _$createComponent, memo as _$memo } from "@alloy-js/core/jsx-runtime";
|
|
2
|
+
import { Scope } from "@alloy-js/core";
|
|
3
|
+
import { NamespaceContext } from "../contexts/namespace.js";
|
|
4
|
+
import { createCSharpNamespaceScope } from "../scopes/namespace.js";
|
|
5
|
+
export function NamespaceScope(props) {
|
|
6
|
+
const scope = createCSharpNamespaceScope(props.symbol);
|
|
7
|
+
return _$createComponent(NamespaceContext.Provider, {
|
|
8
|
+
get value() {
|
|
9
|
+
return {
|
|
10
|
+
symbol: props.symbol
|
|
11
|
+
};
|
|
12
|
+
},
|
|
13
|
+
get children() {
|
|
14
|
+
return _$createComponent(Scope, {
|
|
15
|
+
value: scope,
|
|
16
|
+
get children() {
|
|
17
|
+
return props.children;
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
export function NamespaceScopes(props) {
|
|
24
|
+
function wrapWithScope(symbol, children) {
|
|
25
|
+
const scopeChildren = _$createComponent(NamespaceScope, {
|
|
26
|
+
symbol: symbol,
|
|
27
|
+
children: children
|
|
28
|
+
});
|
|
29
|
+
if (symbol.enclosingNamespace) {
|
|
30
|
+
return wrapWithScope(symbol.enclosingNamespace, scopeChildren);
|
|
31
|
+
}
|
|
32
|
+
return scopeChildren;
|
|
33
|
+
}
|
|
34
|
+
return _$createComponent(NamespaceContext.Provider, {
|
|
35
|
+
get value() {
|
|
36
|
+
return {
|
|
37
|
+
symbol: props.symbol
|
|
38
|
+
};
|
|
39
|
+
},
|
|
40
|
+
get children() {
|
|
41
|
+
return wrapWithScope(props.symbol, props.children);
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=namespace-scopes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Scope","NamespaceContext","createCSharpNamespaceScope","NamespaceScope","props","scope","symbol","_$createComponent","Provider","value","children","NamespaceScopes","wrapWithScope","scopeChildren","enclosingNamespace"],"sources":["../../../src/components/namespace-scopes.tsx"],"sourcesContent":[null],"mappings":";AAAA,SAASA,KAAK,QAAQ,gBAAgB;AAEtC,SAASC,gBAAgB,QAAQ,0BAA0B;AAC3D,SAASC,0BAA0B,QAAQ,wBAAwB;AAQnE,OAAO,SAASC,cAAcA,CAACC,KAAyB,EAAE;EACxD,MAAMC,KAAK,GAAGH,0BAA0B,CAACE,KAAK,CAACE,MAAM,CAAC;EACtD,OAAAC,iBAAA,CACGN,gBAAgB,CAACO,QAAQ;IAAA,IAACC,KAAKA,CAAA;MAAA,OAAE;QAAEH,MAAM,EAAEF,KAAK,CAACE;MAAO,CAAC;IAAA;IAAA,IAAAI,SAAA;MAAA,OAAAH,iBAAA,CACvDP,KAAK;QAACS,KAAK,EAAEJ,KAAK;QAAA,IAAAK,SAAA;UAAA,OAAGN,KAAK,CAACM,QAAQ;QAAA;MAAA;IAAA;EAAA;AAG1C;AAOA,OAAO,SAASC,eAAeA,CAACP,KAA2B,EAAE;EAC3D,SAASQ,aAAaA,CAACN,MAAuB,EAAEI,QAAkB,EAAE;IAClE,MAAMG,aAAa,GAAAN,iBAAA,CAChBJ,cAAc;MAACG,MAAM,EAAEA,MAAM;MAAAI,QAAA,EAAGA;IAAQ,EAC1C;IAED,IAAIJ,MAAM,CAACQ,kBAAkB,EAAE;MAC7B,OAAOF,aAAa,CAACN,MAAM,CAACQ,kBAAkB,EAAED,aAAa,CAAC;IAChE;IAEA,OAAOA,aAAa;EACtB;EAEA,OAAAN,iBAAA,CACGN,gBAAgB,CAACO,QAAQ;IAAA,IAACC,KAAKA,CAAA;MAAA,OAAE;QAAEH,MAAM,EAAEF,KAAK,CAACE;MAAO,CAAC;IAAA;IAAA,IAAAI,SAAA;MAAA,OACvDE,aAAa,CAACR,KAAK,CAACE,MAAM,EAAEF,KAAK,CAACM,QAAQ,CAAC;IAAA;EAAA;AAGlD","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"namespace.d.ts","sourceRoot":"","sources":["../../../src/components/namespace.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAMtD,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,YAyB9C"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { memo as _$memo, createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
|
|
2
|
+
import { Block } from "@alloy-js/core";
|
|
3
|
+
import { NamespaceContext } from "../contexts/namespace.js";
|
|
4
|
+
import { useSourceFileScope } from "../scopes/source-file.js";
|
|
5
|
+
import { createNamespaceSymbol } from "../symbols/factories.js";
|
|
6
|
+
import { NamespaceScope } from "./namespace-scopes.js";
|
|
7
|
+
export function Namespace(props) {
|
|
8
|
+
const namespaceSymbol = createNamespaceSymbol(props.name);
|
|
9
|
+
const sfScope = useSourceFileScope();
|
|
10
|
+
if (!sfScope) {
|
|
11
|
+
return _$createComponent(NamespaceContext.Provider, {
|
|
12
|
+
value: {
|
|
13
|
+
symbol: namespaceSymbol
|
|
14
|
+
},
|
|
15
|
+
get children() {
|
|
16
|
+
return props.children;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
} else {
|
|
20
|
+
sfScope.hasBlockNamespace = true;
|
|
21
|
+
return ["namespace ", _$memo(() => namespaceSymbol.name), " ", _$createComponent(Block, {
|
|
22
|
+
get children() {
|
|
23
|
+
return _$createComponent(NamespaceContext.Provider, {
|
|
24
|
+
value: {
|
|
25
|
+
symbol: namespaceSymbol
|
|
26
|
+
},
|
|
27
|
+
get children() {
|
|
28
|
+
return _$createComponent(NamespaceScope, {
|
|
29
|
+
symbol: namespaceSymbol,
|
|
30
|
+
get children() {
|
|
31
|
+
return props.children;
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
})];
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/*
|
|
42
|
+
const scope = createCSharpNamespaceScope(namespaceSymbol);
|
|
43
|
+
|
|
44
|
+
return <Scope value={scope}>{props.children}</Scope>;
|
|
45
|
+
}
|
|
46
|
+
*/
|
|
47
|
+
//# sourceMappingURL=namespace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Block","NamespaceContext","useSourceFileScope","createNamespaceSymbol","NamespaceScope","Namespace","props","namespaceSymbol","name","sfScope","_$createComponent","Provider","value","symbol","children","hasBlockNamespace","_$memo"],"sources":["../../../src/components/namespace.tsx"],"sourcesContent":[null],"mappings":";AAAA,SAASA,KAAK,QAAQ,gBAAgB;AAEtC,SAASC,gBAAgB,QAAQ,0BAA0B;AAC3D,SAASC,kBAAkB,QAAQ,0BAA0B;AAC7D,SAASC,qBAAqB,QAAQ,yBAAyB;AAC/D,SAASC,cAAc;AAOvB,OAAO,SAASC,SAASA,CAACC,KAAqB,EAAE;EAC/C,MAAMC,eAAe,GAAGJ,qBAAqB,CAACG,KAAK,CAACE,IAAI,CAAC;EACzD,MAAMC,OAAO,GAAGP,kBAAkB,CAAC,CAAC;EAEpC,IAAI,CAACO,OAAO,EAAE;IACZ,OAAAC,iBAAA,CACGT,gBAAgB,CAACU,QAAQ;MAACC,KAAK,EAAE;QAAEC,MAAM,EAAEN;MAAgB,CAAC;MAAA,IAAAO,SAAA;QAAA,OAC1DR,KAAK,CAACQ,QAAQ;MAAA;IAAA;EAGrB,CAAC,MAAM;IACLL,OAAO,CAACM,iBAAiB,GAAG,IAAI;IAChC,sBAAAC,MAAA,OAEeT,eAAe,CAACC,IAAI,GAAE,GAAG,EAAAE,iBAAA,CACnCV,KAAK;MAAA,IAAAc,SAAA;QAAA,OAAAJ,iBAAA,CACHT,gBAAgB,CAACU,QAAQ;UAACC,KAAK,EAAE;YAAEC,MAAM,EAAEN;UAAgB,CAAC;UAAA,IAAAO,SAAA;YAAA,OAAAJ,iBAAA,CAC1DN,cAAc;cAACS,MAAM,EAAEN,eAAe;cAAA,IAAAO,SAAA;gBAAA,OACpCR,KAAK,CAACQ,QAAQ;cAAA;YAAA;UAAA;QAAA;MAAA;IAAA;EAM3B;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"namespace.ref.test.d.ts","sourceRoot":"","sources":["../../../src/components/namespace.ref.test.tsx"],"names":[],"mappings":""}
|
|
@@ -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 "./source-file/source-file.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,SAASC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AACnC,SAASC,gBAAgB;AACzB,SAASC,SAAS;AAClB,SAASC,UAAU;AAEnBH,EAAE,CAAC,wCAAwC,EAAE,MAAM;EACjD,MAAMI,QAAQ,GAAGP,MAAM,CAAC,CAAC;EAEzB,MAAMQ,IAAI,GAAAC,iBAAA,CACPV,MAAM;IAAA,IAAAW,SAAA;MAAA,OAAAD,iBAAA,CACJJ,SAAS;QAACM,IAAI;QAAA,IAAAD,SAAA;UAAA,OAAAD,iBAAA,CACZH,UAAU;YAACM,IAAI;YAAA,IAAAF,SAAA;cAAA,QAAAD,iBAAA,CACbL,gBAAgB;gBAACO,IAAI;gBAAaX,MAAM,EAAEO;cAAQ,IAAAM,iBAAA,aAElDN,QAAQ;YAAA;UAAA;QAAA;MAAA;IAAA;EAAA,EAIhB;EAEDL,MAAM,CAACM,IAAI,CAAC,CAACM,UAAU,CAACb,CAAC;AAC3B;AACA;AACA;AACA;AACA,GAAG,CAAC;AACJ,CAAC,CAAC;AAEFE,EAAE,CAAC,wCAAwC,EAAE,MAAM;EACjD,MAAMI,QAAQ,GAAGP,MAAM,CAAC,CAAC;EAEzB,MAAMQ,IAAI,GAAAC,iBAAA,CACPV,MAAM;IAAA,IAAAW,SAAA;MAAA,OAAAD,iBAAA,CACJJ,SAAS;QAACM,IAAI;QAAA,IAAAD,SAAA;UAAA,OAAAD,iBAAA,CACZH,UAAU;YAACM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.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 "./source-file/source-file.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,13 +1,12 @@
|
|
|
1
|
-
import { Children,
|
|
1
|
+
import { Children, Namekey, 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;
|
|
7
7
|
/** Default value for the parameter */
|
|
8
8
|
default?: Children;
|
|
9
9
|
refkey?: Refkey;
|
|
10
|
-
symbol?: OutputSymbol;
|
|
11
10
|
}
|
|
12
11
|
/** Define a parameter to be used in class or interface method. */
|
|
13
12
|
export declare function Parameter(props: ParameterProps): Children;
|
|
@@ -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,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;IAEnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,kEAAkE;AAClE,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,YAgB9C;AAED,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,cAAc,EAAE,GAAG,SAAS,CAAC;CAC1C;AAED,wCAAwC;AACxC,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,YAehD"}
|
|
@@ -1,24 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { code, Declaration, For, Indent
|
|
3
|
-
import {
|
|
4
|
-
import { CSharpOutputSymbol } from "../../symbols/csharp-output-symbol.js";
|
|
5
|
-
import { useCSharpScope } 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
|
-
|
|
14
|
-
const memberSymbol = new CSharpOutputSymbol(name, {
|
|
15
|
-
scope,
|
|
16
|
-
refkeys: props.refkey ?? refkey(props.name)
|
|
7
|
+
const TypeSlot = createSymbolSlot();
|
|
8
|
+
const memberSymbol = createParameterSymbol(props.name, {
|
|
9
|
+
refkeys: props.refkey,
|
|
10
|
+
type: TypeSlot.firstSymbol,
|
|
11
|
+
isNullable: props.optional
|
|
17
12
|
});
|
|
18
13
|
return _$createComponent(Declaration, {
|
|
19
14
|
symbol: memberSymbol,
|
|
20
15
|
get children() {
|
|
21
|
-
return [_$
|
|
16
|
+
return [_$createComponent(TypeSlot, {
|
|
17
|
+
get children() {
|
|
18
|
+
return props.type;
|
|
19
|
+
}
|
|
20
|
+
}), _$memo(() => props.optional ? "?" : ""), " ", _$createComponent(Name, {}), _$memo(() => props.default ? code` = ${props.default}` : "")];
|
|
22
21
|
}
|
|
23
22
|
});
|
|
24
23
|
}
|
|
@@ -40,4 +39,5 @@ export function Parameters(props) {
|
|
|
40
39
|
})), _$createIntrinsic("softline", {}), ")"];
|
|
41
40
|
}
|
|
42
41
|
});
|
|
43
|
-
}
|
|
42
|
+
}
|
|
43
|
+
//# 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","isNullable","optional","_$createComponent","symbol","children","_$memo","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,QAGD,gBAAgB;AACvB,SAASC,qBAA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@@
|
|
|
1
|
+
{"version":3,"file":"parameters.test.d.ts","sourceRoot":"","sources":["../../../../src/components/parameters/parameters.test.tsx"],"names":[],"mappings":""}
|