@alloy-js/csharp 0.20.0-dev.0 → 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/{ClassDeclaration.d.ts → class/declaration.d.ts} +30 -12
- package/dist/src/components/class/declaration.d.ts.map +1 -0
- package/dist/src/components/class/declaration.js +87 -0
- package/dist/src/components/class/declaration.js.map +1 -0
- package/dist/src/components/class/declaration.test.d.ts +2 -0
- package/dist/src/components/class/declaration.test.d.ts.map +1 -0
- package/dist/src/components/class/declaration.test.js +573 -0
- 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 +13 -21
- 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 +10 -9
- package/dist/src/components/field/field.test.js.map +1 -0
- package/dist/src/components/index.d.ts +8 -4
- package/dist/src/components/index.d.ts.map +1 -1
- package/dist/src/components/index.js +10 -5
- 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 +17 -16
- 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 +484 -0
- package/src/components/{ClassDeclaration.tsx → class/declaration.tsx} +63 -44
- package/src/components/constructor/constructor.test.tsx +11 -17
- 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 +8 -8
- package/src/components/field/field.tsx +12 -22
- package/src/components/index.ts +8 -4
- 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 -21
- package/src/components/property/property.test.tsx +15 -15
- 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 +6910 -2491
- 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/ClassDeclaration.d.ts.map +0 -1
- package/dist/src/components/ClassDeclaration.js +0 -92
- 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/class-declaration.test.d.ts +0 -2
- package/dist/test/class-declaration.test.d.ts.map +0 -1
- package/dist/test/class-declaration.test.js +0 -484
- 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/class-declaration.test.tsx +0 -413
- 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
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { createComponent as _$createComponent, memo as _$memo } from "@alloy-js/core/jsx-runtime";
|
|
2
|
-
import { Declaration, Name
|
|
2
|
+
import { Declaration, Name } from "@alloy-js/core";
|
|
3
3
|
import { computeModifiersPrefix, getAccessModifier, makeModifiers } from "../../modifiers.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { useCSharpScope } from "../../symbols/scopes.js";
|
|
4
|
+
import { accessibilityFromProps, nonAccessibilityFromProps } from "../../symbols/csharp.js";
|
|
5
|
+
import { createFieldSymbol } from "../../symbols/factories.js";
|
|
7
6
|
import { DocWhen } from "../doc/comment.js";
|
|
8
7
|
|
|
9
8
|
/** Field modifiers. */
|
|
@@ -11,19 +10,12 @@ import { DocWhen } from "../doc/comment.js";
|
|
|
11
10
|
const getModifiers = makeModifiers(["new", "static", "readonly", "volatile"]);
|
|
12
11
|
/** Render a c# field */
|
|
13
12
|
export function Field(props) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const
|
|
20
|
-
if (scope.kind !== "member" || scope.name !== "class-decl" && scope.name !== "struct-decl") {
|
|
21
|
-
throw new Error("can't define a class member outside of a class or struct scope");
|
|
22
|
-
}
|
|
23
|
-
const memberSymbol = new CSharpOutputSymbol(name, {
|
|
24
|
-
scope,
|
|
25
|
-
refkeys: props.refkey ?? refkey(props.name)
|
|
26
|
-
});
|
|
13
|
+
const options = {
|
|
14
|
+
accessibility: accessibilityFromProps(props),
|
|
15
|
+
refkeys: props.refkey,
|
|
16
|
+
...nonAccessibilityFromProps(props)
|
|
17
|
+
};
|
|
18
|
+
const memberSymbol = createFieldSymbol(props.name, options);
|
|
27
19
|
const modifiers = computeModifiersPrefix([getAccessModifier(props), getModifiers(props)]);
|
|
28
20
|
return _$createComponent(Declaration, {
|
|
29
21
|
symbol: memberSymbol,
|
|
@@ -35,4 +27,5 @@ export function Field(props) {
|
|
|
35
27
|
}), modifiers, _$memo(() => props.type), " ", _$createComponent(Name, {}), ";"];
|
|
36
28
|
}
|
|
37
29
|
});
|
|
38
|
-
}
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=field.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Declaration","Name","computeModifiersPrefix","getAccessModifier","makeModifiers","accessibilityFromProps","nonAccessibilityFromProps","createFieldSymbol","DocWhen","getModifiers","Field","props","options","accessibility","refkeys","refkey","memberSymbol","name","modifiers","_$createComponent","symbol","children","doc","_$memo","type"],"sources":["../../../../src/components/field/field.tsx"],"sourcesContent":[null],"mappings":";AAAA,SAAmBA,WAAW,EAAEC,IAAI,QAAgB,gBAAgB;AACpE,SAEEC,sBAAsB,EACtBC,iBAAiB,EACjBC,aAAa,QACR,oBAAoB;AAC3B,SACEC,sBAAsB,EACtBC,yBAAyB,QACpB,yBAAyB;AAChC,SAASC,iBAAiB,QAAQ,4BAA4B;AAC9D,SAASC,OAAO;;AAEhB;;AAQA,MAAMC,YAAY,GAAGL,aAAa,CAAiB,CACjD,KAAK,EACL,QAAQ,EACR,UAAU,EACV,UAAU,CACX,CAAC;AAUF;AACA,OAAO,SAASM,KAAKA,CAACC,KAAiB,EAAE;EACvC,MAAMC,OAAO,GAAG;IACdC,aAAa,EAAER,sBAAsB,CAACM,KAAK,CAAC;IAC5CG,OAAO,EAAEH,KAAK,CAACI,MAAM;IACrB,GAAGT,yBAAyB,CAACK,KAAK;EACpC,CAAC;EAED,MAAMK,YAAY,GAAGT,iBAAiB,CAACI,KAAK,CAACM,IAAI,EAAEL,OAAO,CAAC;EAE3D,MAAMM,SAAS,GAAGhB,sBAAsB,CAAC,CACvCC,iBAAiB,CAACQ,KAAK,CAAC,EACxBF,YAAY,CAACE,KAAK,CAAC,CACpB,CAAC;EAEF,OAAAQ,iBAAA,CACGnB,WAAW;IAACoB,MAAM,EAAEJ,YAAY;IAAA,IAAAK,SAAA;MAAA,QAAAF,iBAAA,CAC9BX,OAAO;QAAA,IAACc,GAAGA,CAAA;UAAA,OAAEX,KAAK,CAACW,GAAG;QAAA;MAAA,IACtBJ,SAAS,EAAAK,MAAA,OACTZ,KAAK,CAACa,IAAI,QAAAL,iBAAA,CAAGlB,IAAI;IAAA;EAAA;AAGxB","ignoreList":[]}
|
|
@@ -2,7 +2,7 @@ import { memo as _$memo, createComponent as _$createComponent, mergeProps as _$m
|
|
|
2
2
|
import { List } from "@alloy-js/core";
|
|
3
3
|
import { describe, expect, it } from "vitest";
|
|
4
4
|
import { TestNamespace } from "../../../test/utils.js";
|
|
5
|
-
import { ClassDeclaration } from "../
|
|
5
|
+
import { ClassDeclaration } from "../class/declaration.js";
|
|
6
6
|
import { Field } from "./field.js";
|
|
7
7
|
function Wrapper(props) {
|
|
8
8
|
return _$createComponent(TestNamespace, {
|
|
@@ -37,8 +37,8 @@ it("declares multiple fields", () => {
|
|
|
37
37
|
})).toRenderTo(`
|
|
38
38
|
public class TestClass
|
|
39
39
|
{
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
public string MemberOne;
|
|
41
|
+
public int MemberTwo;
|
|
42
42
|
}
|
|
43
43
|
`);
|
|
44
44
|
});
|
|
@@ -57,7 +57,7 @@ describe("modifiers", () => {
|
|
|
57
57
|
})).toRenderTo(`
|
|
58
58
|
public class TestClass
|
|
59
59
|
{
|
|
60
|
-
|
|
60
|
+
${accessModifier} string ${accessModifier === "private" ? "_testProp" : "TestProp"};
|
|
61
61
|
}
|
|
62
62
|
`);
|
|
63
63
|
});
|
|
@@ -76,7 +76,7 @@ describe("modifiers", () => {
|
|
|
76
76
|
})).toRenderTo(`
|
|
77
77
|
public class TestClass
|
|
78
78
|
{
|
|
79
|
-
|
|
79
|
+
${methodModifier} string _testField;
|
|
80
80
|
}
|
|
81
81
|
`);
|
|
82
82
|
});
|
|
@@ -94,7 +94,7 @@ describe("modifiers", () => {
|
|
|
94
94
|
})).toRenderTo(`
|
|
95
95
|
public class TestClass
|
|
96
96
|
{
|
|
97
|
-
|
|
97
|
+
public new string TestField;
|
|
98
98
|
}
|
|
99
99
|
`);
|
|
100
100
|
});
|
|
@@ -116,7 +116,7 @@ describe("naming", () => {
|
|
|
116
116
|
})).toRenderTo(`
|
|
117
117
|
public class TestClass
|
|
118
118
|
{
|
|
119
|
-
|
|
119
|
+
public string MemberOne;
|
|
120
120
|
}
|
|
121
121
|
`);
|
|
122
122
|
});
|
|
@@ -136,8 +136,9 @@ describe("naming", () => {
|
|
|
136
136
|
})).toRenderTo(`
|
|
137
137
|
public class TestClass
|
|
138
138
|
{
|
|
139
|
-
|
|
139
|
+
private string _memberOne;
|
|
140
140
|
}
|
|
141
141
|
`);
|
|
142
142
|
});
|
|
143
|
-
});
|
|
143
|
+
});
|
|
144
|
+
//# sourceMappingURL=field.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["List","describe","expect","it","TestNamespace","ClassDeclaration","Field","Wrapper","props","_$createComponent","children","name","type","toRenderTo","each","accessModifier","_$mergeProps","methodModifier"],"sources":["../../../../src/components/field/field.test.tsx"],"sourcesContent":[null],"mappings":";AAAA,SAASA,IAAI,QAAQ,gBAAgB;AACrC,SAASC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AAC7C,SAASC,aAAa;AACtB,SAASC,gBAAgB;AACzB,SAASC,KAAK;AAEd,SAASC,OAAOA,CAACC,KAAwB,EAAE;EACzC,OAAAC,iBAAA,CACGL,aAAa;IAAA,IAAAM,SAAA;MAAA,OAAAD,iBAAA,CACXJ,gBAAgB;QAAA;QAAQM,IAAI;QAAA,IAAAD,SAAA;UAAA,OAC1BF,KAAK,CAACE,QAAQ;QAAA;MAAA;IAAA;EAAA;AAIvB;AACAP,EAAE,CAAC,0BAA0B,EAAE,MAAM;EACnCD,MAAM,CAAAO,iBAAA,CACHF,OAAO;IAAA,IAAAG,SAAA;MAAA,OAAAD,iBAAA,CACLT,IAAI;QAAA,IAAAU,SAAA;UAAA,QAAAD,iBAAA,CACFH,KAAK;YAAA;Y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AC,CAAC;EAEFd,EAAE,CAAC,mBAAmB,EAAE,MAAM;IAC5BD,MAAM,CAAAO,iBAAA,CACHF,OAAO;MAAA,IAAAG,SAAA;QAAA,OAAAD,iBAAA,CACLH,KAAK;UAAA;UAAA;UAAYK,IAAI;UAAaC,IAAI;QAAA;MAAA;IAAA,EAE3C,CAAC,CAACC,UAAU,CAAC;AACjB;AACA;AACA;AACA;AACA,OAAO,CAAC;EACN,CAAC,CAAC;AACJ,CAAC,CAAC;AAEFZ,QAAQ,CAAC,QAAQ,EAAE,MAAM;EACvBE,EAAE,CAAC,6BAA6B,EAAE,MAAM;IACtCD,MAAM,CAAAO,iBAAA,CACHF,OAAO;MAAA,IAAAG,SAAA;QAAA,OAAAD,iBAAA,CACLT,IAAI;UAAA,IAAAU,SAAA;YAAA,OAAAD,iBAAA,CACFH,KAAK;cAAA;cAAQK,IAAI;cAAcC,IAAI;YAAA;UAAA;QAAA;MAAA;IAAA,EAG1C,CAAC,CAACC,UAAU,CAAC;AACjB;AACA;AACA;AACA;AACA,KAAK,CAAC;EACJ,CAAC,CAAC;EAEFV,EAAE,CAAC,2CAA2C,EAAE,MAAM;IACpDD,MAAM,CAAAO,iBAAA,CACHF,OAAO;MAAA,IAAAG,SAAA;QAAA,OAAAD,iBAAA,CACLT,IAAI;UAAA,IAAAU,SAAA;YAAA,OAAAD,iBAAA,CACFH,KAAK;cAAA;cAASK,IAAI;cAAcC,IAAI;YAAA;UAAA;QAAA;MAAA;IAAA,EAG3C,CAAC,CAACC,UAAU,CAAC;AACjB;AACA;AACA;AACA;AACA,GAAG,CAAC;EACF,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,23 +1,27 @@
|
|
|
1
1
|
export * from "./attributes/attributes.jsx";
|
|
2
|
-
export * from "./
|
|
2
|
+
export * from "./class/declaration.jsx";
|
|
3
3
|
export * from "./constructor/constructor.jsx";
|
|
4
4
|
export * from "./Declaration.js";
|
|
5
5
|
export * from "./doc/comment.jsx";
|
|
6
6
|
export * from "./doc/from-markdown.jsx";
|
|
7
|
-
export * from "./
|
|
7
|
+
export * from "./enum/declaration.jsx";
|
|
8
|
+
export * from "./enum/member.jsx";
|
|
8
9
|
export * from "./field/field.jsx";
|
|
9
10
|
export * from "./interface/declaration.js";
|
|
10
11
|
export * from "./interface/method.js";
|
|
11
12
|
export * from "./interface/property.js";
|
|
13
|
+
export * from "./invocation-expression/invocation-expression.jsx";
|
|
14
|
+
export * from "./lexical-scope.jsx";
|
|
15
|
+
export * from "./method-scope.jsx";
|
|
12
16
|
export * from "./method/method.jsx";
|
|
13
17
|
export * from "./Name.js";
|
|
14
|
-
export * from "./
|
|
18
|
+
export * from "./namespace.js";
|
|
15
19
|
export * from "./parameters/parameters.jsx";
|
|
16
20
|
export * from "./ProjectDirectory.js";
|
|
17
21
|
export * from "./property/property.jsx";
|
|
18
22
|
export * from "./record/declaration.js";
|
|
19
23
|
export * from "./Reference.js";
|
|
20
|
-
export * from "./
|
|
24
|
+
export * from "./source-file/source-file.jsx";
|
|
21
25
|
export * from "./struct/declaration.jsx";
|
|
22
26
|
export type { TypeParameterProps } from "./type-parameters/type-parameter.jsx";
|
|
23
27
|
export * from "./UsingDirective.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mDAAmD,CAAC;AAClE,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0BAA0B,CAAC;AACzC,YAAY,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC"}
|
|
@@ -1,24 +1,29 @@
|
|
|
1
1
|
export * from "./attributes/attributes.js";
|
|
2
|
-
export * from "./
|
|
2
|
+
export * from "./class/declaration.js";
|
|
3
3
|
export * from "./constructor/constructor.js";
|
|
4
4
|
export * from "./Declaration.js";
|
|
5
5
|
export * from "./doc/comment.js";
|
|
6
6
|
export * from "./doc/from-markdown.js";
|
|
7
|
-
export * from "./
|
|
7
|
+
export * from "./enum/declaration.js";
|
|
8
|
+
export * from "./enum/member.js";
|
|
8
9
|
export * from "./field/field.js";
|
|
9
10
|
export * from "./interface/declaration.js";
|
|
10
11
|
export * from "./interface/method.js";
|
|
11
12
|
export * from "./interface/property.js";
|
|
13
|
+
export * from "./invocation-expression/invocation-expression.js";
|
|
14
|
+
export * from "./lexical-scope.js";
|
|
15
|
+
export * from "./method-scope.js";
|
|
12
16
|
export * from "./method/method.js";
|
|
13
17
|
export * from "./Name.js";
|
|
14
|
-
export * from "./
|
|
18
|
+
export * from "./namespace.js";
|
|
15
19
|
export * from "./parameters/parameters.js";
|
|
16
20
|
export * from "./ProjectDirectory.js";
|
|
17
21
|
export * from "./property/property.js";
|
|
18
22
|
export * from "./record/declaration.js";
|
|
19
23
|
export * from "./Reference.js";
|
|
20
|
-
export * from "./
|
|
24
|
+
export * from "./source-file/source-file.js";
|
|
21
25
|
export * from "./struct/declaration.js";
|
|
22
26
|
export * from "./UsingDirective.js";
|
|
23
27
|
export * from "./var/declaration.js";
|
|
24
|
-
export {};
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/components/index.ts"],"sourcesContent":[null],"mappings":"AAAA;AACA;AACA;AACA,cAAc,kBAAkB;AAChC;AACA;AACA;AACA;AACA;AACA,cAAc,4BAA4B;AAC1C,cAAc,uBAAuB;AACrC,cAAc,yBAAyB;AACvC;AACA;AACA;AACA;AACA,cAAc,WAAW;AACzB,cAAc,gBAAgB;AAC9B;AACA,cAAc,uBAAuB;AACrC;AACA,cAAc,yBAAyB;AACvC,cAAc,gBAAgB;AAC9B;AACA;AAEA,cAAc,qBAAqB;AACnC;AAAsC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"declaration.d.ts","sourceRoot":"","sources":["../../../../src/components/interface/declaration.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAC;AACvC,OAAO,EACL,eAAe,EAIhB,MAAM,oBAAoB,CAAC;AAI5B,OAAO,EAAiB,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAI7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAG3E,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC5B;AAKD,MAAM,WAAW,yBACf,SAAQ,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,UAAU,CAAC,EAC7C,eAAe,EACf,kBAAkB;IACpB,IAAI,EAAE,MAAM,CAAC;IAEb,kBAAkB;IAClB,GAAG,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC;IACpB,MAAM,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC;IAErB;;;;;;;;;;;OAWG;IACH,cAAc,CAAC,EAAE,CAAC,kBAAkB,GAAG,MAAM,CAAC,EAAE,CAAC;IAEjD;;;;;;;;;;;;;;;OAeG;IACH,UAAU,CAAC,EAAE,cAAc,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,
|
|
1
|
+
{"version":3,"file":"declaration.d.ts","sourceRoot":"","sources":["../../../../src/components/interface/declaration.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAC;AACvC,OAAO,EACL,eAAe,EAIhB,MAAM,oBAAoB,CAAC;AAI5B,OAAO,EAAiB,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAI7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAG3E,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC5B;AAKD,MAAM,WAAW,yBACf,SAAQ,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,UAAU,CAAC,EAC7C,eAAe,EACf,kBAAkB;IACpB,IAAI,EAAE,MAAM,CAAC;IAEb,kBAAkB;IAClB,GAAG,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC;IACpB,MAAM,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC;IAErB;;;;;;;;;;;OAWG;IACH,cAAc,CAAC,EAAE,CAAC,kBAAkB,GAAG,MAAM,CAAC,EAAE,CAAC;IAEjD;;;;;;;;;;;;;;;OAeG;IACH,UAAU,CAAC,EAAE,cAAc,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,iBAmCpE"}
|
|
@@ -2,8 +2,8 @@ import { createComponent as _$createComponent, memo as _$memo } from "@alloy-js/
|
|
|
2
2
|
import * as core from "@alloy-js/core";
|
|
3
3
|
import { computeModifiersPrefix, getAccessModifier, makeModifiers } from "../../modifiers.js";
|
|
4
4
|
import { useCSharpNamePolicy } from "../../name-policy.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { createNamedTypeScope } from "../../scopes/factories.js";
|
|
6
|
+
import { createNamedTypeSymbol } from "../../symbols/factories.js";
|
|
7
7
|
import { AttributeList } from "../attributes/attributes.js";
|
|
8
8
|
import { DocWhen } from "../doc/comment.js";
|
|
9
9
|
import { Name } from "../Name.js";
|
|
@@ -35,7 +35,7 @@ const getInterfaceModifiers = makeModifiers(["partial"]);
|
|
|
35
35
|
*/
|
|
36
36
|
export function InterfaceDeclaration(props) {
|
|
37
37
|
const name = useCSharpNamePolicy().getName(props.name, "interface");
|
|
38
|
-
const
|
|
38
|
+
const symbol = createNamedTypeSymbol(name, "interface", {
|
|
39
39
|
refkeys: props.refkey
|
|
40
40
|
});
|
|
41
41
|
|
|
@@ -43,12 +43,10 @@ export function InterfaceDeclaration(props) {
|
|
|
43
43
|
// members will automatically "inherit" this scope so
|
|
44
44
|
// that refkeys to them will produce the fully-qualified
|
|
45
45
|
// name e.g. Foo.Bar.
|
|
46
|
-
const thisInterfaceScope =
|
|
47
|
-
owner: thisInterfaceSymbol
|
|
48
|
-
});
|
|
46
|
+
const thisInterfaceScope = createNamedTypeScope(symbol);
|
|
49
47
|
const modifiers = computeModifiersPrefix([getAccessModifier(props), getInterfaceModifiers(props)]);
|
|
50
48
|
return _$createComponent(core.Declaration, {
|
|
51
|
-
symbol:
|
|
49
|
+
symbol: symbol,
|
|
52
50
|
get children() {
|
|
53
51
|
return [_$createComponent(DocWhen, {
|
|
54
52
|
get doc() {
|
|
@@ -59,25 +57,26 @@ export function InterfaceDeclaration(props) {
|
|
|
59
57
|
return props.attributes;
|
|
60
58
|
},
|
|
61
59
|
endline: true
|
|
62
|
-
}), modifiers, "interface ", _$createComponent(Name, {}), _$
|
|
63
|
-
|
|
64
|
-
return props.typeParameters;
|
|
65
|
-
}
|
|
66
|
-
})), _$memo(() => _$memo(() => !!props.typeParameters)() && _$createComponent(TypeParameterConstraints, {
|
|
67
|
-
get parameters() {
|
|
68
|
-
return props.typeParameters;
|
|
69
|
-
}
|
|
70
|
-
})), _$memo(() => _$memo(() => !!props.children)() ? _$createComponent(core.Block, {
|
|
71
|
-
newline: true,
|
|
60
|
+
}), modifiers, "interface ", _$createComponent(Name, {}), _$createComponent(core.Scope, {
|
|
61
|
+
value: thisInterfaceScope,
|
|
72
62
|
get children() {
|
|
73
|
-
return _$createComponent(
|
|
74
|
-
|
|
63
|
+
return [_$memo(() => _$memo(() => !!props.typeParameters)() && _$createComponent(TypeParameters, {
|
|
64
|
+
get parameters() {
|
|
65
|
+
return props.typeParameters;
|
|
66
|
+
}
|
|
67
|
+
})), _$memo(() => _$memo(() => !!props.typeParameters)() && _$createComponent(TypeParameterConstraints, {
|
|
68
|
+
get parameters() {
|
|
69
|
+
return props.typeParameters;
|
|
70
|
+
}
|
|
71
|
+
})), _$memo(() => _$memo(() => !!props.children)() ? _$createComponent(core.Block, {
|
|
72
|
+
newline: true,
|
|
75
73
|
get children() {
|
|
76
74
|
return props.children;
|
|
77
75
|
}
|
|
78
|
-
});
|
|
76
|
+
}) : ";")];
|
|
79
77
|
}
|
|
80
|
-
})
|
|
78
|
+
})];
|
|
81
79
|
}
|
|
82
80
|
});
|
|
83
|
-
}
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=declaration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["core","computeModifiersPrefix","getAccessModifier","makeModifiers","useCSharpNamePolicy","createNamedTypeScope","createNamedTypeSymbol","AttributeList","DocWhen","Name","TypeParameterConstraints","TypeParameters","getInterfaceModifiers","InterfaceDeclaration","props","name","getName","symbol","refkeys","refkey","thisInterfaceScope","modifiers","_$createComponent","Declaration","children","doc","attributes","endline","Scope","value","_$memo","typeParameters","parameters","Block","newline"],"sources":["../../../../src/components/interface/declaration.tsx"],"sourcesContent":[null],"mappings":";AAAA,OAAO,KAAKA,IAAI,MAAM,gBAAgB;AACtC,SAEEC,sBAAsB,EACtBC,iBAAiB,EACjBC,aAAa,QACR,oBAAoB;AAC3B,SAASC,mBAAmB,QAAQ,sBAAsB;AAC1D,SAASC,oBAAoB,QAAQ,2BAA2B;AAChE,SAASC,qBAAqB,QAAQ,4BAA4B;AAClE,SAASC,aAAa;AACtB,SAASC,OAAO;AAChB,SAASC,IAAI;AACb,SAASC,wBAAwB;AAEjC,SAASC,cAAc;AAMvB,MAAMC,qBAAqB,GAAGT,aAAa,CAAqB,CAAC,SAAS,CAAC,CAAC;;AAE5E;;AA4CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASU,oBAAoBA,CAACC,KAAgC,EAAE;EACrE,MAAMC,IAAI,GAAGX,mBAAmB,CAAC,CAAC,CAACY,OAAO,CAACF,KAAK,CAACC,IAAI,EAAG,WAAW,CAAC;EAEpE,MAAME,MAAM,GAAGX,qBAAqB,CAACS,IAAI,EAAE,WAAW,EAAE;IACtDG,OAAO,EAAEJ,KAAK,CAACK;EACjB,CAAC,CAAC;;EAEF;EACA;EACA;EACA;EACA,MAAMC,kBAAkB,GAAGf,oBAAoB,CAACY,MAAM,CAAC;EAEvD,MAAMI,SAAS,GAAGpB,sBAAsB,CAAC,CACvCC,iBAAiB,CAACY,KAAK,CAAC,EACxBF,qBAAqB,CAACE,KAAK,CAAC,CAC7B,CAAC;EACF,OAAAQ,iBAAA,CACGtB,IAAI,CAACuB,WAAW;IAACN,MAAM,EAAEA,MAAM;IAAA,IAAAO,SAAA;MAAA,QAAAF,iBAAA,CAC7Bd,OAAO;QAAA,IAACiB,GAAGA,CAAA;UAAA,OAAEX,KAAK,CAACW,GAAG;QAAA;MAAA,IAAAH,iBAAA,CACtBf,aAAa;QAAA,IAACmB,UAAUA,CAAA;UAAA,OAAEZ,KAAK,CAACY,UAAU;QAAA;QAAEC,OAAO;MAAA,IACnDN,SAAS,gBAAAC,iBAAA,CAAYb,IAAI,OAAAa,iBAAA,CACzBtB,IAAI,CAAC4B,KAAK;QAACC,KAAK,EAAET,kBAAkB;QAAA,IAAAI,SAAA;UAAA,QAAAM,MAAA,OAClCA,MAAA,SAAAhB,KAAK,CAACiB,cAAc,OAAAT,iBAAA,CAClBX,cAAc;YAAA,IAACqB,UAAUA,CAAA;cAAA,OAAElB,KAAK,CAACiB,cAAc;YAAA;UAAA,EACjD,GAAAD,MAAA,OACAA,MAAA,SAAAhB,KAAK,CAACiB,cAAc,OAAAT,iBAAA,CAClBZ,wBAAwB;YAAA,IAACsB,UAAUA,CAAA;cAAA,OAAElB,KAAK,CAACiB,cAAc;YAAA;UAAA,EAC3D,GAAAD,MAAA,OACAA,MAAA,SAAAhB,KAAK,CAACU,QAAQ,MAAAF,iBAAA,CACZtB,IAAI,CAACiC,KAAK;YAACC,OAAO;YAAA,IAAAV,SAAA;cAAA,OAAEV,KAAK,CAACU,QAAQ;YAAA;UAAA,KACnC,GAAG;QAAA;MAAA;IAAA;EAAA;AAIb","ignoreList":[]}
|
|
@@ -3,7 +3,6 @@ import { List, refkey } from "@alloy-js/core";
|
|
|
3
3
|
import { describe, expect, it } from "vitest";
|
|
4
4
|
import { TestNamespace } from "../../../test/utils.js";
|
|
5
5
|
import { Attribute } from "../attributes/attributes.js";
|
|
6
|
-
import { SourceFile } from "../SourceFile.js";
|
|
7
6
|
import { InterfaceDeclaration } from "./declaration.js";
|
|
8
7
|
import { InterfaceProperty } from "./property.js";
|
|
9
8
|
it("declares class with no members", () => {
|
|
@@ -82,46 +81,38 @@ describe("with type parameters", () => {
|
|
|
82
81
|
}];
|
|
83
82
|
expect(_$createComponent(TestNamespace, {
|
|
84
83
|
get children() {
|
|
85
|
-
return _$createComponent(
|
|
86
|
-
|
|
84
|
+
return _$createComponent(InterfaceDeclaration, {
|
|
85
|
+
"public": true,
|
|
86
|
+
name: "Test",
|
|
87
|
+
typeParameters: typeParameters,
|
|
87
88
|
get children() {
|
|
88
|
-
return _$createComponent(
|
|
89
|
-
"public": true,
|
|
90
|
-
name: "Test",
|
|
91
|
-
typeParameters: typeParameters,
|
|
89
|
+
return _$createComponent(List, {
|
|
92
90
|
get children() {
|
|
93
|
-
return _$createComponent(
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
set: true
|
|
109
|
-
})];
|
|
110
|
-
}
|
|
111
|
-
});
|
|
91
|
+
return [_$createComponent(InterfaceProperty, {
|
|
92
|
+
name: "PropA",
|
|
93
|
+
get type() {
|
|
94
|
+
return typeParameters[0].refkey;
|
|
95
|
+
},
|
|
96
|
+
get: true,
|
|
97
|
+
set: true
|
|
98
|
+
}), _$createComponent(InterfaceProperty, {
|
|
99
|
+
name: "PropB",
|
|
100
|
+
get type() {
|
|
101
|
+
return typeParameters[1].refkey;
|
|
102
|
+
},
|
|
103
|
+
get: true,
|
|
104
|
+
set: true
|
|
105
|
+
})];
|
|
112
106
|
}
|
|
113
107
|
});
|
|
114
108
|
}
|
|
115
109
|
});
|
|
116
110
|
}
|
|
117
111
|
})).toRenderTo(`
|
|
118
|
-
|
|
112
|
+
public interface Test<T, U>
|
|
119
113
|
{
|
|
120
|
-
|
|
121
|
-
{
|
|
122
|
-
T PropA { get; set; }
|
|
123
|
-
U PropB { get; set; }
|
|
124
|
-
}
|
|
114
|
+
T PropA { get; set; }
|
|
115
|
+
U PropB { get; set; }
|
|
125
116
|
}
|
|
126
117
|
`);
|
|
127
118
|
});
|
|
@@ -144,10 +135,10 @@ describe("with type parameters", () => {
|
|
|
144
135
|
}
|
|
145
136
|
})).toRenderTo(`
|
|
146
137
|
public interface Test<T, U>
|
|
147
|
-
|
|
148
|
-
|
|
138
|
+
where T : IFoo
|
|
139
|
+
where U : IBar
|
|
149
140
|
{
|
|
150
|
-
|
|
141
|
+
// Body
|
|
151
142
|
}
|
|
152
143
|
`);
|
|
153
144
|
});
|
|
@@ -168,4 +159,5 @@ it("specify attributes", () => {
|
|
|
168
159
|
[Test]
|
|
169
160
|
interface Test;
|
|
170
161
|
`);
|
|
171
|
-
});
|
|
162
|
+
});
|
|
163
|
+
//# sourceMappingURL=declaration.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["List","refkey","describe","expect","it","TestNamespace","Attribute","InterfaceDeclaration","InterfaceProperty","_$createComponent","children","name","toRenderTo","each","mod","_$mergeProps","partial","doc","typeParameters","type","get","set","constraints","attributes"],"sources":["../../../../src/components/interface/declaration.test.tsx"],"sourcesContent":[null],"mappings":";AAAA,SAASA,IAAI,EAAEC,MAAM,QAAQ,gBAAgB;AAC7C,SAASC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AAC7C,SAASC,aAAa;AACtB,SAASC,SAAS;AAElB,SAASC,oBAAoB;AAC7B,SAASC,iBAAiB;AAE1BJ,EAAE,CAAC,gCAAgC,EAAE,MAAM;EACzCD,MAAM,CAAAM,iBAAA,CACHJ,aAAa;IAAA,IAAAK,SAAA;MAAA,OAAAD,iBAAA,CACXF,oBAAoB;QAACI,IAAI;MAAA;IAAA;EAAA,EAE9B,CAAC,CAACC,UAAU,CAAC;AACf;AACA,GAAG,CAAC;AACJ,CAAC,CAAC;AAEFV,QAAQ,CAAC,WAAW,EAAE,MAAM;EAC1BE,EAAE,CAACS,IAAI,CAAC,CAAC,QAAQ,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC,IAAI,EAAGC,GAAG,IAAK;IACxDX,MAAM,CAAAM,iBAAA,CACHJ,aAAa;MAAA,IAAAK,SAAA;QAAA,O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AAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC;AAEFR,EAAE,CAAC,oBAAoB,EAAE,MAAM;EAC7BD,MAAM,CAAAM,iBAAA,CACHJ,aAAa;IAAA,IAAAK,SAAA;MAAA,OAAAD,iBAAA,CACXF,oBAAoB;QACnBI,IAAI;QAAA,IACJY,UAAUA,CAAA;UAAA,OAAE,CAAAd,iBAAA,CAAEH,SAAS;YAACK,IAAI;UAAA,GAAW;QAAA;MAAA;IAAA;EAAA,EAG7C,CAAC,CAACC,UAAU,CAAC;AACf;AACA;AACA,GAAG,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"method.d.ts","sourceRoot":"","sources":["../../../../src/components/interface/method.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAGR,MAAM,EAEP,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,eAAe,EAIhB,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"method.d.ts","sourceRoot":"","sources":["../../../../src/components/interface/method.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAGR,MAAM,EAEP,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,eAAe,EAIhB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAiB,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE7E,OAAO,EAAE,cAAc,EAAc,MAAM,8BAA8B,CAAC;AAE1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAG3E,yCAAyC;AACzC,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC;CACxB;AAKD,MAAM,WAAW,oBACf,SAAQ,eAAe,EACrB,wBAAwB;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,UAAU,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC;IACnC;;;;;;;;;;;OAWG;IACH,cAAc,CAAC,EAAE,CAAC,kBAAkB,GAAG,MAAM,CAAC,EAAE,CAAC;IACjD,OAAO,CAAC,EAAE,QAAQ,CAAC;IAEnB,kBAAkB;IAClB,GAAG,CAAC,EAAE,QAAQ,CAAC;IAEf;;;;;;;;;;;;;;;OAeG;IACH,UAAU,CAAC,EAAE,cAAc,CAAC;CAC7B;AAGD,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,YAgC1D"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { createComponent as _$createComponent, memo as _$memo } from "@alloy-js/core/jsx-runtime";
|
|
2
|
-
import { Block, MemberDeclaration,
|
|
2
|
+
import { Block, MemberDeclaration, MemberName, Scope } from "@alloy-js/core";
|
|
3
3
|
import { computeModifiersPrefix, getAccessModifier, makeModifiers } from "../../modifiers.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { CSharpMemberScope, useCSharpScope } from "../../symbols/scopes.js";
|
|
4
|
+
import { createMethodScope } from "../../scopes/factories.js";
|
|
5
|
+
import { createMethodSymbol } from "../../symbols/factories.js";
|
|
7
6
|
import { AttributeList } from "../attributes/attributes.js";
|
|
8
7
|
import { DocWhen } from "../doc/comment.js";
|
|
9
8
|
import { Parameters } from "../parameters/parameters.js";
|
|
@@ -18,20 +17,10 @@ const getMethodModifier = makeModifiers(["new"]);
|
|
|
18
17
|
|
|
19
18
|
// a C# interface method
|
|
20
19
|
export function InterfaceMethod(props) {
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
if (scope.kind !== "member" || scope.name !== "interface-decl") {
|
|
24
|
-
throw new Error("can't define an interface method outside of an interface scope");
|
|
25
|
-
}
|
|
26
|
-
const methodSymbol = new CSharpOutputSymbol(name, {
|
|
27
|
-
scope,
|
|
28
|
-
refkeys: props.refkey ?? refkey(props.name)
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
// scope for method declaration
|
|
32
|
-
const methodScope = new CSharpMemberScope("method-decl", {
|
|
33
|
-
owner: methodSymbol
|
|
20
|
+
const methodSymbol = createMethodSymbol(props.name, {
|
|
21
|
+
refkeys: props.refkey
|
|
34
22
|
});
|
|
23
|
+
const methodScope = createMethodScope();
|
|
35
24
|
const modifiers = computeModifiersPrefix([getAccessModifier(props), getMethodModifier(props)]);
|
|
36
25
|
// note that scope wraps the method decl so that the params get the correct scope
|
|
37
26
|
return _$createComponent(MemberDeclaration, {
|
|
@@ -49,7 +38,7 @@ export function InterfaceMethod(props) {
|
|
|
49
38
|
return props.attributes;
|
|
50
39
|
},
|
|
51
40
|
endline: true
|
|
52
|
-
}), modifiers, _$memo(() => props.returns ?? "void"), " ",
|
|
41
|
+
}), modifiers, _$memo(() => props.returns ?? "void"), " ", _$createComponent(MemberName, {}), _$memo(() => _$memo(() => !!props.typeParameters)() && _$createComponent(TypeParameters, {
|
|
53
42
|
get parameters() {
|
|
54
43
|
return props.typeParameters;
|
|
55
44
|
}
|
|
@@ -71,4 +60,5 @@ export function InterfaceMethod(props) {
|
|
|
71
60
|
});
|
|
72
61
|
}
|
|
73
62
|
});
|
|
74
|
-
}
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=method.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Block","MemberDeclaration","MemberName","Scope","computeModifiersPrefix","getAccessModifier","makeModifiers","createMethodScope","createMethodSymbol","AttributeList","DocWhen","Parameters","TypeParameterConstraints","TypeParameters","getMethodModifier","InterfaceMethod","props","methodSymbol","name","refkeys","refkey","methodScope","modifiers","_$createComponent","symbol","children","value","doc","attributes","endline","_$memo","returns","typeParameters","parameters","newline"],"sources":["../../../../src/components/interface/method.tsx"],"sourcesContent":[null],"mappings":";AAAA,SACEA,KAAK,EAELC,iBAAiB,EACjBC,UAAU,EAEVC,KAAK,QACA,gBAAgB;AACvB,SAEEC,sBAAsB,EACtBC,iBA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