@alloy-js/csharp 0.20.0-dev.3 → 0.20.0-dev.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/components/Declaration.d.ts +2 -2
- package/dist/src/components/Declaration.d.ts.map +1 -1
- package/dist/src/components/Declaration.js +5 -14
- package/dist/src/components/Declaration.js.map +1 -0
- package/dist/src/components/Name.js +2 -1
- package/dist/src/components/Name.js.map +1 -0
- package/dist/src/components/ProjectDirectory.js +2 -1
- package/dist/src/components/ProjectDirectory.js.map +1 -0
- package/dist/src/components/Reference.d.ts.map +1 -1
- package/dist/src/components/Reference.js +7 -2
- package/dist/src/components/Reference.js.map +1 -0
- package/dist/src/components/SourceFile.d.ts +8 -9
- package/dist/src/components/SourceFile.d.ts.map +1 -1
- package/dist/src/components/SourceFile.js +71 -46
- package/dist/src/components/SourceFile.js.map +1 -0
- package/dist/src/components/UsingDirective.d.ts +5 -1
- package/dist/src/components/UsingDirective.d.ts.map +1 -1
- package/dist/src/components/UsingDirective.js +5 -2
- package/dist/src/components/UsingDirective.js.map +1 -0
- package/dist/src/components/attributes/attributes.js +2 -1
- package/dist/src/components/attributes/attributes.js.map +1 -0
- package/dist/src/components/attributes/attributes.test.js +2 -1
- package/dist/src/components/attributes/attributes.test.js.map +1 -0
- package/dist/src/components/class/declaration.d.ts +2 -2
- package/dist/src/components/class/declaration.d.ts.map +1 -1
- package/dist/src/components/class/declaration.js +20 -33
- package/dist/src/components/class/declaration.js.map +1 -0
- package/dist/src/components/class/declaration.test.js +173 -194
- package/dist/src/components/class/declaration.test.js.map +1 -0
- package/dist/src/components/constructor/constructor.d.ts.map +1 -1
- package/dist/src/components/constructor/constructor.js +13 -17
- package/dist/src/components/constructor/constructor.js.map +1 -0
- package/dist/src/components/constructor/constructor.test.js +12 -20
- package/dist/src/components/constructor/constructor.test.js.map +1 -0
- package/dist/src/components/doc/comment.js +2 -1
- package/dist/src/components/doc/comment.js.map +1 -0
- package/dist/src/components/doc/comment.test.js +2 -1
- package/dist/src/components/doc/comment.test.js.map +1 -0
- package/dist/src/components/doc/from-markdown.js +2 -1
- package/dist/src/components/doc/from-markdown.js.map +1 -0
- package/dist/src/components/doc/from-markdown.test.js +2 -1
- package/dist/src/components/doc/from-markdown.test.js.map +1 -0
- package/dist/src/components/{EnumDeclaration.d.ts → enum/declaration.d.ts} +6 -11
- package/dist/src/components/enum/declaration.d.ts.map +1 -0
- package/dist/src/components/enum/declaration.js +55 -0
- package/dist/src/components/enum/declaration.js.map +1 -0
- package/dist/src/components/enum/declaration.ref.test.d.ts +2 -0
- package/dist/src/components/enum/declaration.ref.test.d.ts.map +1 -0
- package/dist/src/components/enum/declaration.ref.test.js +121 -0
- package/dist/src/components/enum/declaration.ref.test.js.map +1 -0
- package/dist/src/components/enum/declaration.test.d.ts +2 -0
- package/dist/src/components/enum/declaration.test.d.ts.map +1 -0
- package/dist/src/components/enum/declaration.test.js +40 -0
- package/dist/src/components/enum/declaration.test.js.map +1 -0
- package/dist/src/components/enum/member.d.ts +7 -0
- package/dist/src/components/enum/member.d.ts.map +1 -0
- package/dist/src/components/enum/member.js +30 -0
- package/dist/src/components/enum/member.js.map +1 -0
- package/dist/src/components/enum/member.test.d.ts +2 -0
- package/dist/src/components/enum/member.test.d.ts.map +1 -0
- package/dist/src/components/enum/member.test.js +29 -0
- package/dist/src/components/enum/member.test.js.map +1 -0
- package/dist/src/components/field/field.d.ts.map +1 -1
- package/dist/src/components/field/field.js +11 -15
- package/dist/src/components/field/field.js.map +1 -0
- package/dist/src/components/field/field.test.js +9 -8
- package/dist/src/components/field/field.test.js.map +1 -0
- package/dist/src/components/index.d.ts +5 -2
- package/dist/src/components/index.d.ts.map +1 -1
- package/dist/src/components/index.js +7 -3
- package/dist/src/components/index.js.map +1 -0
- package/dist/src/components/interface/declaration.d.ts.map +1 -1
- package/dist/src/components/interface/declaration.js +21 -22
- package/dist/src/components/interface/declaration.js.map +1 -0
- package/dist/src/components/interface/declaration.test.js +28 -36
- package/dist/src/components/interface/declaration.test.js.map +1 -0
- package/dist/src/components/interface/method.d.ts.map +1 -1
- package/dist/src/components/interface/method.js +9 -16
- package/dist/src/components/interface/method.js.map +1 -0
- package/dist/src/components/interface/method.test.js +40 -48
- package/dist/src/components/interface/method.test.js.map +1 -0
- package/dist/src/components/interface/property.d.ts.map +1 -1
- package/dist/src/components/interface/property.js +23 -37
- package/dist/src/components/interface/property.js.map +1 -0
- package/dist/src/components/interface/property.test.js +13 -12
- package/dist/src/components/interface/property.test.js.map +1 -0
- package/dist/src/components/lexical-scope.d.ts +8 -0
- package/dist/src/components/lexical-scope.d.ts.map +1 -0
- package/dist/src/components/lexical-scope.js +25 -0
- package/dist/src/components/lexical-scope.js.map +1 -0
- package/dist/src/components/method/method.d.ts +5 -2
- package/dist/src/components/method/method.d.ts.map +1 -1
- package/dist/src/components/method/method.js +9 -14
- package/dist/src/components/method/method.js.map +1 -0
- package/dist/src/components/method/method.test.js +13 -12
- package/dist/src/components/method/method.test.js.map +1 -0
- package/dist/src/components/method-scope.d.ts +8 -0
- package/dist/src/components/method-scope.d.ts.map +1 -0
- package/dist/src/components/method-scope.js +25 -0
- package/dist/src/components/method-scope.js.map +1 -0
- package/dist/src/components/namespace-scopes.d.ts +13 -0
- package/dist/src/components/namespace-scopes.d.ts.map +1 -0
- package/dist/src/components/namespace-scopes.js +45 -0
- package/dist/src/components/namespace-scopes.js.map +1 -0
- package/dist/src/components/namespace.d.ts +7 -0
- package/dist/src/components/namespace.d.ts.map +1 -0
- package/dist/src/components/namespace.js +47 -0
- package/dist/src/components/namespace.js.map +1 -0
- package/dist/src/components/namespace.ref.test.d.ts +2 -0
- package/dist/src/components/namespace.ref.test.d.ts.map +1 -0
- package/dist/src/components/namespace.ref.test.js +182 -0
- package/dist/src/components/namespace.ref.test.js.map +1 -0
- package/dist/src/components/namespace.test.d.ts.map +1 -0
- package/dist/src/components/namespace.test.js +79 -0
- package/dist/src/components/namespace.test.js.map +1 -0
- package/dist/src/components/parameters/parameters.d.ts +2 -2
- package/dist/src/components/parameters/parameters.d.ts.map +1 -1
- package/dist/src/components/parameters/parameters.js +14 -12
- package/dist/src/components/parameters/parameters.js.map +1 -0
- package/dist/src/components/parameters/parameters.test.d.ts +2 -0
- package/dist/src/components/parameters/parameters.test.d.ts.map +1 -0
- package/dist/src/components/parameters/parameters.test.js +88 -0
- package/dist/src/components/parameters/parameters.test.js.map +1 -0
- package/dist/src/components/property/property.d.ts.map +1 -1
- package/dist/src/components/property/property.js +23 -37
- package/dist/src/components/property/property.js.map +1 -0
- package/dist/src/components/property/property.test.js +16 -15
- package/dist/src/components/property/property.test.js.map +1 -0
- package/dist/src/components/record/declaration.d.ts.map +1 -1
- package/dist/src/components/record/declaration.js +10 -13
- package/dist/src/components/record/declaration.js.map +1 -0
- package/dist/src/components/record/declaration.test.js +8 -14
- package/dist/src/components/record/declaration.test.js.map +1 -0
- package/dist/src/components/stc/index.js +2 -1
- package/dist/src/components/stc/index.js.map +1 -0
- package/dist/src/components/struct/declaration.d.ts.map +1 -1
- package/dist/src/components/struct/declaration.js +6 -7
- package/dist/src/components/struct/declaration.js.map +1 -0
- package/dist/src/components/struct/declaration.test.js +32 -40
- package/dist/src/components/struct/declaration.test.js.map +1 -0
- package/dist/src/components/type-parameters/type-parameter-constraints.js +2 -1
- package/dist/src/components/type-parameters/type-parameter-constraints.js.map +1 -0
- package/dist/src/components/type-parameters/type-parameter-constraints.test.js +2 -1
- package/dist/src/components/type-parameters/type-parameter-constraints.test.js.map +1 -0
- package/dist/src/components/type-parameters/type-parameter.d.ts.map +1 -1
- package/dist/src/components/type-parameters/type-parameter.js +9 -11
- package/dist/src/components/type-parameters/type-parameter.js.map +1 -0
- package/dist/src/components/type-parameters/type-parameters.js +2 -1
- package/dist/src/components/type-parameters/type-parameters.js.map +1 -0
- package/dist/src/components/type-parameters/type-parameters.test.js +5 -4
- package/dist/src/components/type-parameters/type-parameters.test.js.map +1 -0
- package/dist/src/components/var/declaration.d.ts.map +1 -1
- package/dist/src/components/var/declaration.js +8 -9
- package/dist/src/components/var/declaration.js.map +1 -0
- package/dist/src/components/var/declaration.test.js +13 -21
- package/dist/src/components/var/declaration.test.js.map +1 -0
- package/dist/src/contexts/global-namespace.d.ts +5 -0
- package/dist/src/contexts/global-namespace.d.ts.map +1 -0
- package/dist/src/contexts/global-namespace.js +25 -0
- package/dist/src/contexts/global-namespace.js.map +1 -0
- package/dist/src/contexts/namespace.d.ts +8 -0
- package/dist/src/contexts/namespace.d.ts.map +1 -0
- package/dist/src/contexts/namespace.js +6 -0
- package/dist/src/contexts/namespace.js.map +1 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +3 -1
- package/dist/src/index.js.map +1 -0
- package/dist/src/modifiers.d.ts +11 -0
- package/dist/src/modifiers.d.ts.map +1 -1
- package/dist/src/modifiers.js +2 -1
- package/dist/src/modifiers.js.map +1 -0
- package/dist/src/name-policy.js +2 -1
- package/dist/src/name-policy.js.map +1 -0
- package/dist/src/scopes/class.d.ts +10 -0
- package/dist/src/scopes/class.d.ts.map +1 -0
- package/dist/src/scopes/class.js +11 -0
- package/dist/src/scopes/class.js.map +1 -0
- package/dist/src/scopes/contexts.d.ts +9 -0
- package/dist/src/scopes/contexts.d.ts.map +1 -0
- package/dist/src/scopes/contexts.js +34 -0
- package/dist/src/scopes/contexts.js.map +1 -0
- package/dist/src/scopes/csharp.d.ts +8 -0
- package/dist/src/scopes/csharp.d.ts.map +1 -0
- package/dist/src/scopes/csharp.js +12 -0
- package/dist/src/scopes/csharp.js.map +1 -0
- package/dist/src/scopes/factories.d.ts +9 -0
- package/dist/src/scopes/factories.d.ts.map +1 -0
- package/dist/src/scopes/factories.js +24 -0
- package/dist/src/scopes/factories.js.map +1 -0
- package/dist/src/scopes/index.d.ts +10 -0
- package/dist/src/scopes/index.d.ts.map +1 -0
- package/dist/src/scopes/index.js +10 -0
- package/dist/src/scopes/index.js.map +1 -0
- package/dist/src/scopes/lexical.d.ts +7 -0
- package/dist/src/scopes/lexical.d.ts.map +1 -0
- package/dist/src/scopes/lexical.js +8 -0
- package/dist/src/scopes/lexical.js.map +1 -0
- package/dist/src/scopes/method.d.ts +9 -0
- package/dist/src/scopes/method.d.ts.map +1 -0
- package/dist/src/scopes/method.js +14 -0
- package/dist/src/scopes/method.js.map +1 -0
- package/dist/src/scopes/named-type.d.ts +22 -0
- package/dist/src/scopes/named-type.d.ts.map +1 -0
- package/dist/src/scopes/named-type.js +33 -0
- package/dist/src/scopes/named-type.js.map +1 -0
- package/dist/src/scopes/namespace.d.ts +11 -0
- package/dist/src/scopes/namespace.d.ts.map +1 -0
- package/dist/src/scopes/namespace.js +39 -0
- package/dist/src/scopes/namespace.js.map +1 -0
- package/dist/src/scopes/source-file.d.ts +16 -0
- package/dist/src/scopes/source-file.d.ts.map +1 -0
- package/dist/src/scopes/source-file.js +44 -0
- package/dist/src/scopes/source-file.js.map +1 -0
- package/dist/src/symbols/csharp.d.ts +76 -0
- package/dist/src/symbols/csharp.d.ts.map +1 -0
- package/dist/src/symbols/csharp.js +223 -0
- package/dist/src/symbols/csharp.js.map +1 -0
- package/dist/src/symbols/factories.d.ts +25 -0
- package/dist/src/symbols/factories.d.ts.map +1 -0
- package/dist/src/symbols/factories.js +87 -0
- package/dist/src/symbols/factories.js.map +1 -0
- package/dist/src/symbols/index.d.ts +5 -2
- package/dist/src/symbols/index.d.ts.map +1 -1
- package/dist/src/symbols/index.js +6 -2
- package/dist/src/symbols/index.js.map +1 -0
- package/dist/src/symbols/method.d.ts +13 -0
- package/dist/src/symbols/method.d.ts.map +1 -0
- package/dist/src/symbols/method.js +16 -0
- package/dist/src/symbols/method.js.map +1 -0
- package/dist/src/symbols/named-type.d.ts +19 -0
- package/dist/src/symbols/named-type.d.ts.map +1 -0
- package/dist/src/symbols/named-type.js +31 -0
- package/dist/src/symbols/named-type.js.map +1 -0
- package/dist/src/symbols/namespace.d.ts +22 -0
- package/dist/src/symbols/namespace.d.ts.map +1 -0
- package/dist/src/symbols/namespace.js +45 -0
- package/dist/src/symbols/namespace.js.map +1 -0
- package/dist/src/symbols/reference.d.ts +2 -2
- package/dist/src/symbols/reference.d.ts.map +1 -1
- package/dist/src/symbols/reference.js +38 -44
- package/dist/src/symbols/reference.js.map +1 -0
- package/dist/test/project-directory.test.js +14 -17
- package/dist/test/project-directory.test.js.map +1 -0
- package/dist/test/sourcefile.test.js +8 -19
- package/dist/test/sourcefile.test.js.map +1 -0
- package/dist/test/using.test.js +20 -17
- package/dist/test/using.test.js.map +1 -0
- package/dist/test/utils.js +4 -3
- package/dist/test/utils.js.map +1 -0
- package/dist/test/vitest.setup.js +2 -1
- package/dist/test/vitest.setup.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -3
- package/src/components/Declaration.tsx +3 -6
- package/src/components/Reference.tsx +3 -1
- package/src/components/SourceFile.tsx +68 -55
- package/src/components/UsingDirective.tsx +12 -2
- package/src/components/class/declaration.test.tsx +120 -143
- package/src/components/class/declaration.tsx +19 -32
- package/src/components/constructor/constructor.test.tsx +10 -16
- package/src/components/constructor/constructor.tsx +13 -27
- package/src/components/enum/declaration.ref.test.tsx +93 -0
- package/src/components/enum/declaration.test.tsx +34 -0
- package/src/components/enum/declaration.tsx +65 -0
- package/src/components/enum/member.test.tsx +24 -0
- package/src/components/enum/member.tsx +36 -0
- package/src/components/field/field.test.tsx +7 -7
- package/src/components/field/field.tsx +12 -14
- package/src/components/index.ts +5 -2
- package/src/components/interface/declaration.test.tsx +26 -32
- package/src/components/interface/declaration.tsx +16 -18
- package/src/components/interface/method.test.tsx +38 -44
- package/src/components/interface/method.tsx +7 -19
- package/src/components/interface/property.test.tsx +11 -11
- package/src/components/interface/property.tsx +15 -33
- package/src/components/lexical-scope.tsx +29 -0
- package/src/components/method/method.test.tsx +11 -11
- package/src/components/method/method.tsx +12 -18
- package/src/components/method-scope.tsx +27 -0
- package/src/components/namespace-scopes.tsx +44 -0
- package/src/components/namespace.ref.test.tsx +139 -0
- package/src/components/namespace.test.tsx +52 -0
- package/src/components/namespace.tsx +45 -0
- package/src/components/parameters/parameters.test.tsx +71 -0
- package/src/components/parameters/parameters.tsx +9 -16
- package/src/components/property/property.test.tsx +14 -14
- package/src/components/property/property.tsx +17 -38
- package/src/components/record/declaration.test.tsx +5 -12
- package/src/components/record/declaration.tsx +10 -11
- package/src/components/struct/declaration.test.tsx +16 -22
- package/src/components/struct/declaration.tsx +4 -6
- package/src/components/type-parameters/type-parameter.tsx +14 -11
- package/src/components/type-parameters/type-parameters.test.tsx +4 -4
- package/src/components/var/declaration.test.tsx +8 -14
- package/src/components/var/declaration.tsx +12 -6
- package/src/contexts/global-namespace.ts +29 -0
- package/src/contexts/namespace.ts +13 -0
- package/src/index.ts +1 -0
- package/src/modifiers.ts +14 -0
- package/src/scopes/class.ts +12 -0
- package/src/scopes/contexts.ts +45 -0
- package/src/scopes/csharp.ts +18 -0
- package/src/scopes/factories.ts +45 -0
- package/src/scopes/index.ts +9 -0
- package/src/scopes/lexical.ts +10 -0
- package/src/scopes/method.ts +22 -0
- package/src/scopes/named-type.ts +44 -0
- package/src/scopes/namespace.ts +59 -0
- package/src/scopes/source-file.ts +67 -0
- package/src/symbols/csharp.ts +307 -0
- package/src/symbols/factories.ts +199 -0
- package/src/symbols/index.ts +5 -2
- package/src/symbols/method.ts +26 -0
- package/src/symbols/named-type.ts +54 -0
- package/src/symbols/namespace.ts +62 -0
- package/src/symbols/reference.ts +47 -50
- package/temp/api.json +6251 -2454
- package/test/project-directory.test.tsx +12 -16
- package/test/sourcefile.test.tsx +7 -21
- package/test/using.test.tsx +18 -16
- package/test/utils.tsx +1 -1
- package/tsconfig.json +4 -1
- package/dist/src/components/EnumDeclaration.d.ts.map +0 -1
- package/dist/src/components/EnumDeclaration.js +0 -82
- package/dist/src/components/Namespace.d.ts +0 -11
- package/dist/src/components/Namespace.d.ts.map +0 -1
- package/dist/src/components/Namespace.js +0 -33
- package/dist/src/symbols/csharp-output-symbol.d.ts +0 -8
- package/dist/src/symbols/csharp-output-symbol.d.ts.map +0 -1
- package/dist/src/symbols/csharp-output-symbol.js +0 -19
- package/dist/src/symbols/scopes.d.ts +0 -20
- package/dist/src/symbols/scopes.d.ts.map +0 -1
- package/dist/src/symbols/scopes.js +0 -42
- package/dist/test/enum.test.d.ts +0 -2
- package/dist/test/enum.test.d.ts.map +0 -1
- package/dist/test/enum.test.js +0 -178
- package/dist/test/namespace.test.d.ts.map +0 -1
- package/dist/test/namespace.test.js +0 -81
- package/src/components/EnumDeclaration.tsx +0 -98
- package/src/components/Namespace.tsx +0 -35
- package/src/symbols/csharp-output-symbol.ts +0 -22
- package/src/symbols/scopes.ts +0 -61
- package/test/enum.test.tsx +0 -149
- package/test/namespace.test.tsx +0 -55
- /package/dist/{test → src/components}/namespace.test.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
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,cAAc,WAAW;AACzB,cAAc,gBAAgB;AAC9B;AACA,cAAc,uBAAuB;AACrC;AACA,cAAc,yBAAyB;AACvC,cAAc,gBAAgB;AAC9B,cAAc,iBAAiB;AAC/B;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,O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,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;QA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f,CAAC,EACD;MACEX,IAAI,EAAE,GAAG;MACTW,WAAW,EAAE;IACf,CAAC,CACF;IAEDnB,MAAM,CAAAM,iBAAA,CACHJ,aAAa;MAAA,IAAAK,SAAA;QAAA,OAAAD,iBAAA,CACXF,oBAAoB;UAAA;UAEnBI,IAAI;UACJO,cAAc,EAAEA,cAAc;UAAAR,QAAA;QAAA;MAAA;IAAA,EAKpC,CAAC,CAACE,UAAU,CAAC;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,CAAC;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, useCSharpMemberScope } 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,17 +17,10 @@ const getMethodModifier = makeModifiers(["new"]);
|
|
|
18
17
|
|
|
19
18
|
// a C# interface method
|
|
20
19
|
export function InterfaceMethod(props) {
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
const methodSymbol = new CSharpOutputSymbol(name, {
|
|
24
|
-
scope,
|
|
25
|
-
refkeys: props.refkey ?? refkey(props.name)
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
// scope for method declaration
|
|
29
|
-
const methodScope = new CSharpMemberScope("method-decl", {
|
|
30
|
-
owner: methodSymbol
|
|
20
|
+
const methodSymbol = createMethodSymbol(props.name, {
|
|
21
|
+
refkeys: props.refkey
|
|
31
22
|
});
|
|
23
|
+
const methodScope = createMethodScope();
|
|
32
24
|
const modifiers = computeModifiersPrefix([getAccessModifier(props), getMethodModifier(props)]);
|
|
33
25
|
// note that scope wraps the method decl so that the params get the correct scope
|
|
34
26
|
return _$createComponent(MemberDeclaration, {
|
|
@@ -46,7 +38,7 @@ export function InterfaceMethod(props) {
|
|
|
46
38
|
return props.attributes;
|
|
47
39
|
},
|
|
48
40
|
endline: true
|
|
49
|
-
}), modifiers, _$memo(() => props.returns ?? "void"), " ",
|
|
41
|
+
}), modifiers, _$memo(() => props.returns ?? "void"), " ", _$createComponent(MemberName, {}), _$memo(() => _$memo(() => !!props.typeParameters)() && _$createComponent(TypeParameters, {
|
|
50
42
|
get parameters() {
|
|
51
43
|
return props.typeParameters;
|
|
52
44
|
}
|
|
@@ -68,4 +60,5 @@ export function InterfaceMethod(props) {
|
|
|
68
60
|
});
|
|
69
61
|
}
|
|
70
62
|
});
|
|
71
|
-
}
|
|
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,iBAAiB,EACjBC,aAAa,QACR,oBAAoB;AAC3B,SAASC,iBAAiB,QAAQ,2BAA2B;AAC7D,SAASC,kBAAkB,QAAQ,4BAA4B;AAC/D,SAASC,aAAa;AACtB,SAASC,OAAO;AAChB,SAAyBC,UAAU;AACnC,SAASC,wBAAwB;AAEjC,SAASC,cAAc;;AAEvB;;AAKA,MAAMC,iBAAiB,GAAGR,aAAa,CAA2B,CAAC,KAAK,CAAC,CAAC;;AAE1E;;AA6CA;AACA,OAAO,SAASS,eAAeA,CAACC,KAA2B,EAAE;EAC3D,MAAMC,YAAY,GAAGT,kBAAkB,CAACQ,KAAK,CAACE,IAAI,EAAE;IAClDC,OAAO,EAAEH,KAAK,CAACI;EACjB,CAAC,CAAC;EAEF,MAAMC,WAAW,GAAGd,iBAAiB,CAAC,CAAC;EAEvC,MAAMe,SAAS,GAAGlB,sBAAsB,CAAC,CACvCC,iBAAiB,CAACW,KAAK,CAAC,EACxBF,iBAAiB,CAACE,KAAK,CAAC,CACzB,CAAC;EACF;EACA,OAAAO,iBAAA,CACGtB,iBAAiB;IAACuB,MAAM,EAAEP,YAAY;IAAA,IAAAQ,SAAA;MAAA,OAAAF,iBAAA,CACpCpB,KAAK;QAACuB,KAAK,EAAEL,WAAW;QAAA,IAAAI,SAAA;UAAA,QAAAF,iBAAA,CACtBb,OAAO;YAAA,IAACiB,GAAGA,CAAA;cAAA,OAAEX,KAAK,CAACW,GAAG;YAAA;UAAA,IAAAJ,iBAAA,CACtBd,aAAa;YAAA,IAACmB,UAAUA,CAAA;cAAA,OAAEZ,KAAK,CAACY,UAAU;YAAA;YAAEC,OAAO;UAAA,IACnDP,SAAS,EAAAQ,MAAA,OACTd,KAAK,CAACe,OAAO,IAAI,MAAM,QAAAR,iBAAA,CAAGrB,UAAU,OAAA4B,MAAA,OACpCA,MAAA,SAAAd,KAAK,CAACgB,cAAc,OAAAT,iBAAA,CAClBV,cAAc;YAAA,IAACoB,UAAUA,CAAA;cAAA,OAAEjB,KAAK,CAACgB,cAAc;YAAA;UAAA,EACjD,GAAAT,iBAAA,CACAZ,UAAU;YAAA,IAACsB,UAAUA,CAAA;cAAA,OAAEjB,KAAK,CAACiB,UAAU;YAAA;UAAA,IAAAH,MAAA,OACvCA,MAAA,SAAAd,KAAK,CAACgB,cAAc,OAAAT,iBAAA,CAClBX,wBAAwB;YAAA,IAACqB,UAAUA,CAAA;cAAA,OAAEjB,KAAK,CAACgB,cAAc;YAAA;UAAA,EAC3D,GAAAF,MAAA,OACAA,MAAA,SAAAd,KAAK,CAACS,QAAQ,MAAAF,iBAAA,CACZvB,KAAK;YAACkC,OAAO;YAAA,IAAAT,SAAA;cAAA,OAAET,KAAK,CAACS,QAAQ;YAAA;UAAA,KAC9B,GAAG;QAAA;MAAA;IAAA;EAAA;AAIb","ignoreList":[]}
|
|
@@ -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,EAAE,CAACU,IAAI,CAAC,CAAC,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,CAAU,CAAC,CAC9D,IAAI,EACHC,cAAc,IAAK;MAClBZ,MAAM,CAAAQ,iBAAA,CACHF,OAAO;QAAA,IAAAG,SAAA;UAAA,OAAAD,iBAAA,CACLH,eAAe,EAAAQ,YAAA,CAAK;YAAE,CAACD,cAAc,GAAG;UAAK,CAAC;YAAEF,IAAI;UAAA;QAAA;MAAA,EAEzD,CAAC,CAACI,UAAU,CAAC;AACrB;AACA;AACA,cAAcF,cAAc;AAC5B;AACA,OAAO,CAAC;IACF,CACF,CAAC;EACH,CAAC,CAAC;EAEFb,QAAQ,CAAC,kBAAkB,EAAE,MAAM;IACjCE,EAA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AACA;AACA;AACA;AACA,KAAK,CAAC;EACJ,CAAC,CAAC;EAEFb,EAAE,CAAC,0BAA0B,EAAE,MAAM;IACnC,MAAMwB,cAAoC,GAAG,CAC3C;MACEf,IAAI,EAAE,GAAG;MACTgB,WAAW,EAAE;IACf,CAAC,EACD;MACEhB,IAAI,EAAE,GAAG;MACTgB,WAAW,EAAE;IACf,CAAC,CACF;IAED1B,MAAM,CAAAQ,iBAAA,CACHF,OAAO;MAAA,IAAAG,SAAA;QAAA,OAAAD,iBAAA,CACLH,eAAe;UAAA;UAAQK,IAAI;UAAQe,cAAc,EAAEA,cAAc;UAAAhB,QAAA;QAAA;MAAA;IAAA,EAItE,CAAC,CAACK,UAAU,CAAC;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC;AAEFf,QAAQ,CAAC,YAAY,EAAE,MAAM;EAC3BE,EAAE,CAAC,yCAAyC,EAAE,MAAM;IAClDD,MAAM,CAAAQ,iBAAA,CACHF,OAAO;MAAA,IAAAG,SAAA;QAAA,OAAAD,iBAAA,CACLH,eAAe;UAAA;UAEdK,IAAI;UACJU,UAAU,EAAE,CACV;YACEV,IAAI,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, useCSharpMemberScope } from "../../symbols/scopes.js";
|
|
4
|
+
import { createPropertySymbol } from "../../symbols/factories.js";
|
|
7
5
|
import { AttributeList } from "../attributes/attributes.js";
|
|
8
6
|
import { DocWhen } from "../doc/comment.js";
|
|
9
7
|
|
|
@@ -23,48 +21,36 @@ const getModifiers = makeModifiers(["new"]);
|
|
|
23
21
|
* ```
|
|
24
22
|
*/
|
|
25
23
|
export function InterfaceProperty(props) {
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
const propertySymbol = new CSharpOutputSymbol(name, {
|
|
29
|
-
scope,
|
|
30
|
-
refkeys: props.refkey ?? refkey(props.name)
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
// scope for property declaration
|
|
34
|
-
const propertyScope = new CSharpMemberScope("property-decl", {
|
|
35
|
-
owner: propertySymbol
|
|
24
|
+
const propertySymbol = createPropertySymbol(props.name, {
|
|
25
|
+
refkeys: props.refkey
|
|
36
26
|
});
|
|
37
27
|
const modifiers = computeModifiersPrefix([getAccessModifier(props), getModifiers(props)]);
|
|
38
28
|
// note that scope wraps the method decl so that the params get the correct scope
|
|
39
29
|
return _$createComponent(MemberDeclaration, {
|
|
40
30
|
symbol: propertySymbol,
|
|
41
31
|
get children() {
|
|
42
|
-
return _$createComponent(
|
|
43
|
-
|
|
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,
|
|
44
44
|
get children() {
|
|
45
|
-
return
|
|
46
|
-
|
|
47
|
-
return props.doc;
|
|
48
|
-
}
|
|
49
|
-
}), _$createComponent(AttributeList, {
|
|
50
|
-
get attributes() {
|
|
51
|
-
return props.attributes;
|
|
52
|
-
},
|
|
53
|
-
endline: true
|
|
54
|
-
}), modifiers, _$memo(() => props.type), _$memo(() => props.nullable && "?"), " ", name, " ", _$createComponent(Block, {
|
|
55
|
-
newline: true,
|
|
56
|
-
inline: true,
|
|
45
|
+
return _$createComponent(List, {
|
|
46
|
+
joiner: " ",
|
|
57
47
|
get children() {
|
|
58
|
-
return _$
|
|
59
|
-
joiner: " ",
|
|
60
|
-
get children() {
|
|
61
|
-
return [_$memo(() => props.get && "get;"), _$memo(() => props.set && "set;")];
|
|
62
|
-
}
|
|
63
|
-
});
|
|
48
|
+
return [_$memo(() => props.get && "get;"), _$memo(() => props.set && "set;")];
|
|
64
49
|
}
|
|
65
|
-
})
|
|
50
|
+
});
|
|
66
51
|
}
|
|
67
|
-
});
|
|
52
|
+
})];
|
|
68
53
|
}
|
|
69
54
|
});
|
|
70
|
-
}
|
|
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,CAAC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