@stylelint/language-server 1.0.0

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 (334) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +39 -0
  3. package/bin/stylelint-language-server.mjs +25 -0
  4. package/build/di/container.d.ts +12 -0
  5. package/build/di/container.js +76 -0
  6. package/build/di/container.js.map +1 -0
  7. package/build/di/hooks.d.ts +16 -0
  8. package/build/di/hooks.js +25 -0
  9. package/build/di/hooks.js.map +1 -0
  10. package/build/di/index.d.ts +7 -0
  11. package/build/di/index.js +8 -0
  12. package/build/di/index.js.map +1 -0
  13. package/build/di/inject.d.ts +48 -0
  14. package/build/di/inject.js +55 -0
  15. package/build/di/inject.js.map +1 -0
  16. package/build/di/module.d.ts +51 -0
  17. package/build/di/module.js +93 -0
  18. package/build/di/module.js.map +1 -0
  19. package/build/di/runtime/application.d.ts +17 -0
  20. package/build/di/runtime/application.js +209 -0
  21. package/build/di/runtime/application.js.map +1 -0
  22. package/build/di/runtime/decorators.d.ts +14 -0
  23. package/build/di/runtime/decorators.js +26 -0
  24. package/build/di/runtime/decorators.js.map +1 -0
  25. package/build/di/runtime/index.d.ts +3 -0
  26. package/build/di/runtime/index.js +4 -0
  27. package/build/di/runtime/index.js.map +1 -0
  28. package/build/di/runtime/symbols.d.ts +1 -0
  29. package/build/di/runtime/symbols.js +2 -0
  30. package/build/di/runtime/symbols.js.map +1 -0
  31. package/build/di/runtime/types.d.ts +20 -0
  32. package/build/di/runtime/types.js +2 -0
  33. package/build/di/runtime/types.js.map +1 -0
  34. package/build/di/tokens.d.ts +8 -0
  35. package/build/di/tokens.js +7 -0
  36. package/build/di/tokens.js.map +1 -0
  37. package/build/di/types.d.ts +16 -0
  38. package/build/di/types.js +2 -0
  39. package/build/di/types.js.map +1 -0
  40. package/build/server/config/default-options.d.ts +2 -0
  41. package/build/server/config/default-options.js +29 -0
  42. package/build/server/config/default-options.js.map +1 -0
  43. package/build/server/decorators.d.ts +121 -0
  44. package/build/server/decorators.js +272 -0
  45. package/build/server/decorators.js.map +1 -0
  46. package/build/server/index.d.ts +2 -0
  47. package/build/server/index.js +3 -0
  48. package/build/server/index.js.map +1 -0
  49. package/build/server/modules/documents.module.d.ts +1 -0
  50. package/build/server/modules/documents.module.js +12 -0
  51. package/build/server/modules/documents.module.js.map +1 -0
  52. package/build/server/modules/index.d.ts +6 -0
  53. package/build/server/modules/index.js +7 -0
  54. package/build/server/modules/index.js.map +1 -0
  55. package/build/server/modules/infrastructure.module.d.ts +1 -0
  56. package/build/server/modules/infrastructure.module.js +7 -0
  57. package/build/server/modules/infrastructure.module.js.map +1 -0
  58. package/build/server/modules/lsp.module.d.ts +1 -0
  59. package/build/server/modules/lsp.module.js +18 -0
  60. package/build/server/modules/lsp.module.js.map +1 -0
  61. package/build/server/modules/platform.module.d.ts +4 -0
  62. package/build/server/modules/platform.module.js +33 -0
  63. package/build/server/modules/platform.module.js.map +1 -0
  64. package/build/server/modules/stylelint-runtime.module.d.ts +1 -0
  65. package/build/server/modules/stylelint-runtime.module.js +19 -0
  66. package/build/server/modules/stylelint-runtime.module.js.map +1 -0
  67. package/build/server/modules/workspace.module.d.ts +1 -0
  68. package/build/server/modules/workspace.module.js +7 -0
  69. package/build/server/modules/workspace.module.js.map +1 -0
  70. package/build/server/runtime/application.d.ts +19 -0
  71. package/build/server/runtime/application.js +22 -0
  72. package/build/server/runtime/application.js.map +1 -0
  73. package/build/server/runtime/language-server-feature.d.ts +13 -0
  74. package/build/server/runtime/language-server-feature.js +142 -0
  75. package/build/server/runtime/language-server-feature.js.map +1 -0
  76. package/build/server/runtime/lsp-service-runtime.d.ts +15 -0
  77. package/build/server/runtime/lsp-service-runtime.js +133 -0
  78. package/build/server/runtime/lsp-service-runtime.js.map +1 -0
  79. package/build/server/server.d.ts +13 -0
  80. package/build/server/server.js +38 -0
  81. package/build/server/server.js.map +1 -0
  82. package/build/server/server.module.d.ts +1 -0
  83. package/build/server/server.module.js +13 -0
  84. package/build/server/server.module.js.map +1 -0
  85. package/build/server/services/documents/document-diagnostics.service.d.ts +15 -0
  86. package/build/server/services/documents/document-diagnostics.service.js +88 -0
  87. package/build/server/services/documents/document-diagnostics.service.js.map +1 -0
  88. package/build/server/services/documents/document-fixes.service.d.ts +14 -0
  89. package/build/server/services/documents/document-fixes.service.js +94 -0
  90. package/build/server/services/documents/document-fixes.service.js.map +1 -0
  91. package/build/server/services/documents/index.d.ts +2 -0
  92. package/build/server/services/documents/index.js +3 -0
  93. package/build/server/services/documents/index.js.map +1 -0
  94. package/build/server/services/index.d.ts +5 -0
  95. package/build/server/services/index.js +6 -0
  96. package/build/server/services/index.js.map +1 -0
  97. package/build/server/services/infrastructure/command.service.d.ts +22 -0
  98. package/build/server/services/infrastructure/command.service.js +151 -0
  99. package/build/server/services/infrastructure/command.service.js.map +1 -0
  100. package/build/server/services/infrastructure/index.d.ts +4 -0
  101. package/build/server/services/infrastructure/index.js +5 -0
  102. package/build/server/services/infrastructure/index.js.map +1 -0
  103. package/build/server/services/infrastructure/logging.service.d.ts +6 -0
  104. package/build/server/services/infrastructure/logging.service.js +4 -0
  105. package/build/server/services/infrastructure/logging.service.js.map +1 -0
  106. package/build/server/services/infrastructure/notification.service.d.ts +24 -0
  107. package/build/server/services/infrastructure/notification.service.js +142 -0
  108. package/build/server/services/infrastructure/notification.service.js.map +1 -0
  109. package/build/server/services/infrastructure/winston-logging.service.d.ts +10 -0
  110. package/build/server/services/infrastructure/winston-logging.service.js +48 -0
  111. package/build/server/services/infrastructure/winston-logging.service.js.map +1 -0
  112. package/build/server/services/lsp/auto-fix.service.d.ts +15 -0
  113. package/build/server/services/lsp/auto-fix.service.js +142 -0
  114. package/build/server/services/lsp/auto-fix.service.js.map +1 -0
  115. package/build/server/services/lsp/code-actions/code-action.service.d.ts +18 -0
  116. package/build/server/services/lsp/code-actions/code-action.service.js +288 -0
  117. package/build/server/services/lsp/code-actions/code-action.service.js.map +1 -0
  118. package/build/server/services/lsp/code-actions/disable-rule-file-code-action.service.d.ts +11 -0
  119. package/build/server/services/lsp/code-actions/disable-rule-file-code-action.service.js +72 -0
  120. package/build/server/services/lsp/code-actions/disable-rule-file-code-action.service.js.map +1 -0
  121. package/build/server/services/lsp/code-actions/disable-rule-line-code-action.service.d.ts +12 -0
  122. package/build/server/services/lsp/code-actions/disable-rule-line-code-action.service.js +80 -0
  123. package/build/server/services/lsp/code-actions/disable-rule-line-code-action.service.js.map +1 -0
  124. package/build/server/services/lsp/code-actions/index.d.ts +3 -0
  125. package/build/server/services/lsp/code-actions/index.js +4 -0
  126. package/build/server/services/lsp/code-actions/index.js.map +1 -0
  127. package/build/server/services/lsp/completion.service.d.ts +12 -0
  128. package/build/server/services/lsp/completion.service.js +183 -0
  129. package/build/server/services/lsp/completion.service.js.map +1 -0
  130. package/build/server/services/lsp/empty-config-warning.service.d.ts +17 -0
  131. package/build/server/services/lsp/empty-config-warning.service.js +149 -0
  132. package/build/server/services/lsp/empty-config-warning.service.js.map +1 -0
  133. package/build/server/services/lsp/formatter.service.d.ts +16 -0
  134. package/build/server/services/lsp/formatter.service.js +215 -0
  135. package/build/server/services/lsp/formatter.service.js.map +1 -0
  136. package/build/server/services/lsp/index.d.ts +8 -0
  137. package/build/server/services/lsp/index.js +9 -0
  138. package/build/server/services/lsp/index.js.map +1 -0
  139. package/build/server/services/lsp/old-stylelint-warning.service.d.ts +13 -0
  140. package/build/server/services/lsp/old-stylelint-warning.service.js +186 -0
  141. package/build/server/services/lsp/old-stylelint-warning.service.js.map +1 -0
  142. package/build/server/services/lsp/validator.service.d.ts +19 -0
  143. package/build/server/services/lsp/validator.service.js +273 -0
  144. package/build/server/services/lsp/validator.service.js.map +1 -0
  145. package/build/server/services/lsp/workspace-activity.service.d.ts +10 -0
  146. package/build/server/services/lsp/workspace-activity.service.js +76 -0
  147. package/build/server/services/lsp/workspace-activity.service.js.map +1 -0
  148. package/build/server/services/services.module.d.ts +1 -0
  149. package/build/server/services/services.module.js +19 -0
  150. package/build/server/services/services.module.js.map +1 -0
  151. package/build/server/services/stylelint-runtime/global-path-resolver.service.d.ts +38 -0
  152. package/build/server/services/stylelint-runtime/global-path-resolver.service.js +223 -0
  153. package/build/server/services/stylelint-runtime/global-path-resolver.service.js.map +1 -0
  154. package/build/server/services/stylelint-runtime/index.d.ts +11 -0
  155. package/build/server/services/stylelint-runtime/index.js +12 -0
  156. package/build/server/services/stylelint-runtime/index.js.map +1 -0
  157. package/build/server/services/stylelint-runtime/package-root-cache.service.d.ts +9 -0
  158. package/build/server/services/stylelint-runtime/package-root-cache.service.js +141 -0
  159. package/build/server/services/stylelint-runtime/package-root-cache.service.js.map +1 -0
  160. package/build/server/services/stylelint-runtime/package-root.service.d.ts +8 -0
  161. package/build/server/services/stylelint-runtime/package-root.service.js +119 -0
  162. package/build/server/services/stylelint-runtime/package-root.service.js.map +1 -0
  163. package/build/server/services/stylelint-runtime/pnp-configuration-cache.service.d.ts +16 -0
  164. package/build/server/services/stylelint-runtime/pnp-configuration-cache.service.js +195 -0
  165. package/build/server/services/stylelint-runtime/pnp-configuration-cache.service.js.map +1 -0
  166. package/build/server/services/stylelint-runtime/process-runner.service.d.ts +30 -0
  167. package/build/server/services/stylelint-runtime/process-runner.service.js +149 -0
  168. package/build/server/services/stylelint-runtime/process-runner.service.js.map +1 -0
  169. package/build/server/services/stylelint-runtime/stylelint-options.service.d.ts +12 -0
  170. package/build/server/services/stylelint-runtime/stylelint-options.service.js +185 -0
  171. package/build/server/services/stylelint-runtime/stylelint-options.service.js.map +1 -0
  172. package/build/server/services/stylelint-runtime/stylelint-runner.service.d.ts +42 -0
  173. package/build/server/services/stylelint-runtime/stylelint-runner.service.js +478 -0
  174. package/build/server/services/stylelint-runtime/stylelint-runner.service.js.map +1 -0
  175. package/build/server/services/stylelint-runtime/worker-environment.service.d.ts +17 -0
  176. package/build/server/services/stylelint-runtime/worker-environment.service.js +135 -0
  177. package/build/server/services/stylelint-runtime/worker-environment.service.js.map +1 -0
  178. package/build/server/services/stylelint-runtime/worker-process.service.d.ts +8 -0
  179. package/build/server/services/stylelint-runtime/worker-process.service.js +66 -0
  180. package/build/server/services/stylelint-runtime/worker-process.service.js.map +1 -0
  181. package/build/server/services/stylelint-runtime/worker-registry.service.d.ts +19 -0
  182. package/build/server/services/stylelint-runtime/worker-registry.service.js +289 -0
  183. package/build/server/services/stylelint-runtime/worker-registry.service.js.map +1 -0
  184. package/build/server/services/stylelint-runtime/workspace-stylelint.service.d.ts +37 -0
  185. package/build/server/services/stylelint-runtime/workspace-stylelint.service.js +185 -0
  186. package/build/server/services/stylelint-runtime/workspace-stylelint.service.js.map +1 -0
  187. package/build/server/services/workspace/index.d.ts +2 -0
  188. package/build/server/services/workspace/index.js +3 -0
  189. package/build/server/services/workspace/index.js.map +1 -0
  190. package/build/server/services/workspace/workspace-folder.service.d.ts +18 -0
  191. package/build/server/services/workspace/workspace-folder.service.js +101 -0
  192. package/build/server/services/workspace/workspace-folder.service.js.map +1 -0
  193. package/build/server/services/workspace/workspace-options.service.d.ts +12 -0
  194. package/build/server/services/workspace/workspace-options.service.js +125 -0
  195. package/build/server/services/workspace/workspace-options.service.js.map +1 -0
  196. package/build/server/stylelint/disable-metadata-lookup-table.d.ts +20 -0
  197. package/build/server/stylelint/disable-metadata-lookup-table.js +68 -0
  198. package/build/server/stylelint/disable-metadata-lookup-table.js.map +1 -0
  199. package/build/server/stylelint/formatting-options-to-rules.d.ts +12 -0
  200. package/build/server/stylelint/formatting-options-to-rules.js +19 -0
  201. package/build/server/stylelint/formatting-options-to-rules.js.map +1 -0
  202. package/build/server/stylelint/get-disable-diagnostic-rule.d.ts +7 -0
  203. package/build/server/stylelint/get-disable-diagnostic-rule.js +22 -0
  204. package/build/server/stylelint/get-disable-diagnostic-rule.js.map +1 -0
  205. package/build/server/stylelint/index.d.ts +7 -0
  206. package/build/server/stylelint/index.js +8 -0
  207. package/build/server/stylelint/index.js.map +1 -0
  208. package/build/server/stylelint/is-disable-report-rule.d.ts +6 -0
  209. package/build/server/stylelint/is-disable-report-rule.js +17 -0
  210. package/build/server/stylelint/is-disable-report-rule.js.map +1 -0
  211. package/build/server/stylelint/load-stylelint.d.ts +23 -0
  212. package/build/server/stylelint/load-stylelint.js +173 -0
  213. package/build/server/stylelint/load-stylelint.js.map +1 -0
  214. package/build/server/stylelint/process-linter-result.d.ts +32 -0
  215. package/build/server/stylelint/process-linter-result.js +129 -0
  216. package/build/server/stylelint/process-linter-result.js.map +1 -0
  217. package/build/server/stylelint/types.d.ts +143 -0
  218. package/build/server/stylelint/types.js +47 -0
  219. package/build/server/stylelint/types.js.map +1 -0
  220. package/build/server/stylelint/warning-to-diagnostic.d.ts +46 -0
  221. package/build/server/stylelint/warning-to-diagnostic.js +143 -0
  222. package/build/server/stylelint/warning-to-diagnostic.js.map +1 -0
  223. package/build/server/tokens.d.ts +20 -0
  224. package/build/server/tokens.js +16 -0
  225. package/build/server/tokens.js.map +1 -0
  226. package/build/server/types.d.ts +74 -0
  227. package/build/server/types.js +18 -0
  228. package/build/server/types.js.map +1 -0
  229. package/build/server/utils/documents/create-text-edits.d.ts +10 -0
  230. package/build/server/utils/documents/create-text-edits.js +31 -0
  231. package/build/server/utils/documents/create-text-edits.js.map +1 -0
  232. package/build/server/utils/documents/get-disable-type.d.ts +26 -0
  233. package/build/server/utils/documents/get-disable-type.js +32 -0
  234. package/build/server/utils/documents/get-disable-type.js.map +1 -0
  235. package/build/server/utils/documents/get-edit-info.d.ts +14 -0
  236. package/build/server/utils/documents/get-edit-info.js +31 -0
  237. package/build/server/utils/documents/get-edit-info.js.map +1 -0
  238. package/build/server/utils/documents/get-fixes.d.ts +12 -0
  239. package/build/server/utils/documents/get-fixes.js +18 -0
  240. package/build/server/utils/documents/get-fixes.js.map +1 -0
  241. package/build/server/utils/documents/index.d.ts +4 -0
  242. package/build/server/utils/documents/index.js +5 -0
  243. package/build/server/utils/documents/index.js.map +1 -0
  244. package/build/server/utils/errors.d.ts +10 -0
  245. package/build/server/utils/errors.js +89 -0
  246. package/build/server/utils/errors.js.map +1 -0
  247. package/build/server/utils/fs.d.ts +4 -0
  248. package/build/server/utils/fs.js +11 -0
  249. package/build/server/utils/fs.js.map +1 -0
  250. package/build/server/utils/functions/get-first-return-value.d.ts +11 -0
  251. package/build/server/utils/functions/get-first-return-value.js +28 -0
  252. package/build/server/utils/functions/get-first-return-value.js.map +1 -0
  253. package/build/server/utils/functions/index.d.ts +2 -0
  254. package/build/server/utils/functions/index.js +3 -0
  255. package/build/server/utils/functions/index.js.map +1 -0
  256. package/build/server/utils/functions/lazy-call.d.ts +12 -0
  257. package/build/server/utils/functions/lazy-call.js +33 -0
  258. package/build/server/utils/functions/lazy-call.js.map +1 -0
  259. package/build/server/utils/index.d.ts +11 -0
  260. package/build/server/utils/index.js +12 -0
  261. package/build/server/utils/index.js.map +1 -0
  262. package/build/server/utils/iterables.d.ts +8 -0
  263. package/build/server/utils/iterables.js +15 -0
  264. package/build/server/utils/iterables.js.map +1 -0
  265. package/build/server/utils/logging/error-formatter.d.ts +7 -0
  266. package/build/server/utils/logging/error-formatter.js +14 -0
  267. package/build/server/utils/logging/error-formatter.js.map +1 -0
  268. package/build/server/utils/logging/get-log-function.d.ts +8 -0
  269. package/build/server/utils/logging/get-log-function.js +11 -0
  270. package/build/server/utils/logging/get-log-function.js.map +1 -0
  271. package/build/server/utils/logging/index.d.ts +4 -0
  272. package/build/server/utils/logging/index.js +5 -0
  273. package/build/server/utils/logging/index.js.map +1 -0
  274. package/build/server/utils/logging/language-server-formatter.d.ts +19 -0
  275. package/build/server/utils/logging/language-server-formatter.js +55 -0
  276. package/build/server/utils/logging/language-server-formatter.js.map +1 -0
  277. package/build/server/utils/logging/language-server-transport.d.ts +19 -0
  278. package/build/server/utils/logging/language-server-transport.js +39 -0
  279. package/build/server/utils/logging/language-server-transport.js.map +1 -0
  280. package/build/server/utils/lsp/create-disable-completion-item.d.ts +7 -0
  281. package/build/server/utils/lsp/create-disable-completion-item.js +32 -0
  282. package/build/server/utils/lsp/create-disable-completion-item.js.map +1 -0
  283. package/build/server/utils/lsp/display-error.d.ts +7 -0
  284. package/build/server/utils/lsp/display-error.js +24 -0
  285. package/build/server/utils/lsp/display-error.js.map +1 -0
  286. package/build/server/utils/lsp/index.d.ts +4 -0
  287. package/build/server/utils/lsp/index.js +5 -0
  288. package/build/server/utils/lsp/index.js.map +1 -0
  289. package/build/server/utils/lsp/rule-code-actions-collection.d.ts +29 -0
  290. package/build/server/utils/lsp/rule-code-actions-collection.js +61 -0
  291. package/build/server/utils/lsp/rule-code-actions-collection.js.map +1 -0
  292. package/build/server/utils/lsp/types.d.ts +22 -0
  293. package/build/server/utils/lsp/types.js +2 -0
  294. package/build/server/utils/lsp/types.js.map +1 -0
  295. package/build/server/utils/objects/index.d.ts +3 -0
  296. package/build/server/utils/objects/index.js +4 -0
  297. package/build/server/utils/objects/index.js.map +1 -0
  298. package/build/server/utils/objects/is-object.d.ts +8 -0
  299. package/build/server/utils/objects/is-object.js +13 -0
  300. package/build/server/utils/objects/is-object.js.map +1 -0
  301. package/build/server/utils/objects/merge-assign.d.ts +8 -0
  302. package/build/server/utils/objects/merge-assign.js +38 -0
  303. package/build/server/utils/objects/merge-assign.js.map +1 -0
  304. package/build/server/utils/objects/merge-options-with-defaults.d.ts +5 -0
  305. package/build/server/utils/objects/merge-options-with-defaults.js +56 -0
  306. package/build/server/utils/objects/merge-options-with-defaults.js.map +1 -0
  307. package/build/server/utils/sets.d.ts +6 -0
  308. package/build/server/utils/sets.js +22 -0
  309. package/build/server/utils/sets.js.map +1 -0
  310. package/build/server/utils/strings.d.ts +12 -0
  311. package/build/server/utils/strings.js +20 -0
  312. package/build/server/utils/strings.js.map +1 -0
  313. package/build/server/utils/types.d.ts +27 -0
  314. package/build/server/utils/types.js +2 -0
  315. package/build/server/utils/types.js.map +1 -0
  316. package/build/server/worker/types.d.ts +63 -0
  317. package/build/server/worker/types.js +2 -0
  318. package/build/server/worker/types.js.map +1 -0
  319. package/build/server/worker/worker-entry.d.ts +1 -0
  320. package/build/server/worker/worker-entry.js +320 -0
  321. package/build/server/worker/worker-entry.js.map +1 -0
  322. package/build/server/worker/worker-logging.service.d.ts +18 -0
  323. package/build/server/worker/worker-logging.service.js +61 -0
  324. package/build/server/worker/worker-logging.service.js.map +1 -0
  325. package/build/server/worker/worker-process.d.ts +54 -0
  326. package/build/server/worker/worker-process.js +266 -0
  327. package/build/server/worker/worker-process.js.map +1 -0
  328. package/build/shared/log-level.d.ts +5 -0
  329. package/build/shared/log-level.js +11 -0
  330. package/build/shared/log-level.js.map +1 -0
  331. package/build/shared/types.d.ts +9 -0
  332. package/build/shared/types.js +3 -0
  333. package/build/shared/types.js.map +1 -0
  334. package/package.json +89 -0
@@ -0,0 +1,22 @@
1
+ import type { Connection, Disposable, ServerRequestHandler } from 'vscode-languageserver';
2
+ import * as LSP from 'vscode-languageserver-protocol';
3
+ import { type LoggingService } from './logging.service.js';
4
+ /**
5
+ * Allows registering and executing commands and their handlers by name.
6
+ */
7
+ export declare class CommandService implements Disposable {
8
+ #private;
9
+ /**
10
+ * Instantiates a new command manager.
11
+ */
12
+ constructor(connection: Connection, loggingService: LoggingService);
13
+ dispose(): void;
14
+ /**
15
+ * Registers a handler for a command.
16
+ */
17
+ on(name: string | string[], handler: ServerRequestHandler<LSP.ExecuteCommandParams, unknown, never, void>): Disposable;
18
+ /**
19
+ * Registers the command manager as a request handler.
20
+ */
21
+ register(): void;
22
+ }
@@ -0,0 +1,151 @@
1
+ var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
2
+ function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
3
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
4
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
5
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
6
+ var _, done = false;
7
+ for (var i = decorators.length - 1; i >= 0; i--) {
8
+ var context = {};
9
+ for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
10
+ for (var p in contextIn.access) context.access[p] = contextIn.access[p];
11
+ context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
12
+ var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
13
+ if (kind === "accessor") {
14
+ if (result === void 0) continue;
15
+ if (result === null || typeof result !== "object") throw new TypeError("Object expected");
16
+ if (_ = accept(result.get)) descriptor.get = _;
17
+ if (_ = accept(result.set)) descriptor.set = _;
18
+ if (_ = accept(result.init)) initializers.unshift(_);
19
+ }
20
+ else if (_ = accept(result)) {
21
+ if (kind === "field") initializers.unshift(_);
22
+ else descriptor[key] = _;
23
+ }
24
+ }
25
+ if (target) Object.defineProperty(target, contextIn.name, descriptor);
26
+ done = true;
27
+ };
28
+ var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
29
+ var useValue = arguments.length > 2;
30
+ for (var i = 0; i < initializers.length; i++) {
31
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
32
+ }
33
+ return useValue ? value : void 0;
34
+ };
35
+ import * as LSP from 'vscode-languageserver-protocol';
36
+ import { inject } from '../../../di/index.js';
37
+ import { lspConnectionToken } from '../../tokens.js';
38
+ import { loggingServiceToken } from './logging.service.js';
39
+ /**
40
+ * Allows registering and executing commands and their handlers by name.
41
+ */
42
+ let CommandService = (() => {
43
+ let _classDecorators = [inject({
44
+ inject: [lspConnectionToken, loggingServiceToken],
45
+ })];
46
+ let _classDescriptor;
47
+ let _classExtraInitializers = [];
48
+ let _classThis;
49
+ var CommandService = class {
50
+ static { _classThis = this; }
51
+ static {
52
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
53
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
54
+ CommandService = _classThis = _classDescriptor.value;
55
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
56
+ __runInitializers(_classThis, _classExtraInitializers);
57
+ }
58
+ /**
59
+ * The language server connection.
60
+ */
61
+ #connection;
62
+ /**
63
+ * The logger to use.
64
+ */
65
+ #logger;
66
+ /**
67
+ * Command handlers by command name.
68
+ */
69
+ #commands = new Map();
70
+ /**
71
+ * Instantiates a new command manager.
72
+ */
73
+ constructor(connection, loggingService) {
74
+ this.#connection = connection;
75
+ this.#logger = loggingService.createLogger(CommandService);
76
+ }
77
+ dispose() {
78
+ this.#logger?.debug('Disposing command manager');
79
+ this.#commands.clear();
80
+ this.#connection.onExecuteCommand(() => undefined);
81
+ }
82
+ /**
83
+ * Registers a handler for a command.
84
+ */
85
+ on(name, handler) {
86
+ if (Array.isArray(name)) {
87
+ this.#logger?.debug('Registering commands', { commands: name });
88
+ for (const commandName of name) {
89
+ this.#commands.set(commandName, handler);
90
+ }
91
+ return {
92
+ dispose: () => {
93
+ this.#logger?.debug('Deregistering commands', { commands: name });
94
+ for (const commandName of name) {
95
+ this.#commands.delete(commandName);
96
+ }
97
+ },
98
+ };
99
+ }
100
+ this.#logger?.debug('Registering command', { command: name });
101
+ this.#commands.set(name, handler);
102
+ return {
103
+ dispose: () => {
104
+ this.#logger?.debug('Deregistering command', { command: name });
105
+ this.#commands.delete(name);
106
+ },
107
+ };
108
+ }
109
+ /**
110
+ * Registers the command manager as a request handler.
111
+ */
112
+ register() {
113
+ this.#logger?.debug('Registering ExecuteCommandRequest handler');
114
+ this.#connection.onExecuteCommand(async (...params) => {
115
+ this.#logger?.debug('Received ExecuteCommandRequest', {
116
+ command: params[0].command,
117
+ arguments: params[0].arguments,
118
+ });
119
+ const handler = this.#commands.get(params[0].command);
120
+ if (!handler) {
121
+ this.#logger?.debug('No handler registered for command', {
122
+ command: params[0].command,
123
+ });
124
+ return {};
125
+ }
126
+ this.#logger?.debug('Executing command', {
127
+ command: params[0].command,
128
+ });
129
+ try {
130
+ const response = await handler(...params);
131
+ this.#logger?.debug('Sending command response', {
132
+ command: params[0].command,
133
+ response,
134
+ });
135
+ return response;
136
+ }
137
+ catch (error) {
138
+ this.#logger?.error('Error executing command', {
139
+ command: params[0].command,
140
+ error,
141
+ });
142
+ return new LSP.ResponseError(LSP.ErrorCodes.InternalError, `Error executing command ${params[0].command}`, error);
143
+ }
144
+ });
145
+ this.#logger?.debug('ExecuteCommandRequest handler registered');
146
+ }
147
+ };
148
+ return CommandService = _classThis;
149
+ })();
150
+ export { CommandService };
151
+ //# sourceMappingURL=command.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command.service.js","sourceRoot":"","sources":["../../../../src/server/services/infrastructure/command.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,KAAK,GAAG,MAAM,gCAAgC,CAAC;AAEtD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAuB,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAEhF;;GAEG;IAIU,cAAc;4BAH1B,MAAM,CAAC;YACP,MAAM,EAAE,CAAC,kBAAkB,EAAE,mBAAmB,CAAC;SACjD,CAAC;;;;;;;;YACF,6KA0HC;;;YA1HY,uDAAc;;QAC1B;;WAEG;QACH,WAAW,CAAa;QAExB;;WAEG;QACH,OAAO,CAAkB;QAEzB;;WAEG;QACH,SAAS,GAAG,IAAI,GAAG,EAGhB,CAAC;QAEJ;;WAEG;QACH,YAAY,UAAsB,EAAE,cAA8B;YACjE,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;YAC9B,IAAI,CAAC,OAAO,GAAG,cAAc,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC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C9C,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO;wBAC1B,KAAK;qBACL,CAAC,CAAC;oBAEH,OAAO,IAAI,GAAG,CAAC,aAAa,CAC3B,GAAG,CAAC,UAAU,CAAC,aAAa,EAC5B,2BAA2B,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,EAC9C,KAAK,CACL,CAAC;gBACH,CAAC;YACF,CAAC,CAAC,CAAC;YAEH,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,0CAA0C,CAAC,CAAC;QACjE,CAAC;;;;SAzHW,cAAc"}
@@ -0,0 +1,4 @@
1
+ export * from './command.service.js';
2
+ export * from './logging.service.js';
3
+ export * from './notification.service.js';
4
+ export * from './winston-logging.service.js';
@@ -0,0 +1,5 @@
1
+ export * from './command.service.js';
2
+ export * from './logging.service.js';
3
+ export * from './notification.service.js';
4
+ export * from './winston-logging.service.js';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/server/services/infrastructure/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type winston from 'winston';
2
+ import { type Constructable } from '../../../di/index.js';
3
+ export declare const loggingServiceToken: import("../../../di/tokens.js").Token<LoggingService>;
4
+ export interface LoggingService {
5
+ createLogger(component: Constructable<unknown>): winston.Logger;
6
+ }
@@ -0,0 +1,4 @@
1
+ // @no-unit-test -- Service is only an interface and token definition.
2
+ import { createToken } from '../../../di/index.js';
3
+ export const loggingServiceToken = createToken('LoggingService');
4
+ //# sourceMappingURL=logging.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logging.service.js","sourceRoot":"","sources":["../../../../src/server/services/infrastructure/logging.service.ts"],"names":[],"mappings":"AAAA,sEAAsE;AAGtE,OAAO,EAAsB,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEvE,MAAM,CAAC,MAAM,mBAAmB,GAAG,WAAW,CAAiB,gBAAgB,CAAC,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { Connection, Disposable } from 'vscode-languageserver';
2
+ import * as LSP from 'vscode-languageserver-protocol';
3
+ import { MaybeAsync } from '../../utils/index.js';
4
+ import { type LoggingService } from './logging.service.js';
5
+ /**
6
+ * Allows registering multiple handlers for the same notification type.
7
+ */
8
+ export declare class NotificationService implements Disposable {
9
+ #private;
10
+ /**
11
+ * Instantiates a new notification manager.
12
+ */
13
+ constructor(connection: Connection, loggingService: LoggingService);
14
+ dispose(): void;
15
+ /**
16
+ * Registers a handler for a notification.
17
+ */
18
+ on<R0>(type: LSP.ProtocolNotificationType0<R0>, handler: MaybeAsync<LSP.NotificationHandler0>): Disposable;
19
+ on<P, R0>(type: LSP.ProtocolNotificationType<P, R0>, handler: MaybeAsync<LSP.NotificationHandler<P>>): Disposable;
20
+ on(type: LSP.NotificationType0, handler: MaybeAsync<LSP.NotificationHandler0>): Disposable;
21
+ on<P>(type: LSP.NotificationType<P>, handler: MaybeAsync<LSP.NotificationHandler<P>>): Disposable;
22
+ on(type: string, handler: MaybeAsync<LSP.GenericNotificationHandler>): Disposable;
23
+ on(handler: LSP.StarNotificationHandler): Disposable;
24
+ }
@@ -0,0 +1,142 @@
1
+ var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
2
+ function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
3
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
4
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
5
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
6
+ var _, done = false;
7
+ for (var i = decorators.length - 1; i >= 0; i--) {
8
+ var context = {};
9
+ for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
10
+ for (var p in contextIn.access) context.access[p] = contextIn.access[p];
11
+ context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
12
+ var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
13
+ if (kind === "accessor") {
14
+ if (result === void 0) continue;
15
+ if (result === null || typeof result !== "object") throw new TypeError("Object expected");
16
+ if (_ = accept(result.get)) descriptor.get = _;
17
+ if (_ = accept(result.set)) descriptor.set = _;
18
+ if (_ = accept(result.init)) initializers.unshift(_);
19
+ }
20
+ else if (_ = accept(result)) {
21
+ if (kind === "field") initializers.unshift(_);
22
+ else descriptor[key] = _;
23
+ }
24
+ }
25
+ if (target) Object.defineProperty(target, contextIn.name, descriptor);
26
+ done = true;
27
+ };
28
+ var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
29
+ var useValue = arguments.length > 2;
30
+ for (var i = 0; i < initializers.length; i++) {
31
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
32
+ }
33
+ return useValue ? value : void 0;
34
+ };
35
+ import { inject } from '../../../di/index.js';
36
+ import { lspConnectionToken } from '../../tokens.js';
37
+ import { loggingServiceToken } from './logging.service.js';
38
+ /**
39
+ * Allows registering multiple handlers for the same notification type.
40
+ */
41
+ let NotificationService = (() => {
42
+ let _classDecorators = [inject({
43
+ inject: [lspConnectionToken, loggingServiceToken],
44
+ })];
45
+ let _classDescriptor;
46
+ let _classExtraInitializers = [];
47
+ let _classThis;
48
+ var NotificationService = class {
49
+ static { _classThis = this; }
50
+ static {
51
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
52
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
53
+ NotificationService = _classThis = _classDescriptor.value;
54
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
55
+ __runInitializers(_classThis, _classExtraInitializers);
56
+ }
57
+ /**
58
+ * The connection to the server.
59
+ */
60
+ #connection;
61
+ /**
62
+ * The logger to use.
63
+ */
64
+ #logger;
65
+ /**
66
+ * The registered notification handlers.
67
+ */
68
+ #notifications = new Map();
69
+ /**
70
+ * Instantiates a new notification manager.
71
+ */
72
+ constructor(connection, loggingService) {
73
+ this.#connection = connection;
74
+ this.#logger = loggingService.createLogger(NotificationService);
75
+ }
76
+ dispose() {
77
+ this.#logger?.debug('Disposing notification manager');
78
+ for (const [type] of this.#notifications) {
79
+ if (type) {
80
+ this.#connection.onNotification(type, () => undefined);
81
+ }
82
+ else {
83
+ this.#connection.onNotification(() => undefined);
84
+ }
85
+ }
86
+ this.#notifications.clear();
87
+ }
88
+ async #handleNotification(key, params) {
89
+ this.#logger?.debug('Received notification', {
90
+ notificationType: key ?? '<all>',
91
+ params,
92
+ });
93
+ // This function is only ever called if the handler is registered.
94
+ const handlers = this.#notifications.get(key);
95
+ const funcs = [];
96
+ for (const handler of handlers) {
97
+ funcs.push(async () => {
98
+ try {
99
+ await handler(...params);
100
+ }
101
+ catch (error) {
102
+ this.#logger?.error('Error handling notification', {
103
+ notificationType: key ?? '<all>',
104
+ error,
105
+ });
106
+ }
107
+ });
108
+ }
109
+ await Promise.all(funcs.map((func) => func()));
110
+ }
111
+ on(type, handler) {
112
+ const isStar = typeof type === 'function';
113
+ const [key, func] = isStar ? [undefined, type] : [type, handler];
114
+ if (!func) {
115
+ throw new Error('Handler must be defined');
116
+ }
117
+ const disposable = {
118
+ dispose: () => {
119
+ this.#notifications.get(key)?.delete(func);
120
+ },
121
+ };
122
+ const existing = this.#notifications.get(key);
123
+ if (existing) {
124
+ existing.add(func);
125
+ return disposable;
126
+ }
127
+ this.#notifications.set(key, new Set([func]));
128
+ if (isStar) {
129
+ // eslint-disable-next-line @typescript-eslint/no-misused-promises
130
+ this.#connection.onNotification((...params) => this.#handleNotification(undefined, params));
131
+ return disposable;
132
+ }
133
+ this.#connection.onNotification(type,
134
+ // eslint-disable-next-line @typescript-eslint/no-misused-promises
135
+ (...params) => this.#handleNotification(type, params));
136
+ return disposable;
137
+ }
138
+ };
139
+ return NotificationService = _classThis;
140
+ })();
141
+ export { NotificationService };
142
+ //# sourceMappingURL=notification.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification.service.js","sourceRoot":"","sources":["../../../../src/server/services/infrastructure/notification.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAuB,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAYhF;;GAEG;IAIU,mBAAmB;4BAH/B,MAAM,CAAC;YACP,MAAM,EAAE,CAAC,kBAAkB,EAAE,mBAAmB,CAAC;SACjD,CAAC;;;;;;;;YACF,6KAiJC;;;YAjJY,uDAAmB;;QAC/B;;WAEG;QACH,WAAW,CAAa;QAExB;;WAEG;QACH,OAAO,CAAkB;QAEzB;;WAEG;QACH,cAAc,GAAa,IAAI,GAAG,EAAE,CAAC;QAErC;;WAEG;QACH,YAAY,UAAsB,EAAE,cAA8B;YACjE,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;YAC9B,IAAI,CAAC,OAAO,GAAG,cAAc,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;QACjE,CAAC;QAED,OAAO;YACN,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,gCAAgC,CAAC,CAAC;YAEtD,KAAK,MAAM,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;gBAC1C,IAAI,IAAI,EAAE,CAAC;oBACV,IAAI,CAAC,WAAW,CAAC,cAAc,CAC9B,IAAsD,EACtD,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S,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YAEjE,IAAI,CAAC,IAAI,EAAE,CAAC;gBACX,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;YAC5C,CAAC;YAED,MAAM,UAAU,GAAG;gBAClB,OAAO,EAAE,GAAG,EAAE;oBACb,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;gBAC5C,CAAC;aACD,CAAC;YAEF,MAAM,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAE9C,IAAI,QAAQ,EAAE,CAAC;gBACd,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;gBAEnB,OAAO,UAAU,CAAC;YACnB,CAAC;YAED,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAE9C,IAAI,MAAM,EAAE,CAAC;gBACZ,kEAAkE;gBAClE,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC,GAAG,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,mBAAmB,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC;gBAE5F,OAAO,UAAU,CAAC;YACnB,CAAC;YAED,IAAI,CAAC,WAAW,CAAC,cAAc,CAC9B,IAA2C;YAC3C,kEAAkE;YAClE,CAAC,GAAG,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,mBAAmB,CAAC,IAAI,EAAE,MAAM,CAAC,CACrD,CAAC;YAEF,OAAO,UAAU,CAAC;QACnB,CAAC;;;;SAhJW,mBAAmB"}
@@ -0,0 +1,10 @@
1
+ import { Connection } from 'vscode-languageserver';
2
+ import winston from 'winston';
3
+ import { FactoryRegistration } from '../../../di/index.js';
4
+ import { type LoggingService } from './logging.service.js';
5
+ import type { LogLevel } from '../../../shared/log-level.js';
6
+ export declare const winstonToken: import("../../../di/tokens.js").Token<typeof winston>;
7
+ /**
8
+ * Creates a Winston-based logging service.
9
+ */
10
+ export declare function createWinstonLoggingService(level?: LogLevel, logPath?: string): FactoryRegistration<LoggingService, [Connection, typeof winston]>;
@@ -0,0 +1,48 @@
1
+ import { createToken } from '../../../di/index.js';
2
+ import { ErrorFormatter, LanguageServerFormatter, LanguageServerTransport, } from '../../utils/index.js';
3
+ import { lspConnectionToken } from '../../tokens.js';
4
+ import { loggingServiceToken } from './logging.service.js';
5
+ export const winstonToken = createToken('Winston');
6
+ /**
7
+ * Creates a Winston-based logging service.
8
+ */
9
+ export function createWinstonLoggingService(level = 'info', logPath) {
10
+ return {
11
+ token: loggingServiceToken,
12
+ inject: [lspConnectionToken, winstonToken],
13
+ useFactory: (connection, winstonModule) => {
14
+ const transports = [
15
+ new LanguageServerTransport({
16
+ connection,
17
+ format: winstonModule.format.combine(new ErrorFormatter(), new LanguageServerFormatter({
18
+ connection,
19
+ preferredKeyOrder: ['service', 'uri', 'command'],
20
+ })),
21
+ }),
22
+ ];
23
+ if (logPath) {
24
+ transports.push(new winstonModule.transports.File({
25
+ filename: logPath,
26
+ format: winstonModule.format.combine(new ErrorFormatter(), winstonModule.format.timestamp(), winstonModule.format.json()),
27
+ }));
28
+ }
29
+ const logger = winstonModule.createLogger({
30
+ level,
31
+ transports,
32
+ levels: {
33
+ error: 0,
34
+ warn: 1,
35
+ info: 2,
36
+ debug: 3,
37
+ },
38
+ });
39
+ return {
40
+ createLogger: (component) => {
41
+ const serviceName = component.name || 'UnknownService';
42
+ return logger.child({ service: serviceName });
43
+ },
44
+ };
45
+ },
46
+ };
47
+ }
48
+ //# sourceMappingURL=winston-logging.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"winston-logging.service.js","sourceRoot":"","sources":["../../../../src/server/services/infrastructure/winston-logging.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAuB,WAA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R,IAAI,EAAE,CAAC;oBACP,IAAI,EAAE,CAAC;oBACP,KAAK,EAAE,CAAC;iBACR;aACD,CAAC,CAAC;YAEH,OAAO;gBACN,YAAY,EAAE,CAAC,SAA4B,EAAE,EAAE;oBAC9C,MAAM,WAAW,GAAG,SAAS,CAAC,IAAI,IAAI,gBAAgB,CAAC;oBAEvD,OAAO,MAAM,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC,CAAC;gBAC/C,CAAC;aACD,CAAC;QACH,CAAC;KACD,CAAC;AACH,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { Connection, TextDocuments } from 'vscode-languageserver';
2
+ import { type default as LSP } from 'vscode-languageserver-protocol';
3
+ import type { TextDocument } from 'vscode-languageserver-textdocument';
4
+ import { DocumentFixesService } from '../documents/document-fixes.service.js';
5
+ import { type LoggingService } from '../infrastructure/logging.service.js';
6
+ import { WorkspaceOptionsService } from '../workspace/workspace-options.service.js';
7
+ export declare class AutoFixService {
8
+ #private;
9
+ constructor(documents: TextDocuments<TextDocument>, options: WorkspaceOptionsService, fixes: DocumentFixesService, connection: Connection, loggingService: LoggingService);
10
+ onInitialize(): Partial<LSP.InitializeResult>;
11
+ applyAutoFix(identifier: {
12
+ version: number;
13
+ uri: string;
14
+ }): Promise<void>;
15
+ }
@@ -0,0 +1,142 @@
1
+ var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
2
+ var useValue = arguments.length > 2;
3
+ for (var i = 0; i < initializers.length; i++) {
4
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
5
+ }
6
+ return useValue ? value : void 0;
7
+ };
8
+ var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
9
+ function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
10
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
11
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
12
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
13
+ var _, done = false;
14
+ for (var i = decorators.length - 1; i >= 0; i--) {
15
+ var context = {};
16
+ for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
17
+ for (var p in contextIn.access) context.access[p] = contextIn.access[p];
18
+ context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
19
+ var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
20
+ if (kind === "accessor") {
21
+ if (result === void 0) continue;
22
+ if (result === null || typeof result !== "object") throw new TypeError("Object expected");
23
+ if (_ = accept(result.get)) descriptor.get = _;
24
+ if (_ = accept(result.set)) descriptor.set = _;
25
+ if (_ = accept(result.init)) initializers.unshift(_);
26
+ }
27
+ else if (_ = accept(result)) {
28
+ if (kind === "field") initializers.unshift(_);
29
+ else descriptor[key] = _;
30
+ }
31
+ }
32
+ if (target) Object.defineProperty(target, contextIn.name, descriptor);
33
+ done = true;
34
+ };
35
+ import { WorkspaceChange } from 'vscode-languageserver-protocol';
36
+ import { inject } from '../../../di/index.js';
37
+ import { command, initialize, lspService } from '../../decorators.js';
38
+ import { lspConnectionToken, textDocumentsToken } from '../../tokens.js';
39
+ import { CommandId } from '../../types.js';
40
+ import { DocumentFixesService } from '../documents/document-fixes.service.js';
41
+ import { loggingServiceToken } from '../infrastructure/logging.service.js';
42
+ import { WorkspaceOptionsService } from '../workspace/workspace-options.service.js';
43
+ let AutoFixService = (() => {
44
+ let _classDecorators = [lspService(), inject({
45
+ inject: [
46
+ textDocumentsToken,
47
+ WorkspaceOptionsService,
48
+ DocumentFixesService,
49
+ lspConnectionToken,
50
+ loggingServiceToken,
51
+ ],
52
+ })];
53
+ let _classDescriptor;
54
+ let _classExtraInitializers = [];
55
+ let _classThis;
56
+ let _instanceExtraInitializers = [];
57
+ let _onInitialize_decorators;
58
+ let _applyAutoFix_decorators;
59
+ var AutoFixService = class {
60
+ static { _classThis = this; }
61
+ static {
62
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
63
+ _onInitialize_decorators = [initialize()];
64
+ _applyAutoFix_decorators = [command(CommandId.ApplyAutoFix, { minArgs: 1 })];
65
+ __esDecorate(this, null, _onInitialize_decorators, { kind: "method", name: "onInitialize", static: false, private: false, access: { has: obj => "onInitialize" in obj, get: obj => obj.onInitialize }, metadata: _metadata }, null, _instanceExtraInitializers);
66
+ __esDecorate(this, null, _applyAutoFix_decorators, { kind: "method", name: "applyAutoFix", static: false, private: false, access: { has: obj => "applyAutoFix" in obj, get: obj => obj.applyAutoFix }, metadata: _metadata }, null, _instanceExtraInitializers);
67
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
68
+ AutoFixService = _classThis = _classDescriptor.value;
69
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
70
+ __runInitializers(_classThis, _classExtraInitializers);
71
+ }
72
+ #documents = __runInitializers(this, _instanceExtraInitializers);
73
+ #options;
74
+ #fixes;
75
+ #connection;
76
+ /**
77
+ * The logger to use.
78
+ */
79
+ #logger;
80
+ constructor(documents, options, fixes, connection, loggingService) {
81
+ this.#documents = documents;
82
+ this.#options = options;
83
+ this.#fixes = fixes;
84
+ this.#connection = connection;
85
+ this.#logger = loggingService.createLogger(AutoFixService);
86
+ }
87
+ async #shouldAutoFix(document) {
88
+ const options = await this.#options.getOptions(document.uri);
89
+ return options.validate.includes(document.languageId);
90
+ }
91
+ onInitialize() {
92
+ return {
93
+ capabilities: {
94
+ executeCommandProvider: {
95
+ commands: [CommandId.ApplyAutoFix],
96
+ },
97
+ },
98
+ };
99
+ }
100
+ async applyAutoFix(identifier) {
101
+ const uri = identifier.uri;
102
+ const document = this.#documents.get(uri);
103
+ if (!document || !(await this.#shouldAutoFix(document))) {
104
+ if (this.#logger?.isDebugEnabled()) {
105
+ if (!document) {
106
+ this.#logger.debug('Unknown document, ignoring', { uri });
107
+ }
108
+ else {
109
+ this.#logger.debug('Document should not be auto-fixed, ignoring', {
110
+ uri,
111
+ language: document.languageId,
112
+ });
113
+ }
114
+ }
115
+ return;
116
+ }
117
+ if (identifier.version !== document.version) {
118
+ this.#logger?.debug('Document has been modified, ignoring', {
119
+ uri,
120
+ });
121
+ return;
122
+ }
123
+ const workspaceChange = new WorkspaceChange();
124
+ const textChange = workspaceChange.getTextEditChange(identifier);
125
+ const edits = await this.#fixes.getFixes(document);
126
+ edits.forEach((edit) => textChange.add(edit));
127
+ this.#logger?.debug('Applying fixes', { uri, edits });
128
+ try {
129
+ const response = await this.#connection.workspace.applyEdit(workspaceChange.edit);
130
+ if (!response.applied) {
131
+ this.#logger?.debug('Failed to apply fixes', { uri, response });
132
+ }
133
+ }
134
+ catch (error) {
135
+ this.#logger?.debug('Failed to apply fixes', { uri, error });
136
+ }
137
+ }
138
+ };
139
+ return AutoFixService = _classThis;
140
+ })();
141
+ export { AutoFixService };
142
+ //# sourceMappingURL=auto-fix.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auto-fix.service.js","sourceRoot":"","sources":["../../../../src/server/services/lsp/auto-fix.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EAAE,eAAe,EAAuB,MAAM,gCAAgC,CAAC;AAGtF,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,oBAAoB,EAAE,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,CAAC,CAAC,CAAC;YAE9C,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,gBAAgB,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC;YAEtD,IAAI,CAAC;gBACJ,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,SAAS,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;gBAElF,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;oBACvB,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,uBAAuB,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;gBACjE,CAAC;YACF,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,uBAAuB,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC;YAC9D,CAAC;QACF,CAAC;;;;SAxFW,cAAc"}
@@ -0,0 +1,18 @@
1
+ import type { Connection, TextDocuments } from 'vscode-languageserver';
2
+ import * as LSP from 'vscode-languageserver-protocol';
3
+ import type { TextDocument } from 'vscode-languageserver-textdocument';
4
+ import { DocumentDiagnosticsService } from '../../documents/document-diagnostics.service.js';
5
+ import { DocumentFixesService } from '../../documents/document-fixes.service.js';
6
+ import { type LoggingService } from '../../infrastructure/logging.service.js';
7
+ import { WorkspaceOptionsService } from '../../workspace/workspace-options.service.js';
8
+ import { DisableRuleFileCodeActionService } from './disable-rule-file-code-action.service.js';
9
+ import { DisableRuleLineCodeActionService } from './disable-rule-line-code-action.service.js';
10
+ export declare class CodeActionService {
11
+ #private;
12
+ constructor(documents: TextDocuments<TextDocument>, options: WorkspaceOptionsService, fixes: DocumentFixesService, diagnostics: DocumentDiagnosticsService, disableRuleLineFactory: DisableRuleLineCodeActionService, disableRuleFileFactory: DisableRuleFileCodeActionService, connection: Connection, loggingService: LoggingService);
13
+ onInitialize(): Partial<LSP.InitializeResult>;
14
+ openRuleDocumentation(params: {
15
+ uri: string;
16
+ } | undefined): Promise<object>;
17
+ handleCodeAction(params: LSP.CodeActionParams): Promise<(LSP.Command | LSP.CodeAction)[] | undefined | null>;
18
+ }