UNPKG

markdown-table-prettify

Version:

Transforms markdown tables to be more readable.

18 lines (17 loc) 926 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.TableDocumentPrettyfierCommand = void 0; var vscode = require("vscode"); var TableDocumentPrettyfierCommand = /** @class */ (function () { function TableDocumentPrettyfierCommand(_multiTablePrettyfier) { this._multiTablePrettyfier = _multiTablePrettyfier; } TableDocumentPrettyfierCommand.prototype.prettifyDocument = function (editor) { var formattedDocument = this._multiTablePrettyfier.formatTables(editor.document.getText()); editor.edit(function (textEditorEdit) { textEditorEdit.replace(new vscode.Range(new vscode.Position(0, 0), new vscode.Position(editor.document.lineCount - 1, Number.MAX_SAFE_INTEGER)), formattedDocument); }); }; return TableDocumentPrettyfierCommand; }()); exports.TableDocumentPrettyfierCommand = TableDocumentPrettyfierCommand;