@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 +23 -24
- package/dist/index.js.map +3 -3
- package/dist/index.mjs +23 -24
- package/dist/index.mjs.map +3 -3
- package/dist/service/marko/{document-links/index.d.ts → document-links.d.ts} +1 -1
- package/dist/service/marko/{document-symbols/index.d.ts → document-symbols.d.ts} +1 -1
- package/package.json +8 -8
- package/dist/service/marko/document-links/extract.d.ts +0 -8
- package/dist/service/marko/document-symbols/extract.d.ts +0 -8
package/dist/index.mjs
CHANGED
|
@@ -1294,10 +1294,20 @@ var findDefinition = async (doc, params) => {
|
|
|
1294
1294
|
})) || [];
|
|
1295
1295
|
};
|
|
1296
1296
|
|
|
1297
|
-
// src/service/marko/document-links
|
|
1297
|
+
// src/service/marko/document-links.ts
|
|
1298
1298
|
import { DocumentLink } from "vscode-languageserver";
|
|
1299
1299
|
import { URI as URI6 } from "vscode-uri";
|
|
1300
1300
|
var importTagReg2 = /(['"])<((?:[^\1\\>]+|\\.)*)>?\1/g;
|
|
1301
|
+
var cache = /* @__PURE__ */ new WeakMap();
|
|
1302
|
+
var findDocumentLinks = async (doc) => {
|
|
1303
|
+
const parsed = parse2(doc);
|
|
1304
|
+
let result = cache.get(parsed);
|
|
1305
|
+
if (!result) {
|
|
1306
|
+
result = extractDocumentLinks(doc, parsed, getCompilerInfo(doc).lookup);
|
|
1307
|
+
cache.set(parsed, result);
|
|
1308
|
+
}
|
|
1309
|
+
return result;
|
|
1310
|
+
};
|
|
1301
1311
|
function extractDocumentLinks(doc, parsed, lookup) {
|
|
1302
1312
|
if (URI6.parse(doc.uri).scheme === "untitled") {
|
|
1303
1313
|
return [];
|
|
@@ -1319,7 +1329,10 @@ function extractDocumentLinks(doc, parsed, lookup) {
|
|
|
1319
1329
|
if (node.attrs && node.nameText) {
|
|
1320
1330
|
for (const attr of node.attrs) {
|
|
1321
1331
|
if (isDocumentLinkAttr(doc, node, attr)) {
|
|
1322
|
-
|
|
1332
|
+
const resolved = resolveUrl(read(attr.value.value).slice(1, -1), doc.uri);
|
|
1333
|
+
if (resolved) {
|
|
1334
|
+
links.push(DocumentLink.create(parsed.locationAt(attr.value.value), resolveUrl(read(attr.value.value).slice(1, -1), doc.uri)));
|
|
1335
|
+
}
|
|
1323
1336
|
}
|
|
1324
1337
|
}
|
|
1325
1338
|
}
|
|
@@ -1355,21 +1368,19 @@ function extractDocumentLinks(doc, parsed, lookup) {
|
|
|
1355
1368
|
return links;
|
|
1356
1369
|
}
|
|
1357
1370
|
|
|
1358
|
-
// src/service/marko/document-
|
|
1359
|
-
|
|
1360
|
-
|
|
1371
|
+
// src/service/marko/document-symbols.ts
|
|
1372
|
+
import { URI as URI7 } from "vscode-uri";
|
|
1373
|
+
import { SymbolInformation, SymbolKind } from "vscode-languageserver";
|
|
1374
|
+
var cache2 = /* @__PURE__ */ new WeakMap();
|
|
1375
|
+
var findDocumentSymbols = async (doc) => {
|
|
1361
1376
|
const parsed = parse2(doc);
|
|
1362
|
-
let result =
|
|
1377
|
+
let result = cache2.get(parsed);
|
|
1363
1378
|
if (!result) {
|
|
1364
|
-
result =
|
|
1365
|
-
|
|
1379
|
+
result = extractDocumentSymbols(doc, parsed, getCompilerInfo(doc).lookup);
|
|
1380
|
+
cache2.set(parsed, result);
|
|
1366
1381
|
}
|
|
1367
1382
|
return result;
|
|
1368
1383
|
};
|
|
1369
|
-
|
|
1370
|
-
// src/service/marko/document-symbols/extract.ts
|
|
1371
|
-
import { URI as URI7 } from "vscode-uri";
|
|
1372
|
-
import { SymbolInformation, SymbolKind } from "vscode-languageserver";
|
|
1373
1384
|
function extractDocumentSymbols(doc, parsed, lookup) {
|
|
1374
1385
|
if (URI7.parse(doc.uri).scheme === "untitled") {
|
|
1375
1386
|
return [];
|
|
@@ -1396,18 +1407,6 @@ function extractDocumentSymbols(doc, parsed, lookup) {
|
|
|
1396
1407
|
return symbols;
|
|
1397
1408
|
}
|
|
1398
1409
|
|
|
1399
|
-
// src/service/marko/document-symbols/index.ts
|
|
1400
|
-
var cache2 = /* @__PURE__ */ new WeakMap();
|
|
1401
|
-
var findDocumentSymbols = async (doc) => {
|
|
1402
|
-
const parsed = parse2(doc);
|
|
1403
|
-
let result = cache2.get(parsed);
|
|
1404
|
-
if (!result) {
|
|
1405
|
-
result = extractDocumentSymbols(doc, parsed, getCompilerInfo(doc).lookup);
|
|
1406
|
-
cache2.set(parsed, result);
|
|
1407
|
-
}
|
|
1408
|
-
return result;
|
|
1409
|
-
};
|
|
1410
|
-
|
|
1411
1410
|
// src/service/marko/format.ts
|
|
1412
1411
|
import { Range as Range7, TextEdit as TextEdit6 } from "vscode-languageserver";
|
|
1413
1412
|
import { URI as URI8 } from "vscode-uri";
|