Its a real pain that you can't multiple select things in the pharo UI...
As I try and do things in Pharo and compare the operations to what I can easily do in Eclipse or Intelli-J - I've hit a new one - how do I extract a common superclass from 2 classes that are similar? I can refactor create superclass - but that just does it for one class, and then I can't easily make my second class a subclass as Pharo complains about duplicate instance variables. It seems like the capability is locked in there - but I keep struggling to work it out (refactoring in Pharo seems more complicated than it should be somehow - and I'm really looking forward to sitting down with someone someday and working out some keystrokes to use - extract method, extract temporary, inline temporary should just be keystrokes). Tim _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
Good point. I've been struggling with multiple selection too e.g. when setting the refactoring scope. There's an entry called "selection..." but since I've never been able to select more than one item from a list, selecting "selection..." has the same effect as “category" (when in a category list of course).
Max On 05.08.2010, at 14:52, Tim Mackinnon wrote: > Its a real pain that you can't multiple select things in the pharo UI... > > As I try and do things in Pharo and compare the operations to what I can easily do in Eclipse or Intelli-J - I've hit a new one - how do I extract a common superclass from 2 classes that are similar? > > I can refactor create superclass - but that just does it for one class, and then I can't easily make my second class a subclass as Pharo complains about duplicate instance variables. > > It seems like the capability is locked in there - but I keep struggling to work it out (refactoring in Pharo seems more complicated than it should be somehow - and I'm really looking forward to sitting down with someone someday and working out some keystrokes to use - extract method, extract temporary, inline temporary should just be keystrokes). > > Tim > > _______________________________________________ > Pharo-project mailing list > [hidden email] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
On 5 Aug 2010, at 13:56, Max Leske wrote: > Good point. I've been struggling with multiple selection too e.g. > when setting the refactoring scope. There's an entry called > "selection..." but since I've never been able to select more than > one item from a list, selecting "selection..." has the same effect > as “category" (when in a category list of course). > So is there some way of applying a refactoring to more than one class? What is that refactoring scope menu item - is there some way to specify 2 or more classes in there? Why is this so hard? _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
>> Good point. I've been struggling with multiple selection too e.g. when
>> setting the refactoring scope. There's an entry called "selection..." but >> since I've never been able to select more than one item from a list, >> selecting "selection..." has the same effect as “category" (when in a >> category list of course). > > So is there some way of applying a refactoring to more than one class? What > is that refactoring scope menu item - is there some way to specify 2 or more > classes in there? Why is this so hard? The refactoring scope is something completely different. It selects the part of the system that is considered by a refactoring. Did you ever try to go through the whole create-class refactoring? I get a dialog that offers me to select multiple classes. Lukas -- Lukas Renggli www.lukas-renggli.ch _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
Hi Lukas - sorry to keep this thread going, but I don't quite
understand what you mean? Partly I think the issue is that over the years I've become very familiar with the Eclipse/IntelliJ refactorings (and how they approach things) and I've slowly forgotten how they work in smalltalk (although - in Dolphin they seem to more closely match Eclipse/IntelliJ - adding to my confusion in Pharo). To give some context, I had a class X, then I copied it to create class Y - made some changes and got something useful working. However X and Y are mostly the same - so deserve a superclass. This sounds to me like standard Refactor Class | Create Superclass refactoring (available in the context menu). Is this what you are referring to? (And this is a seaside30.rc image). Is this the create class refactoring you are referring to? It doesn't sound like it? The one I am referring to just asks me for a name of a superclass and shows me the method changes it will make (and I can remove those which I don't deem common) - but they only apply to the single class I ran the refactoring for - say X. This then leaves me with Y which still needs work. I was expecting somewhere where it would ask me if there are any other classes to consider for the refactoring (or better still - let me multi-select several classes before I do the "create superclass" in the first place - which apparently is very hard in Pharo for some reason?). So is there some other browser, or menu option that I am missing? Tim On 6 Aug 2010, at 00:31, Lukas Renggli wrote: >>> Good point. I've been struggling with multiple selection too e.g. >>> when >>> setting the refactoring scope. There's an entry called >>> "selection..." but >>> since I've never been able to select more than one item from a list, >>> selecting "selection..." has the same effect as “category" (when >>> in a >>> category list of course). >> >> So is there some way of applying a refactoring to more than one >> class? What >> is that refactoring scope menu item - is there some way to specify >> 2 or more >> classes in there? Why is this so hard? > > The refactoring scope is something completely different. It selects > the part of the system that is considered by a refactoring. > > Did you ever try to go through the whole create-class refactoring? I > get a dialog that offers me to select multiple classes. > > Lukas > > -- > Lukas Renggli > www.lukas-renggli.ch > > _______________________________________________ > Pharo-project mailing list > [hidden email] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
Select the superclass of your classes X and Y and perform the 'create
subclass' refactoring. A dialog asks you to choose the subclasses of your new class. This old website describes most of the refactorings: http://st-www.cs.illinois.edu/users/brant/Refactory/Refactorings.html. There is also a description in the tooltips of the menu actions. Lukas On 6 August 2010 11:47, Tim Mackinnon <[hidden email]> wrote: > Hi Lukas - sorry to keep this thread going, but I don't quite understand > what you mean? Partly I think the issue is that over the years I've become > very familiar with the Eclipse/IntelliJ refactorings (and how they approach > things) and I've slowly forgotten how they work in smalltalk (although - in > Dolphin they seem to more closely match Eclipse/IntelliJ - adding to my > confusion in Pharo). > > To give some context, I had a class X, then I copied it to create class Y - > made some changes and got something useful working. However X and Y are > mostly the same - so deserve a superclass. This sounds to me like standard > Refactor Class | Create Superclass refactoring (available in the context > menu). Is this what you are referring to? (And this is a seaside30.rc > image). Is this the create class refactoring you are referring to? It > doesn't sound like it? > > The one I am referring to just asks me for a name of a superclass and shows > me the method changes it will make (and I can remove those which I don't > deem common) - but they only apply to the single class I ran the refactoring > for - say X. This then leaves me with Y which still needs work. I was > expecting somewhere where it would ask me if there are any other classes to > consider for the refactoring (or better still - let me multi-select several > classes before I do the "create superclass" in the first place - which > apparently is very hard in Pharo for some reason?). > > So is there some other browser, or menu option that I am missing? > > Tim > > On 6 Aug 2010, at 00:31, Lukas Renggli wrote: > >>>> Good point. I've been struggling with multiple selection too e.g. when >>>> setting the refactoring scope. There's an entry called "selection..." >>>> but >>>> since I've never been able to select more than one item from a list, >>>> selecting "selection..." has the same effect as “category" (when in a >>>> category list of course). >>> >>> So is there some way of applying a refactoring to more than one class? >>> What >>> is that refactoring scope menu item - is there some way to specify 2 or >>> more >>> classes in there? Why is this so hard? >> >> The refactoring scope is something completely different. It selects >> the part of the system that is considered by a refactoring. >> >> Did you ever try to go through the whole create-class refactoring? I >> get a dialog that offers me to select multiple classes. >> >> Lukas >> >> -- >> Lukas Renggli >> www.lukas-renggli.ch >> >> _______________________________________________ >> Pharo-project mailing list >> [hidden email] >> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project > > > _______________________________________________ > Pharo-project mailing list > [hidden email] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project > -- Lukas Renggli www.lukas-renggli.ch _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
Hmmm - (again if you can please be patient with me)... I really am
missing something big here? So in my example class X and Y are subclasses of WAComponent - which has tons of subclasses (it could be even worse, they could subclass Object?). So does this mean that I should create my superclass A first? E.g. I create a new subclass of WAComponent, called A. I then make X and Y subclass A. Now I can do the "Refactor Class | Create Subclass" refactoring, and so I have to call it A2 (ultimately I only want A - but if needs must). Then I do get the prompt that you are referring to and can select both X and Y. Finally it just offers to make me class A2 but unlike what I was trying below it doesn't offer to move up any methods or instance variables???? So this doesn't work? And furthermore it seem much more convoluted than it should be? I don't understand why Refactor Class | Create Superclass doesn't prompt me for other peer classes (this is what I want - in fact what I really, really want is to select 2 classes in the first place). Maybe I'm being really stupid, or does no-one use this refactoring in Pharo? It would seem that my scenario is a very common one - so I'm struggling with this. And frustratingly it seems that all the horsepower to do this, is built into the tools but they just don't use them in an intuitive way? Tim On 6 Aug 2010, at 11:18, Lukas Renggli wrote: > Select the superclass of your classes X and Y and perform the 'create > subclass' refactoring. A dialog asks you to choose the subclasses of > your new class. > > This old website describes most of the refactorings: > http://st-www.cs.illinois.edu/users/brant/Refactory/Refactorings.html. > There is also a description in the tooltips of the menu actions. > > Lukas > > On 6 August 2010 11:47, Tim Mackinnon <[hidden email]> wrote: >> Hi Lukas - sorry to keep this thread going, but I don't quite >> understand >> what you mean? Partly I think the issue is that over the years I've >> become >> very familiar with the Eclipse/IntelliJ refactorings (and how they >> approach >> things) and I've slowly forgotten how they work in smalltalk >> (although - in >> Dolphin they seem to more closely match Eclipse/IntelliJ - adding >> to my >> confusion in Pharo). >> >> To give some context, I had a class X, then I copied it to create >> class Y - >> made some changes and got something useful working. However X and Y >> are >> mostly the same - so deserve a superclass. This sounds to me like >> standard >> Refactor Class | Create Superclass refactoring (available in the >> context >> menu). Is this what you are referring to? (And this is a seaside30.rc >> image). Is this the create class refactoring you are referring to? It >> doesn't sound like it? >> >> The one I am referring to just asks me for a name of a superclass >> and shows >> me the method changes it will make (and I can remove those which I >> don't >> deem common) - but they only apply to the single class I ran the >> refactoring >> for - say X. This then leaves me with Y which still needs work. I >> was >> expecting somewhere where it would ask me if there are any other >> classes to >> consider for the refactoring (or better still - let me multi-select >> several >> classes before I do the "create superclass" in the first place - >> which >> apparently is very hard in Pharo for some reason?). >> >> So is there some other browser, or menu option that I am missing? >> >> Tim >> >> On 6 Aug 2010, at 00:31, Lukas Renggli wrote: >> >>>>> Good point. I've been struggling with multiple selection too >>>>> e.g. when >>>>> setting the refactoring scope. There's an entry called >>>>> "selection..." >>>>> but >>>>> since I've never been able to select more than one item from a >>>>> list, >>>>> selecting "selection..." has the same effect as “category" (when >>>>> in a >>>>> category list of course). >>>> >>>> So is there some way of applying a refactoring to more than one >>>> class? >>>> What >>>> is that refactoring scope menu item - is there some way to >>>> specify 2 or >>>> more >>>> classes in there? Why is this so hard? >>> >>> The refactoring scope is something completely different. It selects >>> the part of the system that is considered by a refactoring. >>> >>> Did you ever try to go through the whole create-class refactoring? I >>> get a dialog that offers me to select multiple classes. >>> >>> Lukas >>> >>> -- >>> Lukas Renggli >>> www.lukas-renggli.ch >>> >>> _______________________________________________ >>> Pharo-project mailing list >>> [hidden email] >>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >> >> >> _______________________________________________ >> Pharo-project mailing list >> [hidden email] >> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >> > > > > -- > Lukas Renggli > www.lukas-renggli.ch > > _______________________________________________ > Pharo-project mailing list > [hidden email] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
I agree. From a desing perspective, it's totally contra intutitive that multiple selection isn't possible in the browser. And (at least when comming from other systems) it is even more confusing to have the refactoring browser show an item "selection..." when you weren't able to select more than one item.
I'm not implying that the browser doesn't supply a way to perform the refactorings, only as Tim's and my problems show, I see a problem in the design, an unnessecary one even. But since I don't know what the plans are for OmniBrowser... Maybe there's already a replacement or update coming along? Max On 06.08.2010, at 13:04, Tim Mackinnon wrote: > Hmmm - (again if you can please be patient with me)... I really am missing something big here? > > So in my example class X and Y are subclasses of WAComponent - which has tons of subclasses (it could be even worse, they could subclass Object?). So does this mean that I should create my superclass A first? > > E.g. I create a new subclass of WAComponent, called A. I then make X and Y subclass A. Now I can do the "Refactor Class | Create Subclass" refactoring, and so I have to call it A2 (ultimately I only want A - but if needs must). Then I do get the prompt that you are referring to and can select both X and Y. Finally it just offers to make me class A2 but unlike what I was trying below it doesn't offer to move up any methods or instance variables???? > > So this doesn't work? And furthermore it seem much more convoluted than it should be? > > I don't understand why Refactor Class | Create Superclass doesn't prompt me for other peer classes (this is what I want - in fact what I really, really want is to select 2 classes in the first place). > > Maybe I'm being really stupid, or does no-one use this refactoring in Pharo? It would seem that my scenario is a very common one - so I'm struggling with this. And frustratingly it seems that all the horsepower to do this, is built into the tools but they just don't use them in an intuitive way? > > Tim > > > On 6 Aug 2010, at 11:18, Lukas Renggli wrote: > >> Select the superclass of your classes X and Y and perform the 'create >> subclass' refactoring. A dialog asks you to choose the subclasses of >> your new class. >> >> This old website describes most of the refactorings: >> http://st-www.cs.illinois.edu/users/brant/Refactory/Refactorings.html. >> There is also a description in the tooltips of the menu actions. >> >> Lukas >> >> On 6 August 2010 11:47, Tim Mackinnon <[hidden email]> wrote: >>> Hi Lukas - sorry to keep this thread going, but I don't quite understand >>> what you mean? Partly I think the issue is that over the years I've become >>> very familiar with the Eclipse/IntelliJ refactorings (and how they approach >>> things) and I've slowly forgotten how they work in smalltalk (although - in >>> Dolphin they seem to more closely match Eclipse/IntelliJ - adding to my >>> confusion in Pharo). >>> >>> To give some context, I had a class X, then I copied it to create class Y - >>> made some changes and got something useful working. However X and Y are >>> mostly the same - so deserve a superclass. This sounds to me like standard >>> Refactor Class | Create Superclass refactoring (available in the context >>> menu). Is this what you are referring to? (And this is a seaside30.rc >>> image). Is this the create class refactoring you are referring to? It >>> doesn't sound like it? >>> >>> The one I am referring to just asks me for a name of a superclass and shows >>> me the method changes it will make (and I can remove those which I don't >>> deem common) - but they only apply to the single class I ran the refactoring >>> for - say X. This then leaves me with Y which still needs work. I was >>> expecting somewhere where it would ask me if there are any other classes to >>> consider for the refactoring (or better still - let me multi-select several >>> classes before I do the "create superclass" in the first place - which >>> apparently is very hard in Pharo for some reason?). >>> >>> So is there some other browser, or menu option that I am missing? >>> >>> Tim >>> >>> On 6 Aug 2010, at 00:31, Lukas Renggli wrote: >>> >>>>>> Good point. I've been struggling with multiple selection too e.g. when >>>>>> setting the refactoring scope. There's an entry called "selection..." >>>>>> but >>>>>> since I've never been able to select more than one item from a list, >>>>>> selecting "selection..." has the same effect as “category" (when in a >>>>>> category list of course). >>>>> >>>>> So is there some way of applying a refactoring to more than one class? >>>>> What >>>>> is that refactoring scope menu item - is there some way to specify 2 or >>>>> more >>>>> classes in there? Why is this so hard? >>>> >>>> The refactoring scope is something completely different. It selects >>>> the part of the system that is considered by a refactoring. >>>> >>>> Did you ever try to go through the whole create-class refactoring? I >>>> get a dialog that offers me to select multiple classes. >>>> >>>> Lukas >>>> >>>> -- >>>> Lukas Renggli >>>> www.lukas-renggli.ch >>>> >>>> _______________________________________________ >>>> Pharo-project mailing list >>>> [hidden email] >>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >>> >>> >>> _______________________________________________ >>> Pharo-project mailing list >>> [hidden email] >>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >>> >> >> >> >> -- >> Lukas Renggli >> www.lukas-renggli.ch >> >> _______________________________________________ >> Pharo-project mailing list >> [hidden email] >> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project > > > _______________________________________________ > Pharo-project mailing list > [hidden email] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
In reply to this post by Tim Mackinnon
On 6 August 2010 13:04, Tim Mackinnon <[hidden email]> wrote:
> Hmmm - (again if you can please be patient with me)... I really am missing > something big here? > > So in my example class X and Y are subclasses of WAComponent - which has > tons of subclasses (it could be even worse, they could subclass Object?). So > does this mean that I should create my superclass A first? > > E.g. I create a new subclass of WAComponent, called A. I then make X and Y > subclass A. Now I can do the "Refactor Class | Create Subclass" refactoring, > and so I have to call it A2 (ultimately I only want A - but if needs must). > Then I do get the prompt that you are referring to and can select both X and > Y. Finally it just offers to make me class A2 but unlike what I was trying > below it doesn't offer to move up any methods or instance variables???? > > So this doesn't work? And furthermore it seem much more convoluted than it > should be? I don't know. Keep in mind that nobody really cares about OmniBrowser, the Refactoring Engine, and all the other development tools. A few years ago they were just rotting along, most tests were broken and the refactoring code base was on outdated code from the last century. I am maintaining these tools because they make me more productive, not because it is fun. I would love to use something as sophisticated as Eclipse, but I don't have interest to do that myself. So I just continue to fix and enhance what works for me. If somebody else provides something better, I am happy to give it a try. Lukas > I don't understand why Refactor Class | Create Superclass doesn't prompt me > for other peer classes (this is what I want - in fact what I really, really > want is to select 2 classes in the first place). > > Maybe I'm being really stupid, or does no-one use this refactoring in Pharo? > It would seem that my scenario is a very common one - so I'm struggling with > this. And frustratingly it seems that all the horsepower to do this, is > built into the tools but they just don't use them in an intuitive way? > > Tim > > > On 6 Aug 2010, at 11:18, Lukas Renggli wrote: > >> Select the superclass of your classes X and Y and perform the 'create >> subclass' refactoring. A dialog asks you to choose the subclasses of >> your new class. >> >> This old website describes most of the refactorings: >> http://st-www.cs.illinois.edu/users/brant/Refactory/Refactorings.html. >> There is also a description in the tooltips of the menu actions. >> >> Lukas >> >> On 6 August 2010 11:47, Tim Mackinnon <[hidden email]> wrote: >>> >>> Hi Lukas - sorry to keep this thread going, but I don't quite understand >>> what you mean? Partly I think the issue is that over the years I've >>> become >>> very familiar with the Eclipse/IntelliJ refactorings (and how they >>> approach >>> things) and I've slowly forgotten how they work in smalltalk (although - >>> in >>> Dolphin they seem to more closely match Eclipse/IntelliJ - adding to my >>> confusion in Pharo). >>> >>> To give some context, I had a class X, then I copied it to create class Y >>> - >>> made some changes and got something useful working. However X and Y are >>> mostly the same - so deserve a superclass. This sounds to me like >>> standard >>> Refactor Class | Create Superclass refactoring (available in the context >>> menu). Is this what you are referring to? (And this is a seaside30.rc >>> image). Is this the create class refactoring you are referring to? It >>> doesn't sound like it? >>> >>> The one I am referring to just asks me for a name of a superclass and >>> shows >>> me the method changes it will make (and I can remove those which I don't >>> deem common) - but they only apply to the single class I ran the >>> refactoring >>> for - say X. This then leaves me with Y which still needs work. I was >>> expecting somewhere where it would ask me if there are any other classes >>> to >>> consider for the refactoring (or better still - let me multi-select >>> several >>> classes before I do the "create superclass" in the first place - which >>> apparently is very hard in Pharo for some reason?). >>> >>> So is there some other browser, or menu option that I am missing? >>> >>> Tim >>> >>> On 6 Aug 2010, at 00:31, Lukas Renggli wrote: >>> >>>>>> Good point. I've been struggling with multiple selection too e.g. when >>>>>> setting the refactoring scope. There's an entry called "selection..." >>>>>> but >>>>>> since I've never been able to select more than one item from a list, >>>>>> selecting "selection..." has the same effect as “category" (when in a >>>>>> category list of course). >>>>> >>>>> So is there some way of applying a refactoring to more than one class? >>>>> What >>>>> is that refactoring scope menu item - is there some way to specify 2 or >>>>> more >>>>> classes in there? Why is this so hard? >>>> >>>> The refactoring scope is something completely different. It selects >>>> the part of the system that is considered by a refactoring. >>>> >>>> Did you ever try to go through the whole create-class refactoring? I >>>> get a dialog that offers me to select multiple classes. >>>> >>>> Lukas >>>> >>>> -- >>>> Lukas Renggli >>>> www.lukas-renggli.ch >>>> >>>> _______________________________________________ >>>> Pharo-project mailing list >>>> [hidden email] >>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >>> >>> >>> _______________________________________________ >>> Pharo-project mailing list >>> [hidden email] >>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >>> >> >> >> >> -- >> Lukas Renggli >> www.lukas-renggli.ch >> >> _______________________________________________ >> Pharo-project mailing list >> [hidden email] >> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project > > > _______________________________________________ > Pharo-project mailing list > [hidden email] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project > -- Lukas Renggli www.lukas-renggli.ch _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
Well I'm certainly glad that you cared to get the tests back up to
scratch - and it makes our whole community more productive. A big thanks for this! I'm just a bit embarrassed that in our community - we keep talking about how we have these great refactoring tools (that were invented in smalltalk) - but it looks like in Pharo (and I guess Squeak) - they've fallen a bit behind in terms of usability. My scenario is a very frequent one - and it should be possible to do effortlessly (and I think that the pieces are in place to do it). Maybe at ESUG we can rally some energy to help support some of these things (hold an appeal fund... not money - but contributions). I want to help - I just am not sure how to yet - and sometimes this is partly my surprise to discover that some of the things I thought already worked - don't. Maybe in the show us your projects demo's it might be worth replaying this scenario and showing how it works in Pharo, and how it works in Eclipse (and maybe another Smalltalk) - and then showing some of the features available in the refactoring engine and trying to get support for improving it. This along with useful keyboard shortcuts are the things that eat away at the awesome productiveness I've noticed in other areas. Tim On 6 Aug 2010, at 13:03, Lukas Renggli wrote: > On 6 August 2010 13:04, Tim Mackinnon <[hidden email]> wrote: >> Hmmm - (again if you can please be patient with me)... I really am >> missing >> something big here? >> >> So in my example class X and Y are subclasses of WAComponent - >> which has >> tons of subclasses (it could be even worse, they could subclass >> Object?). So >> does this mean that I should create my superclass A first? >> >> E.g. I create a new subclass of WAComponent, called A. I then make >> X and Y >> subclass A. Now I can do the "Refactor Class | Create Subclass" >> refactoring, >> and so I have to call it A2 (ultimately I only want A - but if >> needs must). >> Then I do get the prompt that you are referring to and can select >> both X and >> Y. Finally it just offers to make me class A2 but unlike what I was >> trying >> below it doesn't offer to move up any methods or instance >> variables???? >> >> So this doesn't work? And furthermore it seem much more convoluted >> than it >> should be? > > I don't know. > > Keep in mind that nobody really cares about OmniBrowser, the > Refactoring Engine, and all the other development tools. A few years > ago they were just rotting along, most tests were broken and the > refactoring code base was on outdated code from the last century. I am > maintaining these tools because they make me more productive, not > because it is fun. > > I would love to use something as sophisticated as Eclipse, but I don't > have interest to do that myself. So I just continue to fix and enhance > what works for me. If somebody else provides something better, I am > happy to give it a try. > > Lukas > >> I don't understand why Refactor Class | Create Superclass doesn't >> prompt me >> for other peer classes (this is what I want - in fact what I >> really, really >> want is to select 2 classes in the first place). >> >> Maybe I'm being really stupid, or does no-one use this refactoring >> in Pharo? >> It would seem that my scenario is a very common one - so I'm >> struggling with >> this. And frustratingly it seems that all the horsepower to do >> this, is >> built into the tools but they just don't use them in an intuitive >> way? >> >> Tim >> >> >> On 6 Aug 2010, at 11:18, Lukas Renggli wrote: >> >>> Select the superclass of your classes X and Y and perform the >>> 'create >>> subclass' refactoring. A dialog asks you to choose the subclasses of >>> your new class. >>> >>> This old website describes most of the refactorings: >>> http://st-www.cs.illinois.edu/users/brant/Refactory/Refactorings.html >>> . >>> There is also a description in the tooltips of the menu actions. >>> >>> Lukas >>> >>> On 6 August 2010 11:47, Tim Mackinnon <[hidden email]> wrote: >>>> >>>> Hi Lukas - sorry to keep this thread going, but I don't quite >>>> understand >>>> what you mean? Partly I think the issue is that over the years I've >>>> become >>>> very familiar with the Eclipse/IntelliJ refactorings (and how they >>>> approach >>>> things) and I've slowly forgotten how they work in smalltalk >>>> (although - >>>> in >>>> Dolphin they seem to more closely match Eclipse/IntelliJ - adding >>>> to my >>>> confusion in Pharo). >>>> >>>> To give some context, I had a class X, then I copied it to create >>>> class Y >>>> - >>>> made some changes and got something useful working. However X and >>>> Y are >>>> mostly the same - so deserve a superclass. This sounds to me like >>>> standard >>>> Refactor Class | Create Superclass refactoring (available in the >>>> context >>>> menu). Is this what you are referring to? (And this is a >>>> seaside30.rc >>>> image). Is this the create class refactoring you are referring >>>> to? It >>>> doesn't sound like it? >>>> >>>> The one I am referring to just asks me for a name of a superclass >>>> and >>>> shows >>>> me the method changes it will make (and I can remove those which >>>> I don't >>>> deem common) - but they only apply to the single class I ran the >>>> refactoring >>>> for - say X. This then leaves me with Y which still needs work. >>>> I was >>>> expecting somewhere where it would ask me if there are any other >>>> classes >>>> to >>>> consider for the refactoring (or better still - let me multi-select >>>> several >>>> classes before I do the "create superclass" in the first place - >>>> which >>>> apparently is very hard in Pharo for some reason?). >>>> >>>> So is there some other browser, or menu option that I am missing? >>>> >>>> Tim >>>> >>>> On 6 Aug 2010, at 00:31, Lukas Renggli wrote: >>>> >>>>>>> Good point. I've been struggling with multiple selection too >>>>>>> e.g. when >>>>>>> setting the refactoring scope. There's an entry called >>>>>>> "selection..." >>>>>>> but >>>>>>> since I've never been able to select more than one item from a >>>>>>> list, >>>>>>> selecting "selection..." has the same effect as >>>>>>> “category" (when in a >>>>>>> category list of course). >>>>>> >>>>>> So is there some way of applying a refactoring to more than one >>>>>> class? >>>>>> What >>>>>> is that refactoring scope menu item - is there some way to >>>>>> specify 2 or >>>>>> more >>>>>> classes in there? Why is this so hard? >>>>> >>>>> The refactoring scope is something completely different. It >>>>> selects >>>>> the part of the system that is considered by a refactoring. >>>>> >>>>> Did you ever try to go through the whole create-class >>>>> refactoring? I >>>>> get a dialog that offers me to select multiple classes. >>>>> >>>>> Lukas >>>>> >>>>> -- >>>>> Lukas Renggli >>>>> www.lukas-renggli.ch >>>>> >>>>> _______________________________________________ >>>>> Pharo-project mailing list >>>>> [hidden email] >>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo- >>>>> project >>>> >>>> >>>> _______________________________________________ >>>> Pharo-project mailing list >>>> [hidden email] >>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >>>> >>> >>> >>> >>> -- >>> Lukas Renggli >>> www.lukas-renggli.ch >>> >>> _______________________________________________ >>> Pharo-project mailing list >>> [hidden email] >>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >> >> >> _______________________________________________ >> Pharo-project mailing list >> [hidden email] >> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >> > > > > -- > Lukas Renggli > www.lukas-renggli.ch > > _______________________________________________ > Pharo-project mailing list > [hidden email] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
> I'm just a bit embarrassed that in our community - we keep talking about how
> we have these great refactoring tools (that were invented in smalltalk) - > but it looks like in Pharo (and I guess Squeak) - they've fallen a bit > behind in terms of usability. I think people are aware that even in commercial Smalltalks the tools are decades behind the state of the art in Eclipse. > My scenario is a very frequent one - and it should be possible to do > effortlessly (and I think that the pieces are in place to do it). > > Maybe at ESUG we can rally some energy to help support some of these things > (hold an appeal fund... not money - but contributions). I want to help - I > just am not sure how to yet - and sometimes this is partly my surprise to > discover that some of the things I thought already worked - don't. Have a look the method #refactoring in ORCmdCreateSubclassRefactoring and ORCmdCreateSuperclassRefactoring. Maybe you can improve something in terms of UI -> Refactoring Engine interaction? > Maybe in the show us your projects demo's it might be worth replaying this > scenario and showing how it works in Pharo, and how it works in Eclipse (and > maybe another Smalltalk) - and then showing some of the features available > in the refactoring engine and trying to get support for improving it. There are already numerous refactorings that I "ported" from Eclipse: - create multiple accessors at once - generate equal/hash - generate printString - pretty print - make class concrete - swap method As well as some new Smalltalk specific ones: - create cascade - split cascade Lukas -- Lukas Renggli www.lukas-renggli.ch _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
Seriously - I think you've shown that with a good engine (which I'm hoping it is - it seemed that way when I first came across a few bits in Dolphin) - and a bit of knowledge (although you have tons - but I'm hoping we can follow in your footsteps), a few people could make a big impact on what is possible (I certainly don't find it easy to even contemplate writing these things in Eclipse, as the model is very complicated).
Thanks as always for your contributions on this - its inspiring Tim _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
In reply to this post by Tim Mackinnon
If I understand what you want correctly, can you try to select the superclass, then refactor class>>create subclass. You give the name and then you select all subclasses that you want to set as subclasses of the new class.
Is it right ? Laurent On Fri, Aug 6, 2010 at 11:47 AM, Tim Mackinnon <[hidden email]> wrote: Hi Lukas - sorry to keep this thread going, but I don't quite understand what you mean? Partly I think the issue is that over the years I've become very familiar with the Eclipse/IntelliJ refactorings (and how they approach things) and I've slowly forgotten how they work in smalltalk (although - in Dolphin they seem to more closely match Eclipse/IntelliJ - adding to my confusion in Pharo). _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
On 6 Aug 2010, at 15:59, laurent laffont wrote: > If I understand what you want correctly, can you try to select the > superclass, then refactor class>>create subclass. You give the name > and then you select all subclasses that you want to set as > subclasses of the new class. > > Is it right ? Not quite - that assumes that there is a reasonable common superclass (other than Object or WAComponent) - although you can get to that position with a bit of copy/paste of superclass names. THEN - if you do create subclass, that just creates a superclass for your selected classes but DOESN'T offer to promote any common methods or instance variables, that is then left to the reader to sort out. The operation, Refactor Create Superclass is closer to the operation that I want (and I think Lucas may have fixed it so that when it offers to promote methods and ivars you can remove unwanted promotions) HOWEVER - it only does this for a single class, leaving you to manually fix up your other classes by yourself. So its a combination of the two. This is a common thing (and really easy in the Java world - it takes seconds - and I suspect we have the engine to do this in Smalltalk) that I'm surprised its not there (but totally understand that the community has been stretched on other things - and I'm hoping to rally support. There are some basic things that most developers I have met expect - and this is one of them (along with extract method - which we have - but no keystroke for it, assign temporary - again which we have but no keystroke for it, and inline temporary - which we kind of have but its a bit awkward to use and again there is no keystroke for it). I also find that the code reformatter applied after a refactoring is a bit rough as well (and this is possibly why people hold off refactoring as well). I don't want to knock too much - the building blocks appear to be there, its just about building awareness and enthusiastic volunteers to move things forward (without impacting the other important work going on). Tim _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
In reply to this post by Tim Mackinnon
Le 6 août 2010 à 20:14, Tim Mackinnon <[hidden email]> a écrit : > Well I'm certainly glad that you cared to get the tests back up to scratch - and it makes our whole community more productive. A big thanks for this! > > I'm just a bit embarrassed that in our community - we keep talking about how we have these great refactoring tools (that were invented in smalltalk) - but it looks like in Pharo (and I guess Squeak) - they've fallen a bit behind in terms of usability. > Yes you are probably are right, but you know things does not appear magicly ;-) Feel free to propose bugs fix and enhancements in order to enhance the current state of tools. -- Serge Stinckwich _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
In reply to this post by Tim Mackinnon
On Aug 5, 2010, at 2:52 PM, Tim Mackinnon wrote: > Its a real pain that you can't multiple select things in the pharo UI... Agreed. Nor getting nice trees. > As I try and do things in Pharo and compare the operations to what I can easily do in Eclipse or Intelli-J - I've hit a new one - how do I extract a common superclass from 2 classes that are similar? > > I can refactor create superclass - but that just does it for one class, and then I can't easily make my second class a subclass as Pharo complains about duplicate instance variables. > > It seems like the capability is locked in there - but I keep struggling to work it out (refactoring in Pharo seems more complicated than it should be somehow - and I'm really looking forward to sitting down with someone someday and working out some keystrokes to use - extract method, extract temporary, inline temporary should just be keystrokes). > > Tim Thanks tim we need more clients :) (and producers too). _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
In reply to this post by Tim Mackinnon
On Aug 6, 2010, at 3:14 PM, Tim Mackinnon wrote: > Well I'm certainly glad that you cared to get the tests back up to scratch - and it makes our whole community more productive. A big thanks for this! > > I'm just a bit embarrassed that in our community - we keep talking about how we have these great refactoring tools (that were invented in smalltalk) - but it looks like in Pharo (and I guess Squeak) - they've fallen a bit behind in terms of usability. yes this is clear. This is why we should wake up and this is why I thank lukas to have invested and fixed RB and its engine. > My scenario is a very frequent one - and it should be possible to do effortlessly (and I think that the pieces are in place to do it). > > Maybe at ESUG we can rally some energy to help support some of these things (hold an appeal fund... not money - but contributions). I want to help - I just am not sure how to yet - and sometimes this is partly my surprise to discover that some of the things I thought already worked - don't. > > Maybe in the show us your projects demo's it might be worth replaying this scenario and showing how it works in Pharo, and how it works in Eclipse (and maybe another Smalltalk) - and then showing some of the features available in the refactoring engine and trying to get support for improving it. This along with useful keyboard shortcuts are the things that eat away at the awesome productiveness I've noticed in other areas. start small and help this is the best things and once a small thing is done pass to the next one. We will all make progress. Stef > > Tim > > > On 6 Aug 2010, at 13:03, Lukas Renggli wrote: > >> On 6 August 2010 13:04, Tim Mackinnon <[hidden email]> wrote: >>> Hmmm - (again if you can please be patient with me)... I really am missing >>> something big here? >>> >>> So in my example class X and Y are subclasses of WAComponent - which has >>> tons of subclasses (it could be even worse, they could subclass Object?). So >>> does this mean that I should create my superclass A first? >>> >>> E.g. I create a new subclass of WAComponent, called A. I then make X and Y >>> subclass A. Now I can do the "Refactor Class | Create Subclass" refactoring, >>> and so I have to call it A2 (ultimately I only want A - but if needs must). >>> Then I do get the prompt that you are referring to and can select both X and >>> Y. Finally it just offers to make me class A2 but unlike what I was trying >>> below it doesn't offer to move up any methods or instance variables???? >>> >>> So this doesn't work? And furthermore it seem much more convoluted than it >>> should be? >> >> I don't know. >> >> Keep in mind that nobody really cares about OmniBrowser, the >> Refactoring Engine, and all the other development tools. A few years >> ago they were just rotting along, most tests were broken and the >> refactoring code base was on outdated code from the last century. I am >> maintaining these tools because they make me more productive, not >> because it is fun. >> >> I would love to use something as sophisticated as Eclipse, but I don't >> have interest to do that myself. So I just continue to fix and enhance >> what works for me. If somebody else provides something better, I am >> happy to give it a try. >> >> Lukas >> >>> I don't understand why Refactor Class | Create Superclass doesn't prompt me >>> for other peer classes (this is what I want - in fact what I really, really >>> want is to select 2 classes in the first place). >>> >>> Maybe I'm being really stupid, or does no-one use this refactoring in Pharo? >>> It would seem that my scenario is a very common one - so I'm struggling with >>> this. And frustratingly it seems that all the horsepower to do this, is >>> built into the tools but they just don't use them in an intuitive way? >>> >>> Tim >>> >>> >>> On 6 Aug 2010, at 11:18, Lukas Renggli wrote: >>> >>>> Select the superclass of your classes X and Y and perform the 'create >>>> subclass' refactoring. A dialog asks you to choose the subclasses of >>>> your new class. >>>> >>>> This old website describes most of the refactorings: >>>> http://st-www.cs.illinois.edu/users/brant/Refactory/Refactorings.html. >>>> There is also a description in the tooltips of the menu actions. >>>> >>>> Lukas >>>> >>>> On 6 August 2010 11:47, Tim Mackinnon <[hidden email]> wrote: >>>>> >>>>> Hi Lukas - sorry to keep this thread going, but I don't quite understand >>>>> what you mean? Partly I think the issue is that over the years I've >>>>> become >>>>> very familiar with the Eclipse/IntelliJ refactorings (and how they >>>>> approach >>>>> things) and I've slowly forgotten how they work in smalltalk (although - >>>>> in >>>>> Dolphin they seem to more closely match Eclipse/IntelliJ - adding to my >>>>> confusion in Pharo). >>>>> >>>>> To give some context, I had a class X, then I copied it to create class Y >>>>> - >>>>> made some changes and got something useful working. However X and Y are >>>>> mostly the same - so deserve a superclass. This sounds to me like >>>>> standard >>>>> Refactor Class | Create Superclass refactoring (available in the context >>>>> menu). Is this what you are referring to? (And this is a seaside30.rc >>>>> image). Is this the create class refactoring you are referring to? It >>>>> doesn't sound like it? >>>>> >>>>> The one I am referring to just asks me for a name of a superclass and >>>>> shows >>>>> me the method changes it will make (and I can remove those which I don't >>>>> deem common) - but they only apply to the single class I ran the >>>>> refactoring >>>>> for - say X. This then leaves me with Y which still needs work. I was >>>>> expecting somewhere where it would ask me if there are any other classes >>>>> to >>>>> consider for the refactoring (or better still - let me multi-select >>>>> several >>>>> classes before I do the "create superclass" in the first place - which >>>>> apparently is very hard in Pharo for some reason?). >>>>> >>>>> So is there some other browser, or menu option that I am missing? >>>>> >>>>> Tim >>>>> >>>>> On 6 Aug 2010, at 00:31, Lukas Renggli wrote: >>>>> >>>>>>>> Good point. I've been struggling with multiple selection too e.g. when >>>>>>>> setting the refactoring scope. There's an entry called "selection..." >>>>>>>> but >>>>>>>> since I've never been able to select more than one item from a list, >>>>>>>> selecting "selection..." has the same effect as “category" (when in a >>>>>>>> category list of course). >>>>>>> >>>>>>> So is there some way of applying a refactoring to more than one class? >>>>>>> What >>>>>>> is that refactoring scope menu item - is there some way to specify 2 or >>>>>>> more >>>>>>> classes in there? Why is this so hard? >>>>>> >>>>>> The refactoring scope is something completely different. It selects >>>>>> the part of the system that is considered by a refactoring. >>>>>> >>>>>> Did you ever try to go through the whole create-class refactoring? I >>>>>> get a dialog that offers me to select multiple classes. >>>>>> >>>>>> Lukas >>>>>> >>>>>> -- >>>>>> Lukas Renggli >>>>>> www.lukas-renggli.ch >>>>>> >>>>>> _______________________________________________ >>>>>> Pharo-project mailing list >>>>>> [hidden email] >>>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >>>>> >>>>> >>>>> _______________________________________________ >>>>> Pharo-project mailing list >>>>> [hidden email] >>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >>>>> >>>> >>>> >>>> >>>> -- >>>> Lukas Renggli >>>> www.lukas-renggli.ch >>>> >>>> _______________________________________________ >>>> Pharo-project mailing list >>>> [hidden email] >>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >>> >>> >>> _______________________________________________ >>> Pharo-project mailing list >>> [hidden email] >>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >>> >> >> >> >> -- >> Lukas Renggli >> www.lukas-renggli.ch >> >> _______________________________________________ >> Pharo-project mailing list >> [hidden email] >> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project > > > _______________________________________________ > Pharo-project mailing list > [hidden email] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
In reply to this post by Tim Mackinnon
> Seriously - I think you've shown that with a good engine (which I'm hoping it is - it seemed that way when I first came across a few bits in Dolphin) - and a bit of knowledge (although you have tons - but I'm hoping we can follow in your footsteps), a few people could make a big impact on what is possible (I certainly don't find it easy to even contemplate writing these things in Eclipse, as the model is very complicated).
Yes!!! Some eclipse refactoring were are may be still are because java is really complex compare to smalltalk and we should take advantage of that. >> Have a look the method #refactoring in ORCmdCreateSubclassRefactoring >> and ORCmdCreateSuperclassRefactoring. Maybe you can improve something >> in terms of UI -> Refactoring Engine interaction? > > I will certainly have a look - and maybe with a bit of guidance at ESUG I might be able to make a difference too. > >> There are already numerous refactorings that I "ported" from Eclipse: > > I just took these for granted... I've been "spoiled" while being away, and had forgotten what the original base set was. I LOVE the generate multiple accessors (and the ability to edit that list and remove ones you don't want). I sometimes which it was a bit more tickable - but the alt-x (or right click) on an item works reasonably well. > >> As well as some new Smalltalk specific ones: > > Nice. > > Thanks as always for your contributions on this - its inspiring > > Tim > _______________________________________________ > Pharo-project mailing list > [hidden email] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
Free forum by Nabble | Edit this page |