Making OB / RB / OCompletion / Shout to work on Pharo 1.3

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

Making OB / RB / OCompletion / Shout to work on Pharo 1.3

Mariano Martinez Peck
Hi folks. I spent a couple of hours here in the sprint trying to make all those projects to work on Pharo 1.3. I've updated all configurations.
All tests are green, and I can browse code, and some refactors. However, I did a couple of changes that I have NO IDEA. I commit them but I would like someone to review them. Important changes:

from:

OBCodeBrowser  >> subscribe
    "We want to be notified first about changes of the definition, so that we can replace it with a custom one."
   
    | actions |
    super subscribe.
    actions := announcer subscriptions
        at: OBDefinitionChanged
        ifAbsent: [ ActionSequence new ].
    announcer subscriptions
        at: OBDefinitionChanged
        put: (actions copyWithFirst: (MessageSend
            receiver: self
            selector: #definitionChanged:))

to:

OBCodeBrowser  >> subscribe
    "We want to be notified first about changes of the definition, so that we can replace it with a custom one."
   
    | actions |
    super subscribe.
    announcer on: OBDefinitionChanged send: #definitionChanged: to: self.
   

And from:

OBTextMorphWithShout >> editorClass
    "Answer the class used to create the receiver's editor"
   
    ^OBTextMorphEditorWithShout

to:

OBTextMorphWithShout >> editorClass
    "Answer the class used to create the receiver's editor"
   
    ^SmalltalkEditor


Thanks

--
Mariano
http://marianopeck.wordpress.com

Reply | Threaded
Open this post in threaded view
|

Re: Making OB / RB / OCompletion / Shout to work on Pharo 1.3

Lukas Renggli
> OBCodeBrowser  >> subscribe
>     "We want to be notified first about changes of the definition, so that
> we can replace it with a custom one."
>
>     | actions |
>     super subscribe.
>     actions := announcer subscriptions
>         at: OBDefinitionChanged
>         ifAbsent: [ ActionSequence new ].
>     announcer subscriptions
>         at: OBDefinitionChanged
>         put: (actions copyWithFirst: (MessageSend
>             receiver: self
>             selector: #definitionChanged:))
>
> to:
>
> OBCodeBrowser  >> subscribe
>     "We want to be notified first about changes of the definition, so that
> we can replace it with a custom one."
>
>     | actions |
>     super subscribe.
>     announcer on: OBDefinitionChanged send: #definitionChanged: to: self.

This change breaks the undo/redo mechanism of class definitions and
subsequently the undo/redo mechanism of all other code changes and
refactorings.

> And from:
>
> OBTextMorphWithShout >> editorClass
>     "Answer the class used to create the receiver's editor"
>
>     ^OBTextMorphEditorWithShout
>
> to:
>
> OBTextMorphWithShout >> editorClass
>     "Answer the class used to create the receiver's editor"
>
>     ^SmalltalkEditor

This breaks OB in various ways. Not every editor is a Smalltalk
editor, there are lots of editors that don't need Smalltalk semantics
(editing comments, editing organization, displaying lint results,
displaying diffs, ...).

Furthermore, OBTextMorphWithShould should be gone. It is not needed
any longer and was removed to make OB properly work in Pharo 1.2.

Lukas

--
Lukas Renggli
www.lukas-renggli.ch