atom-gpp-compiler
atom-gpp-compiler copied to clipboard
No Compiling Error text file
No compiling error text file appears when compilation fails. Js Stack Trace Error shows up.
Same problem here, 'compiling_error.txt' does not appear for 2 weeks ago. the option for 'compiling_error.txt' is enabled in gpp-compiler settings
No compiling error text file appears when compilation fails. Js Stack Trace Error shows up.
I got it work properly by modifying following codes within ~/.atom/packages/gpp-compiler/index.js
(line 298~300) fs.writeFile(path.join(info.dir, "compiling_error.txt"), stderr);
-> fs.writeFileSync(path.join(info.dir, "compiling_error.txt"), stderr);
(line 431) fs.unlinkSync(path.join(info.dir, "compiling_error.txt"));
-> fs.unlinkSync(path.join(info.dir, "compiling_error.txt"));
it helped but still it doesnt update after first time the compile_error.txt .we have to close and reopen.
it helped but still it doesnt update after first time the compile_error.txt .we have to close and reopen.
It works for me, giving all errors in the same file. With compile_error.txt loaded in atom, it seems to update automatically.
For what its worth the compile_error.txt file is created in the same directory as file being compiled.
Actually a better fix might be to use the asynchronous write, but add an error callback to the function call.
fs.writeFile(path.join(info.dir, "compiling_error.txt"), stderr, (stderr) => {
if (stderr) {
atom.
notifications.
addWarning(stderr.replace(/\n/g, "<br/>"));
}
});
and
fs.unlink(path.join(info.dir, "compiling_error.txt"), (err) => {
if (err) {
atom.
notifications.
addWarning(stderr.replace(/\n/g, "<br/>"));
}
});
As seen in this diff of the pull request https://github.com/kriscross07/atom-gpp-compiler/pull/285/commits/cbff40e2bf3d2c2e65a705fa5d00c7f6137dd42d.
Either will work but an asynchronous file write is probably more robust.