Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add options to write the formatted file to stdout and accept a file from stdin #282

Closed
saborrie opened this issue Jun 10, 2021 · 1 comment · Fixed by #287
Closed

Add options to write the formatted file to stdout and accept a file from stdin #282

saborrie opened this issue Jun 10, 2021 · 1 comment · Fixed by #287
Assignees
Labels
type:enhancement New feature or request
Milestone

Comments

@saborrie
Copy link

It would be great to be able to create a vscode extension for this formatter that is compatible with vscode's format-on-save.

It would be best if it were possible to leave the actual editing of the file contents to vscode, and to just print out the new file contents to stdout.

This doesn't need to be for multiple files in this use case.

This is how prettier works (except when using --write), so it makes sense to work in the same way.

Additionally it would help to support accepting a file from stdin rather than a path, so that it can be made to work with virtual filesystems.

@belav belav added the type:enhancement New feature or request label Jun 10, 2021
@belav belav mentioned this issue Jun 10, 2021
@belav
Copy link
Owner

belav commented Jun 10, 2021

It would be great to be able to create a vscode extension for this formatter that is compatible with vscode's format-on-save.

Definitely! It's been on my list forever now to start to figure out IDE integration, but hasn't been a priority yet.

I don't think it will be too difficult to write to stdout. It will probably not be the default because that would be a breaking change.
My initial thought is adding an option such as --write-stdout

I'll look at accepting a file from stdin at the same time, but may split that off into another issue if it isn't super straightforward.

belav added a commit that referenced this issue Jun 11, 2021
@belav belav added this to the 0.9.6 milestone Jun 11, 2021
@belav belav mentioned this issue Jun 11, 2021
8 tasks
@belav belav self-assigned this Jun 11, 2021
belav added a commit that referenced this issue Jun 12, 2021
* Implementing ability to write to stdout

closes #282

* Some refactoring

* Support piping standard in to csharpier
@belav belav changed the title Add an option to write the formatted file to stdout Add options to write the formatted file to stdout and accept a file from stdin Jun 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants