@alloy-js/csharp 0.20.0-dev.0 → 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 (399) 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/{ClassDeclaration.d.ts → class/declaration.d.ts} +30 -12
  33. package/dist/src/components/class/declaration.d.ts.map +1 -0
  34. package/dist/src/components/class/declaration.js +87 -0
  35. package/dist/src/components/class/declaration.js.map +1 -0
  36. package/dist/src/components/class/declaration.test.d.ts +2 -0
  37. package/dist/src/components/class/declaration.test.d.ts.map +1 -0
  38. package/dist/src/components/class/declaration.test.js +573 -0
  39. package/dist/src/components/class/declaration.test.js.map +1 -0
  40. package/dist/src/components/constructor/constructor.d.ts.map +1 -1
  41. package/dist/src/components/constructor/constructor.js +13 -20
  42. package/dist/src/components/constructor/constructor.js.map +1 -0
  43. package/dist/src/components/constructor/constructor.test.js +13 -21
  44. package/dist/src/components/constructor/constructor.test.js.map +1 -0
  45. package/dist/src/components/doc/comment.js +2 -1
  46. package/dist/src/components/doc/comment.js.map +1 -0
  47. package/dist/src/components/doc/comment.test.js +2 -1
  48. package/dist/src/components/doc/comment.test.js.map +1 -0
  49. package/dist/src/components/doc/from-markdown.js +2 -1
  50. package/dist/src/components/doc/from-markdown.js.map +1 -0
  51. package/dist/src/components/doc/from-markdown.test.js +2 -1
  52. package/dist/src/components/doc/from-markdown.test.js.map +1 -0
  53. package/dist/src/components/{EnumDeclaration.d.ts → enum/declaration.d.ts} +6 -11
  54. package/dist/src/components/enum/declaration.d.ts.map +1 -0
  55. package/dist/src/components/enum/declaration.js +55 -0
  56. package/dist/src/components/enum/declaration.js.map +1 -0
  57. package/dist/src/components/enum/declaration.ref.test.d.ts +2 -0
  58. package/dist/src/components/enum/declaration.ref.test.d.ts.map +1 -0
  59. package/dist/src/components/enum/declaration.ref.test.js +121 -0
  60. package/dist/src/components/enum/declaration.ref.test.js.map +1 -0
  61. package/dist/src/components/enum/declaration.test.d.ts +2 -0
  62. package/dist/src/components/enum/declaration.test.d.ts.map +1 -0
  63. package/dist/src/components/enum/declaration.test.js +40 -0
  64. package/dist/src/components/enum/declaration.test.js.map +1 -0
  65. package/dist/src/components/enum/member.d.ts +7 -0
  66. package/dist/src/components/enum/member.d.ts.map +1 -0
  67. package/dist/src/components/enum/member.js +30 -0
  68. package/dist/src/components/enum/member.js.map +1 -0
  69. package/dist/src/components/enum/member.test.d.ts +2 -0
  70. package/dist/src/components/enum/member.test.d.ts.map +1 -0
  71. package/dist/src/components/enum/member.test.js +29 -0
  72. package/dist/src/components/enum/member.test.js.map +1 -0
  73. package/dist/src/components/field/field.d.ts.map +1 -1
  74. package/dist/src/components/field/field.js +11 -18
  75. package/dist/src/components/field/field.js.map +1 -0
  76. package/dist/src/components/field/field.test.js +10 -9
  77. package/dist/src/components/field/field.test.js.map +1 -0
  78. package/dist/src/components/index.d.ts +8 -4
  79. package/dist/src/components/index.d.ts.map +1 -1
  80. package/dist/src/components/index.js +10 -5
  81. package/dist/src/components/index.js.map +1 -0
  82. package/dist/src/components/interface/declaration.d.ts.map +1 -1
  83. package/dist/src/components/interface/declaration.js +21 -22
  84. package/dist/src/components/interface/declaration.js.map +1 -0
  85. package/dist/src/components/interface/declaration.test.js +28 -36
  86. package/dist/src/components/interface/declaration.test.js.map +1 -0
  87. package/dist/src/components/interface/method.d.ts.map +1 -1
  88. package/dist/src/components/interface/method.js +9 -19
  89. package/dist/src/components/interface/method.js.map +1 -0
  90. package/dist/src/components/interface/method.test.js +40 -48
  91. package/dist/src/components/interface/method.test.js.map +1 -0
  92. package/dist/src/components/interface/property.d.ts.map +1 -1
  93. package/dist/src/components/interface/property.js +23 -40
  94. package/dist/src/components/interface/property.js.map +1 -0
  95. package/dist/src/components/interface/property.test.js +13 -12
  96. package/dist/src/components/interface/property.test.js.map +1 -0
  97. package/dist/src/components/invocation-expression/invocation-expression.d.ts +29 -0
  98. package/dist/src/components/invocation-expression/invocation-expression.d.ts.map +1 -0
  99. package/dist/src/components/invocation-expression/invocation-expression.js +70 -0
  100. package/dist/src/components/invocation-expression/invocation-expression.js.map +1 -0
  101. package/dist/src/components/invocation-expression/invocation-expression.test.d.ts +2 -0
  102. package/dist/src/components/invocation-expression/invocation-expression.test.d.ts.map +1 -0
  103. package/dist/src/components/invocation-expression/invocation-expression.test.js +105 -0
  104. package/dist/src/components/invocation-expression/invocation-expression.test.js.map +1 -0
  105. package/dist/src/components/lexical-scope.d.ts +8 -0
  106. package/dist/src/components/lexical-scope.d.ts.map +1 -0
  107. package/dist/src/components/lexical-scope.js +25 -0
  108. package/dist/src/components/lexical-scope.js.map +1 -0
  109. package/dist/src/components/method/method.d.ts +5 -2
  110. package/dist/src/components/method/method.d.ts.map +1 -1
  111. package/dist/src/components/method/method.js +9 -17
  112. package/dist/src/components/method/method.js.map +1 -0
  113. package/dist/src/components/method/method.test.js +13 -12
  114. package/dist/src/components/method/method.test.js.map +1 -0
  115. package/dist/src/components/method-scope.d.ts +8 -0
  116. package/dist/src/components/method-scope.d.ts.map +1 -0
  117. package/dist/src/components/method-scope.js +25 -0
  118. package/dist/src/components/method-scope.js.map +1 -0
  119. package/dist/src/components/namespace-scopes.d.ts +13 -0
  120. package/dist/src/components/namespace-scopes.d.ts.map +1 -0
  121. package/dist/src/components/namespace-scopes.js +45 -0
  122. package/dist/src/components/namespace-scopes.js.map +1 -0
  123. package/dist/src/components/namespace.d.ts +7 -0
  124. package/dist/src/components/namespace.d.ts.map +1 -0
  125. package/dist/src/components/namespace.js +47 -0
  126. package/dist/src/components/namespace.js.map +1 -0
  127. package/dist/src/components/namespace.ref.test.d.ts +2 -0
  128. package/dist/src/components/namespace.ref.test.d.ts.map +1 -0
  129. package/dist/src/components/namespace.ref.test.js +182 -0
  130. package/dist/src/components/namespace.ref.test.js.map +1 -0
  131. package/dist/src/components/namespace.test.d.ts.map +1 -0
  132. package/dist/src/components/namespace.test.js +79 -0
  133. package/dist/src/components/namespace.test.js.map +1 -0
  134. package/dist/src/components/parameters/parameters.d.ts +2 -3
  135. package/dist/src/components/parameters/parameters.d.ts.map +1 -1
  136. package/dist/src/components/parameters/parameters.js +15 -15
  137. package/dist/src/components/parameters/parameters.js.map +1 -0
  138. package/dist/src/components/parameters/parameters.test.d.ts +2 -0
  139. package/dist/src/components/parameters/parameters.test.d.ts.map +1 -0
  140. package/dist/src/components/parameters/parameters.test.js +154 -0
  141. package/dist/src/components/parameters/parameters.test.js.map +1 -0
  142. package/dist/src/components/property/property.d.ts +2 -2
  143. package/dist/src/components/property/property.d.ts.map +1 -1
  144. package/dist/src/components/property/property.js +30 -40
  145. package/dist/src/components/property/property.js.map +1 -0
  146. package/dist/src/components/property/property.test.js +17 -16
  147. package/dist/src/components/property/property.test.js.map +1 -0
  148. package/dist/src/components/record/declaration.d.ts +18 -0
  149. package/dist/src/components/record/declaration.d.ts.map +1 -1
  150. package/dist/src/components/record/declaration.js +21 -14
  151. package/dist/src/components/record/declaration.js.map +1 -0
  152. package/dist/src/components/record/declaration.test.js +52 -4
  153. package/dist/src/components/record/declaration.test.js.map +1 -0
  154. package/dist/src/components/source-file/source-file.d.ts +19 -0
  155. package/dist/src/components/source-file/source-file.d.ts.map +1 -0
  156. package/dist/src/components/source-file/source-file.js +59 -0
  157. package/dist/src/components/source-file/source-file.js.map +1 -0
  158. package/dist/src/components/source-file/source-file.test.d.ts +2 -0
  159. package/dist/src/components/source-file/source-file.test.d.ts.map +1 -0
  160. package/dist/src/components/source-file/source-file.test.js +136 -0
  161. package/dist/src/components/source-file/source-file.test.js.map +1 -0
  162. package/dist/src/components/stc/index.js +2 -1
  163. package/dist/src/components/stc/index.js.map +1 -0
  164. package/dist/src/components/struct/declaration.d.ts.map +1 -1
  165. package/dist/src/components/struct/declaration.js +6 -7
  166. package/dist/src/components/struct/declaration.js.map +1 -0
  167. package/dist/src/components/struct/declaration.test.js +32 -40
  168. package/dist/src/components/struct/declaration.test.js.map +1 -0
  169. package/dist/src/components/type-parameters/type-parameter-constraints.js +2 -1
  170. package/dist/src/components/type-parameters/type-parameter-constraints.js.map +1 -0
  171. package/dist/src/components/type-parameters/type-parameter-constraints.test.js +2 -1
  172. package/dist/src/components/type-parameters/type-parameter-constraints.test.js.map +1 -0
  173. package/dist/src/components/type-parameters/type-parameter.d.ts.map +1 -1
  174. package/dist/src/components/type-parameters/type-parameter.js +9 -11
  175. package/dist/src/components/type-parameters/type-parameter.js.map +1 -0
  176. package/dist/src/components/type-parameters/type-parameters.js +2 -1
  177. package/dist/src/components/type-parameters/type-parameters.js.map +1 -0
  178. package/dist/src/components/type-parameters/type-parameters.test.js +5 -4
  179. package/dist/src/components/type-parameters/type-parameters.test.js.map +1 -0
  180. package/dist/src/components/var/declaration.d.ts.map +1 -1
  181. package/dist/src/components/var/declaration.js +8 -9
  182. package/dist/src/components/var/declaration.js.map +1 -0
  183. package/dist/src/components/var/declaration.test.js +13 -21
  184. package/dist/src/components/var/declaration.test.js.map +1 -0
  185. package/dist/src/contexts/format-options.d.ts +5 -0
  186. package/dist/src/contexts/format-options.d.ts.map +1 -0
  187. package/dist/src/contexts/format-options.js +9 -0
  188. package/dist/src/contexts/format-options.js.map +1 -0
  189. package/dist/src/contexts/global-namespace.d.ts +5 -0
  190. package/dist/src/contexts/global-namespace.d.ts.map +1 -0
  191. package/dist/src/contexts/global-namespace.js +25 -0
  192. package/dist/src/contexts/global-namespace.js.map +1 -0
  193. package/dist/src/contexts/namespace.d.ts +8 -0
  194. package/dist/src/contexts/namespace.d.ts.map +1 -0
  195. package/dist/src/contexts/namespace.js +6 -0
  196. package/dist/src/contexts/namespace.js.map +1 -0
  197. package/dist/src/index.d.ts +2 -0
  198. package/dist/src/index.d.ts.map +1 -1
  199. package/dist/src/index.js +4 -1
  200. package/dist/src/index.js.map +1 -0
  201. package/dist/src/modifiers.d.ts +11 -0
  202. package/dist/src/modifiers.d.ts.map +1 -1
  203. package/dist/src/modifiers.js +2 -1
  204. package/dist/src/modifiers.js.map +1 -0
  205. package/dist/src/name-policy.js +2 -1
  206. package/dist/src/name-policy.js.map +1 -0
  207. package/dist/src/scopes/class.d.ts +10 -0
  208. package/dist/src/scopes/class.d.ts.map +1 -0
  209. package/dist/src/scopes/class.js +11 -0
  210. package/dist/src/scopes/class.js.map +1 -0
  211. package/dist/src/scopes/contexts.d.ts +9 -0
  212. package/dist/src/scopes/contexts.d.ts.map +1 -0
  213. package/dist/src/scopes/contexts.js +34 -0
  214. package/dist/src/scopes/contexts.js.map +1 -0
  215. package/dist/src/scopes/csharp.d.ts +10 -0
  216. package/dist/src/scopes/csharp.d.ts.map +1 -0
  217. package/dist/src/scopes/csharp.js +15 -0
  218. package/dist/src/scopes/csharp.js.map +1 -0
  219. package/dist/src/scopes/factories.d.ts +9 -0
  220. package/dist/src/scopes/factories.d.ts.map +1 -0
  221. package/dist/src/scopes/factories.js +24 -0
  222. package/dist/src/scopes/factories.js.map +1 -0
  223. package/dist/src/scopes/index.d.ts +10 -0
  224. package/dist/src/scopes/index.d.ts.map +1 -0
  225. package/dist/src/scopes/index.js +10 -0
  226. package/dist/src/scopes/index.js.map +1 -0
  227. package/dist/src/scopes/lexical.d.ts +7 -0
  228. package/dist/src/scopes/lexical.d.ts.map +1 -0
  229. package/dist/src/scopes/lexical.js +8 -0
  230. package/dist/src/scopes/lexical.js.map +1 -0
  231. package/dist/src/scopes/method.d.ts +9 -0
  232. package/dist/src/scopes/method.d.ts.map +1 -0
  233. package/dist/src/scopes/method.js +14 -0
  234. package/dist/src/scopes/method.js.map +1 -0
  235. package/dist/src/scopes/named-type.d.ts +22 -0
  236. package/dist/src/scopes/named-type.d.ts.map +1 -0
  237. package/dist/src/scopes/named-type.js +33 -0
  238. package/dist/src/scopes/named-type.js.map +1 -0
  239. package/dist/src/scopes/namespace.d.ts +11 -0
  240. package/dist/src/scopes/namespace.d.ts.map +1 -0
  241. package/dist/src/scopes/namespace.js +39 -0
  242. package/dist/src/scopes/namespace.js.map +1 -0
  243. package/dist/src/scopes/source-file.d.ts +16 -0
  244. package/dist/src/scopes/source-file.d.ts.map +1 -0
  245. package/dist/src/scopes/source-file.js +44 -0
  246. package/dist/src/scopes/source-file.js.map +1 -0
  247. package/dist/src/symbols/csharp.d.ts +87 -0
  248. package/dist/src/symbols/csharp.d.ts.map +1 -0
  249. package/dist/src/symbols/csharp.js +246 -0
  250. package/dist/src/symbols/csharp.js.map +1 -0
  251. package/dist/src/symbols/factories.d.ts +25 -0
  252. package/dist/src/symbols/factories.d.ts.map +1 -0
  253. package/dist/src/symbols/factories.js +93 -0
  254. package/dist/src/symbols/factories.js.map +1 -0
  255. package/dist/src/symbols/index.d.ts +5 -2
  256. package/dist/src/symbols/index.d.ts.map +1 -1
  257. package/dist/src/symbols/index.js +6 -2
  258. package/dist/src/symbols/index.js.map +1 -0
  259. package/dist/src/symbols/method.d.ts +13 -0
  260. package/dist/src/symbols/method.d.ts.map +1 -0
  261. package/dist/src/symbols/method.js +16 -0
  262. package/dist/src/symbols/method.js.map +1 -0
  263. package/dist/src/symbols/named-type.d.ts +19 -0
  264. package/dist/src/symbols/named-type.d.ts.map +1 -0
  265. package/dist/src/symbols/named-type.js +31 -0
  266. package/dist/src/symbols/named-type.js.map +1 -0
  267. package/dist/src/symbols/namespace.d.ts +22 -0
  268. package/dist/src/symbols/namespace.d.ts.map +1 -0
  269. package/dist/src/symbols/namespace.js +45 -0
  270. package/dist/src/symbols/namespace.js.map +1 -0
  271. package/dist/src/symbols/reference.d.ts +2 -2
  272. package/dist/src/symbols/reference.d.ts.map +1 -1
  273. package/dist/src/symbols/reference.js +50 -44
  274. package/dist/src/symbols/reference.js.map +1 -0
  275. package/dist/test/project-directory.test.js +20 -19
  276. package/dist/test/project-directory.test.js.map +1 -0
  277. package/dist/test/using.test.js +23 -21
  278. package/dist/test/using.test.js.map +1 -0
  279. package/dist/test/utils.d.ts.map +1 -1
  280. package/dist/test/utils.js +7 -4
  281. package/dist/test/utils.js.map +1 -0
  282. package/dist/test/vitest.setup.js +2 -1
  283. package/dist/test/vitest.setup.js.map +1 -0
  284. package/dist/tsconfig.tsbuildinfo +1 -1
  285. package/package.json +12 -6
  286. package/src/components/Declaration.tsx +3 -6
  287. package/src/components/Reference.tsx +3 -1
  288. package/src/components/UsingDirective.tsx +12 -2
  289. package/src/components/access-expression/access-expression.test.tsx +284 -0
  290. package/src/components/access-expression/access-expression.tsx +375 -0
  291. package/src/components/access-expression/part-descriptors.ts +175 -0
  292. package/src/components/class/declaration.test.tsx +484 -0
  293. package/src/components/{ClassDeclaration.tsx → class/declaration.tsx} +63 -44
  294. package/src/components/constructor/constructor.test.tsx +11 -17
  295. package/src/components/constructor/constructor.tsx +13 -32
  296. package/src/components/enum/declaration.ref.test.tsx +93 -0
  297. package/src/components/enum/declaration.test.tsx +34 -0
  298. package/src/components/enum/declaration.tsx +65 -0
  299. package/src/components/enum/member.test.tsx +24 -0
  300. package/src/components/enum/member.tsx +36 -0
  301. package/src/components/field/field.test.tsx +8 -8
  302. package/src/components/field/field.tsx +12 -22
  303. package/src/components/index.ts +8 -4
  304. package/src/components/interface/declaration.test.tsx +26 -32
  305. package/src/components/interface/declaration.tsx +16 -18
  306. package/src/components/interface/method.test.tsx +38 -44
  307. package/src/components/interface/method.tsx +7 -20
  308. package/src/components/interface/property.test.tsx +11 -11
  309. package/src/components/interface/property.tsx +15 -34
  310. package/src/components/invocation-expression/invocation-expression.test.tsx +101 -0
  311. package/src/components/invocation-expression/invocation-expression.tsx +60 -0
  312. package/src/components/lexical-scope.tsx +29 -0
  313. package/src/components/method/method.test.tsx +11 -11
  314. package/src/components/method/method.tsx +12 -23
  315. package/src/components/method-scope.tsx +27 -0
  316. package/src/components/namespace-scopes.tsx +44 -0
  317. package/src/components/namespace.ref.test.tsx +139 -0
  318. package/src/components/namespace.test.tsx +52 -0
  319. package/src/components/namespace.tsx +45 -0
  320. package/src/components/parameters/parameters.test.tsx +117 -0
  321. package/src/components/parameters/parameters.tsx +11 -21
  322. package/src/components/property/property.test.tsx +15 -15
  323. package/src/components/property/property.tsx +23 -41
  324. package/src/components/record/declaration.test.tsx +47 -3
  325. package/src/components/record/declaration.tsx +34 -11
  326. package/src/components/source-file/source-file.test.tsx +96 -0
  327. package/src/components/source-file/source-file.tsx +98 -0
  328. package/src/components/struct/declaration.test.tsx +16 -22
  329. package/src/components/struct/declaration.tsx +4 -6
  330. package/src/components/type-parameters/type-parameter.tsx +14 -11
  331. package/src/components/type-parameters/type-parameters.test.tsx +4 -4
  332. package/src/components/var/declaration.test.tsx +8 -14
  333. package/src/components/var/declaration.tsx +12 -6
  334. package/src/contexts/format-options.ts +14 -0
  335. package/src/contexts/global-namespace.ts +29 -0
  336. package/src/contexts/namespace.ts +13 -0
  337. package/src/index.ts +2 -0
  338. package/src/modifiers.ts +14 -0
  339. package/src/scopes/class.ts +12 -0
  340. package/src/scopes/contexts.ts +45 -0
  341. package/src/scopes/csharp.ts +23 -0
  342. package/src/scopes/factories.ts +45 -0
  343. package/src/scopes/index.ts +9 -0
  344. package/src/scopes/lexical.ts +10 -0
  345. package/src/scopes/method.ts +22 -0
  346. package/src/scopes/named-type.ts +44 -0
  347. package/src/scopes/namespace.ts +59 -0
  348. package/src/scopes/source-file.ts +67 -0
  349. package/src/symbols/csharp.ts +339 -0
  350. package/src/symbols/factories.ts +215 -0
  351. package/src/symbols/index.ts +5 -2
  352. package/src/symbols/method.ts +26 -0
  353. package/src/symbols/named-type.ts +54 -0
  354. package/src/symbols/namespace.ts +62 -0
  355. package/src/symbols/reference.tsx +64 -0
  356. package/temp/api.json +6910 -2491
  357. package/test/project-directory.test.tsx +14 -16
  358. package/test/using.test.tsx +21 -21
  359. package/test/utils.tsx +2 -1
  360. package/tsconfig.json +4 -1
  361. package/tsdoc-metadata.json +1 -1
  362. package/dist/src/components/ClassDeclaration.d.ts.map +0 -1
  363. package/dist/src/components/ClassDeclaration.js +0 -92
  364. package/dist/src/components/EnumDeclaration.d.ts.map +0 -1
  365. package/dist/src/components/EnumDeclaration.js +0 -85
  366. package/dist/src/components/Namespace.d.ts +0 -11
  367. package/dist/src/components/Namespace.d.ts.map +0 -1
  368. package/dist/src/components/Namespace.js +0 -33
  369. package/dist/src/components/SourceFile.d.ts +0 -14
  370. package/dist/src/components/SourceFile.d.ts.map +0 -1
  371. package/dist/src/components/SourceFile.js +0 -69
  372. package/dist/src/symbols/csharp-output-symbol.d.ts +0 -8
  373. package/dist/src/symbols/csharp-output-symbol.d.ts.map +0 -1
  374. package/dist/src/symbols/csharp-output-symbol.js +0 -19
  375. package/dist/src/symbols/scopes.d.ts +0 -14
  376. package/dist/src/symbols/scopes.d.ts.map +0 -1
  377. package/dist/src/symbols/scopes.js +0 -31
  378. package/dist/test/class-declaration.test.d.ts +0 -2
  379. package/dist/test/class-declaration.test.d.ts.map +0 -1
  380. package/dist/test/class-declaration.test.js +0 -484
  381. package/dist/test/enum.test.d.ts +0 -2
  382. package/dist/test/enum.test.d.ts.map +0 -1
  383. package/dist/test/enum.test.js +0 -178
  384. package/dist/test/namespace.test.d.ts.map +0 -1
  385. package/dist/test/namespace.test.js +0 -81
  386. package/dist/test/sourcefile.test.d.ts +0 -2
  387. package/dist/test/sourcefile.test.d.ts.map +0 -1
  388. package/dist/test/sourcefile.test.js +0 -58
  389. package/src/components/EnumDeclaration.tsx +0 -99
  390. package/src/components/Namespace.tsx +0 -35
  391. package/src/components/SourceFile.tsx +0 -78
  392. package/src/symbols/csharp-output-symbol.ts +0 -22
  393. package/src/symbols/reference.ts +0 -65
  394. package/src/symbols/scopes.ts +0 -41
  395. package/test/class-declaration.test.tsx +0 -413
  396. package/test/enum.test.tsx +0 -149
  397. package/test/namespace.test.tsx +0 -55
  398. package/test/sourcefile.test.tsx +0 -47
  399. /package/dist/{test → src/components}/namespace.test.d.ts +0 -0
@@ -2,11 +2,12 @@ import {
2
2
  Block,
3
3
  Children,
4
4
  code,
5
+ createSymbolSlot,
5
6
  List,
6
7
  MemberDeclaration,
7
- refkey,
8
+ MemberName,
9
+ Namekey,
8
10
  Refkey,
9
- Scope,
10
11
  } from "@alloy-js/core";
11
12
  import {
12
13
  AccessModifiers,
@@ -14,9 +15,7 @@ import {
14
15
  getAccessModifier,
15
16
  makeModifiers,
16
17
  } from "../../modifiers.js";
17
- import { useCSharpNamePolicy } from "../../name-policy.js";
18
- import { CSharpOutputSymbol } from "../../symbols/csharp-output-symbol.js";
19
- import { CSharpMemberScope, useCSharpScope } from "../../symbols/scopes.js";
18
+ import { createPropertySymbol } from "../../symbols/factories.js";
20
19
  import { AttributeList, AttributesProp } from "../attributes/attributes.jsx";
21
20
  import { DocWhen } from "../doc/comment.jsx";
22
21
 
@@ -51,7 +50,7 @@ const getModifiers = makeModifiers<PropertyModifiers>([
51
50
 
52
51
  /** Properties for {@link Property} component */
53
52
  export interface PropertyProps extends AccessModifiers, PropertyModifiers {
54
- name: string;
53
+ name: Namekey | string;
55
54
  refkey?: Refkey;
56
55
 
57
56
  /** Property type */
@@ -118,27 +117,12 @@ export interface PropertyProps extends AccessModifiers, PropertyModifiers {
118
117
  * ```
119
118
  */
120
119
  export function Property(props: PropertyProps) {
121
- const name = useCSharpNamePolicy().getName(props.name, "class-property");
122
- const scope = useCSharpScope();
123
- if (
124
- scope.kind !== "member" ||
125
- (scope.name !== "class-decl" &&
126
- scope.name !== "record-decl" &&
127
- scope.name !== "struct-decl")
128
- ) {
129
- throw new Error(
130
- "can't define an interface method outside of an interface scope",
131
- );
132
- }
133
-
134
- const propertySymbol = new CSharpOutputSymbol(name, {
135
- scope,
136
- refkeys: props.refkey ?? refkey(props.name),
137
- });
120
+ const TypeSlot = createSymbolSlot();
138
121
 
139
- // scope for property declaration
140
- const propertyScope = new CSharpMemberScope("property-decl", {
141
- owner: propertySymbol,
122
+ const propertySymbol = createPropertySymbol(props.name, {
123
+ refkeys: props.refkey,
124
+ isNullable: props.nullable,
125
+ type: TypeSlot.firstSymbol,
142
126
  });
143
127
 
144
128
  const modifiers = computeModifiersPrefix([
@@ -154,21 +138,19 @@ export function Property(props: PropertyProps) {
154
138
  // note that scope wraps the method decl so that the params get the correct scope
155
139
  return (
156
140
  <MemberDeclaration symbol={propertySymbol}>
157
- <Scope value={propertyScope}>
158
- <DocWhen doc={props.doc} />
159
- <AttributeList attributes={props.attributes} endline />
160
- {modifiers}
161
- {props.type}
162
- {props.nullable && "?"} {name}{" "}
163
- <Block newline inline>
164
- <List joiner=" ">
165
- {props.get && "get;"}
166
- {props.set && "set;"}
167
- {props.init && "init;"}
168
- </List>
169
- </Block>
170
- {props.initializer && code` = ${props.initializer};`}
171
- </Scope>
141
+ <DocWhen doc={props.doc} />
142
+ <AttributeList attributes={props.attributes} endline />
143
+ {modifiers}
144
+ <TypeSlot>{props.type}</TypeSlot>
145
+ {props.nullable && "?"} <MemberName />{" "}
146
+ <Block newline inline>
147
+ <List joiner=" ">
148
+ {props.get && "get;"}
149
+ {props.set && "set;"}
150
+ {props.init && "init;"}
151
+ </List>
152
+ </Block>
153
+ {props.initializer && code` = ${props.initializer};`}
172
154
  </MemberDeclaration>
173
155
  );
174
156
  }
@@ -1,9 +1,15 @@
1
+ import { Children, code, refkey } from "@alloy-js/core";
1
2
  import { describe, expect, it } from "vitest";
2
3
  import { TestNamespace } from "../../../test/utils.jsx";
3
4
  import { Property } from "../property/property.jsx";
4
5
  import { RecordDeclaration } from "./declaration.jsx";
5
6
 
6
- it("declares class with no members", () => {
7
+ // Remove Wrapper that added <SourceFile> because TestNamespace already does
8
+ function Wrapper({ children }: { children: Children }) {
9
+ return <TestNamespace>{children}</TestNamespace>;
10
+ }
11
+
12
+ it("declares record with no members", () => {
7
13
  expect(
8
14
  <TestNamespace>
9
15
  <RecordDeclaration name="TestRecord" />
@@ -56,7 +62,7 @@ it("specify doc comment", () => {
56
62
  `);
57
63
  });
58
64
 
59
- it("specify class property inside", () => {
65
+ it("specify record property inside", () => {
60
66
  expect(
61
67
  <TestNamespace>
62
68
  <RecordDeclaration name="TestRecord" doc="This is a test">
@@ -67,7 +73,45 @@ it("specify class property inside", () => {
67
73
  /// This is a test
68
74
  record TestRecord
69
75
  {
70
- string Prop { get; set; }
76
+ string Prop { get; set; }
71
77
  }
72
78
  `);
73
79
  });
80
+
81
+ describe("constructor", () => {
82
+ it("declares primary constructor with args", () => {
83
+ const paramNameRefkey = refkey();
84
+ const paramSizeRefkey = refkey();
85
+
86
+ const ctorParams = [
87
+ {
88
+ name: "name",
89
+ type: "string",
90
+ refkey: paramNameRefkey,
91
+ },
92
+ {
93
+ name: "size",
94
+ type: "int",
95
+ refkey: paramSizeRefkey,
96
+ },
97
+ ];
98
+
99
+ expect(
100
+ <Wrapper>
101
+ <RecordDeclaration public name="Test" primaryConstructor={ctorParams}>
102
+ <Property
103
+ name="PrettyName"
104
+ type="string"
105
+ get
106
+ initializer={code`$"{${paramNameRefkey}} {${paramSizeRefkey}}"`}
107
+ />
108
+ </RecordDeclaration>
109
+ </Wrapper>,
110
+ ).toRenderTo(`
111
+ public record Test(string name, int size)
112
+ {
113
+ string PrettyName { get; } = $"{name} {size}";
114
+ }
115
+ `);
116
+ });
117
+ });
@@ -6,10 +6,14 @@ import {
6
6
  makeModifiers,
7
7
  } from "../../modifiers.js";
8
8
  import { useCSharpNamePolicy } from "../../name-policy.js";
9
- import { CSharpOutputSymbol } from "../../symbols/csharp-output-symbol.js";
10
- import { CSharpMemberScope } from "../../symbols/scopes.js";
9
+ import { createClassScope } from "../../scopes/factories.js";
10
+ import {
11
+ createNamedTypeSymbol,
12
+ createTypeParameterSymbol,
13
+ } from "../../symbols/factories.js";
11
14
  import { DocWhen } from "../doc/comment.jsx";
12
15
  import { Name } from "../Name.jsx";
16
+ import { ParameterProps, Parameters } from "../parameters/parameters.jsx";
13
17
 
14
18
  export interface RecordModifiers {
15
19
  readonly partial?: boolean;
@@ -28,6 +32,24 @@ export interface RecordDeclarationProps
28
32
  doc?: core.Children;
29
33
  refkey?: core.Refkey;
30
34
  typeParameters?: Record<string, core.Refkey>;
35
+
36
+ /**
37
+ * Set the primary constructor parameters
38
+ * @example
39
+ * ```tsx
40
+ * <ClassDeclaration name="MyClass" primaryConstructor={[
41
+ * {name: "value", type: "int"}
42
+ * ]}>
43
+ * ```
44
+ * This will produce:
45
+ * ```csharp
46
+ * public class MyClass(int value)
47
+ * {
48
+ *
49
+ * }
50
+ * ```
51
+ */
52
+ primaryConstructor?: ParameterProps[];
31
53
  }
32
54
 
33
55
  /**
@@ -53,17 +75,13 @@ export interface RecordDeclarationProps
53
75
  export function RecordDeclaration(props: RecordDeclarationProps) {
54
76
  const name = useCSharpNamePolicy().getName(props.name!, "record");
55
77
 
56
- const thisRecordSymbol = new CSharpOutputSymbol(name, {
78
+ // records don't have their own type kind but instead use class or struct
79
+ // depending on what kind of record we have.
80
+ const thisRecordSymbol = createNamedTypeSymbol(name, "record", {
57
81
  refkeys: props.refkey,
58
82
  });
59
83
 
60
- // this creates a new scope for the record definition.
61
- // members will automatically "inherit" this scope so
62
- // that refkeys to them will produce the fully-qualified
63
- // name e.g. Foo.Bar.
64
- const thisRecordScope = new CSharpMemberScope("record-decl", {
65
- owner: thisRecordSymbol,
66
- });
84
+ const thisRecordScope = createClassScope(thisRecordSymbol);
67
85
 
68
86
  let typeParams: core.Children;
69
87
  if (props.typeParameters) {
@@ -74,7 +92,7 @@ export function RecordDeclaration(props: RecordDeclarationProps) {
74
92
  );
75
93
  // create a symbol for each type param so its
76
94
  // refkey resolves to the type param's name
77
- new CSharpOutputSymbol(entry[0], {
95
+ createTypeParameterSymbol(entry[0], {
78
96
  scope: thisRecordScope,
79
97
  refkeys: entry[1],
80
98
  });
@@ -99,6 +117,11 @@ export function RecordDeclaration(props: RecordDeclarationProps) {
99
117
  <DocWhen doc={props.doc} />
100
118
  {modifiers}record <Name />
101
119
  {typeParams}
120
+ {props.primaryConstructor && (
121
+ <core.Scope value={thisRecordScope}>
122
+ <Parameters parameters={props.primaryConstructor} />
123
+ </core.Scope>
124
+ )}
102
125
  {props.children ?
103
126
  <core.Block newline>
104
127
  <core.Scope value={thisRecordScope}>{props.children}</core.Scope>
@@ -0,0 +1,96 @@
1
+ import { ClassDeclaration } from "#components/class/declaration.jsx";
2
+ import { Namespace } from "#components/namespace.jsx";
3
+ import { Children, FormatOptions, Indent, Output, Prose } from "@alloy-js/core";
4
+ import { describe, expect, it } from "vitest";
5
+ import { CSharpFormatOptions } from "../../contexts/format-options.js";
6
+ import { SourceFile } from "./source-file.jsx";
7
+
8
+ it("defines multiple source files with unique content", () => {
9
+ expect(
10
+ <Output>
11
+ <Namespace name="TestCode">
12
+ <SourceFile path="Test1.cs">
13
+ <ClassDeclaration public name="TestClass1" />
14
+ </SourceFile>
15
+ <SourceFile path="Test2.cs">
16
+ <ClassDeclaration public name="TestClass2" />
17
+ </SourceFile>
18
+ </Namespace>
19
+ </Output>,
20
+ ).toRenderTo({
21
+ "Test1.cs": `
22
+ namespace TestCode;
23
+
24
+ public class TestClass1;
25
+ `,
26
+ "Test2.cs": `
27
+ namespace TestCode;
28
+
29
+ public class TestClass2;
30
+ `,
31
+ });
32
+ });
33
+
34
+ describe("format options", () => {
35
+ function FileWithFormatOptions(props: {
36
+ options: CSharpFormatOptions;
37
+ children: Children;
38
+ }) {
39
+ return (
40
+ <CSharpFormatOptions value={props.options}>
41
+ <SourceFile path="hi.cs">{props.children}</SourceFile>
42
+ </CSharpFormatOptions>
43
+ );
44
+ }
45
+
46
+ it("respect tabWidth", () => {
47
+ expect(
48
+ <FileWithFormatOptions options={{ tabWidth: 5 }}>
49
+ hello
50
+ <Indent>indented 5 spaces</Indent>
51
+ </FileWithFormatOptions>,
52
+ ).toRenderTo(`
53
+ hello
54
+ indented 5 spaces
55
+ `);
56
+ });
57
+
58
+ it("respect useTabs", () => {
59
+ expect(
60
+ <FileWithFormatOptions options={{ useTabs: true }}>
61
+ hello
62
+ <Indent>indented with tabs</Indent>
63
+ </FileWithFormatOptions>,
64
+ ).toRenderTo(`
65
+ hello
66
+ \tindented with tabs
67
+ `);
68
+ });
69
+
70
+ it("respect printWidth", () => {
71
+ expect(
72
+ <FileWithFormatOptions options={{ printWidth: 10 }}>
73
+ <Prose>this is too long</Prose>
74
+ </FileWithFormatOptions>,
75
+ ).toRenderTo(`
76
+ this is
77
+ too long
78
+ `);
79
+ });
80
+
81
+ it("CSharpFormatOptions takes precedence over FormatOptions", () => {
82
+ expect(
83
+ <FormatOptions value={{ tabWidth: 5 }}>
84
+ <CSharpFormatOptions value={{ tabWidth: 3 }}>
85
+ <SourceFile path="hi.cs">
86
+ hello
87
+ <Indent>indented 3 spaces</Indent>
88
+ </SourceFile>
89
+ </CSharpFormatOptions>
90
+ </FormatOptions>,
91
+ ).toRenderTo(`
92
+ hello
93
+ indented 3 spaces
94
+ `);
95
+ });
96
+ });
@@ -0,0 +1,98 @@
1
+ import { NamespaceScopes } from "#components/namespace-scopes.jsx";
2
+ import { Reference } from "#components/Reference.jsx";
3
+ import { UsingDirective } from "#components/UsingDirective.jsx";
4
+ import {
5
+ Block,
6
+ Children,
7
+ computed,
8
+ SourceFile as CoreSourceFile,
9
+ Scope,
10
+ useBinder,
11
+ } from "@alloy-js/core";
12
+ import {
13
+ CSharpFormatOptions,
14
+ useCsharpFormatOptions,
15
+ } from "../../contexts/format-options.js";
16
+ import { getGlobalNamespace } from "../../contexts/global-namespace.js";
17
+ import { useNamespaceContext } from "../../contexts/namespace.js";
18
+ import { CSharpSourceFileScope } from "../../scopes/source-file.js";
19
+ import { NamespaceSymbol } from "../../symbols/namespace.js";
20
+
21
+ /**
22
+ * Props for {@link SourceFile} component
23
+ */
24
+ export interface SourceFileProps extends CSharpFormatOptions {
25
+ /** Path of the source file */
26
+ path: string;
27
+
28
+ /** Source file content */
29
+ children?: Children;
30
+
31
+ /**
32
+ * A list of using directives to explicitly include. Note that providing
33
+ * explicit usings is not necessary when referencing symbols via refkeys.
34
+ */
35
+ using?: string[];
36
+ }
37
+
38
+ /** A C# source file exists within the context of a namespace contains using statements and declarations */
39
+ export function SourceFile(props: SourceFileProps) {
40
+ const sourceFileScope = new CSharpSourceFileScope(props.path);
41
+
42
+ const nsContext = useNamespaceContext();
43
+ const globalNs = getGlobalNamespace(useBinder());
44
+ const nsSymbol = nsContext ? nsContext.symbol : globalNs;
45
+ const nsRef = nsContext ? nsContext.symbol.name : undefined;
46
+ const usings = computed(() => {
47
+ return (
48
+ Array.from(sourceFileScope.usings) as (NamespaceSymbol | string)[]
49
+ ).concat(props.using ?? []);
50
+ });
51
+
52
+ const content = computed(() => (
53
+ <NamespaceScopes symbol={nsSymbol}>{props.children}</NamespaceScopes>
54
+ ));
55
+
56
+ const opts = useCsharpFormatOptions({
57
+ printWidth: props.printWidth,
58
+ tabWidth: props.tabWidth,
59
+ useTabs: props.useTabs,
60
+ });
61
+
62
+ return (
63
+ <CoreSourceFile
64
+ path={props.path}
65
+ filetype="cs"
66
+ reference={Reference}
67
+ {...opts}
68
+ >
69
+ <Scope value={sourceFileScope}>
70
+ {(sourceFileScope.usings.size > 0 ||
71
+ (props.using && props.using.length > 0)) && (
72
+ <>
73
+ <UsingDirective namespaces={usings.value} />
74
+ <hbr />
75
+ <hbr />
76
+ </>
77
+ )}
78
+ {nsSymbol === globalNs ?
79
+ content
80
+ : <>
81
+ namespace {nsRef}
82
+ {sourceFileScope.hasBlockNamespace ?
83
+ <>
84
+ {" "}
85
+ <Block>{content}</Block>
86
+ </>
87
+ : <>
88
+ ;<hbr />
89
+ <hbr />
90
+ {content}
91
+ </>
92
+ }
93
+ </>
94
+ }
95
+ </Scope>
96
+ </CoreSourceFile>
97
+ );
98
+ }
@@ -6,7 +6,6 @@ import { Constructor } from "../constructor/constructor.jsx";
6
6
  import { Field } from "../field/field.jsx";
7
7
  import { Method } from "../method/method.jsx";
8
8
  import { Property } from "../property/property.jsx";
9
- import { SourceFile } from "../SourceFile.jsx";
10
9
  import { TypeParameterProps } from "../type-parameters/type-parameter.jsx";
11
10
  import { StructDeclaration } from "./declaration.jsx";
12
11
 
@@ -78,23 +77,18 @@ describe("with type parameters", () => {
78
77
 
79
78
  expect(
80
79
  <TestNamespace>
81
- <SourceFile path="Test.cs">
82
- <StructDeclaration public name="Test" typeParameters={typeParameters}>
83
- <List>
84
- <Property name="PropA" type={typeParameters[0].refkey} get set />
85
- <Property name="PropB" type={typeParameters[1].refkey} get set />
86
- </List>
87
- </StructDeclaration>
88
- </SourceFile>
80
+ <StructDeclaration public name="Test" typeParameters={typeParameters}>
81
+ <List>
82
+ <Property name="PropA" type={typeParameters[0].refkey} get set />
83
+ <Property name="PropB" type={typeParameters[1].refkey} get set />
84
+ </List>
85
+ </StructDeclaration>
89
86
  </TestNamespace>,
90
87
  ).toRenderTo(`
91
- namespace TestCode
88
+ public struct Test<T, U>
92
89
  {
93
- public struct Test<T, U>
94
- {
95
- T PropA { get; set; }
96
- U PropB { get; set; }
97
- }
90
+ T PropA { get; set; }
91
+ U PropB { get; set; }
98
92
  }
99
93
  `);
100
94
  });
@@ -119,10 +113,10 @@ describe("with type parameters", () => {
119
113
  </TestNamespace>,
120
114
  ).toRenderTo(`
121
115
  public struct Test<T, U>
122
- where T : IFoo
123
- where U : IBar
116
+ where T : IFoo
117
+ where U : IBar
124
118
  {
125
- // Body
119
+ // Body
126
120
  }
127
121
  `);
128
122
  });
@@ -149,7 +143,7 @@ it("define methods", () => {
149
143
  ).toRenderTo(`
150
144
  struct Test
151
145
  {
152
- void MethodOne() {}
146
+ void MethodOne() {}
153
147
  }
154
148
  `);
155
149
  });
@@ -164,7 +158,7 @@ it("define constructor", () => {
164
158
  ).toRenderTo(`
165
159
  struct Test
166
160
  {
167
- public Test() {}
161
+ public Test() {}
168
162
  }
169
163
  `);
170
164
  });
@@ -182,8 +176,8 @@ it("defines fields", () => {
182
176
  ).toRenderTo(`
183
177
  public struct TestClass
184
178
  {
185
- public string MemberOne;
186
- public int MemberTwo;
179
+ public string MemberOne;
180
+ public int MemberTwo;
187
181
  }
188
182
  `);
189
183
  });
@@ -7,8 +7,8 @@ import {
7
7
  makeModifiers,
8
8
  } from "../../modifiers.js";
9
9
  import { useCSharpNamePolicy } from "../../name-policy.js";
10
- import { CSharpOutputSymbol } from "../../symbols/csharp-output-symbol.js";
11
- import { CSharpMemberScope } from "../../symbols/scopes.js";
10
+ import { createNamedTypeScope } from "../../scopes/factories.js";
11
+ import { createNamedTypeSymbol } from "../../symbols/factories.js";
12
12
  import { AttributeList, AttributesProp } from "../attributes/attributes.jsx";
13
13
  import { DocWhen } from "../doc/comment.jsx";
14
14
  import { Name } from "../Name.jsx";
@@ -100,13 +100,11 @@ export interface StructDeclarationProps
100
100
  export function StructDeclaration(props: StructDeclarationProps) {
101
101
  const name = useCSharpNamePolicy().getName(props.name!, "struct");
102
102
 
103
- const thisStructSymbol = new CSharpOutputSymbol(name, {
103
+ const thisStructSymbol = createNamedTypeSymbol(name, "struct", {
104
104
  refkeys: props.refkey,
105
105
  });
106
106
 
107
- const thisStructScope = new CSharpMemberScope("struct-decl", {
108
- owner: thisStructSymbol,
109
- });
107
+ const thisStructScope = createNamedTypeScope(thisStructSymbol);
110
108
 
111
109
  const modifiers = computeModifiersPrefix([
112
110
  getAccessModifier(props),
@@ -1,7 +1,10 @@
1
- import { Children, MemberDeclaration, refkey, Refkey } from "@alloy-js/core";
2
- import { useCSharpNamePolicy } from "../../name-policy.js";
3
- import { CSharpOutputSymbol } from "../../symbols/csharp-output-symbol.js";
4
- import { useCSharpScope } from "../../symbols/scopes.js";
1
+ import {
2
+ Children,
3
+ MemberDeclaration,
4
+ MemberName,
5
+ Refkey,
6
+ } from "@alloy-js/core";
7
+ import { createTypeParameterSymbol } from "../../symbols/factories.js";
5
8
 
6
9
  /**
7
10
  * Information for a TypeScript generic type parameter.
@@ -24,12 +27,12 @@ export interface TypeParameterProps {
24
27
  }
25
28
 
26
29
  export function TypeParameter(props: TypeParameterProps) {
27
- const name = useCSharpNamePolicy().getName(props.name, "type-parameter");
28
- const scope = useCSharpScope();
29
- const symbol = new CSharpOutputSymbol(name, {
30
- scope,
31
- refkeys: props.refkey ?? refkey(props.name),
30
+ const symbol = createTypeParameterSymbol(props.name, {
31
+ refkeys: props.refkey,
32
32
  });
33
-
34
- return <MemberDeclaration symbol={symbol}>{name}</MemberDeclaration>;
33
+ return (
34
+ <MemberDeclaration symbol={symbol}>
35
+ <MemberName />
36
+ </MemberDeclaration>
37
+ );
35
38
  }
@@ -15,16 +15,16 @@ it("render very long", () => {
15
15
  <TestNamespace>
16
16
  <TypeParameters
17
17
  parameters={[
18
- "SomeVeryVeryLongParamThatMightGetSplitOverMultipleLinesA",
19
- "SomeVeryVeryLongParamThatMightGetSplitOverMultipleLinesB",
18
+ "SomeVeryVeryLongParamThatMightGetSplitOverMultipleLinesLongLongLongLongLongA",
19
+ "SomeVeryVeryLongParamThatMightGetSplitOverMultipleLinesLongLongLongLongLongB",
20
20
  ]}
21
21
  />
22
22
  </TestNamespace>,
23
23
  ).toRenderTo(
24
24
  `
25
25
  <
26
- SomeVeryVeryLongParamThatMightGetSplitOverMultipleLinesA,
27
- SomeVeryVeryLongParamThatMightGetSplitOverMultipleLinesB>
26
+ SomeVeryVeryLongParamThatMightGetSplitOverMultipleLinesLongLongLongLongLongA,
27
+ SomeVeryVeryLongParamThatMightGetSplitOverMultipleLinesLongLongLongLongLongB>
28
28
  `,
29
29
  );
30
30
  });
@@ -1,7 +1,6 @@
1
1
  import { List, refkey } from "@alloy-js/core";
2
2
  import { expect, it } from "vitest";
3
3
  import { TestNamespace } from "../../../test/utils.jsx";
4
- import { SourceFile } from "../SourceFile.jsx";
5
4
  import { VarDeclaration } from "./declaration.jsx";
6
5
 
7
6
  it("declares var without type", () => {
@@ -40,20 +39,15 @@ it("links refkey", () => {
40
39
  const key = refkey();
41
40
  expect(
42
41
  <TestNamespace>
43
- <SourceFile path="test.cs">
44
- <List>
45
- <VarDeclaration name="testVar" refkey={key}>
46
- 42
47
- </VarDeclaration>
48
- <VarDeclaration name="testVar2">{key}</VarDeclaration>
49
- </List>
50
- </SourceFile>
42
+ <List>
43
+ <VarDeclaration name="testVar" refkey={key}>
44
+ 42
45
+ </VarDeclaration>
46
+ <VarDeclaration name="testVar2">{key}</VarDeclaration>
47
+ </List>
51
48
  </TestNamespace>,
52
49
  ).toRenderTo(`
53
- namespace TestCode
54
- {
55
- var testVar = 42;
56
- var testVar2 = testVar;
57
- }
50
+ var testVar = 42;
51
+ var testVar2 = testVar;
58
52
  `);
59
53
  });