null-ls.nvim icon indicating copy to clipboard operation
null-ls.nvim copied to clipboard

feat: buf format via stdin

Open choplin opened this issue 2 years ago • 4 comments

buf now support format files via stdin.

This would be more efficient than the current temp_file settings. (Additionally, temp_file settings don't work out-of-the-box in my environment)

choplin avatar Aug 18 '22 09:08 choplin

I don't think it's supported quite yet - there's an open PR for it though. I'd assume it'll make it out in the next release.

stefanvanburen avatar Aug 18 '22 12:08 stefanvanburen

Thanks! Let's wait until the upstream PR has been merged, then we can go ahead and merge this, since I agree it's a big improvement.

jose-elias-alvarez avatar Aug 18 '22 15:08 jose-elias-alvarez

Thanks, everyone! Right, I misunderstood the buf behavior. Although this PR worked for me as expected, it didn't format input from stdin but format all proto files on the project defined with buf.yaml and buf.work.yaml. Since the rest proto files were already formatted, it looked to format only the file being edited.

By the way, I added the --stdin flag for https://github.com/bufbuild/buf/pull/1345. I'd be happy if this would be merged when https://github.com/bufbuild/buf/pull/1345 is merged and released.

choplin avatar Aug 19 '22 02:08 choplin

I'll watch https://github.com/bufbuild/buf/pull/1345, and let you know when it's released.

choplin avatar Aug 19 '22 02:08 choplin