agent-ide 0.1.10 → 0.3.3

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 (639) hide show
  1. package/README.md +28 -278
  2. package/dist/application/events/event-bus.d.ts.map +1 -1
  3. package/dist/application/events/event-bus.js.map +1 -1
  4. package/dist/application/index.d.ts +3 -1
  5. package/dist/application/index.d.ts.map +1 -1
  6. package/dist/application/index.js +10 -5
  7. package/dist/application/index.js.map +1 -1
  8. package/dist/application/services/cache-coordinator.service.d.ts.map +1 -1
  9. package/dist/application/services/cache-coordinator.service.js.map +1 -1
  10. package/dist/application/services/error-handler.service.d.ts.map +1 -1
  11. package/dist/application/services/error-handler.service.js.map +1 -1
  12. package/dist/application/services/module-coordinator.service.d.ts +13 -3
  13. package/dist/application/services/module-coordinator.service.d.ts.map +1 -1
  14. package/dist/application/services/module-coordinator.service.js +65 -25
  15. package/dist/application/services/module-coordinator.service.js.map +1 -1
  16. package/dist/application/services/session-manager.service.d.ts.map +1 -1
  17. package/dist/application/services/session-manager.service.js.map +1 -1
  18. package/dist/application/services/workflow-engine.service.d.ts +1 -1
  19. package/dist/application/services/workflow-engine.service.d.ts.map +1 -1
  20. package/dist/application/services/workflow-engine.service.js.map +1 -1
  21. package/dist/application/state/state-manager.d.ts +3 -3
  22. package/dist/application/state/state-manager.d.ts.map +1 -1
  23. package/dist/application/state/state-manager.js +3 -3
  24. package/dist/application/state/state-manager.js.map +1 -1
  25. package/dist/application/types.d.ts.map +1 -1
  26. package/dist/application/workflows/analysis-workflow.d.ts +1 -1
  27. package/dist/application/workflows/analysis-workflow.d.ts.map +1 -1
  28. package/dist/application/workflows/analysis-workflow.js +1 -1
  29. package/dist/application/workflows/analysis-workflow.js.map +1 -1
  30. package/dist/application/workflows/base-workflow.d.ts.map +1 -1
  31. package/dist/application/workflows/base-workflow.js.map +1 -1
  32. package/dist/application/workflows/index.d.ts +2 -2
  33. package/dist/application/workflows/index.d.ts.map +1 -1
  34. package/dist/application/workflows/index.js +2 -2
  35. package/dist/application/workflows/index.js.map +1 -1
  36. package/dist/application/workflows/refactor-workflow.d.ts +1 -1
  37. package/dist/application/workflows/refactor-workflow.d.ts.map +1 -1
  38. package/dist/application/workflows/refactor-workflow.js +1 -1
  39. package/dist/application/workflows/refactor-workflow.js.map +1 -1
  40. package/dist/core/dependency/cycle-detector.d.ts +1 -1
  41. package/dist/core/dependency/cycle-detector.d.ts.map +1 -1
  42. package/dist/core/dependency/cycle-detector.js +1 -1
  43. package/dist/core/dependency/cycle-detector.js.map +1 -1
  44. package/dist/core/dependency/dependency-analyzer.d.ts +3 -1
  45. package/dist/core/dependency/dependency-analyzer.d.ts.map +1 -1
  46. package/dist/core/dependency/dependency-analyzer.js +35 -24
  47. package/dist/core/dependency/dependency-analyzer.js.map +1 -1
  48. package/dist/core/dependency/types.d.ts.map +1 -1
  49. package/dist/core/indexing/file-index.d.ts.map +1 -1
  50. package/dist/core/indexing/file-index.js +1 -1
  51. package/dist/core/indexing/file-index.js.map +1 -1
  52. package/dist/core/indexing/file-watcher.d.ts +4 -2
  53. package/dist/core/indexing/file-watcher.d.ts.map +1 -1
  54. package/dist/core/indexing/file-watcher.js +10 -6
  55. package/dist/core/indexing/file-watcher.js.map +1 -1
  56. package/dist/core/indexing/index-engine.d.ts +7 -1
  57. package/dist/core/indexing/index-engine.d.ts.map +1 -1
  58. package/dist/core/indexing/index-engine.js +49 -16
  59. package/dist/core/indexing/index-engine.js.map +1 -1
  60. package/dist/core/indexing/symbol-index.d.ts +4 -0
  61. package/dist/core/indexing/symbol-index.d.ts.map +1 -1
  62. package/dist/core/indexing/symbol-index.js +17 -0
  63. package/dist/core/indexing/symbol-index.js.map +1 -1
  64. package/dist/core/indexing/types.d.ts.map +1 -1
  65. package/dist/core/search/engines/text-engine.d.ts +3 -0
  66. package/dist/core/search/engines/text-engine.d.ts.map +1 -1
  67. package/dist/core/search/engines/text-engine.js +8 -7
  68. package/dist/core/search/engines/text-engine.js.map +1 -1
  69. package/dist/core/search/service.d.ts +2 -1
  70. package/dist/core/search/service.d.ts.map +1 -1
  71. package/dist/core/search/service.js +3 -3
  72. package/dist/core/search/service.js.map +1 -1
  73. package/dist/core/search/types.d.ts.map +1 -1
  74. package/dist/core/snapshot/index.d.ts +7 -0
  75. package/dist/core/snapshot/index.d.ts.map +1 -0
  76. package/dist/core/snapshot/index.js +6 -0
  77. package/dist/core/snapshot/index.js.map +1 -0
  78. package/dist/core/snapshot/snapshot-generator.d.ts +66 -0
  79. package/dist/core/snapshot/snapshot-generator.d.ts.map +1 -0
  80. package/dist/core/snapshot/snapshot-generator.js +258 -0
  81. package/dist/core/snapshot/snapshot-generator.js.map +1 -0
  82. package/dist/core/snapshot/types.d.ts +67 -0
  83. package/dist/core/snapshot/types.d.ts.map +1 -0
  84. package/dist/core/snapshot/types.js +25 -0
  85. package/dist/core/snapshot/types.js.map +1 -0
  86. package/dist/core/transform/index.d.ts +10 -0
  87. package/dist/core/transform/index.d.ts.map +1 -0
  88. package/dist/core/transform/index.js +21 -0
  89. package/dist/core/transform/index.js.map +1 -0
  90. package/dist/core/transform/location/index.d.ts +8 -0
  91. package/dist/core/transform/location/index.d.ts.map +1 -0
  92. package/dist/core/transform/location/index.js +9 -0
  93. package/dist/core/transform/location/index.js.map +1 -0
  94. package/dist/core/{move → transform/location/move-file}/import-resolver.d.ts +1 -1
  95. package/dist/core/transform/location/move-file/import-resolver.d.ts.map +1 -0
  96. package/dist/core/{move → transform/location/move-file}/import-resolver.js +19 -12
  97. package/dist/core/transform/location/move-file/import-resolver.js.map +1 -0
  98. package/dist/core/{move → transform/location/move-file}/index.d.ts +2 -2
  99. package/dist/core/transform/location/move-file/index.d.ts.map +1 -0
  100. package/dist/core/{move → transform/location/move-file}/index.js +2 -2
  101. package/dist/core/transform/location/move-file/index.js.map +1 -0
  102. package/dist/core/{move → transform/location/move-file}/move-service.d.ts +5 -3
  103. package/dist/core/transform/location/move-file/move-service.d.ts.map +1 -0
  104. package/dist/core/{move → transform/location/move-file}/move-service.js +74 -92
  105. package/dist/core/transform/location/move-file/move-service.js.map +1 -0
  106. package/dist/core/{move → transform/location/move-file}/types.d.ts +1 -1
  107. package/dist/core/transform/location/move-file/types.d.ts.map +1 -0
  108. package/dist/core/transform/location/move-file/types.js.map +1 -0
  109. package/dist/core/transform/location/move-member/index.d.ts +10 -0
  110. package/dist/core/transform/location/move-member/index.d.ts.map +1 -0
  111. package/dist/core/transform/location/move-member/index.js +12 -0
  112. package/dist/core/transform/location/move-member/index.js.map +1 -0
  113. package/dist/core/transform/location/move-member/member-extractor.d.ts +96 -0
  114. package/dist/core/transform/location/move-member/member-extractor.d.ts.map +1 -0
  115. package/dist/core/transform/location/move-member/member-extractor.js +439 -0
  116. package/dist/core/transform/location/move-member/member-extractor.js.map +1 -0
  117. package/dist/core/transform/location/move-member/move-member-service.d.ts +87 -0
  118. package/dist/core/transform/location/move-member/move-member-service.d.ts.map +1 -0
  119. package/dist/core/transform/location/move-member/move-member-service.js +412 -0
  120. package/dist/core/transform/location/move-member/move-member-service.js.map +1 -0
  121. package/dist/core/transform/location/move-member/types.d.ts +182 -0
  122. package/dist/core/transform/location/move-member/types.d.ts.map +1 -0
  123. package/dist/core/transform/location/move-member/types.js +75 -0
  124. package/dist/core/transform/location/move-member/types.js.map +1 -0
  125. package/dist/core/transform/location/shift/file-generator.d.ts +45 -0
  126. package/dist/core/transform/location/shift/file-generator.d.ts.map +1 -0
  127. package/dist/core/transform/location/shift/file-generator.js +94 -0
  128. package/dist/core/transform/location/shift/file-generator.js.map +1 -0
  129. package/dist/core/transform/location/shift/index.d.ts +11 -0
  130. package/dist/core/transform/location/shift/index.d.ts.map +1 -0
  131. package/dist/core/transform/location/shift/index.js +13 -0
  132. package/dist/core/transform/location/shift/index.js.map +1 -0
  133. package/dist/core/transform/location/shift/line-extractor.d.ts +55 -0
  134. package/dist/core/transform/location/shift/line-extractor.d.ts.map +1 -0
  135. package/dist/core/transform/location/shift/line-extractor.js +123 -0
  136. package/dist/core/transform/location/shift/line-extractor.js.map +1 -0
  137. package/dist/core/transform/location/shift/shift-service.d.ts +57 -0
  138. package/dist/core/transform/location/shift/shift-service.d.ts.map +1 -0
  139. package/dist/core/transform/location/shift/shift-service.js +199 -0
  140. package/dist/core/transform/location/shift/shift-service.js.map +1 -0
  141. package/dist/core/transform/location/shift/types.d.ts +195 -0
  142. package/dist/core/transform/location/shift/types.d.ts.map +1 -0
  143. package/dist/core/transform/location/shift/types.js +89 -0
  144. package/dist/core/transform/location/shift/types.js.map +1 -0
  145. package/dist/core/transform/shared/code-editor.d.ts +70 -0
  146. package/dist/core/transform/shared/code-editor.d.ts.map +1 -0
  147. package/dist/core/transform/shared/code-editor.js +206 -0
  148. package/dist/core/transform/shared/code-editor.js.map +1 -0
  149. package/dist/core/transform/shared/index.d.ts +7 -0
  150. package/dist/core/transform/shared/index.d.ts.map +1 -0
  151. package/dist/core/transform/shared/index.js +7 -0
  152. package/dist/core/transform/shared/index.js.map +1 -0
  153. package/dist/core/transform/shared/symbol-finder.d.ts +154 -0
  154. package/dist/core/transform/shared/symbol-finder.d.ts.map +1 -0
  155. package/dist/core/transform/shared/symbol-finder.js +433 -0
  156. package/dist/core/transform/shared/symbol-finder.js.map +1 -0
  157. package/dist/core/transform/structure/extract/extract-function.d.ts.map +1 -0
  158. package/dist/core/{refactor → transform/structure/extract}/extract-function.js +1 -1
  159. package/dist/core/transform/structure/extract/extract-function.js.map +1 -0
  160. package/dist/core/transform/structure/extract/index.d.ts +7 -0
  161. package/dist/core/transform/structure/extract/index.d.ts.map +1 -0
  162. package/dist/core/transform/structure/extract/index.js +9 -0
  163. package/dist/core/transform/structure/extract/index.js.map +1 -0
  164. package/dist/core/transform/structure/extract/swift-extractor.d.ts +98 -0
  165. package/dist/core/transform/structure/extract/swift-extractor.d.ts.map +1 -0
  166. package/dist/core/transform/structure/extract/swift-extractor.js +283 -0
  167. package/dist/core/transform/structure/extract/swift-extractor.js.map +1 -0
  168. package/dist/core/transform/structure/index.d.ts +8 -0
  169. package/dist/core/transform/structure/index.d.ts.map +1 -0
  170. package/dist/core/transform/structure/index.js +8 -0
  171. package/dist/core/transform/structure/index.js.map +1 -0
  172. package/dist/core/transform/structure/inline/index.d.ts +6 -0
  173. package/dist/core/transform/structure/inline/index.d.ts.map +1 -0
  174. package/dist/core/transform/structure/inline/index.js +6 -0
  175. package/dist/core/transform/structure/inline/index.js.map +1 -0
  176. package/dist/core/transform/structure/inline/inline-function.d.ts.map +1 -0
  177. package/dist/core/{refactor → transform/structure/inline}/inline-function.js +37 -26
  178. package/dist/core/transform/structure/inline/inline-function.js.map +1 -0
  179. package/dist/core/transform/structure/patterns/design-patterns.d.ts.map +1 -0
  180. package/dist/core/transform/structure/patterns/design-patterns.js.map +1 -0
  181. package/dist/core/transform/structure/patterns/index.d.ts +6 -0
  182. package/dist/core/transform/structure/patterns/index.d.ts.map +1 -0
  183. package/dist/core/transform/structure/patterns/index.js +6 -0
  184. package/dist/core/transform/structure/patterns/index.js.map +1 -0
  185. package/dist/core/transform/symbol/change-signature/change-signature-service.d.ts +94 -0
  186. package/dist/core/transform/symbol/change-signature/change-signature-service.d.ts.map +1 -0
  187. package/dist/core/transform/symbol/change-signature/change-signature-service.js +544 -0
  188. package/dist/core/transform/symbol/change-signature/change-signature-service.js.map +1 -0
  189. package/dist/core/transform/symbol/change-signature/index.d.ts +10 -0
  190. package/dist/core/transform/symbol/change-signature/index.d.ts.map +1 -0
  191. package/dist/core/transform/symbol/change-signature/index.js +12 -0
  192. package/dist/core/transform/symbol/change-signature/index.js.map +1 -0
  193. package/dist/core/transform/symbol/change-signature/signature-parser.d.ts +76 -0
  194. package/dist/core/transform/symbol/change-signature/signature-parser.d.ts.map +1 -0
  195. package/dist/core/transform/symbol/change-signature/signature-parser.js +387 -0
  196. package/dist/core/transform/symbol/change-signature/signature-parser.js.map +1 -0
  197. package/dist/core/transform/symbol/change-signature/types.d.ts +244 -0
  198. package/dist/core/transform/symbol/change-signature/types.d.ts.map +1 -0
  199. package/dist/core/transform/symbol/change-signature/types.js +73 -0
  200. package/dist/core/transform/symbol/change-signature/types.js.map +1 -0
  201. package/dist/core/transform/symbol/index.d.ts +7 -0
  202. package/dist/core/transform/symbol/index.d.ts.map +1 -0
  203. package/dist/core/transform/symbol/index.js +7 -0
  204. package/dist/core/transform/symbol/index.js.map +1 -0
  205. package/dist/core/transform/symbol/rename/index.d.ts +9 -0
  206. package/dist/core/transform/symbol/rename/index.d.ts.map +1 -0
  207. package/dist/core/{rename → transform/symbol/rename}/index.js +5 -3
  208. package/dist/core/transform/symbol/rename/index.js.map +1 -0
  209. package/dist/core/{rename → transform/symbol/rename}/reference-updater.d.ts +2 -2
  210. package/dist/core/transform/symbol/rename/reference-updater.d.ts.map +1 -0
  211. package/dist/core/{rename → transform/symbol/rename}/reference-updater.js +16 -8
  212. package/dist/core/transform/symbol/rename/reference-updater.js.map +1 -0
  213. package/dist/core/{rename → transform/symbol/rename}/rename-engine.d.ts +2 -2
  214. package/dist/core/transform/symbol/rename/rename-engine.d.ts.map +1 -0
  215. package/dist/core/{rename → transform/symbol/rename}/rename-engine.js +3 -3
  216. package/dist/core/transform/symbol/rename/rename-engine.js.map +1 -0
  217. package/dist/core/{rename → transform/symbol/rename}/scope-analyzer.d.ts +3 -3
  218. package/dist/core/transform/symbol/rename/scope-analyzer.d.ts.map +1 -0
  219. package/dist/core/{rename → transform/symbol/rename}/scope-analyzer.js +2 -2
  220. package/dist/core/transform/symbol/rename/scope-analyzer.js.map +1 -0
  221. package/dist/core/{rename → transform/symbol/rename}/types.d.ts +2 -2
  222. package/dist/core/transform/symbol/rename/types.d.ts.map +1 -0
  223. package/dist/core/transform/symbol/rename/types.js.map +1 -0
  224. package/dist/core/transform/types.d.ts +185 -0
  225. package/dist/core/transform/types.d.ts.map +1 -0
  226. package/dist/core/transform/types.js +150 -0
  227. package/dist/core/transform/types.js.map +1 -0
  228. package/dist/infrastructure/cache/cache-manager.d.ts +1 -1
  229. package/dist/infrastructure/cache/cache-manager.d.ts.map +1 -1
  230. package/dist/infrastructure/cache/cache-manager.js +1 -1
  231. package/dist/infrastructure/cache/cache-manager.js.map +1 -1
  232. package/dist/infrastructure/cache/memory-cache.js +1 -1
  233. package/dist/infrastructure/cache/memory-cache.js.map +1 -1
  234. package/dist/infrastructure/cache/strategies.d.ts +1 -1
  235. package/dist/infrastructure/cache/strategies.d.ts.map +1 -1
  236. package/dist/infrastructure/cache/strategies.js +1 -1
  237. package/dist/infrastructure/cache/strategies.js.map +1 -1
  238. package/dist/infrastructure/formatters/diff-generator.d.ts +11 -0
  239. package/dist/infrastructure/formatters/diff-generator.d.ts.map +1 -0
  240. package/dist/infrastructure/formatters/diff-generator.js +217 -0
  241. package/dist/infrastructure/formatters/diff-generator.js.map +1 -0
  242. package/dist/infrastructure/formatters/index.d.ts +11 -0
  243. package/dist/infrastructure/formatters/index.d.ts.map +1 -0
  244. package/dist/infrastructure/formatters/index.js +13 -0
  245. package/dist/infrastructure/formatters/index.js.map +1 -0
  246. package/dist/infrastructure/formatters/preview-converter.d.ts +85 -0
  247. package/dist/infrastructure/formatters/preview-converter.d.ts.map +1 -0
  248. package/dist/infrastructure/formatters/preview-converter.js +209 -0
  249. package/dist/infrastructure/formatters/preview-converter.js.map +1 -0
  250. package/dist/infrastructure/formatters/preview-formatter.d.ts +61 -0
  251. package/dist/infrastructure/formatters/preview-formatter.d.ts.map +1 -0
  252. package/dist/infrastructure/formatters/preview-formatter.js +208 -0
  253. package/dist/infrastructure/formatters/preview-formatter.js.map +1 -0
  254. package/dist/infrastructure/formatters/query-formatter.d.ts +63 -0
  255. package/dist/infrastructure/formatters/query-formatter.d.ts.map +1 -0
  256. package/dist/infrastructure/formatters/query-formatter.js +218 -0
  257. package/dist/infrastructure/formatters/query-formatter.js.map +1 -0
  258. package/dist/infrastructure/formatters/query-types.d.ts +165 -0
  259. package/dist/infrastructure/formatters/query-types.d.ts.map +1 -0
  260. package/dist/infrastructure/formatters/query-types.js +30 -0
  261. package/dist/infrastructure/formatters/query-types.js.map +1 -0
  262. package/dist/infrastructure/formatters/types.d.ts +153 -0
  263. package/dist/infrastructure/formatters/types.d.ts.map +1 -0
  264. package/dist/infrastructure/formatters/types.js +27 -0
  265. package/dist/infrastructure/formatters/types.js.map +1 -0
  266. package/dist/infrastructure/parser/analysis-types.d.ts +198 -0
  267. package/dist/infrastructure/parser/analysis-types.d.ts.map +1 -0
  268. package/dist/infrastructure/parser/analysis-types.js +6 -0
  269. package/dist/infrastructure/parser/analysis-types.js.map +1 -0
  270. package/dist/infrastructure/parser/base.d.ts +37 -1
  271. package/dist/infrastructure/parser/base.d.ts.map +1 -1
  272. package/dist/infrastructure/parser/base.js +73 -1
  273. package/dist/infrastructure/parser/base.js.map +1 -1
  274. package/dist/infrastructure/parser/factory.d.ts +3 -3
  275. package/dist/infrastructure/parser/factory.d.ts.map +1 -1
  276. package/dist/infrastructure/parser/factory.js +1 -1
  277. package/dist/infrastructure/parser/factory.js.map +1 -1
  278. package/dist/infrastructure/parser/index.d.ts +1 -0
  279. package/dist/infrastructure/parser/index.d.ts.map +1 -1
  280. package/dist/infrastructure/parser/index.js.map +1 -1
  281. package/dist/infrastructure/parser/interface.d.ts +64 -1
  282. package/dist/infrastructure/parser/interface.d.ts.map +1 -1
  283. package/dist/infrastructure/parser/interface.js +11 -1
  284. package/dist/infrastructure/parser/interface.js.map +1 -1
  285. package/dist/infrastructure/parser/registry.d.ts +1 -1
  286. package/dist/infrastructure/parser/registry.d.ts.map +1 -1
  287. package/dist/infrastructure/parser/registry.js +1 -1
  288. package/dist/infrastructure/parser/registry.js.map +1 -1
  289. package/dist/infrastructure/parser/types.d.ts.map +1 -1
  290. package/dist/infrastructure/storage/file-system.d.ts +2 -1
  291. package/dist/infrastructure/storage/file-system.d.ts.map +1 -1
  292. package/dist/infrastructure/storage/file-system.interface.d.ts +69 -0
  293. package/dist/infrastructure/storage/file-system.interface.d.ts.map +1 -0
  294. package/dist/infrastructure/storage/file-system.interface.js +6 -0
  295. package/dist/infrastructure/storage/file-system.interface.js.map +1 -0
  296. package/dist/infrastructure/storage/file-system.js.map +1 -1
  297. package/dist/infrastructure/storage/index.d.ts +2 -2
  298. package/dist/infrastructure/storage/index.d.ts.map +1 -1
  299. package/dist/infrastructure/storage/index.js +1 -6
  300. package/dist/infrastructure/storage/index.js.map +1 -1
  301. package/dist/infrastructure/storage/mem-file-system.d.ts +44 -0
  302. package/dist/infrastructure/storage/mem-file-system.d.ts.map +1 -0
  303. package/dist/infrastructure/storage/mem-file-system.js +105 -0
  304. package/dist/infrastructure/storage/mem-file-system.js.map +1 -0
  305. package/dist/infrastructure/storage/path-utils.d.ts +1 -1
  306. package/dist/infrastructure/storage/path-utils.d.ts.map +1 -1
  307. package/dist/interfaces/cli/cli.d.ts +13 -70
  308. package/dist/interfaces/cli/cli.d.ts.map +1 -1
  309. package/dist/interfaces/cli/cli.js +65 -1186
  310. package/dist/interfaces/cli/cli.js.map +1 -1
  311. package/dist/interfaces/cli/commands/analyze.command.d.ts +11 -0
  312. package/dist/interfaces/cli/commands/analyze.command.d.ts.map +1 -0
  313. package/dist/interfaces/cli/commands/analyze.command.js +460 -0
  314. package/dist/interfaces/cli/commands/analyze.command.js.map +1 -0
  315. package/dist/interfaces/cli/commands/change-signature.command.d.ts +11 -0
  316. package/dist/interfaces/cli/commands/change-signature.command.d.ts.map +1 -0
  317. package/dist/interfaces/cli/commands/change-signature.command.js +299 -0
  318. package/dist/interfaces/cli/commands/change-signature.command.js.map +1 -0
  319. package/dist/interfaces/cli/commands/deps.command.d.ts +11 -0
  320. package/dist/interfaces/cli/commands/deps.command.d.ts.map +1 -0
  321. package/dist/interfaces/cli/commands/deps.command.js +143 -0
  322. package/dist/interfaces/cli/commands/deps.command.js.map +1 -0
  323. package/dist/interfaces/cli/commands/extract.command.d.ts +11 -0
  324. package/dist/interfaces/cli/commands/extract.command.d.ts.map +1 -0
  325. package/dist/interfaces/cli/commands/extract.command.js +314 -0
  326. package/dist/interfaces/cli/commands/extract.command.js.map +1 -0
  327. package/dist/interfaces/cli/commands/index.d.ts +16 -0
  328. package/dist/interfaces/cli/commands/index.d.ts.map +1 -0
  329. package/dist/interfaces/cli/commands/index.js +15 -0
  330. package/dist/interfaces/cli/commands/index.js.map +1 -0
  331. package/dist/interfaces/cli/commands/inline.command.d.ts +11 -0
  332. package/dist/interfaces/cli/commands/inline.command.d.ts.map +1 -0
  333. package/dist/interfaces/cli/commands/inline.command.js +208 -0
  334. package/dist/interfaces/cli/commands/inline.command.js.map +1 -0
  335. package/dist/interfaces/cli/commands/move-member.command.d.ts +11 -0
  336. package/dist/interfaces/cli/commands/move-member.command.d.ts.map +1 -0
  337. package/dist/interfaces/cli/commands/move-member.command.js +194 -0
  338. package/dist/interfaces/cli/commands/move-member.command.js.map +1 -0
  339. package/dist/interfaces/cli/commands/move.command.d.ts +11 -0
  340. package/dist/interfaces/cli/commands/move.command.d.ts.map +1 -0
  341. package/dist/interfaces/cli/commands/move.command.js +220 -0
  342. package/dist/interfaces/cli/commands/move.command.js.map +1 -0
  343. package/dist/interfaces/cli/commands/refactor.command.d.ts +11 -0
  344. package/dist/interfaces/cli/commands/refactor.command.d.ts.map +1 -0
  345. package/dist/interfaces/cli/commands/refactor.command.js +414 -0
  346. package/dist/interfaces/cli/commands/refactor.command.js.map +1 -0
  347. package/dist/interfaces/cli/commands/rename.command.d.ts +11 -0
  348. package/dist/interfaces/cli/commands/rename.command.d.ts.map +1 -0
  349. package/dist/interfaces/cli/commands/rename.command.js +272 -0
  350. package/dist/interfaces/cli/commands/rename.command.js.map +1 -0
  351. package/dist/interfaces/cli/commands/search.command.d.ts +11 -0
  352. package/dist/interfaces/cli/commands/search.command.d.ts.map +1 -0
  353. package/dist/interfaces/cli/commands/search.command.js +409 -0
  354. package/dist/interfaces/cli/commands/search.command.js.map +1 -0
  355. package/dist/interfaces/cli/commands/shift.command.d.ts +11 -0
  356. package/dist/interfaces/cli/commands/shift.command.d.ts.map +1 -0
  357. package/dist/interfaces/cli/commands/shift.command.js +143 -0
  358. package/dist/interfaces/cli/commands/shift.command.js.map +1 -0
  359. package/dist/interfaces/cli/commands/snapshot.command.d.ts +11 -0
  360. package/dist/interfaces/cli/commands/snapshot.command.d.ts.map +1 -0
  361. package/dist/interfaces/cli/commands/snapshot.command.js +68 -0
  362. package/dist/interfaces/cli/commands/snapshot.command.js.map +1 -0
  363. package/dist/interfaces/cli/commands/types.d.ts +18 -0
  364. package/dist/interfaces/cli/commands/types.d.ts.map +1 -0
  365. package/dist/interfaces/cli/commands/types.js +5 -0
  366. package/dist/interfaces/cli/commands/types.js.map +1 -0
  367. package/dist/interfaces/cli/index.d.ts +1 -1
  368. package/dist/interfaces/cli/index.d.ts.map +1 -1
  369. package/dist/interfaces/cli/index.js +1 -1
  370. package/dist/interfaces/cli/index.js.map +1 -1
  371. package/dist/interfaces/cli/preview-output-handler.d.ts +53 -0
  372. package/dist/interfaces/cli/preview-output-handler.d.ts.map +1 -0
  373. package/dist/interfaces/cli/preview-output-handler.js +73 -0
  374. package/dist/interfaces/cli/preview-output-handler.js.map +1 -0
  375. package/dist/interfaces/cli/unified-output-handler.d.ts +77 -0
  376. package/dist/interfaces/cli/unified-output-handler.d.ts.map +1 -0
  377. package/dist/interfaces/cli/unified-output-handler.js +140 -0
  378. package/dist/interfaces/cli/unified-output-handler.js.map +1 -0
  379. package/dist/plugins/javascript/index.d.ts +2 -2
  380. package/dist/plugins/javascript/index.d.ts.map +1 -1
  381. package/dist/plugins/javascript/index.js +1 -1
  382. package/dist/plugins/javascript/index.js.map +1 -1
  383. package/dist/plugins/javascript/parser.d.ts +41 -0
  384. package/dist/plugins/javascript/parser.d.ts.map +1 -1
  385. package/dist/plugins/javascript/parser.js +284 -0
  386. package/dist/plugins/javascript/parser.js.map +1 -1
  387. package/dist/plugins/javascript/types.d.ts.map +1 -1
  388. package/dist/plugins/javascript/types.js.map +1 -1
  389. package/dist/plugins/python/analyzers/complexity-analyzer.d.ts +50 -0
  390. package/dist/plugins/python/analyzers/complexity-analyzer.d.ts.map +1 -0
  391. package/dist/plugins/python/analyzers/complexity-analyzer.js +172 -0
  392. package/dist/plugins/python/analyzers/complexity-analyzer.js.map +1 -0
  393. package/dist/plugins/python/analyzers/duplication-detector.d.ts +39 -0
  394. package/dist/plugins/python/analyzers/duplication-detector.d.ts.map +1 -0
  395. package/dist/plugins/python/analyzers/duplication-detector.js +146 -0
  396. package/dist/plugins/python/analyzers/duplication-detector.js.map +1 -0
  397. package/dist/plugins/python/analyzers/error-handling-checker.d.ts +28 -0
  398. package/dist/plugins/python/analyzers/error-handling-checker.d.ts.map +1 -0
  399. package/dist/plugins/python/analyzers/error-handling-checker.js +143 -0
  400. package/dist/plugins/python/analyzers/error-handling-checker.js.map +1 -0
  401. package/dist/plugins/python/analyzers/naming-checker.d.ts +56 -0
  402. package/dist/plugins/python/analyzers/naming-checker.d.ts.map +1 -0
  403. package/dist/plugins/python/analyzers/naming-checker.js +220 -0
  404. package/dist/plugins/python/analyzers/naming-checker.js.map +1 -0
  405. package/dist/plugins/python/analyzers/pattern-detector.d.ts +44 -0
  406. package/dist/plugins/python/analyzers/pattern-detector.d.ts.map +1 -0
  407. package/dist/plugins/python/analyzers/pattern-detector.js +222 -0
  408. package/dist/plugins/python/analyzers/pattern-detector.js.map +1 -0
  409. package/dist/plugins/python/analyzers/security-checker.d.ts +56 -0
  410. package/dist/plugins/python/analyzers/security-checker.d.ts.map +1 -0
  411. package/dist/plugins/python/analyzers/security-checker.js +279 -0
  412. package/dist/plugins/python/analyzers/security-checker.js.map +1 -0
  413. package/dist/plugins/python/analyzers/type-safety-checker.d.ts +44 -0
  414. package/dist/plugins/python/analyzers/type-safety-checker.d.ts.map +1 -0
  415. package/dist/plugins/python/analyzers/type-safety-checker.js +177 -0
  416. package/dist/plugins/python/analyzers/type-safety-checker.js.map +1 -0
  417. package/dist/plugins/python/analyzers/unused-symbol-detector.d.ts +37 -0
  418. package/dist/plugins/python/analyzers/unused-symbol-detector.d.ts.map +1 -0
  419. package/dist/plugins/python/analyzers/unused-symbol-detector.js +141 -0
  420. package/dist/plugins/python/analyzers/unused-symbol-detector.js.map +1 -0
  421. package/dist/plugins/python/dependency-analyzer.d.ts +86 -0
  422. package/dist/plugins/python/dependency-analyzer.d.ts.map +1 -0
  423. package/dist/plugins/python/dependency-analyzer.js +252 -0
  424. package/dist/plugins/python/dependency-analyzer.js.map +1 -0
  425. package/dist/plugins/python/index.d.ts +17 -0
  426. package/dist/plugins/python/index.d.ts.map +1 -0
  427. package/dist/plugins/python/index.js +23 -0
  428. package/dist/plugins/python/index.js.map +1 -0
  429. package/dist/plugins/python/parser.d.ts +150 -0
  430. package/dist/plugins/python/parser.d.ts.map +1 -0
  431. package/dist/plugins/python/parser.js +476 -0
  432. package/dist/plugins/python/parser.js.map +1 -0
  433. package/dist/plugins/python/symbol-extractor.d.ts +108 -0
  434. package/dist/plugins/python/symbol-extractor.d.ts.map +1 -0
  435. package/dist/plugins/python/symbol-extractor.js +389 -0
  436. package/dist/plugins/python/symbol-extractor.js.map +1 -0
  437. package/dist/plugins/python/tree-sitter-bridge.d.ts +57 -0
  438. package/dist/plugins/python/tree-sitter-bridge.d.ts.map +1 -0
  439. package/dist/plugins/python/tree-sitter-bridge.js +267 -0
  440. package/dist/plugins/python/tree-sitter-bridge.js.map +1 -0
  441. package/dist/plugins/python/types.d.ts +179 -0
  442. package/dist/plugins/python/types.d.ts.map +1 -0
  443. package/dist/plugins/python/types.js +252 -0
  444. package/dist/plugins/python/types.js.map +1 -0
  445. package/dist/plugins/swift/analyzers/complexity-analyzer.d.ts +41 -0
  446. package/dist/plugins/swift/analyzers/complexity-analyzer.d.ts.map +1 -0
  447. package/dist/plugins/swift/analyzers/complexity-analyzer.js +206 -0
  448. package/dist/plugins/swift/analyzers/complexity-analyzer.js.map +1 -0
  449. package/dist/plugins/swift/analyzers/duplication-detector.d.ts +89 -0
  450. package/dist/plugins/swift/analyzers/duplication-detector.d.ts.map +1 -0
  451. package/dist/plugins/swift/analyzers/duplication-detector.js +271 -0
  452. package/dist/plugins/swift/analyzers/duplication-detector.js.map +1 -0
  453. package/dist/plugins/swift/analyzers/error-handling-checker.d.ts +34 -0
  454. package/dist/plugins/swift/analyzers/error-handling-checker.d.ts.map +1 -0
  455. package/dist/plugins/swift/analyzers/error-handling-checker.js +135 -0
  456. package/dist/plugins/swift/analyzers/error-handling-checker.js.map +1 -0
  457. package/dist/plugins/swift/analyzers/naming-checker.d.ts +47 -0
  458. package/dist/plugins/swift/analyzers/naming-checker.d.ts.map +1 -0
  459. package/dist/plugins/swift/analyzers/naming-checker.js +161 -0
  460. package/dist/plugins/swift/analyzers/naming-checker.js.map +1 -0
  461. package/dist/plugins/swift/analyzers/pattern-detector.d.ts +78 -0
  462. package/dist/plugins/swift/analyzers/pattern-detector.d.ts.map +1 -0
  463. package/dist/plugins/swift/analyzers/pattern-detector.js +247 -0
  464. package/dist/plugins/swift/analyzers/pattern-detector.js.map +1 -0
  465. package/dist/plugins/swift/analyzers/security-checker.d.ts +38 -0
  466. package/dist/plugins/swift/analyzers/security-checker.d.ts.map +1 -0
  467. package/dist/plugins/swift/analyzers/security-checker.js +135 -0
  468. package/dist/plugins/swift/analyzers/security-checker.js.map +1 -0
  469. package/dist/plugins/swift/analyzers/type-safety-checker.d.ts +41 -0
  470. package/dist/plugins/swift/analyzers/type-safety-checker.d.ts.map +1 -0
  471. package/dist/plugins/swift/analyzers/type-safety-checker.js +121 -0
  472. package/dist/plugins/swift/analyzers/type-safety-checker.js.map +1 -0
  473. package/dist/plugins/swift/analyzers/unused-symbol-detector.d.ts +38 -0
  474. package/dist/plugins/swift/analyzers/unused-symbol-detector.d.ts.map +1 -0
  475. package/dist/plugins/swift/analyzers/unused-symbol-detector.js +211 -0
  476. package/dist/plugins/swift/analyzers/unused-symbol-detector.js.map +1 -0
  477. package/dist/plugins/swift/dependency-analyzer.d.ts +33 -0
  478. package/dist/plugins/swift/dependency-analyzer.d.ts.map +1 -0
  479. package/dist/plugins/swift/dependency-analyzer.js +95 -0
  480. package/dist/plugins/swift/dependency-analyzer.js.map +1 -0
  481. package/dist/plugins/swift/index.d.ts +14 -0
  482. package/dist/plugins/swift/index.d.ts.map +1 -0
  483. package/dist/plugins/swift/index.js +19 -0
  484. package/dist/plugins/swift/index.js.map +1 -0
  485. package/dist/plugins/swift/parser.d.ts +160 -0
  486. package/dist/plugins/swift/parser.d.ts.map +1 -0
  487. package/dist/plugins/swift/parser.js +670 -0
  488. package/dist/plugins/swift/parser.js.map +1 -0
  489. package/dist/plugins/swift/swift-bridge/swift-parser +0 -0
  490. package/dist/plugins/swift/symbol-extractor.d.ts +46 -0
  491. package/dist/plugins/swift/symbol-extractor.d.ts.map +1 -0
  492. package/dist/plugins/swift/symbol-extractor.js +187 -0
  493. package/dist/plugins/swift/symbol-extractor.js.map +1 -0
  494. package/dist/plugins/swift/types.d.ts +137 -0
  495. package/dist/plugins/swift/types.d.ts.map +1 -0
  496. package/dist/plugins/swift/types.js +212 -0
  497. package/dist/plugins/swift/types.js.map +1 -0
  498. package/dist/plugins/typescript/analyzers/complexity-analyzer.d.ts +39 -0
  499. package/dist/plugins/typescript/analyzers/complexity-analyzer.d.ts.map +1 -0
  500. package/dist/plugins/typescript/analyzers/complexity-analyzer.js +196 -0
  501. package/dist/plugins/typescript/analyzers/complexity-analyzer.js.map +1 -0
  502. package/dist/{core/analysis → plugins/typescript/analyzers}/duplication-detector.d.ts +34 -3
  503. package/dist/plugins/typescript/analyzers/duplication-detector.d.ts.map +1 -0
  504. package/dist/plugins/typescript/analyzers/duplication-detector.js +695 -0
  505. package/dist/plugins/typescript/analyzers/duplication-detector.js.map +1 -0
  506. package/dist/plugins/typescript/analyzers/error-handling-checker.d.ts +26 -0
  507. package/dist/plugins/typescript/analyzers/error-handling-checker.d.ts.map +1 -0
  508. package/dist/plugins/typescript/analyzers/error-handling-checker.js +84 -0
  509. package/dist/plugins/typescript/analyzers/error-handling-checker.js.map +1 -0
  510. package/dist/plugins/typescript/analyzers/naming-checker.d.ts +30 -0
  511. package/dist/plugins/typescript/analyzers/naming-checker.d.ts.map +1 -0
  512. package/dist/plugins/typescript/analyzers/naming-checker.js +116 -0
  513. package/dist/plugins/typescript/analyzers/naming-checker.js.map +1 -0
  514. package/dist/plugins/typescript/analyzers/pattern-detector.d.ts +80 -0
  515. package/dist/plugins/typescript/analyzers/pattern-detector.d.ts.map +1 -0
  516. package/dist/plugins/typescript/analyzers/pattern-detector.js +267 -0
  517. package/dist/plugins/typescript/analyzers/pattern-detector.js.map +1 -0
  518. package/dist/plugins/typescript/analyzers/security-checker.d.ts +34 -0
  519. package/dist/plugins/typescript/analyzers/security-checker.d.ts.map +1 -0
  520. package/dist/plugins/typescript/analyzers/security-checker.js +126 -0
  521. package/dist/plugins/typescript/analyzers/security-checker.js.map +1 -0
  522. package/dist/plugins/typescript/analyzers/type-safety-checker.d.ts +32 -0
  523. package/dist/plugins/typescript/analyzers/type-safety-checker.d.ts.map +1 -0
  524. package/dist/plugins/typescript/analyzers/type-safety-checker.js +86 -0
  525. package/dist/plugins/typescript/analyzers/type-safety-checker.js.map +1 -0
  526. package/dist/plugins/typescript/analyzers/unused-symbol-detector.d.ts +47 -0
  527. package/dist/plugins/typescript/analyzers/unused-symbol-detector.d.ts.map +1 -0
  528. package/dist/plugins/typescript/analyzers/unused-symbol-detector.js +152 -0
  529. package/dist/plugins/typescript/analyzers/unused-symbol-detector.js.map +1 -0
  530. package/dist/plugins/typescript/parser.d.ts +41 -0
  531. package/dist/plugins/typescript/parser.d.ts.map +1 -1
  532. package/dist/plugins/typescript/parser.js +348 -3
  533. package/dist/plugins/typescript/parser.js.map +1 -1
  534. package/dist/plugins/typescript/symbol-extractor.d.ts.map +1 -1
  535. package/dist/plugins/typescript/symbol-extractor.js +12 -0
  536. package/dist/plugins/typescript/symbol-extractor.js.map +1 -1
  537. package/dist/plugins/typescript/types.d.ts.map +1 -1
  538. package/dist/plugins/typescript/types.js +10 -0
  539. package/dist/plugins/typescript/types.js.map +1 -1
  540. package/dist/shared/errors/config-error.d.ts +1 -1
  541. package/dist/shared/errors/config-error.d.ts.map +1 -1
  542. package/dist/shared/errors/config-error.js +1 -1
  543. package/dist/shared/errors/config-error.js.map +1 -1
  544. package/dist/shared/errors/file-error.d.ts +1 -1
  545. package/dist/shared/errors/file-error.d.ts.map +1 -1
  546. package/dist/shared/errors/file-error.js +1 -1
  547. package/dist/shared/errors/file-error.js.map +1 -1
  548. package/dist/shared/errors/index.d.ts +1 -1
  549. package/dist/shared/errors/index.d.ts.map +1 -1
  550. package/dist/shared/errors/index.js +4 -4
  551. package/dist/shared/errors/index.js.map +1 -1
  552. package/dist/shared/errors/parser-error.d.ts +1 -1
  553. package/dist/shared/errors/parser-error.d.ts.map +1 -1
  554. package/dist/shared/errors/parser-error.js +1 -1
  555. package/dist/shared/errors/parser-error.js.map +1 -1
  556. package/dist/shared/errors/validation-error.d.ts +1 -1
  557. package/dist/shared/errors/validation-error.d.ts.map +1 -1
  558. package/dist/shared/errors/validation-error.js +1 -1
  559. package/dist/shared/errors/validation-error.js.map +1 -1
  560. package/dist/shared/types/ast.d.ts +1 -1
  561. package/dist/shared/types/ast.d.ts.map +1 -1
  562. package/dist/shared/types/ast.js +1 -1
  563. package/dist/shared/types/ast.js.map +1 -1
  564. package/dist/shared/types/symbol.d.ts +8 -2
  565. package/dist/shared/types/symbol.d.ts.map +1 -1
  566. package/dist/shared/types/symbol.js +8 -2
  567. package/dist/shared/types/symbol.js.map +1 -1
  568. package/dist/shared/utils/index.d.ts +5 -5
  569. package/dist/shared/utils/index.d.ts.map +1 -1
  570. package/dist/shared/utils/index.js +5 -5
  571. package/dist/shared/utils/index.js.map +1 -1
  572. package/package.json +21 -9
  573. package/bin/mcp-server.js +0 -20
  574. package/dist/core/analysis/complexity-analyzer.d.ts +0 -81
  575. package/dist/core/analysis/complexity-analyzer.d.ts.map +0 -1
  576. package/dist/core/analysis/complexity-analyzer.js +0 -255
  577. package/dist/core/analysis/complexity-analyzer.js.map +0 -1
  578. package/dist/core/analysis/dead-code-detector.d.ts +0 -152
  579. package/dist/core/analysis/dead-code-detector.d.ts.map +0 -1
  580. package/dist/core/analysis/dead-code-detector.js +0 -351
  581. package/dist/core/analysis/dead-code-detector.js.map +0 -1
  582. package/dist/core/analysis/duplication-detector.d.ts.map +0 -1
  583. package/dist/core/analysis/duplication-detector.js +0 -433
  584. package/dist/core/analysis/duplication-detector.js.map +0 -1
  585. package/dist/core/analysis/index.d.ts +0 -9
  586. package/dist/core/analysis/index.d.ts.map +0 -1
  587. package/dist/core/analysis/index.js +0 -13
  588. package/dist/core/analysis/index.js.map +0 -1
  589. package/dist/core/analysis/quality-metrics.d.ts +0 -158
  590. package/dist/core/analysis/quality-metrics.d.ts.map +0 -1
  591. package/dist/core/analysis/quality-metrics.js +0 -442
  592. package/dist/core/analysis/quality-metrics.js.map +0 -1
  593. package/dist/core/move/import-resolver.d.ts.map +0 -1
  594. package/dist/core/move/import-resolver.js.map +0 -1
  595. package/dist/core/move/index.d.ts.map +0 -1
  596. package/dist/core/move/index.js.map +0 -1
  597. package/dist/core/move/move-service.d.ts.map +0 -1
  598. package/dist/core/move/move-service.js.map +0 -1
  599. package/dist/core/move/types.d.ts.map +0 -1
  600. package/dist/core/move/types.js.map +0 -1
  601. package/dist/core/refactor/design-patterns.d.ts.map +0 -1
  602. package/dist/core/refactor/design-patterns.js.map +0 -1
  603. package/dist/core/refactor/extract-function.d.ts.map +0 -1
  604. package/dist/core/refactor/extract-function.js.map +0 -1
  605. package/dist/core/refactor/index.d.ts +0 -8
  606. package/dist/core/refactor/index.d.ts.map +0 -1
  607. package/dist/core/refactor/index.js +0 -11
  608. package/dist/core/refactor/index.js.map +0 -1
  609. package/dist/core/refactor/inline-function.d.ts.map +0 -1
  610. package/dist/core/refactor/inline-function.js.map +0 -1
  611. package/dist/core/rename/index.d.ts +0 -9
  612. package/dist/core/rename/index.d.ts.map +0 -1
  613. package/dist/core/rename/index.js.map +0 -1
  614. package/dist/core/rename/reference-updater.d.ts.map +0 -1
  615. package/dist/core/rename/reference-updater.js.map +0 -1
  616. package/dist/core/rename/rename-engine.d.ts.map +0 -1
  617. package/dist/core/rename/rename-engine.js.map +0 -1
  618. package/dist/core/rename/scope-analyzer.d.ts.map +0 -1
  619. package/dist/core/rename/scope-analyzer.js.map +0 -1
  620. package/dist/core/rename/types.d.ts.map +0 -1
  621. package/dist/core/rename/types.js.map +0 -1
  622. package/dist/interfaces/mcp/index.d.ts +0 -7
  623. package/dist/interfaces/mcp/index.d.ts.map +0 -1
  624. package/dist/interfaces/mcp/index.js +0 -6
  625. package/dist/interfaces/mcp/index.js.map +0 -1
  626. package/dist/interfaces/mcp/mcp-server.d.ts +0 -34
  627. package/dist/interfaces/mcp/mcp-server.d.ts.map +0 -1
  628. package/dist/interfaces/mcp/mcp-server.js +0 -162
  629. package/dist/interfaces/mcp/mcp-server.js.map +0 -1
  630. package/dist/interfaces/mcp/mcp.d.ts +0 -52
  631. package/dist/interfaces/mcp/mcp.d.ts.map +0 -1
  632. package/dist/interfaces/mcp/mcp.js +0 -853
  633. package/dist/interfaces/mcp/mcp.js.map +0 -1
  634. /package/dist/core/{move → transform/location/move-file}/types.js +0 -0
  635. /package/dist/core/{refactor → transform/structure/extract}/extract-function.d.ts +0 -0
  636. /package/dist/core/{refactor → transform/structure/inline}/inline-function.d.ts +0 -0
  637. /package/dist/core/{refactor → transform/structure/patterns}/design-patterns.d.ts +0 -0
  638. /package/dist/core/{refactor → transform/structure/patterns}/design-patterns.js +0 -0
  639. /package/dist/core/{rename → transform/symbol/rename}/types.js +0 -0
@@ -0,0 +1,670 @@
1
+ /**
2
+ * Swift Parser 主要實作
3
+ * 實作 ParserPlugin 介面
4
+ */
5
+ import { exec } from 'child_process';
6
+ import { promisify } from 'util';
7
+ import * as path from 'path';
8
+ import * as fs from 'fs';
9
+ import { createValidationSuccess, createValidationFailure, createCodeEdit, createDefinition, createUsage } from '../../infrastructure/parser/index.js';
10
+ import { createAST, createASTMetadata, ReferenceType, SymbolType } from '../../shared/types/index.js';
11
+ import { SwiftNodeKind, createSwiftASTNode, createParseError, getNodeName, isValidIdentifier } from './types.js';
12
+ import { createSymbolExtractor } from '../swift/symbol-extractor.js';
13
+ import { createDependencyAnalyzer } from '../swift/dependency-analyzer.js';
14
+ const execAsync = promisify(exec);
15
+ /**
16
+ * Swift Parser 實作
17
+ */
18
+ export class SwiftParser {
19
+ name = 'swift';
20
+ version = '1.0.0';
21
+ supportedExtensions = ['.swift'];
22
+ supportedLanguages = ['swift'];
23
+ symbolExtractor;
24
+ dependencyAnalyzer;
25
+ cliPath;
26
+ constructor(cliPath = 'swift-parser') {
27
+ this.symbolExtractor = createSymbolExtractor();
28
+ this.dependencyAnalyzer = createDependencyAnalyzer();
29
+ this.cliPath = cliPath;
30
+ }
31
+ // ===== 10 個基本方法 =====
32
+ /**
33
+ * 解析 Swift 程式碼
34
+ */
35
+ async parse(code, filePath) {
36
+ this.validateInput(code, filePath);
37
+ try {
38
+ // 呼叫 Swift CLI Bridge
39
+ const cliPath = this.resolveCliPath();
40
+ const escapedCode = code.replace(/'/g, '\'\\\'\''); // 逸出單引號
41
+ const { stdout } = await execAsync(`echo '${escapedCode}' | ${cliPath}`, {
42
+ maxBuffer: 10 * 1024 * 1024 // 10MB buffer
43
+ });
44
+ // 解析 JSON 輸出
45
+ const cliOutput = JSON.parse(stdout);
46
+ // 檢查解析錯誤
47
+ if (cliOutput.parseErrors) {
48
+ throw createParseError(`Swift 語法錯誤: ${cliOutput.parseErrors.map((e) => e.message).join(', ')}`);
49
+ }
50
+ // 轉換為標準 AST
51
+ const rootNode = this.convertCLINodeToASTNode(cliOutput.root);
52
+ const metadata = createASTMetadata('swift', cliOutput.metadata?.parserVersion || this.version, {}, Date.now(), 0);
53
+ const baseAST = createAST(filePath, rootNode, metadata);
54
+ const ast = {
55
+ ...baseAST,
56
+ root: rootNode,
57
+ swiftVersion: cliOutput.metadata?.parserVersion,
58
+ diagnostics: []
59
+ };
60
+ return ast;
61
+ }
62
+ catch (error) {
63
+ throw createParseError(`解析失敗: ${error instanceof Error ? error.message : String(error)}`);
64
+ }
65
+ }
66
+ /**
67
+ * 解析 Swift CLI Bridge 路徑
68
+ */
69
+ resolveCliPath() {
70
+ // 優先使用建構參數指定的路徑
71
+ if (this.cliPath && this.cliPath !== 'swift-parser') {
72
+ if (fs.existsSync(this.cliPath)) {
73
+ return this.cliPath;
74
+ }
75
+ }
76
+ // 從 dist/ 目錄解析(build 時已複製)
77
+ const distPath = path.join(__dirname, 'swift-bridge', 'swift-parser');
78
+ if (fs.existsSync(distPath)) {
79
+ return distPath;
80
+ }
81
+ // 開發環境:從 src/ 目錄解析
82
+ const projectRoot = process.cwd();
83
+ const srcPath = path.join(projectRoot, 'src/plugins/swift/swift-bridge/swift-parser');
84
+ if (fs.existsSync(srcPath)) {
85
+ return srcPath;
86
+ }
87
+ // 錯誤:CLI Bridge 未找到
88
+ throw new Error('Swift CLI Bridge not found. Please run: cd src/plugins/swift/swift-bridge && bash build.sh');
89
+ }
90
+ /**
91
+ * 轉換 CLI Bridge 節點為 AST 節點
92
+ */
93
+ convertCLINodeToASTNode(cliNode) {
94
+ const swiftKind = this.nodeTypeToSwiftKind(cliNode.type);
95
+ const node = {
96
+ type: cliNode.type,
97
+ range: cliNode.range,
98
+ swiftKind,
99
+ properties: cliNode.properties || {},
100
+ children: (cliNode.children || []).map((child) => this.convertCLINodeToASTNode(child)),
101
+ attributes: this.extractAttributes(cliNode),
102
+ modifiers: this.extractModifiers(cliNode),
103
+ source: cliNode.source || undefined
104
+ };
105
+ return node;
106
+ }
107
+ /**
108
+ * 節點類型轉換為 SwiftNodeKind
109
+ */
110
+ nodeTypeToSwiftKind(nodeType) {
111
+ // 對應 Swift CLI Bridge 的節點類型
112
+ const mapping = {
113
+ 'SourceFile': SwiftNodeKind.SourceFile,
114
+ 'ClassDecl': SwiftNodeKind.Class,
115
+ 'StructDecl': SwiftNodeKind.Struct,
116
+ 'ProtocolDecl': SwiftNodeKind.Protocol,
117
+ 'EnumDecl': SwiftNodeKind.Enum,
118
+ 'FunctionDecl': SwiftNodeKind.Function,
119
+ 'FuncDecl': SwiftNodeKind.Function,
120
+ 'VariableDecl': SwiftNodeKind.Variable,
121
+ 'ImportDecl': SwiftNodeKind.Import
122
+ };
123
+ return mapping[nodeType] || SwiftNodeKind.Unknown;
124
+ }
125
+ /**
126
+ * 從節點提取屬性(@Published, @State 等)
127
+ */
128
+ extractAttributes(node) {
129
+ // 從 properties 或子節點中提取屬性
130
+ if (node.properties?.attributes) {
131
+ return node.properties.attributes.split(',').map((a) => a.trim());
132
+ }
133
+ return [];
134
+ }
135
+ /**
136
+ * 從節點提取修飾符(public, private 等)
137
+ */
138
+ extractModifiers(node) {
139
+ // 從 properties 或子節點中提取修飾符
140
+ if (node.properties?.modifiers) {
141
+ return node.properties.modifiers.split(' ').filter((m) => m.length > 0);
142
+ }
143
+ return [];
144
+ }
145
+ /**
146
+ * 提取符號
147
+ */
148
+ async extractSymbols(ast) {
149
+ const typedAst = ast;
150
+ return await this.symbolExtractor.extractSymbols(typedAst);
151
+ }
152
+ /**
153
+ * 查找符號引用
154
+ * 在當前 AST 中查找所有對指定符號的引用
155
+ */
156
+ async findReferences(ast, symbol) {
157
+ const typedAst = ast;
158
+ const references = [];
159
+ // 遍歷 AST 尋找匹配的識別符
160
+ this.findReferencesInNode(typedAst.root, symbol.name, typedAst.sourceFile, references, symbol);
161
+ return references;
162
+ }
163
+ /**
164
+ * 提取依賴關係
165
+ */
166
+ async extractDependencies(ast) {
167
+ const typedAst = ast;
168
+ return await this.dependencyAnalyzer.extractDependencies(typedAst);
169
+ }
170
+ /**
171
+ * 重新命名符號
172
+ */
173
+ async rename(ast, position, newName) {
174
+ this.validateRenameInput(newName);
175
+ // 查找位置上的符號
176
+ const symbol = await this.findSymbolAtPosition(ast, position);
177
+ if (!symbol) {
178
+ throw new Error('在指定位置找不到符號');
179
+ }
180
+ // 查找所有引用
181
+ const references = await this.findReferences(ast, symbol);
182
+ // 建立編輯操作
183
+ const edits = [];
184
+ for (const reference of references) {
185
+ const edit = createCodeEdit(reference.location.filePath, reference.location.range, newName, 'rename');
186
+ edits.push(edit);
187
+ }
188
+ return edits;
189
+ }
190
+ /**
191
+ * 提取函式重構
192
+ */
193
+ async extractFunction(_ast, _selection) {
194
+ throw new Error('提取函式重構尚未實作');
195
+ }
196
+ /**
197
+ * 查找定義
198
+ */
199
+ async findDefinition(ast, position) {
200
+ const symbol = await this.findSymbolAtPosition(ast, position);
201
+ if (!symbol) {
202
+ return null;
203
+ }
204
+ return createDefinition(symbol.location, this.symbolTypeToDefinitionKind(symbol.type));
205
+ }
206
+ /**
207
+ * 查找使用位置
208
+ */
209
+ async findUsages(ast, symbol) {
210
+ const references = await this.findReferences(ast, symbol);
211
+ return references
212
+ .filter(ref => ref.type === ReferenceType.Usage)
213
+ .map(ref => createUsage(ref.location, 'reference'));
214
+ }
215
+ /**
216
+ * 驗證插件狀態
217
+ */
218
+ async validate() {
219
+ try {
220
+ // 檢查 Swift CLI Bridge 是否可用
221
+ const { stdout } = await execAsync(`command -v ${this.cliPath}`);
222
+ if (!stdout) {
223
+ return createValidationFailure([{
224
+ code: 'SWIFT_CLI_UNAVAILABLE',
225
+ message: 'Swift CLI Bridge 不可用',
226
+ location: {
227
+ filePath: '',
228
+ range: {
229
+ start: { line: 0, column: 0, offset: 0 },
230
+ end: { line: 0, column: 0, offset: 0 }
231
+ }
232
+ }
233
+ }]);
234
+ }
235
+ return createValidationSuccess();
236
+ }
237
+ catch (error) {
238
+ // CLI Bridge 尚未實作,暫時返回成功
239
+ return createValidationSuccess();
240
+ }
241
+ }
242
+ /**
243
+ * 清理資源
244
+ */
245
+ async dispose() {
246
+ // 清理資源
247
+ this.symbolExtractor = null;
248
+ this.dependencyAnalyzer = null;
249
+ }
250
+ // ===== 9 個分析方法 =====
251
+ /**
252
+ * 檢測未使用的符號
253
+ */
254
+ async detectUnusedSymbols(ast, allSymbols) {
255
+ const unusedCodes = [];
256
+ for (const symbol of allSymbols) {
257
+ const references = await this.findReferences(ast, symbol);
258
+ // 只有定義但沒有使用的符號
259
+ const usages = references.filter(ref => ref.type === ReferenceType.Usage);
260
+ if (usages.length === 0) {
261
+ unusedCodes.push({
262
+ type: symbol.type === SymbolType.Function ? 'function' :
263
+ symbol.type === SymbolType.Class ? 'class' : 'variable',
264
+ name: symbol.name,
265
+ location: {
266
+ filePath: symbol.location.filePath,
267
+ line: symbol.location.range.start.line,
268
+ column: symbol.location.range.start.column
269
+ },
270
+ confidence: 0.9,
271
+ reason: `符號 "${symbol.name}" 已定義但從未使用`
272
+ });
273
+ }
274
+ }
275
+ return unusedCodes;
276
+ }
277
+ /**
278
+ * 分析程式碼複雜度
279
+ */
280
+ async analyzeComplexity(code, _ast) {
281
+ const lines = code.split('\n');
282
+ const complexity = this.calculateCyclomaticComplexity(code);
283
+ return {
284
+ cyclomaticComplexity: complexity,
285
+ cognitiveComplexity: Math.floor(complexity * 1.2),
286
+ evaluation: complexity > 20 ? 'very-complex' :
287
+ complexity > 10 ? 'complex' :
288
+ complexity > 5 ? 'moderate' : 'simple',
289
+ functionCount: (code.match(/\bfunc\b/g) || []).length,
290
+ averageComplexity: complexity / Math.max(1, (code.match(/\bfunc\b/g) || []).length),
291
+ maxComplexity: complexity,
292
+ maxComplexityFunction: undefined
293
+ };
294
+ }
295
+ /**
296
+ * 提取程式碼片段(用於重複代碼檢測)
297
+ */
298
+ async extractCodeFragments(code, filePath) {
299
+ const fragments = [];
300
+ const lines = code.split('\n');
301
+ // 提取方法片段
302
+ for (let i = 0; i < lines.length; i++) {
303
+ const line = lines[i];
304
+ if (/func\s+\w+/.test(line)) {
305
+ let braceCount = (line.match(/{/g) || []).length;
306
+ let endLine = i;
307
+ for (let j = i + 1; j < lines.length && braceCount > 0; j++) {
308
+ braceCount += (lines[j].match(/{/g) || []).length;
309
+ braceCount -= (lines[j].match(/}/g) || []).length;
310
+ endLine = j;
311
+ }
312
+ if (endLine > i && endLine - i + 1 >= 3) {
313
+ const methodCode = lines.slice(i, endLine + 1).join('\n');
314
+ const { createHash } = await import('crypto');
315
+ fragments.push({
316
+ type: 'method',
317
+ code: methodCode,
318
+ tokens: methodCode.split(/\s+/).filter(t => t.length > 0),
319
+ location: { filePath, startLine: i + 1, endLine: endLine + 1 },
320
+ hash: createHash('md5').update(methodCode).digest('hex')
321
+ });
322
+ }
323
+ }
324
+ }
325
+ return fragments;
326
+ }
327
+ /**
328
+ * 檢測樣板模式
329
+ */
330
+ async detectPatterns(_code, _ast) {
331
+ // Swift 特定模式檢測(如 guard let、if let 等)
332
+ return [];
333
+ }
334
+ /**
335
+ * 檢查型別安全問題
336
+ */
337
+ async checkTypeSafety(code, ast) {
338
+ const issues = [];
339
+ const lines = code.split('\n');
340
+ for (let i = 0; i < lines.length; i++) {
341
+ const line = lines[i];
342
+ // 檢測 as! 強制轉型
343
+ if (/as!\s+/.test(line)) {
344
+ issues.push({
345
+ type: 'unsafe-cast',
346
+ location: { filePath: ast.sourceFile, line: i + 1, column: 0 },
347
+ message: '使用了 as! 強制轉型,可能導致運行時崩潰',
348
+ severity: 'error'
349
+ });
350
+ }
351
+ // 檢測強制解包 !
352
+ if (/\w+!/.test(line) && !/if\s+let|guard\s+let/.test(line)) {
353
+ issues.push({
354
+ type: 'unsafe-cast',
355
+ location: { filePath: ast.sourceFile, line: i + 1, column: 0 },
356
+ message: '使用了強制解包 !,建議使用 if let 或 guard let',
357
+ severity: 'warning'
358
+ });
359
+ }
360
+ }
361
+ return issues;
362
+ }
363
+ /**
364
+ * 檢查錯誤處理問題
365
+ */
366
+ async checkErrorHandling(code, ast) {
367
+ const issues = [];
368
+ const lines = code.split('\n');
369
+ for (let i = 0; i < lines.length; i++) {
370
+ const line = lines[i];
371
+ // 檢測空 catch 區塊
372
+ if (/catch\s*\{?\s*\}/.test(line)) {
373
+ issues.push({
374
+ type: 'empty-catch',
375
+ location: { filePath: ast.sourceFile, line: i + 1, column: 0 },
376
+ message: '空的 catch 區塊,應該處理錯誤',
377
+ severity: 'warning'
378
+ });
379
+ }
380
+ // 檢測 try? 靜默錯誤
381
+ if (/try\?/.test(line)) {
382
+ issues.push({
383
+ type: 'silent-error',
384
+ location: { filePath: ast.sourceFile, line: i + 1, column: 0 },
385
+ message: '使用 try? 靜默錯誤,建議使用 do-catch 處理',
386
+ severity: 'warning'
387
+ });
388
+ }
389
+ }
390
+ return issues;
391
+ }
392
+ /**
393
+ * 檢查安全性問題
394
+ */
395
+ async checkSecurity(code, ast) {
396
+ const issues = [];
397
+ const lines = code.split('\n');
398
+ for (let i = 0; i < lines.length; i++) {
399
+ const line = lines[i];
400
+ // 檢測硬編碼密碼
401
+ if (/(password|apiKey|token|secret)\s*=\s*"[^"]{3,}"/.test(line) &&
402
+ !/ProcessInfo/.test(line)) {
403
+ issues.push({
404
+ type: 'hardcoded-secret',
405
+ location: { filePath: ast.sourceFile, line: i + 1, column: 0 },
406
+ message: '硬編碼的密碼或密鑰,應使用 Keychain 或環境變數',
407
+ severity: 'critical'
408
+ });
409
+ }
410
+ }
411
+ return issues;
412
+ }
413
+ /**
414
+ * 檢查命名規範問題
415
+ */
416
+ async checkNamingConventions(symbols, filePath) {
417
+ const issues = [];
418
+ for (const symbol of symbols) {
419
+ // Swift 規範:變數和函式用 camelCase
420
+ if (symbol.type === SymbolType.Variable ||
421
+ symbol.type === SymbolType.Function) {
422
+ if (/^[A-Z]/.test(symbol.name)) {
423
+ issues.push({
424
+ type: 'invalid-naming',
425
+ symbolName: symbol.name,
426
+ symbolType: symbol.type,
427
+ location: {
428
+ filePath,
429
+ line: symbol.location.range.start.line,
430
+ column: symbol.location.range.start.column
431
+ },
432
+ message: `變數/函式 "${symbol.name}" 應使用 camelCase 命名`
433
+ });
434
+ }
435
+ }
436
+ // Swift 規範:類別和協定用 PascalCase
437
+ if (symbol.type === SymbolType.Class ||
438
+ symbol.type === SymbolType.Interface) {
439
+ if (!/^[A-Z]/.test(symbol.name)) {
440
+ issues.push({
441
+ type: 'invalid-naming',
442
+ symbolName: symbol.name,
443
+ symbolType: symbol.type,
444
+ location: {
445
+ filePath,
446
+ line: symbol.location.range.start.line,
447
+ column: symbol.location.range.start.column
448
+ },
449
+ message: `類別/協定 "${symbol.name}" 應使用 PascalCase 命名`
450
+ });
451
+ }
452
+ }
453
+ // 檢測底線開頭變數(Swift 不建議)
454
+ if (symbol.name.startsWith('_')) {
455
+ issues.push({
456
+ type: 'invalid-naming',
457
+ symbolName: symbol.name,
458
+ symbolType: symbol.type,
459
+ location: {
460
+ filePath,
461
+ line: symbol.location.range.start.line,
462
+ column: symbol.location.range.start.column
463
+ },
464
+ message: `符號 "${symbol.name}" 以底線開頭,違反 Swift 命名規範`
465
+ });
466
+ }
467
+ }
468
+ return issues;
469
+ }
470
+ /**
471
+ * 判斷檔案是否為測試檔案
472
+ */
473
+ isTestFile(filePath) {
474
+ return /Tests\.swift$/.test(filePath) || filePath.includes('/Tests/');
475
+ }
476
+ // ===== 可選方法 =====
477
+ /**
478
+ * 獲取 Swift 特定的排除模式
479
+ */
480
+ getDefaultExcludePatterns() {
481
+ return [
482
+ '.build/**',
483
+ 'DerivedData/**',
484
+ '**/*Tests.swift',
485
+ '**/Tests/**',
486
+ '*.xcodeproj/**',
487
+ '*.xcworkspace/**',
488
+ 'Pods/**',
489
+ 'Carthage/**'
490
+ ];
491
+ }
492
+ /**
493
+ * 判斷是否應該忽略特定檔案
494
+ */
495
+ shouldIgnoreFile(filePath) {
496
+ const patterns = this.getDefaultExcludePatterns();
497
+ return patterns.some(pattern => {
498
+ const regex = new RegExp(pattern.replace(/\*\*/g, '.*').replace(/\*/g, '[^/]*'));
499
+ return regex.test(filePath);
500
+ });
501
+ }
502
+ /**
503
+ * 判斷符號是否為抽象宣告
504
+ */
505
+ isAbstractDeclaration(symbol) {
506
+ const abstractTypes = [
507
+ SymbolType.Class,
508
+ SymbolType.Struct,
509
+ SymbolType.Protocol,
510
+ SymbolType.Interface, // 保留以兼容舊程式碼
511
+ SymbolType.Type, // typealias
512
+ SymbolType.Enum
513
+ ];
514
+ return abstractTypes.includes(symbol.type);
515
+ }
516
+ // ===== 私有輔助方法 =====
517
+ validateInput(code, filePath) {
518
+ if (!code.trim()) {
519
+ throw new Error('程式碼內容不能為空');
520
+ }
521
+ if (!filePath.trim()) {
522
+ throw new Error('檔案路徑不能為空');
523
+ }
524
+ }
525
+ validateRenameInput(newName) {
526
+ if (!newName.trim()) {
527
+ throw new Error('新名稱不能為空');
528
+ }
529
+ if (!isValidIdentifier(newName)) {
530
+ throw new Error('新名稱必須是有效的 Swift 識別符');
531
+ }
532
+ }
533
+ /**
534
+ * 模擬解析(實際需要呼叫 CLI Bridge)
535
+ */
536
+ mockParse(code) {
537
+ return createSwiftASTNode(SwiftNodeKind.SourceFile, code);
538
+ }
539
+ /**
540
+ * 在節點中遞歸查找引用
541
+ */
542
+ findReferencesInNode(node, symbolName, filePath, references, symbol) {
543
+ // 檢查當前節點名稱
544
+ const nodeName = getNodeName(node);
545
+ if (nodeName === symbolName) {
546
+ // 使用節點的 range 資訊(如果有)
547
+ const range = node.range || {
548
+ start: { line: 1, column: 1, offset: 0 },
549
+ end: { line: 1, column: 1, offset: 0 }
550
+ };
551
+ references.push({
552
+ symbol,
553
+ location: {
554
+ filePath,
555
+ range
556
+ },
557
+ type: ReferenceType.Usage
558
+ });
559
+ }
560
+ // 檢查節點的 source code 是否包含符號(用於捕捉類型引用等)
561
+ // 例如:`let user: User` 中的 User 可能不是獨立節點
562
+ if (node.source) {
563
+ const regex = new RegExp(`\\b${this.escapeRegex(symbolName)}\\b`, 'g');
564
+ let match;
565
+ while ((match = regex.exec(node.source)) !== null) {
566
+ // 確保不重複添加(如果已經透過 nodeName 匹配到)
567
+ if (nodeName !== symbolName) {
568
+ const range = node.range || {
569
+ start: { line: 1, column: match.index + 1, offset: 0 },
570
+ end: { line: 1, column: match.index + symbolName.length + 1, offset: 0 }
571
+ };
572
+ references.push({
573
+ symbol,
574
+ location: {
575
+ filePath,
576
+ range
577
+ },
578
+ type: ReferenceType.Usage
579
+ });
580
+ }
581
+ }
582
+ }
583
+ // 遞歸處理子節點
584
+ if (node.children) {
585
+ for (const child of node.children) {
586
+ this.findReferencesInNode(child, symbolName, filePath, references, symbol);
587
+ }
588
+ }
589
+ }
590
+ /**
591
+ * 逸出正則表達式特殊字符
592
+ */
593
+ escapeRegex(text) {
594
+ return text.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
595
+ }
596
+ /**
597
+ * 查找指定位置的符號
598
+ */
599
+ async findSymbolAtPosition(ast, position) {
600
+ const symbols = await this.extractSymbols(ast);
601
+ // 簡化實作:返回第一個符號
602
+ return symbols[0] || null;
603
+ }
604
+ /**
605
+ * 計算圈複雜度
606
+ */
607
+ calculateCyclomaticComplexity(code) {
608
+ let complexity = 1;
609
+ // 計算控制流關鍵字(單詞類)
610
+ const wordKeywords = ['if', 'else', 'for', 'while', 'guard', 'switch', 'case'];
611
+ for (const keyword of wordKeywords) {
612
+ const regex = new RegExp(`\\b${keyword}\\b`, 'g');
613
+ const matches = code.match(regex);
614
+ if (matches) {
615
+ complexity += matches.length;
616
+ }
617
+ }
618
+ // 計算邏輯運算子(需要轉義特殊字元)
619
+ const operators = [
620
+ { pattern: '&&', name: 'logical-and' },
621
+ { pattern: '||', name: 'logical-or' },
622
+ { pattern: '?', name: 'ternary' }
623
+ ];
624
+ for (const op of operators) {
625
+ const escapedPattern = op.pattern.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
626
+ const regex = new RegExp(escapedPattern, 'g');
627
+ const matches = code.match(regex);
628
+ if (matches) {
629
+ complexity += matches.length;
630
+ }
631
+ }
632
+ return complexity;
633
+ }
634
+ /**
635
+ * SymbolType 轉換為 DefinitionKind
636
+ */
637
+ symbolTypeToDefinitionKind(symbolType) {
638
+ switch (symbolType) {
639
+ case SymbolType.Class:
640
+ return 'class';
641
+ case SymbolType.Struct:
642
+ return 'struct';
643
+ case SymbolType.Protocol:
644
+ return 'protocol';
645
+ case SymbolType.Interface:
646
+ return 'interface';
647
+ case SymbolType.Function:
648
+ return 'function';
649
+ case SymbolType.Variable:
650
+ return 'variable';
651
+ case SymbolType.Property:
652
+ return 'property';
653
+ case SymbolType.Constant:
654
+ return 'constant';
655
+ case SymbolType.Type:
656
+ return 'type';
657
+ case SymbolType.Enum:
658
+ return 'enum';
659
+ default:
660
+ return 'variable';
661
+ }
662
+ }
663
+ }
664
+ /**
665
+ * 建立 Swift Parser 實例
666
+ */
667
+ export function createSwiftParser(cliPath) {
668
+ return new SwiftParser(cliPath);
669
+ }
670
+ //# sourceMappingURL=parser.js.map