sysml-v2-lsp 0.35.0 → 0.37.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.
@@ -113452,6 +113452,25 @@ package WarmUp {
113452
113452
  }
113453
113453
  `;
113454
113454
 
113455
+ // server/src/parser/positionUtils.ts
113456
+ function normalizeUtf16Columns(text, tokens, errors) {
113457
+ if (!/[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(text)) return;
113458
+ const columns = /* @__PURE__ */ new Map();
113459
+ const lines = text.split("\n");
113460
+ for (let line = 0; line < lines.length; line++) {
113461
+ if (!/[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(lines[line])) continue;
113462
+ const offsets = [0];
113463
+ for (const character of lines[line]) offsets.push(offsets[offsets.length - 1] + character.length);
113464
+ columns.set(line, offsets);
113465
+ }
113466
+ for (const token of tokens) {
113467
+ token.column = columns.get(token.line - 1)?.[token.column] ?? token.column;
113468
+ }
113469
+ for (const error of errors) {
113470
+ error.column = columns.get(error.line)?.[error.column] ?? error.column;
113471
+ }
113472
+ }
113473
+
113455
113474
  // server/src/parser/parseWorker.ts
113456
113475
  function createWarmupChunks() {
113457
113476
  const allLines = WARMUP_TEXT.split("\n");
@@ -114372,6 +114391,7 @@ function handleParseRequest(msg) {
114372
114391
  }
114373
114392
  tokenStream.fill();
114374
114393
  const allTokens = tokenStream.getTokens();
114394
+ normalizeUtf16Columns(text, allTokens, errors);
114375
114395
  const visible = [];
114376
114396
  const positionIndex = /* @__PURE__ */ new Map();
114377
114397
  for (let i = 0; i < allTokens.length; i++) {