proseFormatter.js 1.1 KB

12345678910111213141516171819202122232425
  1. "use strict";
  2. var __extends = (this && this.__extends) || function (d, b) {
  3. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  4. function __() { this.constructor = d; }
  5. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  6. };
  7. var abstractFormatter_1 = require("../language/formatter/abstractFormatter");
  8. var Formatter = (function (_super) {
  9. __extends(Formatter, _super);
  10. function Formatter() {
  11. _super.apply(this, arguments);
  12. }
  13. Formatter.prototype.format = function (failures) {
  14. var outputLines = failures.map(function (failure) {
  15. var fileName = failure.getFileName();
  16. var failureString = failure.getFailure();
  17. var lineAndCharacter = failure.getStartPosition().getLineAndCharacter();
  18. var positionTuple = "[" + (lineAndCharacter.line + 1) + ", " + (lineAndCharacter.character + 1) + "]";
  19. return "" + fileName + positionTuple + ": " + failureString;
  20. });
  21. return outputLines.join("\n") + "\n";
  22. };
  23. return Formatter;
  24. }(abstractFormatter_1.AbstractFormatter));
  25. exports.Formatter = Formatter;