Modyfing BlueInk formatter

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Modyfing BlueInk formatter

Peter Uhnak
Hi,

how hard it would be to modify BlueInk formatter to inline dynamic
array in some situations?

Currently BL places each element of dynamic array at separate line

~~~~~~~~~~
v addAll:
    {l1.
   l2.
   l3}
~~~~~~~~~~

and what I want is to inline them if the length of the element names
is small (1-3 characters maybe)...

~~~~~~~~~
v addAll: { l1 . l2 . l3 }
~~~~~~~~~

For longer names I want to keep the current behavior.

Obviously this would have to be configurable, however as I have no
knowledge of BL internals I don't even know where to start...

Any pointers appreciated,
Peter

Reply | Threaded
Open this post in threaded view
|

Re: Modyfing BlueInk formatter

Franck Warlouzet
Hi,

It could be cool yep, I will do it. So we say 3 characters as limit ?

Franck

> Date: Sat, 19 Sep 2015 02:16:34 +0200

> From: [hidden email]
> To: [hidden email]
> Subject: [Pharo-dev] Modyfing BlueInk formatter
>
> Hi,
>
> how hard it would be to modify BlueInk formatter to inline dynamic
> array in some situations?
>
> Currently BL places each element of dynamic array at separate line
>
> ~~~~~~~~~~
> v addAll:
> {l1.
> l2.
> l3}
> ~~~~~~~~~~
>
> and what I want is to inline them if the length of the element names
> is small (1-3 characters maybe)...
>
> ~~~~~~~~~
> v addAll: { l1 . l2 . l3 }
> ~~~~~~~~~
>
> For longer names I want to keep the current behavior.
>
> Obviously this would have to be configurable, however as I have no
> knowledge of BL internals I don't even know where to start...
>
> Any pointers appreciated,
> Peter
>
Reply | Threaded
Open this post in threaded view
|

Re: Modyfing BlueInk formatter

Peter Uhnak
> It could be cool yep, I will do it.

I don't mind digging into it provided I have some pointers. :)

> So we say 3 characters as limit ?

3 characters is a good start, but I wonder...

because there may be other use-cases.

For example
"all elements are symbols AND it all fits on a single line"
{ #smb1 . #smb2 . #smb3 }

or

"all elements are sends to the same object AND it all fits on a single line"
{ TextEmphasis bold . TextEmphasis italic }

The ideal scenario is that we can A/B test this -- implement it all
and see how each scenario behaves in real world, but that is perhaps a
lot of work.

Speaking of which... I'm thinking that I could analyze existing code
and see how these things are generally formatted (there's a lot of
code formatted by hand).

Peter