-
Notifications
You must be signed in to change notification settings - Fork 108
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
support nginx-mode with crossplane #42
base: master
Are you sure you want to change the base?
Conversation
Thank you. This doesn't currently work reliably because crossplane doesn't support stdin properly. I'll send a pull request to crossplane to fix it. |
It's quite complex because the crossplane formatter uses a parser that visits include files. This means that even if the formatted file comes from stdin, it needs to have a fake filename used to resolve the includes. And those included files need to exist. I don't have time to look more deeply into it right now, but I can try again later. |
Basically, for formatting purposes, the nginx conf file should always be read from stdin. (Even if we're formatting an existing file, because we may not have saved the file in Emacs, so the latest buffer contents need to be sent from the Emacs buffer to crossplane's stdin. It's simpler and more reliable to always do it via stdin, even if we have saved the file in Emacs just before formatting.) Then there's the question of resolving includes. I hope we can change crossplane so it doesn't visit includes when formatting a file. If we can't do that, then Emacs needs to give crossplane a fake filename for stdin (some formatters have this command line option, e.g. |
My current temporary solution is wrapper via shell script (not works in Windows) to support stdin as input.
and define formatter for nginx-mode as
|
It's great that you got it to work for yourself with a tempfile! Since it's open source, let's send them a pull request to fix it at the source though. That will make life easier for every editor plugin that uses it to format nginx conf files. Do you know Python? The code for the
We should probably make that part optional. So that it does |
No description provided.