@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,59 @@
1
+ import { createComponent as _$createComponent, memo as _$memo, mergeProps as _$mergeProps, createIntrinsic as _$createIntrinsic } from "@alloy-js/core/jsx-runtime";
2
+ import { NamespaceScopes } from "#components/namespace-scopes.js";
3
+ import { Reference } from "#components/Reference.js";
4
+ import { UsingDirective } from "#components/UsingDirective.js";
5
+ import { Block, computed, SourceFile as CoreSourceFile, Scope, useBinder } from "@alloy-js/core";
6
+ import { useCsharpFormatOptions } from "../../contexts/format-options.js";
7
+ import { getGlobalNamespace } from "../../contexts/global-namespace.js";
8
+ import { useNamespaceContext } from "../../contexts/namespace.js";
9
+ import { CSharpSourceFileScope } from "../../scopes/source-file.js";
10
+
11
+ /**
12
+ * Props for {@link SourceFile} component
13
+ */
14
+
15
+ /** A C# source file exists within the context of a namespace contains using statements and declarations */
16
+ export function SourceFile(props) {
17
+ const sourceFileScope = new CSharpSourceFileScope(props.path);
18
+ const nsContext = useNamespaceContext();
19
+ const globalNs = getGlobalNamespace(useBinder());
20
+ const nsSymbol = nsContext ? nsContext.symbol : globalNs;
21
+ const nsRef = nsContext ? nsContext.symbol.name : undefined;
22
+ const usings = computed(() => {
23
+ return Array.from(sourceFileScope.usings).concat(props.using ?? []);
24
+ });
25
+ const content = computed(() => _$createComponent(NamespaceScopes, {
26
+ symbol: nsSymbol,
27
+ get children() {
28
+ return props.children;
29
+ }
30
+ }));
31
+ const opts = useCsharpFormatOptions({
32
+ printWidth: props.printWidth,
33
+ tabWidth: props.tabWidth,
34
+ useTabs: props.useTabs
35
+ });
36
+ return _$createComponent(CoreSourceFile, _$mergeProps({
37
+ get path() {
38
+ return props.path;
39
+ },
40
+ filetype: "cs",
41
+ reference: Reference
42
+ }, opts, {
43
+ get children() {
44
+ return _$createComponent(Scope, {
45
+ value: sourceFileScope,
46
+ get children() {
47
+ return [_$memo(() => _$memo(() => !!(sourceFileScope.usings.size > 0 || props.using && props.using.length > 0))() && [_$createComponent(UsingDirective, {
48
+ get namespaces() {
49
+ return usings.value;
50
+ }
51
+ }), _$createIntrinsic("hbr", {}), _$createIntrinsic("hbr", {})]), _$memo(() => nsSymbol === globalNs ? content : ["namespace ", nsRef, _$memo(() => _$memo(() => !!sourceFileScope.hasBlockNamespace)() ? [" ", _$createComponent(Block, {
52
+ children: content
53
+ })] : [";", _$createIntrinsic("hbr", {}), _$createIntrinsic("hbr", {}), content])])];
54
+ }
55
+ });
56
+ }
57
+ }));
58
+ }
59
+ //# sourceMappingURL=source-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["NamespaceScopes","Reference","UsingDirective","Block","computed","SourceFile","CoreSourceFile","Scope","useBinder","useCsharpFormatOptions","getGlobalNamespace","useNamespaceContext","CSharpSourceFileScope","props","sourceFileScope","path","nsContext","globalNs","nsSymbol","symbol","nsRef","name","undefined","usings","Array","from","concat","using","content","_$createComponent","children","opts","printWidth","tabWidth","useTabs","_$mergeProps","filetype","reference","value","_$memo","size","length","namespaces","_$createIntrinsic","hasBlockNamespace"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AAK,CAACoB,QAAQ;IACxBC,OAAO,EAAErB,KAAK,CAACqB;EACjB,CAAC,CAAC;EAEF,OAAAL,iBAAA,CACGvB,cAAc,EAAA6B,YAAA;IAAA,IACbpB,IAAIA,CAAA;MAAA,OAAEF,KAAK,CAACE,IAAI;IAAA;IAChBqB,QAAQ;IACRC,SAAS,EAAEpC;EAAS,GAChB8B,IAAI;IAAA,IAAAD,SAAA;MAAA,OAAAD,iBAAA,CAEPtB,KAAK;QAAC+B,KAAK,EAAExB,eAAe;QAAA,IAAAgB,SAAA;UAAA,QAAAS,MAAA,OAC1BA,MAAA,UAACzB,eAAe,CAACS,MAAM,CAACiB,IAAI,GAAG,CAAC,IAC9B3B,KAAK,CAACc,KAAK,IAAId,KAAK,CAACc,KAAK,CAACc,MAAM,GAAG,CAAE,SAAAZ,iBAAA,CAEpC3B,cAAc;YAAA,IAACwC,UAAUA,CAAA;cAAA,OAAEnB,MAAM,CAACe,KAAK;YAAA;UAAA,IAAAK,iBAAA,aAAAA,iBAAA,YAI3C,GAAAJ,MAAA,OACArB,QAAQ,KAAKD,QAAQ,GACpBW,OAAO,kBAEMR,KAAK,EAAAmB,MAAA,OACfA,MAAA,SAAAzB,eAAe,CAAC8B,iBAAiB,OAE7B,GAAG,EAAAf,iBAAA,CACH1B,KAAK;YAAA2B,QAAA,EAAEF;UAAO,YAAAe,iBAAA,aAAAA,iBAAA,aAKdf,OAAO,CACP,EAEJ;QAAA;MAAA;IAAA;EAAA;AAKb","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=source-file.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source-file.test.d.ts","sourceRoot":"","sources":["../../../../src/components/source-file/source-file.test.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,136 @@
1
+ import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
2
+ import { ClassDeclaration } from "#components/class/declaration.js";
3
+ import { Namespace } from "#components/namespace.js";
4
+ import { FormatOptions, Indent, Output, Prose } from "@alloy-js/core";
5
+ import { describe, expect, it } from "vitest";
6
+ import { CSharpFormatOptions } from "../../contexts/format-options.js";
7
+ import { SourceFile } from "./source-file.js";
8
+ it("defines multiple source files with unique content", () => {
9
+ expect(_$createComponent(Output, {
10
+ get children() {
11
+ return _$createComponent(Namespace, {
12
+ name: "TestCode",
13
+ get children() {
14
+ return [_$createComponent(SourceFile, {
15
+ path: "Test1.cs",
16
+ get children() {
17
+ return _$createComponent(ClassDeclaration, {
18
+ "public": true,
19
+ name: "TestClass1"
20
+ });
21
+ }
22
+ }), _$createComponent(SourceFile, {
23
+ path: "Test2.cs",
24
+ get children() {
25
+ return _$createComponent(ClassDeclaration, {
26
+ "public": true,
27
+ name: "TestClass2"
28
+ });
29
+ }
30
+ })];
31
+ }
32
+ });
33
+ }
34
+ })).toRenderTo({
35
+ "Test1.cs": `
36
+ namespace TestCode;
37
+
38
+ public class TestClass1;
39
+ `,
40
+ "Test2.cs": `
41
+ namespace TestCode;
42
+
43
+ public class TestClass2;
44
+ `
45
+ });
46
+ });
47
+ describe("format options", () => {
48
+ function FileWithFormatOptions(props) {
49
+ return _$createComponent(CSharpFormatOptions, {
50
+ get value() {
51
+ return props.options;
52
+ },
53
+ get children() {
54
+ return _$createComponent(SourceFile, {
55
+ path: "hi.cs",
56
+ get children() {
57
+ return props.children;
58
+ }
59
+ });
60
+ }
61
+ });
62
+ }
63
+ it("respect tabWidth", () => {
64
+ expect(_$createComponent(FileWithFormatOptions, {
65
+ options: {
66
+ tabWidth: 5
67
+ },
68
+ get children() {
69
+ return ["hello", _$createComponent(Indent, {
70
+ children: "indented 5 spaces"
71
+ })];
72
+ }
73
+ })).toRenderTo(`
74
+ hello
75
+ indented 5 spaces
76
+ `);
77
+ });
78
+ it("respect useTabs", () => {
79
+ expect(_$createComponent(FileWithFormatOptions, {
80
+ options: {
81
+ useTabs: true
82
+ },
83
+ get children() {
84
+ return ["hello", _$createComponent(Indent, {
85
+ children: "indented with tabs"
86
+ })];
87
+ }
88
+ })).toRenderTo(`
89
+ hello
90
+ \tindented with tabs
91
+ `);
92
+ });
93
+ it("respect printWidth", () => {
94
+ expect(_$createComponent(FileWithFormatOptions, {
95
+ options: {
96
+ printWidth: 10
97
+ },
98
+ get children() {
99
+ return _$createComponent(Prose, {
100
+ children: "this is too long"
101
+ });
102
+ }
103
+ })).toRenderTo(`
104
+ this is
105
+ too long
106
+ `);
107
+ });
108
+ it("CSharpFormatOptions takes precedence over FormatOptions", () => {
109
+ expect(_$createComponent(FormatOptions, {
110
+ value: {
111
+ tabWidth: 5
112
+ },
113
+ get children() {
114
+ return _$createComponent(CSharpFormatOptions, {
115
+ value: {
116
+ tabWidth: 3
117
+ },
118
+ get children() {
119
+ return _$createComponent(SourceFile, {
120
+ path: "hi.cs",
121
+ get children() {
122
+ return ["hello", _$createComponent(Indent, {
123
+ children: "indented 3 spaces"
124
+ })];
125
+ }
126
+ });
127
+ }
128
+ });
129
+ }
130
+ })).toRenderTo(`
131
+ hello
132
+ indented 3 spaces
133
+ `);
134
+ });
135
+ });
136
+ //# sourceMappingURL=source-file.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["ClassDeclaration","Namespace","FormatOptions","Indent","Output","Prose","describe","expect","it","CSharpFormatOptions","SourceFile","_$createComponent","children","name","path","toRenderTo","FileWithFormatOptions","props","value","options","tabWidth","useTabs","printWidth"],"sources":["../../../../src/components/source-file/source-file.test.tsx"],"sourcesContent":[null],"mappings":";AAAA,SAASA,gBAAgB;AACzB,SAASC,SAAS;AAClB,SAAmBC,aAAa,EAAEC,MAAM,EAAEC,MAAM,EAAEC,KAAK,QAAQ,gBAAgB;AAC/E,SAASC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AAC7C,SAASC,mBAAmB,QAAQ,kCAAkC;AACtE,SAASC,UAAU;AAEnBF,EAAE,CAAC,mDAAmD,EAAE,MAAM;EAC5DD,MAAM,CAAAI,iBAAA,CACHP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,qBAAqB;MAACG,OAAO,EAAE;QAAEE,OAAO,EAAE;MAAK,CAAC;MAAA,IAAAT,SAAA;QAAA,iBAAAD,iBAAA,CAE9CR,MAAM;UAAAS,QAAA;QAAA;MAAA;IAAA,EAEX,CAAC,CAACG,UAAU,CAAC;AACjB;AACA;AACA,KAAK,CAAC;EACJ,CAAC,CAAC;EAEFP,EAAE,CAAC,oBAAoB,EAAE,MAAM;IAC7BD,MAAM,CAAAI,iBAAA,CACHK,qBAAqB;MAACG,OAAO,EAAE;QAAEG,UAAU,EAAE;MAAG,CAAC;MAAA,IAAAV,SAAA;QAAA,OAAAD,iBAAA,CAC/CN,KAAK;UAAAO,QAAA;QAAA;MAAA;IAAA,EAEV,CAAC,CAACG,UAAU,CAAC;AACjB;AACA;AACA,KAAK,CAAC;EACJ,CAAC,CAAC;EAEFP,EAAE,CAAC,yDAAyD,EAAE,MAAM;IAClED,MAAM,CAAAI,iBAAA,CACHT,aAAa;MAACgB,KAAK,EAAE;QAAEE,QAAQ,EAAE;MAAE,CAAC;MAAA,IAAAR,SAAA;QAAA,OAAAD,iBAAA,CAClCF,mBAAmB;UAACS,KAAK,EAAE;YAAEE,QAAQ,EAAE;UAAE,CAAC;UAAA,IAAAR,SAAA;YAAA,OAAAD,iBAAA,CACxCD,UAAU;cAACI,IAAI;cAAA,IAAAF,SAAA;gBAAA,iBAAAD,iBAAA,CAEbR,MAAM;kBAAAS,QAAA;gBAAA;cAAA;YAAA;UAAA;QAAA;MAAA;IAAA,EAIf,CAAC,CAACG,UAAU,CAAC;AACjB;AACA;AACA,KAAK,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -10,4 +10,5 @@ export const Parameter = core.stc(base.Parameter);
10
10
  export const Parameters = core.stc(base.Parameters);
11
11
  export const ProjectDirectory = core.stc(base.ProjectDirectory);
12
12
  export const UsingDirective = core.stc(base.UsingDirective);
13
- export const StructDeclaration = core.stc(base.StructDeclaration);
13
+ export const StructDeclaration = core.stc(base.StructDeclaration);
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["core","base","ClassDeclaration","stc","Constructor","Field","ClassMethod","Method","EnumDeclaration","EnumMember","Parameter","Parameters","ProjectDirectory","UsingDirective","StructDeclaration"],"sources":["../../../../src/components/stc/index.ts"],"sourcesContent":[null],"mappings":"AAAA,OAAO,KAAKA,IAAI,MAAM,gBAAgB;AACtC,OAAO,KAAKC,IAAI,MAAM,aAAa;AAEnC,OAAO,MAAMC,gBAAgB,GAAGF,IAAI,CAACG,GAAG,CAACF,IAAI,CAACC,gBAAgB,CAAC;AAC/D,OAAO,MAAME,WAAW,GAAGJ,IAAI,CAACG,GAAG,CAACF,IAAI,CAACG,WAAW,CAAC;AACrD,OAAO,MAAMC,KAAK,GAAGL,IAAI,CAACG,GAAG,CAACF,IAAI,CAACI,KAAK,CAAC;AACzC,OAAO,MAAMC,WAAW,GAAGN,IAAI,CAACG,GAAG,CAACF,IAAI,CAACM,MAAM,CAAC;AAChD,OAAO,MAAMC,eAAe,GAAGR,IAAI,CAACG,GAAG,CAACF,IAAI,CAACO,eAAe,CAAC;AAC7D,OAAO,MAAMC,UAAU,GAAGT,IAAI,CAACG,GAAG,CAACF,IAAI,CAACQ,UAAU,CAAC;AACnD,OAAO,MAAMC,SAAS,GAAGV,IAAI,CAACG,GAAG,CAACF,IAAI,CAACS,SAAS,CAAC;AACjD,OAAO,MAAMC,UAAU,GAAGX,IAAI,CAACG,GAAG,CAACF,IAAI,CAACU,UAAU,CAAC;AACnD,OAAO,MAAMC,gBAAgB,GAAGZ,IAAI,CAACG,GAAG,CAACF,IAAI,CAACW,gBAAgB,CAAC;AAC/D,OAAO,MAAMC,cAAc,GAAGb,IAAI,CAACG,GAAG,CAACF,IAAI,CAACY,cAAc,CAAC;AAC3D,OAAO,MAAMC,iBAAiB,GAAGd,IAAI,CAACG,GAAG,CAACF,IAAI,CAACa,iBAAiB,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"declaration.d.ts","sourceRoot":"","sources":["../../../../src/components/struct/declaration.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAC;AAEvC,OAAO,EACL,eAAe,EAIhB,MAAM,oBAAoB,CAAC;AAI5B,OAAO,EAAiB,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAI7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAG3E,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC5B;AAUD,MAAM,WAAW,sBACf,SAAQ,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,UAAU,CAAC,EAC7C,eAAe,EACf,eAAe;IACjB,IAAI,EAAE,MAAM,CAAC;IAEb,kBAAkB;IAClB,GAAG,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC;IACpB,MAAM,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC;IAErB;;;;;;;;;;;OAWG;IACH,cAAc,CAAC,EAAE,CAAC,kBAAkB,GAAG,MAAM,CAAC,EAAE,CAAC;IAEjD;;;;;;;;;;;;;;;OAeG;IACH,UAAU,CAAC,EAAE,cAAc,CAAC;IAE5B,wCAAwC;IACxC,cAAc,CAAC,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC;CAClC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,iBAwC9D"}
1
+ {"version":3,"file":"declaration.d.ts","sourceRoot":"","sources":["../../../../src/components/struct/declaration.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAC;AAEvC,OAAO,EACL,eAAe,EAIhB,MAAM,oBAAoB,CAAC;AAI5B,OAAO,EAAiB,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAI7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAG3E,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC5B;AAUD,MAAM,WAAW,sBACf,SAAQ,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,UAAU,CAAC,EAC7C,eAAe,EACf,eAAe;IACjB,IAAI,EAAE,MAAM,CAAC;IAEb,kBAAkB;IAClB,GAAG,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC;IACpB,MAAM,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC;IAErB;;;;;;;;;;;OAWG;IACH,cAAc,CAAC,EAAE,CAAC,kBAAkB,GAAG,MAAM,CAAC,EAAE,CAAC;IAEjD;;;;;;;;;;;;;;;OAeG;IACH,UAAU,CAAC,EAAE,cAAc,CAAC;IAE5B,wCAAwC;IACxC,cAAc,CAAC,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC;CAClC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,iBAsC9D"}
@@ -3,8 +3,8 @@ import * as core from "@alloy-js/core";
3
3
  import { join } from "@alloy-js/core";
4
4
  import { computeModifiersPrefix, getAccessModifier, makeModifiers } from "../../modifiers.js";
5
5
  import { useCSharpNamePolicy } from "../../name-policy.js";
6
- import { CSharpOutputSymbol } from "../../symbols/csharp-output-symbol.js";
7
- import { CSharpMemberScope } from "../../symbols/scopes.js";
6
+ import { createNamedTypeScope } from "../../scopes/factories.js";
7
+ import { createNamedTypeSymbol } from "../../symbols/factories.js";
8
8
  import { AttributeList } from "../attributes/attributes.js";
9
9
  import { DocWhen } from "../doc/comment.js";
10
10
  import { Name } from "../Name.js";
@@ -36,12 +36,10 @@ const getStructModifiers = makeModifiers(["new", "readonly", "ref", "partial"]);
36
36
  */
37
37
  export function StructDeclaration(props) {
38
38
  const name = useCSharpNamePolicy().getName(props.name, "struct");
39
- const thisStructSymbol = new CSharpOutputSymbol(name, {
39
+ const thisStructSymbol = createNamedTypeSymbol(name, "struct", {
40
40
  refkeys: props.refkey
41
41
  });
42
- const thisStructScope = new CSharpMemberScope("struct-decl", {
43
- owner: thisStructSymbol
44
- });
42
+ const thisStructScope = createNamedTypeScope(thisStructSymbol);
45
43
  const modifiers = computeModifiersPrefix([getAccessModifier(props), getStructModifiers(props)]);
46
44
  const base = props.interfaceTypes && props.interfaceTypes.length > 0 ? [" : ", _$memo(() => join(props.interfaceTypes, {
47
45
  joiner: ", "
@@ -79,4 +77,5 @@ export function StructDeclaration(props) {
79
77
  }) : ";")];
80
78
  }
81
79
  });
82
- }
80
+ }
81
+ //# sourceMappingURL=declaration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["core","join","computeModifiersPrefix","getAccessModifier","makeModifiers","useCSharpNamePolicy","createNamedTypeScope","createNamedTypeSymbol","AttributeList","DocWhen","Name","TypeParameterConstraints","TypeParameters","getStructModifiers","StructDeclaration","props","name","getName","thisStructSymbol","refkeys","refkey","thisStructScope","modifiers","base","interfaceTypes","length","_$memo","joiner","_$createComponent","Declaration","symbol","children","doc","attributes","endline","typeParameters","parameters","Block","newline","Scope","value"],"sources":["../../../../src/components/struct/declaration.tsx"],"sourcesContent":[null],"mappings":";AAAA,OAAO,KAAKA,IAAI,MAAM,gBAAgB;AACtC,SAASC,IAAI,QAAQ,gBAAgB;AACrC,SAEEC,sBAAsB,EACtBC,iBAAiB,EACjBC,aAAa,QACR,oBAAoB;AAC3B,SAASC,mBAAmB,QAAQ,s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IAAAJ,iBAAA,CACtBpB,aAAa;QAAA,IAACyB,UAAUA,CAAA;UAAA,OAAElB,KAAK,CAACkB,UAAU;QAAA;QAAEC,OAAO;MAAA,IACnDZ,SAAS,aAAAM,iBAAA,CAASlB,IAAI,OAAAgB,MAAA,OACtBA,MAAA,SAAAX,KAAK,CAACoB,cAAc,OAAAP,iBAAA,CAClBhB,cAAc;QAAA,IAACwB,UAAUA,CAAA;UAAA,OAAErB,KAAK,CAACoB,cAAc;QAAA;MAAA,EACjD,GACAZ,IAAI,EAAAG,MAAA,OACJA,MAAA,SAAAX,KAAK,CAACoB,cAAc,OAAAP,iBAAA,CAClBjB,wBAAwB;QAAA,IAACyB,UAAUA,CAAA;UAAA,OAAErB,KAAK,CAACoB,cAAc;QAAA;MAAA,EAC3D,GAAAT,MAAA,OACAA,MAAA,SAAAX,KAAK,CAACgB,QAAQ,MAAAH,iBAAA,CACZ5B,IAAI,CAACqC,KAAK;QAACC,OAAO;QAAA,IAAAP,SAAA;UAAA,OAAAH,iBAAA,CAChB5B,IAAI,CAACuC,KAAK;YAACC,KAAK,EAAEnB,eAAe;YAAA,IAAAU,SAAA;cAAA,OAAGhB,KAAK,CAACgB,QAAQ;YAAA;UAAA;QAAA;MAAA,KAErD,GAAG;IAAA;EAAA;AAGX","ignoreList":[]}
@@ -7,7 +7,6 @@ import { Constructor } from "../constructor/constructor.js";
7
7
  import { Field } from "../field/field.js";
8
8
  import { Method } from "../method/method.js";
9
9
  import { Property } from "../property/property.js";
10
- import { SourceFile } from "../SourceFile.js";
11
10
  import { StructDeclaration } from "./declaration.js";
12
11
  it("declares struct with no members", () => {
13
12
  expect(_$createComponent(TestNamespace, {
@@ -85,46 +84,38 @@ describe("with type parameters", () => {
85
84
  }];
86
85
  expect(_$createComponent(TestNamespace, {
87
86
  get children() {
88
- return _$createComponent(SourceFile, {
89
- path: "Test.cs",
87
+ return _$createComponent(StructDeclaration, {
88
+ "public": true,
89
+ name: "Test",
90
+ typeParameters: typeParameters,
90
91
  get children() {
91
- return _$createComponent(StructDeclaration, {
92
- "public": true,
93
- name: "Test",
94
- typeParameters: typeParameters,
92
+ return _$createComponent(List, {
95
93
  get children() {
96
- return _$createComponent(List, {
97
- get children() {
98
- return [_$createComponent(Property, {
99
- name: "PropA",
100
- get type() {
101
- return typeParameters[0].refkey;
102
- },
103
- get: true,
104
- set: true
105
- }), _$createComponent(Property, {
106
- name: "PropB",
107
- get type() {
108
- return typeParameters[1].refkey;
109
- },
110
- get: true,
111
- set: true
112
- })];
113
- }
114
- });
94
+ return [_$createComponent(Property, {
95
+ name: "PropA",
96
+ get type() {
97
+ return typeParameters[0].refkey;
98
+ },
99
+ get: true,
100
+ set: true
101
+ }), _$createComponent(Property, {
102
+ name: "PropB",
103
+ get type() {
104
+ return typeParameters[1].refkey;
105
+ },
106
+ get: true,
107
+ set: true
108
+ })];
115
109
  }
116
110
  });
117
111
  }
118
112
  });
119
113
  }
120
114
  })).toRenderTo(`
121
- namespace TestCode
115
+ public struct Test<T, U>
122
116
  {
123
- public struct Test<T, U>
124
- {
125
- T PropA { get; set; }
126
- U PropB { get; set; }
127
- }
117
+ T PropA { get; set; }
118
+ U PropB { get; set; }
128
119
  }
129
120
  `);
130
121
  });
@@ -147,10 +138,10 @@ describe("with type parameters", () => {
147
138
  }
148
139
  })).toRenderTo(`
149
140
  public struct Test<T, U>
150
- where T : IFoo
151
- where U : IBar
141
+ where T : IFoo
142
+ where U : IBar
152
143
  {
153
- // Body
144
+ // Body
154
145
  }
155
146
  `);
156
147
  });
@@ -187,7 +178,7 @@ it("define methods", () => {
187
178
  })).toRenderTo(`
188
179
  struct Test
189
180
  {
190
- void MethodOne() {}
181
+ void MethodOne() {}
191
182
  }
192
183
  `);
193
184
  });
@@ -206,7 +197,7 @@ it("define constructor", () => {
206
197
  })).toRenderTo(`
207
198
  struct Test
208
199
  {
209
- public Test() {}
200
+ public Test() {}
210
201
  }
211
202
  `);
212
203
  });
@@ -236,8 +227,8 @@ it("defines fields", () => {
236
227
  })).toRenderTo(`
237
228
  public struct TestClass
238
229
  {
239
- public string MemberOne;
240
- public int MemberTwo;
230
+ public string MemberOne;
231
+ public int MemberTwo;
241
232
  }
242
233
  `);
243
234
  });
@@ -252,4 +243,5 @@ it("define multiple interface types", () => {
252
243
  })).toRenderTo(`
253
244
  struct Test : Foo, Bar;
254
245
  `);
255
- });
246
+ });
247
+ //# sourceMappingURL=declaration.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["List","refkey","describe","expect","it","TestNamespace","Attribute","Constructor","Field","Method","Property","StructDeclaration","_$createComponent","children","name","toRenderTo","each","mod","_$mergeProps","partial","doc","typeParameters","type","get","set","constraints","attributes","interfaceTypes"],"sources":["../../../../src/components/struct/declaration.test.tsx"],"sourcesContent":[null],"mappings":";AAAA,SAASA,IAAI,EAAEC,MAAM,QAAQ,gBAAgB;AAC7C,SAASC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AAC7C,SAASC,aAAa;AACtB,SAASC,SAAS;AAClB,SAASC,WAAW;AACpB,SAASC,KAAK;AACd,SAASC,MAAM;AACf,SAASC,QAAQ;AAEjB,SAASC,iBAAiB;AAE1BP,EAAE,CAAC,iCAAiC,EAAE,MAAM;EAC1CD,MAAM,CAAAS,iBAAA,CACHP,aAAa;IAAA,IAAAQ,SAAA;MAAA,OAAAD,iBAAA,CACXD,iBAAiB;QAACG,IAAI;MAAA;IAAA;EAAA,EAE3B,CAAC,CAACC,UAAU,CAAC;AACf;AACA,GAAG,CAAC;AACJ,CAAC,CAAC;AAEFb,QAAQ,CAAC,WAAW,EAAE,MAAM;EAC1BE,EAAE,CAACY,IAAI,CAAC,CAAC,QAAQ,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC,IAAI,EAAGC,GAAG,IAAK;IACxDd,MAAM,CAAAS,iBAAA,CACHP,aAAa;MAAA,IAAAQ,SAAA;QAAA,OAAAD,iBAAA,CACXD,iBAAiB,EAAAO,YAAA,CAA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ACFJ,KAAK;gBAAA;gBAAQM,IAAI;gBAAaQ,IAAI;cAAA,IAAAV,iBAAA,CAClCJ,KAAK;gBAAA;gBAAQM,IAAI;gBAAaQ,IAAI;cAAA;YAAA;UAAA;QAAA;MAAA;IAAA;EAAA,EAI3C,CAAC,CAACP,UAAU,CAAC;AACf;AACA;AACA;AACA;AACA;AACA,GAAG,CAAC;AACJ,CAAC,CAAC;AAEFX,EAAE,CAAC,iCAAiC,EAAE,MAAM;EAC1CD,MAAM,CAAAS,iBAAA,CACHP,aAAa;IAAA,IAAAQ,SAAA;MAAA,OAAAD,iBAAA,CACXD,iBAAiB;QAACG,IAAI;QAAQa,cAAc,EAAE,CAAC,KAAK,EAAE,KAAK;MAAC;IAAA;EAAA,EAEjE,CAAC,CAACZ,UAAU,CAAC;AACf;AACA,GAAG,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -41,4 +41,5 @@ function TypeParameterConstraint(props) {
41
41
  }
42
42
  function arrayify(value) {
43
43
  return Array.isArray(value) ? value : [value];
44
- }
44
+ }
45
+ //# sourceMappingURL=type-parameter-constraints.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["code","For","Indent","normalizeParameters","TypeParameterConstraints","props","parameters","some","x","constraints","_$createIntrinsic","children","_$createComponent","line","each","hardline","param","TypeParameterConstraint","arrayify","_$memo","name","softline","comma","constraint","value","Array","isArray"],"sources":["../../../../src/components/type-parameters/type-parameter-constraints.tsx"],"sourcesContent":[null],"mappings":";AAAA,SAAmBA,IAAI,EAAEC,GAAG,EAAEC,MAAM,QAAQ,gBAAgB;AAE5D,SAASC,mBAAmB;AAO5B,OAAO,SAASC,wBAAwBA,CACtCC,KAAoC,EAC1B;EACV,MAAMC,UAAU,GAAGH,mBAAmB,CAACE,KAAK,CAACC,UAAU,CAAC;EACxD,IAAI,CAACA,UAAU,CAACC,IAAI,CAAEC,CAAC,IAAKA,CAAC,CAACC,WAAW,CAAC,EAAE;IAC1C,OAAO,IAAI;EACb;EACA,OAAAC,iBAAA;IAAA,IAAAC,SAAA;MAAA,OAAAC,iBAAA,CAEKV,MAAM;QAACW,IAAI;QAAA,IAAAF,SAAA;UAAA,OAAAC,iBAAA,CACTX,GAAG;YAACa,IAAI,EAAER,UAAU;YAAES,QAAQ;YAAAJ,QAAA,EAC3BK,KAAK,IAAAJ,iBAAA,CAAMK,uBAAuB,EAAKD,KAAK;UAAI;QAAA;MAAA;IAAA;EAAA;AAK5D;AAEA,SAASC,uBAAuBA,CAACZ,KAAyB,EAAY;EACpE,MAAMI,WAAW,GAAGS,QAAQ,CAACb,KAAK,CAACI,WAAW,CAAC;EAC/C,kBAAAU,MAAA,OAEWnB,IAAI,GAAGK,KAAK,CAACe,IAAI,KAAK,GAAAV,iBAAA;IAAA,IAAAC,SAAA;MAAA,OAAAC,iBAAA,CAE1BV,MAAM;QAACmB,QAAQ;QAAA,IAAAV,SAAA;UAAA,OAAAC,iBAAA,CACbX,GAAG;YAACa,IAAI,EAAEL,WAAW;YAAEa,KAAK;YAACT,IAAI;YAAAF,QAAA,EAC9BY,UAAU,IAAKvB,IAAI,GAAGuB,UAAU;UAAE;QAAA;MAAA;IAAA;EAAA;AAMhD;AAEA,SAASL,QAAQA,CAAIM,KAAc,EAAO;EACxC,OAAOC,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC,GAAGA,KAAK,GAAG,CAACA,KAAK,CAAC;AAC/C","ignoreList":[]}
@@ -64,4 +64,5 @@ it("declare type parameters using parameters", () => {
64
64
  where A : string
65
65
  where B : string
66
66
  `);
67
- });
67
+ });
68
+ //# sourceMappingURL=type-parameter-constraints.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["expect","it","TypeParameterConstraints","_$createComponent","parameters","toRenderTo","name","constraints"],"sources":["../../../../src/components/type-parameters/type-parameter-constraints.test.tsx"],"sourcesContent":[null],"mappings":";AAAA,SAASA,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AACnC,SAASC,wBAAwB;AAEjCD,EAAE,CAA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CAAC;AACJ,CAAC,CAAC;AAEFJ,EAAE,CAAC,0CAA0C,EAAE,MAAM;EACnDD,MAAM,EAED,QAAQ,EAAAG,iBAAA,CACRD,wBAAwB;IACvBE,UAAU,EAAE,CACV;MAAEE,IAAI,EAAE,GAAG;MAAEC,WAAW,EAAE;IAAS,CAAC,EACpC;MAAED,IAAI,EAAE,GAAG;MAAEC,WAAW,EAAE;IAAS,CAAC;EACrC,GAGP,CAAC,CAACF,UAAU,CAAC;AACf;AACA;AACA;AACA,GAAG,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"type-parameter.d.ts","sourceRoot":"","sources":["../../../../src/components/type-parameters/type-parameter.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAA6B,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAK7E;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,QAAQ,GAAG,QAAQ,EAAE,CAAC;IAE7C;;OAEG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CACrC;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,YAStD"}
1
+ {"version":3,"file":"type-parameter.d.ts","sourceRoot":"","sources":["../../../../src/components/type-parameters/type-parameter.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAGR,MAAM,EACP,MAAM,gBAAgB,CAAC;AAGxB;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,QAAQ,GAAG,QAAQ,EAAE,CAAC;IAE7C;;OAEG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CACrC;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,YAStD"}
@@ -1,22 +1,20 @@
1
1
  import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
2
- import { MemberDeclaration, refkey } from "@alloy-js/core";
3
- import { useCSharpNamePolicy } from "../../name-policy.js";
4
- import { CSharpOutputSymbol } from "../../symbols/csharp-output-symbol.js";
5
- import { useCSharpScope } from "../../symbols/scopes.js";
2
+ import { MemberDeclaration, MemberName } from "@alloy-js/core";
3
+ import { createTypeParameterSymbol } from "../../symbols/factories.js";
6
4
 
7
5
  /**
8
6
  * Information for a TypeScript generic type parameter.
9
7
  */
10
8
 
11
9
  export function TypeParameter(props) {
12
- const name = useCSharpNamePolicy().getName(props.name, "type-parameter");
13
- const scope = useCSharpScope();
14
- const symbol = new CSharpOutputSymbol(name, {
15
- scope,
16
- refkeys: props.refkey ?? refkey(props.name)
10
+ const symbol = createTypeParameterSymbol(props.name, {
11
+ refkeys: props.refkey
17
12
  });
18
13
  return _$createComponent(MemberDeclaration, {
19
14
  symbol: symbol,
20
- children: name
15
+ get children() {
16
+ return _$createComponent(MemberName, {});
17
+ }
21
18
  });
22
- }
19
+ }
20
+ //# sourceMappingURL=type-parameter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["MemberDeclaration","MemberName","createTypeParameterSymbol","TypeParameter","props","symbol","name","refkeys","refkey","_$createComponent","children"],"sources":["../../../../src/components/type-parameters/type-parameter.tsx"],"sourcesContent":[null],"mappings":";AAAA,SAEEA,iBAAiB,EACjBC,UAAU,QAEL,gBAAgB;AACvB,SAASC,yBAAyB,QAAQ,4BAA4B;;AAEtE;AACA;AACA;;AAkBA,OAAO,SAASC,aAAaA,CAACC,KAAyB,EAAE;EACvD,MAAMC,MAAM,GAAGH,yBAAyB,CAACE,KAAK,CAACE,IAAI,EAAE;IACnDC,OAAO,EAAEH,KAAK,CAACI;EACjB,CAAC,CAAC;EACF,OAAAC,iBAAA,CACGT,iBAAiB;IAACK,MAAM,EAAEA,MAAM;IAAA,IAAAK,SAAA;MAAA,OAAAD,iBAAA,CAC9BR,UAAU;IAAA;EAAA;AAGjB","ignoreList":[]}
@@ -51,4 +51,5 @@ export function normalizeParameters(parameters) {
51
51
  // }),
52
52
  // };
53
53
  // });
54
- // }
54
+ // }
55
+ //# sourceMappingURL=type-parameters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["For","Indent","taggedComponent","TypeParameter","typeParametersTag","Symbol","for","TypeParameters","props","typeParameters","normalizeParameters","parameters","_$createIntrinsic","children","_$createComponent","softline","each","comma","line","param","map","name"],"sources":["../../../../src/components/type-parameters/type-parameters.tsx"],"sourcesContent":[null],"mappings":";AAAA,SAASA,GAAG,EAAEC,MAAM,EAAEC,eAAe,QAAQ,gBAAgB;AAC7D,SAASC,aAAa;AAEtB,OAAO,MAAMC,iBAAiB,GAAGC,MAAM,CAACC,GAAG,CAAC,wBAAwB,CAAC;AAOrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,cAAc,GAAGL,eAAe,CAC3CE,iBAAiB,EACjB,SAASG,cAAcA,CAACC,KAA0B,EAAE;EAClD,MAAMC,cAAc,GAAGC,mBAAmB,CAACF,KAAK,CAACG,UAAU,CAAC;EAE5D,QAEK,GAAG,EAAAC,iBAAA;IAAA,IAAAC,SAAA;MAAA,OAAAC,iBAAA,CAEDb,MAAM;QAACc,QAAQ;QAAA,IAAAF,SAAA;UAAA,OAAAC,iBAAA,CACbd,GAAG;YAACgB,IAAI,EAAEP,cAAc;YAAEQ,KAAK;YAACC,IAAI;YAAAL,QAAA,EACjCM,KAAK,IAAAL,iBAAA,CAAMX,aAAa,EAAKgB,KAAK;UAAI;QAAA;MAAA;IAAA;EAAA,IAI7C,GAAG;AAGV,CACF,CAAC;AAED,OAAO,SAAST,mBAAmBA,CACjCC,UAA2C,EACrB;EACtB,OAAOA,UAAU,CAACS,GAAG,CAAED,KAAK,IAAK;IAC/B,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;MAC7B,OAAO;QAAEE,IAAI,EAAEF;MAAM,CAAC;IACxB;IACA,OAAOA,KAAK;EACd,CAAC,CAAC;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
@@ -15,13 +15,13 @@ it("render very long", () => {
15
15
  expect(_$createComponent(TestNamespace, {
16
16
  get children() {
17
17
  return _$createComponent(TypeParameters, {
18
- parameters: ["SomeVeryVeryLongParamThatMightGetSplitOverMultipleLinesA", "SomeVeryVeryLongParamThatMightGetSplitOverMultipleLinesB"]
18
+ parameters: ["SomeVeryVeryLongParamThatMightGetSplitOverMultipleLinesLongLongLongLongLongA", "SomeVeryVeryLongParamThatMightGetSplitOverMultipleLinesLongLongLongLongLongB"]
19
19
  });
20
20
  }
21
21
  })).toRenderTo(`
22
22
  <
23
- SomeVeryVeryLongParamThatMightGetSplitOverMultipleLinesA,
24
- SomeVeryVeryLongParamThatMightGetSplitOverMultipleLinesB>
23
+ SomeVeryVeryLongParamThatMightGetSplitOverMultipleLinesLongLongLongLongLongA,
24
+ SomeVeryVeryLongParamThatMightGetSplitOverMultipleLinesLongLongLongLongLongB>
25
25
  `);
26
26
  });
27
27
  it("declare type parameters using parameters names", () => {
@@ -45,4 +45,5 @@ it("declare type parameters using parameters", () => {
45
45
  });
46
46
  }
47
47
  })).toRenderTo(`<A, B>`);
48
- });
48
+ });
49
+ //# sourceMappingURL=type-parameters.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["expect","it","TestNamespace","TypeParameters","_$createComponent","children","parameters","toRenderTo","name"],"sources":["../../../../src/components/type-parameters/type-parameters.test.tsx"],"sourcesContent":[null],"mappings":";AAAA,SAASA,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AACnC,SAASC,aAAa;AACtB,SAASC,cAAc;AAEvBF,EAAE,CAAC,YAAY,EAAE,MAAM;EACrBD,MAAM,CAAAI,iBAAA,CACHF,aAAa;IAAA,IAAAG,SAAA;MAAA,OAAAD,iBAAA,CACXD,cAAc;QAACG,UAAU,EAAE,CAAC,GAAG;MAAC;IAAA;EAAA,EAErC,CAAC,CAACC,UAAU,CAAC,KAAK,CAAC;AACrB,CAAC,CAAC;AAEFN,EAAE,CAAC,kBAAkB,EAAE,MAAM;EAC3BD,MAAM,CAAAI,iBAAA,CACHF,aAAa;IAAA,IAAAG,SAAA;MAAA,OAAAD,iBAAA,CACXD,cAAc;QACbG,UAAU,EAAE,CACV,8EAA8E,EAC9E,8EAA8E;MAC/E;IAAA;EAAA,EAGP,CAAC,CAACC,UAAU,CACV;AACJ;AACA;AACA;AACA,KACE,CAAC;AACH,CAAC,CAAC;AAEFN,EAAE,CAAC,gDAAgD,EAAE,MAAM;EACzDD,MAAM,CAAAI,iBAAA,CACHF,aAAa;IAAA,IAAAG,SAAA;MAAA,OAAAD,iBAAA,CACXD,cAAc;QAACG,UAAU,EAAE,CAAC,GAAG,EAAE,GAAG;MAAC;IAAA;EAAA,EAE1C,CAAC,CAACC,UAAU,CAAC,QAAQ,CAAC;AACxB,CAAC,CAAC;AAEFN,EAAE,CAAC,0CAA0C,EAAE,MAAM;EACnDD,MAAM,CAAAI,iBAAA,CACHF,aAAa;IAAA,IAAAG,SAAA;MAAA,OAAAD,iBAAA,CACXD,cAAc;QAACG,UAAU,EAAE,CAAC;UAAEE,IAAI,EAAE;QAAI,CAAC,EAAE;UAAEA,IAAI,EAAE;QAAI,CAAC;MAAC;IAAA;EAAA,EAE9D,CAAC,CAACD,UAAU,CAAC,QAAQ,CAAC;AACxB,CAAC,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"declaration.d.ts","sourceRoot":"","sources":["../../../../src/components/var/declaration.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAQ,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAI1E,iDAAiD;AACjD,MAAM,WAAW,mBACf,SAAQ,IAAI,CAAC,gBAAgB,EAAE,UAAU,CAAC;IAC1C,oBAAoB;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,4EAA4E;IAC5E,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,sBAAsB;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,qBAAqB;IACrB,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,YAQxD"}
1
+ {"version":3,"file":"declaration.d.ts","sourceRoot":"","sources":["../../../../src/components/var/declaration.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAER,gBAAgB,EAEhB,MAAM,EACP,MAAM,gBAAgB,CAAC;AAGxB,iDAAiD;AACjD,MAAM,WAAW,mBACf,SAAQ,IAAI,CAAC,gBAAgB,EAAE,UAAU,CAAC;IAC1C,oBAAoB;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,4EAA4E;IAC5E,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,sBAAsB;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,qBAAqB;IACrB,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,YASxD"}
@@ -1,7 +1,6 @@
1
1
  import { memo as _$memo, createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
2
- import { Name } from "@alloy-js/core";
3
- import { useCSharpNamePolicy } from "../../name-policy.js";
4
- import { Declaration } from "../Declaration.js";
2
+ import { Declaration, Name } from "@alloy-js/core";
3
+ import { createVariableSymbol } from "../../symbols/factories.js";
5
4
 
6
5
  /** Props for {@link VarDeclaration} component */
7
6
 
@@ -27,14 +26,14 @@ import { Declaration } from "../Declaration.js";
27
26
  * ```
28
27
  */
29
28
  export function VarDeclaration(props) {
30
- const name = useCSharpNamePolicy().getName(props.name, "variable");
29
+ const sym = createVariableSymbol(props.name, {
30
+ refkeys: props.refkey
31
+ });
31
32
  return _$createComponent(Declaration, {
32
- name: name,
33
- get refkey() {
34
- return props.refkey;
35
- },
33
+ symbol: sym,
36
34
  get children() {
37
35
  return [_$memo(() => props.type ?? "var"), " ", _$createComponent(Name, {}), " = ", _$memo(() => props.children), ";"];
38
36
  }
39
37
  });
40
- }
38
+ }
39
+ //# sourceMappingURL=declaration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Declaration","Name","createVariableSymbol","VarDeclaration","props","sym","name","refkeys","refkey","_$createComponent","symbol","children","_$memo","type"],"sources":["../../../../src/components/var/declaration.tsx"],"sourcesContent":[null],"mappings":";AAAA,SAEEA,WAAW,EAEXC,IAAI,QAEC,gBAAgB;AACvB,SAASC,oBAAoB,QAAQ,4BAA4B;;AAEjE;;AAaA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,cAAcA,CAACC,KAA0B,EAAE;EACzD,MAAMC,GAAG,GAAGH,oBAAoB,CAACE,KAAK,CAACE,IAAI,EAAE;IAC3CC,OAAO,EAAEH,KAAK,CAACI;EACjB,CAAC,CAAC;EACF,OAAAC,iBAAA,CACGT,WAAW;IAACU,MAAM,EAAEL,GAAG;IAAA,IAAAM,SAAA;MAAA,QAAAC,MAAA,OACrBR,KAAK,CAACS,IAAI,IAAI,KAAK,QAAAJ,iBAAA,CAAGR,IAAI,cAAAW,MAAA,OAAOR,KAAK,CAACO,QAAQ;IAAA;EAAA;AAGtD","ignoreList":[]}
@@ -2,7 +2,6 @@ import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime
2
2
  import { List, refkey } from "@alloy-js/core";
3
3
  import { expect, it } from "vitest";
4
4
  import { TestNamespace } from "../../../test/utils.js";
5
- import { SourceFile } from "../SourceFile.js";
6
5
  import { VarDeclaration } from "./declaration.js";
7
6
  it("declares var without type", () => {
8
7
  expect(_$createComponent(TestNamespace, {
@@ -45,29 +44,22 @@ it("links refkey", () => {
45
44
  const key = refkey();
46
45
  expect(_$createComponent(TestNamespace, {
47
46
  get children() {
48
- return _$createComponent(SourceFile, {
49
- path: "test.cs",
47
+ return _$createComponent(List, {
50
48
  get children() {
51
- return _$createComponent(List, {
52
- get children() {
53
- return [_$createComponent(VarDeclaration, {
54
- name: "testVar",
55
- refkey: key,
56
- children: "42"
57
- }), _$createComponent(VarDeclaration, {
58
- name: "testVar2",
59
- children: key
60
- })];
61
- }
62
- });
49
+ return [_$createComponent(VarDeclaration, {
50
+ name: "testVar",
51
+ refkey: key,
52
+ children: "42"
53
+ }), _$createComponent(VarDeclaration, {
54
+ name: "testVar2",
55
+ children: key
56
+ })];
63
57
  }
64
58
  });
65
59
  }
66
60
  })).toRenderTo(`
67
- namespace TestCode
68
- {
69
- var testVar = 42;
70
- var testVar2 = testVar;
71
- }
61
+ var testVar = 42;
62
+ var testVar2 = testVar;
72
63
  `);
73
- });
64
+ });
65
+ //# sourceMappingURL=declaration.test.js.map