funkscript 0.2.4 → 0.2.6

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 (359) hide show
  1. package/README.md +23 -5
  2. package/dist/ast/types.d.ts.map +1 -1
  3. package/dist/ast/types.js.map +1 -1
  4. package/dist/ast/walk.d.ts.map +1 -1
  5. package/dist/ast/walk.js.map +1 -1
  6. package/dist/cli/build-bun.d.ts.map +1 -1
  7. package/dist/cli/build-bun.js.map +1 -1
  8. package/dist/cli/build-watch.d.ts.map +1 -1
  9. package/dist/cli/build-watch.js +5 -3
  10. package/dist/cli/build-watch.js.map +1 -1
  11. package/dist/cli/build.d.ts +1 -1
  12. package/dist/cli/build.d.ts.map +1 -1
  13. package/dist/cli/build.js.map +1 -1
  14. package/dist/cli/check.d.ts.map +1 -1
  15. package/dist/cli/check.js.map +1 -1
  16. package/dist/cli/commands.d.ts.map +1 -1
  17. package/dist/cli/commands.js.map +1 -1
  18. package/dist/cli/doc.d.ts.map +1 -1
  19. package/dist/cli/doc.js.map +1 -1
  20. package/dist/cli/doctor.d.ts.map +1 -1
  21. package/dist/cli/doctor.js +4 -2
  22. package/dist/cli/doctor.js.map +1 -1
  23. package/dist/cli/emit.d.ts +1 -1
  24. package/dist/cli/emit.d.ts.map +1 -1
  25. package/dist/cli/emit.js.map +1 -1
  26. package/dist/cli/explain.d.ts.map +1 -1
  27. package/dist/cli/explain.js.map +1 -1
  28. package/dist/cli/fmt.d.ts.map +1 -1
  29. package/dist/cli/fmt.js.map +1 -1
  30. package/dist/cli/index.d.ts.map +1 -1
  31. package/dist/cli/index.js +0 -0
  32. package/dist/cli/index.js.map +1 -1
  33. package/dist/cli/init.d.ts +1 -1
  34. package/dist/cli/init.d.ts.map +1 -1
  35. package/dist/cli/init.js +66 -21
  36. package/dist/cli/init.js.map +1 -1
  37. package/dist/cli/io.d.ts.map +1 -1
  38. package/dist/cli/io.js.map +1 -1
  39. package/dist/cli/pipeline-style.d.ts.map +1 -1
  40. package/dist/cli/pipeline-style.js.map +1 -1
  41. package/dist/cli/repl.d.ts.map +1 -1
  42. package/dist/cli/repl.js.map +1 -1
  43. package/dist/cli/run.d.ts.map +1 -1
  44. package/dist/cli/run.js.map +1 -1
  45. package/dist/cli/test.d.ts +1 -1
  46. package/dist/cli/test.d.ts.map +1 -1
  47. package/dist/cli/test.js.map +1 -1
  48. package/dist/cli/tsc.d.ts.map +1 -1
  49. package/dist/cli/tsc.js +5 -3
  50. package/dist/cli/tsc.js.map +1 -1
  51. package/dist/cli/typecheck.d.ts.map +1 -1
  52. package/dist/cli/typecheck.js.map +1 -1
  53. package/dist/compiler/ast-inspection.d.ts.map +1 -1
  54. package/dist/compiler/ast-inspection.js.map +1 -1
  55. package/dist/compiler/boolean-operators.d.ts.map +1 -1
  56. package/dist/compiler/boolean-operators.js +12 -2
  57. package/dist/compiler/boolean-operators.js.map +1 -1
  58. package/dist/compiler/check.d.ts.map +1 -1
  59. package/dist/compiler/check.js +95 -103
  60. package/dist/compiler/check.js.map +1 -1
  61. package/dist/compiler/diagnostics.d.ts.map +1 -1
  62. package/dist/compiler/diagnostics.js.map +1 -1
  63. package/dist/compiler/effect-mutation-rule.d.ts.map +1 -1
  64. package/dist/compiler/effect-mutation-rule.js.map +1 -1
  65. package/dist/compiler/entry-rules.d.ts.map +1 -1
  66. package/dist/compiler/entry-rules.js.map +1 -1
  67. package/dist/compiler/incremental-build.d.ts.map +1 -1
  68. package/dist/compiler/incremental-build.js.map +1 -1
  69. package/dist/compiler/incremental-dependencies.d.ts.map +1 -1
  70. package/dist/compiler/incremental-dependencies.js.map +1 -1
  71. package/dist/compiler/js-interop-nullability.d.ts.map +1 -1
  72. package/dist/compiler/js-interop-nullability.js.map +1 -1
  73. package/dist/compiler/modules/output-collisions.d.ts.map +1 -1
  74. package/dist/compiler/modules/output-collisions.js.map +1 -1
  75. package/dist/compiler/modules/output-plan.d.ts.map +1 -1
  76. package/dist/compiler/modules/output-plan.js.map +1 -1
  77. package/dist/compiler/modules/resolution.d.ts.map +1 -1
  78. package/dist/compiler/modules/resolution.js +2 -1
  79. package/dist/compiler/modules/resolution.js.map +1 -1
  80. package/dist/compiler/modules/source-files.d.ts +3 -0
  81. package/dist/compiler/modules/source-files.d.ts.map +1 -0
  82. package/dist/compiler/modules/source-files.js +5 -0
  83. package/dist/compiler/modules/source-files.js.map +1 -0
  84. package/dist/compiler/numeric-comparisons.d.ts.map +1 -1
  85. package/dist/compiler/numeric-comparisons.js.map +1 -1
  86. package/dist/compiler/optional-arguments.d.ts.map +1 -1
  87. package/dist/compiler/optional-arguments.js.map +1 -1
  88. package/dist/compiler/package-fingerprint.d.ts.map +1 -1
  89. package/dist/compiler/package-fingerprint.js.map +1 -1
  90. package/dist/compiler/package-record-contracts.d.ts.map +1 -1
  91. package/dist/compiler/package-record-contracts.js.map +1 -1
  92. package/dist/compiler/pipelines/catalog.d.ts.map +1 -1
  93. package/dist/compiler/pipelines/catalog.js.map +1 -1
  94. package/dist/compiler/pipelines/companions.d.ts.map +1 -1
  95. package/dist/compiler/pipelines/companions.js.map +1 -1
  96. package/dist/compiler/pipelines/resolution.d.ts.map +1 -1
  97. package/dist/compiler/pipelines/resolution.js.map +1 -1
  98. package/dist/compiler/project-config.d.ts.map +1 -1
  99. package/dist/compiler/project-config.js +29 -19
  100. package/dist/compiler/project-config.js.map +1 -1
  101. package/dist/compiler/record-contracts.d.ts.map +1 -1
  102. package/dist/compiler/record-contracts.js.map +1 -1
  103. package/dist/compiler/rules/control-flow.d.ts.map +1 -1
  104. package/dist/compiler/rules/control-flow.js.map +1 -1
  105. package/dist/compiler/rules/diagnostic.d.ts.map +1 -1
  106. package/dist/compiler/rules/diagnostic.js.map +1 -1
  107. package/dist/compiler/rules/module-scope-refs.d.ts.map +1 -1
  108. package/dist/compiler/rules/module-scope-refs.js.map +1 -1
  109. package/dist/compiler/rules/resource-escape.d.ts +7 -0
  110. package/dist/compiler/rules/resource-escape.d.ts.map +1 -0
  111. package/dist/compiler/rules/resource-escape.js +146 -0
  112. package/dist/compiler/rules/resource-escape.js.map +1 -0
  113. package/dist/compiler/rules/resource-providers.d.ts +19 -0
  114. package/dist/compiler/rules/resource-providers.d.ts.map +1 -0
  115. package/dist/compiler/rules/resource-providers.js +222 -0
  116. package/dist/compiler/rules/resource-providers.js.map +1 -0
  117. package/dist/compiler/schemas/analysis.d.ts.map +1 -1
  118. package/dist/compiler/schemas/analysis.js.map +1 -1
  119. package/dist/compiler/schemas/imported-record-functions.d.ts.map +1 -1
  120. package/dist/compiler/schemas/imported-record-functions.js.map +1 -1
  121. package/dist/compiler/schemas/imported-schemas.d.ts.map +1 -1
  122. package/dist/compiler/schemas/imported-schemas.js.map +1 -1
  123. package/dist/compiler/source-map.d.ts.map +1 -1
  124. package/dist/compiler/source-map.js.map +1 -1
  125. package/dist/compiler/type-view-paths.d.ts +4 -0
  126. package/dist/compiler/type-view-paths.d.ts.map +1 -0
  127. package/dist/compiler/type-view-paths.js +4 -0
  128. package/dist/compiler/type-view-paths.js.map +1 -0
  129. package/dist/compiler/typescript-context.d.ts.map +1 -1
  130. package/dist/compiler/typescript-context.js.map +1 -1
  131. package/dist/compiler.d.ts.map +1 -1
  132. package/dist/compiler.js.map +1 -1
  133. package/dist/emitter/assemblyscript.d.ts.map +1 -1
  134. package/dist/emitter/assemblyscript.js.map +1 -1
  135. package/dist/emitter/declarations.d.ts.map +1 -1
  136. package/dist/emitter/declarations.js.map +1 -1
  137. package/dist/emitter/emitter.d.ts +3 -1
  138. package/dist/emitter/emitter.d.ts.map +1 -1
  139. package/dist/emitter/emitter.js +10 -1
  140. package/dist/emitter/emitter.js.map +1 -1
  141. package/dist/emitter/imports.d.ts.map +1 -1
  142. package/dist/emitter/imports.js.map +1 -1
  143. package/dist/emitter/indent.d.ts.map +1 -1
  144. package/dist/emitter/indent.js.map +1 -1
  145. package/dist/emitter/jsx.d.ts.map +1 -1
  146. package/dist/emitter/jsx.js.map +1 -1
  147. package/dist/emitter/local-bindings.d.ts.map +1 -1
  148. package/dist/emitter/local-bindings.js.map +1 -1
  149. package/dist/emitter/match.d.ts.map +1 -1
  150. package/dist/emitter/match.js.map +1 -1
  151. package/dist/emitter/runtime-helpers.d.ts.map +1 -1
  152. package/dist/emitter/runtime-helpers.js.map +1 -1
  153. package/dist/emitter/schemas.d.ts.map +1 -1
  154. package/dist/emitter/schemas.js.map +1 -1
  155. package/dist/emitter/statements.d.ts +1 -0
  156. package/dist/emitter/statements.d.ts.map +1 -1
  157. package/dist/emitter/statements.js +1 -0
  158. package/dist/emitter/statements.js.map +1 -1
  159. package/dist/emitter/tagged-match.d.ts.map +1 -1
  160. package/dist/emitter/tagged-match.js.map +1 -1
  161. package/dist/emitter/types.d.ts.map +1 -1
  162. package/dist/emitter/types.js.map +1 -1
  163. package/dist/errors.d.ts.map +1 -1
  164. package/dist/errors.js.map +1 -1
  165. package/dist/formatter/comments.d.ts.map +1 -1
  166. package/dist/formatter/comments.js +13 -0
  167. package/dist/formatter/comments.js.map +1 -1
  168. package/dist/formatter/index.d.ts.map +1 -1
  169. package/dist/formatter/index.js +57 -3
  170. package/dist/formatter/index.js.map +1 -1
  171. package/dist/formatter/operator-precedence.d.ts.map +1 -1
  172. package/dist/formatter/operator-precedence.js.map +1 -1
  173. package/dist/formatter/prettier.d.ts.map +1 -1
  174. package/dist/formatter/prettier.js.map +1 -1
  175. package/dist/index.d.ts.map +1 -1
  176. package/dist/index.js.map +1 -1
  177. package/dist/interop/callback.d.ts.map +1 -1
  178. package/dist/interop/callback.js.map +1 -1
  179. package/dist/interop/js.d.ts.map +1 -1
  180. package/dist/interop/js.js.map +1 -1
  181. package/dist/interop/record.d.ts.map +1 -1
  182. package/dist/interop/record.js.map +1 -1
  183. package/dist/interop/valibot.d.ts.map +1 -1
  184. package/dist/interop/valibot.js.map +1 -1
  185. package/dist/interop/zod.d.ts.map +1 -1
  186. package/dist/interop/zod.js.map +1 -1
  187. package/dist/lexer/lexer.d.ts +1 -0
  188. package/dist/lexer/lexer.d.ts.map +1 -1
  189. package/dist/lexer/lexer.js +26 -10
  190. package/dist/lexer/lexer.js.map +1 -1
  191. package/dist/lexer/tokens.d.ts.map +1 -1
  192. package/dist/lexer/tokens.js.map +1 -1
  193. package/dist/lsp/code-action-worker.d.ts.map +1 -1
  194. package/dist/lsp/code-action-worker.js.map +1 -1
  195. package/dist/lsp/completion.d.ts.map +1 -1
  196. package/dist/lsp/completion.js.map +1 -1
  197. package/dist/lsp/definition.d.ts.map +1 -1
  198. package/dist/lsp/definition.js.map +1 -1
  199. package/dist/lsp/diagnostics-worker.d.ts.map +1 -1
  200. package/dist/lsp/diagnostics-worker.js +1 -1
  201. package/dist/lsp/diagnostics-worker.js.map +1 -1
  202. package/dist/lsp/docs.d.ts +1 -1
  203. package/dist/lsp/docs.d.ts.map +1 -1
  204. package/dist/lsp/docs.js +4 -3
  205. package/dist/lsp/docs.js.map +1 -1
  206. package/dist/lsp/error-channel.d.ts.map +1 -1
  207. package/dist/lsp/error-channel.js.map +1 -1
  208. package/dist/lsp/hover.d.ts.map +1 -1
  209. package/dist/lsp/hover.js +16 -5
  210. package/dist/lsp/hover.js.map +1 -1
  211. package/dist/lsp/imports.d.ts.map +1 -1
  212. package/dist/lsp/imports.js +10 -1
  213. package/dist/lsp/imports.js.map +1 -1
  214. package/dist/lsp/index.d.ts.map +1 -1
  215. package/dist/lsp/index.js.map +1 -1
  216. package/dist/lsp/inlay-hints.d.ts.map +1 -1
  217. package/dist/lsp/inlay-hints.js.map +1 -1
  218. package/dist/lsp/interop-rename.d.ts.map +1 -1
  219. package/dist/lsp/interop-rename.js.map +1 -1
  220. package/dist/lsp/match-arms.d.ts.map +1 -1
  221. package/dist/lsp/match-arms.js.map +1 -1
  222. package/dist/lsp/navigation.d.ts.map +1 -1
  223. package/dist/lsp/navigation.js.map +1 -1
  224. package/dist/lsp/parsed-documents.d.ts.map +1 -1
  225. package/dist/lsp/parsed-documents.js.map +1 -1
  226. package/dist/lsp/rename-worker.d.ts.map +1 -1
  227. package/dist/lsp/rename-worker.js.map +1 -1
  228. package/dist/lsp/server.d.ts +2 -1
  229. package/dist/lsp/server.d.ts.map +1 -1
  230. package/dist/lsp/server.js +20 -0
  231. package/dist/lsp/server.js.map +1 -1
  232. package/dist/lsp/signature-help.d.ts +6 -0
  233. package/dist/lsp/signature-help.d.ts.map +1 -0
  234. package/dist/lsp/signature-help.js +183 -0
  235. package/dist/lsp/signature-help.js.map +1 -0
  236. package/dist/lsp/thunk-pipeline.d.ts.map +1 -1
  237. package/dist/lsp/thunk-pipeline.js.map +1 -1
  238. package/dist/lsp/validation.d.ts.map +1 -1
  239. package/dist/lsp/validation.js +3 -2
  240. package/dist/lsp/validation.js.map +1 -1
  241. package/dist/lsp/workspace.d.ts.map +1 -1
  242. package/dist/lsp/workspace.js.map +1 -1
  243. package/dist/parser/declarations.d.ts.map +1 -1
  244. package/dist/parser/declarations.js +22 -1
  245. package/dist/parser/declarations.js.map +1 -1
  246. package/dist/parser/errors.d.ts.map +1 -1
  247. package/dist/parser/errors.js.map +1 -1
  248. package/dist/parser/jsx.d.ts.map +1 -1
  249. package/dist/parser/jsx.js.map +1 -1
  250. package/dist/parser/operator-expressions.d.ts.map +1 -1
  251. package/dist/parser/operator-expressions.js.map +1 -1
  252. package/dist/parser/parser.d.ts.map +1 -1
  253. package/dist/parser/parser.js.map +1 -1
  254. package/dist/parser/patterns.d.ts.map +1 -1
  255. package/dist/parser/patterns.js.map +1 -1
  256. package/dist/parser/pipeline-expressions.d.ts.map +1 -1
  257. package/dist/parser/pipeline-expressions.js.map +1 -1
  258. package/dist/parser/scope.d.ts.map +1 -1
  259. package/dist/parser/scope.js.map +1 -1
  260. package/dist/parser/statements.d.ts.map +1 -1
  261. package/dist/parser/statements.js.map +1 -1
  262. package/dist/parser/types.d.ts.map +1 -1
  263. package/dist/parser/types.js.map +1 -1
  264. package/dist/plugins/bun-preload.d.ts.map +1 -1
  265. package/dist/plugins/bun-preload.js.map +1 -1
  266. package/dist/plugins/bun.d.ts.map +1 -1
  267. package/dist/plugins/bun.js.map +1 -1
  268. package/dist/plugins/esbuild.d.ts.map +1 -1
  269. package/dist/plugins/esbuild.js.map +1 -1
  270. package/dist/plugins/type-view.d.ts.map +1 -1
  271. package/dist/plugins/type-view.js +5 -3
  272. package/dist/plugins/type-view.js.map +1 -1
  273. package/dist/plugins/vite.d.ts.map +1 -1
  274. package/dist/plugins/vite.js.map +1 -1
  275. package/dist/testing/index.d.ts.map +1 -1
  276. package/dist/testing/index.js.map +1 -1
  277. package/dist/tooling/doc.d.ts.map +1 -1
  278. package/dist/tooling/doc.js.map +1 -1
  279. package/dist/tooling/idiomatic.d.ts.map +1 -1
  280. package/dist/tooling/idiomatic.js.map +1 -1
  281. package/dist/tooling/pipeline-style.d.ts.map +1 -1
  282. package/dist/tooling/pipeline-style.js.map +1 -1
  283. package/dist/version.d.ts.map +1 -1
  284. package/dist/version.js.map +1 -1
  285. package/package.json +13 -6
  286. package/src/cli/build-watch.ts +6 -3
  287. package/src/cli/doctor.ts +8 -2
  288. package/src/cli/init.ts +66 -21
  289. package/src/cli/tsc.ts +8 -3
  290. package/src/compiler/boolean-operators.ts +11 -2
  291. package/src/compiler/check.ts +124 -132
  292. package/src/compiler/modules/resolution.ts +2 -1
  293. package/src/compiler/modules/source-files.ts +4 -0
  294. package/src/compiler/project-config.ts +30 -19
  295. package/src/compiler/rules/resource-escape.ts +223 -0
  296. package/src/compiler/rules/resource-providers.ts +293 -0
  297. package/src/compiler/type-view-paths.ts +3 -0
  298. package/src/emitter/emitter.ts +13 -1
  299. package/src/emitter/statements.ts +2 -0
  300. package/src/formatter/comments.ts +14 -0
  301. package/src/formatter/index.ts +70 -2
  302. package/src/lexer/lexer.ts +39 -20
  303. package/src/lsp/diagnostics-worker.ts +1 -4
  304. package/src/lsp/docs.ts +4 -3
  305. package/src/lsp/hover.ts +23 -4
  306. package/src/lsp/imports.ts +20 -1
  307. package/src/lsp/server.ts +30 -0
  308. package/src/lsp/signature-help.ts +226 -0
  309. package/src/lsp/validation.ts +3 -2
  310. package/src/parser/declarations.ts +27 -1
  311. package/src/plugins/type-view.ts +11 -3
  312. package/dist/Widget.tsx +0 -9
  313. package/dist/cli/output-collisions.d.ts +0 -2
  314. package/dist/cli/output-collisions.d.ts.map +0 -1
  315. package/dist/cli/output-collisions.js +0 -39
  316. package/dist/cli/output-collisions.js.map +0 -1
  317. package/dist/compiler/imported-record-functions.d.ts +0 -4
  318. package/dist/compiler/imported-record-functions.d.ts.map +0 -1
  319. package/dist/compiler/imported-record-functions.js +0 -706
  320. package/dist/compiler/imported-record-functions.js.map +0 -1
  321. package/dist/compiler/imported-schemas.d.ts +0 -21
  322. package/dist/compiler/imported-schemas.d.ts.map +0 -1
  323. package/dist/compiler/imported-schemas.js +0 -461
  324. package/dist/compiler/imported-schemas.js.map +0 -1
  325. package/dist/compiler/module-resolution.d.ts +0 -6
  326. package/dist/compiler/module-resolution.d.ts.map +0 -1
  327. package/dist/compiler/module-resolution.js +0 -44
  328. package/dist/compiler/module-resolution.js.map +0 -1
  329. package/dist/compiler/pipeline-companions.d.ts +0 -18
  330. package/dist/compiler/pipeline-companions.d.ts.map +0 -1
  331. package/dist/compiler/pipeline-companions.js +0 -1042
  332. package/dist/compiler/pipeline-companions.js.map +0 -1
  333. package/dist/compiler/providers.d.ts +0 -4
  334. package/dist/compiler/providers.d.ts.map +0 -1
  335. package/dist/compiler/providers.js +0 -101
  336. package/dist/compiler/providers.js.map +0 -1
  337. package/dist/emitter/pipeline-catalog.d.ts +0 -15
  338. package/dist/emitter/pipeline-catalog.d.ts.map +0 -1
  339. package/dist/emitter/pipeline-catalog.js +0 -55
  340. package/dist/emitter/pipeline-catalog.js.map +0 -1
  341. package/dist/emitter/pipeline-resolution.d.ts +0 -38
  342. package/dist/emitter/pipeline-resolution.d.ts.map +0 -1
  343. package/dist/emitter/pipeline-resolution.js +0 -571
  344. package/dist/emitter/pipeline-resolution.js.map +0 -1
  345. package/dist/interop/index.d.ts +0 -6
  346. package/dist/interop/index.d.ts.map +0 -1
  347. package/dist/interop/index.js +0 -6
  348. package/dist/interop/index.js.map +0 -1
  349. package/dist/math.ts +0 -1
  350. package/dist/parser/index.d.ts +0 -9
  351. package/dist/parser/index.d.ts.map +0 -1
  352. package/dist/parser/index.js +0 -9
  353. package/dist/parser/index.js.map +0 -1
  354. package/dist/service.ts +0 -3
  355. package/dist/service.ts.map +0 -1
  356. package/dist/tooling/migrate.d.ts +0 -62
  357. package/dist/tooling/migrate.d.ts.map +0 -1
  358. package/dist/tooling/migrate.js +0 -608
  359. package/dist/tooling/migrate.js.map +0 -1
package/src/lsp/hover.ts CHANGED
@@ -28,7 +28,12 @@ function isExpectedHoverError(error: unknown): boolean {
28
28
  return error instanceof FunScriptError || error instanceof URIError;
29
29
  }
30
30
 
31
- function symbolHover(source: string, uri: string, token: Token): Hover | null {
31
+ function symbolHover(
32
+ source: string,
33
+ uri: string,
34
+ token: Token,
35
+ companion?: string,
36
+ ): Hover | null {
32
37
  if (
33
38
  token.type !== TokenType.IDENTIFIER &&
34
39
  token.type !== TokenType.UPPER_IDENTIFIER
@@ -40,7 +45,7 @@ function symbolHover(source: string, uri: string, token: Token): Hover | null {
40
45
  const result = Effect.runSync(
41
46
  compileString(source, filename, { context, sourcemap: false }),
42
47
  );
43
- return symbolHoverFromResult(source, token, context, result);
48
+ return symbolHoverFromResult(source, token, context, result, companion);
44
49
  } catch (error) {
45
50
  if (!isExpectedHoverError(error)) throw error;
46
51
  return null;
@@ -52,6 +57,7 @@ function symbolHoverFromResult(
52
57
  token: Token,
53
58
  context: TypeScriptCompilationContext,
54
59
  result: CompileResult,
60
+ companion?: string,
55
61
  ): Hover | null {
56
62
  try {
57
63
  const schema = result.ast.body.flatMap((entry) => {
@@ -110,7 +116,15 @@ function symbolHoverFromResult(
110
116
  character: number;
111
117
  }> = [];
112
118
  const visit = (node: ts.Node): void => {
113
- if (ts.isIdentifier(node) && node.text === token.value) {
119
+ if (
120
+ ts.isIdentifier(node) &&
121
+ node.text === token.value &&
122
+ (!companion ||
123
+ (ts.isPropertyAccessExpression(node.parent) &&
124
+ node.parent.name === node &&
125
+ ts.isIdentifier(node.parent.expression) &&
126
+ node.parent.expression.text === companion))
127
+ ) {
114
128
  const symbol = checked.checker.getSymbolAtLocation(node);
115
129
  if (symbol) {
116
130
  found.set(symbol, node);
@@ -465,10 +479,15 @@ function findHoverInTokens(
465
479
  new TypeScriptCompilationContext(filename),
466
480
  ).stageResolutions.get(token.span.start.offset);
467
481
  if (resolution) {
482
+ const resolved = `${resolution.module}.${resolution.method}`;
483
+ const typedHover = skipSymbol
484
+ ? null
485
+ : symbolHover(source, uri, token, resolution.module);
486
+ const typedDetails = typedHover?.contents;
468
487
  return {
469
488
  contents: {
470
489
  kind: MarkupKind.Markdown,
471
- value: `Resolves to \`${resolution.module}.${resolution.method}\`.`,
490
+ value: `Resolves to \`${resolved}\`.${typeof typedDetails === "object" && "value" in typedDetails ? `\n\n${typedDetails.value}` : ""}`,
472
491
  },
473
492
  range: spanToRange(token.span),
474
493
  };
@@ -14,6 +14,19 @@ import { COMPANION_IMPORT_SOURCE } from "../compiler/pipelines/catalog.js";
14
14
  import { Lexer } from "../lexer/lexer.js";
15
15
  import { TokenType, type Token } from "../lexer/tokens.js";
16
16
  import { Parser } from "../parser/parser.js";
17
+ import { extractComments } from "../formatter/comments.js";
18
+
19
+ function hasImportComments(source: string, decl: ImportDeclaration): boolean {
20
+ const lineEnd = source.indexOf("\n", decl.span.end.offset);
21
+ return (
22
+ extractComments(
23
+ source.slice(
24
+ decl.span.start.offset,
25
+ lineEnd < 0 ? source.length : lineEnd,
26
+ ),
27
+ ).length > 0
28
+ );
29
+ }
17
30
 
18
31
  export const EFFECT_MODULE_EXPORTS = new Set([
19
32
  "Array",
@@ -167,6 +180,7 @@ export function findAutoImportCodeActions(
167
180
  if (
168
181
  targetSource === "effect" &&
169
182
  existingEffectImport &&
183
+ !hasImportComments(source, existingEffectImport) &&
170
184
  existingEffectImport.specifiers.length > 0
171
185
  ) {
172
186
  // Add to existing import { ... } from "effect"
@@ -295,7 +309,12 @@ export function findRemoveUnusedImportsCodeActions(
295
309
  const organizeEdits: TextEdit[] = [];
296
310
 
297
311
  for (const decl of importDecls) {
298
- if (decl.isSideEffect || decl.defaultBinding || decl.namespaceBinding) {
312
+ if (
313
+ decl.isSideEffect ||
314
+ decl.defaultBinding ||
315
+ decl.namespaceBinding ||
316
+ hasImportComments(source, decl)
317
+ ) {
299
318
  continue;
300
319
  }
301
320
 
package/src/lsp/server.ts CHANGED
@@ -53,6 +53,8 @@ import {
53
53
  type PublishDiagnosticsParams,
54
54
  type ReferenceParams,
55
55
  type RenameParams,
56
+ type SignatureHelp,
57
+ type SignatureHelpParams,
56
58
  type RequestMessage,
57
59
  type ResponseMessage,
58
60
  type SymbolInformation,
@@ -75,6 +77,7 @@ import {
75
77
  findRemoveUnusedImportsCodeActions,
76
78
  } from "./imports.js";
77
79
  import { findInlayHints } from "./inlay-hints.js";
80
+ import { findSignatureHelp } from "./signature-help.js";
78
81
  import { InteropRenameSession, renameInterop } from "./interop-rename.js";
79
82
  import { findFillMatchArmsCodeActions } from "./match-arms.js";
80
83
  import { findThunkPipelineCodeActions } from "./thunk-pipeline.js";
@@ -219,6 +222,7 @@ export class FunScriptLspServer extends EventEmitter {
219
222
  );
220
223
  connection.onDefinition((params) => this.onDefinitionHandler(params));
221
224
  connection.onHover((params) => this.onHoverHandler(params));
225
+ connection.onSignatureHelp((params) => this.onSignatureHelpHandler(params));
222
226
  connection.onCompletion((params) => this.onCompletionHandler(params));
223
227
  connection.onDocumentSymbol((params) =>
224
228
  this.onDocumentSymbolHandler(params),
@@ -273,6 +277,10 @@ export class FunScriptLspServer extends EventEmitter {
273
277
  referencesProvider: true,
274
278
  renameProvider: { prepareProvider: true },
275
279
  hoverProvider: true,
280
+ signatureHelpProvider: {
281
+ triggerCharacters: ["(", ","],
282
+ retriggerCharacters: [","],
283
+ },
276
284
  completionProvider: {
277
285
  resolveProvider: false,
278
286
  triggerCharacters: [".", "<", ">"],
@@ -700,6 +708,20 @@ export class FunScriptLspServer extends EventEmitter {
700
708
  return findInlayHints(doc.text, uri, params?.range);
701
709
  }
702
710
 
711
+ public onSignatureHelpHandler(
712
+ params: SignatureHelpParams,
713
+ ): SignatureHelp | null {
714
+ const uri = params?.textDocument?.uri;
715
+ const doc = uri ? this.documents.get(uri) : undefined;
716
+ if (!doc || !params?.position) return null;
717
+ return findSignatureHelp(
718
+ doc.text,
719
+ uri,
720
+ params.position,
721
+ this.getDocuments(),
722
+ );
723
+ }
724
+
703
725
  public onCompletionHandler(params: CompletionParams): CompletionItem[] {
704
726
  const uri = params?.textDocument?.uri;
705
727
  const doc = uri ? this.documents.get(uri) : undefined;
@@ -1087,6 +1109,14 @@ export class FunScriptLspServer extends EventEmitter {
1087
1109
  };
1088
1110
  }
1089
1111
 
1112
+ if (req.method === "textDocument/signatureHelp") {
1113
+ return {
1114
+ jsonrpc: "2.0",
1115
+ id: req.id,
1116
+ result: this.onSignatureHelpHandler(req.params as SignatureHelpParams),
1117
+ };
1118
+ }
1119
+
1090
1120
  if (req.method === "textDocument/inlayHint") {
1091
1121
  const result = this.onInlayHintHandler(req.params as InlayHintParams);
1092
1122
  return {
@@ -0,0 +1,226 @@
1
+ import * as Effect from "effect/Effect";
2
+ import { fileURLToPath } from "node:url";
3
+ import { existsSync, readFileSync } from "node:fs";
4
+ import { resolve } from "node:path";
5
+ import ts from "typescript";
6
+ import {
7
+ MarkupKind,
8
+ type Position,
9
+ type SignatureHelp,
10
+ } from "vscode-languageserver/node";
11
+ import { compileString } from "../compiler.js";
12
+ import { TypeScriptCompilationContext } from "../compiler/typescript-context.js";
13
+ import { resolveFunModule } from "../compiler/modules/resolution.js";
14
+ import { FunScriptError } from "../errors.js";
15
+ import { Lexer } from "../lexer/lexer.js";
16
+ import { TokenType, type Token } from "../lexer/tokens.js";
17
+
18
+ const marker = "__funkscript_signature_help_argument__";
19
+ const opening = new Set([
20
+ TokenType.LPAREN,
21
+ TokenType.LBRACKET,
22
+ TokenType.LBRACE,
23
+ ]);
24
+ const closing = new Map([
25
+ [TokenType.RPAREN, TokenType.LPAREN],
26
+ [TokenType.RBRACKET, TokenType.LBRACKET],
27
+ [TokenType.RBRACE, TokenType.LBRACE],
28
+ ]);
29
+
30
+ function cursorOffset(source: string, position: Position): number | undefined {
31
+ if (position.line < 0 || position.character < 0) return undefined;
32
+ const lines = source.split("\n");
33
+ if (
34
+ position.line >= lines.length ||
35
+ position.character > lines[position.line].length
36
+ )
37
+ return undefined;
38
+ return (
39
+ lines.slice(0, position.line).reduce((n, line) => n + line.length + 1, 0) +
40
+ position.character
41
+ );
42
+ }
43
+
44
+ function activeArgument(
45
+ tokens: Token[],
46
+ offset: number,
47
+ ): { start: number; end: number; index: number; closed: boolean } | undefined {
48
+ const stack: number[] = [];
49
+ for (
50
+ let i = 0;
51
+ i < tokens.length && tokens[i].span.start.offset < offset;
52
+ i++
53
+ ) {
54
+ const token = tokens[i];
55
+ if (opening.has(token.type)) stack.push(i);
56
+ else if (
57
+ closing.has(token.type) &&
58
+ tokens[stack[stack.length - 1]]?.type === closing.get(token.type)
59
+ )
60
+ stack.pop();
61
+ }
62
+ const openIndex = [...stack]
63
+ .reverse()
64
+ .find((i) => tokens[i].type === TokenType.LPAREN);
65
+ if (openIndex === undefined) return undefined;
66
+ const previous = tokens[openIndex - 1];
67
+ if (
68
+ !previous ||
69
+ ![
70
+ TokenType.IDENTIFIER,
71
+ TokenType.UPPER_IDENTIFIER,
72
+ TokenType.RPAREN,
73
+ TokenType.RBRACKET,
74
+ ].includes(previous.type)
75
+ )
76
+ return undefined;
77
+ let depth = 0;
78
+ let start = tokens[openIndex].span.end.offset;
79
+ let index = 0;
80
+ for (let i = openIndex + 1; i < tokens.length; i++) {
81
+ const token = tokens[i];
82
+ if (
83
+ depth === 0 &&
84
+ (token.type === TokenType.COMMA || token.type === TokenType.RPAREN)
85
+ ) {
86
+ if (token.span.start.offset >= offset)
87
+ return { start, end: token.span.start.offset, index, closed: true };
88
+ if (token.type === TokenType.RPAREN) return undefined;
89
+ start = token.span.end.offset;
90
+ index++;
91
+ } else if (opening.has(token.type)) depth++;
92
+ else if (closing.has(token.type)) depth = Math.max(0, depth - 1);
93
+ }
94
+ return { start, end: offset, index, closed: false };
95
+ }
96
+
97
+ export function findSignatureHelp(
98
+ source: string,
99
+ uri: string,
100
+ position: Position,
101
+ documents: ReadonlyArray<{ uri: string; text: string }> = [],
102
+ ): SignatureHelp | null {
103
+ const offset = cursorOffset(source, position);
104
+ if (offset === undefined || source.includes(marker)) return null;
105
+ try {
106
+ let tokens: Token[];
107
+ try {
108
+ tokens = new Lexer(source, uri).tokenize();
109
+ } catch (error) {
110
+ if (!(error instanceof FunScriptError)) throw error;
111
+ // The cursor is often inside a string that has not been closed yet.
112
+ tokens = new Lexer(
113
+ source.slice(0, offset) + '"' + source.slice(offset),
114
+ uri,
115
+ ).tokenize();
116
+ }
117
+ const active = activeArgument(tokens, offset);
118
+ if (!active) return null;
119
+ const repaired =
120
+ `ts { declare const ${marker}: any; }\n` +
121
+ source.slice(0, active.start) +
122
+ marker +
123
+ (active.closed ? "" : ")") +
124
+ source.slice(active.end);
125
+ const filename = uri.startsWith("file:") ? fileURLToPath(uri) : uri;
126
+ const context = new TypeScriptCompilationContext(filename);
127
+ const result = Effect.runSync(
128
+ compileString(repaired, filename, { context, sourcemap: false }),
129
+ );
130
+ const openFiles = new Map<string, string>();
131
+ for (const document of documents) {
132
+ if (document.uri.startsWith("file:")) {
133
+ openFiles.set(resolve(fileURLToPath(document.uri)), document.text);
134
+ }
135
+ }
136
+ const auxiliary = new Map<string, string>();
137
+ for (const declaration of result.ast.body) {
138
+ if (declaration.kind !== "ImportDeclaration") continue;
139
+ const specifier = declaration.source.parts
140
+ .map((part) => (part.kind === "StringRawPart" ? part.value : ""))
141
+ .join("");
142
+ const target = resolveFunModule(
143
+ filename,
144
+ specifier,
145
+ (file) => openFiles.has(file) || existsSync(file),
146
+ );
147
+ if (!target) continue;
148
+ const virtualFile = target.replace(
149
+ /\.funx?$/,
150
+ target.endsWith(".funx") ? ".tsx" : ".ts",
151
+ );
152
+ // A real TypeScript sibling must never masquerade as an explicit FunkScript import.
153
+ if (existsSync(virtualFile)) return null;
154
+ const importedSource =
155
+ openFiles.get(target) ?? readFileSync(target, "utf8");
156
+ const imported = Effect.runSync(
157
+ compileString(importedSource, target, { sourcemap: false }),
158
+ );
159
+ auxiliary.set(virtualFile, imported.typescript);
160
+ }
161
+ if (auxiliary.size) context.setAuxiliarySources(auxiliary);
162
+ const checked = context.check(result.typescript);
163
+ if (!checked) return null;
164
+ let call: ts.CallExpression | undefined;
165
+ const visit = (node: ts.Node): void => {
166
+ if (
167
+ ts.isIdentifier(node) &&
168
+ node.text === marker &&
169
+ ts.isCallExpression(node.parent) &&
170
+ node.parent.arguments.includes(node)
171
+ )
172
+ call = node.parent;
173
+ else ts.forEachChild(node, visit);
174
+ };
175
+ visit(checked.sourceFile);
176
+ if (!call) return null;
177
+ const signatures = checked.checker
178
+ .getTypeAtLocation(call.expression)
179
+ .getCallSignatures();
180
+ if (!signatures.length) return null;
181
+ const resolved = checked.checker.getResolvedSignature(call);
182
+ const selected = Math.max(
183
+ 0,
184
+ signatures.findIndex(
185
+ (signature) =>
186
+ signature === resolved ||
187
+ (resolved &&
188
+ signature.getDeclaration() === resolved.getDeclaration()),
189
+ ),
190
+ );
191
+ return {
192
+ signatures: signatures.map((signature) => ({
193
+ label: checked.checker.signatureToString(
194
+ signature,
195
+ call,
196
+ ts.TypeFormatFlags.NoTruncation,
197
+ ),
198
+ documentation: {
199
+ kind: MarkupKind.Markdown,
200
+ value: ts.displayPartsToString(
201
+ signature.getDocumentationComment(checked.checker),
202
+ ),
203
+ },
204
+ parameters: signature.getParameters().map((parameter) => ({
205
+ label: parameter.getName(),
206
+ documentation: {
207
+ kind: MarkupKind.Markdown,
208
+ value: ts.displayPartsToString(
209
+ parameter.getDocumentationComment(checked.checker),
210
+ ),
211
+ },
212
+ })),
213
+ })),
214
+ activeSignature: selected,
215
+ activeParameter: active.index,
216
+ };
217
+ } catch (error) {
218
+ if (
219
+ error instanceof FunScriptError ||
220
+ error instanceof URIError ||
221
+ error instanceof TypeError
222
+ )
223
+ return null;
224
+ throw error;
225
+ }
226
+ }
@@ -1,4 +1,4 @@
1
- import { pathToFileURL } from "node:url";
1
+ import { fileURLToPath, pathToFileURL } from "node:url";
2
2
  import {
3
3
  DiagnosticSeverity,
4
4
  type Diagnostic,
@@ -134,7 +134,8 @@ export function validateFunScript(
134
134
  const { diagnostics, ast } = validateSyntax(source, uri);
135
135
  if (!diagnostics.length && ast) {
136
136
  try {
137
- const context = new TypeScriptCompilationContext(uri);
137
+ const filename = uri.startsWith("file:") ? fileURLToPath(uri) : uri;
138
+ const context = new TypeScriptCompilationContext(filename);
138
139
  if (!ast.body.some((decl) => decl.kind === "AsDeclaration"))
139
140
  validateNumericComparisons(ast, source, context);
140
141
  validateBooleanOperators(ast, source, context);
@@ -277,6 +277,16 @@ export function parseImportDeclaration(
277
277
  namespaceBinding = ctx.parseAnyIdentifier();
278
278
  } else {
279
279
  ctx.consume(TokenType.LBRACE, "Expected '{' or '*' in import declaration");
280
+ const skipImportWhitespace = () => {
281
+ while (
282
+ ctx.match(TokenType.NEWLINE) ||
283
+ ctx.match(TokenType.INDENT) ||
284
+ ctx.match(TokenType.DEDENT)
285
+ ) {
286
+ // Consume indentation tokens that only separate import specifiers.
287
+ }
288
+ };
289
+ skipImportWhitespace();
280
290
  if (!ctx.check(TokenType.RBRACE)) {
281
291
  do {
282
292
  let specTypeOnly = false;
@@ -321,7 +331,23 @@ export function parseImportDeclaration(
321
331
  local: localId,
322
332
  span: { start: importedId.span.start, end: localId.span.end },
323
333
  });
324
- } while (ctx.match(TokenType.COMMA) && !ctx.check(TokenType.RBRACE));
334
+ // Keep the newline as a recovery boundary if the next token cannot
335
+ // continue the import; it may start another top-level declaration.
336
+ let lookahead = 0;
337
+ while (
338
+ ctx.peekAhead(lookahead).type === TokenType.NEWLINE ||
339
+ ctx.peekAhead(lookahead).type === TokenType.INDENT ||
340
+ ctx.peekAhead(lookahead).type === TokenType.DEDENT
341
+ )
342
+ lookahead++;
343
+ if (
344
+ ctx.peekAhead(lookahead).type === TokenType.COMMA ||
345
+ ctx.peekAhead(lookahead).type === TokenType.RBRACE
346
+ )
347
+ skipImportWhitespace();
348
+ if (!ctx.match(TokenType.COMMA)) break;
349
+ skipImportWhitespace();
350
+ } while (!ctx.check(TokenType.RBRACE));
325
351
  }
326
352
  ctx.consume(TokenType.RBRACE, "Expected '}' after import specifiers");
327
353
  }
@@ -5,6 +5,11 @@ import * as path from "node:path";
5
5
  import ts from "typescript";
6
6
  import { compileString } from "../compiler.js";
7
7
  import { TypeScriptCompilationContext } from "../compiler/typescript-context.js";
8
+ import {
9
+ DEFAULT_TYPE_VIEW_DIR,
10
+ TYPE_VIEW_MANIFEST,
11
+ } from "../compiler/type-view-paths.js";
12
+ import { isFunSourceFile } from "../compiler/modules/source-files.js";
8
13
 
9
14
  export interface TypeViewOptions {
10
15
  /** Project-relative source directories or files. Defaults to ["app"]. */
@@ -69,11 +74,14 @@ export class TypeView {
69
74
 
70
75
  constructor(root: string, options: TypeViewOptions = {}) {
71
76
  this.root = path.resolve(root);
72
- this.outDir = path.resolve(this.root, options.outDir ?? ".funscript/types");
77
+ this.outDir = path.resolve(
78
+ this.root,
79
+ options.outDir ?? DEFAULT_TYPE_VIEW_DIR,
80
+ );
73
81
  this.inputs = (options.include ?? ["app"]).map((input) =>
74
82
  path.resolve(this.root, input),
75
83
  );
76
- this.manifest = path.join(this.outDir, ".funscript-type-view.json");
84
+ this.manifest = path.join(this.outDir, TYPE_VIEW_MANIFEST);
77
85
  this.context = new TypeScriptCompilationContext(
78
86
  path.join(this.root, "__funscript_type_view__.fun"),
79
87
  );
@@ -116,7 +124,7 @@ export class TypeView {
116
124
  throw error;
117
125
  }
118
126
  if (stat.isSymbolicLink()) return [];
119
- if (stat.isFile()) return /\.funx?$/.test(entry) ? [entry] : [];
127
+ if (stat.isFile()) return isFunSourceFile(entry) ? [entry] : [];
120
128
  if (!stat.isDirectory()) return [];
121
129
  const entries = await fs.readdir(entry, { withFileTypes: true });
122
130
  const nested = entries
package/dist/Widget.tsx DELETED
@@ -1,9 +0,0 @@
1
- import { Schema } from "effect";
2
-
3
- const Props = Schema.Struct({
4
- name: Schema.String
5
- });
6
- type Props = typeof Props.Type;
7
- const PropsFromUnknown = (input: unknown): Props => Schema.decodeUnknownSync(Props)(input);
8
-
9
- export const Widget = (props: Props) => <div className="widget"><h3>{props.name}</h3></div>;
@@ -1,2 +0,0 @@
1
- export declare function sourceOutputCollision(sources: ReadonlyMap<string, string>): string | undefined;
2
- //# sourceMappingURL=output-collisions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"output-collisions.d.ts","sources":["../../src/cli/output-collisions.ts"],"names":[],"mappings":"AAMA,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GACnC,MAAM,GAAG,SAAS,CAuCpB"}
@@ -1,39 +0,0 @@
1
- import { existsSync } from "node:fs";
2
- import * as path from "node:path";
3
- import { FunScriptError } from "../errors.js";
4
- import { Lexer } from "../lexer/lexer.js";
5
- import { Parser } from "../parser/parser.js";
6
- export function sourceOutputCollision(sources) {
7
- const stems = new Map([...sources.keys()].map((file) => [
8
- path.resolve(file).replace(/\.funx?$/, ""),
9
- path.resolve(file),
10
- ]));
11
- for (const [file, source] of sources) {
12
- let declarations;
13
- try {
14
- declarations = new Parser(new Lexer(source, file).tokenize(), file, source).parse().body;
15
- }
16
- catch (error) {
17
- if (!(error instanceof FunScriptError))
18
- throw error;
19
- continue;
20
- }
21
- for (const declaration of declarations) {
22
- if (declaration.kind !== "ImportDeclaration" &&
23
- declaration.kind !== "ExportFromDeclaration")
24
- continue;
25
- if (declaration.source.parts.length !== 1 ||
26
- declaration.source.parts[0].kind !== "StringRawPart")
27
- continue;
28
- const specifier = declaration.source.parts[0].value;
29
- if (!/^\.{1,2}\//.test(specifier) || !/\.tsx?$/.test(specifier))
30
- continue;
31
- const target = path.resolve(path.dirname(file), specifier);
32
- const conflict = stems.get(target.replace(/\.tsx?$/, ""));
33
- if (conflict && existsSync(target))
34
- return `Build output collision: '${conflict}' and '${target}' both compile to the same JavaScript module. Rename one of the files.`;
35
- }
36
- }
37
- return undefined;
38
- }
39
- //# sourceMappingURL=output-collisions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"output-collisions.js","sources":["../../src/cli/output-collisions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,MAAM,UAAU,qBAAqB,CACnC,OAAoC;IAEpC,MAAM,KAAK,GAAG,IAAI,GAAG,CACnB,CAAC,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;QAChC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC;QAC1C,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;KACnB,CAAC,CACH,CAAC;IACF,KAAK,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC;QACrC,IAAI,YAAY,CAAC;QACjB,IAAI,CAAC;YACH,YAAY,GAAG,IAAI,MAAM,CACvB,IAAI,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,QAAQ,EAAE,EAClC,IAAI,EACJ,MAAM,CACP,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC;QACjB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,CAAC,KAAK,YAAY,cAAc,CAAC;gBAAE,MAAM,KAAK,CAAC;YACpD,SAAS;QACX,CAAC;QACD,KAAK,MAAM,WAAW,IAAI,YAAY,EAAE,CAAC;YACvC,IACE,WAAW,CAAC,IAAI,KAAK,mBAAmB;gBACxC,WAAW,CAAC,IAAI,KAAK,uBAAuB;gBAE5C,SAAS;YACX,IACE,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC;gBACrC,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,eAAe;gBAEpD,SAAS;YACX,MAAM,SAAS,GAAG,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;YACpD,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC;gBAAE,SAAS;YAC1E,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC,CAAC;YAC3D,MAAM,QAAQ,GAAG,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC;YAC1D,IAAI,QAAQ,IAAI,UAAU,CAAC,MAAM,CAAC;gBAChC,OAAO,4BAA4B,QAAQ,UAAU,MAAM,wEAAwE,CAAC;QACxI,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -1,4 +0,0 @@
1
- import type { Program, RecordTypeNode, TypeNode } from "../ast/types.js";
2
- /** Resolve only unambiguous FunScript functions; unknown targets remain restricted. */
3
- export declare function resolveImportedRecordFunctions(ast: Program, filename: string, virtualSources?: ReadonlyMap<string, string>, importedContracts?: Map<string, RecordTypeNode>, importedIdentitySchemas?: Set<string>, importedGenericDataSchemas?: Map<string, number>, importedDataSchemas?: Set<string>, importedNullishSchemas?: Map<string, Map<string, TypeNode>>, importedTaggedUnionVariants?: Map<string, Set<string>>): Map<string, ReadonlySet<number>>;
4
- //# sourceMappingURL=imported-record-functions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"imported-record-functions.d.ts","sources":["../../src/compiler/imported-record-functions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAKV,OAAO,EACP,cAAc,EACd,QAAQ,EAET,MAAM,iBAAiB,CAAC;AAOzB,uFAAuF;AACvF,wBAAgB,8BAA8B,CAC5C,GAAG,EAAE,OAAO,EACZ,QAAQ,EAAE,MAAM,EAChB,cAAc,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,EAC5C,iBAAiB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,EAC/C,uBAAuB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,EACrC,0BAA0B,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAChD,mBAAmB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,EACjC,sBAAsB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,EAC3D,2BAA2B,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,GACrD,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,CA07BlC"}