UNPKG

gauge-ts

Version:
31 lines (30 loc) 1.2 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.StepNameProcessor = void 0; const messages_pb_1 = require("../gen/messages_pb"); const spec_pb_1 = require("../gen/spec_pb"); const StepRegistry_1 = require("../models/StepRegistry"); class StepNameProcessor { process(req) { const res = new messages_pb_1.StepNameResponse(); if (!StepRegistry_1.default.isImplemented(req.getStepvalue())) { res.setIssteppresent(false); } else { const info = StepRegistry_1.default.get(req.getStepvalue()); const range = info.getRange(); res.setIssteppresent(true); res.setFilename(info.getFilePath()); res.setHasalias(info.hasAlias()); res.setStepnameList([info.getStepText()]); const span = new spec_pb_1.Span(); span.setStart(range.getStart().getLine()); span.setStartchar(range.getStart().getChar()); span.setEnd(range.getEnd().getLine()); span.setEndchar(range.getEnd().getChar()); res.setSpan(span); } return res; } } exports.StepNameProcessor = StepNameProcessor;