[Pharo-project] editing methods without header
Hi, Currently, when we edit a method, we use one text morph that includes both the header and the body of the method. I am searching for an easy way to edit only the body of the methods, but still have completion and syntax highlighting. Any ideas of how to approach this? Cheers, Doru -- www.tudorgirba.com "Be rather willing to give than demanding to get."
What i've did is to use a NewTextMorph, displaying as the contents, the method's body source; and on each edition (which is announced by the new text morph), reapply the shout styling. To maintain syntax highlighting: You have to call by SHOUT by hand, adding and eliminating the selector+arguments line to/from the resulting styled text. If TextMorph announces edition also, you could use the same trick there. Fernando On Thu, Sep 1, 2011 at 12:29 AM, Tudor Girba <tudor@tudorgirba.com> wrote:
Hi,
Currently, when we edit a method, we use one text morph that includes both the header and the body of the method.
I am searching for an easy way to edit only the body of the methods, but still have completion and syntax highlighting.
Any ideas of how to approach this?
Cheers, Doru
-- www.tudorgirba.com
"Be rather willing to give than demanding to get."
To maintain syntax highlighting: You have to call by SHOUT by hand, adding and  eliminating the selector+arguments line to/from the resulting styled text.
You don't have to do anything by hand: Set Shout to "workspace-mode" in #shoutAboutToStyle: and provide a dictionary with bindings for the arguments and the instance variables. Likely this currently doesn't work properly, but http://code.google.com/p/pharo/issues/detail?id=4609 should fix that. Lukas -- Lukas Renggli www.lukas-renggli.ch
participants (3)
-
Fernando Olivero -
Lukas Renggli -
Tudor Girba