20 lines
774 B
Plaintext
20 lines
774 B
Plaintext
|
"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
|