@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
|
@@ -3,7 +3,6 @@ import { 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 { InterfaceMethod } from "./method.js";
|
|
9
8
|
const Wrapper = props => _$createComponent(TestNamespace, {
|
|
@@ -31,7 +30,7 @@ describe("modifiers", () => {
|
|
|
31
30
|
})).toRenderTo(`
|
|
32
31
|
public interface TestInterface
|
|
33
32
|
{
|
|
34
|
-
|
|
33
|
+
${accessModifier} void MethodOne();
|
|
35
34
|
}
|
|
36
35
|
`);
|
|
37
36
|
});
|
|
@@ -49,7 +48,7 @@ describe("modifiers", () => {
|
|
|
49
48
|
})).toRenderTo(`
|
|
50
49
|
public interface TestInterface
|
|
51
50
|
{
|
|
52
|
-
|
|
51
|
+
${methodModifier} void MethodOne();
|
|
53
52
|
}
|
|
54
53
|
`);
|
|
55
54
|
});
|
|
@@ -67,7 +66,7 @@ describe("modifiers", () => {
|
|
|
67
66
|
})).toRenderTo(`
|
|
68
67
|
public interface TestInterface
|
|
69
68
|
{
|
|
70
|
-
|
|
69
|
+
public new Task MethodOne();
|
|
71
70
|
}
|
|
72
71
|
`);
|
|
73
72
|
});
|
|
@@ -82,7 +81,7 @@ it("applies PascalCase naming policy", () => {
|
|
|
82
81
|
})).toRenderTo(`
|
|
83
82
|
public interface TestInterface
|
|
84
83
|
{
|
|
85
|
-
|
|
84
|
+
void MethodOne();
|
|
86
85
|
}
|
|
87
86
|
`);
|
|
88
87
|
});
|
|
@@ -107,7 +106,7 @@ it("defines params and return type", () => {
|
|
|
107
106
|
expect(res).toRenderTo(`
|
|
108
107
|
public interface TestInterface
|
|
109
108
|
{
|
|
110
|
-
|
|
109
|
+
public string MethodOne(int intParam, string stringParam);
|
|
111
110
|
}
|
|
112
111
|
`);
|
|
113
112
|
});
|
|
@@ -129,7 +128,7 @@ it("defines optional param", () => {
|
|
|
129
128
|
expect(res).toRenderTo(`
|
|
130
129
|
public interface TestInterface
|
|
131
130
|
{
|
|
132
|
-
|
|
131
|
+
public string MethodOne(int? intParam);
|
|
133
132
|
}
|
|
134
133
|
`);
|
|
135
134
|
});
|
|
@@ -151,7 +150,7 @@ it("defines optional param with default", () => {
|
|
|
151
150
|
expect(res).toRenderTo(`
|
|
152
151
|
public interface TestInterface
|
|
153
152
|
{
|
|
154
|
-
|
|
153
|
+
public string MethodOne(int intParam = 12);
|
|
155
154
|
}
|
|
156
155
|
`);
|
|
157
156
|
});
|
|
@@ -171,8 +170,8 @@ it("specify doc comment", () => {
|
|
|
171
170
|
})).toRenderTo(`
|
|
172
171
|
interface Test
|
|
173
172
|
{
|
|
174
|
-
|
|
175
|
-
|
|
173
|
+
/// This is a test
|
|
174
|
+
void Method();
|
|
176
175
|
}
|
|
177
176
|
`);
|
|
178
177
|
});
|
|
@@ -191,8 +190,8 @@ it("specify attributes", () => {
|
|
|
191
190
|
})).toRenderTo(`
|
|
192
191
|
public interface TestInterface
|
|
193
192
|
{
|
|
194
|
-
|
|
195
|
-
|
|
193
|
+
[Test]
|
|
194
|
+
void Test();
|
|
196
195
|
}
|
|
197
196
|
`);
|
|
198
197
|
});
|
|
@@ -207,39 +206,31 @@ describe("with type parameters", () => {
|
|
|
207
206
|
}];
|
|
208
207
|
expect(_$createComponent(TestNamespace, {
|
|
209
208
|
get children() {
|
|
210
|
-
return _$createComponent(
|
|
211
|
-
|
|
209
|
+
return _$createComponent(InterfaceDeclaration, {
|
|
210
|
+
"public": true,
|
|
211
|
+
name: "TestInterface",
|
|
212
212
|
get children() {
|
|
213
|
-
return _$createComponent(
|
|
213
|
+
return _$createComponent(InterfaceMethod, {
|
|
214
|
+
name: "Test",
|
|
214
215
|
"public": true,
|
|
215
|
-
|
|
216
|
-
get
|
|
217
|
-
return
|
|
218
|
-
name: "
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
type: typeParameters[0].refkey
|
|
225
|
-
}];
|
|
226
|
-
},
|
|
227
|
-
get returns() {
|
|
228
|
-
return typeParameters[0].refkey;
|
|
229
|
-
}
|
|
230
|
-
});
|
|
216
|
+
typeParameters: typeParameters,
|
|
217
|
+
get parameters() {
|
|
218
|
+
return [{
|
|
219
|
+
name: "paramA",
|
|
220
|
+
type: typeParameters[0].refkey
|
|
221
|
+
}];
|
|
222
|
+
},
|
|
223
|
+
get returns() {
|
|
224
|
+
return typeParameters[0].refkey;
|
|
231
225
|
}
|
|
232
226
|
});
|
|
233
227
|
}
|
|
234
228
|
});
|
|
235
229
|
}
|
|
236
230
|
})).toRenderTo(`
|
|
237
|
-
|
|
231
|
+
public interface TestInterface
|
|
238
232
|
{
|
|
239
|
-
public
|
|
240
|
-
{
|
|
241
|
-
public T Test<T, U>(T paramA);
|
|
242
|
-
}
|
|
233
|
+
public T Test<T, U>(T paramA);
|
|
243
234
|
}
|
|
244
235
|
`);
|
|
245
236
|
});
|
|
@@ -263,12 +254,12 @@ describe("with type parameters", () => {
|
|
|
263
254
|
})).toRenderTo(`
|
|
264
255
|
public interface TestInterface
|
|
265
256
|
{
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
257
|
+
public void Test<T, U>()
|
|
258
|
+
where T : IFoo
|
|
259
|
+
where U : IBar
|
|
260
|
+
{
|
|
261
|
+
// Body
|
|
262
|
+
}
|
|
272
263
|
}
|
|
273
264
|
`);
|
|
274
265
|
});
|
|
@@ -282,19 +273,20 @@ describe("formatting", () => {
|
|
|
282
273
|
name: "Handle",
|
|
283
274
|
parameters: [{
|
|
284
275
|
name: "message",
|
|
285
|
-
type: "Some.Quite.Long.Type.That.Will.Split"
|
|
276
|
+
type: "Some.Quite.Long.Type.That.Will.Split.At.One.Hundred.Chars.Line.Width"
|
|
286
277
|
}],
|
|
287
278
|
typeParameters: ["T"],
|
|
288
|
-
returns: "Some.Quite.Long.Type.That.Will.Split"
|
|
279
|
+
returns: "Some.Quite.Long.Type.That.Will.Split.At.One.Hundred.Chars.Line.Width"
|
|
289
280
|
});
|
|
290
281
|
}
|
|
291
282
|
})).toRenderTo(`
|
|
292
283
|
public interface TestInterface
|
|
293
284
|
{
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
285
|
+
public Some.Quite.Long.Type.That.Will.Split.At.One.Hundred.Chars.Line.Width Handle<T>(
|
|
286
|
+
Some.Quite.Long.Type.That.Will.Split.At.One.Hundred.Chars.Line.Width message
|
|
287
|
+
);
|
|
297
288
|
}
|
|
298
289
|
`);
|
|
299
290
|
});
|
|
300
|
-
});
|
|
291
|
+
});
|
|
292
|
+
//# sourceMappingURL=method.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["refkey","describe","expect","it","TestNamespace","Attribute","InterfaceDeclaration","InterfaceMethod","Wrapper","props","_$createComponent","children","name","each","accessModifier","_$mergeProps","toRenderTo","methodModifier","returns","params","type","res","parameters","optional","default","doc","attributes","typeParameters","constraints"],"sources":["../../../../src/components/interface/method.test.tsx"],"sourcesContent":[null],"mappings":";AAAA,SAASA,MAAM,QAAQ,gBAAgB;AAEvC,SAASC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AAC7C,SAASC,aAAa;AACtB,SAASC,SAAS;AAElB,SAASC,oBAAoB;AAC7B,SAASC,eAAe;AAExB,MAAMC,OAAO,GAAIC,KAA6B,IAAAC,iBAAA,CAC3CN,aAAa;EAAA,IAAAO,SAAA;IAAA,OAAAD,iBAAA,CACXJ,oBAAoB;MAAA;MAAQM,IAAI;MAAA,IAAAD,SAAA;QAAA,OAC9BF,KAAK,CAACE,QAAQ;MAAA;IAAA;EAAA;AAAA,EAGpB;AAEDV,QAAQ,CAAC,WAAW,EAAE,MAAM;EAC1BA,QAAQ,CAAC,kBAAkB,EAAE,MAAM;IACjCE,EA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EAAE,SAAS;YACfQ,IAAI,EAAE;UACR,CAAC,CACF;UACDO,cAAc,EAAE,CAAC,GAAG,CAAC;UACrBT,OAAO;QAAA;MAAA;IAAA,EAGb,CAAC,CAACF,UAAU,CAAC;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"property.d.ts","sourceRoot":"","sources":["../../../../src/components/interface/property.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAIR,MAAM,
|
|
1
|
+
{"version":3,"file":"property.d.ts","sourceRoot":"","sources":["../../../../src/components/interface/property.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAIR,MAAM,EACP,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,eAAe,EAIhB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAiB,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAG7E,yCAAyC;AACzC,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC;CACxB;AAKD,MAAM,WAAW,sBACf,SAAQ,eAAe,EACrB,0BAA0B;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,oBAAoB;IACpB,IAAI,EAAE,QAAQ,CAAC;IAEf,uCAAuC;IACvC,GAAG,CAAC,EAAE,OAAO,CAAC;IAEd,uCAAuC;IACvC,GAAG,CAAC,EAAE,OAAO,CAAC;IAEd,kBAAkB;IAClB,GAAG,CAAC,EAAE,QAAQ,CAAC;IAEf;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;;;;;;;;;;;;OAeG;IACH,UAAU,CAAC,EAAE,cAAc,CAAC;CAC7B;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,YAyB9D"}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { createComponent as _$createComponent, memo as _$memo } from "@alloy-js/core/jsx-runtime";
|
|
2
|
-
import { Block, List, MemberDeclaration,
|
|
2
|
+
import { Block, List, MemberDeclaration, MemberName } from "@alloy-js/core";
|
|
3
3
|
import { computeModifiersPrefix, getAccessModifier, makeModifiers } from "../../modifiers.js";
|
|
4
|
-
import {
|
|
5
|
-
import { CSharpOutputSymbol } from "../../symbols/csharp-output-symbol.js";
|
|
6
|
-
import { CSharpMemberScope, useCSharpScope } from "../../symbols/scopes.js";
|
|
4
|
+
import { createPropertySymbol } from "../../symbols/factories.js";
|
|
7
5
|
import { AttributeList } from "../attributes/attributes.js";
|
|
8
6
|
import { DocWhen } from "../doc/comment.js";
|
|
9
7
|
|
|
@@ -23,51 +21,36 @@ const getModifiers = makeModifiers(["new"]);
|
|
|
23
21
|
* ```
|
|
24
22
|
*/
|
|
25
23
|
export function InterfaceProperty(props) {
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
if (scope.kind !== "member" || scope.name !== "interface-decl") {
|
|
29
|
-
throw new Error("can't define an interface method outside of an interface scope");
|
|
30
|
-
}
|
|
31
|
-
const propertySymbol = new CSharpOutputSymbol(name, {
|
|
32
|
-
scope,
|
|
33
|
-
refkeys: props.refkey ?? refkey(props.name)
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
// scope for property declaration
|
|
37
|
-
const propertyScope = new CSharpMemberScope("property-decl", {
|
|
38
|
-
owner: propertySymbol
|
|
24
|
+
const propertySymbol = createPropertySymbol(props.name, {
|
|
25
|
+
refkeys: props.refkey
|
|
39
26
|
});
|
|
40
27
|
const modifiers = computeModifiersPrefix([getAccessModifier(props), getModifiers(props)]);
|
|
41
28
|
// note that scope wraps the method decl so that the params get the correct scope
|
|
42
29
|
return _$createComponent(MemberDeclaration, {
|
|
43
30
|
symbol: propertySymbol,
|
|
44
31
|
get children() {
|
|
45
|
-
return _$createComponent(
|
|
46
|
-
|
|
32
|
+
return [_$createComponent(DocWhen, {
|
|
33
|
+
get doc() {
|
|
34
|
+
return props.doc;
|
|
35
|
+
}
|
|
36
|
+
}), _$createComponent(AttributeList, {
|
|
37
|
+
get attributes() {
|
|
38
|
+
return props.attributes;
|
|
39
|
+
},
|
|
40
|
+
endline: true
|
|
41
|
+
}), modifiers, _$memo(() => props.type), _$memo(() => props.nullable && "?"), " ", _$createComponent(MemberName, {}), " ", _$createComponent(Block, {
|
|
42
|
+
newline: true,
|
|
43
|
+
inline: true,
|
|
47
44
|
get children() {
|
|
48
|
-
return
|
|
49
|
-
|
|
50
|
-
return props.doc;
|
|
51
|
-
}
|
|
52
|
-
}), _$createComponent(AttributeList, {
|
|
53
|
-
get attributes() {
|
|
54
|
-
return props.attributes;
|
|
55
|
-
},
|
|
56
|
-
endline: true
|
|
57
|
-
}), modifiers, _$memo(() => props.type), _$memo(() => props.nullable && "?"), " ", name, " ", _$createComponent(Block, {
|
|
58
|
-
newline: true,
|
|
59
|
-
inline: true,
|
|
45
|
+
return _$createComponent(List, {
|
|
46
|
+
joiner: " ",
|
|
60
47
|
get children() {
|
|
61
|
-
return _$
|
|
62
|
-
joiner: " ",
|
|
63
|
-
get children() {
|
|
64
|
-
return [_$memo(() => props.get && "get;"), _$memo(() => props.set && "set;")];
|
|
65
|
-
}
|
|
66
|
-
});
|
|
48
|
+
return [_$memo(() => props.get && "get;"), _$memo(() => props.set && "set;")];
|
|
67
49
|
}
|
|
68
|
-
})
|
|
50
|
+
});
|
|
69
51
|
}
|
|
70
|
-
});
|
|
52
|
+
})];
|
|
71
53
|
}
|
|
72
54
|
});
|
|
73
|
-
}
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=property.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Block","List","MemberDeclaration","MemberName","computeModifiersPrefix","getAccessModifier","makeModifiers","createPropertySymbol","AttributeList","DocWhen","getModifiers","InterfaceProperty","props","propertySymbol","name","refkeys","refkey","modifiers","_$createComponent","symbol","children","doc","attributes","endline","_$memo","type","nullable","newline","inline","joiner","get","set"],"sources":["../../../../src/components/interface/property.tsx"],"sourcesContent":[null],"mappings":";AAAA,SACEA,KAAK,EAELC,IAAI,EACJC,iBAAiB,EACjBC,UAAU,QAEL,gBAAgB;AACvB,SAEEC,sBAAsB,EACtBC,iBAAiB,EACjBC,aAAa,QACR,oBAAoB;AAC3B,SAASC,oBAAoB,QAAQ,4BAA4B;AACjE,SAASC,aAAa;AACtB,SAASC,OAAO;;AAEhB;;AAKA,MAAMC,YAAY,GAAGJ,aAAa,CAA6B,CAAC,KAAK,CAAC,CAAC;;AAEvE;;AAgDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASK,iBAAiBA,CAACC,KAA6B,EAAE;EAC/D,MAAMC,cAAc,GAAGN,oBAAoB,CAACK,KAAK,CAACE,IAAI,EAAE;IACtDC,OAAO,EAAEH,KAAK,CAACI;EACjB,CAAC,CAAC;EAEF,MAAMC,SAAS,GAAGb,sBAAsB,CAAC,CACvCC,iBAAiB,CAACO,KAAK,CAAC,EACxBF,YAAY,CAACE,KAAK,CAAC,CACpB,CAAC;EACF;EACA,OAAAM,iBAAA,CACGhB,iBAAiB;IAACiB,MAAM,EAAEN,cAAc;IAAA,IAAAO,SAAA;MAAA,QAAAF,iBAAA,CACtCT,OAAO;QAAA,IAACY,GAAGA,CAAA;UAAA,OAAET,KAAK,CAACS,GAAG;QAAA;MAAA,IAAAH,iBAAA,CACtBV,aAAa;QAAA,IAACc,UAAUA,CAAA;UAAA,OAAEV,KAAK,CAACU,UAAU;QAAA;QAAEC,OAAO;MAAA,IACnDN,SAAS,EAAAO,MAAA,OACTZ,KAAK,CAACa,IAAI,GAAAD,MAAA,OACVZ,KAAK,CAACc,QAAQ,IAAI,GAAG,QAAAR,iBAAA,CAAGf,UAAU,OAAI,GAAG,EAAAe,iBAAA,CACzClB,KAAK;QAAC2B,OAAO;QAACC,MAAM;QAAA,IAAAR,SAAA;UAAA,OAAAF,iBAAA,CAClBjB,IAAI;YAAC4B,MAAM;YAAA,IAAAT,SAAA;cAAA,QAAAI,MAAA,OACTZ,KAAK,CAACkB,GAAG,IAAI,MAAM,GAAAN,MAAA,OACnBZ,KAAK,CAACmB,GAAG,IAAI,MAAM;YAAA;UAAA;QAAA;MAAA;IAAA;EAAA;AAK9B","ignoreList":[]}
|
|
@@ -31,7 +31,7 @@ describe("modifiers", () => {
|
|
|
31
31
|
})).toRenderTo(`
|
|
32
32
|
public interface TestInterface
|
|
33
33
|
{
|
|
34
|
-
|
|
34
|
+
${accessModifier} string TestProp { get; }
|
|
35
35
|
}
|
|
36
36
|
`);
|
|
37
37
|
});
|
|
@@ -51,7 +51,7 @@ describe("modifiers", () => {
|
|
|
51
51
|
})).toRenderTo(`
|
|
52
52
|
public interface TestInterface
|
|
53
53
|
{
|
|
54
|
-
|
|
54
|
+
${methodModifier} string TestProp { get; }
|
|
55
55
|
}
|
|
56
56
|
`);
|
|
57
57
|
});
|
|
@@ -70,7 +70,7 @@ describe("modifiers", () => {
|
|
|
70
70
|
})).toRenderTo(`
|
|
71
71
|
public interface TestInterface
|
|
72
72
|
{
|
|
73
|
-
|
|
73
|
+
public new string TestProp { get; }
|
|
74
74
|
}
|
|
75
75
|
`);
|
|
76
76
|
});
|
|
@@ -87,7 +87,7 @@ it("applies PascalCase naming policy", () => {
|
|
|
87
87
|
})).toRenderTo(`
|
|
88
88
|
public interface TestInterface
|
|
89
89
|
{
|
|
90
|
-
|
|
90
|
+
string TestProp { get; }
|
|
91
91
|
}
|
|
92
92
|
`);
|
|
93
93
|
});
|
|
@@ -103,7 +103,7 @@ it("has getter only", () => {
|
|
|
103
103
|
})).toRenderTo(`
|
|
104
104
|
public interface TestInterface
|
|
105
105
|
{
|
|
106
|
-
|
|
106
|
+
string TestProp { get; }
|
|
107
107
|
}
|
|
108
108
|
`);
|
|
109
109
|
});
|
|
@@ -119,7 +119,7 @@ it("has setter only", () => {
|
|
|
119
119
|
})).toRenderTo(`
|
|
120
120
|
public interface TestInterface
|
|
121
121
|
{
|
|
122
|
-
|
|
122
|
+
string TestProp { set; }
|
|
123
123
|
}
|
|
124
124
|
`);
|
|
125
125
|
});
|
|
@@ -136,7 +136,7 @@ it("has getter and setter", () => {
|
|
|
136
136
|
})).toRenderTo(`
|
|
137
137
|
public interface TestInterface
|
|
138
138
|
{
|
|
139
|
-
|
|
139
|
+
string TestProp { get; set; }
|
|
140
140
|
}
|
|
141
141
|
`);
|
|
142
142
|
});
|
|
@@ -159,8 +159,8 @@ it("specify doc comment", () => {
|
|
|
159
159
|
})).toRenderTo(`
|
|
160
160
|
interface Test
|
|
161
161
|
{
|
|
162
|
-
|
|
163
|
-
|
|
162
|
+
/// This is a test
|
|
163
|
+
string Method { get; set; }
|
|
164
164
|
}
|
|
165
165
|
`);
|
|
166
166
|
});
|
|
@@ -182,8 +182,9 @@ it("specify attributes", () => {
|
|
|
182
182
|
})).toRenderTo(`
|
|
183
183
|
public interface TestInterface
|
|
184
184
|
{
|
|
185
|
-
|
|
186
|
-
|
|
185
|
+
[Test]
|
|
186
|
+
int Test { get; set; }
|
|
187
187
|
}
|
|
188
188
|
`);
|
|
189
|
-
});
|
|
189
|
+
});
|
|
190
|
+
//# sourceMappingURL=property.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["describe","expect","it","TestNamespace","Attribute","InterfaceDeclaration","InterfaceProperty","Wrapper","props","_$createComponent","children","name","each","accessModifier","_$mergeProps","type","get","toRenderTo","methodModifier","set","doc","attributes"],"sources":["../../../../src/components/interface/property.test.tsx"],"sourcesContent":[null],"mappings":";AACA,SAASA,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AAC7C,SAASC,aAAa;AACtB,SAASC,SAAS;AAClB,SAASC,oBAAoB;AAC7B,SAASC,iBAAiB;AAE1B,MAAMC,OAAO,GAAIC,KAA6B,IAAAC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AI;QAAUC,GAAG;QAACG,GAAG;MAAA;IAAA;EAAA,EAE5D,CAAC,CAACF,UAAU,CAAC;AACf;AACA;AACA;AACA;AACA,GAAG,CAAC;AACJ,CAAC,CAAC;AAEFf,EAAE,CAAC,qBAAqB,EAAE,MAAM;EAC9BD,MAAM,CAAAQ,iBAAA,CACHN,aAAa;IAAA,IAAAO,SAAA;MAAA,OAAAD,iBAAA,CACXJ,oBAAoB;QAACM,IAAI;QAAA,IAAAD,SAAA;UAAA,OAAAD,iBAAA,CACvBH,iBAAiB;YAChBK,IAAI;YACJI,IAAI;YACJC,GAAG;YACHG,GAAG;YACHC,GAAG;UAAA;QAAA;MAAA;IAAA;EAAA,EAIX,CAAC,CAACH,UAAU,CAAC;AACf;AACA;AACA;AACA;AACA;AACA,GAAG,CAAC;AACJ,CAAC,CAAC;AAEFf,EAAE,CAAC,oBAAoB,EAAE,MAAM;EAC7BD,MAAM,CAAAQ,iBAAA,CACHF,OAAO;IAAA,IAAAG,SAAA;MAAA,OAAAD,iBAAA,CACLH,iBAAiB;QAChBK,IAAI;QACJI,IAAI;QAAA,IACJM,UAAUA,CAAA;UAAA,OAAE,CAAAZ,iBAAA,CAAEL,SAAS;YAACO,IAAI;UAAA,GAAW;QAAA;QACvCK,GAAG;QACHG,GAAG;MAAA;IAAA;EAAA,EAGT,CAAC,CAACF,UAAU,CAAC;AACf;AACA;AACA;AACA;AACA;AACA,GAAG,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Children } from "@alloy-js/core";
|
|
2
|
+
export interface InvocationExpressionProps {
|
|
3
|
+
target: Children;
|
|
4
|
+
/**
|
|
5
|
+
* Arguments to pass to the invocation.
|
|
6
|
+
*/
|
|
7
|
+
args?: Children[];
|
|
8
|
+
/**
|
|
9
|
+
* Generic type arguments for the invocation.
|
|
10
|
+
*/
|
|
11
|
+
typeArgs?: Children[];
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* A call to a function or method.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
*
|
|
18
|
+
* ```jsx
|
|
19
|
+
* <InvocationExpression target="Foo" typeArgs={["T"]} args={["x"]} />
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* Renders to:
|
|
23
|
+
*
|
|
24
|
+
* ```csharp
|
|
25
|
+
* Foo<T>("x");
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export declare function InvocationExpression(props: InvocationExpressionProps): Children;
|
|
29
|
+
//# sourceMappingURL=invocation-expression.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invocation-expression.d.ts","sourceRoot":"","sources":["../../../../src/components/invocation-expression/invocation-expression.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAA2B,MAAM,gBAAgB,CAAC;AAEnE,MAAM,WAAW,yBAAyB;IACxC,MAAM,EAAE,QAAQ,CAAC;IACjB;;OAEG;IACH,IAAI,CAAC,EAAE,QAAQ,EAAE,CAAC;IAClB;;OAEG;IACH,QAAQ,CAAC,EAAE,QAAQ,EAAE,CAAC;CACvB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,YA8BpE"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { memo as _$memo, createComponent as _$createComponent, createIntrinsic as _$createIntrinsic } from "@alloy-js/core/jsx-runtime";
|
|
2
|
+
import { For, Indent, Show, Wrap } from "@alloy-js/core";
|
|
3
|
+
/**
|
|
4
|
+
* A call to a function or method.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
*
|
|
8
|
+
* ```jsx
|
|
9
|
+
* <InvocationExpression target="Foo" typeArgs={["T"]} args={["x"]} />
|
|
10
|
+
* ```
|
|
11
|
+
*
|
|
12
|
+
* Renders to:
|
|
13
|
+
*
|
|
14
|
+
* ```csharp
|
|
15
|
+
* Foo<T>("x");
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export function InvocationExpression(props) {
|
|
19
|
+
return _$createIntrinsic("group", {
|
|
20
|
+
get children() {
|
|
21
|
+
return [_$memo(() => props.target), _$createComponent(Show, {
|
|
22
|
+
get when() {
|
|
23
|
+
return !!props.typeArgs && props.typeArgs.length > 0;
|
|
24
|
+
},
|
|
25
|
+
get children() {
|
|
26
|
+
return ["<", _$createComponent(Wrap, {
|
|
27
|
+
get when() {
|
|
28
|
+
return props.typeArgs.length > 1;
|
|
29
|
+
},
|
|
30
|
+
"with": Indent,
|
|
31
|
+
props: {
|
|
32
|
+
softline: true,
|
|
33
|
+
trailingBreak: true
|
|
34
|
+
},
|
|
35
|
+
get children() {
|
|
36
|
+
return _$createComponent(For, {
|
|
37
|
+
get each() {
|
|
38
|
+
return props.typeArgs ?? [];
|
|
39
|
+
},
|
|
40
|
+
comma: true,
|
|
41
|
+
line: true,
|
|
42
|
+
children: typeArg => typeArg
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}), ">"];
|
|
46
|
+
}
|
|
47
|
+
}), "(", _$createComponent(Wrap, {
|
|
48
|
+
get when() {
|
|
49
|
+
return !!props.args && props.args.length > 1;
|
|
50
|
+
},
|
|
51
|
+
"with": Indent,
|
|
52
|
+
props: {
|
|
53
|
+
softline: true,
|
|
54
|
+
trailingBreak: true
|
|
55
|
+
},
|
|
56
|
+
get children() {
|
|
57
|
+
return _$createComponent(For, {
|
|
58
|
+
get each() {
|
|
59
|
+
return props.args ?? [];
|
|
60
|
+
},
|
|
61
|
+
comma: true,
|
|
62
|
+
line: true,
|
|
63
|
+
children: arg => arg
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}), ")"];
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=invocation-expression.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["For","Indent","Show","Wrap","InvocationExpression","props","_$createIntrinsic","children","_$memo","target","_$createComponent","when","typeArgs","length","softline","trailingBreak","each","comma","line","typeArg","args","arg"],"sources":["../../../../src/components/invocation-expression/invocation-expression.tsx"],"sourcesContent":[null],"mappings":";AAAA,SAAmBA,GAAG,EAAEC,MAAM,EAAEC,IAAI,EAAEC,IAAI,QAAQ,gBAAgB;AAclE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,oBAAoBA,CAACC,KAAgC,EAAE;EACrE,OAAAC,iBAAA;IAAA,IAAAC,SAAA;MAAA,QAAAC,MAAA,OAEKH,KAAK,CAACI,MAAM,GAAAC,iBAAA,CACZR,IAAI;QAAA,IAACS,IAAIA,CAAA;UAAA,OAAE,CAAC,CAACN,KAAK,CAACO,QAAQ,IAAIP,KAAK,CAACO,QAAQ,CAACC,MAAM,GAAG,CAAC;QAAA;QAAA,IAAAN,SAAA;UAAA,QACtD,GAAG,EAAAG,iBAAA,CACHP,IAAI;YAAA,IACHQ,IAAIA,CAAA;cAAA,OAAEN,KAAK,CAACO,QAAQ,CAAEC,MAAM,GAAG,CAAC;YAAA;YAAA,QAC1BZ,MAAM;YACZI,KAAK,EAAE;cAAES,QAAQ,EAAE,IAAI;cAAEC,aAAa,EAAE;YAAK,CAAC;YAAA,IAAAR,SAAA;cAAA,OAAAG,iBAAA,CAE7CV,GAAG;gBAAA,IAACgB,IAAIA,CAAA;kBAAA,OAAEX,KAAK,CAACO,QAAQ,IAAI,EAAE;gBAAA;gBAAEK,KAAK;gBAACC,IAAI;gBAAAX,QAAA,EACvCY,OAAO,IAAKA;cAAO;YAAA;UAAA,IAGxB,GAAG;QAAA;MAAA,SAAAT,iBAAA,CAGLP,IAAI;QAAA,IACHQ,IAAIA,CAAA;UAAA,OAAE,CAAC,CAACN,KAAK,CAACe,IAAI,IAAIf,KAAK,CAACe,IAAI,CAACP,MAAM,GAAG,CAAC;QAAA;QAAA,QACrCZ,MAAM;QACZI,KAAK,EAAE;UAAES,QAAQ,EAAE,IAAI;UAAEC,aAAa,EAAE;QAAK,CAAC;QAAA,IAAAR,SAAA;UAAA,OAAAG,iBAAA,CAE7CV,GAAG;YAAA,IAACgB,IAAIA,CAAA;cAAA,OAAEX,KAAK,CAACe,IAAI,IAAI,EAAE;YAAA;YAAEH,KAAK;YAACC,IAAI;YAAAX,QAAA,EACnCc,GAAG,IAAKA;UAAG;QAAA;MAAA;IAAA;EAAA;AAMvB","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invocation-expression.test.d.ts","sourceRoot":"","sources":["../../../../src/components/invocation-expression/invocation-expression.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { createComponent as _$createComponent, createIntrinsic as _$createIntrinsic } from "@alloy-js/core/jsx-runtime";
|
|
2
|
+
import { ClassDeclaration } from "#components/class/declaration.js";
|
|
3
|
+
import { Method } from "#components/method/method.js";
|
|
4
|
+
import { TestNamespace } from "#test/utils.js";
|
|
5
|
+
import { namekey } from "@alloy-js/core";
|
|
6
|
+
import { describe, expect, it } from "vitest";
|
|
7
|
+
import { InvocationExpression } from "./invocation-expression.js";
|
|
8
|
+
it("makes a call with no arguments", () => {
|
|
9
|
+
const template = _$createComponent(InvocationExpression, {
|
|
10
|
+
target: "Foo"
|
|
11
|
+
});
|
|
12
|
+
expect(template).toRenderTo(`Foo()`);
|
|
13
|
+
});
|
|
14
|
+
it("makes a call with arguments", () => {
|
|
15
|
+
const template = _$createComponent(InvocationExpression, {
|
|
16
|
+
target: "Foo",
|
|
17
|
+
args: ["42", `"string"`]
|
|
18
|
+
});
|
|
19
|
+
expect(template).toRenderTo(`Foo(42, "string")`);
|
|
20
|
+
});
|
|
21
|
+
it("makes a call with type parameters", () => {
|
|
22
|
+
const template = _$createComponent(InvocationExpression, {
|
|
23
|
+
target: "Foo",
|
|
24
|
+
typeArgs: ["Bar", "Baz"]
|
|
25
|
+
});
|
|
26
|
+
expect(template).toRenderTo(`Foo<Bar, Baz>()`);
|
|
27
|
+
});
|
|
28
|
+
it("makes a call to a method", () => {
|
|
29
|
+
const cls = namekey("TestClass");
|
|
30
|
+
const method = namekey("Method");
|
|
31
|
+
const template = _$createComponent(TestNamespace, {
|
|
32
|
+
get children() {
|
|
33
|
+
return [_$createComponent(ClassDeclaration, {
|
|
34
|
+
name: cls,
|
|
35
|
+
get children() {
|
|
36
|
+
return _$createComponent(Method, {
|
|
37
|
+
name: method,
|
|
38
|
+
children: "return 1;"
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}), _$createIntrinsic("hbr", {}), _$createComponent(InvocationExpression, {
|
|
42
|
+
target: method
|
|
43
|
+
}), ";"];
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
expect(template).toRenderTo(`
|
|
47
|
+
class TestClass
|
|
48
|
+
{
|
|
49
|
+
void Method()
|
|
50
|
+
{
|
|
51
|
+
return 1;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
TestClass.Method();
|
|
55
|
+
`);
|
|
56
|
+
});
|
|
57
|
+
describe("formatting", () => {
|
|
58
|
+
it("doesn't break one long argument", () => {
|
|
59
|
+
const template = _$createComponent(InvocationExpression, {
|
|
60
|
+
target: "Foo",
|
|
61
|
+
args: ["oneLongArgument"]
|
|
62
|
+
});
|
|
63
|
+
expect(template).toRenderTo(`Foo(oneLongArgument)`, {
|
|
64
|
+
printWidth: 10
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
it("breaks multiple arguments", () => {
|
|
68
|
+
const template = _$createComponent(InvocationExpression, {
|
|
69
|
+
target: "Foo",
|
|
70
|
+
args: ["oneLongArgument", "anotherLongArgument"]
|
|
71
|
+
});
|
|
72
|
+
expect(template).toRenderTo(`
|
|
73
|
+
Foo(
|
|
74
|
+
oneLongArgument,
|
|
75
|
+
anotherLongArgument
|
|
76
|
+
)
|
|
77
|
+
`, {
|
|
78
|
+
printWidth: 10
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
it("doesn't break one long type argument", () => {
|
|
82
|
+
const template = _$createComponent(InvocationExpression, {
|
|
83
|
+
target: "Foo",
|
|
84
|
+
typeArgs: ["oneLongArgument"]
|
|
85
|
+
});
|
|
86
|
+
expect(template).toRenderTo(`Foo<oneLongArgument>()`, {
|
|
87
|
+
printWidth: 10
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
it("breaks multiple type arguments", () => {
|
|
91
|
+
const template = _$createComponent(InvocationExpression, {
|
|
92
|
+
target: "Foo",
|
|
93
|
+
typeArgs: ["oneLongArgument", "anotherLongArgument"]
|
|
94
|
+
});
|
|
95
|
+
expect(template).toRenderTo(`
|
|
96
|
+
Foo<
|
|
97
|
+
oneLongArgument,
|
|
98
|
+
anotherLongArgument
|
|
99
|
+
>()
|
|
100
|
+
`, {
|
|
101
|
+
printWidth: 10
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
//# sourceMappingURL=invocation-expression.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ClassDeclaration","Method","TestNamespace","namekey","describe","expect","it","InvocationExpression","template","_$createComponent","target","toRenderTo","args","typeArgs","cls","method","children","name","_$createIntrinsic","printWidth"],"sources":["../../../../src/components/invocation-expression/invocation-expression.test.tsx"],"sourcesContent":[null],"mappings":";AAAA,SAASA,gBAAgB;AACzB,SAASC,MAAM;AACf,SAASC,aAAa;AACtB,SAASC,OAAO,QAAQ,gBAAgB;AACxC,SAASC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AAC7C,SAASC,oBAAoB;AAE7BD,EAAE,CAAC,gCAAgC,EAAE,MAAM;EACzC,MAAME,QAAQ,GAAAC,iBAAA,CAAIF,oBAAoB;IAACG,MAAM;EAAA,EAAS;EACtDL,MAAM,CAACG,QAAQ,CAAC,CAACG,UAAU,CAAC,OAAO,CAAC;AACtC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AAOE,IAAI,EAAE,CAAC,iBAAiB;IAAC,EAC7D;IACDP,MAAM,CAACG,QAAQ,CAAC,CAACG,UAAU,CAAC,sBAAsB,EAAE;MAAEQ,UAAU,EAAE;IAAG,CAAC,CAAC;EACzE,CAAC,CAAC;EAEFb,EAAE,CAAC,2BAA2B,EAAE,MAAM;IACpC,MAAME,QAAQ,GAAAC,iBAAA,CACXF,oBAAoB;MACnBG,MAAM;MACNE,IAAI,EAAE,CAAC,iBAAiB,EAAE,qBAAqB;IAAC,EAEnD;IACDP,MAAM,CAACG,QAAQ,CAAC,CAACG,UAAU,CACzB;AACN;AACA;AACA;AACA;AACA,OAAO,EACD;MAAEQ,UAAU,EAAE;IAAG,CACnB,CAAC;EACH,CAAC,CAAC;EAEFb,EAAE,CAAC,sCAAsC,EAAE,MAAM;IAC/C,MAAME,QAAQ,GAAAC,iBAAA,CACXF,oBAAoB;MAACG,MAAM;MAAOG,QAAQ,EAAE,CAAC,iBAAiB;IAAC,EACjE;IACDR,MAAM,CAACG,QAAQ,CAAC,CAACG,UAAU,CAAC,wBAAwB,EAAE;MAAEQ,UAAU,EAAE;IAAG,CAAC,CAAC;EAC3E,CAAC,CAAC;EAEFb,EAAE,CAAC,gCAAgC,EAAE,MAAM;IACzC,MAAME,QAAQ,GAAAC,iBAAA,CACXF,oBAAoB;MACnBG,MAAM;MACNG,QAAQ,EAAE,CAAC,iBAAiB,EAAE,qBAAqB;IAAC,EAEvD;IACDR,MAAM,CAACG,QAAQ,CAAC,CAACG,UAAU,CACzB;AACN;AACA;AACA;AACA;AACA,OAAO,EACD;MAAEQ,UAAU,EAAE;IAAG,CACnB,CAAC;EACH,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ScopePropsWithInfo, ScopePropsWithValue } from "@alloy-js/core";
|
|
2
|
+
export interface LexicalScopePropsWithScopeValue extends ScopePropsWithValue {
|
|
3
|
+
}
|
|
4
|
+
export interface LeixcalScopePropsWithScopeInfo extends ScopePropsWithInfo {
|
|
5
|
+
}
|
|
6
|
+
export type LexicalScopeProps = LexicalScopePropsWithScopeValue | LeixcalScopePropsWithScopeInfo;
|
|
7
|
+
export declare function LexicalScope(props: LexicalScopeProps): import("@alloy-js/core").Children;
|
|
8
|
+
//# sourceMappingURL=lexical-scope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lexical-scope.d.ts","sourceRoot":"","sources":["../../../src/components/lexical-scope.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAS,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAIhF,MAAM,WAAW,+BAAgC,SAAQ,mBAAmB;CAAG;AAC/E,MAAM,WAAW,8BAA+B,SAAQ,kBAAkB;CAAG;AAE7E,MAAM,MAAM,iBAAiB,GACzB,+BAA+B,GAC/B,8BAA8B,CAAC;AAEnC,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,qCAiBpD"}
|