@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.
Files changed (346) hide show
  1. package/dist/src/components/Declaration.d.ts +2 -2
  2. package/dist/src/components/Declaration.d.ts.map +1 -1
  3. package/dist/src/components/Declaration.js +5 -14
  4. package/dist/src/components/Declaration.js.map +1 -0
  5. package/dist/src/components/Name.js +2 -1
  6. package/dist/src/components/Name.js.map +1 -0
  7. package/dist/src/components/ProjectDirectory.js +2 -1
  8. package/dist/src/components/ProjectDirectory.js.map +1 -0
  9. package/dist/src/components/Reference.d.ts.map +1 -1
  10. package/dist/src/components/Reference.js +7 -2
  11. package/dist/src/components/Reference.js.map +1 -0
  12. package/dist/src/components/SourceFile.d.ts +8 -9
  13. package/dist/src/components/SourceFile.d.ts.map +1 -1
  14. package/dist/src/components/SourceFile.js +71 -46
  15. package/dist/src/components/SourceFile.js.map +1 -0
  16. package/dist/src/components/UsingDirective.d.ts +5 -1
  17. package/dist/src/components/UsingDirective.d.ts.map +1 -1
  18. package/dist/src/components/UsingDirective.js +5 -2
  19. package/dist/src/components/UsingDirective.js.map +1 -0
  20. package/dist/src/components/attributes/attributes.js +2 -1
  21. package/dist/src/components/attributes/attributes.js.map +1 -0
  22. package/dist/src/components/attributes/attributes.test.js +2 -1
  23. package/dist/src/components/attributes/attributes.test.js.map +1 -0
  24. package/dist/src/components/class/declaration.d.ts +2 -2
  25. package/dist/src/components/class/declaration.d.ts.map +1 -1
  26. package/dist/src/components/class/declaration.js +20 -33
  27. package/dist/src/components/class/declaration.js.map +1 -0
  28. package/dist/src/components/class/declaration.test.js +173 -194
  29. package/dist/src/components/class/declaration.test.js.map +1 -0
  30. package/dist/src/components/constructor/constructor.d.ts.map +1 -1
  31. package/dist/src/components/constructor/constructor.js +13 -17
  32. package/dist/src/components/constructor/constructor.js.map +1 -0
  33. package/dist/src/components/constructor/constructor.test.js +12 -20
  34. package/dist/src/components/constructor/constructor.test.js.map +1 -0
  35. package/dist/src/components/doc/comment.js +2 -1
  36. package/dist/src/components/doc/comment.js.map +1 -0
  37. package/dist/src/components/doc/comment.test.js +2 -1
  38. package/dist/src/components/doc/comment.test.js.map +1 -0
  39. package/dist/src/components/doc/from-markdown.js +2 -1
  40. package/dist/src/components/doc/from-markdown.js.map +1 -0
  41. package/dist/src/components/doc/from-markdown.test.js +2 -1
  42. package/dist/src/components/doc/from-markdown.test.js.map +1 -0
  43. package/dist/src/components/{EnumDeclaration.d.ts → enum/declaration.d.ts} +6 -11
  44. package/dist/src/components/enum/declaration.d.ts.map +1 -0
  45. package/dist/src/components/enum/declaration.js +55 -0
  46. package/dist/src/components/enum/declaration.js.map +1 -0
  47. package/dist/src/components/enum/declaration.ref.test.d.ts +2 -0
  48. package/dist/src/components/enum/declaration.ref.test.d.ts.map +1 -0
  49. package/dist/src/components/enum/declaration.ref.test.js +121 -0
  50. package/dist/src/components/enum/declaration.ref.test.js.map +1 -0
  51. package/dist/src/components/enum/declaration.test.d.ts +2 -0
  52. package/dist/src/components/enum/declaration.test.d.ts.map +1 -0
  53. package/dist/src/components/enum/declaration.test.js +40 -0
  54. package/dist/src/components/enum/declaration.test.js.map +1 -0
  55. package/dist/src/components/enum/member.d.ts +7 -0
  56. package/dist/src/components/enum/member.d.ts.map +1 -0
  57. package/dist/src/components/enum/member.js +30 -0
  58. package/dist/src/components/enum/member.js.map +1 -0
  59. package/dist/src/components/enum/member.test.d.ts +2 -0
  60. package/dist/src/components/enum/member.test.d.ts.map +1 -0
  61. package/dist/src/components/enum/member.test.js +29 -0
  62. package/dist/src/components/enum/member.test.js.map +1 -0
  63. package/dist/src/components/field/field.d.ts.map +1 -1
  64. package/dist/src/components/field/field.js +11 -15
  65. package/dist/src/components/field/field.js.map +1 -0
  66. package/dist/src/components/field/field.test.js +9 -8
  67. package/dist/src/components/field/field.test.js.map +1 -0
  68. package/dist/src/components/index.d.ts +5 -2
  69. package/dist/src/components/index.d.ts.map +1 -1
  70. package/dist/src/components/index.js +7 -3
  71. package/dist/src/components/index.js.map +1 -0
  72. package/dist/src/components/interface/declaration.d.ts.map +1 -1
  73. package/dist/src/components/interface/declaration.js +21 -22
  74. package/dist/src/components/interface/declaration.js.map +1 -0
  75. package/dist/src/components/interface/declaration.test.js +28 -36
  76. package/dist/src/components/interface/declaration.test.js.map +1 -0
  77. package/dist/src/components/interface/method.d.ts.map +1 -1
  78. package/dist/src/components/interface/method.js +9 -16
  79. package/dist/src/components/interface/method.js.map +1 -0
  80. package/dist/src/components/interface/method.test.js +40 -48
  81. package/dist/src/components/interface/method.test.js.map +1 -0
  82. package/dist/src/components/interface/property.d.ts.map +1 -1
  83. package/dist/src/components/interface/property.js +23 -37
  84. package/dist/src/components/interface/property.js.map +1 -0
  85. package/dist/src/components/interface/property.test.js +13 -12
  86. package/dist/src/components/interface/property.test.js.map +1 -0
  87. package/dist/src/components/lexical-scope.d.ts +8 -0
  88. package/dist/src/components/lexical-scope.d.ts.map +1 -0
  89. package/dist/src/components/lexical-scope.js +25 -0
  90. package/dist/src/components/lexical-scope.js.map +1 -0
  91. package/dist/src/components/method/method.d.ts +5 -2
  92. package/dist/src/components/method/method.d.ts.map +1 -1
  93. package/dist/src/components/method/method.js +9 -14
  94. package/dist/src/components/method/method.js.map +1 -0
  95. package/dist/src/components/method/method.test.js +13 -12
  96. package/dist/src/components/method/method.test.js.map +1 -0
  97. package/dist/src/components/method-scope.d.ts +8 -0
  98. package/dist/src/components/method-scope.d.ts.map +1 -0
  99. package/dist/src/components/method-scope.js +25 -0
  100. package/dist/src/components/method-scope.js.map +1 -0
  101. package/dist/src/components/namespace-scopes.d.ts +13 -0
  102. package/dist/src/components/namespace-scopes.d.ts.map +1 -0
  103. package/dist/src/components/namespace-scopes.js +45 -0
  104. package/dist/src/components/namespace-scopes.js.map +1 -0
  105. package/dist/src/components/namespace.d.ts +7 -0
  106. package/dist/src/components/namespace.d.ts.map +1 -0
  107. package/dist/src/components/namespace.js +47 -0
  108. package/dist/src/components/namespace.js.map +1 -0
  109. package/dist/src/components/namespace.ref.test.d.ts +2 -0
  110. package/dist/src/components/namespace.ref.test.d.ts.map +1 -0
  111. package/dist/src/components/namespace.ref.test.js +182 -0
  112. package/dist/src/components/namespace.ref.test.js.map +1 -0
  113. package/dist/src/components/namespace.test.d.ts.map +1 -0
  114. package/dist/src/components/namespace.test.js +79 -0
  115. package/dist/src/components/namespace.test.js.map +1 -0
  116. package/dist/src/components/parameters/parameters.d.ts +2 -2
  117. package/dist/src/components/parameters/parameters.d.ts.map +1 -1
  118. package/dist/src/components/parameters/parameters.js +14 -12
  119. package/dist/src/components/parameters/parameters.js.map +1 -0
  120. package/dist/src/components/parameters/parameters.test.d.ts +2 -0
  121. package/dist/src/components/parameters/parameters.test.d.ts.map +1 -0
  122. package/dist/src/components/parameters/parameters.test.js +88 -0
  123. package/dist/src/components/parameters/parameters.test.js.map +1 -0
  124. package/dist/src/components/property/property.d.ts.map +1 -1
  125. package/dist/src/components/property/property.js +23 -37
  126. package/dist/src/components/property/property.js.map +1 -0
  127. package/dist/src/components/property/property.test.js +16 -15
  128. package/dist/src/components/property/property.test.js.map +1 -0
  129. package/dist/src/components/record/declaration.d.ts.map +1 -1
  130. package/dist/src/components/record/declaration.js +10 -13
  131. package/dist/src/components/record/declaration.js.map +1 -0
  132. package/dist/src/components/record/declaration.test.js +8 -14
  133. package/dist/src/components/record/declaration.test.js.map +1 -0
  134. package/dist/src/components/stc/index.js +2 -1
  135. package/dist/src/components/stc/index.js.map +1 -0
  136. package/dist/src/components/struct/declaration.d.ts.map +1 -1
  137. package/dist/src/components/struct/declaration.js +6 -7
  138. package/dist/src/components/struct/declaration.js.map +1 -0
  139. package/dist/src/components/struct/declaration.test.js +32 -40
  140. package/dist/src/components/struct/declaration.test.js.map +1 -0
  141. package/dist/src/components/type-parameters/type-parameter-constraints.js +2 -1
  142. package/dist/src/components/type-parameters/type-parameter-constraints.js.map +1 -0
  143. package/dist/src/components/type-parameters/type-parameter-constraints.test.js +2 -1
  144. package/dist/src/components/type-parameters/type-parameter-constraints.test.js.map +1 -0
  145. package/dist/src/components/type-parameters/type-parameter.d.ts.map +1 -1
  146. package/dist/src/components/type-parameters/type-parameter.js +9 -11
  147. package/dist/src/components/type-parameters/type-parameter.js.map +1 -0
  148. package/dist/src/components/type-parameters/type-parameters.js +2 -1
  149. package/dist/src/components/type-parameters/type-parameters.js.map +1 -0
  150. package/dist/src/components/type-parameters/type-parameters.test.js +5 -4
  151. package/dist/src/components/type-parameters/type-parameters.test.js.map +1 -0
  152. package/dist/src/components/var/declaration.d.ts.map +1 -1
  153. package/dist/src/components/var/declaration.js +8 -9
  154. package/dist/src/components/var/declaration.js.map +1 -0
  155. package/dist/src/components/var/declaration.test.js +13 -21
  156. package/dist/src/components/var/declaration.test.js.map +1 -0
  157. package/dist/src/contexts/global-namespace.d.ts +5 -0
  158. package/dist/src/contexts/global-namespace.d.ts.map +1 -0
  159. package/dist/src/contexts/global-namespace.js +25 -0
  160. package/dist/src/contexts/global-namespace.js.map +1 -0
  161. package/dist/src/contexts/namespace.d.ts +8 -0
  162. package/dist/src/contexts/namespace.d.ts.map +1 -0
  163. package/dist/src/contexts/namespace.js +6 -0
  164. package/dist/src/contexts/namespace.js.map +1 -0
  165. package/dist/src/index.d.ts +1 -0
  166. package/dist/src/index.d.ts.map +1 -1
  167. package/dist/src/index.js +3 -1
  168. package/dist/src/index.js.map +1 -0
  169. package/dist/src/modifiers.d.ts +11 -0
  170. package/dist/src/modifiers.d.ts.map +1 -1
  171. package/dist/src/modifiers.js +2 -1
  172. package/dist/src/modifiers.js.map +1 -0
  173. package/dist/src/name-policy.js +2 -1
  174. package/dist/src/name-policy.js.map +1 -0
  175. package/dist/src/scopes/class.d.ts +10 -0
  176. package/dist/src/scopes/class.d.ts.map +1 -0
  177. package/dist/src/scopes/class.js +11 -0
  178. package/dist/src/scopes/class.js.map +1 -0
  179. package/dist/src/scopes/contexts.d.ts +9 -0
  180. package/dist/src/scopes/contexts.d.ts.map +1 -0
  181. package/dist/src/scopes/contexts.js +34 -0
  182. package/dist/src/scopes/contexts.js.map +1 -0
  183. package/dist/src/scopes/csharp.d.ts +8 -0
  184. package/dist/src/scopes/csharp.d.ts.map +1 -0
  185. package/dist/src/scopes/csharp.js +12 -0
  186. package/dist/src/scopes/csharp.js.map +1 -0
  187. package/dist/src/scopes/factories.d.ts +9 -0
  188. package/dist/src/scopes/factories.d.ts.map +1 -0
  189. package/dist/src/scopes/factories.js +24 -0
  190. package/dist/src/scopes/factories.js.map +1 -0
  191. package/dist/src/scopes/index.d.ts +10 -0
  192. package/dist/src/scopes/index.d.ts.map +1 -0
  193. package/dist/src/scopes/index.js +10 -0
  194. package/dist/src/scopes/index.js.map +1 -0
  195. package/dist/src/scopes/lexical.d.ts +7 -0
  196. package/dist/src/scopes/lexical.d.ts.map +1 -0
  197. package/dist/src/scopes/lexical.js +8 -0
  198. package/dist/src/scopes/lexical.js.map +1 -0
  199. package/dist/src/scopes/method.d.ts +9 -0
  200. package/dist/src/scopes/method.d.ts.map +1 -0
  201. package/dist/src/scopes/method.js +14 -0
  202. package/dist/src/scopes/method.js.map +1 -0
  203. package/dist/src/scopes/named-type.d.ts +22 -0
  204. package/dist/src/scopes/named-type.d.ts.map +1 -0
  205. package/dist/src/scopes/named-type.js +33 -0
  206. package/dist/src/scopes/named-type.js.map +1 -0
  207. package/dist/src/scopes/namespace.d.ts +11 -0
  208. package/dist/src/scopes/namespace.d.ts.map +1 -0
  209. package/dist/src/scopes/namespace.js +39 -0
  210. package/dist/src/scopes/namespace.js.map +1 -0
  211. package/dist/src/scopes/source-file.d.ts +16 -0
  212. package/dist/src/scopes/source-file.d.ts.map +1 -0
  213. package/dist/src/scopes/source-file.js +44 -0
  214. package/dist/src/scopes/source-file.js.map +1 -0
  215. package/dist/src/symbols/csharp.d.ts +76 -0
  216. package/dist/src/symbols/csharp.d.ts.map +1 -0
  217. package/dist/src/symbols/csharp.js +223 -0
  218. package/dist/src/symbols/csharp.js.map +1 -0
  219. package/dist/src/symbols/factories.d.ts +25 -0
  220. package/dist/src/symbols/factories.d.ts.map +1 -0
  221. package/dist/src/symbols/factories.js +87 -0
  222. package/dist/src/symbols/factories.js.map +1 -0
  223. package/dist/src/symbols/index.d.ts +5 -2
  224. package/dist/src/symbols/index.d.ts.map +1 -1
  225. package/dist/src/symbols/index.js +6 -2
  226. package/dist/src/symbols/index.js.map +1 -0
  227. package/dist/src/symbols/method.d.ts +13 -0
  228. package/dist/src/symbols/method.d.ts.map +1 -0
  229. package/dist/src/symbols/method.js +16 -0
  230. package/dist/src/symbols/method.js.map +1 -0
  231. package/dist/src/symbols/named-type.d.ts +19 -0
  232. package/dist/src/symbols/named-type.d.ts.map +1 -0
  233. package/dist/src/symbols/named-type.js +31 -0
  234. package/dist/src/symbols/named-type.js.map +1 -0
  235. package/dist/src/symbols/namespace.d.ts +22 -0
  236. package/dist/src/symbols/namespace.d.ts.map +1 -0
  237. package/dist/src/symbols/namespace.js +45 -0
  238. package/dist/src/symbols/namespace.js.map +1 -0
  239. package/dist/src/symbols/reference.d.ts +2 -2
  240. package/dist/src/symbols/reference.d.ts.map +1 -1
  241. package/dist/src/symbols/reference.js +38 -44
  242. package/dist/src/symbols/reference.js.map +1 -0
  243. package/dist/test/project-directory.test.js +14 -17
  244. package/dist/test/project-directory.test.js.map +1 -0
  245. package/dist/test/sourcefile.test.js +8 -19
  246. package/dist/test/sourcefile.test.js.map +1 -0
  247. package/dist/test/using.test.js +20 -17
  248. package/dist/test/using.test.js.map +1 -0
  249. package/dist/test/utils.js +4 -3
  250. package/dist/test/utils.js.map +1 -0
  251. package/dist/test/vitest.setup.js +2 -1
  252. package/dist/test/vitest.setup.js.map +1 -0
  253. package/dist/tsconfig.tsbuildinfo +1 -1
  254. package/package.json +9 -3
  255. package/src/components/Declaration.tsx +3 -6
  256. package/src/components/Reference.tsx +3 -1
  257. package/src/components/SourceFile.tsx +68 -55
  258. package/src/components/UsingDirective.tsx +12 -2
  259. package/src/components/class/declaration.test.tsx +120 -143
  260. package/src/components/class/declaration.tsx +19 -32
  261. package/src/components/constructor/constructor.test.tsx +10 -16
  262. package/src/components/constructor/constructor.tsx +13 -27
  263. package/src/components/enum/declaration.ref.test.tsx +93 -0
  264. package/src/components/enum/declaration.test.tsx +34 -0
  265. package/src/components/enum/declaration.tsx +65 -0
  266. package/src/components/enum/member.test.tsx +24 -0
  267. package/src/components/enum/member.tsx +36 -0
  268. package/src/components/field/field.test.tsx +7 -7
  269. package/src/components/field/field.tsx +12 -14
  270. package/src/components/index.ts +5 -2
  271. package/src/components/interface/declaration.test.tsx +26 -32
  272. package/src/components/interface/declaration.tsx +16 -18
  273. package/src/components/interface/method.test.tsx +38 -44
  274. package/src/components/interface/method.tsx +7 -19
  275. package/src/components/interface/property.test.tsx +11 -11
  276. package/src/components/interface/property.tsx +15 -33
  277. package/src/components/lexical-scope.tsx +29 -0
  278. package/src/components/method/method.test.tsx +11 -11
  279. package/src/components/method/method.tsx +12 -18
  280. package/src/components/method-scope.tsx +27 -0
  281. package/src/components/namespace-scopes.tsx +44 -0
  282. package/src/components/namespace.ref.test.tsx +139 -0
  283. package/src/components/namespace.test.tsx +52 -0
  284. package/src/components/namespace.tsx +45 -0
  285. package/src/components/parameters/parameters.test.tsx +71 -0
  286. package/src/components/parameters/parameters.tsx +9 -16
  287. package/src/components/property/property.test.tsx +14 -14
  288. package/src/components/property/property.tsx +17 -38
  289. package/src/components/record/declaration.test.tsx +5 -12
  290. package/src/components/record/declaration.tsx +10 -11
  291. package/src/components/struct/declaration.test.tsx +16 -22
  292. package/src/components/struct/declaration.tsx +4 -6
  293. package/src/components/type-parameters/type-parameter.tsx +14 -11
  294. package/src/components/type-parameters/type-parameters.test.tsx +4 -4
  295. package/src/components/var/declaration.test.tsx +8 -14
  296. package/src/components/var/declaration.tsx +12 -6
  297. package/src/contexts/global-namespace.ts +29 -0
  298. package/src/contexts/namespace.ts +13 -0
  299. package/src/index.ts +1 -0
  300. package/src/modifiers.ts +14 -0
  301. package/src/scopes/class.ts +12 -0
  302. package/src/scopes/contexts.ts +45 -0
  303. package/src/scopes/csharp.ts +18 -0
  304. package/src/scopes/factories.ts +45 -0
  305. package/src/scopes/index.ts +9 -0
  306. package/src/scopes/lexical.ts +10 -0
  307. package/src/scopes/method.ts +22 -0
  308. package/src/scopes/named-type.ts +44 -0
  309. package/src/scopes/namespace.ts +59 -0
  310. package/src/scopes/source-file.ts +67 -0
  311. package/src/symbols/csharp.ts +307 -0
  312. package/src/symbols/factories.ts +199 -0
  313. package/src/symbols/index.ts +5 -2
  314. package/src/symbols/method.ts +26 -0
  315. package/src/symbols/named-type.ts +54 -0
  316. package/src/symbols/namespace.ts +62 -0
  317. package/src/symbols/reference.ts +47 -50
  318. package/temp/api.json +6251 -2454
  319. package/test/project-directory.test.tsx +12 -16
  320. package/test/sourcefile.test.tsx +7 -21
  321. package/test/using.test.tsx +18 -16
  322. package/test/utils.tsx +1 -1
  323. package/tsconfig.json +4 -1
  324. package/dist/src/components/EnumDeclaration.d.ts.map +0 -1
  325. package/dist/src/components/EnumDeclaration.js +0 -82
  326. package/dist/src/components/Namespace.d.ts +0 -11
  327. package/dist/src/components/Namespace.d.ts.map +0 -1
  328. package/dist/src/components/Namespace.js +0 -33
  329. package/dist/src/symbols/csharp-output-symbol.d.ts +0 -8
  330. package/dist/src/symbols/csharp-output-symbol.d.ts.map +0 -1
  331. package/dist/src/symbols/csharp-output-symbol.js +0 -19
  332. package/dist/src/symbols/scopes.d.ts +0 -20
  333. package/dist/src/symbols/scopes.d.ts.map +0 -1
  334. package/dist/src/symbols/scopes.js +0 -42
  335. package/dist/test/enum.test.d.ts +0 -2
  336. package/dist/test/enum.test.d.ts.map +0 -1
  337. package/dist/test/enum.test.js +0 -178
  338. package/dist/test/namespace.test.d.ts.map +0 -1
  339. package/dist/test/namespace.test.js +0 -81
  340. package/src/components/EnumDeclaration.tsx +0 -98
  341. package/src/components/Namespace.tsx +0 -35
  342. package/src/symbols/csharp-output-symbol.ts +0 -22
  343. package/src/symbols/scopes.ts +0 -61
  344. package/test/enum.test.tsx +0 -149
  345. package/test/namespace.test.tsx +0 -55
  346. /package/dist/{test → src/components}/namespace.test.d.ts +0 -0
@@ -1,54 +1,48 @@
1
- import * as core from "@alloy-js/core";
2
- import { useNamespace } from "../components/Namespace.js";
3
- import { useSourceFile } from "../components/SourceFile.js";
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 targetNamespaceCtx = useNamespace();
16
- const resolveResult = core.resolve(refkey);
17
- return core.memo(() => {
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
- targetDeclaration,
34
- pathDown
35
- } = resolveResult.value;
36
- const sourceNamespace = pathDown.find(v => {
37
- return v.kind === "namespace";
38
- });
39
- if (sourceNamespace && sourceNamespace.name !== targetNamespaceCtx.name) {
40
- // the source symbol is in a different namespace that the target refkey.
41
- // add the applicable using statement to the target's source file.
42
- const targetSrc = useSourceFile();
43
- targetSrc.addUsing(sourceNamespace.name);
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
- // we only need to build the fully-qualified name for members
47
- // TODO: possibly a subset of members
48
- const syms = pathDown.filter(v => {
49
- return v.kind === "member";
50
- }).map(s => s.owner);
51
- syms.push(targetDeclaration);
52
- return syms.map(sym => sym.name).join(".");
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,QA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;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
- public class TestClass1;
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
- public class TestClass2;
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
- public class TestClass1;
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
- public class TestClass2;
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,EAAEC,EAAE,QAAQ,QAAQ;AACnC,OAAO,KAAKC,MAAM,MAAM,iBAAiB;AAEzCD,EAAE,CAAC,6DAA6D,EAAE,MAAM;EACtE,MAAME,GAAG,GAAGL,IAAI,CAACM,MAAM,CAAAC,iBAAA,CACpBP,IAAI,CAACQ,MAAM;IAAA,IAAAC,SAAA;MAAA,OAAAF,iBAAA,CACTH,MAAM,CAACM,gBAAgB;QACtBC,IAAI;QACJC,IAAI;QACJC,OAAO;QACPC,WAAW;QAAA,IAAAL,SAAA;UAAA,OAAAF,iBAAA,CAEVH,MAAM,CAACW,SAAS;YAACJ,IAAI;YAAA,IAAAF,SAAA;cAAA,QAAAF,iBAAA,CACnBH,MAAM,CAACY,UAAU;gBAACJ,IAAI;gBAAA,IAAAH,SAAA;kBAAA,OAAAF,iBAAA,CACpBH,MAAM,CAACa,gBAAgB;oBAAA;oBAAQN,IAAI;kBAAA;gBAAA;cAAA,IAAAJ,iBAAA,CAErCH,MAAM,CAACY,UAAU;gBAACJ,IAAI;gBAAA,IAAAH,SAAA;kBAAA,OAAAF,iBAAA,CACpBH,MAAM,CAACa,gBAAgB;oBAAA;oBAAQN,IAAI;kBAAA;gBAAA;cAAA;YAAA;UAAA;QAAA;MAAA;IAAA;EAAA,EAK9C,CAAC;EAED,MAAMO,OAAO,GAAGb,GAAG,CAACc,QAAQ,CAAC,CAAC,CAAyB;EAEvDjB,MAAM,CAACgB,OAAO,CAACN,IAAI,CAAC,CAACQ,MAAM,CAAC,wBAAwB,CAAC;EACrDlB,MAAM,CAACgB,OAAO,CAACC,QAAQ,CAAC,CAAC,CAA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AAC;EAC7ElB,MAAM,CAAEqB,MAAM,CAACJ,QAAQ,CAAC,CAAC,CAAC,CAA4BA,QAAQ,CAAC,CAC5DE,IAAI,CAACpB,QAAQ,CAACqB,CAAC;AACpB;AACA;AACA;AACA,GAAG,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -1,7 +1,7 @@
1
1
  import { createComponent 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 { expect, it } from "vitest";
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
- public class TestClass1;
39
- }
36
+ namespace TestCode;
37
+
38
+ public class TestClass1;
40
39
  `,
41
40
  "Test2.cs": coretest.d`
42
- namespace TestCode
43
- {
44
- public class TestClass2;
45
- }
41
+ namespace TestCode;
42
+
43
+ public class TestClass2;
46
44
  `
47
45
  });
48
46
  });
49
- it("throws when declaring a source file outside a namespace", () => {
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":[]}
@@ -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
- public class Input;
120
- public class Output;
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 class Client
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","Method","parameters","returns"],"sources":["../../test/using.test.tsx"],"sourcesContent":[null],"mappings":";AAAA,OAAO,KAAKA,IAAI,MAAM,gBAAgB;AACtC,OAAO,KAAKC,QAAQ,MAAM,wBAAwB;AAClD,SAASC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AACnC,OAAO,KAAKC,MAAM,MAAM,iBAAiB;AACzC,SAASC,kBAAkB,EAAEC,QAAQ;AAErCH,EAAE,CAAC,yBAAyB,EAAE,MAAM;EAClC,MAAMI,GAAG,GAAGP,IAAI,CAACQ,MAAM,CAAAC,iBAAA,CACpBT,IAAI,CAACU,MAAM;IAAA,IAAAC,SAAA;MAAA,OAAAF,iBAAA,CACTL,MAAM,CAACQ,SAAS;QAACC,IAAI;QAAA,IAAAF,SAAA;UAAA,OAAAF,iBAAA,CACnBL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AAA;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":[]}
@@ -9,8 +9,8 @@ export function TestNamespace(props) {
9
9
  return csharp.createCSharpNamePolicy();
10
10
  },
11
11
  get children() {
12
- return _$createComponent(csharp.Namespace, {
13
- name: "TestCode",
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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KAAK,MAAMc,IAAI,IAAIX,GAAG,CAACM,QAAQ,EAAE;MAC/B,IAAIK,IAAI,CAACC,IAAI,KAAK,MAAM,EAAE;QACxB,IAAID,IAAI,CAACd,IAAI,CAACgB,QAAQ,CAAChB,IAAI,CAAC,EAAE;UAC5B,OAAOc,IAAI;QACb;QACA;MACF,CAAC,MAAM;QACL,MAAMG,KAAK,GAAGL,cAAc,CAACE,IAAI,EAAEd,IAAI,CAAC;QACxC,IAAIiB,KAAK,EAAE;UACT,OAAOA,KAAK;QACd;MACF;IACF;IACA,OAAO,IAAI;EACb;AACF;AAEA,OAAO,SAASC,kBAAkBA,CAChCf,GAAyB,EACzBgB,aAAqC,EAC/B;EACN,KAAK,MAAM,CAACnB,IAAI,EAAES,QAAQ,CAAC,IAAIW,MAAM,CAACC,OAAO,CAACF,aAAa,CAAC,EAAE;IAC5D,MAAMZ,IAAI,GAAGC,QAAQ,CAACL,GAAG,EAAEH,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":[]}