@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
@@ -1,8 +1,8 @@
1
1
  import * as core from "@alloy-js/core";
2
2
  export interface DeclarationProps {
3
3
  name: string;
4
- refkey?: core.Refkey;
4
+ refkey?: core.Refkey | core.Refkey[];
5
5
  children?: core.Children;
6
6
  }
7
- export declare function Declaration(props: DeclarationProps): core.Children;
7
+ export declare function Declaration(props: DeclarationProps): void;
8
8
  //# sourceMappingURL=Declaration.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Declaration.d.ts","sourceRoot":"","sources":["../../../src/components/Declaration.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAC;AAIvC,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC;CAC1B;AAGD,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,iBAMlD"}
1
+ {"version":3,"file":"Declaration.d.ts","sourceRoot":"","sources":["../../../src/components/Declaration.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAC;AAGvC,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;IACrC,QAAQ,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC;CAC1B;AAGD,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,QAIlD"}
@@ -1,18 +1,9 @@
1
- import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
2
- import * as core from "@alloy-js/core";
3
- import { CSharpOutputSymbol } from "../symbols/csharp-output-symbol.js";
4
-
5
1
  // properties for creating a declaration
6
2
 
7
3
  // declares a symbol in the program (class, enum, interface etc)
8
4
  export function Declaration(props) {
9
- const sym = new CSharpOutputSymbol(props.name, {
10
- refkeys: props.refkey
11
- });
12
- return _$createComponent(core.Declaration, {
13
- symbol: sym,
14
- get children() {
15
- return props.children;
16
- }
17
- });
18
- }
5
+ throw new Error("Not supported");
6
+
7
+ //return <core.Declaration symbol={sym}>{props.children}</core.Declaration>;
8
+ }
9
+ //# sourceMappingURL=Declaration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Declaration","props","Error"],"sources":["../../../src/components/Declaration.tsx"],"sourcesContent":[null],"mappings":"AAEA;;AAOA;AACA,OAAO,SAASA,WAAWA,CAACC,KAAuB,EAAE;EACnD,MAAM,IAAIC,KAAK,CAAC,eAAe,CAAC;;EAEhC;AACF","ignoreList":[]}
@@ -8,4 +8,5 @@ export function Name() {
8
8
  throw new Error("missing declaration context");
9
9
  }
10
10
  return [_$memo(() => declSymbol.name)];
11
- }
11
+ }
12
+ //# sourceMappingURL=Name.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["core","Name","declSymbol","useContext","DeclarationContext","Error","_$memo","name"],"sources":["../../../src/components/Name.tsx"],"sourcesContent":[null],"mappings":";AAAA,OAAO,KAAKA,IAAI,MAAM,gBAAgB;;AAEtC;AACA,OAAO,SAASC,IAAIA,CAAA,EAAG;EACrB,MAAMC,UAAU,GAAGF,IAAI,CAACG,UAAU,CAACH,IAAI,CAACI,kBAAkB,CAAC;EAC3D,IAAI,CAACF,UAAU,EAAE;IACf,MAAM,IAAIG,KAAK,CAAC,6BAA6B,CAAC;EAChD;EAEA,QAAAC,MAAA,OAAUJ,UAAU,CAACK,IAAI;AAC3B","ignoreList":[]}
@@ -43,4 +43,5 @@ export function ProjectDirectory(props) {
43
43
  })];
44
44
  }
45
45
  });
46
- }
46
+ }
47
+ //# sourceMappingURL=ProjectDirectory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["core","join","ProjectDirectory","props","srcDir","targetFrameworkMoniker","_$createComponent","SourceDirectory","path","name","children","SourceFile","filetype","code","version","description"],"sources":["../../../src/components/ProjectDirectory.tsx"],"sourcesContent":[null],"mappings":";AAAA,OAAO,KAAKA,IAAI,MAAM,gBAAgB;AACtC,SAASC,IAAI,QAAQ,OAAO;;AAE5B;;AAwBA;AACA,OAAO,SAASC,gBAAgBA,CAACC,KAA4B,EAAE;EAC7D,IAAI,CAACA,KAAK,CAACC,MAAM,EAAE;IACjBD,KAAK,CAACC,MAAM,GAAG,KAAK;EACtB;EAEA,IAAI,CAACD,KAAK,CAACE,sBAAsB,EAAE;IACjCF,KAAK,CAACE,sBAAsB,GAAG,QAAQ;EACzC;EAEA,OAAAC,iBAAA,CACGN,IAAI,CAACO,eAAe;IAAA,IAACC,IAAIA,CAAA;MAAA,OAAEP,IAAI,CAACE,KAAK,CAACK,IAAI,EAAEL,KAAK,CAACM,IAAI,CAAC;IAAA;IAAA,IAAAC,SAAA;MAAA,QAAAJ,iBAAA,CACrDN,IAAI,CAACW,UAAU;QAAA,IAACH,IAAIA,CAAA;UAAA,OAAEL,KAAK,CAACM,IAAI,GAAG,SAAS;QAAA;QAAEG,QAAQ;QAAA,IAAAF,SAAA;UAAA,OACpDV,IAAI,CAACa,IAAI;AAClB;AACA;AACA,uBAAuBV,KAAK,CAACW,OAAO;AACpC,2BAA2BX,KAAK,CAACY,WAAW;AAC5C,+BAA+BZ,KAAK,CAACE,sBAAsB;AAC3D;AACA;AACA,OAAO;QAAA;MAAA,IAAAC,iBAAA,CAEAN,IAAI,CAACO,eAAe;QAAA,IAACC,IAAIA,CAAA;UAAA,OAAEL,KAAK,CAACC,MAAM;QAAA;QAAA,IAAAM,SAAA;UAAA,OACrCP,KAAK,CAACO,QAAQ;QAAA;MAAA;IAAA;EAAA;AAIvB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"Reference.d.ts","sourceRoot":"","sources":["../../../src/components/Reference.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAC;AAGvC,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC;CACrB;AAGD,wBAAgB,SAAS,CAAC,EAAE,MAAM,EAAE,EAAE,cAAc,iBAInD"}
1
+ {"version":3,"file":"Reference.d.ts","sourceRoot":"","sources":["../../../src/components/Reference.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAC;AAGvC,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC;CACrB;AAGD,wBAAgB,SAAS,CAAC,EAAE,MAAM,EAAE,EAAE,cAAc,iBAMnD"}
@@ -1,8 +1,13 @@
1
+ import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
2
+ import * as core from "@alloy-js/core";
1
3
  import { ref } from "../symbols/reference.js";
2
4
  // used to resolve refkey references within source files
3
5
  export function Reference({
4
6
  refkey
5
7
  }) {
6
8
  const reference = ref(refkey);
7
- return [reference];
8
- }
9
+ const symbolRef = core.computed(() => reference()[1]);
10
+ core.emitSymbol(symbolRef);
11
+ return [_$memo(() => reference()[0])];
12
+ }
13
+ //# sourceMappingURL=Reference.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["core","ref","Reference","refkey","reference","symbolRef","computed","emitSymbol","_$memo"],"sources":["../../../src/components/Reference.tsx"],"sourcesContent":[null],"mappings":";AAAA,OAAO,KAAKA,IAAI,MAAM,gBAAgB;AACtC,SAASC,GAAG,QAAQ,yBAAyB;AAM7C;AACA,OAAO,SAASC,SAASA,CAAC;EAAEC;AAAuB,CAAC,EAAE;EACpD,MAAMC,SAAS,GAAGH,GAAG,CAACE,MAAM,CAAC;EAC7B,MAAME,SAAS,GAAGL,IAAI,CAACM,QAAQ,CAAC,MAAMF,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;EAErDJ,IAAI,CAACO,UAAU,CAACF,SAAS,CAAC;EAC1B,QAAAG,MAAA,OAAUJ,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;AAC1B","ignoreList":[]}
@@ -1,6 +1,10 @@
1
1
  import * as core from "@alloy-js/core";
2
+ import { NamespaceSymbol } from "../symbols/namespace.js";
2
3
  export interface UsingDirectiveProps {
3
- namespaces: Array<string>;
4
+ /**
5
+ * Namespace symbols or namespace names to use to generate using statements.
6
+ */
7
+ namespaces?: (NamespaceSymbol | string)[];
4
8
  }
5
9
  export declare function UsingDirective(props: UsingDirectiveProps): core.Children;
6
10
  //# sourceMappingURL=UsingDirective.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"UsingDirective.d.ts","sourceRoot":"","sources":["../../../src/components/UsingDirective.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAC;AAEvC,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CAC3B;AAGD,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,iBAUxD"}
1
+ {"version":3,"file":"UsingDirective.d.ts","sourceRoot":"","sources":["../../../src/components/UsingDirective.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,UAAU,CAAC,EAAE,CAAC,eAAe,GAAG,MAAM,CAAC,EAAE,CAAC;CAC3C;AAGD,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,iBAgBxD"}
@@ -3,10 +3,13 @@ import * as core from "@alloy-js/core";
3
3
  // one ore more C# using directives
4
4
  export function UsingDirective(props) {
5
5
  const sortedNamespaces = core.computed(() => {
6
- return props.namespaces.sort();
6
+ return props.namespaces.map(ns => typeof ns === "string" ? ns : ns.getFullyQualifiedName({
7
+ omitGlobal: true
8
+ })).sort((n1, n2) => n1.localeCompare(n2));
7
9
  });
8
10
  return _$createComponent(core.For, {
9
11
  each: sortedNamespaces,
10
12
  children: namespace => `using ${namespace};`
11
13
  });
12
- }
14
+ }
15
+ //# sourceMappingURL=UsingDirective.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["core","UsingDirective","props","sortedNamespaces","computed","namespaces","map","ns","getFullyQualifiedName","omitGlobal","sort","n1","n2","localeCompare","_$createComponent","For","each","children","namespace"],"sources":["../../../src/components/UsingDirective.tsx"],"sourcesContent":[null],"mappings":";AAAA,OAAO,KAAKA,IAAI,MAAM,gBAAgB;AAUtC;AACA,OAAO,SAASC,cAAcA,CAACC,KAA0B,EAAE;EACzD,MAAMC,gBAAgB,GAAGH,IAAI,CAACI,QAAQ,CAAC,MAAM;IAC3C,OAAOF,KAAK,CACTG,UAAU,CAAEC,GAAG,CAAEC,EAAE,IAClB,OAAOA,EAAE,KAAK,QAAQ,GAAGA,EAAE,GACzBA,EAAE,CAACC,qBAAqB,CAAC;MAAEC,UAAU,EAAE;IAAK,CAAC,CAEjD,CAAC,CACAC,IAAI,CAAC,CAACC,EAAE,EAAEC,EAAE,KAAKD,EAAE,CAACE,aAAa,CAACD,EAAE,CAAC,CAAC;EAC3C,CAAC,CAAC;EAEF,OAAAE,iBAAA,CACGd,IAAI,CAACe,GAAG;IAACC,IAAI,EAAEb,gBAAgB;IAAAc,QAAA,EAC5BC,SAAS,IAAK,SAASA,SAAS;EAAG;AAG3C","ignoreList":[]}
@@ -0,0 +1,54 @@
1
+ import { Children, Refkey } from "@alloy-js/core";
2
+ import { CSharpSymbol } from "../../symbols/csharp.js";
3
+ export interface AccessExpressionProps {
4
+ children: Children;
5
+ }
6
+ export declare function AccessExpression(props: AccessExpressionProps): string | number | boolean | void | (() => Children) | import("@vue/reactivity").Ref<any, any> | import("@alloy-js/core").SymbolRefkey | import("@alloy-js/core").MemberRefkey | import("@alloy-js/core").CustomContext | import("@alloy-js/core").IndentIntrinsicElement | import("@alloy-js/core").IndentIfBreakIntrinsicElement | import("@alloy-js/core").BrIntrinsicElement | import("@alloy-js/core").LineIntrinsicElement | import("@alloy-js/core").HbrIntrinsicElement | import("@alloy-js/core").HardlineIntrinsicElement | import("@alloy-js/core").SbrIntrinsicElement | import("@alloy-js/core").SoftlineIntrinsicElement | import("@alloy-js/core").GroupIntrinsicElement | import("@alloy-js/core").AlignIntrinsicElement | import("@alloy-js/core").FillIntrinsicElement | import("@alloy-js/core").BreakParentIntrinsicElement | import("@alloy-js/core").LineSuffixIntrinsicElement | import("@alloy-js/core").LineSuffixBoundaryIntrinsicElement | import("@alloy-js/core").DedentIntrinsicElement | import("@alloy-js/core").LiterallineIntrinsicElement | import("@alloy-js/core").LbrIntrinsicElement | import("@alloy-js/core").DedentToRootIntrinsicElement | import("@alloy-js/core").MarkAsRootIntrinsicElement | import("@alloy-js/core").IfBreakIntrinsicElement | Children[] | import("@vue/reactivity").ComputedRef<Children> | null;
7
+ export declare namespace AccessExpression {
8
+ var Part: (props: AccessExpressionPartProps) => void;
9
+ }
10
+ export interface AccessExpressionPartProps {
11
+ children?: Children;
12
+ /**
13
+ * Whether this part should use conditional access.
14
+ */
15
+ conditional?: boolean;
16
+ /**
17
+ * Emit a function call.
18
+ */
19
+ args?: boolean | Children[];
20
+ /**
21
+ * Type arguments to pass to a member access.
22
+ */
23
+ typeArgs?: Children[];
24
+ /**
25
+ * A refkey for the symbol whose name becomes this part's identifier. When a refkey is provided for the first
26
+ * part, it will be fully resolved. Otherwise, just the symbol's name is used.
27
+ */
28
+ refkey?: Refkey;
29
+ /**
30
+ * The symbol whose name becomes this part's identifier.
31
+ */
32
+ symbol?: CSharpSymbol;
33
+ /**
34
+ * The identifier to use for this part.
35
+ */
36
+ id?: string;
37
+ /**
38
+ * Create an element access part with a single indexer argument. Mutually
39
+ * exclusive with the `indexerArgs` prop.
40
+ */
41
+ index?: Children;
42
+ /**
43
+ * Create an element access part with multiple indexer arguments. Mutually
44
+ * exclusive with the `index` prop.
45
+ */
46
+ indexerArgs?: Children[];
47
+ /**
48
+ * Whether this part could possibly be null. Will guard member and element
49
+ * access with a conditional access operator. Passing this is not necessary if
50
+ * you provide a symbol or refkey and the symbol's nullable flag is set.
51
+ */
52
+ nullable?: boolean;
53
+ }
54
+ //# sourceMappingURL=access-expression.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"access-expression.d.ts","sourceRoot":"","sources":["../../../../src/components/access-expression/access-expression.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAMR,MAAM,EAGP,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAWvD,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,qyCA6B5D;yBA7Be,gBAAgB;sBAoGS,yBAAyB;;AApDlE,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,EAAE,CAAC;IAE5B;;OAEG;IACH,QAAQ,CAAC,EAAE,QAAQ,EAAE,CAAC;IAEtB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,MAAM,CAAC,EAAE,YAAY,CAAC;IAEtB;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ;;;OAGG;IACH,KAAK,CAAC,EAAE,QAAQ,CAAC;IAEjB;;;OAGG;IACH,WAAW,CAAC,EAAE,QAAQ,EAAE,CAAC;IAEzB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB"}
@@ -0,0 +1,277 @@
1
+ import { createIntrinsic as _$createIntrinsic, createComponent as _$createComponent, memo as _$memo } from "@alloy-js/core/jsx-runtime";
2
+ import { childrenArray, computed, For, isComponentCreator, Show, takeSymbols } from "@alloy-js/core";
3
+ import { childrenToPartDescriptors, isArgsPart, isIdPart } from "./part-descriptors.js";
4
+ export function AccessExpression(props) {
5
+ const children = flattenAccessExpression(childrenArray(() => props.children));
6
+ const parts = childrenToPartDescriptors(children);
7
+
8
+ // any symbols emitted from the children won't be relevant to parent scopes.
9
+ takeSymbols();
10
+ if (parts.length === 0) {
11
+ return [];
12
+ }
13
+ const isCallChain = computed(() => {
14
+ let callCount = 0;
15
+ for (const part of parts) {
16
+ if (isArgsPart(part)) callCount++;
17
+ }
18
+ return callCount > 1;
19
+ });
20
+
21
+ // construct a member expression from the parts. When a part is nullish,
22
+ // and there is a subsequent part, we use `?.` instead of `.`. accessStyle determines
23
+ // whether we use dot or bracket notation.
24
+
25
+ return computed(() => {
26
+ return isCallChain.value ? formatCallChain(parts) : formatNonCallChain(parts);
27
+ });
28
+ }
29
+
30
+ /**
31
+ * Flattens nested access expressions into a single array of parts.
32
+ */
33
+ function flattenAccessExpression(children) {
34
+ const flattened = [];
35
+ for (const child of children) {
36
+ if (isComponentCreator(child, AccessExpression)) {
37
+ flattened.push(...flattenAccessExpression(childrenArray(() => child.props.children)));
38
+ } else {
39
+ flattened.push(child);
40
+ }
41
+ }
42
+ return flattened;
43
+ }
44
+ AccessExpression.Part = function (props) {
45
+ /** renders nothing, the parent AccessExpression will use these args */
46
+ };
47
+
48
+ /**
49
+ * Formatting of call chains (i.e. member expressions which have more than one
50
+ * call in them). The general approach is that line breaks occur after each
51
+ * call, and there is only one call per line. When there are non-call elements,
52
+ * they occur prior to the call part. The first part of the member expression
53
+ * contains all but the last non-call part.
54
+ *
55
+ * The following is an example of proper formatting:
56
+ *
57
+ * ```ts
58
+ * z.dummy // all but the last non-call part for the first element
59
+ * .object({ // the first call part with line break after
60
+ * a: 1,
61
+ * })
62
+ * .dummy.partial() // the next call part with non-call parts before it
63
+ * ```
64
+ */
65
+ function formatCallChain(parts) {
66
+ return computed(() => {
67
+ const expression = [];
68
+
69
+ // break the expression into parts.
70
+ const chunks = [];
71
+
72
+ // the first part is all the non-call parts
73
+ let partIndex = 0;
74
+ function pushPart() {
75
+ const part = parts[partIndex];
76
+ if (!part) throw new Error("No part to push");
77
+ chunks.at(-1).push(part);
78
+ partIndex++;
79
+ }
80
+ function pushChunk() {
81
+ chunks.push([]);
82
+ }
83
+
84
+ // For the first chunk, take all the non-call parts except the last one
85
+ // and put them in a chunk.
86
+ pushChunk();
87
+ while (partIndex < parts.length && (partIndex === parts.length - 1 || chunks.at(-1).length === 0 || !isArgsPart(parts[partIndex + 1]))) {
88
+ pushPart();
89
+ if (isArgsPart(chunks.at(-1).at(-1))) {
90
+ // the first segment always ends after we see a call
91
+ // if we happen to take one
92
+ break;
93
+ }
94
+ }
95
+
96
+ // then for all remaining parts, collect all the non-call parts and end with
97
+ // a call chunk
98
+ while (partIndex < parts.length) {
99
+ pushChunk();
100
+ while (partIndex < parts.length && !isArgsPart(parts[partIndex])) {
101
+ pushPart();
102
+ }
103
+ while (partIndex < parts.length && isArgsPart(parts[partIndex])) {
104
+ pushPart();
105
+ }
106
+ }
107
+ for (let chunkIndex = 0; chunkIndex < chunks.length; chunkIndex++) {
108
+ const chunk = chunks[chunkIndex];
109
+ const chunkExpression = [];
110
+ for (let partIndex = 0; partIndex < chunk.length; partIndex++) {
111
+ if (chunkIndex === 0 && partIndex === 0) {
112
+ // first part is just gonna be the id
113
+ const firstPart = isIdPart(chunk[0]) ? chunk[0].id : chunk[0].indexerArgs;
114
+ chunkExpression.push(firstPart);
115
+ continue;
116
+ }
117
+ const part = chunk[partIndex];
118
+ const prevPart = partIndex === 0 ? chunks[chunkIndex - 1].at(-1) : chunk[partIndex - 1];
119
+ if (isArgsPart(part)) {
120
+ // For parts with only args (no name), append function call directly with appropriate nullish operator
121
+ chunkExpression.push(formatCallExpr(prevPart, part));
122
+ } else if (isIdPart(part)) {
123
+ chunkExpression.push(formatMemberAccess(prevPart, part, true));
124
+ } else {
125
+ // bracket notation - don't include the dot
126
+ chunkExpression.push(formatElementAccess(prevPart, part));
127
+ }
128
+ }
129
+ expression.push(chunkIndex === 0 ? chunkExpression : [_$createIntrinsic("sbr", {}), chunkExpression]);
130
+ }
131
+ return _$createIntrinsic("group", {
132
+ get children() {
133
+ return _$createIntrinsic("indent", {
134
+ children: expression
135
+ });
136
+ }
137
+ });
138
+ });
139
+ }
140
+ function formatNonCallChain(parts) {
141
+ return computed(() => {
142
+ const expression = [];
143
+ for (let i = 0; i < parts.length; i++) {
144
+ const part = parts[i];
145
+ const base = isIdPart(part) ? part.id : part.indexerArgs;
146
+ if (i === 0) {
147
+ expression.push(base, _$createComponent(TypeArgs, {
148
+ get args() {
149
+ return part.typeArgs;
150
+ }
151
+ }));
152
+ } else {
153
+ // Determine if we should use nullish operator from previous part
154
+ const prevPart = parts[i - 1];
155
+ if (isArgsPart(part)) {
156
+ // For parts with only args (no name), append function call directly with appropriate nullish operator
157
+ expression.push(formatCallExpr(prevPart, part));
158
+ } else if (isIdPart(part)) {
159
+ expression.push(formatMemberAccess(prevPart, part));
160
+ } else {
161
+ // bracket notation - don't include the dot
162
+ expression.push(formatElementAccess(prevPart, part));
163
+ }
164
+ }
165
+ }
166
+ return expression;
167
+ });
168
+ }
169
+ function formatElementAccess(prevPart, part) {
170
+ return _$createIntrinsic("group", {
171
+ get children() {
172
+ return [_$memo(() => part.conditional || "nullable" in prevPart && prevPart.nullable ? "?" : ""), "[", _$createIntrinsic("indent", {
173
+ get children() {
174
+ return [_$createIntrinsic("sbr", {}), _$createComponent(For, {
175
+ get each() {
176
+ return part.indexerArgs;
177
+ },
178
+ comma: true,
179
+ line: true,
180
+ children: arg => arg
181
+ })];
182
+ }
183
+ }), _$createIntrinsic("sbr", {}), "]"];
184
+ }
185
+ });
186
+ }
187
+ function formatMemberAccess(prevPart, part, noIndent = false) {
188
+ let Wrapping;
189
+ if (noIndent) {
190
+ Wrapping = function (props) {
191
+ return _$createIntrinsic("group", {
192
+ get children() {
193
+ return [_$createIntrinsic("sbr", {}), _$memo(() => props.children)];
194
+ }
195
+ });
196
+ };
197
+ } else {
198
+ Wrapping = function (props) {
199
+ return _$createIntrinsic("group", {
200
+ get children() {
201
+ return _$createIntrinsic("indent", {
202
+ get children() {
203
+ return [_$createIntrinsic("sbr", {}), _$memo(() => props.children)];
204
+ }
205
+ });
206
+ }
207
+ });
208
+ };
209
+ }
210
+ return _$createComponent(Wrapping, {
211
+ get children() {
212
+ return [_$memo(() => part.conditional || "nullable" in prevPart && prevPart.nullable ? "?." : "."), _$memo(() => isIdPart(part) ? part.id : part.indexerArgs), _$createComponent(TypeArgs, {
213
+ get args() {
214
+ return part.typeArgs;
215
+ }
216
+ })];
217
+ }
218
+ });
219
+ }
220
+ function TypeArgs(props) {
221
+ return _$createComponent(Show, {
222
+ get when() {
223
+ return props.args && props.args.length > 0;
224
+ },
225
+ get children() {
226
+ return ["<", _$createIntrinsic("group", {
227
+ get children() {
228
+ return [_$createIntrinsic("indent", {
229
+ get children() {
230
+ return [_$createIntrinsic("sbr", {}), _$createComponent(For, {
231
+ get each() {
232
+ return props.args;
233
+ },
234
+ comma: true,
235
+ line: true,
236
+ children: arg => arg
237
+ })];
238
+ }
239
+ }), _$createIntrinsic("sbr", {})];
240
+ }
241
+ }), ">"];
242
+ }
243
+ });
244
+ }
245
+ function formatCallExpr(prevPart, part) {
246
+ return _$createIntrinsic("group", {
247
+ get children() {
248
+ return ["(", _$createComponent(Show, {
249
+ get when() {
250
+ return part.args.length <= 1;
251
+ },
252
+ get children() {
253
+ return part.args[0];
254
+ }
255
+ }), _$createComponent(Show, {
256
+ get when() {
257
+ return part.args.length > 1;
258
+ },
259
+ get children() {
260
+ return [_$createIntrinsic("indent", {
261
+ get children() {
262
+ return [_$createIntrinsic("sbr", {}), _$createComponent(For, {
263
+ get each() {
264
+ return part.args;
265
+ },
266
+ comma: true,
267
+ line: true,
268
+ children: arg => arg
269
+ })];
270
+ }
271
+ }), _$createIntrinsic("sbr", {})];
272
+ }
273
+ }), ")"];
274
+ }
275
+ });
276
+ }
277
+ //# sourceMappingURL=access-expression.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["childrenArray","computed","For","isComponentCreator","Show","takeSymbols","childrenToPartDescriptors","isArgsPart","isIdPart","AccessExpression","props","children","flattenAccessExpression","parts","length","isCallChain","callCount","part","value","formatCallChain","formatNonCallChain","flattened","child","push","Part","expression","chunks","partIndex","pushPart","Error","at","pushChunk","chunkIndex","chunk","chunkExpression","firstPart","id","indexerArgs","prevPart","formatCallExpr","formatMemberAccess","formatElementAccess","_$createIntrinsic","i","base","_$createComponent","TypeArgs","args","typeArgs","_$memo","conditional","nullable","each","comma","line","arg","noIndent","Wrapping","when"],"sources":["../../../../src/components/access-expression/access-expression.tsx"],"sourcesContent":[null],"mappings":";AAAA,SAEEA,aAAa,EAEbC,QAAQ,EACRC,GAAG,EACHC,kBAAkB,EAElBC,IAAI,EACJC,WAAW,QACN,gBAAgB;AAEvB,SACEC,yBAAyB,EACzBC,UAAU,EACVC,QAAQ,QAKH,uBAAuB;AAM9B,OAAO,SAASC,gBAAgBA,CAACC,KAA4B,EAAE;EAC7D,MAAMC,QAAQ,GAAGC,uBAAuB,CAACZ,aAAa,CAAC,MAAMU,KAAK,CAACC,QAAQ,CAAC,CAAC;EAC7E,MAAME,KAAK,GAAGP,yBAAyB,CAACK,QAAQ,CAAC;;EAEjD;EACAN,WAAW,CAAC,CAAC;EAEb,IAAIQ,KAAK,CAACC,MAAM,KAAK,CAAC,EAAE;IACtB;EACF;EAEA,MAAMC,WAAW,GAAGd,QAAQ,CAAC,MAAM;IACjC,IAAIe,SAAS,GAAG,CAAC;IACjB,KAAK,MAAMC,IAAI,IAAIJ,KAAK,EAAE;MACxB,IAAIN,UAAU,CAACU,IAAI,CAAC,EAAED,SAAS,EAAE;IACnC;IAEA,OAAOA,SAAS,GAAG,CAAC;EACtB,CAAC,CAAC;;EAEF;EACA;EACA;;EAEA,OAAOf,QAAQ,CAAC,MAAM;IACpB,OAAOc,WAAW,CAACG,KAAK,GACpBC,eAAe,CAACN,KAAK,CAAC,GACtBO,kBAAkB,CAACP,KAAK,CAAC;EAC/B,CAAC,CAAC;AACJ;;AAEA;AACA;AACA;AACA,SAASD,uBAAuBA,CAACD,QAAoB,EAAc;EACjE,MAAMU,SAAqB,GAAG,EAAE;EAChC,KAAK,MAAMC,KAAK,IAAIX,QAAQ,EAAE;IAC5B,IAAIR,kBAAkB,CAACmB,KAAK,EAAEb,gBAAgB,CAAC,EAAE;MAC/CY,SAAS,CAACE,IAAI,CACZ,GAAGX,uBAAuB,CAACZ,aAAa,CAAC,MAAMsB,KAAK,CAACZ,KAA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AAGV;AAEA,SAASH,cAAcA,CACrBD,QAAwB,EACxBrB,IAA4B,EAC5B;EACA,OAAAyB,iBAAA;IAAA,IAAA/B,SAAA;MAAA,aAAAkC,iBAAA,CAEMzC,IAAI;QAAA,IAACsD,IAAIA,CAAA;UAAA,OAAEzC,IAAI,CAAC8B,IAAI,CAACjC,MAAM,IAAI,CAAC;QAAA;QAAA,IAAAH,SAAA;UAAA,OAAGM,IAAI,CAAC8B,IAAI,CAAC,CAAC,CAAC;QAAA;MAAA,IAAAF,iBAAA,CAChDzC,IAAI;QAAA,IAACsD,IAAIA,CAAA;UAAA,OAAEzC,IAAI,CAAC8B,IAAI,CAACjC,MAAM,GAAG,CAAC;QAAA;QAAA,IAAAH,SAAA;UAAA,QAAA+B,iBAAA;YAAA,IAAA/B,SAAA;cAAA,QAAA+B,iBAAA,aAAAG,iBAAA,CAG3B3C,GAAG;gBAAA,IAACkD,IAAIA,CAAA;kBAAA,OAAEnC,IAAI,CAAC8B,IAAI;gBAAA;gBAAEM,KAAK;gBAACC,IAAI;gBAAA3C,QAAA,EAC5B4C,GAAG,IAAKA;cAAG;YAAA;UAAA,IAAAb,iBAAA;QAAA;MAAA;IAAA;EAAA;AAQzB","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=access-expression.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"access-expression.test.d.ts","sourceRoot":"","sources":["../../../../src/components/access-expression/access-expression.test.tsx"],"names":[],"mappings":""}