astro-ghostcms/.pnpm-store/v3/files/50/e8f86aac5859609bdc3698259d1...

20 lines
774 B
Plaintext
Raw Permalink Normal View History

2024-02-14 19:45:06 +00:00
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.register = void 0;
const shared_1 = require("../shared");
const transforms_1 = require("../utils/transforms");
function register(ctx) {
return (uri, position) => {
const document = ctx.getTextDocument(uri);
if (!document)
return [];
const fileName = ctx.uriToFileName(document.uri);
const offset = document.offsetAt(position);
const info = (0, shared_1.safeCall)(() => ctx.languageService.getDefinitionAndBoundSpan(fileName, offset));
if (!info)
return [];
return (0, transforms_1.boundSpanToLocationLinks)(info, document, ctx);
};
}
exports.register = register;
//# sourceMappingURL=definition.js.map