@alloy-js/csharp 0.20.0-dev.1 → 0.20.0-dev.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (391) 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/UsingDirective.d.ts +5 -1
  13. package/dist/src/components/UsingDirective.d.ts.map +1 -1
  14. package/dist/src/components/UsingDirective.js +5 -2
  15. package/dist/src/components/UsingDirective.js.map +1 -0
  16. package/dist/src/components/access-expression/access-expression.d.ts +54 -0
  17. package/dist/src/components/access-expression/access-expression.d.ts.map +1 -0
  18. package/dist/src/components/access-expression/access-expression.js +277 -0
  19. package/dist/src/components/access-expression/access-expression.js.map +1 -0
  20. package/dist/src/components/access-expression/access-expression.test.d.ts +2 -0
  21. package/dist/src/components/access-expression/access-expression.test.d.ts.map +1 -0
  22. package/dist/src/components/access-expression/access-expression.test.js +336 -0
  23. package/dist/src/components/access-expression/access-expression.test.js.map +1 -0
  24. package/dist/src/components/access-expression/part-descriptors.d.ts +32 -0
  25. package/dist/src/components/access-expression/part-descriptors.d.ts.map +1 -0
  26. package/dist/src/components/access-expression/part-descriptors.js +99 -0
  27. package/dist/src/components/access-expression/part-descriptors.js.map +1 -0
  28. package/dist/src/components/attributes/attributes.js +2 -1
  29. package/dist/src/components/attributes/attributes.js.map +1 -0
  30. package/dist/src/components/attributes/attributes.test.js +2 -1
  31. package/dist/src/components/attributes/attributes.test.js.map +1 -0
  32. package/dist/src/components/class/declaration.d.ts +2 -2
  33. package/dist/src/components/class/declaration.d.ts.map +1 -1
  34. package/dist/src/components/class/declaration.js +21 -34
  35. package/dist/src/components/class/declaration.js.map +1 -0
  36. package/dist/src/components/class/declaration.test.js +199 -200
  37. package/dist/src/components/class/declaration.test.js.map +1 -0
  38. package/dist/src/components/constructor/constructor.d.ts.map +1 -1
  39. package/dist/src/components/constructor/constructor.js +13 -20
  40. package/dist/src/components/constructor/constructor.js.map +1 -0
  41. package/dist/src/components/constructor/constructor.test.js +12 -20
  42. package/dist/src/components/constructor/constructor.test.js.map +1 -0
  43. package/dist/src/components/doc/comment.js +2 -1
  44. package/dist/src/components/doc/comment.js.map +1 -0
  45. package/dist/src/components/doc/comment.test.js +2 -1
  46. package/dist/src/components/doc/comment.test.js.map +1 -0
  47. package/dist/src/components/doc/from-markdown.js +2 -1
  48. package/dist/src/components/doc/from-markdown.js.map +1 -0
  49. package/dist/src/components/doc/from-markdown.test.js +2 -1
  50. package/dist/src/components/doc/from-markdown.test.js.map +1 -0
  51. package/dist/src/components/{EnumDeclaration.d.ts → enum/declaration.d.ts} +6 -11
  52. package/dist/src/components/enum/declaration.d.ts.map +1 -0
  53. package/dist/src/components/enum/declaration.js +55 -0
  54. package/dist/src/components/enum/declaration.js.map +1 -0
  55. package/dist/src/components/enum/declaration.ref.test.d.ts +2 -0
  56. package/dist/src/components/enum/declaration.ref.test.d.ts.map +1 -0
  57. package/dist/src/components/enum/declaration.ref.test.js +121 -0
  58. package/dist/src/components/enum/declaration.ref.test.js.map +1 -0
  59. package/dist/src/components/enum/declaration.test.d.ts +2 -0
  60. package/dist/src/components/enum/declaration.test.d.ts.map +1 -0
  61. package/dist/src/components/enum/declaration.test.js +40 -0
  62. package/dist/src/components/enum/declaration.test.js.map +1 -0
  63. package/dist/src/components/enum/member.d.ts +7 -0
  64. package/dist/src/components/enum/member.d.ts.map +1 -0
  65. package/dist/src/components/enum/member.js +30 -0
  66. package/dist/src/components/enum/member.js.map +1 -0
  67. package/dist/src/components/enum/member.test.d.ts +2 -0
  68. package/dist/src/components/enum/member.test.d.ts.map +1 -0
  69. package/dist/src/components/enum/member.test.js +29 -0
  70. package/dist/src/components/enum/member.test.js.map +1 -0
  71. package/dist/src/components/field/field.d.ts.map +1 -1
  72. package/dist/src/components/field/field.js +11 -18
  73. package/dist/src/components/field/field.js.map +1 -0
  74. package/dist/src/components/field/field.test.js +9 -8
  75. package/dist/src/components/field/field.test.js.map +1 -0
  76. package/dist/src/components/index.d.ts +7 -3
  77. package/dist/src/components/index.d.ts.map +1 -1
  78. package/dist/src/components/index.js +9 -4
  79. package/dist/src/components/index.js.map +1 -0
  80. package/dist/src/components/interface/declaration.d.ts.map +1 -1
  81. package/dist/src/components/interface/declaration.js +21 -22
  82. package/dist/src/components/interface/declaration.js.map +1 -0
  83. package/dist/src/components/interface/declaration.test.js +28 -36
  84. package/dist/src/components/interface/declaration.test.js.map +1 -0
  85. package/dist/src/components/interface/method.d.ts.map +1 -1
  86. package/dist/src/components/interface/method.js +9 -19
  87. package/dist/src/components/interface/method.js.map +1 -0
  88. package/dist/src/components/interface/method.test.js +40 -48
  89. package/dist/src/components/interface/method.test.js.map +1 -0
  90. package/dist/src/components/interface/property.d.ts.map +1 -1
  91. package/dist/src/components/interface/property.js +23 -40
  92. package/dist/src/components/interface/property.js.map +1 -0
  93. package/dist/src/components/interface/property.test.js +13 -12
  94. package/dist/src/components/interface/property.test.js.map +1 -0
  95. package/dist/src/components/invocation-expression/invocation-expression.d.ts +29 -0
  96. package/dist/src/components/invocation-expression/invocation-expression.d.ts.map +1 -0
  97. package/dist/src/components/invocation-expression/invocation-expression.js +70 -0
  98. package/dist/src/components/invocation-expression/invocation-expression.js.map +1 -0
  99. package/dist/src/components/invocation-expression/invocation-expression.test.d.ts +2 -0
  100. package/dist/src/components/invocation-expression/invocation-expression.test.d.ts.map +1 -0
  101. package/dist/src/components/invocation-expression/invocation-expression.test.js +105 -0
  102. package/dist/src/components/invocation-expression/invocation-expression.test.js.map +1 -0
  103. package/dist/src/components/lexical-scope.d.ts +8 -0
  104. package/dist/src/components/lexical-scope.d.ts.map +1 -0
  105. package/dist/src/components/lexical-scope.js +25 -0
  106. package/dist/src/components/lexical-scope.js.map +1 -0
  107. package/dist/src/components/method/method.d.ts +5 -2
  108. package/dist/src/components/method/method.d.ts.map +1 -1
  109. package/dist/src/components/method/method.js +9 -17
  110. package/dist/src/components/method/method.js.map +1 -0
  111. package/dist/src/components/method/method.test.js +13 -12
  112. package/dist/src/components/method/method.test.js.map +1 -0
  113. package/dist/src/components/method-scope.d.ts +8 -0
  114. package/dist/src/components/method-scope.d.ts.map +1 -0
  115. package/dist/src/components/method-scope.js +25 -0
  116. package/dist/src/components/method-scope.js.map +1 -0
  117. package/dist/src/components/namespace-scopes.d.ts +13 -0
  118. package/dist/src/components/namespace-scopes.d.ts.map +1 -0
  119. package/dist/src/components/namespace-scopes.js +45 -0
  120. package/dist/src/components/namespace-scopes.js.map +1 -0
  121. package/dist/src/components/namespace.d.ts +7 -0
  122. package/dist/src/components/namespace.d.ts.map +1 -0
  123. package/dist/src/components/namespace.js +47 -0
  124. package/dist/src/components/namespace.js.map +1 -0
  125. package/dist/src/components/namespace.ref.test.d.ts +2 -0
  126. package/dist/src/components/namespace.ref.test.d.ts.map +1 -0
  127. package/dist/src/components/namespace.ref.test.js +182 -0
  128. package/dist/src/components/namespace.ref.test.js.map +1 -0
  129. package/dist/src/components/namespace.test.d.ts.map +1 -0
  130. package/dist/src/components/namespace.test.js +79 -0
  131. package/dist/src/components/namespace.test.js.map +1 -0
  132. package/dist/src/components/parameters/parameters.d.ts +2 -3
  133. package/dist/src/components/parameters/parameters.d.ts.map +1 -1
  134. package/dist/src/components/parameters/parameters.js +15 -15
  135. package/dist/src/components/parameters/parameters.js.map +1 -0
  136. package/dist/src/components/parameters/parameters.test.d.ts +2 -0
  137. package/dist/src/components/parameters/parameters.test.d.ts.map +1 -0
  138. package/dist/src/components/parameters/parameters.test.js +154 -0
  139. package/dist/src/components/parameters/parameters.test.js.map +1 -0
  140. package/dist/src/components/property/property.d.ts +2 -2
  141. package/dist/src/components/property/property.d.ts.map +1 -1
  142. package/dist/src/components/property/property.js +30 -40
  143. package/dist/src/components/property/property.js.map +1 -0
  144. package/dist/src/components/property/property.test.js +16 -15
  145. package/dist/src/components/property/property.test.js.map +1 -0
  146. package/dist/src/components/record/declaration.d.ts +18 -0
  147. package/dist/src/components/record/declaration.d.ts.map +1 -1
  148. package/dist/src/components/record/declaration.js +21 -14
  149. package/dist/src/components/record/declaration.js.map +1 -0
  150. package/dist/src/components/record/declaration.test.js +52 -4
  151. package/dist/src/components/record/declaration.test.js.map +1 -0
  152. package/dist/src/components/source-file/source-file.d.ts +19 -0
  153. package/dist/src/components/source-file/source-file.d.ts.map +1 -0
  154. package/dist/src/components/source-file/source-file.js +59 -0
  155. package/dist/src/components/source-file/source-file.js.map +1 -0
  156. package/dist/src/components/source-file/source-file.test.d.ts +2 -0
  157. package/dist/src/components/source-file/source-file.test.d.ts.map +1 -0
  158. package/dist/src/components/source-file/source-file.test.js +136 -0
  159. package/dist/src/components/source-file/source-file.test.js.map +1 -0
  160. package/dist/src/components/stc/index.js +2 -1
  161. package/dist/src/components/stc/index.js.map +1 -0
  162. package/dist/src/components/struct/declaration.d.ts.map +1 -1
  163. package/dist/src/components/struct/declaration.js +6 -7
  164. package/dist/src/components/struct/declaration.js.map +1 -0
  165. package/dist/src/components/struct/declaration.test.js +32 -40
  166. package/dist/src/components/struct/declaration.test.js.map +1 -0
  167. package/dist/src/components/type-parameters/type-parameter-constraints.js +2 -1
  168. package/dist/src/components/type-parameters/type-parameter-constraints.js.map +1 -0
  169. package/dist/src/components/type-parameters/type-parameter-constraints.test.js +2 -1
  170. package/dist/src/components/type-parameters/type-parameter-constraints.test.js.map +1 -0
  171. package/dist/src/components/type-parameters/type-parameter.d.ts.map +1 -1
  172. package/dist/src/components/type-parameters/type-parameter.js +9 -11
  173. package/dist/src/components/type-parameters/type-parameter.js.map +1 -0
  174. package/dist/src/components/type-parameters/type-parameters.js +2 -1
  175. package/dist/src/components/type-parameters/type-parameters.js.map +1 -0
  176. package/dist/src/components/type-parameters/type-parameters.test.js +5 -4
  177. package/dist/src/components/type-parameters/type-parameters.test.js.map +1 -0
  178. package/dist/src/components/var/declaration.d.ts.map +1 -1
  179. package/dist/src/components/var/declaration.js +8 -9
  180. package/dist/src/components/var/declaration.js.map +1 -0
  181. package/dist/src/components/var/declaration.test.js +13 -21
  182. package/dist/src/components/var/declaration.test.js.map +1 -0
  183. package/dist/src/contexts/format-options.d.ts +5 -0
  184. package/dist/src/contexts/format-options.d.ts.map +1 -0
  185. package/dist/src/contexts/format-options.js +9 -0
  186. package/dist/src/contexts/format-options.js.map +1 -0
  187. package/dist/src/contexts/global-namespace.d.ts +5 -0
  188. package/dist/src/contexts/global-namespace.d.ts.map +1 -0
  189. package/dist/src/contexts/global-namespace.js +25 -0
  190. package/dist/src/contexts/global-namespace.js.map +1 -0
  191. package/dist/src/contexts/namespace.d.ts +8 -0
  192. package/dist/src/contexts/namespace.d.ts.map +1 -0
  193. package/dist/src/contexts/namespace.js +6 -0
  194. package/dist/src/contexts/namespace.js.map +1 -0
  195. package/dist/src/index.d.ts +2 -0
  196. package/dist/src/index.d.ts.map +1 -1
  197. package/dist/src/index.js +4 -1
  198. package/dist/src/index.js.map +1 -0
  199. package/dist/src/modifiers.d.ts +11 -0
  200. package/dist/src/modifiers.d.ts.map +1 -1
  201. package/dist/src/modifiers.js +2 -1
  202. package/dist/src/modifiers.js.map +1 -0
  203. package/dist/src/name-policy.js +2 -1
  204. package/dist/src/name-policy.js.map +1 -0
  205. package/dist/src/scopes/class.d.ts +10 -0
  206. package/dist/src/scopes/class.d.ts.map +1 -0
  207. package/dist/src/scopes/class.js +11 -0
  208. package/dist/src/scopes/class.js.map +1 -0
  209. package/dist/src/scopes/contexts.d.ts +9 -0
  210. package/dist/src/scopes/contexts.d.ts.map +1 -0
  211. package/dist/src/scopes/contexts.js +34 -0
  212. package/dist/src/scopes/contexts.js.map +1 -0
  213. package/dist/src/scopes/csharp.d.ts +10 -0
  214. package/dist/src/scopes/csharp.d.ts.map +1 -0
  215. package/dist/src/scopes/csharp.js +15 -0
  216. package/dist/src/scopes/csharp.js.map +1 -0
  217. package/dist/src/scopes/factories.d.ts +9 -0
  218. package/dist/src/scopes/factories.d.ts.map +1 -0
  219. package/dist/src/scopes/factories.js +24 -0
  220. package/dist/src/scopes/factories.js.map +1 -0
  221. package/dist/src/scopes/index.d.ts +10 -0
  222. package/dist/src/scopes/index.d.ts.map +1 -0
  223. package/dist/src/scopes/index.js +10 -0
  224. package/dist/src/scopes/index.js.map +1 -0
  225. package/dist/src/scopes/lexical.d.ts +7 -0
  226. package/dist/src/scopes/lexical.d.ts.map +1 -0
  227. package/dist/src/scopes/lexical.js +8 -0
  228. package/dist/src/scopes/lexical.js.map +1 -0
  229. package/dist/src/scopes/method.d.ts +9 -0
  230. package/dist/src/scopes/method.d.ts.map +1 -0
  231. package/dist/src/scopes/method.js +14 -0
  232. package/dist/src/scopes/method.js.map +1 -0
  233. package/dist/src/scopes/named-type.d.ts +22 -0
  234. package/dist/src/scopes/named-type.d.ts.map +1 -0
  235. package/dist/src/scopes/named-type.js +33 -0
  236. package/dist/src/scopes/named-type.js.map +1 -0
  237. package/dist/src/scopes/namespace.d.ts +11 -0
  238. package/dist/src/scopes/namespace.d.ts.map +1 -0
  239. package/dist/src/scopes/namespace.js +39 -0
  240. package/dist/src/scopes/namespace.js.map +1 -0
  241. package/dist/src/scopes/source-file.d.ts +16 -0
  242. package/dist/src/scopes/source-file.d.ts.map +1 -0
  243. package/dist/src/scopes/source-file.js +44 -0
  244. package/dist/src/scopes/source-file.js.map +1 -0
  245. package/dist/src/symbols/csharp.d.ts +87 -0
  246. package/dist/src/symbols/csharp.d.ts.map +1 -0
  247. package/dist/src/symbols/csharp.js +246 -0
  248. package/dist/src/symbols/csharp.js.map +1 -0
  249. package/dist/src/symbols/factories.d.ts +25 -0
  250. package/dist/src/symbols/factories.d.ts.map +1 -0
  251. package/dist/src/symbols/factories.js +93 -0
  252. package/dist/src/symbols/factories.js.map +1 -0
  253. package/dist/src/symbols/index.d.ts +5 -2
  254. package/dist/src/symbols/index.d.ts.map +1 -1
  255. package/dist/src/symbols/index.js +6 -2
  256. package/dist/src/symbols/index.js.map +1 -0
  257. package/dist/src/symbols/method.d.ts +13 -0
  258. package/dist/src/symbols/method.d.ts.map +1 -0
  259. package/dist/src/symbols/method.js +16 -0
  260. package/dist/src/symbols/method.js.map +1 -0
  261. package/dist/src/symbols/named-type.d.ts +19 -0
  262. package/dist/src/symbols/named-type.d.ts.map +1 -0
  263. package/dist/src/symbols/named-type.js +31 -0
  264. package/dist/src/symbols/named-type.js.map +1 -0
  265. package/dist/src/symbols/namespace.d.ts +22 -0
  266. package/dist/src/symbols/namespace.d.ts.map +1 -0
  267. package/dist/src/symbols/namespace.js +45 -0
  268. package/dist/src/symbols/namespace.js.map +1 -0
  269. package/dist/src/symbols/reference.d.ts +2 -2
  270. package/dist/src/symbols/reference.d.ts.map +1 -1
  271. package/dist/src/symbols/reference.js +50 -44
  272. package/dist/src/symbols/reference.js.map +1 -0
  273. package/dist/test/project-directory.test.js +20 -19
  274. package/dist/test/project-directory.test.js.map +1 -0
  275. package/dist/test/using.test.js +23 -21
  276. package/dist/test/using.test.js.map +1 -0
  277. package/dist/test/utils.d.ts.map +1 -1
  278. package/dist/test/utils.js +7 -4
  279. package/dist/test/utils.js.map +1 -0
  280. package/dist/test/vitest.setup.js +2 -1
  281. package/dist/test/vitest.setup.js.map +1 -0
  282. package/dist/tsconfig.tsbuildinfo +1 -1
  283. package/package.json +12 -6
  284. package/src/components/Declaration.tsx +3 -6
  285. package/src/components/Reference.tsx +3 -1
  286. package/src/components/UsingDirective.tsx +12 -2
  287. package/src/components/access-expression/access-expression.test.tsx +284 -0
  288. package/src/components/access-expression/access-expression.tsx +375 -0
  289. package/src/components/access-expression/part-descriptors.ts +175 -0
  290. package/src/components/class/declaration.test.tsx +142 -150
  291. package/src/components/class/declaration.tsx +20 -32
  292. package/src/components/constructor/constructor.test.tsx +10 -16
  293. package/src/components/constructor/constructor.tsx +13 -32
  294. package/src/components/enum/declaration.ref.test.tsx +93 -0
  295. package/src/components/enum/declaration.test.tsx +34 -0
  296. package/src/components/enum/declaration.tsx +65 -0
  297. package/src/components/enum/member.test.tsx +24 -0
  298. package/src/components/enum/member.tsx +36 -0
  299. package/src/components/field/field.test.tsx +7 -7
  300. package/src/components/field/field.tsx +12 -22
  301. package/src/components/index.ts +7 -3
  302. package/src/components/interface/declaration.test.tsx +26 -32
  303. package/src/components/interface/declaration.tsx +16 -18
  304. package/src/components/interface/method.test.tsx +38 -44
  305. package/src/components/interface/method.tsx +7 -20
  306. package/src/components/interface/property.test.tsx +11 -11
  307. package/src/components/interface/property.tsx +15 -34
  308. package/src/components/invocation-expression/invocation-expression.test.tsx +101 -0
  309. package/src/components/invocation-expression/invocation-expression.tsx +60 -0
  310. package/src/components/lexical-scope.tsx +29 -0
  311. package/src/components/method/method.test.tsx +11 -11
  312. package/src/components/method/method.tsx +12 -23
  313. package/src/components/method-scope.tsx +27 -0
  314. package/src/components/namespace-scopes.tsx +44 -0
  315. package/src/components/namespace.ref.test.tsx +139 -0
  316. package/src/components/namespace.test.tsx +52 -0
  317. package/src/components/namespace.tsx +45 -0
  318. package/src/components/parameters/parameters.test.tsx +117 -0
  319. package/src/components/parameters/parameters.tsx +11 -23
  320. package/src/components/property/property.test.tsx +14 -14
  321. package/src/components/property/property.tsx +23 -41
  322. package/src/components/record/declaration.test.tsx +47 -3
  323. package/src/components/record/declaration.tsx +34 -11
  324. package/src/components/source-file/source-file.test.tsx +96 -0
  325. package/src/components/source-file/source-file.tsx +98 -0
  326. package/src/components/struct/declaration.test.tsx +16 -22
  327. package/src/components/struct/declaration.tsx +4 -6
  328. package/src/components/type-parameters/type-parameter.tsx +14 -11
  329. package/src/components/type-parameters/type-parameters.test.tsx +4 -4
  330. package/src/components/var/declaration.test.tsx +8 -14
  331. package/src/components/var/declaration.tsx +12 -6
  332. package/src/contexts/format-options.ts +14 -0
  333. package/src/contexts/global-namespace.ts +29 -0
  334. package/src/contexts/namespace.ts +13 -0
  335. package/src/index.ts +2 -0
  336. package/src/modifiers.ts +14 -0
  337. package/src/scopes/class.ts +12 -0
  338. package/src/scopes/contexts.ts +45 -0
  339. package/src/scopes/csharp.ts +23 -0
  340. package/src/scopes/factories.ts +45 -0
  341. package/src/scopes/index.ts +9 -0
  342. package/src/scopes/lexical.ts +10 -0
  343. package/src/scopes/method.ts +22 -0
  344. package/src/scopes/named-type.ts +44 -0
  345. package/src/scopes/namespace.ts +59 -0
  346. package/src/scopes/source-file.ts +67 -0
  347. package/src/symbols/csharp.ts +339 -0
  348. package/src/symbols/factories.ts +215 -0
  349. package/src/symbols/index.ts +5 -2
  350. package/src/symbols/method.ts +26 -0
  351. package/src/symbols/named-type.ts +54 -0
  352. package/src/symbols/namespace.ts +62 -0
  353. package/src/symbols/reference.tsx +64 -0
  354. package/temp/api.json +6919 -2532
  355. package/test/project-directory.test.tsx +14 -16
  356. package/test/using.test.tsx +21 -21
  357. package/test/utils.tsx +2 -1
  358. package/tsconfig.json +4 -1
  359. package/tsdoc-metadata.json +1 -1
  360. package/dist/src/components/EnumDeclaration.d.ts.map +0 -1
  361. package/dist/src/components/EnumDeclaration.js +0 -85
  362. package/dist/src/components/Namespace.d.ts +0 -11
  363. package/dist/src/components/Namespace.d.ts.map +0 -1
  364. package/dist/src/components/Namespace.js +0 -33
  365. package/dist/src/components/SourceFile.d.ts +0 -14
  366. package/dist/src/components/SourceFile.d.ts.map +0 -1
  367. package/dist/src/components/SourceFile.js +0 -69
  368. package/dist/src/symbols/csharp-output-symbol.d.ts +0 -8
  369. package/dist/src/symbols/csharp-output-symbol.d.ts.map +0 -1
  370. package/dist/src/symbols/csharp-output-symbol.js +0 -19
  371. package/dist/src/symbols/scopes.d.ts +0 -14
  372. package/dist/src/symbols/scopes.d.ts.map +0 -1
  373. package/dist/src/symbols/scopes.js +0 -31
  374. package/dist/test/enum.test.d.ts +0 -2
  375. package/dist/test/enum.test.d.ts.map +0 -1
  376. package/dist/test/enum.test.js +0 -178
  377. package/dist/test/namespace.test.d.ts.map +0 -1
  378. package/dist/test/namespace.test.js +0 -81
  379. package/dist/test/sourcefile.test.d.ts +0 -2
  380. package/dist/test/sourcefile.test.d.ts.map +0 -1
  381. package/dist/test/sourcefile.test.js +0 -58
  382. package/src/components/EnumDeclaration.tsx +0 -99
  383. package/src/components/Namespace.tsx +0 -35
  384. package/src/components/SourceFile.tsx +0 -78
  385. package/src/symbols/csharp-output-symbol.ts +0 -22
  386. package/src/symbols/reference.ts +0 -65
  387. package/src/symbols/scopes.ts +0 -41
  388. package/test/enum.test.tsx +0 -149
  389. package/test/namespace.test.tsx +0 -55
  390. package/test/sourcefile.test.tsx +0 -47
  391. /package/dist/{test → src/components}/namespace.test.d.ts +0 -0
@@ -0,0 +1,336 @@
1
+ import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
2
+ import { ClassDeclaration } from "#components/class/declaration.js";
3
+ import { Method } from "#components/method/method.js";
4
+ import { TestNamespace } from "#test/utils.js";
5
+ import { List, namekey, printTree, renderTree } from "@alloy-js/core";
6
+ import { describe, expect, it } from "vitest";
7
+ import { CSharpSymbol } from "../../symbols/csharp.js";
8
+ import { AccessExpression } from "./access-expression.js";
9
+ it("makes a member access expression", () => {
10
+ const template = _$createComponent(AccessExpression, {
11
+ get children() {
12
+ return [_$createComponent(AccessExpression.Part, {
13
+ id: "Foo"
14
+ }), _$createComponent(AccessExpression.Part, {
15
+ id: "Bar"
16
+ })];
17
+ }
18
+ });
19
+ expect(template).toRenderTo(`Foo.Bar`);
20
+ });
21
+ it("makes an element access expression", () => {
22
+ const template = _$createComponent(AccessExpression, {
23
+ get children() {
24
+ return [_$createComponent(AccessExpression.Part, {
25
+ id: "Foo"
26
+ }), _$createComponent(AccessExpression.Part, {
27
+ index: 1
28
+ })];
29
+ }
30
+ });
31
+ expect(template).toRenderTo(`Foo[1]`);
32
+ });
33
+ it("makes a call expression", () => {
34
+ const template = _$createComponent(AccessExpression, {
35
+ get children() {
36
+ return [_$createComponent(AccessExpression.Part, {
37
+ id: "Foo"
38
+ }), _$createComponent(AccessExpression.Part, {
39
+ args: [1, 2, 3]
40
+ })];
41
+ }
42
+ });
43
+ expect(template).toRenderTo(`Foo(1, 2, 3)`);
44
+ });
45
+ it("makes an id part from a symbol", () => {
46
+ const symbol = new CSharpSymbol("Symbol", undefined);
47
+ const template = _$createComponent(AccessExpression, {
48
+ get children() {
49
+ return [_$createComponent(AccessExpression.Part, {
50
+ id: "Foo"
51
+ }), _$createComponent(AccessExpression.Part, {
52
+ symbol: symbol
53
+ })];
54
+ }
55
+ });
56
+ expect(template).toRenderTo(`Foo.Symbol`);
57
+ });
58
+ it("makes an id part from a symbol reactively", () => {
59
+ const symbol = new CSharpSymbol("Symbol", undefined);
60
+ const tree = renderTree(_$createComponent(AccessExpression, {
61
+ get children() {
62
+ return [_$createComponent(AccessExpression.Part, {
63
+ id: "Foo"
64
+ }), _$createComponent(AccessExpression.Part, {
65
+ symbol: symbol
66
+ })];
67
+ }
68
+ }));
69
+ expect(printTree(tree)).toEqual("Foo.Symbol");
70
+ symbol.name = "Bar";
71
+ expect(printTree(tree)).toEqual("Foo.Bar");
72
+ });
73
+ it("makes an id part from refkey, where the first part is a full reference, and subsequent parts are just the id", () => {
74
+ const methodKey = namekey("method");
75
+ const template = _$createComponent(TestNamespace, {
76
+ get children() {
77
+ return _$createComponent(List, {
78
+ get children() {
79
+ return [_$createComponent(ClassDeclaration, {
80
+ name: "MyClass",
81
+ get children() {
82
+ return _$createComponent(Method, {
83
+ name: methodKey
84
+ });
85
+ }
86
+ }), _$createComponent(AccessExpression, {
87
+ get children() {
88
+ return [_$createComponent(AccessExpression.Part, {
89
+ refkey: methodKey
90
+ }), _$createComponent(AccessExpression.Part, {
91
+ refkey: methodKey
92
+ })];
93
+ }
94
+ })];
95
+ }
96
+ });
97
+ }
98
+ });
99
+ expect(template).toRenderTo(`
100
+ class MyClass
101
+ {
102
+ void Method() {}
103
+ }
104
+ MyClass.Method.Method
105
+ `);
106
+ });
107
+ it("takes type args", () => {
108
+ const template = _$createComponent(AccessExpression, {
109
+ get children() {
110
+ return _$createComponent(AccessExpression.Part, {
111
+ id: "Foo",
112
+ typeArgs: ["Foo", "Bar"]
113
+ });
114
+ }
115
+ });
116
+ expect(template).toRenderTo(`Foo<Foo, Bar>`);
117
+ });
118
+ it("takes multiple indexer arguments", () => {
119
+ const template = _$createComponent(AccessExpression, {
120
+ get children() {
121
+ return [_$createComponent(AccessExpression.Part, {
122
+ id: "Foo"
123
+ }), _$createComponent(AccessExpression.Part, {
124
+ indexerArgs: ["arg1", "arg2"]
125
+ })];
126
+ }
127
+ });
128
+ expect(template).toRenderTo(`Foo[arg1, arg2]`);
129
+ });
130
+ it("allows nullable member access", () => {
131
+ const template = _$createComponent(AccessExpression, {
132
+ get children() {
133
+ return [_$createComponent(AccessExpression.Part, {
134
+ id: "Foo",
135
+ nullable: true
136
+ }), _$createComponent(AccessExpression.Part, {
137
+ id: "Bar"
138
+ })];
139
+ }
140
+ });
141
+ expect(template).toRenderTo(`Foo?.Bar`);
142
+ });
143
+ it("allows conditional member access", () => {
144
+ const template = _$createComponent(AccessExpression, {
145
+ get children() {
146
+ return [_$createComponent(AccessExpression.Part, {
147
+ id: "Foo"
148
+ }), _$createComponent(AccessExpression.Part, {
149
+ id: "Bar",
150
+ conditional: true
151
+ })];
152
+ }
153
+ });
154
+ expect(template).toRenderTo(`Foo?.Bar`);
155
+ });
156
+ it("allows nullable element access", () => {
157
+ const template = _$createComponent(AccessExpression, {
158
+ get children() {
159
+ return [_$createComponent(AccessExpression.Part, {
160
+ id: "Foo",
161
+ nullable: true
162
+ }), _$createComponent(AccessExpression.Part, {
163
+ index: 1
164
+ })];
165
+ }
166
+ });
167
+ expect(template).toRenderTo(`Foo?[1]`);
168
+ });
169
+ it("allows conditional element access", () => {
170
+ const template = _$createComponent(AccessExpression, {
171
+ get children() {
172
+ return [_$createComponent(AccessExpression.Part, {
173
+ id: "Foo"
174
+ }), _$createComponent(AccessExpression.Part, {
175
+ index: 1,
176
+ conditional: true
177
+ })];
178
+ }
179
+ });
180
+ expect(template).toRenderTo(`Foo?[1]`);
181
+ });
182
+ it("uses symbol information for nullability", () => {
183
+ const symbol = new CSharpSymbol("Symbol", undefined, {
184
+ isNullable: true
185
+ });
186
+ const typeSymbol = new CSharpSymbol("SomeType", undefined, {
187
+ isNullable: true
188
+ });
189
+ const typedSymbol = new CSharpSymbol("SomeValue", undefined, {
190
+ type: typeSymbol
191
+ });
192
+ const template = _$createComponent(AccessExpression, {
193
+ get children() {
194
+ return [_$createComponent(AccessExpression.Part, {
195
+ symbol: symbol
196
+ }), _$createComponent(AccessExpression.Part, {
197
+ symbol: typedSymbol
198
+ }), _$createComponent(AccessExpression.Part, {
199
+ id: "Foo"
200
+ })];
201
+ }
202
+ });
203
+ expect(template).toRenderTo(`Symbol?.SomeValue?.Foo`);
204
+ });
205
+ describe("formatting", () => {
206
+ it("breaks long identifier chains", () => {
207
+ const template = _$createComponent(AccessExpression, {
208
+ get children() {
209
+ return [_$createComponent(AccessExpression.Part, {
210
+ id: "Foo"
211
+ }), _$createComponent(AccessExpression.Part, {
212
+ id: "Foo"
213
+ }), _$createComponent(AccessExpression.Part, {
214
+ id: "Foo"
215
+ }), _$createComponent(AccessExpression.Part, {
216
+ id: "Foo"
217
+ }), _$createComponent(AccessExpression.Part, {
218
+ id: "Foo"
219
+ }), _$createComponent(AccessExpression.Part, {
220
+ id: "Foo"
221
+ })];
222
+ }
223
+ });
224
+ expect(template).toRenderTo(`
225
+ Foo.Foo
226
+ .Foo.Foo
227
+ .Foo.Foo
228
+ `, {
229
+ printWidth: 10
230
+ });
231
+ });
232
+ it("breaks long call expressions", () => {
233
+ const template = _$createComponent(AccessExpression, {
234
+ get children() {
235
+ return [_$createComponent(AccessExpression.Part, {
236
+ id: "Foo"
237
+ }), _$createComponent(AccessExpression.Part, {
238
+ id: "Bar"
239
+ }), _$createComponent(AccessExpression.Part, {
240
+ args: ["variable1", "variable2", "variable3"]
241
+ })];
242
+ }
243
+ });
244
+ expect(template).toRenderTo(`
245
+ Foo.Bar(
246
+ variable1,
247
+ variable2,
248
+ variable3
249
+ )
250
+ `, {
251
+ printWidth: 10
252
+ });
253
+ });
254
+ it("breaks long type args", () => {
255
+ const template = _$createComponent(AccessExpression, {
256
+ get children() {
257
+ return _$createComponent(AccessExpression.Part, {
258
+ id: "Foo",
259
+ typeArgs: ["Foo", "Bar", "Baz", "Qux"]
260
+ });
261
+ }
262
+ });
263
+ expect(template).toRenderTo(`
264
+ Foo<
265
+ Foo,
266
+ Bar,
267
+ Baz,
268
+ Qux
269
+ >
270
+ `, {
271
+ printWidth: 10
272
+ });
273
+ });
274
+ it("breaks long type args for second member", () => {
275
+ const template = _$createComponent(AccessExpression, {
276
+ get children() {
277
+ return [_$createComponent(AccessExpression.Part, {
278
+ id: "Foo"
279
+ }), _$createComponent(AccessExpression.Part, {
280
+ id: "Bar",
281
+ typeArgs: ["Foo", "Bar", "Baz", "Qux"]
282
+ })];
283
+ }
284
+ });
285
+ expect(template).toRenderTo(`
286
+ Foo
287
+ .Bar<
288
+ Foo,
289
+ Bar,
290
+ Baz,
291
+ Qux
292
+ >
293
+ `, {
294
+ printWidth: 10
295
+ });
296
+ });
297
+ it("formats builder pattern", () => {
298
+ const template = _$createComponent(AccessExpression, {
299
+ get children() {
300
+ return [_$createComponent(AccessExpression.Part, {
301
+ id: "Foo"
302
+ }), _$createComponent(AccessExpression.Part, {
303
+ id: "Bar"
304
+ }), _$createComponent(AccessExpression.Part, {
305
+ id: "Baz"
306
+ }), _$createComponent(AccessExpression.Part, {
307
+ args: true
308
+ }), _$createComponent(AccessExpression.Part, {
309
+ id: "Qux"
310
+ }), _$createComponent(AccessExpression.Part, {
311
+ id: "Quux",
312
+ typeArgs: ["TTypeOne", "TTypeTwo"]
313
+ }), _$createComponent(AccessExpression.Part, {
314
+ indexerArgs: ["arg1", "arg2"]
315
+ }), _$createComponent(AccessExpression.Part, {
316
+ args: true
317
+ })];
318
+ }
319
+ });
320
+ expect(template).toRenderTo(`
321
+ Foo.Bar
322
+ .Baz()
323
+ .Qux
324
+ .Quux<
325
+ TTypeOne,
326
+ TTypeTwo
327
+ >[
328
+ arg1,
329
+ arg2
330
+ ]()
331
+ `, {
332
+ printWidth: 10
333
+ });
334
+ });
335
+ });
336
+ //# sourceMappingURL=access-expression.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["ClassDeclaration","Method","TestNamespace","List","namekey","printTree","renderTree","describe","expect","it","CSharpSymbol","AccessExpression","template","_$createComponent","children","Part","id","toRenderTo","index","args","symbol","undefined","tree","toEqual","name","methodKey","refkey","typeArgs","indexerArgs","nullable","conditional","isNullable","typeSymbol","typedSymbol","type","printWidth"],"sources":["../../../../src/components/access-expression/access-expression.test.tsx"],"sourcesContent":[null],"mappings":";AAAA,SAASA,gBAAgB;AACzB,SAASC,MAAM;AACf,SAASC,aAAa;AACtB,SAASC,IAAI,EAAEC,OAAO,EAAEC,SAAS,EAAEC,UAAU,QAAQ,gBAAgB;AACrE,SAASC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AAC7C,SAASC,YAAY,QAAQ,yBAAyB;AACtD,SAASC,gBAAgB;AAEzBF,EAAE,CAAC,kCAAkC,EAAE,MAAM;EAC3C,MAAMG,QAAQ,GAAAC,iBAAA,CACXF,gBAAgB;IAAA,IAAAG,SAAA;MAAA,QAAAD,iBAAA,CACdF,gBAAgB,CAACI,IAAI;QAACC,EAAE;MAAA,IAAAH,iBAAA,CACxBF,gBAAgB,CAACI,IAAI;QAACC,EAAE;MAAA;IAAA;EAAA,EAE5B;EACDR,MAAM,CAACI,QAAQ,CAAC,CAACK,UAAU,CAAC,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CACXF,gBAAgB;MAAA,IAAAG,SAAA;QAAA,QAAAD,iBAAA,CACdF,gBAAgB,CAACI,IAAI;UAACC,EAAE;QAAA,IAAAH,iBAAA,CACxBF,gBAAgB,CAACI,IAAI;UAACC,EAAE;QAAA,IAAAH,iBAAA,CACxBF,gBAAgB,CAACI,IAAI;UAACC,EAAE;QAAA,IAAAH,iBAAA,CACxBF,gBAAgB,CAACI,IAAI;UAACI,IAAI;QAAA,IAAAN,iBAAA,CAC1BF,gBAAgB,CAACI,IAAI;UAACC,EAAE;QAAA,IAAAH,iBAAA,CACxBF,gBAAgB,CAACI,IAAI;UAACC,EAAE;UAAQW,QAAQ,EAAE,CAAC,UAAU,EAAE,UAAU;QAAC,IAAAd,iBAAA,CAClEF,gBAAgB,CAACI,IAAI;UAACa,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM;QAAC,IAAAf,iBAAA,CACnDF,gBAAgB,CAACI,IAAI;UAACI,IAAI;QAAA;MAAA;IAAA,EAE9B;IACDX,MAAM,CAACI,QAAQ,CAAC,CAACK,UAAU,CACzB;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,EACD;MAAEkB,UAAU,EAAE;IAAG,CACnB,CAAC;EACH,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,32 @@
1
+ import { Children } from "@alloy-js/core";
2
+ export interface PartDescriptorWithId extends PartDescriptorBase {
3
+ /**
4
+ * The identifier of the access expression part. Will use member access, so must be a valid
5
+ * C# identifier.
6
+ */
7
+ id: Children;
8
+ conditional: boolean;
9
+ typeArgs?: Children[];
10
+ }
11
+ export declare function isIdPart(part: PartDescriptor): part is PartDescriptorWithId;
12
+ export interface PartDescriptorWithIndex extends PartDescriptorBase {
13
+ /**
14
+ * The index of the access expression part. Will use element access.
15
+ */
16
+ indexerArgs: Children[];
17
+ conditional: boolean;
18
+ }
19
+ export declare function isIndexPart(part: PartDescriptor): part is PartDescriptorWithIndex;
20
+ export interface PartDescriptorWithArgs extends PartDescriptorBase {
21
+ args: Children[];
22
+ }
23
+ export declare function isArgsPart(part: PartDescriptor): part is PartDescriptorWithArgs;
24
+ export interface PartDescriptorBase {
25
+ nullable: boolean;
26
+ }
27
+ export type PartDescriptor = PartDescriptorWithId | PartDescriptorWithIndex | PartDescriptorWithArgs;
28
+ /**
29
+ * Build part descriptors from the children of a MemberExpression.
30
+ */
31
+ export declare function childrenToPartDescriptors(children: Children[]): PartDescriptor[];
32
+ //# sourceMappingURL=part-descriptors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"part-descriptors.d.ts","sourceRoot":"","sources":["../../../../src/components/access-expression/part-descriptors.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAOT,MAAM,gBAAgB,CAAC;AAOxB,MAAM,WAAW,oBAAqB,SAAQ,kBAAkB;IAC9D;;;OAGG;IACH,EAAE,EAAE,QAAQ,CAAC;IACb,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,QAAQ,EAAE,CAAC;CACvB;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,IAAI,oBAAoB,CAE3E;AAED,MAAM,WAAW,uBAAwB,SAAQ,kBAAkB;IACjE;;OAEG;IACH,WAAW,EAAE,QAAQ,EAAE,CAAC;IACxB,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,wBAAgB,WAAW,CACzB,IAAI,EAAE,cAAc,GACnB,IAAI,IAAI,uBAAuB,CAEjC;AAED,MAAM,WAAW,sBAAuB,SAAQ,kBAAkB;IAChE,IAAI,EAAE,QAAQ,EAAE,CAAC;CAClB;AAED,wBAAgB,UAAU,CACxB,IAAI,EAAE,cAAc,GACnB,IAAI,IAAI,sBAAsB,CAEhC;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,MAAM,cAAc,GACtB,oBAAoB,GACpB,uBAAuB,GACvB,sBAAsB,CAAC;AAE3B;;GAEG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,QAAQ,EAAE,GACnB,cAAc,EAAE,CAclB"}
@@ -0,0 +1,99 @@
1
+ import { computed, isComponentCreator, reactive, ref, symbolForRefkey } from "@alloy-js/core";
2
+ import { AccessExpression } from "./access-expression.js";
3
+ export function isIdPart(part) {
4
+ return "id" in part && part.id !== undefined;
5
+ }
6
+ export function isIndexPart(part) {
7
+ return "indexerArgs" in part && part.indexerArgs !== undefined;
8
+ }
9
+ export function isArgsPart(part) {
10
+ return "args" in part && part.args !== undefined;
11
+ }
12
+ /**
13
+ * Build part descriptors from the children of a MemberExpression.
14
+ */
15
+ export function childrenToPartDescriptors(children) {
16
+ const parts = [];
17
+ for (const child of children) {
18
+ if (!isComponentCreator(child, AccessExpression.Part)) {
19
+ // we ignore non-parts
20
+ continue;
21
+ }
22
+ parts.push(createPartDescriptorFromProps(child.props, child === children[0]));
23
+ }
24
+ return parts;
25
+ }
26
+ const exclusiveParts = ["children", "args", "refkey", "symbol", "id"];
27
+ /**
28
+ * Creates a reactive part descriptor from the given part props.
29
+ *
30
+ * @param partProps The props for the part.
31
+ * @param first Whether this is the first part in the expression. Refkeys are
32
+ * handled specially for the first part.
33
+ */
34
+ function createPartDescriptorFromProps(partProps, first) {
35
+ const foundProps = exclusiveParts.filter(key => {
36
+ return key in partProps;
37
+ });
38
+ if (foundProps.length > 1) {
39
+ throw new Error(`Only one of ${foundProps.join(", ")} can be used for a MemberExpression part at a time`);
40
+ }
41
+ const symbolSource = computed(() => {
42
+ if (partProps.refkey) {
43
+ return symbolForRefkey(partProps.refkey).value;
44
+ } else if (partProps.symbol) {
45
+ return partProps.symbol;
46
+ } else {
47
+ return undefined;
48
+ }
49
+ });
50
+ const part = {
51
+ id: computed(() => {
52
+ if (partProps.args || partProps.index || partProps.indexerArgs) {
53
+ return undefined;
54
+ } else if (partProps.children !== undefined) {
55
+ return partProps.children;
56
+ } else if (first && partProps.refkey) {
57
+ return partProps.refkey;
58
+ } else if (partProps.id !== undefined) {
59
+ return partProps.id;
60
+ } else if (symbolSource.value) {
61
+ return escapeId(symbolSource.value.name);
62
+ } else {
63
+ return "<unresolved symbol>";
64
+ }
65
+ }),
66
+ indexerArgs: computed(() => {
67
+ if (partProps.indexerArgs) {
68
+ return partProps.indexerArgs;
69
+ }
70
+ if (partProps.index !== undefined) {
71
+ return [partProps.index];
72
+ }
73
+ return [];
74
+ }),
75
+ conditional: computed(() => {
76
+ return !!partProps.conditional;
77
+ }),
78
+ nullable: computed(() => {
79
+ if (partProps.nullable) {
80
+ return true;
81
+ }
82
+ if (symbolSource.value) {
83
+ return symbolSource.value.isNullable;
84
+ }
85
+ return false;
86
+ }),
87
+ args: ref(partProps.args === true ? [] : partProps.args),
88
+ typeArgs: ref(partProps.typeArgs)
89
+ };
90
+ return reactive(part);
91
+ }
92
+
93
+ /**
94
+ * replaces quotes with escaped quotes
95
+ */
96
+ function escapeId(id) {
97
+ return id.replace(/"/g, '\\"');
98
+ }
99
+ //# sourceMappingURL=part-descriptors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["computed","isComponentCreator","reactive","ref","symbolForRefkey","AccessExpression","isIdPart","part","id","undefined","isIndexPart","indexerArgs","isArgsPart","args","childrenToPartDescriptors","children","parts","child","Part","push","createPartDescriptorFromProps","props","exclusiveParts","partProps","first","foundProps","filter","key","length","Error","join","symbolSource","refkey","value","symbol","index","escapeId","name","conditional","nullable","isNullable","typeArgs","replace"],"sources":["../../../../src/components/access-expression/part-descriptors.ts"],"sourcesContent":[null],"mappings":"AAAA,SAEEA,QAAQ,EACRC,kBAAkB,EAClBC,QAAQ,EACRC,GAAG,EACHC,eAAe,QAEV,gBAAgB;AAEvB,SACEC,gBAAgB;AAclB,OAAO,SAASC,QAAQA,CAACC,IAAoB,EAAgC;EAC3E,OAAO,IAAI,IAAIA,IAAI,IAAIA,IAAI,CAACC,EAAE,KAAKC,SAAS;AAC9C;AAUA,OAAO,SAAS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E,KAAK,EAAE;QACtB,OAAOF,YAAY,CAACE,KAAK,CAACO,UAAU;MACtC;MAEA,OAAO,KAAK;IACd,CAAC,CAAC;IACF3B,IAAI,EAAEV,GAAG,CAAMoB,SAAS,CAACV,IAAI,KAAK,IAAI,GAAG,EAAE,GAAGU,SAAS,CAACV,IAAI,CAAC;IAC7D4B,QAAQ,EAAEtC,GAAG,CAAMoB,SAAS,CAACkB,QAAQ;EACvC,CAAC;EAED,OAAOvC,QAAQ,CAACK,IAAI,CAAC;AACvB;;AAEA;AACA;AACA;AACA,SAAS6B,QAAQA,CAAC5B,EAAU,EAAE;EAC5B,OAAOA,EAAE,CAACkC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;AAChC","ignoreList":[]}
@@ -59,4 +59,5 @@ export const Attribute = taggedComponent(AttributeTag, props => {
59
59
  }), ")"]), "]"];
60
60
  }
61
61
  });
62
- });
62
+ });
63
+ //# sourceMappingURL=attributes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["findKeyedChildren","For","Indent","taggedComponent","AttributeList","props","attributes","children","Attribute","tag","_$createComponent","each","line","arg","renderAttribute","_$memo","endline","length","_$createIntrinsic","attr","name","AttributeTag","Symbol","args","softline","comma"],"sources":["../../../../src/components/attributes/attributes.tsx"],"sourcesContent":[null],"mappings":";AAAA,SAEEA,iBAAiB,EACjBC,GAAG,EACHC,MAAM,EACNC,eAAe,QACV,gBAAgB;AAgBvB;AACA;AACA;AACA,OAAO,SAASC,aAAaA,CAACC,KAAyB,EAAE;EACvD,MAAMC,UAAU,GACdD,KAAK,CAACC,UAAU,KACfD,KAAK,CAACE,QAAQ,IAAIP,iBAAiB,CAACK,KAAK,CAACE,QAAQ,EAAEC,SAAS,CAACC,GAAG,CAAC,CAAC;EAEtE,IAAI,CAACH,UAAU,EAAE;IACf,OAAO,IAAI;EACb;EAEA,QAAAI,iBAAA,CAEKT,GAAG;IAACU,IAAI,EAAEL,UAAU;IAAEM,IAAI;IAAAL,QAAA,EACv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[TestB]
74
74
  `);
75
- });
75
+ });
76
+ //# sourceMappingURL=attributes.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["expect","it","Attribute","AttributeList","_$createComponent","name","toRenderTo","args","attributes","children"],"sources":["../../../../src/components/attributes/attributes.test.tsx"],"sourcesContent":[null],"mappings":";AAAA,SAASA,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AACnC,SAASC,SAAS,EAAEC,aAAa;AAEjCF,EAAE,CAAC,kBAAkB,EAAE,MAAM;EAC3BD,MAAM,CAAAI,iBAAA,CAAEF,SAAS;IAACG,IAAI;EAAA,EAAU,CAAC,CAACC,UAAU,CAAC;AAC/C;AACA,GAAG,CAAC;AACJ,CAAC,CAAC;AAEFL,EAAE,CAAC,kCAAkC,EAAE,MAAM;EAC3CD,MAAM,CAAAI,iBAAA,CAAEF,SAAS;IAACG,IAAI;IAAQE,IAAI,EAAE,CAAC,OAAO;EAAC,EAAI,CAAC,CAACD,UAAU,CAAC;AAChE;AACA,GAAG,CAAC;AACJ,CAAC,CAAC;AAEFL,EAAE,CAAC,oCAAoC,EAAE,MAAM;EAC7CD,MAAM,CAAAI,iBAAA,CAAEF,SAAS;IAACG,IAAI;IAAQE,IAAI,EAAE,CAAC,OAAO,EAAE,OAAO;EAAC,EAAI,CAAC,CAACD,UAAU,CAAC;AACzE;AACA,GAAG,CAAC;AACJ,CAAC,CAAC;AAEFL,EAAE,CAAC,iDAAiD,EAAE,MAAM;EAC1DD,MAAM,CAAAI,iBAAA,CACHD,aAAa;IAAA,IACZK,UAAUA,CAAA;MAAA,OAAE,CAAAJ,iBAAA,CAAEF,SAAS;QAACG,IAAI;MAAA,IAAAD,iBAAA,CAAcF,SAAS;QAACG,IAAI;MAAA,GAAY;IAAA;EAAA,EAExE,CAAC,CAACC,UAAU,CAAC;AACf;AACA;AACA,GAAG,CAAC;AACJ,CAAC,CAAC;AAEFL,EAAE,CAAC,4CAA4C,EAAE,MAAM;EACrDD,MAAM,CAAAI,iBAAA,CAAED,aAAa;IAACK,UAAU,EAAE,CAAC,OAAO,EAAE,OAAO;EAAC,EAAI,CAAC,CAACF,UAAU,CAAC;AACvE;AACA;AACA,GAAG,CAAC;AACJ,CAAC,CAAC;AAEFL,EAAE,CAAC,4CAA4C,EAAE,MAAM;EACrDD,MAAM,CAAAI,iBAAA,CACHD,aAAa;IACZK,UAAU,EAAE,CAAC;MAAEH,IAAI,EAAE;IAAQ,CAAC,EAAE;MAAEA,IAAI,EAAE,OAAO;MAAEE,IAAI,EAAE,CAAC,QAAQ;IAAE,CAAC;EAAC,EAExE,CAAC,CAACD,UAAU,CAAC;AACf;AACA;AACA,GAAG,CAAC;AACJ,CAAC,CAAC;AAEFL,EAAE,CAAC,qCAAqC,EAAE,MAAM;EAC9CD,MAAM,CAAAI,iBAAA,CACHD,aAAa;IAAA,IAAAM,SAAA;MAAA,QAAAL,iBAAA,CACXF,SAAS;QAACG,IAAI;MAAA,IAAAD,iBAAA,CACdF,SAAS;QAACG,IAAI;MAAA;IAAA;EAAA,EAEnB,CAAC,CAACC,UAAU,CAAC;AACf;AACA;AACA,GAAG,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import { Children, DeclarationProps, Refkey } from "@alloy-js/core";
1
+ import { Children, DeclarationProps, Namekey, Refkey } from "@alloy-js/core";
2
2
  import { AccessModifiers } from "../../modifiers.js";
3
3
  import { AttributesProp } from "../attributes/attributes.jsx";
4
4
  import { ParameterProps } from "../parameters/parameters.jsx";
@@ -10,7 +10,7 @@ export interface ClassModifiers {
10
10
  readonly static?: boolean;
11
11
  }
12
12
  export interface ClassDeclarationProps extends Omit<DeclarationProps, "nameKind">, AccessModifiers, ClassModifiers {
13
- name: string;
13
+ name: string | Namekey;
14
14
  /** Doc comment */
15
15
  doc?: Children;
16
16
  refkey?: Refkey;
@@ -1 +1 @@
1
- {"version":3,"file":"declaration.d.ts","sourceRoot":"","sources":["../../../../src/components/class/declaration.tsx"],"names":[],"mapp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
@@ -1,15 +1,14 @@
1
1
  import { memo as _$memo, createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
2
2
  import { Block, Declaration, join, Name, Scope } from "@alloy-js/core";
3
3
  import { computeModifiersPrefix, getAccessModifier, makeModifiers } from "../../modifiers.js";
4
- import { useCSharpNamePolicy } from "../../name-policy.js";
5
- import { CSharpOutputSymbol } from "../../symbols/csharp-output-symbol.js";
6
- import { CSharpMemberScope } from "../../symbols/scopes.js";
4
+ import { createClassScope } from "../../scopes/factories.js";
5
+ import { createNamedTypeSymbol } 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";
10
9
  import { TypeParameterConstraints } from "../type-parameters/type-parameter-constraints.js";
11
10
  import { TypeParameters } from "../type-parameters/type-parameters.js";
12
- const getClassModifiers = makeModifiers(["abstract", "partial", "sealed", "static"]);
11
+ const getClassModifiers = makeModifiers(["abstract", "sealed", "static", "partial"]);
13
12
 
14
13
  // properties for creating a class
15
14
 
@@ -38,18 +37,10 @@ const getClassModifiers = makeModifiers(["abstract", "partial", "sealed", "stati
38
37
  * ```
39
38
  */
40
39
  export function ClassDeclaration(props) {
41
- const name = useCSharpNamePolicy().getName(props.name, "class");
42
- const thisClassSymbol = new CSharpOutputSymbol(name, {
40
+ const thisClassSymbol = createNamedTypeSymbol(props.name, "class", {
43
41
  refkeys: props.refkey
44
42
  });
45
-
46
- // this creates a new scope for the class definition.
47
- // members will automatically "inherit" this scope so
48
- // that refkeys to them will produce the fully-qualified
49
- // name e.g. Foo.Bar.
50
- const thisClassScope = new CSharpMemberScope("class-decl", {
51
- owner: thisClassSymbol
52
- });
43
+ const thisClassScope = createClassScope(thisClassSymbol);
53
44
  const bases = [...(props.baseType ? [props.baseType] : []), ...(props.interfaceTypes || [])];
54
45
  const base = bases.length > 0 ? [" : ", _$memo(() => join(bases, {
55
46
  joiner: ", "
@@ -67,34 +58,30 @@ export function ClassDeclaration(props) {
67
58
  return props.attributes;
68
59
  },
69
60
  endline: true
70
- }), modifiers, "class ", _$createComponent(Name, {}), _$memo(() => _$memo(() => !!props.typeParameters)() && _$createComponent(TypeParameters, {
71
- get parameters() {
72
- return props.typeParameters;
73
- }
74
- })), _$memo(() => _$memo(() => !!props.primaryConstructor)() && _$createComponent(Scope, {
61
+ }), modifiers, "class ", _$createComponent(Name, {}), _$createComponent(Scope, {
75
62
  value: thisClassScope,
76
63
  get children() {
77
- return _$createComponent(Parameters, {
64
+ return [_$memo(() => _$memo(() => !!props.typeParameters)() && _$createComponent(TypeParameters, {
65
+ get parameters() {
66
+ return props.typeParameters;
67
+ }
68
+ })), _$memo(() => _$memo(() => !!props.primaryConstructor)() && _$createComponent(Parameters, {
78
69
  get parameters() {
79
70
  return props.primaryConstructor;
80
71
  }
81
- });
82
- }
83
- })), base, _$memo(() => _$memo(() => !!props.typeParameters)() && _$createComponent(TypeParameterConstraints, {
84
- get parameters() {
85
- return props.typeParameters;
86
- }
87
- })), _$memo(() => !props.children && ";"), _$memo(() => _$memo(() => !!props.children)() && _$createComponent(Block, {
88
- newline: true,
89
- get children() {
90
- return _$createComponent(Scope, {
91
- value: thisClassScope,
72
+ })), base, _$memo(() => _$memo(() => !!props.typeParameters)() && _$createComponent(TypeParameterConstraints, {
73
+ get parameters() {
74
+ return props.typeParameters;
75
+ }
76
+ })), _$memo(() => !props.children && ";"), _$memo(() => _$memo(() => !!props.children)() && _$createComponent(Block, {
77
+ newline: true,
92
78
  get children() {
93
79
  return props.children;
94
80
  }
95
- });
81
+ }))];
96
82
  }
97
- }))];
83
+ })];
98
84
  }
99
85
  });
100
- }
86
+ }
87
+ //# sourceMappingURL=declaration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Block","Declaration","join","Name","Scope","computeModifiersPrefix","getAccessModifier","makeModifiers","createClassScope","createNamedTypeSymbol","AttributeList","DocWhen","Parameters","TypeParameterConstraints","TypeParameters","getClassModifiers","ClassDeclaration","props","thisClassSymbol","name","refkeys","refkey","thisClassScope","bases","baseType","interfaceTypes","base","length","_$memo","joiner","modifiers","_$createComponent","symbol","children","doc","attributes","endline","value","typeParameters","parameters","primaryConstructor","newline"],"sources":["../../../../src/components/class/declaration.tsx"],"sourcesContent":[null],"mappings":";AAAA,SACEA,KAAK,EAELC,WAAW,EAEXC,IAAI,EACJC,IAAI,EAGJC,KAAK,QACA,gBAAgB;AACvB,SAEEC,sBAAsB,EACtBC,iBAAiB,EACjBC,aAAa,QACR,oBAAoB;AAC3B,SAASC,gBAAgB,QAAQ,2BAA2B;AAC5D,SAASC,qBAAqB,QAAQ,4BAA4B;AAClE,SAASC,aAAa;AACtB,SAASC,OAAO;AAChB,SAAyBC,UAAU;AACnC,SAASC,wBAAwB;AAEjC,SAASC,cAAc;AASvB,MAAMC,iBAAiB,GAAGR,aAAa,CAAiB,CACtD,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,SAAS,CACV,CAAC;;AAEF;;AAmEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASS,gBAAgBA,CAACC,KAA4B,EAAE;EAC7D,MAAMC,eAAe,GAAGT,qBAAqB,CAACQ,KAAK,CAACE,IAAI,EAAE,OAAO,EAAE;IACjEC,OAAO,EAAEH,KAAK,CAACI;EACjB,CAAC,CAAC;EAEF,MAAMC,cAAc,GAAGd,gBAAgB,CAACU,eAAe,CAAC;EAExD,MAAMK,KAAK,GAAG,CACZ,IAAIN,KAAK,CAACO,QAAQ,GAAG,CAACP,KAAK,CAACO,QAAQ,CAAC,GAAG,EAAE,CAAC,EAC3C,IAAIP,KAAK,CAACQ,cAAc,IAAI,EAAE,CAAC,CAChC;EACD,MAAMC,IAAI,GACRH,KAAK,CAACI,MAAM,GAAG,CAAC,WAAAC,MAAA,OAAS1B,IAAI,CAACqB,KAAK,EA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