@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
|
@@ -1,54 +1,48 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
// when resolving references across source files, the last element
|
|
6
|
-
// in pathDown will be the containing source file. we only need this
|
|
7
|
-
// here so we can find and remove this scope as it's not useful
|
|
8
|
-
// when building the reference
|
|
9
|
-
|
|
1
|
+
import { memo, resolve } from "@alloy-js/core";
|
|
2
|
+
import { CSharpNamespaceScope } from "../scopes/namespace.js";
|
|
3
|
+
import { useSourceFileScope } from "../scopes/source-file.js";
|
|
10
4
|
// converts a refkey to its fully qualified name
|
|
11
5
|
// e.g. if refkey is for bar in enum type foo, and
|
|
12
6
|
// foo is in the same namespace as the refkey, then
|
|
13
7
|
// the result would be foo.bar.
|
|
14
8
|
export function ref(refkey) {
|
|
15
|
-
const
|
|
16
|
-
const resolveResult =
|
|
17
|
-
return
|
|
9
|
+
const refSfScope = useSourceFileScope();
|
|
10
|
+
const resolveResult = resolve(refkey);
|
|
11
|
+
return memo(() => {
|
|
18
12
|
if (resolveResult.value === undefined) {
|
|
19
|
-
return "<Unresolved Symbol>";
|
|
13
|
+
return ["<Unresolved Symbol>", undefined];
|
|
20
14
|
}
|
|
21
|
-
|
|
22
|
-
// targetDeclaration is the symbol with the refkey
|
|
23
|
-
// pathDown is an array of scopes to that symbol and can be empty.
|
|
24
|
-
// the entries are top-down, so namespace, source-file, member
|
|
25
|
-
// - referencing a type within the same namespace will have an empty path
|
|
26
|
-
// - referencing a member (e.g. enum value) within the same namespace will
|
|
27
|
-
// have a single path entry that contains the owning type
|
|
28
|
-
// - referencing a type within the same namespace but in a different source
|
|
29
|
-
// file will have at least a source-file entry
|
|
30
|
-
// - referencing a symbol outside the current namespace will have at least
|
|
31
|
-
// two entries, namespace, source-file
|
|
15
|
+
const result = resolveResult.value;
|
|
32
16
|
const {
|
|
33
|
-
|
|
34
|
-
pathDown
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
17
|
+
commonScope,
|
|
18
|
+
pathDown,
|
|
19
|
+
memberPath
|
|
20
|
+
} = result;
|
|
21
|
+
let {
|
|
22
|
+
lexicalDeclaration
|
|
23
|
+
} = result;
|
|
24
|
+
const parts = [];
|
|
25
|
+
if (!commonScope) {
|
|
26
|
+
// this shouldn't be possible in csharp.
|
|
27
|
+
return ["<Unresolved Symbol>", undefined];
|
|
44
28
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
29
|
+
if (commonScope instanceof CSharpNamespaceScope && commonScope.ownerSymbol.isGlobal && lexicalDeclaration.symbolKind === "namespace" && memberPath.length > 0) {
|
|
30
|
+
// we need to using the namespace
|
|
31
|
+
let nsToUse;
|
|
32
|
+
while (lexicalDeclaration.symbolKind === "namespace" && memberPath.length > 0) {
|
|
33
|
+
nsToUse = lexicalDeclaration;
|
|
34
|
+
lexicalDeclaration = memberPath.shift();
|
|
35
|
+
}
|
|
36
|
+
refSfScope.addUsing(nsToUse);
|
|
37
|
+
}
|
|
38
|
+
for (const nsScope of pathDown) {
|
|
39
|
+
parts.push(nsScope.ownerSymbol.name);
|
|
40
|
+
}
|
|
41
|
+
parts.push(lexicalDeclaration.name);
|
|
42
|
+
for (const member of memberPath) {
|
|
43
|
+
parts.push(member.name);
|
|
44
|
+
}
|
|
45
|
+
return [parts.join("."), result.symbol];
|
|
53
46
|
});
|
|
54
|
-
}
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=reference.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["memo","resolve","CSharpNamespaceScope","useSourceFileScope","ref","refkey","refSfScope","resolveResult","value","undefined","result","commonScope","pathDown","memberPath","lexicalDeclaration","parts","ownerSymbol","isGlobal","symbolKind","length","nsToUse","shift","addUsing","nsScope","push","name","member","join","symbol"],"sources":["../../../src/symbols/reference.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,IAAI,EAAwBC,OAAO,QAAQ,gBAAgB;AAEpE,SAASC,oBAAoB,QAAQ,wBAAwB;AAC7D,SAASC,kBAAkB,QAAQ,0BAA0B;AAI7D;AACA;AACA;AACA;AACA,OAAO,SAASC,GAAGA,CAACC,MAAc,EAA4C;EAC5E,MAAMC,UAAU,GAAGH,kBAAkB,CAAC,CAAE;EACxC,MAAMI,aAAa,GAAGN,OAAO,CAA4BI,MAAgB,CAAC;EAE1E,OAAOL,IAAI,CAAC,MAAM;IAChB,IAAIO,aAAa,CAACC,KAAK,KAAKC,SAAS,EAAE;MACrC,OAAO,CAAC,qBAAqB,EAAEA,SAAS,CAAC;IAC3C;IAEA,MAAMC,MAAM,GAAGH,aAAa,CAACC,KAAK;IAClC,MAAM;MAAEG,WAAW;MAAEC,QAAQ;MAAEC;IAAW,CAAC,GAAGH,MAAM;IACpD,IAAI;MAAEI;IAAmB,CAAC,GAAGJ,MAAM;IAEnC,MAAMK,KAAK,GAAG,EAAE;IAChB,IAAI,CAACJ,WAAW,EAAE;MAChB;MACA,OAAO,CAAC,qBAAqB,EAAEF,SAAS,CAAC;IAC3C;IAEA,IACEE,WAAW,YAAYT,oBAAoB,IAC3CS,WAAW,CAACK,WAAW,CAACC,QAAQ,IAChCH,kBAAkB,CAACI,UAAU,KAAK,WAAW,IAC7CL,UAAU,CAACM,MAAM,GAAG,CAAC,EACrB;MACA;MACA,IAAIC,OAAwB;MAC5B,OACEN,kBAAkB,CAACI,UAAU,KAAK,WAAW,IAC7CL,UAAU,CAACM,MAAM,GAAG,CAAC,EACrB;QACAC,OAAO,GAAGN,kBAAqC;QAC/CA,kBAAkB,GAAGD,UAAU,CAACQ,KAAK,CAAC,CAAE;MAC1C;MAEAf,UAAU,CAACgB,QAAQ,CAACF,OAAQ,CAAC;IAC/B;IAEA,KAAK,MAAMG,OAAO,IAAIX,QAAQ,EAAE;MAC9BG,KAAK,CAACS,IAAI,CAACD,OAAO,CAACP,WAAW,CAAES,IAAI,CAAC;IACvC;IAEAV,KAAK,CAACS,IAAI,CAACV,kBAAkB,CAACW,IAAI,CAAC;IAEnC,KAAK,MAAMC,MAAM,IAAIb,UAAU,EAAE;MAC/BE,KAAK,CAACS,IAAI,CAACE,MAAM,CAACD,IAAI,CAAC;IACzB;IAEA,OAAO,CAACV,KAAK,CAACY,IAAI,CAAC,GAAG,CAAC,EAAEjB,MAAM,CAACkB,MAAM,CAAC;EACzC,CAAC,CAAC;AACJ","ignoreList":[]}
|
|
@@ -53,17 +53,15 @@ it("defines a project directory file with multiple source files", () => {
|
|
|
53
53
|
const srcDir = projDir.contents[1];
|
|
54
54
|
expect(srcDir.contents[0].path).equals("~/projects/TestProject/src/Test1.cs");
|
|
55
55
|
expect(srcDir.contents[0].contents).toBe(coretest.d`
|
|
56
|
-
namespace TestCode
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
56
|
+
namespace TestCode;
|
|
57
|
+
|
|
58
|
+
public class TestClass1;
|
|
60
59
|
`);
|
|
61
60
|
expect(srcDir.contents[1].path).equals("~/projects/TestProject/src/Test2.cs");
|
|
62
61
|
expect(srcDir.contents[1].contents).toBe(coretest.d`
|
|
63
|
-
namespace TestCode
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
62
|
+
namespace TestCode;
|
|
63
|
+
|
|
64
|
+
public class TestClass2;
|
|
67
65
|
`);
|
|
68
66
|
});
|
|
69
67
|
it("defines a project directory file with multiple source files and a custom TFM", () => {
|
|
@@ -117,16 +115,15 @@ it("defines a project directory file with multiple source files and a custom TFM
|
|
|
117
115
|
const srcDir = projDir.contents[1];
|
|
118
116
|
expect(srcDir.contents[0].path).equals("~/projects/TestProject/src/Test1.cs");
|
|
119
117
|
expect(srcDir.contents[0].contents).toBe(coretest.d`
|
|
120
|
-
namespace TestCode
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}
|
|
118
|
+
namespace TestCode;
|
|
119
|
+
|
|
120
|
+
public class TestClass1;
|
|
124
121
|
`);
|
|
125
122
|
expect(srcDir.contents[1].path).equals("~/projects/TestProject/src/Test2.cs");
|
|
126
123
|
expect(srcDir.contents[1].contents).toBe(coretest.d`
|
|
127
|
-
namespace TestCode
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
}
|
|
124
|
+
namespace TestCode;
|
|
125
|
+
|
|
126
|
+
public class TestClass2;
|
|
131
127
|
`);
|
|
132
|
-
});
|
|
128
|
+
});
|
|
129
|
+
//# sourceMappingURL=project-directory.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["core","coretest","expect","it","csharp","res","render","_$createComponent","Output","children","ProjectDirectory","name","path","version","description","Namespace","SourceFile","ClassDeclaration","projDir","contents","equals","toBe","d","srcDir","targetFrameworkMoniker"],"sources":["../../test/project-directory.test.tsx"],"sourcesContent":[null],"mappings":";AAAA,OAAO,KAAKA,IAAI,MAAM,gBAAgB;AACtC,OAAO,KAAKC,QAAQ,MAAM,wBAAwB;AAClD,SAASC,MAAM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Component as _$createComponent } from "@alloy-js/core/jsx-runtime";
|
|
2
2
|
import * as core from "@alloy-js/core";
|
|
3
3
|
import * as coretest from "@alloy-js/core/testing";
|
|
4
|
-
import {
|
|
4
|
+
import { it } from "vitest";
|
|
5
5
|
import * as csharp from "../src/index.js";
|
|
6
6
|
import { assertFileContents } from "./utils.js";
|
|
7
7
|
it("defines multiple source files with unique content", () => {
|
|
@@ -33,26 +33,15 @@ it("defines multiple source files with unique content", () => {
|
|
|
33
33
|
}));
|
|
34
34
|
assertFileContents(res, {
|
|
35
35
|
"Test1.cs": coretest.d`
|
|
36
|
-
namespace TestCode
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
36
|
+
namespace TestCode;
|
|
37
|
+
|
|
38
|
+
public class TestClass1;
|
|
40
39
|
`,
|
|
41
40
|
"Test2.cs": coretest.d`
|
|
42
|
-
namespace TestCode
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
41
|
+
namespace TestCode;
|
|
42
|
+
|
|
43
|
+
public class TestClass2;
|
|
46
44
|
`
|
|
47
45
|
});
|
|
48
46
|
});
|
|
49
|
-
|
|
50
|
-
const decl = _$createComponent(core.Output, {
|
|
51
|
-
get children() {
|
|
52
|
-
return _$createComponent(csharp.SourceFile, {
|
|
53
|
-
path: "Test.cs"
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
expect(() => core.render(decl)).toThrow("SourceFile must be declared inside a namespace");
|
|
58
|
-
});
|
|
47
|
+
//# sourceMappingURL=sourcefile.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["core","coretest","it","csharp","assertFileContents","res","render","_$createComponent","Output","children","Namespace","name","SourceFile","path","ClassDeclaration","d"],"sources":["../../test/sourcefile.test.tsx"],"sourcesContent":[null],"mappings":";AAAA,OAAO,KAAKA,IAAI,MAAM,gBAAgB;AACtC,OAAO,KAAKC,QAAQ,MAAM,wBAAwB;AAClD,SAASC,EAAE,QAAQ,QAAQ;AAC3B,OAAO,KAAKC,MAAM,MAAM,iBAAiB;AACzC,SAASC,kBAAkB;AAE3BF,EAAE,CAAC,mDAAmD,EAAE,MAAM;EAC5D,MAAMG,GAAG,GAAGL,IAAI,CAACM,MAAM,CAAAC,iBAAA,CACpBP,IAAI,CAACQ,MAAM;IAAA,IAAAC,SAAA;MAAA,OAAAF,iBAAA,CACTJ,MAAM,CAACO,SAAS;QAACC,IAAI;QAAA,IAAAF,SAAA;UAAA,QAAAF,iBAAA,CACnBJ,MAAM,CAACS,UAAU;YAACC,IAAI;YAAA,IAAAJ,SAAA;cAAA,OAAAF,iBAAA,CACpBJ,MAAM,CAACW,gBAAgB;gBAAA;gBAAQH,IAAI;cAAA;YAAA;UAAA,IAAAJ,iBAAA,CAErCJ,MAAM,CAACS,UAAU;YAACC,IAAI;YAAA,IAAAJ,SAAA;cAAA,OAAAF,iBAAA,CACpBJ,MAAM,CAACW,gBAAgB;gBAAA;gBAAQH,IAAI;cAAA;YAAA;UAAA;QAAA;MAAA;IAAA;EAAA,EAI5C,CAAC;EAEDP,kBAAkB,CAACC,GAAG,EAAE;IACtB,UAAU,EAAEJ,QAAQ,CAACc,CAAC;AAC1B;AACA;AACA;AACA,KAAK;IACD,UAAU,EAAEd,QAAQ,CAACc,CAAC;AAC1B;AACA;AACA;AACA;EACE,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
package/dist/test/using.test.js
CHANGED
|
@@ -21,7 +21,9 @@ it("uses a single namespace", () => {
|
|
|
21
21
|
expect(findFile(res, "Test1.cs").contents).toBe(coretest.d`
|
|
22
22
|
using Foo;
|
|
23
23
|
|
|
24
|
-
namespace TestCode
|
|
24
|
+
namespace TestCode;
|
|
25
|
+
|
|
26
|
+
|
|
25
27
|
`);
|
|
26
28
|
});
|
|
27
29
|
it("uses multiple namespaces", () => {
|
|
@@ -42,7 +44,9 @@ it("uses multiple namespaces", () => {
|
|
|
42
44
|
using Bar.Baz;
|
|
43
45
|
using Foo;
|
|
44
46
|
|
|
45
|
-
namespace TestCode
|
|
47
|
+
namespace TestCode;
|
|
48
|
+
|
|
49
|
+
|
|
46
50
|
`);
|
|
47
51
|
});
|
|
48
52
|
it("adds using statement across namespaces", () => {
|
|
@@ -114,29 +118,28 @@ it("adds using statement across namespaces", () => {
|
|
|
114
118
|
}));
|
|
115
119
|
assertFileContents(res, {
|
|
116
120
|
"Models.cs": coretest.d`
|
|
117
|
-
namespace Models
|
|
121
|
+
namespace Models;
|
|
122
|
+
|
|
123
|
+
public class Input;
|
|
124
|
+
public class Output;
|
|
125
|
+
public enum TestEnum
|
|
118
126
|
{
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
public enum TestEnum
|
|
122
|
-
{
|
|
123
|
-
One,
|
|
124
|
-
Two
|
|
125
|
-
}
|
|
127
|
+
One,
|
|
128
|
+
Two
|
|
126
129
|
}
|
|
127
130
|
`,
|
|
128
131
|
"Client.cs": coretest.d`
|
|
129
132
|
using Models;
|
|
130
133
|
using System;
|
|
131
134
|
|
|
132
|
-
namespace Client
|
|
135
|
+
namespace Client;
|
|
136
|
+
|
|
137
|
+
public class Client
|
|
133
138
|
{
|
|
134
|
-
public
|
|
135
|
-
{
|
|
136
|
-
public Output MethodOne(Input bodyParam) {}
|
|
137
|
-
}
|
|
138
|
-
TestEnum.Two;
|
|
139
|
+
public Output MethodOne(Input bodyParam) {}
|
|
139
140
|
}
|
|
141
|
+
TestEnum.Two;
|
|
140
142
|
`
|
|
141
143
|
});
|
|
142
|
-
});
|
|
144
|
+
});
|
|
145
|
+
//# sourceMappingURL=using.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["core","coretest","expect","it","csharp","assertFileContents","findFile","res","render","_$createComponent","Output","children","Namespace","name","SourceFile","path","using","contents","toBe","d","inputTypeRefkey","refkey","outputTypeRefkey","twoValRefkey","params","type","namePolicy","createCSharpNamePolicy","ClassDeclaration","_$createIntrinsic","EnumDeclaration","EnumMember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;kBAAY;gBAAA;cAAA;YAAA;UAAA;QAAA;MAAA,IAAAd,iBAAA,CAIvDL,MAAM,CAACQ,SAAS;QAACC,IAAI;QAAA,IAAAF,SAAA;UAAA,OAAAF,iBAAA,CACnBL,MAAM,CAACU,UAAU;YAACC,IAAI;YAAaC,KAAK,EAAE,CAAC,QAAQ,CAAC;YAAA,IAAAL,SAAA;cAAA,QAAAF,iBAAA,CAClDL,MAAM,CAACwB,gBAAgB;gBAAA;gBAAQf,IAAI;gBAAA,IAAAF,SAAA;kBAAA,OAAAF,iBAAA,CACjCL,MAAM,CAAC4B,MAAM;oBAAA;oBAEZnB,IAAI;oBACJoB,UAAU,EAAET,MAAM;oBAClBU,OAAO,EAAEZ;kBAAgB;gBAAA;cAAA,IAAAO,iBAAA,aAI5BN,YAAY;YAAA;UAAA;QAAA;MAAA;IAAA;EAAA,EAIrB,CAAC;EAEDlB,kBAAkB,CAACE,GAAG,EAAE;IACtB,WAAW,EAAEN,QAAQ,CAACkB,CAAC;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;IACD,WAAW,EAAElB,QAAQ,CAACkB,CAAC;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
package/dist/test/utils.js
CHANGED
|
@@ -9,8 +9,8 @@ export function TestNamespace(props) {
|
|
|
9
9
|
return csharp.createCSharpNamePolicy();
|
|
10
10
|
},
|
|
11
11
|
get children() {
|
|
12
|
-
return _$createComponent(csharp.
|
|
13
|
-
|
|
12
|
+
return _$createComponent(csharp.SourceFile, {
|
|
13
|
+
path: "Test.cs",
|
|
14
14
|
get children() {
|
|
15
15
|
return props.children;
|
|
16
16
|
}
|
|
@@ -76,4 +76,5 @@ export function assertFileContents(res, expectedFiles) {
|
|
|
76
76
|
const file = findFile(res, path);
|
|
77
77
|
expect(file.contents).toBe(coretest.dedent(contents));
|
|
78
78
|
}
|
|
79
|
-
}
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["core","coretest","expect","csharp","TestNamespace","props","_$createComponent","Output","namePolicy","createCSharpNamePolicy","children","SourceFile","path","toSourceText","c","res","render","Namespace","name","file","findFile","contents","testRender","result","findFileWorker","Error","item","kind","includes","found","assertFileContents","expectedFiles","Object","entries","toBe","dedent"],"sources":["../../test/utils.tsx"],"sourcesContent":[null],"mappings":";AAAA,OAAO,KAAKA,IAAI,MAAM,gBAAgB;AACtC,OAAO,KAAKC,QAAQ,MAAM,wBAAwB;AAClD,SAASC,MAAM,QAAQ,QAAQ;AAC/B,OAAO,KAAKC,MAAM,MAAM,iBAAiB;AAEzC,OAAO,SAASC,aAAaA,CAACC,KAE7B,EAAiB;EAChB,OAAAC,iBAAA,CACGN,IAAI,CAACO,MAAM;IAAA,IAACC,UAAUA,CAAA;MAAA,OAAEL,MAAM,CAACM,sBAAsB,CAAC,CAAC;IAAA;IAAA,IAAAC,SAAA;MAAA,OAAAJ,iBAAA,CACrDH,MAAM,CAACQ,UAAU;QAACC,IAAI;QAAA,IAAAF,SAAA;UAAA,OAAYL,KAAK,CAACK,QAAQ;QAAA;MAAA;IAAA;EAAA;AAGvD;AACA,OAAO,SAASG,YAAYA,CAACC,CAAgB,EAAU;EACrD,MAAMC,GAAG,GAAGf,IAAI,CAACgB,MAAM,CAAAV,iBAAA,CACpBN,IAAI,CAACO,MAAM;IAAA,IAACC,UAAUA,CAAA;MAAA,OAAEL,MAAM,CAACM,sBAAsB,CAAC,CAAC;IAAA;IAAA,IAAAC,SAAA;MAAA,OAAAJ,iBAAA,CACrDH,MAAM,CAACc,SAAS;QAACC,IAAI;QAAA,IAAAR,SAAA;UAAA,OAAAJ,iBAAA,CACnBH,MAAM,CAACQ,UAAU;YAACC,IAAI;YAAAF,QAAA,EAAYI;UAAC;QAAA;MAAA;IAAA;EAAA,EAG1C,C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IAAI,CAAC;IAChCV,MAAM,CAACiB,IAAI,CAACE,QAAQ,CAAC,CAACa,IAAI,CAACjC,QAAQ,CAACkC,MAAM,CAACd,QAAQ,CAAC,CAAC;EACvD;AACF","ignoreList":[]}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
import "@alloy-js/core/testing";
|
|
1
|
+
import "@alloy-js/core/testing";
|
|
2
|
+
//# sourceMappingURL=vitest.setup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["../../test/vitest.setup.ts"],"sourcesContent":[null],"mappings":"AAAA,OAAO,wBAAwB","ignoreList":[]}
|