@menapo/vi18n 0.1.1 → 0.2.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 (121) hide show
  1. package/README.md +19 -0
  2. package/dist/{apply-Bre-lY9J.js → apply-Bg-3rB2m.js} +69 -89
  3. package/dist/{captured-Bj8bO6vd.js → captured-DfLk50Ji.js} +196 -217
  4. package/dist/{check-BIKEuu6B.js → check-CunekuYs.js} +76 -85
  5. package/dist/cli.js +2 -3
  6. package/dist/{collect-Cx4_SKOe.js → collect-CYATDjdo.js} +1 -2
  7. package/dist/collisions-CDSdtLQm.js +215 -0
  8. package/dist/{compile-Cc97JaW2.js → compile-DqkofbiO.js} +376 -331
  9. package/dist/compile-hva0qjhZ.js +240 -0
  10. package/dist/concurrency-BCY_4zcr.js +1 -0
  11. package/dist/concurrency-Dy2ny50V.js +107 -0
  12. package/dist/config.d.ts +1 -5
  13. package/dist/config.js +4 -5
  14. package/dist/{types-D3QGM8XO.js → diagnostics-LgIWyeSp.js} +28 -27
  15. package/dist/{dir-zw6bGMKQ.js → dir-TGLYuOZb.js} +34 -37
  16. package/dist/{duplicates-yuRljQ6h.js → duplicates-8cudcHNj.js} +10 -27
  17. package/dist/engine-ecRD8-IE.js +556 -0
  18. package/dist/engine.d.ts +1 -5
  19. package/dist/engine.js +297 -168
  20. package/dist/exchange-DjwlrTQ9.js +41 -0
  21. package/dist/{exclude-Du-Zd_qI.js → exclude-BFETmvde.js} +2 -3
  22. package/dist/{export-C9Sy6UWv.js → export-D2tsqWIr.js} +17 -38
  23. package/dist/{extract-C3S8btx0.js → extract-BxYchVmY.js} +114 -82
  24. package/dist/{formats-9unqj_fZ.js → formats-BaryZ2N7.js} +352 -276
  25. package/dist/fs-ezCMZeDV.js +52 -0
  26. package/dist/i18next-COO6o0tX.js +1907 -0
  27. package/dist/i18next-Dr7DCQlQ.js +1 -0
  28. package/dist/{import-nANvQutw.js → import-vSC29Cn4.js} +81 -75
  29. package/dist/index.d.ts +1 -13
  30. package/dist/index.js +14 -16
  31. package/dist/{init-C2ScuW6a.js → init-Cc7A-8VX.js} +466 -501
  32. package/dist/{library-D5CWvTQs.js → library-tp_xqzSY.js} +975 -451
  33. package/dist/lingui-BnnlqGXT.js +902 -0
  34. package/dist/lint.d.ts +0 -4
  35. package/dist/lint.js +70 -82
  36. package/dist/{load-gW-oJt1Q.js → load-BSIeGJ5v.js} +275 -148
  37. package/dist/{load-CQRz4PpM.js → load-SSrAeJVB.js} +1214 -1116
  38. package/dist/{locales-DX4MOBFE.js → locales-D0U-yVRm.js} +271 -237
  39. package/dist/{lsp-RMMMc88P.js → lsp-DvC11pBZ.js} +4 -5
  40. package/dist/{match-BGr8EXB3.js → match-BLDcj610.js} +11 -4
  41. package/dist/{mcp-CHVwBoRP.js → mcp-D2zzOTBy.js} +4 -5
  42. package/dist/{merge-driver-BTX87aVm.js → merge-driver-BLI8OtAc.js} +138 -122
  43. package/dist/migrate-1r43OBfe.js +1 -0
  44. package/dist/migrate-ChDGhlC-.js +2169 -0
  45. package/dist/{openai-CTaMDcl-.js → openai-CLn4puY8.js} +128 -87
  46. package/dist/{output-DWE3SIUA.js → output-D5tAt8q4.js} +15 -9
  47. package/dist/parse.d.ts +1 -3
  48. package/dist/parse.js +7 -8
  49. package/dist/{pipeline-C9Dbotkh.js → pipeline-BJSkkRYC.js} +387 -359
  50. package/dist/{pipeline-DbX6rlo5.js → pipeline-BeCc441z.js} +1 -1
  51. package/dist/project-B5KIO0q-.js +544 -0
  52. package/dist/{pseudo-DRv30iN5.js → pseudo-B2DUpoLu.js} +126 -3
  53. package/dist/{raw-C4Y6vyGY.js → raw-YsYZMS9n.js} +52 -29
  54. package/dist/react-intl-C8JehBBL.js +634 -0
  55. package/dist/rename-ZVGq9ZG1.js +577 -0
  56. package/dist/repeated-uuI1tUGg.js +85 -0
  57. package/dist/restore-xlBIrtRt.js +199 -0
  58. package/dist/rewrite-BwzXoBiA.js +415 -0
  59. package/dist/{rich-DCUKl5HM.js → rich-ApY1Dm4S.js} +35 -28
  60. package/dist/rolldown-runtime-C1I3wEg2.js +43 -0
  61. package/dist/{rolldown-runtime-D7D4PA-g.js → rolldown-runtime-D8jQpDG7.js} +1 -2
  62. package/dist/run-CQ9pDLSa.js +674 -0
  63. package/dist/scan-worker.d.ts +2 -4
  64. package/dist/scan-worker.js +1 -1
  65. package/dist/{scoped-BMYpSthj.js → scoped-h3KE8XWW.js} +3 -4
  66. package/dist/{server-Da1Ot9IN.js → server-Br8tAuG2.js} +312 -386
  67. package/dist/{server-deBOq2vq.js → server-DJRpUQVZ.js} +1059 -333
  68. package/dist/server.d.ts +1 -17
  69. package/dist/server.js +419 -379
  70. package/dist/{sitemap-DJXzKoza.js → sitemap-CSAkm6oi.js} +21 -33
  71. package/dist/{sources-D19czDSA.js → sources-DNVbYsgs.js} +713 -373
  72. package/dist/{status-zr4jY59Y.js → status-q6M3rBrh.js} +30 -30
  73. package/dist/{stdio-FPOKQAgu.js → stdio-D9kTzyqB.js} +2 -4
  74. package/dist/{stdio-CVaJfxA7.js → stdio-FWIVU3P4.js} +1 -2
  75. package/dist/sync-BNIAwMhR.js +1352 -0
  76. package/dist/{t-DC-c9zE5.js → t-gvEXx25s.js} +76 -53
  77. package/dist/test.d.ts +5 -16
  78. package/dist/test.js +126 -56
  79. package/dist/translate-BP4iVhOR.js +336 -0
  80. package/dist/{ts-BaU5yOf0.js → ts-BX6kwig5.js} +25 -14
  81. package/dist/{types-DtvQ7UdD.js → types-3kwyaCAm.js} +1 -2
  82. package/dist/{types-DsdWBG0b.d.ts → types-B4wNX6PA.d.ts} +6 -8
  83. package/dist/{types-CgUCkFU1.d.ts → types-_4UdFhR9.d.ts} +24 -21
  84. package/dist/types-xR2exI3L.js +42 -0
  85. package/dist/{units-CQ5Q99RC.js → units-DPPfCN7j.js} +7 -16
  86. package/dist/{url-CRfCOhUI.js → url-Bpc6wLea.js} +24 -11
  87. package/dist/{url-CsBkRaJy.js → url-D2_VlEeH.js} +25 -12
  88. package/dist/{validate-BxpupdAf.js → validate-CgzaDdOY.js} +690 -377
  89. package/dist/{validate-D6DJepZv.js → validate-PGgMsasz.js} +3 -5
  90. package/dist/{version-Byqi2guX.js → version-DC-J5WvV.js} +3 -5
  91. package/dist/{vite-scan-CT_vsp4g.js → vite-scan-kM8Ta3rO.js} +87 -92
  92. package/dist/vite.d.ts +2 -6
  93. package/dist/vite.js +6500 -6032
  94. package/dist/vue-i18n-_uIXlFVh.js +806 -0
  95. package/dist/{which-BOemZ5Q8.js → which-DFWk_KwN.js} +44 -37
  96. package/dist/{worker-84U6uYB3.js → worker-zlhNj4y3.js} +454 -608
  97. package/package.json +5 -5
  98. package/dist/check-HsmmpJZg.js +0 -1
  99. package/dist/codec-DuvU2VQy.js +0 -207
  100. package/dist/collisions-CfpZU8e4.js +0 -217
  101. package/dist/compile-BaDh0cHG.js +0 -245
  102. package/dist/concurrency-C9UUWuDC.js +0 -96
  103. package/dist/concurrency-DONL7t4V.js +0 -1
  104. package/dist/engine-C2ENBRJe.js +0 -531
  105. package/dist/i18next-9HAoxwUI.js +0 -1
  106. package/dist/i18next-BEJgv_S8.js +0 -1596
  107. package/dist/lingui-zUiCl9Um.js +0 -833
  108. package/dist/messages-BfjIExyB.js +0 -166
  109. package/dist/migrate-IpLDMXmq.js +0 -1484
  110. package/dist/migrate-rCQuOGsf.js +0 -1
  111. package/dist/project-Bw9UPIdx.js +0 -1046
  112. package/dist/project-C4GpaN-n.js +0 -381
  113. package/dist/react-intl-BP0u-D5m.js +0 -519
  114. package/dist/restore-CiYv-jxS.js +0 -175
  115. package/dist/rewrite-EsIw_lsq.js +0 -803
  116. package/dist/run-BEcnBbu-.js +0 -694
  117. package/dist/runtime-DTMmliT1.js +0 -64
  118. package/dist/sync-B9V2KFwb.js +0 -658
  119. package/dist/translate-CQnJfLjO.js +0 -299
  120. package/dist/types-wSh9fCBY.js +0 -11
  121. package/dist/vue-i18n-g0iGy6CZ.js +0 -651
@@ -1,16 +1,18 @@
1
- import { a as __commonJSMin, c as __require, i as messageView, l as __toCommonJS, o as __esmMin, r as localeView, s as __exportAll, t as indexCatalog } from "./messages-BfjIExyB.js";
2
- import { o as isDiagnosticError } from "./types-D3QGM8XO.js";
3
- import { r as validateTranslation } from "./validate-BxpupdAf.js";
4
- import { t as createCodec } from "./codec-DuvU2VQy.js";
5
- import { l as loadCatalogSet, o as catalogLayout, s as catalogPath, u as parseCatalog } from "./library-D5CWvTQs.js";
6
- import { a as toPosix, r as isIncluded } from "./project-Bw9UPIdx.js";
7
- import { n as loadConfig, t as findConfigFile } from "./load-gW-oJt1Q.js";
8
- import { t as VERSION } from "./version-Byqi2guX.js";
9
- import { i as scanSource, r as scanConfig } from "./worker-84U6uYB3.js";
10
- import { n as syntaxOfEntry } from "./check-BIKEuu6B.js";
11
- import { dirname, relative } from "node:path";
1
+ import { a as __toCommonJS, i as __require, n as __esmMin, r as __exportAll, t as __commonJSMin } from "./rolldown-runtime-C1I3wEg2.js";
2
+ import { t as VERSION } from "./version-DC-J5WvV.js";
3
+ import { d as toPosix } from "./validate-CgzaDdOY.js";
4
+ import { F as isIncluded, l as loadCatalogSet, s as catalogPath, u as parseCatalog } from "./library-tp_xqzSY.js";
5
+ import { i as writesText, n as repeatedDiagnostics, r as repeatedTexts, t as quoted } from "./repeated-uuI1tUGg.js";
6
+ import { r as loadConfig, t as findConfigFile } from "./load-BSIeGJ5v.js";
7
+ import { n as isDiagnosticError } from "./diagnostics-LgIWyeSp.js";
8
+ import { s as scanProject } from "./sync-BNIAwMhR.js";
9
+ import { i as scanSource, r as scanConfig } from "./worker-zlhNj4y3.js";
10
+ import { S as checkTranslation, _ as indexCatalog, b as localeView, d as projectOf, v as indexCatalogs, w as syntaxOfEntry, x as messageView } from "./project-B5KIO0q-.js";
11
+ import { o as errorMessage } from "./output-D5tAt8q4.js";
12
+ import { dirname, posix, relative, resolve } from "node:path";
13
+ import { readFile } from "node:fs/promises";
12
14
  import { fileURLToPath, pathToFileURL } from "node:url";
13
- //#region ../../node_modules/.pnpm/vscode-languageserver-textdocument@1.0.15/node_modules/vscode-languageserver-textdocument/lib/esm/main.js
15
+ // ../../node_modules/.pnpm/vscode-languageserver-textdocument@1.0.15/node_modules/vscode-languageserver-textdocument/lib/esm/main.js
14
16
  var FullTextDocument$1 = class FullTextDocument$1 {
15
17
  constructor(uri, languageId, version, content) {
16
18
  this._uri = uri;
@@ -251,8 +253,7 @@ function getWellformedEdit(textEdit) {
251
253
  };
252
254
  return textEdit;
253
255
  }
254
- //#endregion
255
- //#region ../../node_modules/.pnpm/vscode-languageserver@10.1.2/node_modules/vscode-languageserver/lib/common/utils/is.js
256
+ // ../../node_modules/.pnpm/vscode-languageserver@10.1.2/node_modules/vscode-languageserver/lib/common/utils/is.js
256
257
  var require_is$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
257
258
  Object.defineProperty(exports, "__esModule", { value: true });
258
259
  exports.boolean = boolean;
@@ -292,8 +293,7 @@ var require_is$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
292
293
  return value && func(value.then);
293
294
  }
294
295
  }));
295
- //#endregion
296
- //#region ../../node_modules/.pnpm/vscode-jsonrpc@9.0.3/node_modules/vscode-jsonrpc/lib/common/is.js
296
+ // ../../node_modules/.pnpm/vscode-jsonrpc@9.0.3/node_modules/vscode-jsonrpc/lib/common/is.js
297
297
  var require_is$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
298
298
  Object.defineProperty(exports, "__esModule", { value: true });
299
299
  exports.boolean = boolean;
@@ -325,8 +325,7 @@ var require_is$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
325
325
  return array(value) && value.every((elem) => string(elem));
326
326
  }
327
327
  }));
328
- //#endregion
329
- //#region ../../node_modules/.pnpm/vscode-jsonrpc@9.0.3/node_modules/vscode-jsonrpc/lib/common/messages.js
328
+ // ../../node_modules/.pnpm/vscode-jsonrpc@9.0.3/node_modules/vscode-jsonrpc/lib/common/messages.js
330
329
  var require_messages$1 = /* @__PURE__ */ __commonJSMin(((exports, module, this$19) => {
331
330
  var __createBinding = this$19 && this$19.__createBinding || (Object.create ? (function(o, m, k, k2) {
332
331
  if (k2 === void 0) k2 = k;
@@ -760,8 +759,7 @@ var require_messages$1 = /* @__PURE__ */ __commonJSMin(((exports, module, this$1
760
759
  Message.isResponse = isResponse;
761
760
  })(Message || (exports.Message = Message = {}));
762
761
  }));
763
- //#endregion
764
- //#region ../../node_modules/.pnpm/vscode-jsonrpc@9.0.3/node_modules/vscode-jsonrpc/lib/common/linkedMap.js
762
+ // ../../node_modules/.pnpm/vscode-jsonrpc@9.0.3/node_modules/vscode-jsonrpc/lib/common/linkedMap.js
765
763
  var require_linkedMap = /* @__PURE__ */ __commonJSMin(((exports) => {
766
764
  Object.defineProperty(exports, "__esModule", { value: true });
767
765
  exports.LRUCache = exports.LinkedMap = exports.Touch = void 0;
@@ -1107,8 +1105,7 @@ var require_linkedMap = /* @__PURE__ */ __commonJSMin(((exports) => {
1107
1105
  };
1108
1106
  exports.LRUCache = LRUCache;
1109
1107
  }));
1110
- //#endregion
1111
- //#region ../../node_modules/.pnpm/vscode-jsonrpc@9.0.3/node_modules/vscode-jsonrpc/lib/common/disposable.js
1108
+ // ../../node_modules/.pnpm/vscode-jsonrpc@9.0.3/node_modules/vscode-jsonrpc/lib/common/disposable.js
1112
1109
  var require_disposable = /* @__PURE__ */ __commonJSMin(((exports) => {
1113
1110
  Object.defineProperty(exports, "__esModule", { value: true });
1114
1111
  exports.Disposable = void 0;
@@ -1120,8 +1117,7 @@ var require_disposable = /* @__PURE__ */ __commonJSMin(((exports) => {
1120
1117
  Disposable.create = create;
1121
1118
  })(Disposable || (exports.Disposable = Disposable = {}));
1122
1119
  }));
1123
- //#endregion
1124
- //#region ../../node_modules/.pnpm/vscode-jsonrpc@9.0.3/node_modules/vscode-jsonrpc/lib/common/ral.js
1120
+ // ../../node_modules/.pnpm/vscode-jsonrpc@9.0.3/node_modules/vscode-jsonrpc/lib/common/ral.js
1125
1121
  var require_ral = /* @__PURE__ */ __commonJSMin(((exports) => {
1126
1122
  Object.defineProperty(exports, "__esModule", { value: true });
1127
1123
  let _ral;
@@ -1138,8 +1134,7 @@ var require_ral = /* @__PURE__ */ __commonJSMin(((exports) => {
1138
1134
  })(RAL || (RAL = {}));
1139
1135
  exports.default = RAL;
1140
1136
  }));
1141
- //#endregion
1142
- //#region ../../node_modules/.pnpm/vscode-jsonrpc@9.0.3/node_modules/vscode-jsonrpc/lib/common/events.js
1137
+ // ../../node_modules/.pnpm/vscode-jsonrpc@9.0.3/node_modules/vscode-jsonrpc/lib/common/events.js
1143
1138
  var require_events = /* @__PURE__ */ __commonJSMin(((exports, module, this$18) => {
1144
1139
  var __importDefault = this$18 && this$18.__importDefault || function(mod) {
1145
1140
  return mod && mod.__esModule ? mod : { "default": mod };
@@ -1239,8 +1234,7 @@ var require_events = /* @__PURE__ */ __commonJSMin(((exports, module, this$18) =
1239
1234
  }
1240
1235
  };
1241
1236
  }));
1242
- //#endregion
1243
- //#region ../../node_modules/.pnpm/vscode-jsonrpc@9.0.3/node_modules/vscode-jsonrpc/lib/common/cancellation.js
1237
+ // ../../node_modules/.pnpm/vscode-jsonrpc@9.0.3/node_modules/vscode-jsonrpc/lib/common/cancellation.js
1244
1238
  var require_cancellation = /* @__PURE__ */ __commonJSMin(((exports, module, this$17) => {
1245
1239
  var __createBinding = this$17 && this$17.__createBinding || (Object.create ? (function(o, m, k, k2) {
1246
1240
  if (k2 === void 0) k2 = k;
@@ -1357,8 +1351,7 @@ var require_cancellation = /* @__PURE__ */ __commonJSMin(((exports, module, this
1357
1351
  };
1358
1352
  exports.CancellationTokenSource = CancellationTokenSource;
1359
1353
  }));
1360
- //#endregion
1361
- //#region ../../node_modules/.pnpm/vscode-jsonrpc@9.0.3/node_modules/vscode-jsonrpc/lib/common/sharedArrayCancellation.js
1354
+ // ../../node_modules/.pnpm/vscode-jsonrpc@9.0.3/node_modules/vscode-jsonrpc/lib/common/sharedArrayCancellation.js
1362
1355
  var require_sharedArrayCancellation = /* @__PURE__ */ __commonJSMin(((exports) => {
1363
1356
  Object.defineProperty(exports, "__esModule", { value: true });
1364
1357
  exports.SharedArrayReceiverStrategy = exports.SharedArraySenderStrategy = void 0;
@@ -1425,8 +1418,7 @@ var require_sharedArrayCancellation = /* @__PURE__ */ __commonJSMin(((exports) =
1425
1418
  };
1426
1419
  exports.SharedArrayReceiverStrategy = SharedArrayReceiverStrategy;
1427
1420
  }));
1428
- //#endregion
1429
- //#region ../../node_modules/.pnpm/vscode-jsonrpc@9.0.3/node_modules/vscode-jsonrpc/lib/common/semaphore.js
1421
+ // ../../node_modules/.pnpm/vscode-jsonrpc@9.0.3/node_modules/vscode-jsonrpc/lib/common/semaphore.js
1430
1422
  var require_semaphore = /* @__PURE__ */ __commonJSMin(((exports, module, this$16) => {
1431
1423
  var __importDefault = this$16 && this$16.__importDefault || function(mod) {
1432
1424
  return mod && mod.__esModule ? mod : { "default": mod };
@@ -1491,8 +1483,7 @@ var require_semaphore = /* @__PURE__ */ __commonJSMin(((exports, module, this$16
1491
1483
  };
1492
1484
  exports.Semaphore = Semaphore;
1493
1485
  }));
1494
- //#endregion
1495
- //#region ../../node_modules/.pnpm/vscode-jsonrpc@9.0.3/node_modules/vscode-jsonrpc/lib/common/messageReader.js
1486
+ // ../../node_modules/.pnpm/vscode-jsonrpc@9.0.3/node_modules/vscode-jsonrpc/lib/common/messageReader.js
1496
1487
  var require_messageReader = /* @__PURE__ */ __commonJSMin(((exports, module, this$15) => {
1497
1488
  var __createBinding = this$15 && this$15.__createBinding || (Object.create ? (function(o, m, k, k2) {
1498
1489
  if (k2 === void 0) k2 = k;
@@ -1726,8 +1717,7 @@ var require_messageReader = /* @__PURE__ */ __commonJSMin(((exports, module, thi
1726
1717
  };
1727
1718
  exports.ReadableStreamMessageReader = ReadableStreamMessageReader;
1728
1719
  }));
1729
- //#endregion
1730
- //#region ../../node_modules/.pnpm/vscode-jsonrpc@9.0.3/node_modules/vscode-jsonrpc/lib/common/messageWriter.js
1720
+ // ../../node_modules/.pnpm/vscode-jsonrpc@9.0.3/node_modules/vscode-jsonrpc/lib/common/messageWriter.js
1731
1721
  var require_messageWriter = /* @__PURE__ */ __commonJSMin(((exports, module, this$14) => {
1732
1722
  var __createBinding = this$14 && this$14.__createBinding || (Object.create ? (function(o, m, k, k2) {
1733
1723
  if (k2 === void 0) k2 = k;
@@ -1886,8 +1876,7 @@ var require_messageWriter = /* @__PURE__ */ __commonJSMin(((exports, module, thi
1886
1876
  };
1887
1877
  exports.WriteableStreamMessageWriter = WriteableStreamMessageWriter;
1888
1878
  }));
1889
- //#endregion
1890
- //#region ../../node_modules/.pnpm/vscode-jsonrpc@9.0.3/node_modules/vscode-jsonrpc/lib/common/messageBuffer.js
1879
+ // ../../node_modules/.pnpm/vscode-jsonrpc@9.0.3/node_modules/vscode-jsonrpc/lib/common/messageBuffer.js
1891
1880
  var require_messageBuffer = /* @__PURE__ */ __commonJSMin(((exports) => {
1892
1881
  Object.defineProperty(exports, "__esModule", { value: true });
1893
1882
  exports.AbstractMessageBuffer = void 0;
@@ -2015,8 +2004,7 @@ var require_messageBuffer = /* @__PURE__ */ __commonJSMin(((exports) => {
2015
2004
  };
2016
2005
  exports.AbstractMessageBuffer = AbstractMessageBuffer;
2017
2006
  }));
2018
- //#endregion
2019
- //#region ../../node_modules/.pnpm/vscode-jsonrpc@9.0.3/node_modules/vscode-jsonrpc/lib/common/connection.js
2007
+ // ../../node_modules/.pnpm/vscode-jsonrpc@9.0.3/node_modules/vscode-jsonrpc/lib/common/connection.js
2020
2008
  var require_connection$1 = /* @__PURE__ */ __commonJSMin(((exports, module, this$13) => {
2021
2009
  var __createBinding = this$13 && this$13.__createBinding || (Object.create ? (function(o, m, k, k2) {
2022
2010
  if (k2 === void 0) k2 = k;
@@ -2974,8 +2962,7 @@ var require_connection$1 = /* @__PURE__ */ __commonJSMin(((exports, module, this
2974
2962
  return connection;
2975
2963
  }
2976
2964
  }));
2977
- //#endregion
2978
- //#region ../../node_modules/.pnpm/vscode-jsonrpc@9.0.3/node_modules/vscode-jsonrpc/lib/common/api.js
2965
+ // ../../node_modules/.pnpm/vscode-jsonrpc@9.0.3/node_modules/vscode-jsonrpc/lib/common/api.js
2979
2966
  var require_api$2 = /* @__PURE__ */ __commonJSMin(((exports, module, this$12) => {
2980
2967
  var __importDefault = this$12 && this$12.__importDefault || function(mod) {
2981
2968
  return mod && mod.__esModule ? mod : { "default": mod };
@@ -3373,8 +3360,7 @@ var require_api$2 = /* @__PURE__ */ __commonJSMin(((exports, module, this$12) =>
3373
3360
  });
3374
3361
  exports.RAL = __importDefault(require_ral()).default;
3375
3362
  }));
3376
- //#endregion
3377
- //#region ../../node_modules/.pnpm/vscode-languageserver-types@3.18.4/node_modules/vscode-languageserver-types/lib/esm/main.js
3363
+ // ../../node_modules/.pnpm/vscode-languageserver-types@3.18.4/node_modules/vscode-languageserver-types/lib/esm/main.js
3378
3364
  var main_exports = /* @__PURE__ */ __exportAll({
3379
3365
  AnnotatedTextEdit: () => AnnotatedTextEdit,
3380
3366
  ApplyKind: () => ApplyKind,
@@ -5417,8 +5403,7 @@ var init_main = __esmMin((() => {
5417
5403
  Is.typedArray = typedArray;
5418
5404
  })(Is || (Is = {}));
5419
5405
  }));
5420
- //#endregion
5421
- //#region ../../node_modules/.pnpm/vscode-languageserver-protocol@3.18.4/node_modules/vscode-languageserver-protocol/lib/common/messages.js
5406
+ // ../../node_modules/.pnpm/vscode-languageserver-protocol@3.18.4/node_modules/vscode-languageserver-protocol/lib/common/messages.js
5422
5407
  var require_messages = /* @__PURE__ */ __commonJSMin(((exports) => {
5423
5408
  Object.defineProperty(exports, "__esModule", { value: true });
5424
5409
  exports.CM = exports.ProtocolNotificationType = exports.ProtocolNotificationType0 = exports.ProtocolRequestType = exports.ProtocolRequestType0 = exports.RegistrationType = exports.MessageDirection = void 0;
@@ -5500,8 +5485,7 @@ var require_messages = /* @__PURE__ */ __commonJSMin(((exports) => {
5500
5485
  CM.create = create;
5501
5486
  })(CM || (exports.CM = CM = {}));
5502
5487
  }));
5503
- //#endregion
5504
- //#region ../../node_modules/.pnpm/vscode-languageserver-protocol@3.18.4/node_modules/vscode-languageserver-protocol/lib/common/utils/is.js
5488
+ // ../../node_modules/.pnpm/vscode-languageserver-protocol@3.18.4/node_modules/vscode-languageserver-protocol/lib/common/utils/is.js
5505
5489
  var require_is = /* @__PURE__ */ __commonJSMin(((exports) => {
5506
5490
  Object.defineProperty(exports, "__esModule", { value: true });
5507
5491
  exports.boolean = boolean;
@@ -5541,8 +5525,7 @@ var require_is = /* @__PURE__ */ __commonJSMin(((exports) => {
5541
5525
  return value !== null && typeof value === "object";
5542
5526
  }
5543
5527
  }));
5544
- //#endregion
5545
- //#region ../../node_modules/.pnpm/vscode-languageserver-protocol@3.18.4/node_modules/vscode-languageserver-protocol/lib/common/protocol.implementation.js
5528
+ // ../../node_modules/.pnpm/vscode-languageserver-protocol@3.18.4/node_modules/vscode-languageserver-protocol/lib/common/protocol.implementation.js
5546
5529
  var require_protocol_implementation = /* @__PURE__ */ __commonJSMin(((exports) => {
5547
5530
  Object.defineProperty(exports, "__esModule", { value: true });
5548
5531
  exports.ImplementationRequest = void 0;
@@ -5560,8 +5543,7 @@ var require_protocol_implementation = /* @__PURE__ */ __commonJSMin(((exports) =
5560
5543
  ImplementationRequest.capabilities = messages_1.CM.create("textDocument.implementation", "implementationProvider");
5561
5544
  })(ImplementationRequest || (exports.ImplementationRequest = ImplementationRequest = {}));
5562
5545
  }));
5563
- //#endregion
5564
- //#region ../../node_modules/.pnpm/vscode-languageserver-protocol@3.18.4/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeDefinition.js
5546
+ // ../../node_modules/.pnpm/vscode-languageserver-protocol@3.18.4/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeDefinition.js
5565
5547
  var require_protocol_typeDefinition = /* @__PURE__ */ __commonJSMin(((exports) => {
5566
5548
  Object.defineProperty(exports, "__esModule", { value: true });
5567
5549
  exports.TypeDefinitionRequest = void 0;
@@ -5579,8 +5561,7 @@ var require_protocol_typeDefinition = /* @__PURE__ */ __commonJSMin(((exports) =
5579
5561
  TypeDefinitionRequest.capabilities = messages_1.CM.create("textDocument.typeDefinition", "typeDefinitionProvider");
5580
5562
  })(TypeDefinitionRequest || (exports.TypeDefinitionRequest = TypeDefinitionRequest = {}));
5581
5563
  }));
5582
- //#endregion
5583
- //#region ../../node_modules/.pnpm/vscode-languageserver-protocol@3.18.4/node_modules/vscode-languageserver-protocol/lib/common/protocol.workspaceFolder.js
5564
+ // ../../node_modules/.pnpm/vscode-languageserver-protocol@3.18.4/node_modules/vscode-languageserver-protocol/lib/common/protocol.workspaceFolder.js
5584
5565
  var require_protocol_workspaceFolder = /* @__PURE__ */ __commonJSMin(((exports) => {
5585
5566
  Object.defineProperty(exports, "__esModule", { value: true });
5586
5567
  exports.DidChangeWorkspaceFoldersNotification = exports.WorkspaceFoldersRequest = void 0;
@@ -5607,8 +5588,7 @@ var require_protocol_workspaceFolder = /* @__PURE__ */ __commonJSMin(((exports)
5607
5588
  DidChangeWorkspaceFoldersNotification.capabilities = messages_1.CM.create(void 0, "workspace.workspaceFolders.changeNotifications");
5608
5589
  })(DidChangeWorkspaceFoldersNotification || (exports.DidChangeWorkspaceFoldersNotification = DidChangeWorkspaceFoldersNotification = {}));
5609
5590
  }));
5610
- //#endregion
5611
- //#region ../../node_modules/.pnpm/vscode-languageserver-protocol@3.18.4/node_modules/vscode-languageserver-protocol/lib/common/protocol.configuration.js
5591
+ // ../../node_modules/.pnpm/vscode-languageserver-protocol@3.18.4/node_modules/vscode-languageserver-protocol/lib/common/protocol.configuration.js
5612
5592
  var require_protocol_configuration = /* @__PURE__ */ __commonJSMin(((exports) => {
5613
5593
  Object.defineProperty(exports, "__esModule", { value: true });
5614
5594
  exports.ConfigurationRequest = void 0;
@@ -5630,8 +5610,7 @@ var require_protocol_configuration = /* @__PURE__ */ __commonJSMin(((exports) =>
5630
5610
  ConfigurationRequest.capabilities = messages_1.CM.create("workspace.configuration", void 0);
5631
5611
  })(ConfigurationRequest || (exports.ConfigurationRequest = ConfigurationRequest = {}));
5632
5612
  }));
5633
- //#endregion
5634
- //#region ../../node_modules/.pnpm/vscode-languageserver-protocol@3.18.4/node_modules/vscode-languageserver-protocol/lib/common/protocol.colorProvider.js
5613
+ // ../../node_modules/.pnpm/vscode-languageserver-protocol@3.18.4/node_modules/vscode-languageserver-protocol/lib/common/protocol.colorProvider.js
5635
5614
  var require_protocol_colorProvider = /* @__PURE__ */ __commonJSMin(((exports) => {
5636
5615
  Object.defineProperty(exports, "__esModule", { value: true });
5637
5616
  exports.ColorPresentationRequest = exports.DocumentColorRequest = void 0;
@@ -5663,8 +5642,7 @@ var require_protocol_colorProvider = /* @__PURE__ */ __commonJSMin(((exports) =>
5663
5642
  ColorPresentationRequest.capabilities = messages_1.CM.create("textDocument.colorProvider", "colorProvider");
5664
5643
  })(ColorPresentationRequest || (exports.ColorPresentationRequest = ColorPresentationRequest = {}));
5665
5644
  }));
5666
- //#endregion
5667
- //#region ../../node_modules/.pnpm/vscode-languageserver-protocol@3.18.4/node_modules/vscode-languageserver-protocol/lib/common/protocol.foldingRange.js
5645
+ // ../../node_modules/.pnpm/vscode-languageserver-protocol@3.18.4/node_modules/vscode-languageserver-protocol/lib/common/protocol.foldingRange.js
5668
5646
  var require_protocol_foldingRange = /* @__PURE__ */ __commonJSMin(((exports) => {
5669
5647
  Object.defineProperty(exports, "__esModule", { value: true });
5670
5648
  exports.FoldingRangeRefreshRequest = exports.FoldingRangeRequest = void 0;
@@ -5695,8 +5673,7 @@ var require_protocol_foldingRange = /* @__PURE__ */ __commonJSMin(((exports) =>
5695
5673
  FoldingRangeRefreshRequest.capabilities = messages_1.CM.create("workspace.foldingRange.refreshSupport", void 0);
5696
5674
  })(FoldingRangeRefreshRequest || (exports.FoldingRangeRefreshRequest = FoldingRangeRefreshRequest = {}));
5697
5675
  }));
5698
- //#endregion
5699
- //#region ../../node_modules/.pnpm/vscode-languageserver-protocol@3.18.4/node_modules/vscode-languageserver-protocol/lib/common/protocol.declaration.js
5676
+ // ../../node_modules/.pnpm/vscode-languageserver-protocol@3.18.4/node_modules/vscode-languageserver-protocol/lib/common/protocol.declaration.js
5700
5677
  var require_protocol_declaration = /* @__PURE__ */ __commonJSMin(((exports) => {
5701
5678
  Object.defineProperty(exports, "__esModule", { value: true });
5702
5679
  exports.DeclarationRequest = void 0;
@@ -5715,8 +5692,7 @@ var require_protocol_declaration = /* @__PURE__ */ __commonJSMin(((exports) => {
5715
5692
  DeclarationRequest.capabilities = messages_1.CM.create("textDocument.declaration", "declarationProvider");
5716
5693
  })(DeclarationRequest || (exports.DeclarationRequest = DeclarationRequest = {}));
5717
5694
  }));
5718
- //#endregion
5719
- //#region ../../node_modules/.pnpm/vscode-languageserver-protocol@3.18.4/node_modules/vscode-languageserver-protocol/lib/common/protocol.selectionRange.js
5695
+ // ../../node_modules/.pnpm/vscode-languageserver-protocol@3.18.4/node_modules/vscode-languageserver-protocol/lib/common/protocol.selectionRange.js
5720
5696
  var require_protocol_selectionRange = /* @__PURE__ */ __commonJSMin(((exports) => {
5721
5697
  Object.defineProperty(exports, "__esModule", { value: true });
5722
5698
  exports.SelectionRangeRequest = void 0;
@@ -5735,8 +5711,7 @@ var require_protocol_selectionRange = /* @__PURE__ */ __commonJSMin(((exports) =
5735
5711
  SelectionRangeRequest.capabilities = messages_1.CM.create("textDocument.selectionRange", "selectionRangeProvider");
5736
5712
  })(SelectionRangeRequest || (exports.SelectionRangeRequest = SelectionRangeRequest = {}));
5737
5713
  }));
5738
- //#endregion
5739
- //#region ../../node_modules/.pnpm/vscode-languageserver-protocol@3.18.4/node_modules/vscode-languageserver-protocol/lib/common/protocol.progress.js
5714
+ // ../../node_modules/.pnpm/vscode-languageserver-protocol@3.18.4/node_modules/vscode-languageserver-protocol/lib/common/protocol.progress.js
5740
5715
  var require_protocol_progress = /* @__PURE__ */ __commonJSMin(((exports) => {
5741
5716
  Object.defineProperty(exports, "__esModule", { value: true });
5742
5717
  exports.WorkDoneProgressCancelNotification = exports.WorkDoneProgressCreateRequest = exports.WorkDoneProgress = void 0;
@@ -5772,8 +5747,7 @@ var require_protocol_progress = /* @__PURE__ */ __commonJSMin(((exports) => {
5772
5747
  WorkDoneProgressCancelNotification.type = new messages_1.ProtocolNotificationType(WorkDoneProgressCancelNotification.method);
5773
5748
  })(WorkDoneProgressCancelNotification || (exports.WorkDoneProgressCancelNotification = WorkDoneProgressCancelNotification = {}));
5774
5749
  }));
5775
- //#endregion
5776
- //#region ../../node_modules/.pnpm/vscode-languageserver-protocol@3.18.4/node_modules/vscode-languageserver-protocol/lib/common/protocol.callHierarchy.js
5750
+ // ../../node_modules/.pnpm/vscode-languageserver-protocol@3.18.4/node_modules/vscode-languageserver-protocol/lib/common/protocol.callHierarchy.js
5777
5751
  var require_protocol_callHierarchy = /* @__PURE__ */ __commonJSMin(((exports) => {
5778
5752
  Object.defineProperty(exports, "__esModule", { value: true });
5779
5753
  exports.CallHierarchyOutgoingCallsRequest = exports.CallHierarchyIncomingCallsRequest = exports.CallHierarchyPrepareRequest = void 0;
@@ -5816,8 +5790,7 @@ var require_protocol_callHierarchy = /* @__PURE__ */ __commonJSMin(((exports) =>
5816
5790
  CallHierarchyOutgoingCallsRequest.capabilities = messages_1.CM.create("textDocument.callHierarchy", "callHierarchyProvider");
5817
5791
  })(CallHierarchyOutgoingCallsRequest || (exports.CallHierarchyOutgoingCallsRequest = CallHierarchyOutgoingCallsRequest = {}));
5818
5792
  }));
5819
- //#endregion
5820
- //#region ../../node_modules/.pnpm/vscode-languageserver-protocol@3.18.4/node_modules/vscode-languageserver-protocol/lib/common/protocol.semanticTokens.js
5793
+ // ../../node_modules/.pnpm/vscode-languageserver-protocol@3.18.4/node_modules/vscode-languageserver-protocol/lib/common/protocol.semanticTokens.js
5821
5794
  var require_protocol_semanticTokens = /* @__PURE__ */ __commonJSMin(((exports) => {
5822
5795
  Object.defineProperty(exports, "__esModule", { value: true });
5823
5796
  exports.SemanticTokensRefreshRequest = exports.SemanticTokensRangeRequest = exports.SemanticTokensDeltaRequest = exports.SemanticTokensRequest = exports.SemanticTokensRegistrationType = exports.TokenFormat = void 0;
@@ -5875,8 +5848,7 @@ var require_protocol_semanticTokens = /* @__PURE__ */ __commonJSMin(((exports) =
5875
5848
  SemanticTokensRefreshRequest.capabilities = messages_1.CM.create("workspace.semanticTokens.refreshSupport", void 0);
5876
5849
  })(SemanticTokensRefreshRequest || (exports.SemanticTokensRefreshRequest = SemanticTokensRefreshRequest = {}));
5877
5850
  }));
5878
- //#endregion
5879
- //#region ../../node_modules/.pnpm/vscode-languageserver-protocol@3.18.4/node_modules/vscode-languageserver-protocol/lib/common/protocol.showDocument.js
5851
+ // ../../node_modules/.pnpm/vscode-languageserver-protocol@3.18.4/node_modules/vscode-languageserver-protocol/lib/common/protocol.showDocument.js
5880
5852
  var require_protocol_showDocument = /* @__PURE__ */ __commonJSMin(((exports) => {
5881
5853
  Object.defineProperty(exports, "__esModule", { value: true });
5882
5854
  exports.ShowDocumentRequest = void 0;
@@ -5897,8 +5869,7 @@ var require_protocol_showDocument = /* @__PURE__ */ __commonJSMin(((exports) =>
5897
5869
  ShowDocumentRequest.capabilities = messages_1.CM.create("window.showDocument.support", void 0);
5898
5870
  })(ShowDocumentRequest || (exports.ShowDocumentRequest = ShowDocumentRequest = {}));
5899
5871
  }));
5900
- //#endregion
5901
- //#region ../../node_modules/.pnpm/vscode-languageserver-protocol@3.18.4/node_modules/vscode-languageserver-protocol/lib/common/protocol.linkedEditingRange.js
5872
+ // ../../node_modules/.pnpm/vscode-languageserver-protocol@3.18.4/node_modules/vscode-languageserver-protocol/lib/common/protocol.linkedEditingRange.js
5902
5873
  var require_protocol_linkedEditingRange = /* @__PURE__ */ __commonJSMin(((exports) => {
5903
5874
  Object.defineProperty(exports, "__esModule", { value: true });
5904
5875
  exports.LinkedEditingRangeRequest = void 0;
@@ -5916,8 +5887,7 @@ var require_protocol_linkedEditingRange = /* @__PURE__ */ __commonJSMin(((export
5916
5887
  LinkedEditingRangeRequest.capabilities = messages_1.CM.create("textDocument.linkedEditingRange", "linkedEditingRangeProvider");
5917
5888
  })(LinkedEditingRangeRequest || (exports.LinkedEditingRangeRequest = LinkedEditingRangeRequest = {}));
5918
5889
  }));
5919
- //#endregion
5920
- //#region ../../node_modules/.pnpm/vscode-languageserver-protocol@3.18.4/node_modules/vscode-languageserver-protocol/lib/common/protocol.fileOperations.js
5890
+ // ../../node_modules/.pnpm/vscode-languageserver-protocol@3.18.4/node_modules/vscode-languageserver-protocol/lib/common/protocol.fileOperations.js
5921
5891
  var require_protocol_fileOperations = /* @__PURE__ */ __commonJSMin(((exports) => {
5922
5892
  Object.defineProperty(exports, "__esModule", { value: true });
5923
5893
  exports.WillDeleteFilesRequest = exports.DidDeleteFilesNotification = exports.DidRenameFilesNotification = exports.WillRenameFilesRequest = exports.DidCreateFilesNotification = exports.WillCreateFilesRequest = exports.FileOperationPatternKind = void 0;
@@ -6022,8 +5992,7 @@ var require_protocol_fileOperations = /* @__PURE__ */ __commonJSMin(((exports) =
6022
5992
  WillDeleteFilesRequest.capabilities = messages_1.CM.create("workspace.fileOperations.willDelete", "workspace.fileOperations.willDelete");
6023
5993
  })(WillDeleteFilesRequest || (exports.WillDeleteFilesRequest = WillDeleteFilesRequest = {}));
6024
5994
  }));
6025
- //#endregion
6026
- //#region ../../node_modules/.pnpm/vscode-languageserver-protocol@3.18.4/node_modules/vscode-languageserver-protocol/lib/common/protocol.moniker.js
5995
+ // ../../node_modules/.pnpm/vscode-languageserver-protocol@3.18.4/node_modules/vscode-languageserver-protocol/lib/common/protocol.moniker.js
6027
5996
  var require_protocol_moniker = /* @__PURE__ */ __commonJSMin(((exports) => {
6028
5997
  Object.defineProperty(exports, "__esModule", { value: true });
6029
5998
  exports.MonikerRequest = exports.MonikerKind = exports.UniquenessLevel = void 0;
@@ -6090,8 +6059,7 @@ var require_protocol_moniker = /* @__PURE__ */ __commonJSMin(((exports) => {
6090
6059
  MonikerRequest.capabilities = messages_1.CM.create("textDocument.moniker", "monikerProvider");
6091
6060
  })(MonikerRequest || (exports.MonikerRequest = MonikerRequest = {}));
6092
6061
  }));
6093
- //#endregion
6094
- //#region ../../node_modules/.pnpm/vscode-languageserver-protocol@3.18.4/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeHierarchy.js
6062
+ // ../../node_modules/.pnpm/vscode-languageserver-protocol@3.18.4/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeHierarchy.js
6095
6063
  var require_protocol_typeHierarchy = /* @__PURE__ */ __commonJSMin(((exports) => {
6096
6064
  Object.defineProperty(exports, "__esModule", { value: true });
6097
6065
  exports.TypeHierarchySubtypesRequest = exports.TypeHierarchySupertypesRequest = exports.TypeHierarchyPrepareRequest = void 0;
@@ -6132,8 +6100,7 @@ var require_protocol_typeHierarchy = /* @__PURE__ */ __commonJSMin(((exports) =>
6132
6100
  TypeHierarchySubtypesRequest.type = new messages_1.ProtocolRequestType(TypeHierarchySubtypesRequest.method);
6133
6101
  })(TypeHierarchySubtypesRequest || (exports.TypeHierarchySubtypesRequest = TypeHierarchySubtypesRequest = {}));
6134
6102
  }));
6135
- //#endregion
6136
- //#region ../../node_modules/.pnpm/vscode-languageserver-protocol@3.18.4/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineValue.js
6103
+ // ../../node_modules/.pnpm/vscode-languageserver-protocol@3.18.4/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineValue.js
6137
6104
  var require_protocol_inlineValue = /* @__PURE__ */ __commonJSMin(((exports) => {
6138
6105
  Object.defineProperty(exports, "__esModule", { value: true });
6139
6106
  exports.InlineValueRefreshRequest = exports.InlineValueRequest = void 0;
@@ -6163,8 +6130,7 @@ var require_protocol_inlineValue = /* @__PURE__ */ __commonJSMin(((exports) => {
6163
6130
  InlineValueRefreshRequest.capabilities = messages_1.CM.create("workspace.inlineValue.refreshSupport", void 0);
6164
6131
  })(InlineValueRefreshRequest || (exports.InlineValueRefreshRequest = InlineValueRefreshRequest = {}));
6165
6132
  }));
6166
- //#endregion
6167
- //#region ../../node_modules/.pnpm/vscode-languageserver-protocol@3.18.4/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlayHint.js
6133
+ // ../../node_modules/.pnpm/vscode-languageserver-protocol@3.18.4/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlayHint.js
6168
6134
  var require_protocol_inlayHint = /* @__PURE__ */ __commonJSMin(((exports) => {
6169
6135
  Object.defineProperty(exports, "__esModule", { value: true });
6170
6136
  exports.InlayHintRefreshRequest = exports.InlayHintResolveRequest = exports.InlayHintRequest = void 0;
@@ -6208,8 +6174,7 @@ var require_protocol_inlayHint = /* @__PURE__ */ __commonJSMin(((exports) => {
6208
6174
  InlayHintRefreshRequest.capabilities = messages_1.CM.create("workspace.inlayHint.refreshSupport", void 0);
6209
6175
  })(InlayHintRefreshRequest || (exports.InlayHintRefreshRequest = InlayHintRefreshRequest = {}));
6210
6176
  }));
6211
- //#endregion
6212
- //#region ../../node_modules/.pnpm/vscode-languageserver-protocol@3.18.4/node_modules/vscode-languageserver-protocol/lib/common/protocol.diagnostic.js
6177
+ // ../../node_modules/.pnpm/vscode-languageserver-protocol@3.18.4/node_modules/vscode-languageserver-protocol/lib/common/protocol.diagnostic.js
6213
6178
  var require_protocol_diagnostic = /* @__PURE__ */ __commonJSMin(((exports, module, this$11) => {
6214
6179
  var __createBinding = this$11 && this$11.__createBinding || (Object.create ? (function(o, m, k, k2) {
6215
6180
  if (k2 === void 0) k2 = k;
@@ -6326,8 +6291,7 @@ var require_protocol_diagnostic = /* @__PURE__ */ __commonJSMin(((exports, modul
6326
6291
  DiagnosticRefreshRequest.capabilities = messages_1.CM.create("workspace.diagnostics.refreshSupport", void 0);
6327
6292
  })(DiagnosticRefreshRequest || (exports.DiagnosticRefreshRequest = DiagnosticRefreshRequest = {}));
6328
6293
  }));
6329
- //#endregion
6330
- //#region ../../node_modules/.pnpm/vscode-languageserver-protocol@3.18.4/node_modules/vscode-languageserver-protocol/lib/common/protocol.notebook.js
6294
+ // ../../node_modules/.pnpm/vscode-languageserver-protocol@3.18.4/node_modules/vscode-languageserver-protocol/lib/common/protocol.notebook.js
6331
6295
  var require_protocol_notebook = /* @__PURE__ */ __commonJSMin(((exports, module, this$10) => {
6332
6296
  var __createBinding = this$10 && this$10.__createBinding || (Object.create ? (function(o, m, k, k2) {
6333
6297
  if (k2 === void 0) k2 = k;
@@ -6550,8 +6514,7 @@ var require_protocol_notebook = /* @__PURE__ */ __commonJSMin(((exports, module,
6550
6514
  DidCloseNotebookDocumentNotification.registrationMethod = NotebookDocumentSyncRegistrationType.method;
6551
6515
  })(DidCloseNotebookDocumentNotification || (exports.DidCloseNotebookDocumentNotification = DidCloseNotebookDocumentNotification = {}));
6552
6516
  }));
6553
- //#endregion
6554
- //#region ../../node_modules/.pnpm/vscode-languageserver-protocol@3.18.4/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineCompletion.js
6517
+ // ../../node_modules/.pnpm/vscode-languageserver-protocol@3.18.4/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineCompletion.js
6555
6518
  var require_protocol_inlineCompletion = /* @__PURE__ */ __commonJSMin(((exports) => {
6556
6519
  Object.defineProperty(exports, "__esModule", { value: true });
6557
6520
  exports.InlineCompletionRequest = void 0;
@@ -6571,8 +6534,7 @@ var require_protocol_inlineCompletion = /* @__PURE__ */ __commonJSMin(((exports)
6571
6534
  InlineCompletionRequest.capabilities = messages_1.CM.create("textDocument.inlineCompletion", "inlineCompletionProvider");
6572
6535
  })(InlineCompletionRequest || (exports.InlineCompletionRequest = InlineCompletionRequest = {}));
6573
6536
  }));
6574
- //#endregion
6575
- //#region ../../node_modules/.pnpm/vscode-languageserver-protocol@3.18.4/node_modules/vscode-languageserver-protocol/lib/common/protocol.textDocumentContent.js
6537
+ // ../../node_modules/.pnpm/vscode-languageserver-protocol@3.18.4/node_modules/vscode-languageserver-protocol/lib/common/protocol.textDocumentContent.js
6576
6538
  var require_protocol_textDocumentContent = /* @__PURE__ */ __commonJSMin(((exports) => {
6577
6539
  Object.defineProperty(exports, "__esModule", { value: true });
6578
6540
  exports.TextDocumentContentRefreshRequest = exports.TextDocumentContentRequest = void 0;
@@ -6603,8 +6565,7 @@ var require_protocol_textDocumentContent = /* @__PURE__ */ __commonJSMin(((expor
6603
6565
  TextDocumentContentRefreshRequest.type = new messages_1.ProtocolRequestType(TextDocumentContentRefreshRequest.method);
6604
6566
  })(TextDocumentContentRefreshRequest || (exports.TextDocumentContentRefreshRequest = TextDocumentContentRefreshRequest = {}));
6605
6567
  }));
6606
- //#endregion
6607
- //#region ../../node_modules/.pnpm/vscode-languageserver-protocol@3.18.4/node_modules/vscode-languageserver-protocol/lib/common/protocol.js
6568
+ // ../../node_modules/.pnpm/vscode-languageserver-protocol@3.18.4/node_modules/vscode-languageserver-protocol/lib/common/protocol.js
6608
6569
  var require_protocol = /* @__PURE__ */ __commonJSMin(((exports, module, this$9) => {
6609
6570
  var __createBinding = this$9 && this$9.__createBinding || (Object.create ? (function(o, m, k, k2) {
6610
6571
  if (k2 === void 0) k2 = k;
@@ -7928,8 +7889,7 @@ var require_protocol = /* @__PURE__ */ __commonJSMin(((exports, module, this$9)
7928
7889
  ApplyWorkspaceEditRequest.capabilities = messages_1.CM.create("workspace.applyEdit", void 0);
7929
7890
  })(ApplyWorkspaceEditRequest || (exports.ApplyWorkspaceEditRequest = ApplyWorkspaceEditRequest = {}));
7930
7891
  }));
7931
- //#endregion
7932
- //#region ../../node_modules/.pnpm/vscode-languageserver-protocol@3.18.4/node_modules/vscode-languageserver-protocol/lib/common/connection.js
7892
+ // ../../node_modules/.pnpm/vscode-languageserver-protocol@3.18.4/node_modules/vscode-languageserver-protocol/lib/common/connection.js
7933
7893
  var require_connection = /* @__PURE__ */ __commonJSMin(((exports) => {
7934
7894
  Object.defineProperty(exports, "__esModule", { value: true });
7935
7895
  exports.createProtocolConnection = createProtocolConnection;
@@ -7939,8 +7899,7 @@ var require_connection = /* @__PURE__ */ __commonJSMin(((exports) => {
7939
7899
  return (0, vscode_jsonrpc_1.createMessageConnection)(input, output, logger, options);
7940
7900
  }
7941
7901
  }));
7942
- //#endregion
7943
- //#region ../../node_modules/.pnpm/vscode-languageserver-protocol@3.18.4/node_modules/vscode-languageserver-protocol/lib/common/api.js
7902
+ // ../../node_modules/.pnpm/vscode-languageserver-protocol@3.18.4/node_modules/vscode-languageserver-protocol/lib/common/api.js
7944
7903
  var require_api$1 = /* @__PURE__ */ __commonJSMin(((exports, module, this$8) => {
7945
7904
  var __createBinding = this$8 && this$8.__createBinding || (Object.create ? (function(o, m, k, k2) {
7946
7905
  if (k2 === void 0) k2 = k;
@@ -8023,8 +7982,7 @@ var require_api$1 = /* @__PURE__ */ __commonJSMin(((exports, module, this$8) =>
8023
7982
  LSPErrorCodes.lspReservedErrorRangeEnd = -32800;
8024
7983
  })(LSPErrorCodes || (exports.LSPErrorCodes = LSPErrorCodes = {}));
8025
7984
  }));
8026
- //#endregion
8027
- //#region ../../node_modules/.pnpm/vscode-languageserver@10.1.2/node_modules/vscode-languageserver/lib/common/utils/uuid.js
7985
+ // ../../node_modules/.pnpm/vscode-languageserver@10.1.2/node_modules/vscode-languageserver/lib/common/utils/uuid.js
8028
7986
  var require_uuid = /* @__PURE__ */ __commonJSMin(((exports) => {
8029
7987
  Object.defineProperty(exports, "__esModule", { value: true });
8030
7988
  exports.empty = void 0;
@@ -8140,8 +8098,7 @@ var require_uuid = /* @__PURE__ */ __commonJSMin(((exports) => {
8140
8098
  return v4().asHex();
8141
8099
  }
8142
8100
  }));
8143
- //#endregion
8144
- //#region ../../node_modules/.pnpm/vscode-languageserver@10.1.2/node_modules/vscode-languageserver/lib/common/progress.js
8101
+ // ../../node_modules/.pnpm/vscode-languageserver@10.1.2/node_modules/vscode-languageserver/lib/common/progress.js
8145
8102
  var require_progress = /* @__PURE__ */ __commonJSMin(((exports) => {
8146
8103
  Object.defineProperty(exports, "__esModule", { value: true });
8147
8104
  exports.ProgressFeature = exports.WorkDoneProgressReporter = void 0;
@@ -8290,8 +8247,7 @@ var require_progress = /* @__PURE__ */ __commonJSMin(((exports) => {
8290
8247
  return new ResultProgressReporterImpl(connection, token);
8291
8248
  }
8292
8249
  }));
8293
- //#endregion
8294
- //#region ../../node_modules/.pnpm/vscode-languageserver@10.1.2/node_modules/vscode-languageserver/lib/common/configuration.js
8250
+ // ../../node_modules/.pnpm/vscode-languageserver@10.1.2/node_modules/vscode-languageserver/lib/common/configuration.js
8295
8251
  var require_configuration = /* @__PURE__ */ __commonJSMin(((exports, module, this$7) => {
8296
8252
  var __createBinding = this$7 && this$7.__createBinding || (Object.create ? (function(o, m, k, k2) {
8297
8253
  if (k2 === void 0) k2 = k;
@@ -8356,8 +8312,7 @@ var require_configuration = /* @__PURE__ */ __commonJSMin(((exports, module, thi
8356
8312
  };
8357
8313
  exports.ConfigurationFeature = ConfigurationFeature;
8358
8314
  }));
8359
- //#endregion
8360
- //#region ../../node_modules/.pnpm/vscode-languageserver@10.1.2/node_modules/vscode-languageserver/lib/common/workspaceFolder.js
8315
+ // ../../node_modules/.pnpm/vscode-languageserver@10.1.2/node_modules/vscode-languageserver/lib/common/workspaceFolder.js
8361
8316
  var require_workspaceFolder = /* @__PURE__ */ __commonJSMin(((exports) => {
8362
8317
  Object.defineProperty(exports, "__esModule", { value: true });
8363
8318
  exports.WorkspaceFoldersFeature = void 0;
@@ -8398,8 +8353,7 @@ var require_workspaceFolder = /* @__PURE__ */ __commonJSMin(((exports) => {
8398
8353
  };
8399
8354
  exports.WorkspaceFoldersFeature = WorkspaceFoldersFeature;
8400
8355
  }));
8401
- //#endregion
8402
- //#region ../../node_modules/.pnpm/vscode-languageserver@10.1.2/node_modules/vscode-languageserver/lib/common/callHierarchy.js
8356
+ // ../../node_modules/.pnpm/vscode-languageserver@10.1.2/node_modules/vscode-languageserver/lib/common/callHierarchy.js
8403
8357
  var require_callHierarchy = /* @__PURE__ */ __commonJSMin(((exports) => {
8404
8358
  Object.defineProperty(exports, "__esModule", { value: true });
8405
8359
  exports.CallHierarchyFeature = void 0;
@@ -8431,8 +8385,7 @@ var require_callHierarchy = /* @__PURE__ */ __commonJSMin(((exports) => {
8431
8385
  };
8432
8386
  exports.CallHierarchyFeature = CallHierarchyFeature;
8433
8387
  }));
8434
- //#endregion
8435
- //#region ../../node_modules/.pnpm/vscode-languageserver@10.1.2/node_modules/vscode-languageserver/lib/common/semanticTokens.js
8388
+ // ../../node_modules/.pnpm/vscode-languageserver@10.1.2/node_modules/vscode-languageserver/lib/common/semanticTokens.js
8436
8389
  var require_semanticTokens = /* @__PURE__ */ __commonJSMin(((exports) => {
8437
8390
  Object.defineProperty(exports, "__esModule", { value: true });
8438
8391
  exports.SemanticTokensBuilder = exports.SemanticTokensDiff = exports.SemanticTokensFeature = void 0;
@@ -8646,8 +8599,7 @@ var require_semanticTokens = /* @__PURE__ */ __commonJSMin(((exports) => {
8646
8599
  }
8647
8600
  };
8648
8601
  }));
8649
- //#endregion
8650
- //#region ../../node_modules/.pnpm/vscode-languageserver@10.1.2/node_modules/vscode-languageserver/lib/common/showDocument.js
8602
+ // ../../node_modules/.pnpm/vscode-languageserver@10.1.2/node_modules/vscode-languageserver/lib/common/showDocument.js
8651
8603
  var require_showDocument = /* @__PURE__ */ __commonJSMin(((exports) => {
8652
8604
  Object.defineProperty(exports, "__esModule", { value: true });
8653
8605
  exports.ShowDocumentFeature = void 0;
@@ -8661,8 +8613,7 @@ var require_showDocument = /* @__PURE__ */ __commonJSMin(((exports) => {
8661
8613
  };
8662
8614
  exports.ShowDocumentFeature = ShowDocumentFeature;
8663
8615
  }));
8664
- //#endregion
8665
- //#region ../../node_modules/.pnpm/vscode-languageserver@10.1.2/node_modules/vscode-languageserver/lib/common/fileOperations.js
8616
+ // ../../node_modules/.pnpm/vscode-languageserver@10.1.2/node_modules/vscode-languageserver/lib/common/fileOperations.js
8666
8617
  var require_fileOperations = /* @__PURE__ */ __commonJSMin(((exports) => {
8667
8618
  Object.defineProperty(exports, "__esModule", { value: true });
8668
8619
  exports.FileOperationsFeature = void 0;
@@ -8703,8 +8654,7 @@ var require_fileOperations = /* @__PURE__ */ __commonJSMin(((exports) => {
8703
8654
  };
8704
8655
  exports.FileOperationsFeature = FileOperationsFeature;
8705
8656
  }));
8706
- //#endregion
8707
- //#region ../../node_modules/.pnpm/vscode-languageserver@10.1.2/node_modules/vscode-languageserver/lib/common/linkedEditingRange.js
8657
+ // ../../node_modules/.pnpm/vscode-languageserver@10.1.2/node_modules/vscode-languageserver/lib/common/linkedEditingRange.js
8708
8658
  var require_linkedEditingRange = /* @__PURE__ */ __commonJSMin(((exports) => {
8709
8659
  Object.defineProperty(exports, "__esModule", { value: true });
8710
8660
  exports.LinkedEditingRangeFeature = void 0;
@@ -8720,8 +8670,7 @@ var require_linkedEditingRange = /* @__PURE__ */ __commonJSMin(((exports) => {
8720
8670
  };
8721
8671
  exports.LinkedEditingRangeFeature = LinkedEditingRangeFeature;
8722
8672
  }));
8723
- //#endregion
8724
- //#region ../../node_modules/.pnpm/vscode-languageserver@10.1.2/node_modules/vscode-languageserver/lib/common/typeHierarchy.js
8673
+ // ../../node_modules/.pnpm/vscode-languageserver@10.1.2/node_modules/vscode-languageserver/lib/common/typeHierarchy.js
8725
8674
  var require_typeHierarchy = /* @__PURE__ */ __commonJSMin(((exports) => {
8726
8675
  Object.defineProperty(exports, "__esModule", { value: true });
8727
8676
  exports.TypeHierarchyFeature = void 0;
@@ -8753,8 +8702,7 @@ var require_typeHierarchy = /* @__PURE__ */ __commonJSMin(((exports) => {
8753
8702
  };
8754
8703
  exports.TypeHierarchyFeature = TypeHierarchyFeature;
8755
8704
  }));
8756
- //#endregion
8757
- //#region ../../node_modules/.pnpm/vscode-languageserver@10.1.2/node_modules/vscode-languageserver/lib/common/inlineValue.js
8705
+ // ../../node_modules/.pnpm/vscode-languageserver@10.1.2/node_modules/vscode-languageserver/lib/common/inlineValue.js
8758
8706
  var require_inlineValue = /* @__PURE__ */ __commonJSMin(((exports) => {
8759
8707
  Object.defineProperty(exports, "__esModule", { value: true });
8760
8708
  exports.InlineValueFeature = void 0;
@@ -8777,8 +8725,7 @@ var require_inlineValue = /* @__PURE__ */ __commonJSMin(((exports) => {
8777
8725
  };
8778
8726
  exports.InlineValueFeature = InlineValueFeature;
8779
8727
  }));
8780
- //#endregion
8781
- //#region ../../node_modules/.pnpm/vscode-languageserver@10.1.2/node_modules/vscode-languageserver/lib/common/foldingRange.js
8728
+ // ../../node_modules/.pnpm/vscode-languageserver@10.1.2/node_modules/vscode-languageserver/lib/common/foldingRange.js
8782
8729
  var require_foldingRange = /* @__PURE__ */ __commonJSMin(((exports) => {
8783
8730
  Object.defineProperty(exports, "__esModule", { value: true });
8784
8731
  exports.FoldingRangeFeature = void 0;
@@ -8802,8 +8749,7 @@ var require_foldingRange = /* @__PURE__ */ __commonJSMin(((exports) => {
8802
8749
  };
8803
8750
  exports.FoldingRangeFeature = FoldingRangeFeature;
8804
8751
  }));
8805
- //#endregion
8806
- //#region ../../node_modules/.pnpm/vscode-languageserver@10.1.2/node_modules/vscode-languageserver/lib/common/inlayHint.js
8752
+ // ../../node_modules/.pnpm/vscode-languageserver@10.1.2/node_modules/vscode-languageserver/lib/common/inlayHint.js
8807
8753
  var require_inlayHint = /* @__PURE__ */ __commonJSMin(((exports) => {
8808
8754
  Object.defineProperty(exports, "__esModule", { value: true });
8809
8755
  exports.InlayHintFeature = void 0;
@@ -8831,8 +8777,7 @@ var require_inlayHint = /* @__PURE__ */ __commonJSMin(((exports) => {
8831
8777
  };
8832
8778
  exports.InlayHintFeature = InlayHintFeature;
8833
8779
  }));
8834
- //#endregion
8835
- //#region ../../node_modules/.pnpm/vscode-languageserver@10.1.2/node_modules/vscode-languageserver/lib/common/diagnostic.js
8780
+ // ../../node_modules/.pnpm/vscode-languageserver@10.1.2/node_modules/vscode-languageserver/lib/common/diagnostic.js
8836
8781
  var require_diagnostic = /* @__PURE__ */ __commonJSMin(((exports) => {
8837
8782
  Object.defineProperty(exports, "__esModule", { value: true });
8838
8783
  exports.DiagnosticFeature = void 0;
@@ -8860,8 +8805,7 @@ var require_diagnostic = /* @__PURE__ */ __commonJSMin(((exports) => {
8860
8805
  };
8861
8806
  exports.DiagnosticFeature = DiagnosticFeature;
8862
8807
  }));
8863
- //#endregion
8864
- //#region ../../node_modules/.pnpm/vscode-languageserver@10.1.2/node_modules/vscode-languageserver/lib/common/textDocuments.js
8808
+ // ../../node_modules/.pnpm/vscode-languageserver@10.1.2/node_modules/vscode-languageserver/lib/common/textDocuments.js
8865
8809
  var require_textDocuments = /* @__PURE__ */ __commonJSMin(((exports) => {
8866
8810
  Object.defineProperty(exports, "__esModule", { value: true });
8867
8811
  exports.TextDocuments = void 0;
@@ -9035,8 +8979,7 @@ var require_textDocuments = /* @__PURE__ */ __commonJSMin(((exports) => {
9035
8979
  };
9036
8980
  exports.TextDocuments = TextDocuments;
9037
8981
  }));
9038
- //#endregion
9039
- //#region ../../node_modules/.pnpm/vscode-languageserver@10.1.2/node_modules/vscode-languageserver/lib/common/notebook.js
8982
+ // ../../node_modules/.pnpm/vscode-languageserver@10.1.2/node_modules/vscode-languageserver/lib/common/notebook.js
9040
8983
  var require_notebook = /* @__PURE__ */ __commonJSMin(((exports) => {
9041
8984
  Object.defineProperty(exports, "__esModule", { value: true });
9042
8985
  exports.NotebookDocuments = exports.NotebookSyncFeature = void 0;
@@ -9279,8 +9222,7 @@ var require_notebook = /* @__PURE__ */ __commonJSMin(((exports) => {
9279
9222
  };
9280
9223
  exports.NotebookDocuments = NotebookDocuments;
9281
9224
  }));
9282
- //#endregion
9283
- //#region ../../node_modules/.pnpm/vscode-languageserver@10.1.2/node_modules/vscode-languageserver/lib/common/moniker.js
9225
+ // ../../node_modules/.pnpm/vscode-languageserver@10.1.2/node_modules/vscode-languageserver/lib/common/moniker.js
9284
9226
  var require_moniker = /* @__PURE__ */ __commonJSMin(((exports) => {
9285
9227
  Object.defineProperty(exports, "__esModule", { value: true });
9286
9228
  exports.MonikerFeature = void 0;
@@ -9299,8 +9241,7 @@ var require_moniker = /* @__PURE__ */ __commonJSMin(((exports) => {
9299
9241
  };
9300
9242
  exports.MonikerFeature = MonikerFeature;
9301
9243
  }));
9302
- //#endregion
9303
- //#region ../../node_modules/.pnpm/vscode-languageserver@10.1.2/node_modules/vscode-languageserver/lib/common/inlineCompletion.js
9244
+ // ../../node_modules/.pnpm/vscode-languageserver@10.1.2/node_modules/vscode-languageserver/lib/common/inlineCompletion.js
9304
9245
  var require_inlineCompletion = /* @__PURE__ */ __commonJSMin(((exports) => {
9305
9246
  Object.defineProperty(exports, "__esModule", { value: true });
9306
9247
  exports.InlineCompletionFeature = void 0;
@@ -9318,8 +9259,7 @@ var require_inlineCompletion = /* @__PURE__ */ __commonJSMin(((exports) => {
9318
9259
  };
9319
9260
  exports.InlineCompletionFeature = InlineCompletionFeature;
9320
9261
  }));
9321
- //#endregion
9322
- //#region ../../node_modules/.pnpm/vscode-languageserver@10.1.2/node_modules/vscode-languageserver/lib/common/textDocumentContent.js
9262
+ // ../../node_modules/.pnpm/vscode-languageserver@10.1.2/node_modules/vscode-languageserver/lib/common/textDocumentContent.js
9323
9263
  var require_textDocumentContent = /* @__PURE__ */ __commonJSMin(((exports) => {
9324
9264
  Object.defineProperty(exports, "__esModule", { value: true });
9325
9265
  exports.TextDocumentContentFeature = void 0;
@@ -9342,8 +9282,7 @@ var require_textDocumentContent = /* @__PURE__ */ __commonJSMin(((exports) => {
9342
9282
  };
9343
9283
  exports.TextDocumentContentFeature = TextDocumentContentFeature;
9344
9284
  }));
9345
- //#endregion
9346
- //#region ../../node_modules/.pnpm/vscode-languageserver@10.1.2/node_modules/vscode-languageserver/lib/common/server.js
9285
+ // ../../node_modules/.pnpm/vscode-languageserver@10.1.2/node_modules/vscode-languageserver/lib/common/server.js
9347
9286
  var require_server = /* @__PURE__ */ __commonJSMin(((exports, module, this$6) => {
9348
9287
  var __createBinding = this$6 && this$6.__createBinding || (Object.create ? (function(o, m, k, k2) {
9349
9288
  if (k2 === void 0) k2 = k;
@@ -10080,8 +10019,7 @@ var require_server = /* @__PURE__ */ __commonJSMin(((exports, module, this$6) =>
10080
10019
  return protocolConnection;
10081
10020
  }
10082
10021
  }));
10083
- //#endregion
10084
- //#region ../../node_modules/.pnpm/vscode-languageserver@10.1.2/node_modules/vscode-languageserver/lib/node/files.js
10022
+ // ../../node_modules/.pnpm/vscode-languageserver@10.1.2/node_modules/vscode-languageserver/lib/node/files.js
10085
10023
  var require_files = /* @__PURE__ */ __commonJSMin(((exports, module, this$5) => {
10086
10024
  var __createBinding = this$5 && this$5.__createBinding || (Object.create ? (function(o, m, k, k2) {
10087
10025
  if (k2 === void 0) k2 = k;
@@ -10320,8 +10258,7 @@ var require_files = /* @__PURE__ */ __commonJSMin(((exports, module, this$5) =>
10320
10258
  } else return resolve(moduleName, resolveGlobalNodePath(tracer), workspaceRoot, tracer);
10321
10259
  }
10322
10260
  }));
10323
- //#endregion
10324
- //#region ../../node_modules/.pnpm/vscode-jsonrpc@9.0.3/node_modules/vscode-jsonrpc/lib/node/ril.js
10261
+ // ../../node_modules/.pnpm/vscode-jsonrpc@9.0.3/node_modules/vscode-jsonrpc/lib/node/ril.js
10325
10262
  var require_ril = /* @__PURE__ */ __commonJSMin(((exports) => {
10326
10263
  Object.defineProperty(exports, "__esModule", { value: true });
10327
10264
  const util_1 = __require("util");
@@ -10458,8 +10395,7 @@ var require_ril = /* @__PURE__ */ __commonJSMin(((exports) => {
10458
10395
  })(RIL || (RIL = {}));
10459
10396
  exports.default = RIL;
10460
10397
  }));
10461
- //#endregion
10462
- //#region ../../node_modules/.pnpm/vscode-jsonrpc@9.0.3/node_modules/vscode-jsonrpc/lib/node/main.js
10398
+ // ../../node_modules/.pnpm/vscode-jsonrpc@9.0.3/node_modules/vscode-jsonrpc/lib/node/main.js
10463
10399
  var require_main$2 = /* @__PURE__ */ __commonJSMin(((exports, module, this$4) => {
10464
10400
  var __createBinding = this$4 && this$4.__createBinding || (Object.create ? (function(o, m, k, k2) {
10465
10401
  if (k2 === void 0) k2 = k;
@@ -10728,8 +10664,7 @@ var require_main$2 = /* @__PURE__ */ __commonJSMin(((exports, module, this$4) =>
10728
10664
  return (0, api_1.createMessageConnection)(reader, writer, logger, options);
10729
10665
  }
10730
10666
  }));
10731
- //#endregion
10732
- //#region ../../node_modules/.pnpm/vscode-languageserver-protocol@3.18.4/node_modules/vscode-languageserver-protocol/lib/node/main.js
10667
+ // ../../node_modules/.pnpm/vscode-languageserver-protocol@3.18.4/node_modules/vscode-languageserver-protocol/lib/node/main.js
10733
10668
  var require_main$1 = /* @__PURE__ */ __commonJSMin(((exports, module, this$3) => {
10734
10669
  var __createBinding = this$3 && this$3.__createBinding || (Object.create ? (function(o, m, k, k2) {
10735
10670
  if (k2 === void 0) k2 = k;
@@ -10757,8 +10692,7 @@ var require_main$1 = /* @__PURE__ */ __commonJSMin(((exports, module, this$3) =>
10757
10692
  return (0, node_1.createMessageConnection)(input, output, logger, options);
10758
10693
  }
10759
10694
  }));
10760
- //#endregion
10761
- //#region ../../node_modules/.pnpm/vscode-languageserver@10.1.2/node_modules/vscode-languageserver/lib/common/api.js
10695
+ // ../../node_modules/.pnpm/vscode-languageserver@10.1.2/node_modules/vscode-languageserver/lib/common/api.js
10762
10696
  var require_api = /* @__PURE__ */ __commonJSMin(((exports, module, this$2) => {
10763
10697
  var __createBinding = this$2 && this$2.__createBinding || (Object.create ? (function(o, m, k, k2) {
10764
10698
  if (k2 === void 0) k2 = k;
@@ -10814,8 +10748,7 @@ var require_api = /* @__PURE__ */ __commonJSMin(((exports, module, this$2) => {
10814
10748
  ProposedFeatures.all = { __brand: "features" };
10815
10749
  })(ProposedFeatures || (exports.ProposedFeatures = ProposedFeatures = {}));
10816
10750
  }));
10817
- //#endregion
10818
- //#region src/cli/lsp/text.ts
10751
+ // src/cli/lsp/edited.ts
10819
10752
  var import_main = (/* @__PURE__ */ __commonJSMin(((exports, module, this$1) => {
10820
10753
  var __createBinding = this$1 && this$1.__createBinding || (Object.create ? (function(o, m, k, k2) {
10821
10754
  if (k2 === void 0) k2 = k;
@@ -11060,6 +10993,46 @@ var import_main = (/* @__PURE__ */ __commonJSMin(((exports, module, this$1) => {
11060
10993
  };
11061
10994
  }
11062
10995
  })))();
10996
+ /** Literal call sites per id, counted once so the entries loop below stays linear. */
10997
+ function countById(list) {
10998
+ const counts = /* @__PURE__ */ new Map();
10999
+ for (const occurrence of list) counts.set(occurrence.id, (counts.get(occurrence.id) ?? 0) + 1);
11000
+ return counts;
11001
+ }
11002
+ function findEditedText(input) {
11003
+ const { file, current, saved, entries, sitesOf, threshold } = input;
11004
+ const fresh = current.filter((o) => writesText(o) && !entries.has(o.id));
11005
+ if (fresh.length === 0) return null;
11006
+ const candidates = [];
11007
+ const savedCounts = countById(saved);
11008
+ const currentCounts = countById(current);
11009
+ for (const [id, entry] of entries) {
11010
+ if (entry.manualId !== null || entry.source === null) continue;
11011
+ const used = entry.refs.includes(file) ? 1 : 0;
11012
+ const before = Math.max(savedCounts.get(id) ?? 0, used);
11013
+ const now = currentCounts.get(id) ?? 0;
11014
+ if (now >= before) continue;
11015
+ const remaining = sitesOf(id);
11016
+ if (remaining + (before - now) < threshold) continue;
11017
+ candidates.push({
11018
+ id,
11019
+ source: entry.source,
11020
+ remaining
11021
+ });
11022
+ }
11023
+ if (candidates.length === 0) return null;
11024
+ const ids = new Set(fresh.map((o) => o.id));
11025
+ const [only] = candidates;
11026
+ return {
11027
+ paired: candidates.length === 1 && ids.size === 1 && only !== void 0 ? {
11028
+ old: only,
11029
+ id: fresh[0]?.id
11030
+ } : null,
11031
+ candidates,
11032
+ sites: fresh
11033
+ };
11034
+ }
11035
+ // src/cli/lsp/text.ts
11063
11036
  const QUOTES = /* @__PURE__ */ new Set([
11064
11037
  "\"",
11065
11038
  "'",
@@ -11102,7 +11075,7 @@ function offsetOf(text, starts, line, column) {
11102
11075
  const next = index + 1 < starts.length ? starts[index + 1] - 1 : text.length;
11103
11076
  return Math.min(start + Math.max(column, 1) - 1, next);
11104
11077
  }
11105
- function positionOf(starts, offset) {
11078
+ function lspPosition(starts, offset) {
11106
11079
  let low = 0;
11107
11080
  let high = starts.length - 1;
11108
11081
  while (low < high) {
@@ -11119,12 +11092,12 @@ function positionOf(starts, offset) {
11119
11092
  function tokenRange(text, starts, line, column) {
11120
11093
  const start = offsetOf(text, starts, line, column);
11121
11094
  return {
11122
- start: positionOf(starts, start),
11123
- end: positionOf(starts, tokenEnd(text, start))
11095
+ start: lspPosition(starts, start),
11096
+ end: lspPosition(starts, tokenEnd(text, start))
11124
11097
  };
11125
11098
  }
11126
11099
  /** A whole 1-based line, without its indentation and line break. */
11127
- function lineRange(text, starts, line) {
11100
+ function lspLineRange(text, starts, line) {
11128
11101
  const index = Math.min(Math.max(line, 1), starts.length) - 1;
11129
11102
  const start = starts[index];
11130
11103
  let end = index + 1 < starts.length ? starts[index + 1] - 1 : text.length;
@@ -11165,7 +11138,7 @@ const REASONS = {
11165
11138
  };
11166
11139
  /** Why a locale's own entry is not used, in words. */
11167
11140
  function reasonText(reason) {
11168
- return REASONS[reason ?? "no-entry"] ?? reason;
11141
+ return REASONS[reason ?? "no-entry"];
11169
11142
  }
11170
11143
  /** The hover of one message: id, source, notes, then one table row per locale. */
11171
11144
  function hoverMarkdown(message) {
@@ -11197,8 +11170,634 @@ function hoverMarkdown(message) {
11197
11170
  function escapeMarkdown(text) {
11198
11171
  return text.replace(/[\\`*_{}[\]<>()#+!|]/g, "\\$&");
11199
11172
  }
11200
- //#endregion
11201
- //#region src/cli/lsp/workspace.ts
11173
+ // src/cli/lsp/extract.ts
11174
+ /**
11175
+ * The edit behind "Declare once with msg()": one declaration for a text
11176
+ * written at many `t()` call sites, and `t(ref)` at the sites. Pure over
11177
+ * the files' texts (the workspace reads them), so the choices are testable
11178
+ * and the rule stays one predictable sentence: **the declaration goes in the
11179
+ * file when every site is in it, else in `messages.ts` (`messages.js` for
11180
+ * JavaScript-only sites) in the nearest directory above all the sites**, and
11181
+ * every other site imports it from there.
11182
+ *
11183
+ * A site is replaced only when its literal is still where the scan saw it
11184
+ * and means the same text, so a file edited since the scan loses that one
11185
+ * site and keeps working. Component files (`.vue`, `.svelte`, `.astro`) and
11186
+ * `rich*` calls are left alone: a template cannot import the declaration,
11187
+ * and a `rich*` call's handlers belong to the call.
11188
+ */
11189
+ const SCRIPT = /\.(?:[cm]?[jt]s|[jt]sx)$/;
11190
+ const JAVASCRIPT = /\.(?:[cm]?js|jsx)$/;
11191
+ const MESSAGES = "messages";
11192
+ const VI18N = "@menapo/vi18n";
11193
+ const RESERVED = new Set("await break case catch class const continue debugger default delete do else enum export extends false finally for function if implements import in instanceof interface let msg new null package private protected public return static super switch this throw true try typeof undefined var void while with yield t".split(" "));
11194
+ /** `Sign in` → `signIn`, from the first five words; `text` when no word is left. */
11195
+ function nameOf(source) {
11196
+ const name = (source.match(/[\p{L}\p{Nd}]+/gu)?.slice(0, 5) ?? []).map((word, i) => i === 0 ? word.toLowerCase() : word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join("");
11197
+ if (name === "") return "text";
11198
+ return /^\p{Nd}/u.test(name) ? `text${name}` : name;
11199
+ }
11200
+ /** The first of `name`, `name2`, `name3`… that is no reserved word and appears in none of `texts`. */
11201
+ function freeName(name, texts) {
11202
+ const taken = (candidate) => RESERVED.has(candidate) || texts.some((text) => new RegExp(`(?<![\\p{L}\\p{N}_$])${candidate}(?![\\p{L}\\p{N}_$])`, "u").test(text));
11203
+ if (!taken(name)) return name;
11204
+ for (let n = 2;; n++) if (!taken(`${name}${n}`)) return `${name}${n}`;
11205
+ }
11206
+ /** The value of the string literal `raw` (quotes included), or null when it holds an escape this does not read or a `${`. */
11207
+ function decodeLiteral(raw) {
11208
+ const quote = raw[0];
11209
+ if (raw.length < 2 || raw.at(-1) !== quote || quote !== "\"" && quote !== "'" && quote !== "`") return null;
11210
+ const body = raw.slice(1, -1);
11211
+ if (quote === "`" && body.includes("${")) return null;
11212
+ let out = "";
11213
+ for (let i = 0; i < body.length; i++) {
11214
+ const ch = body[i];
11215
+ if (ch !== "\\") {
11216
+ out += ch;
11217
+ continue;
11218
+ }
11219
+ const next = body[++i];
11220
+ const simple = {
11221
+ n: "\n",
11222
+ t: " ",
11223
+ r: "\r",
11224
+ b: "\b",
11225
+ f: "\f",
11226
+ v: "\v",
11227
+ "0": "\0",
11228
+ "\\": "\\",
11229
+ "'": "'",
11230
+ "\"": "\"",
11231
+ "`": "`",
11232
+ "\n": ""
11233
+ };
11234
+ if (next !== void 0 && next in simple) {
11235
+ if (next === "0" && /\d/.test(body[i + 1] ?? "")) return null;
11236
+ out += simple[next];
11237
+ } else if (next === "x" && /^[\da-f]{2}$/i.test(body.slice(i + 1, i + 3))) {
11238
+ out += String.fromCharCode(Number.parseInt(body.slice(i + 1, i + 3), 16));
11239
+ i += 2;
11240
+ } else if (next === "u" && /^[\da-f]{4}$/i.test(body.slice(i + 1, i + 5))) {
11241
+ out += String.fromCharCode(Number.parseInt(body.slice(i + 1, i + 5), 16));
11242
+ i += 4;
11243
+ } else return null;
11244
+ }
11245
+ return out;
11246
+ }
11247
+ /** JSON's string syntax is JavaScript's for any message text. */
11248
+ const literalOf = (text) => JSON.stringify(text);
11249
+ /** The end offset of the last top-level `import` statement, or 0 without any. */
11250
+ function importsEnd(text) {
11251
+ const statement = /^import\b(?!\s*[.(])(?:[^;"']|"[^"\n]*"|'[^'\n]*')*?(["'])[^"'\n]+\1[ \t]*;?/gm;
11252
+ let end = 0;
11253
+ for (const match of text.matchAll(statement)) end = match.index + match[0].length;
11254
+ return end;
11255
+ }
11256
+ /** The `import { … } from "<from>"` statements of `text`: where the braces open and what each names. */
11257
+ function namedImports(text, from) {
11258
+ const named = new RegExp(`import(\\s+type)?\\s*\\{([^}]*)\\}\\s*from\\s*(["'])${from.replace(/[.*+?^${}()|[\]\\/]/g, "\\$&")}\\3`, "g");
11259
+ return [...text.matchAll(named)].map((match) => ({
11260
+ open: match.index + match[0].indexOf("{") + 1,
11261
+ typeOnly: match[1] !== void 0,
11262
+ specs: match[2].split(",").map((part) => /^\s*(type\s+)?([\w$]+)(?:\s+as\s+([\w$]+))?\s*$/.exec(part)).filter((found) => found !== null).map((found) => ({
11263
+ imported: found[2],
11264
+ local: found[3] ?? found[2],
11265
+ type: found[1] !== void 0
11266
+ }))
11267
+ }));
11268
+ }
11269
+ /** The local name `text` already gives to `name` imported from `from` (`msg as m` gives `m`), or null. */
11270
+ function localNameOf(text, name, from) {
11271
+ for (const statement of namedImports(text, from)) {
11272
+ if (statement.typeOnly) continue;
11273
+ const found = statement.specs.find((spec) => !spec.type && spec.imported === name);
11274
+ if (found !== void 0) return found.local;
11275
+ }
11276
+ return null;
11277
+ }
11278
+ /** An edit that makes `text` import `name` from `from`: into an existing `import { … } from` that module, else a new line after the imports. */
11279
+ function addNamedImport(text, name, from) {
11280
+ if (localNameOf(text, name, from) === name) return null;
11281
+ const statement = namedImports(text, from).find((candidate) => !candidate.typeOnly);
11282
+ if (statement !== void 0) return {
11283
+ start: statement.open,
11284
+ end: statement.open,
11285
+ newText: ` ${name},`
11286
+ };
11287
+ const end = insertionPoint(text);
11288
+ const line = `import { ${name} } from "${from}";`;
11289
+ return end === 0 ? {
11290
+ start: 0,
11291
+ end: 0,
11292
+ newText: `${line}\n\n`
11293
+ } : {
11294
+ start: end,
11295
+ end,
11296
+ newText: `\n${line}`
11297
+ };
11298
+ }
11299
+ /**
11300
+ * Where the first statement may go: after a shebang and the directives
11301
+ * (`"use client"`) that must stay first, 0 when the file has neither.
11302
+ */
11303
+ function prologueEnd(text) {
11304
+ let end = /^#![^\n]*/.exec(text)?.[0].length ?? 0;
11305
+ const directive = /(?:\s|\/\/[^\n]*|\/\*[\s\S]*?\*\/)*(["'])(?:(?!\1)[^\n\\])*\1[ \t]*;?/y;
11306
+ for (;;) {
11307
+ directive.lastIndex = end;
11308
+ if (directive.exec(text) === null) return end;
11309
+ end = directive.lastIndex;
11310
+ }
11311
+ }
11312
+ /** After the last import, else after the prologue, else 0. */
11313
+ function insertionPoint(text) {
11314
+ const end = importsEnd(text);
11315
+ return end > 0 ? end : prologueEnd(text);
11316
+ }
11317
+ /** Where the call's literal is now, when it is still a `t(…)` first argument that means `canonical`. */
11318
+ function locate(text, site, input, canonical) {
11319
+ const start = offsetOf(text, lineStarts(text), site.line, site.column);
11320
+ const end = tokenEnd(text, start);
11321
+ const value = decodeLiteral(text.slice(start, end));
11322
+ if (value === null || input.canonical(value) !== canonical) return null;
11323
+ if (!/\bt\s*\(\s*$/.test(text.slice(Math.max(0, start - 40), start))) return null;
11324
+ return {
11325
+ start,
11326
+ end,
11327
+ value
11328
+ };
11329
+ }
11330
+ /** Where the declaration goes for sites in `files`: the file itself, else a messages module above all of them. */
11331
+ function declarationFile(files) {
11332
+ if (files.length === 1) return files[0];
11333
+ const dirs = files.map((file) => posix.dirname(file).split("/").filter((part) => part !== "."));
11334
+ let common = dirs[0];
11335
+ for (const dir of dirs) {
11336
+ let n = 0;
11337
+ while (n < common.length && n < dir.length && common[n] === dir[n]) n++;
11338
+ common = common.slice(0, n);
11339
+ }
11340
+ const extension = files.every((file) => JAVASCRIPT.test(file)) ? "js" : "ts";
11341
+ return posix.join(...common, `${MESSAGES}.${extension}`);
11342
+ }
11343
+ /** The relative import specifier from `file` to `target`, without extension. */
11344
+ function specifier(file, target) {
11345
+ const relative = posix.relative(posix.join("/", posix.dirname(file)), posix.join("/", target.replace(/\.[cm]?[jt]s$/, "")));
11346
+ return relative.startsWith(".") ? relative : `./${relative}`;
11347
+ }
11348
+ /** The sites still plain `t("…")` calls of the text, with the files' texts as read. */
11349
+ function replaceable(input, canonical) {
11350
+ const texts = /* @__PURE__ */ new Map();
11351
+ const found = [];
11352
+ let source = null;
11353
+ for (const site of input.text.sites) {
11354
+ if (site.callee !== "t" || site.annotated || !SCRIPT.test(site.file) || site.line === 0) continue;
11355
+ const content = texts.get(site.file) ?? input.read(site.file);
11356
+ if (content === null) continue;
11357
+ texts.set(site.file, content);
11358
+ const where = locate(content, site, input, canonical);
11359
+ if (where === null) continue;
11360
+ source ??= where.value;
11361
+ found.push({
11362
+ file: site.file,
11363
+ start: where.start,
11364
+ end: where.end
11365
+ });
11366
+ }
11367
+ return source === null || found.length === 0 ? null : {
11368
+ found,
11369
+ texts,
11370
+ source
11371
+ };
11372
+ }
11373
+ /** The edit that declares `name` in a file that exists: after its imports when it holds every site, else at its end. */
11374
+ function declareIn(content, name, source, local) {
11375
+ const alias = localNameOf(content, "msg", VI18N);
11376
+ const declaration = `const ${name} = ${alias ?? "msg"}(${literalOf(source)});`;
11377
+ const importMsg = alias === null ? addNamedImport(content, "msg", VI18N) : null;
11378
+ if (!local) {
11379
+ const tail = content === "" || content.endsWith("\n") ? "" : "\n";
11380
+ const end = content.length;
11381
+ const edits = [{
11382
+ start: end,
11383
+ end,
11384
+ newText: `${tail}\nexport ${declaration}\n`
11385
+ }];
11386
+ return importMsg === null ? edits : [...edits, importMsg];
11387
+ }
11388
+ const end = insertionPoint(content);
11389
+ const joined = importMsg !== null && importMsg.start === end;
11390
+ const gap = /^\r?\n\r?\n/.test(content.slice(end)) || end >= content.length ? "" : "\n";
11391
+ const edit = {
11392
+ start: end,
11393
+ end,
11394
+ newText: `${joined ? importMsg.newText : ""}\n\n${declaration}${gap}`
11395
+ };
11396
+ return importMsg === null || joined ? [edit] : [edit, importMsg];
11397
+ }
11398
+ /** `\n` in an inserted text becomes the file's own line break, so a CRLF file stays CRLF. */
11399
+ function inEolOf(content, edit) {
11400
+ if (content === null || !content.includes("\r\n")) return edit;
11401
+ return {
11402
+ ...edit,
11403
+ newText: edit.newText.replace(/\r?\n/g, "\r\n")
11404
+ };
11405
+ }
11406
+ /** Outside the config root (or on another drive): the fix never writes there. */
11407
+ function outsideRoot(file) {
11408
+ return /^(?:\.\.(?:\/|$)|\/|[A-Za-z]:)/.test(file);
11409
+ }
11410
+ /**
11411
+ * The plan for one repeated text, or null when nothing can be replaced
11412
+ * correctly: no site is still a plain `t("…")` in a script file, or the
11413
+ * messages module would sit where the scan does not read.
11414
+ */
11415
+ function planExtraction(input) {
11416
+ const canonical = input.canonical(input.text.source);
11417
+ if (input.text.sites.some((site) => outsideRoot(site.file))) return null;
11418
+ const sites = canonical === null ? null : replaceable(input, canonical);
11419
+ if (sites === null) return null;
11420
+ const { found, texts, source } = sites;
11421
+ const everywhere = new Set(input.text.sites.map((site) => site.file));
11422
+ const declaredIn = declarationFile([...everywhere]);
11423
+ if (!input.included(declaredIn)) return null;
11424
+ const existing = texts.get(declaredIn) ?? input.read(declaredIn);
11425
+ const name = freeName(nameOf(source), [...texts.values(), existing ?? ""]);
11426
+ const edits = /* @__PURE__ */ new Map();
11427
+ const add = (file, list) => {
11428
+ const content = texts.get(file) ?? (file === declaredIn ? existing : null);
11429
+ const kept = list.filter((edit) => edit !== null);
11430
+ edits.set(file, [...edits.get(file) ?? [], ...kept.map((edit) => inEolOf(content, edit))]);
11431
+ };
11432
+ for (const site of found) add(site.file, [{
11433
+ start: site.start,
11434
+ end: site.end,
11435
+ newText: name
11436
+ }]);
11437
+ if (existing === null) add(declaredIn, [{
11438
+ start: 0,
11439
+ end: 0,
11440
+ newText: `import { msg } from "${VI18N}";\n\nexport const ${name} = msg(${literalOf(source)});\n`
11441
+ }]);
11442
+ else add(declaredIn, declareIn(existing, name, source, everywhere.size === 1));
11443
+ for (const file of new Set(found.map((site) => site.file))) {
11444
+ if (file === declaredIn) continue;
11445
+ add(file, [addNamedImport(texts.get(file), name, specifier(file, declaredIn))]);
11446
+ }
11447
+ return {
11448
+ name,
11449
+ declaredIn,
11450
+ create: existing === null,
11451
+ edits,
11452
+ replaced: found.length
11453
+ };
11454
+ }
11455
+ // src/cli/lsp/text-checks.ts
11456
+ /**
11457
+ * The two project-wide text checks of the editor and their quick fixes:
11458
+ *
11459
+ * - **repeated text** (`extract-repeated-text`, warning): one literal at
11460
+ * `extraction.repeatedText` call sites or more; the fix declares it once
11461
+ * with `msg()` (`extract.ts`);
11462
+ * - **edited text** (`extract-edited-text`, information): a text many sites
11463
+ * share was edited at one of them (`edited.ts` has the heuristic); the fix
11464
+ * hands the rename the old and new text, and "Keep as a new text" marks
11465
+ * the site `vi18n-ignore`, the comment the rest of the tooling already
11466
+ * reads.
11467
+ *
11468
+ * `repeatedText: false` turns both off.
11469
+ */
11470
+ const REPLACE_COMMAND = "vi18n.replaceText";
11471
+ function plural(n) {
11472
+ return n === 1 ? "place" : "places";
11473
+ }
11474
+ async function textDiagnostics(state, doc) {
11475
+ const threshold = state.project.config.extraction.repeatedText;
11476
+ if (threshold === false) return [];
11477
+ await state.sites.ready();
11478
+ const starts = lineStarts(doc.text);
11479
+ const out = [];
11480
+ for (const text of state.sites.repeated(threshold)) {
11481
+ const first = text.sites[0];
11482
+ for (const diagnostic of repeatedDiagnostics([text])) {
11483
+ if (diagnostic.file !== doc.refFile || diagnostic.line === void 0) continue;
11484
+ const entry = {
11485
+ range: tokenRange(doc.text, starts, diagnostic.line, diagnostic.column ?? 1),
11486
+ severity: 2,
11487
+ code: diagnostic.code,
11488
+ source: "vi18n",
11489
+ message: diagnostic.message,
11490
+ data: {
11491
+ kind: "repeated",
11492
+ id: text.id
11493
+ }
11494
+ };
11495
+ if (first !== void 0 && first.line > 0) entry.relatedInformation = [{
11496
+ location: {
11497
+ uri: pathToFileURL(resolve(state.project.config.root, first.file)).href,
11498
+ range: {
11499
+ start: {
11500
+ line: first.line - 1,
11501
+ character: first.column - 1
11502
+ },
11503
+ end: {
11504
+ line: first.line - 1,
11505
+ character: first.column - 1
11506
+ }
11507
+ }
11508
+ },
11509
+ message: `first of the ${text.sites.length} sites`
11510
+ }];
11511
+ out.push(entry);
11512
+ }
11513
+ }
11514
+ const edited = editedIn(state, doc, threshold);
11515
+ if (edited !== null) out.push(...editedDiagnostics(edited, doc, starts));
11516
+ return out;
11517
+ }
11518
+ function editedIn(state, doc, threshold) {
11519
+ const entries = state.indexes.get(state.project.config.sourceLocale)?.entries;
11520
+ if (entries === void 0) return null;
11521
+ return findEditedText({
11522
+ file: doc.refFile,
11523
+ current: doc.occurrences,
11524
+ saved: state.sites.saved(doc.refFile),
11525
+ entries,
11526
+ sitesOf: (id) => state.sites.sitesOf(id),
11527
+ threshold
11528
+ });
11529
+ }
11530
+ function editedDiagnostics(edited, doc, starts) {
11531
+ const { paired, candidates } = edited;
11532
+ const out = [];
11533
+ for (const site of edited.sites) {
11534
+ if (site.line === 0) continue;
11535
+ let message;
11536
+ let data;
11537
+ if (paired !== null) {
11538
+ const { old } = paired;
11539
+ message = `This text was ${quoted(old.source)} in ${old.remaining} other ${plural(old.remaining)}; they still use the old text`;
11540
+ data = {
11541
+ kind: "edited",
11542
+ id: site.id,
11543
+ from: old.source,
11544
+ to: site.source,
11545
+ others: old.remaining
11546
+ };
11547
+ } else {
11548
+ message = `A text used in several places was edited in this file: ${candidates.slice(0, 3).map((c) => `${quoted(c.source)} (${c.remaining} ${plural(c.remaining)})`).join(", ")}${candidates.length > 3 ? ", …" : ""}; several texts changed here, so change the other places too, or keep this as a new text`;
11549
+ data = {
11550
+ kind: "edited-hint",
11551
+ id: site.id
11552
+ };
11553
+ }
11554
+ out.push({
11555
+ range: tokenRange(doc.text, starts, site.line, site.column),
11556
+ severity: 3,
11557
+ code: "extract-edited-text",
11558
+ source: "vi18n",
11559
+ message,
11560
+ data
11561
+ });
11562
+ }
11563
+ return out;
11564
+ }
11565
+ async function textActions(context, diagnostics) {
11566
+ const out = [];
11567
+ for (const diagnostic of diagnostics) {
11568
+ const data = diagnostic.data;
11569
+ if (diagnostic.source !== "vi18n" || data === void 0) continue;
11570
+ if (data.kind === "repeated") {
11571
+ const action = await extractAction(context, diagnostic, data.id);
11572
+ if (action !== null) out.push(action);
11573
+ continue;
11574
+ }
11575
+ if (data.kind === "edited") {
11576
+ const title = `Replace ${quoted(data.from)} with ${quoted(data.to)} in all ${data.others} other ${plural(data.others)}`;
11577
+ out.push({
11578
+ title,
11579
+ kind: "quickfix",
11580
+ diagnostics: [diagnostic],
11581
+ isPreferred: true,
11582
+ command: {
11583
+ title,
11584
+ command: REPLACE_COMMAND,
11585
+ arguments: [{
11586
+ uri: context.doc.uri,
11587
+ from: data.from,
11588
+ to: data.to
11589
+ }]
11590
+ }
11591
+ });
11592
+ }
11593
+ if (data.kind === "edited" || data.kind === "edited-hint") out.push(keepAction(context.doc, diagnostic, data.id));
11594
+ }
11595
+ return out;
11596
+ }
11597
+ /** `/* vi18n-ignore *\/` before each literal of the new text in this document: the edit stays a new message. */
11598
+ function keepAction(doc, diagnostic, id) {
11599
+ const starts = lineStarts(doc.text);
11600
+ const edits = [];
11601
+ for (const occurrence of doc.occurrences) {
11602
+ if (occurrence.id !== id || !writesText(occurrence) || occurrence.line === 0) continue;
11603
+ const at = lspPosition(starts, offsetOf(doc.text, starts, occurrence.line, occurrence.column));
11604
+ edits.push({
11605
+ range: {
11606
+ start: at,
11607
+ end: at
11608
+ },
11609
+ newText: "/* vi18n-ignore -- a new text */ "
11610
+ });
11611
+ }
11612
+ return {
11613
+ title: "Keep as a new text",
11614
+ kind: "quickfix",
11615
+ diagnostics: [diagnostic],
11616
+ edit: { changes: { [doc.uri]: edits } }
11617
+ };
11618
+ }
11619
+ async function extractAction({ state, doc, files }, diagnostic, id) {
11620
+ const threshold = state.project.config.extraction.repeatedText;
11621
+ if (threshold === false) return null;
11622
+ const text = state.sites.repeated(threshold).find((candidate) => candidate.id === id);
11623
+ if (text === void 0) return null;
11624
+ const { config, codec } = state.project;
11625
+ const sites = [...new Set(text.sites.map((site) => site.file))];
11626
+ const contents = /* @__PURE__ */ new Map();
11627
+ for (const file of [...sites, declarationFile(sites)]) {
11628
+ if (contents.has(file)) continue;
11629
+ contents.set(file, file === doc.refFile ? doc.text : await files.text(resolve(config.root, file)));
11630
+ }
11631
+ const plan = planExtraction({
11632
+ text,
11633
+ read: (file) => contents.get(file) ?? null,
11634
+ included: (file) => isIncluded(resolve(config.root, file), config),
11635
+ canonical: (source) => {
11636
+ try {
11637
+ return codec.canonicalize(source);
11638
+ } catch {
11639
+ return null;
11640
+ }
11641
+ }
11642
+ });
11643
+ if (plan === null) return null;
11644
+ const changes = [];
11645
+ const ordered = [...plan.edits].sort(([a], [b]) => Number(b === plan.declaredIn) - Number(a === plan.declaredIn));
11646
+ for (const [file, edits] of ordered) {
11647
+ const path = resolve(config.root, file);
11648
+ const uri = file === doc.refFile ? doc.uri : pathToFileURL(path).href;
11649
+ const before = contents.get(file) ?? "";
11650
+ if (plan.create && file === plan.declaredIn) changes.push({
11651
+ kind: "create",
11652
+ uri,
11653
+ options: { ignoreIfExists: true }
11654
+ });
11655
+ changes.push({
11656
+ textDocument: {
11657
+ uri,
11658
+ version: files.version(path)
11659
+ },
11660
+ edits: toLsp$1(before, edits)
11661
+ });
11662
+ }
11663
+ return {
11664
+ title: `Declare once with msg() as ${plan.name} (${plan.replaced} sites)`,
11665
+ kind: "quickfix",
11666
+ diagnostics: [diagnostic],
11667
+ edit: { documentChanges: changes }
11668
+ };
11669
+ }
11670
+ function toLsp$1(text, edits) {
11671
+ const starts = lineStarts(text);
11672
+ return edits.map((edit) => ({
11673
+ range: {
11674
+ start: lspPosition(starts, edit.start),
11675
+ end: lspPosition(starts, edit.end)
11676
+ },
11677
+ newText: edit.newText
11678
+ }));
11679
+ }
11680
+ // src/cli/lsp/sites.ts
11681
+ /**
11682
+ * Every literal call site in the project, for the checks that compare
11683
+ * documents with each other (repeated and edited texts). The disk scan comes
11684
+ * first and is cached like `extract`'s; an open document's own scan replaces
11685
+ * its file's, so unsaved text counts. A change the server cannot see (a file
11686
+ * saved elsewhere, an `extract` run) marks the disk scan stale, and the next
11687
+ * answer reads it again, which the scan cache makes cheap.
11688
+ */
11689
+ var ProjectSites = class {
11690
+ load;
11691
+ disk = null;
11692
+ loading = null;
11693
+ open = /* @__PURE__ */ new Map();
11694
+ diskRevision = 0;
11695
+ /** Bumped by every change to the open files; keys what is derived from them. */
11696
+ openRevision = 0;
11697
+ /** Bumped only when a file opens or closes: the disk's share of the totals changes then, not per keystroke. */
11698
+ openFiles = 0;
11699
+ writers = null;
11700
+ /** The disk scan without the open files' own, by id; rebuilt when the disk scan or the set of open files changes, never per keystroke. */
11701
+ base = null;
11702
+ constructor(load) {
11703
+ this.load = load;
11704
+ }
11705
+ /** Waits for the disk scan; reads it again when something marked it stale. */
11706
+ async ready() {
11707
+ if (this.disk !== null) return;
11708
+ this.loading ??= this.load().then((map) => {
11709
+ this.disk = map;
11710
+ }).finally(() => {
11711
+ this.loading = null;
11712
+ this.diskRevision++;
11713
+ });
11714
+ await this.loading;
11715
+ }
11716
+ /** The disk scan no longer matches the files. */
11717
+ invalidate() {
11718
+ this.disk = null;
11719
+ this.diskRevision++;
11720
+ }
11721
+ /** An open document's occurrences as its text is now. */
11722
+ setOpen(file, occurrences) {
11723
+ if (!this.open.has(file)) this.openFiles++;
11724
+ this.open.set(file, occurrences);
11725
+ this.openRevision++;
11726
+ }
11727
+ dropOpen(file) {
11728
+ if (!this.open.delete(file)) return;
11729
+ this.openFiles++;
11730
+ this.openRevision++;
11731
+ }
11732
+ /** A file's occurrences as of its last save (the disk scan), for the edit's "before". */
11733
+ saved(file) {
11734
+ return this.disk?.get(file) ?? [];
11735
+ }
11736
+ /**
11737
+ * The disk's literal call sites by id, without the open files'. Per
11738
+ * keystroke only the open files' own occurrences are read again, so a
11739
+ * large project costs the same as a small one.
11740
+ */
11741
+ diskBase(threshold) {
11742
+ let base = this.base;
11743
+ if (base?.diskRevision !== this.diskRevision || base.openFiles !== this.openFiles) {
11744
+ const byId = /* @__PURE__ */ new Map();
11745
+ for (const [file, list] of this.disk ?? []) {
11746
+ if (this.open.has(file)) continue;
11747
+ for (const occurrence of list) {
11748
+ if (!writesText(occurrence)) continue;
11749
+ const sites = byId.get(occurrence.id);
11750
+ if (sites === void 0) byId.set(occurrence.id, [occurrence]);
11751
+ else sites.push(occurrence);
11752
+ }
11753
+ }
11754
+ base = {
11755
+ diskRevision: this.diskRevision,
11756
+ openFiles: this.openFiles,
11757
+ byId,
11758
+ frequent: /* @__PURE__ */ new Map()
11759
+ };
11760
+ this.base = base;
11761
+ }
11762
+ if (!base.frequent.has(threshold)) {
11763
+ const ids = [];
11764
+ for (const [id, sites] of base.byId) if (sites.length >= threshold) ids.push(id);
11765
+ base.frequent.set(threshold, ids);
11766
+ }
11767
+ return base;
11768
+ }
11769
+ openWriters() {
11770
+ if (this.writers?.revision === this.openRevision) return this.writers.byId;
11771
+ const byId = /* @__PURE__ */ new Map();
11772
+ for (const list of this.open.values()) for (const occurrence of list) {
11773
+ if (!writesText(occurrence)) continue;
11774
+ const sites = byId.get(occurrence.id);
11775
+ if (sites === void 0) byId.set(occurrence.id, [occurrence]);
11776
+ else sites.push(occurrence);
11777
+ }
11778
+ this.writers = {
11779
+ revision: this.openRevision,
11780
+ byId
11781
+ };
11782
+ return byId;
11783
+ }
11784
+ /** Literal call sites of one id, in the project as it is now. */
11785
+ sitesOf(id) {
11786
+ return (this.diskBase(Number.POSITIVE_INFINITY).byId.get(id)?.length ?? 0) + (this.openWriters().get(id)?.length ?? 0);
11787
+ }
11788
+ repeated(threshold) {
11789
+ const { byId, frequent } = this.diskBase(threshold);
11790
+ const opened = this.openWriters();
11791
+ const ids = /* @__PURE__ */ new Set([...frequent.get(threshold) ?? [], ...opened.keys()]);
11792
+ const all = [];
11793
+ for (const id of ids) {
11794
+ for (const occurrence of byId.get(id) ?? []) all.push(occurrence);
11795
+ for (const occurrence of opened.get(id) ?? []) all.push(occurrence);
11796
+ }
11797
+ return repeatedTexts(all, threshold);
11798
+ }
11799
+ };
11800
+ // src/cli/lsp/workspace.ts
11202
11801
  /**
11203
11802
  * What the language server knows (INTERNALS §2.17): per `vi18n.config.ts`,
11204
11803
  * the resolved config and every locale's catalog index; per open document,
@@ -11230,6 +11829,11 @@ var LanguageWorkspace = class {
11230
11829
  this.documents.delete(uri);
11231
11830
  const state = this.states.get(uri);
11232
11831
  this.states.delete(uri);
11832
+ if (state?.kind === "code") {
11833
+ const closed = await this.projects.get(state.configFile);
11834
+ closed?.sites.dropOpen(state.refFile);
11835
+ closed?.sites.invalidate();
11836
+ }
11233
11837
  if (state?.kind !== "catalog") return false;
11234
11838
  const project = await this.projects.get(state.configFile);
11235
11839
  if (project == null) return false;
@@ -11260,7 +11864,7 @@ var LanguageWorkspace = class {
11260
11864
  });
11261
11865
  return { catalogChanged: false };
11262
11866
  }
11263
- const configFile = project.project.config.configFile;
11867
+ const { configFile } = project;
11264
11868
  const locale = project.catalogs.get(path);
11265
11869
  if (locale !== void 0) {
11266
11870
  const { index, diagnostics } = this.readOpenCatalog(project, locale, path, document.text);
@@ -11300,11 +11904,14 @@ var LanguageWorkspace = class {
11300
11904
  range: tokenRange(document.text, starts, occurrence.line, occurrence.column)
11301
11905
  });
11302
11906
  }
11907
+ project.sites.setOpen(refFile, result.occurrences);
11303
11908
  this.states.set(uri, {
11304
11909
  kind: "code",
11305
11910
  version: document.version,
11306
11911
  configFile,
11912
+ refFile,
11307
11913
  located,
11914
+ occurrences: result.occurrences,
11308
11915
  diagnostics: result.diagnostics.filter((diagnostic) => diagnostic.file === void 0 || diagnostic.file === refFile),
11309
11916
  text: document.text
11310
11917
  });
@@ -11333,8 +11940,67 @@ var LanguageWorkspace = class {
11333
11940
  out.push(toLsp(diagnostic, range));
11334
11941
  }
11335
11942
  for (const { occurrence, range } of state.located) out.push(...this.translationDiagnostics(project, occurrence, range));
11943
+ out.push(...await textDiagnostics(project, this.checked(uri, state)));
11336
11944
  return out;
11337
11945
  }
11946
+ /** Quick fixes for the repeated and edited text diagnostics of a document. */
11947
+ async codeActions(uri, diagnostics) {
11948
+ await this.refresh(uri);
11949
+ const state = this.states.get(uri);
11950
+ if (state?.kind !== "code") return [];
11951
+ const project = await this.projects.get(state.configFile);
11952
+ if (project == null) return [];
11953
+ return textActions({
11954
+ state: project,
11955
+ doc: this.checked(uri, state),
11956
+ files: {
11957
+ text: (path) => this.textOf(path),
11958
+ version: (path) => this.versionOf(path)
11959
+ }
11960
+ }, diagnostics);
11961
+ }
11962
+ /**
11963
+ * "Replace in all places": the rename changes the old text to the edited
11964
+ * one in every file but this document, which already says it. Returns the
11965
+ * rewritten sites; open documents' diagnostics change afterwards.
11966
+ */
11967
+ async replaceText(request) {
11968
+ const path = filePath(request.uri);
11969
+ const project = path === null ? null : await this.projectFor(path);
11970
+ if (path === null || project === null) throw new Error(`${request.uri} belongs to no vi18n project`);
11971
+ const { renameMessage } = await import("./rename-ZVGq9ZG1.js");
11972
+ const { sites } = await renameMessage(project.project, {
11973
+ from: request.from,
11974
+ to: request.to,
11975
+ review: false,
11976
+ merge: false,
11977
+ skip: [path]
11978
+ }, { write: true });
11979
+ project.sites.invalidate();
11980
+ for (const locale of project.project.config.locales) await this.reloadLocale(project, locale);
11981
+ return sites.length;
11982
+ }
11983
+ checked(uri, state) {
11984
+ return {
11985
+ uri,
11986
+ refFile: state.refFile,
11987
+ text: state.text,
11988
+ occurrences: state.occurrences
11989
+ };
11990
+ }
11991
+ /** An open buffer's text, else the file on disk; null when it does not exist. */
11992
+ async textOf(path) {
11993
+ for (const document of this.documents.values()) if (filePath(document.uri) === path) return document.text;
11994
+ try {
11995
+ return await readFile(path, "utf8");
11996
+ } catch {
11997
+ return null;
11998
+ }
11999
+ }
12000
+ versionOf(path) {
12001
+ for (const document of this.documents.values()) if (filePath(document.uri) === path) return document.version;
12002
+ return null;
12003
+ }
11338
12004
  async hover(uri, position) {
11339
12005
  const found = await this.occurrenceAt(uri, position);
11340
12006
  if (found === null) return null;
@@ -11386,10 +12052,8 @@ var LanguageWorkspace = class {
11386
12052
  for (const uri of uris) {
11387
12053
  const path = filePath(uri);
11388
12054
  if (path === null) continue;
11389
- if (path.endsWith("/vi18n.config.ts") || path.endsWith("\\vi18n.config.ts")) {
11390
- this.configs.clear();
11391
- this.projects.clear();
11392
- this.states.clear();
12055
+ if (this.projects.has(path) || /[\\/]vi18n\.config\.ts$/.test(path)) {
12056
+ this.reset();
11393
12057
  return true;
11394
12058
  }
11395
12059
  for (const pending of this.projects.values()) {
@@ -11397,6 +12061,7 @@ var LanguageWorkspace = class {
11397
12061
  const locale = project?.catalogs.get(path);
11398
12062
  if (project == null || locale === void 0 || project.overlays.has(locale)) continue;
11399
12063
  await this.reloadLocale(project, locale);
12064
+ project.sites.invalidate();
11400
12065
  changed = true;
11401
12066
  }
11402
12067
  }
@@ -11448,33 +12113,38 @@ var LanguageWorkspace = class {
11448
12113
  configFile
11449
12114
  });
11450
12115
  } catch (error) {
11451
- const message = isDiagnosticError(error) ? error.diagnostic.message : error instanceof Error ? error.message : String(error);
12116
+ const message = isDiagnosticError(error) ? error.diagnostic.message : errorMessage(error);
11452
12117
  this.options.log(`vi18n: ${configFile} could not be loaded: ${message}`);
11453
12118
  return null;
11454
12119
  }
11455
- const codec = createCodec(config.ids.length);
11456
- const project = {
11457
- config,
11458
- codec,
11459
- layout: catalogLayout(config)
11460
- };
12120
+ const project = projectOf(config);
11461
12121
  const state = {
11462
12122
  project,
12123
+ configFile,
11463
12124
  scan: scanConfig(config),
11464
12125
  catalogs: new Map(config.locales.map((locale) => [catalogPath(config, locale), locale])),
11465
12126
  indexes: /* @__PURE__ */ new Map(),
11466
- overlays: /* @__PURE__ */ new Set()
12127
+ overlays: /* @__PURE__ */ new Set(),
12128
+ sites: new ProjectSites(() => this.scanSites(config, project.codec))
11467
12129
  };
11468
- const loaded = await loadCatalogSet(config, codec);
12130
+ const loaded = await loadCatalogSet(config, project.codec);
11469
12131
  for (const diagnostic of loaded.diagnostics) if (diagnostic.severity === "error") this.options.log(`vi18n: ${diagnostic.message}`);
11470
- for (const locale of [config.sourceLocale, ...config.locales]) {
11471
- const read = loaded.set.get(locale);
11472
- if (read === void 0 || state.indexes.has(locale)) continue;
11473
- state.indexes.set(locale, indexCatalog(project, locale, read.path, read.catalog, read.hash));
11474
- }
12132
+ state.indexes = indexCatalogs(project, loaded.set);
11475
12133
  this.options.log(`vi18n: loaded ${configFile} (${config.locales.join(", ")})`);
11476
12134
  return state;
11477
12135
  }
12136
+ /** The disk scan of every literal call site (the scan cache makes a repeat cheap); nothing when the checks are off. */
12137
+ async scanSites(config, codec) {
12138
+ const sites = /* @__PURE__ */ new Map();
12139
+ if (config.extraction.repeatedText === false) return sites;
12140
+ try {
12141
+ const scanned = await scanProject(config, codec, { cache: true });
12142
+ for (const file of scanned.files) sites.set(file.refFile, file.occurrences);
12143
+ } catch (error) {
12144
+ this.options.log(`vi18n: scanning the project failed: ${errorMessage(error)}`);
12145
+ }
12146
+ return sites;
12147
+ }
11478
12148
  async reloadLocale(project, locale) {
11479
12149
  const { config, codec } = project.project;
11480
12150
  const read = (await loadCatalogSet(config, codec, [locale])).set.get(locale);
@@ -11490,7 +12160,7 @@ var LanguageWorkspace = class {
11490
12160
  */
11491
12161
  readOpenCatalog(state, locale, path, text) {
11492
12162
  const { project } = state;
11493
- const { config, codec, layout } = project;
12163
+ const { config, layout } = project;
11494
12164
  const isSourceLocale = locale === config.sourceLocale;
11495
12165
  const read = parseCatalog(text, {
11496
12166
  locale,
@@ -11502,37 +12172,34 @@ var LanguageWorkspace = class {
11502
12172
  for (const entry of read.catalog.entries) syntaxOfEntry(found, entry, index.file, locale);
11503
12173
  const starts = lineStarts(text);
11504
12174
  const out = [];
11505
- for (const diagnostic of found) out.push(toLsp(diagnostic, lineRange(text, starts, diagnostic.line ?? 1)));
11506
- if (!isSourceLocale) for (const entry of read.catalog.entries) {
11507
- if (entry.translation === "" || entry.source === null || entry.foreignContext !== null) continue;
11508
- let source;
11509
- try {
11510
- source = codec.parse(codec.canonicalize(entry.source));
11511
- } catch (error) {
11512
- if (!isDiagnosticError(error)) throw error;
11513
- continue;
11514
- }
11515
- const range = lineRange(text, starts, translationLine(text, starts, entry.line, layout));
11516
- let parsed;
11517
- try {
11518
- parsed = codec.parse(entry.translation);
11519
- } catch (error) {
11520
- if (!isDiagnosticError(error)) throw error;
11521
- out.push(toLsp(error.diagnostic, range));
11522
- continue;
11523
- }
11524
- const options = {
11525
- locale,
11526
- text: entry.translation
11527
- };
11528
- if (entry.maxLength !== null) options.maxLength = entry.maxLength;
11529
- for (const diagnostic of validateTranslation(parsed, source, options)) out.push(toLsp(diagnostic, range));
11530
- }
12175
+ for (const diagnostic of found) out.push(toLsp(diagnostic, lspLineRange(text, starts, diagnostic.line ?? 1)));
12176
+ if (!isSourceLocale) for (const entry of read.catalog.entries) out.push(...this.entryDiagnostics(project, locale, entry, text, starts));
11531
12177
  return {
11532
12178
  index,
11533
12179
  diagnostics: out
11534
12180
  };
11535
12181
  }
12182
+ /** An open catalog entry's translation checked against the source the entry records. */
12183
+ entryDiagnostics(project, locale, entry, text, starts) {
12184
+ const { codec, layout } = project;
12185
+ if (entry.translation === "" || entry.source === null || entry.foreignContext !== null) return [];
12186
+ let source;
12187
+ try {
12188
+ source = codec.parse(codec.canonicalize(entry.source));
12189
+ } catch (error) {
12190
+ if (!isDiagnosticError(error)) throw error;
12191
+ return [];
12192
+ }
12193
+ const range = lspLineRange(text, starts, translationLine(text, starts, entry.line, layout));
12194
+ const checked = checkTranslation(codec, {
12195
+ translation: entry.translation,
12196
+ source,
12197
+ locale,
12198
+ maxLength: entry.maxLength
12199
+ });
12200
+ if (checked.parseError !== null) return [toLsp(checked.parseError, range)];
12201
+ return checked.findings.map((diagnostic) => toLsp(diagnostic, range));
12202
+ }
11536
12203
  /**
11537
12204
  * One message's translation diagnostics at its call site: one per locale
11538
12205
  * whose translation is invalid (`strict.invalid`), and one listing the
@@ -11635,8 +12302,7 @@ function filePath(uri) {
11635
12302
  return null;
11636
12303
  }
11637
12304
  }
11638
- //#endregion
11639
- //#region src/cli/lsp/server.ts
12305
+ // src/cli/lsp/server.ts
11640
12306
  /**
11641
12307
  * `vi18n lsp` (INTERNALS §2.17): the Language Server Protocol over a pair of
11642
12308
  * streams. Built on `vscode-languageserver`'s protocol connection rather than
@@ -11647,89 +12313,116 @@ function filePath(uri) {
11647
12313
  */
11648
12314
  /** Resolves with the exit code once the client exits or the input ends: 0 after a `shutdown` request, 1 otherwise (LSP). */
11649
12315
  function startLanguageServer(options) {
11650
- const delay = options.delay ?? 150;
11651
- const connection = (0, import_main.createProtocolConnection)(new import_main.StreamMessageReader(options.input), new import_main.StreamMessageWriter(options.output));
11652
- const log = (message) => {
11653
- connection.sendNotification(import_main.LogMessageNotification.type, {
12316
+ return new LanguageServer(options).done;
12317
+ }
12318
+ var LanguageServer = class {
12319
+ done;
12320
+ options;
12321
+ delay;
12322
+ connection;
12323
+ workspace;
12324
+ documents = /* @__PURE__ */ new Map();
12325
+ timers = /* @__PURE__ */ new Map();
12326
+ shutdown = false;
12327
+ watchedFiles = false;
12328
+ parentWatch;
12329
+ finished = false;
12330
+ resolveDone = () => {};
12331
+ onAbort = () => this.finish(this.shutdown ? 0 : 1);
12332
+ constructor(options) {
12333
+ this.options = options;
12334
+ this.delay = options.delay ?? 150;
12335
+ this.connection = (0, import_main.createProtocolConnection)(new import_main.StreamMessageReader(options.input), new import_main.StreamMessageWriter(options.output));
12336
+ this.workspace = new LanguageWorkspace({
12337
+ cwd: options.cwd,
12338
+ configFile: options.configFile,
12339
+ log: (message) => this.log(message)
12340
+ });
12341
+ this.done = new Promise((resolve) => {
12342
+ this.resolveDone = resolve;
12343
+ });
12344
+ options.signal?.addEventListener("abort", this.onAbort, { once: true });
12345
+ this.registerLifecycle();
12346
+ this.registerDocuments();
12347
+ this.registerRequests();
12348
+ this.connection.listen();
12349
+ }
12350
+ log(message) {
12351
+ this.connection.sendNotification(import_main.LogMessageNotification.type, {
11654
12352
  type: import_main.MessageType.Log,
11655
12353
  message
11656
12354
  });
11657
- };
11658
- const workspace = new LanguageWorkspace({
11659
- cwd: options.cwd,
11660
- configFile: options.configFile,
11661
- log
11662
- });
11663
- const documents = /* @__PURE__ */ new Map();
11664
- const timers = /* @__PURE__ */ new Map();
11665
- let shutdown = false;
11666
- let watchedFiles = false;
11667
- let parentWatch;
11668
- let finish = () => {};
11669
- const done = new Promise((resolve) => {
11670
- let finished = false;
11671
- finish = (code) => {
11672
- if (finished) return;
11673
- finished = true;
11674
- for (const timer of timers.values()) clearTimeout(timer);
11675
- timers.clear();
11676
- if (parentWatch !== void 0) clearInterval(parentWatch);
11677
- options.signal?.removeEventListener("abort", onAbort);
11678
- connection.dispose();
11679
- options.input.destroy?.();
11680
- resolve(code);
11681
- };
11682
- });
11683
- const onAbort = () => finish(shutdown ? 0 : 1);
11684
- options.signal?.addEventListener("abort", onAbort, { once: true });
12355
+ }
12356
+ finish(code) {
12357
+ if (this.finished) return;
12358
+ this.finished = true;
12359
+ for (const timer of this.timers.values()) clearTimeout(timer);
12360
+ this.timers.clear();
12361
+ if (this.parentWatch !== void 0) clearInterval(this.parentWatch);
12362
+ this.options.signal?.removeEventListener("abort", this.onAbort);
12363
+ this.connection.dispose();
12364
+ this.options.input.destroy?.();
12365
+ this.resolveDone(code);
12366
+ }
11685
12367
  /** Publishes one document's diagnostics, unless it was closed meanwhile. */
11686
- const publish = async (uri) => {
11687
- const document = documents.get(uri);
12368
+ async publish(uri) {
12369
+ const document = this.documents.get(uri);
11688
12370
  if (document === void 0) return;
11689
- const diagnostics = await workspace.diagnostics(uri);
11690
- if (documents.get(uri) !== document) return;
11691
- connection.sendNotification(import_main.PublishDiagnosticsNotification.type, {
12371
+ const diagnostics = await this.workspace.diagnostics(uri);
12372
+ if (this.documents.get(uri) !== document) return;
12373
+ this.connection.sendNotification(import_main.PublishDiagnosticsNotification.type, {
11692
12374
  uri,
11693
12375
  version: document.version,
11694
12376
  diagnostics
11695
12377
  });
11696
- };
11697
- const publishAll = async () => {
11698
- for (const uri of workspace.openUris()) {
11699
- await workspace.refresh(uri);
11700
- await publish(uri);
12378
+ }
12379
+ async publishAll() {
12380
+ for (const uri of this.workspace.openUris()) {
12381
+ await this.workspace.refresh(uri);
12382
+ await this.publish(uri);
11701
12383
  }
11702
- };
12384
+ }
11703
12385
  /** Re-analyses one document; a catalog edit changes every open document's diagnostics. */
11704
- const analyse = async (uri) => {
12386
+ async analyse(uri) {
11705
12387
  try {
11706
- const { catalogChanged } = await workspace.refresh(uri);
11707
- if (catalogChanged) await publishAll();
11708
- else await publish(uri);
12388
+ const { catalogChanged } = await this.workspace.refresh(uri);
12389
+ if (catalogChanged) await this.publishAll();
12390
+ else await this.publish(uri);
11709
12391
  } catch (error) {
11710
- log(`vi18n: ${uri}: ${error instanceof Error ? error.stack ?? error.message : String(error)}`);
12392
+ this.log(`vi18n: ${uri}: ${error instanceof Error ? error.stack ?? error.message : String(error)}`);
11711
12393
  }
11712
- };
11713
- const schedule = (uri) => {
11714
- const pending = timers.get(uri);
11715
- if (pending !== void 0) clearTimeout(pending);
11716
- timers.set(uri, setTimeout(() => {
11717
- timers.delete(uri);
11718
- analyse(uri);
11719
- }, delay));
11720
- };
11721
- connection.onRequest(import_main.InitializeRequest.type, (params) => {
11722
- watchedFiles = params.capabilities.workspace?.didChangeWatchedFiles?.dynamicRegistration === true;
12394
+ }
12395
+ /** Drops a document's pending rescan; whether there was one. */
12396
+ cancelPending(uri) {
12397
+ const pending = this.timers.get(uri);
12398
+ if (pending === void 0) return false;
12399
+ clearTimeout(pending);
12400
+ this.timers.delete(uri);
12401
+ return true;
12402
+ }
12403
+ schedule(uri) {
12404
+ this.cancelPending(uri);
12405
+ this.timers.set(uri, setTimeout(() => {
12406
+ this.timers.delete(uri);
12407
+ this.analyse(uri);
12408
+ }, this.delay));
12409
+ }
12410
+ /** A pending rescan runs now: positions must match the text the client shows. */
12411
+ async settle(uri) {
12412
+ if (this.cancelPending(uri)) await this.analyse(uri);
12413
+ }
12414
+ initialize(params) {
12415
+ this.watchedFiles = params.capabilities.workspace?.didChangeWatchedFiles?.dynamicRegistration === true;
11723
12416
  if (typeof params.processId === "number") {
11724
12417
  const pid = params.processId;
11725
- parentWatch = setInterval(() => {
12418
+ this.parentWatch = setInterval(() => {
11726
12419
  try {
11727
12420
  process.kill(pid, 0);
11728
12421
  } catch {
11729
- finish(1);
12422
+ this.finish(1);
11730
12423
  }
11731
12424
  }, 3e3);
11732
- parentWatch.unref();
12425
+ this.parentWatch.unref();
11733
12426
  }
11734
12427
  return {
11735
12428
  capabilities: {
@@ -11738,17 +12431,24 @@ function startLanguageServer(options) {
11738
12431
  change: import_main.TextDocumentSyncKind.Incremental
11739
12432
  },
11740
12433
  hoverProvider: true,
11741
- definitionProvider: true
12434
+ definitionProvider: true,
12435
+ codeActionProvider: { codeActionKinds: ["quickfix"] },
12436
+ executeCommandProvider: { commands: [REPLACE_COMMAND] }
11742
12437
  },
11743
12438
  serverInfo: {
11744
12439
  name: "vi18n",
11745
12440
  version: VERSION
11746
12441
  }
11747
12442
  };
11748
- });
11749
- connection.onNotification(import_main.InitializedNotification.type, () => {
11750
- if (!watchedFiles) return;
11751
- connection.sendRequest(import_main.RegistrationRequest.type, { registrations: [{
12443
+ }
12444
+ /**
12445
+ * Catalogs and configs edited outside the editor (vi18n extract, git,
12446
+ * the dev server) reach the server as file events; JSON catalogs need
12447
+ * the broad pattern, and events for other files cost a map lookup.
12448
+ */
12449
+ watchFiles() {
12450
+ if (!this.watchedFiles) return;
12451
+ this.connection.sendRequest(import_main.RegistrationRequest.type, { registrations: [{
11752
12452
  id: "vi18n-watched-files",
11753
12453
  method: import_main.DidChangeWatchedFilesNotification.method,
11754
12454
  registerOptions: { watchers: [
@@ -11756,68 +12456,94 @@ function startLanguageServer(options) {
11756
12456
  { globPattern: "**/*.po" },
11757
12457
  { globPattern: "**/*.json" }
11758
12458
  ] }
11759
- }] }).catch((error) => log(`vi18n: file watching unavailable: ${String(error)}`));
11760
- });
11761
- connection.onRequest(import_main.ShutdownRequest.type, () => {
11762
- shutdown = true;
11763
- });
11764
- connection.onNotification(import_main.ExitNotification.type, () => finish(shutdown ? 0 : 1));
11765
- connection.onClose(() => setImmediate(() => finish(shutdown ? 0 : 1)));
11766
- connection.onNotification(import_main.DidOpenTextDocumentNotification.type, ({ textDocument }) => {
11767
- const document = TextDocument$1.create(textDocument.uri, textDocument.languageId, textDocument.version, textDocument.text);
11768
- documents.set(textDocument.uri, document);
11769
- workspace.open({
11770
- uri: document.uri,
11771
- version: document.version,
11772
- text: document.getText()
12459
+ }] }).catch((error) => this.log(`vi18n: file watching unavailable: ${String(error)}`));
12460
+ }
12461
+ registerLifecycle() {
12462
+ const { connection } = this;
12463
+ connection.onRequest(import_main.InitializeRequest.type, (params) => this.initialize(params));
12464
+ connection.onNotification(import_main.InitializedNotification.type, () => this.watchFiles());
12465
+ connection.onRequest(import_main.ShutdownRequest.type, () => {
12466
+ this.shutdown = true;
11773
12467
  });
11774
- analyse(textDocument.uri);
11775
- });
11776
- connection.onNotification(import_main.DidChangeTextDocumentNotification.type, ({ textDocument, contentChanges }) => {
11777
- const previous = documents.get(textDocument.uri);
11778
- if (previous === void 0) return;
11779
- const document = TextDocument$1.update(previous, contentChanges, textDocument.version);
11780
- documents.set(textDocument.uri, document);
11781
- workspace.open({
11782
- uri: document.uri,
11783
- version: document.version,
11784
- text: document.getText()
12468
+ connection.onNotification(import_main.ExitNotification.type, () => this.finish(this.shutdown ? 0 : 1));
12469
+ connection.onClose(() => setImmediate(() => this.finish(this.shutdown ? 0 : 1)));
12470
+ }
12471
+ registerDocuments() {
12472
+ const { connection, documents, workspace } = this;
12473
+ connection.onNotification(import_main.DidOpenTextDocumentNotification.type, ({ textDocument }) => {
12474
+ const document = TextDocument$1.create(textDocument.uri, textDocument.languageId, textDocument.version, textDocument.text);
12475
+ documents.set(textDocument.uri, document);
12476
+ workspace.open({
12477
+ uri: document.uri,
12478
+ version: document.version,
12479
+ text: document.getText()
12480
+ });
12481
+ this.analyse(textDocument.uri);
11785
12482
  });
11786
- schedule(textDocument.uri);
11787
- });
11788
- connection.onNotification(import_main.DidCloseTextDocumentNotification.type, ({ textDocument }) => {
11789
- const { uri } = textDocument;
11790
- documents.delete(uri);
11791
- const pending = timers.get(uri);
11792
- if (pending !== void 0) clearTimeout(pending);
11793
- timers.delete(uri);
11794
- connection.sendNotification(import_main.PublishDiagnosticsNotification.type, {
11795
- uri,
11796
- diagnostics: []
12483
+ connection.onNotification(import_main.DidChangeTextDocumentNotification.type, ({ textDocument, contentChanges }) => {
12484
+ const previous = documents.get(textDocument.uri);
12485
+ if (previous === void 0) return;
12486
+ const document = TextDocument$1.update(previous, contentChanges, textDocument.version);
12487
+ documents.set(textDocument.uri, document);
12488
+ workspace.open({
12489
+ uri: document.uri,
12490
+ version: document.version,
12491
+ text: document.getText()
12492
+ });
12493
+ this.schedule(textDocument.uri);
11797
12494
  });
11798
- workspace.close(uri).then((wasCatalog) => wasCatalog ? publishAll() : void 0);
11799
- });
11800
- connection.onNotification(import_main.DidChangeWatchedFilesNotification.type, ({ changes }) => {
11801
- workspace.filesChanged(changes.map((change) => change.uri)).then((changed) => changed ? publishAll() : void 0).catch((error) => log(`vi18n: ${String(error)}`));
11802
- });
11803
- connection.onRequest(import_main.HoverRequest.type, async ({ textDocument, position }) => {
11804
- await settle(textDocument.uri);
11805
- return workspace.hover(textDocument.uri, position);
11806
- });
11807
- connection.onRequest(import_main.DefinitionRequest.type, async ({ textDocument, position }) => {
11808
- await settle(textDocument.uri);
11809
- return workspace.definition(textDocument.uri, position);
11810
- });
11811
- /** A pending rescan runs now: positions must match the text the client shows. */
11812
- const settle = async (uri) => {
11813
- const pending = timers.get(uri);
11814
- if (pending === void 0) return;
11815
- clearTimeout(pending);
11816
- timers.delete(uri);
11817
- await analyse(uri);
11818
- };
11819
- connection.listen();
11820
- return done;
11821
- }
11822
- //#endregion
12495
+ connection.onNotification(import_main.DidCloseTextDocumentNotification.type, ({ textDocument }) => {
12496
+ const { uri } = textDocument;
12497
+ documents.delete(uri);
12498
+ this.cancelPending(uri);
12499
+ connection.sendNotification(import_main.PublishDiagnosticsNotification.type, {
12500
+ uri,
12501
+ diagnostics: []
12502
+ });
12503
+ workspace.close(uri).then((wasCatalog) => wasCatalog ? this.publishAll() : void 0).catch((error) => this.log(`vi18n: ${String(error)}`));
12504
+ });
12505
+ connection.onNotification(import_main.DidChangeWatchedFilesNotification.type, ({ changes }) => {
12506
+ workspace.filesChanged(changes.map((change) => change.uri)).then((changed) => changed ? this.publishAll() : void 0).catch((error) => this.log(`vi18n: ${String(error)}`));
12507
+ });
12508
+ }
12509
+ /** `vi18n.replaceText`: the rename, then every open document's diagnostics again. */
12510
+ async execute(params) {
12511
+ if (params.command !== "vi18n.replaceText") return null;
12512
+ const [request] = params.arguments ?? [];
12513
+ const { uri, from, to } = request ?? {};
12514
+ if (typeof uri !== "string" || typeof from !== "string" || typeof to !== "string") throw new Error(`${REPLACE_COMMAND} needs { uri, from, to }`);
12515
+ try {
12516
+ const sites = await this.workspace.replaceText({
12517
+ uri,
12518
+ from,
12519
+ to
12520
+ });
12521
+ this.log(`vi18n: replaced ${sites} sites`);
12522
+ } catch (error) {
12523
+ const message = error instanceof Error ? error.message : String(error);
12524
+ this.connection.sendNotification(import_main.ShowMessageNotification.type, {
12525
+ type: import_main.MessageType.Error,
12526
+ message: `vi18n: replacing the text failed: ${message}`
12527
+ });
12528
+ }
12529
+ await this.publishAll();
12530
+ return null;
12531
+ }
12532
+ registerRequests() {
12533
+ const { connection, workspace } = this;
12534
+ connection.onRequest(import_main.HoverRequest.type, async ({ textDocument, position }) => {
12535
+ await this.settle(textDocument.uri);
12536
+ return workspace.hover(textDocument.uri, position);
12537
+ });
12538
+ connection.onRequest(import_main.DefinitionRequest.type, async ({ textDocument, position }) => {
12539
+ await this.settle(textDocument.uri);
12540
+ return workspace.definition(textDocument.uri, position);
12541
+ });
12542
+ connection.onRequest(import_main.CodeActionRequest.type, async ({ textDocument, context }) => {
12543
+ await this.settle(textDocument.uri);
12544
+ return workspace.codeActions(textDocument.uri, context.diagnostics);
12545
+ });
12546
+ connection.onRequest(import_main.ExecuteCommandRequest.type, (params) => this.execute(params));
12547
+ }
12548
+ };
11823
12549
  export { startLanguageServer };