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

more/better hooks in erl_prettypr #2

Open
richcarl opened this issue Aug 4, 2011 · 0 comments
Open

more/better hooks in erl_prettypr #2

richcarl opened this issue Aug 4, 2011 · 0 comments

Comments

@richcarl
Copy link
Owner

richcarl commented Aug 4, 2011

Vlad Dumitrescu wrote (08/12/2005 12:01 PM):

I would like to use syntax_tools to prettyprint source code, but with a slightly modified layout - for example, I'd like to have a newline after function clause arrows.

I made the layout so that it tries to be as compact as possible, so it will not break lines if there is enough room horizontally. Of course, this might not suit everyone, but it suited me at the time.

At first I thought this would be done with prettyprinter hooks, but they are only called for annotations.

Yes. In hindsight, maybe I should have added more hooks after all. Perhaps I can still change it and remain backwards compatible.

My question is: is there a way to customize the behaviour like this in a friendly way, or do I have to take the axe and hack away?

If you add annotations to the nodes you want to handle, as a prepass, you should be able to trigger the hooks and do the formatting your way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant