fish-lsp
Version:
LSP implementation for fish/fish-shell
21 lines (20 loc) • 643 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.formatDocumentContent = formatDocumentContent;
const child_process_1 = require("child_process");
async function formatDocumentContent(content) {
return new Promise((resolve, reject) => {
const process = (0, child_process_1.exec)('fish_indent', (error, stdout, stderr) => {
if (error) {
reject(stderr);
}
else {
resolve(stdout);
}
});
if (process.stdin) {
process.stdin.write(content);
process.stdin.end();
}
});
}