cppfront icon indicating copy to clipboard operation
cppfront copied to clipboard

Feat: Add ability to compile from stdin

Open vanceism7 opened this issue 1 year ago • 2 comments

This PR adds the ability to compile from stdin.

This is useful so that cppfront can compile source code that's been piped in from another program. For my use-case specifically: when working on the LSP server, we already have access to source code within a TextDocument variable.

Prior to this PR, we have to either save the edited content to a temporary file, or save the source file itself prior to invoking cppfront, otherwise we end up with stale diagnostics data.

Happy to fix any issues anyone finds!

Thanks!

vanceism7 avatar Oct 22 '24 20:10 vanceism7

Thanks for the reviews!

vanceism7 avatar Oct 23 '24 20:10 vanceism7

Thanks for your pull request! It looks like this may be your first contribution to cppfront. I've emailed you the Contributor License Agreement (CLA), and once it's completed I can look at your pull request. Thanks again for your contribution.

hsutter avatar Oct 31 '24 02:10 hsutter

Thanks Herb! (I had read the in the section about contributing that we needed to sign something, and was wondering where we were supposed to sign, happy to see it just comes through email haha). I've signed and sent back the CLA

vanceism7 avatar Nov 01 '24 15:11 vanceism7

Thanks!

hsutter avatar Nov 02 '24 16:11 hsutter