latex-lsp/index.ts

17 lines
427 B
TypeScript

import fs from 'fs';
import process from 'process';
import { diagnosticsRequests, getDiagnostics, parseLsp } from './parser';
if (process.argv.length !== 3) {
console.log("Please provide only one pass");
process.exit(1);
}
const file = fs.readFileSync(process.argv[2]).toString();
const res = parseLsp(file);
fs.writeFileSync('./res', res.text);
console.log((await diagnosticsRequests(res)).map(a => a.replacements));