@marko/language-server 0.12.13 → 0.12.14

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.
package/dist/index.js CHANGED
@@ -1275,10 +1275,20 @@ var findDefinition = async (doc, params) => {
1275
1275
  })) || [];
1276
1276
  };
1277
1277
 
1278
- // src/service/marko/document-links/extract.ts
1278
+ // src/service/marko/document-links.ts
1279
1279
  var import_vscode_languageserver11 = require("vscode-languageserver");
1280
1280
  var import_vscode_uri6 = require("vscode-uri");
1281
1281
  var importTagReg2 = /(['"])<((?:[^\1\\>]+|\\.)*)>?\1/g;
1282
+ var cache = /* @__PURE__ */ new WeakMap();
1283
+ var findDocumentLinks = async (doc) => {
1284
+ const parsed = parse2(doc);
1285
+ let result = cache.get(parsed);
1286
+ if (!result) {
1287
+ result = extractDocumentLinks(doc, parsed, getCompilerInfo(doc).lookup);
1288
+ cache.set(parsed, result);
1289
+ }
1290
+ return result;
1291
+ };
1282
1292
  function extractDocumentLinks(doc, parsed, lookup) {
1283
1293
  if (import_vscode_uri6.URI.parse(doc.uri).scheme === "untitled") {
1284
1294
  return [];
@@ -1300,7 +1310,10 @@ function extractDocumentLinks(doc, parsed, lookup) {
1300
1310
  if (node.attrs && node.nameText) {
1301
1311
  for (const attr of node.attrs) {
1302
1312
  if (isDocumentLinkAttr(doc, node, attr)) {
1303
- links.push(import_vscode_languageserver11.DocumentLink.create(parsed.locationAt(attr.value.value), resolveUrl(read(attr.value.value).slice(1, -1), doc.uri)));
1313
+ const resolved = resolveUrl(read(attr.value.value).slice(1, -1), doc.uri);
1314
+ if (resolved) {
1315
+ links.push(import_vscode_languageserver11.DocumentLink.create(parsed.locationAt(attr.value.value), resolveUrl(read(attr.value.value).slice(1, -1), doc.uri)));
1316
+ }
1304
1317
  }
1305
1318
  }
1306
1319
  }
@@ -1336,21 +1349,19 @@ function extractDocumentLinks(doc, parsed, lookup) {
1336
1349
  return links;
1337
1350
  }
1338
1351
 
1339
- // src/service/marko/document-links/index.ts
1340
- var cache = /* @__PURE__ */ new WeakMap();
1341
- var findDocumentLinks = async (doc) => {
1352
+ // src/service/marko/document-symbols.ts
1353
+ var import_vscode_uri7 = require("vscode-uri");
1354
+ var import_vscode_languageserver12 = require("vscode-languageserver");
1355
+ var cache2 = /* @__PURE__ */ new WeakMap();
1356
+ var findDocumentSymbols = async (doc) => {
1342
1357
  const parsed = parse2(doc);
1343
- let result = cache.get(parsed);
1358
+ let result = cache2.get(parsed);
1344
1359
  if (!result) {
1345
- result = extractDocumentLinks(doc, parsed, getCompilerInfo(doc).lookup);
1346
- cache.set(parsed, result);
1360
+ result = extractDocumentSymbols(doc, parsed, getCompilerInfo(doc).lookup);
1361
+ cache2.set(parsed, result);
1347
1362
  }
1348
1363
  return result;
1349
1364
  };
1350
-
1351
- // src/service/marko/document-symbols/extract.ts
1352
- var import_vscode_uri7 = require("vscode-uri");
1353
- var import_vscode_languageserver12 = require("vscode-languageserver");
1354
1365
  function extractDocumentSymbols(doc, parsed, lookup) {
1355
1366
  if (import_vscode_uri7.URI.parse(doc.uri).scheme === "untitled") {
1356
1367
  return [];
@@ -1377,18 +1388,6 @@ function extractDocumentSymbols(doc, parsed, lookup) {
1377
1388
  return symbols;
1378
1389
  }
1379
1390
 
1380
- // src/service/marko/document-symbols/index.ts
1381
- var cache2 = /* @__PURE__ */ new WeakMap();
1382
- var findDocumentSymbols = async (doc) => {
1383
- const parsed = parse2(doc);
1384
- let result = cache2.get(parsed);
1385
- if (!result) {
1386
- result = extractDocumentSymbols(doc, parsed, getCompilerInfo(doc).lookup);
1387
- cache2.set(parsed, result);
1388
- }
1389
- return result;
1390
- };
1391
-
1392
1391
  // src/service/marko/format.ts
1393
1392
  var import_vscode_languageserver13 = require("vscode-languageserver");
1394
1393
  var import_vscode_uri8 = require("vscode-uri");