theia-sprotty
Version:
Glue code for sprotty diagrams in a Theia IDE
27 lines • 839 B
JavaScript
;
/*
* Copyright (C) 2018 TypeFox and others.
*
* Licensed under the Apache License, Version 2.0 (the "License") you may not use this file except in compliance with the License.
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
*/
Object.defineProperty(exports, "__esModule", { value: true });
function isRanged(element) {
return element.range !== undefined;
}
exports.isRanged = isRanged;
function toLsRange(rangeString) {
var numbers = rangeString.split(/[:-]/).map(function (s) { return parseInt(s, 10); });
return {
start: {
line: numbers[0],
character: numbers[1]
},
end: {
line: numbers[2],
character: numbers[3]
}
};
}
exports.toLsRange = toLsRange;
//# sourceMappingURL=ranged.js.map