Multiselect in method pane

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

Multiselect in method pane

NorbertHartl
What is the rationale for having the method pane as multi-select list? I don't think it is of greater use when editing code. I could imagine that some refactoring tasks could be easier having multi-select lists.

Anyway, if I try to rename a method without using the refactoring engine I just change the selector, save and delete the method with the old selector. In pharo 2.0 when you rename a method and then click on the old selector both methods are selected and shortcut invocation for deleting deletes both. Which is quite annoying. In my opinion there is no reason for two methods being selected. If you agree I'll happily enter a bug.

Norbert
Reply | Threaded
Open this post in threaded view
|

Re: Multiselect in method pane

stephane ducasse

On Mar 28, 2013, at 11:21 AM, Norbert Hartl <[hidden email]> wrote:

> What is the rationale for having the method pane as multi-select list? I don't think it is of greater use when editing code. I could imagine that some refactoring tasks could be easier having multi-select lists.
>
> Anyway, if I try to rename a method without using the refactoring engine I just change the selector, save and delete the method with the old selector. In pharo 2.0 when you rename a method and then click on the old selector both methods are selected and shortcut invocation for deleting deletes both. Which is quite annoying. In my opinion there is no reason for two methods being selected. If you agree I'll happily enter a bug.


The problem is not a nautilus bug but a compiled method one if I remember correctly.
because two methods with the same body are equal.

> Norbert


Reply | Threaded
Open this post in threaded view
|

Re: Multiselect in method pane

NorbertHartl

Am 28.03.2013 um 11:51 schrieb stephane ducasse <[hidden email]>:

>
> On Mar 28, 2013, at 11:21 AM, Norbert Hartl <[hidden email]> wrote:
>
>> What is the rationale for having the method pane as multi-select list? I don't think it is of greater use when editing code. I could imagine that some refactoring tasks could be easier having multi-select lists.
>>
>> Anyway, if I try to rename a method without using the refactoring engine I just change the selector, save and delete the method with the old selector. In pharo 2.0 when you rename a method and then click on the old selector both methods are selected and shortcut invocation for deleting deletes both. Which is quite annoying. In my opinion there is no reason for two methods being selected. If you agree I'll happily enter a bug.
>
>
> The problem is not a nautilus bug but a compiled method one if I remember correctly.
> because two methods with the same body are equal.


Ok, so my case is an edge case which usually doesn't happen. But what is the rationale for selecting based on equality instead of identity?

Norbert



Reply | Threaded
Open this post in threaded view
|

Re: Multiselect in method pane

Benjamin Van Ryseghem (Pharo)
In reply to this post by stephane ducasse
Two compiled methods with same byte code, even with different selectors are equals
(and people laughed at me when I found that disturbing)

Ben

On Mar 28, 2013, at 11:51 AM, stephane ducasse <[hidden email]> wrote:


On Mar 28, 2013, at 11:21 AM, Norbert Hartl <[hidden email]> wrote:

What is the rationale for having the method pane as multi-select list? I don't think it is of greater use when editing code. I could imagine that some refactoring tasks could be easier having multi-select lists.

Anyway, if I try to rename a method without using the refactoring engine I just change the selector, save and delete the method with the old selector. In pharo 2.0 when you rename a method and then click on the old selector both methods are selected and shortcut invocation for deleting deletes both. Which is quite annoying. In my opinion there is no reason for two methods being selected. If you agree I'll happily enter a bug.


The problem is not a nautilus bug but a compiled method one if I remember correctly.
because two methods with the same body are equal.

Norbert



Reply | Threaded
Open this post in threaded view
|

Re: Multiselect in method pane

Benjamin Van Ryseghem (Pharo)
In reply to this post by NorbertHartl
Honestly, I do not remember 

Ben

On Mar 28, 2013, at 11:58 AM, Norbert Hartl <[hidden email]> wrote:


Am 28.03.2013 um 11:51 schrieb stephane ducasse <[hidden email]>:


On Mar 28, 2013, at 11:21 AM, Norbert Hartl <[hidden email]> wrote:

What is the rationale for having the method pane as multi-select list? I don't think it is of greater use when editing code. I could imagine that some refactoring tasks could be easier having multi-select lists.

Anyway, if I try to rename a method without using the refactoring engine I just change the selector, save and delete the method with the old selector. In pharo 2.0 when you rename a method and then click on the old selector both methods are selected and shortcut invocation for deleting deletes both. Which is quite annoying. In my opinion there is no reason for two methods being selected. If you agree I'll happily enter a bug.


The problem is not a nautilus bug but a compiled method one if I remember correctly.
because two methods with the same body are equal.


Ok, so my case is an edge case which usually doesn't happen. But what is the rationale for selecting based on equality instead of identity?

Norbert




Reply | Threaded
Open this post in threaded view
|

Re: Multiselect in method pane

NorbertHartl
In reply to this post by stephane ducasse

Am 28.03.2013 um 11:51 schrieb stephane ducasse <[hidden email]>:

>
> On Mar 28, 2013, at 11:21 AM, Norbert Hartl <[hidden email]> wrote:
>
>> What is the rationale for having the method pane as multi-select list? I don't think it is of greater use when editing code. I could imagine that some refactoring tasks could be easier having multi-select lists.
>>
>> Anyway, if I try to rename a method without using the refactoring engine I just change the selector, save and delete the method with the old selector. In pharo 2.0 when you rename a method and then click on the old selector both methods are selected and shortcut invocation for deleting deletes both. Which is quite annoying. In my opinion there is no reason for two methods being selected. If you agree I'll happily enter a bug.
>
>
> The problem is not a nautilus bug but a compiled method one if I remember correctly.
> because two methods with the same body are equal.
>
It happens in MethodWidget>>#methodSelectionAt:put. When PluggableIconListMorph updates the list selection it calls the MethodWidget to set true on the new method selected. But MethodWidget uses a Dictionary for instVar methodSelection and finds the old method being equal and enables this.
As I don't see a reason why a selection should be done by equality this behavior can be fixed by using an IdentityDictionary.

Fix:

MethodWidget>>#initialize

        super initialize.
        methodsSelection := IdentityDictionary new.

Any arguments?

Norbert
Reply | Threaded
Open this post in threaded view
|

Re: Multiselect in method pane

Benjamin Van Ryseghem (Pharo)
if it works go ahead ;)

Ben

On Mar 28, 2013, at 12:48 PM, Norbert Hartl <[hidden email]> wrote:


Am 28.03.2013 um 11:51 schrieb stephane ducasse <[hidden email]>:


On Mar 28, 2013, at 11:21 AM, Norbert Hartl <[hidden email]> wrote:

What is the rationale for having the method pane as multi-select list? I don't think it is of greater use when editing code. I could imagine that some refactoring tasks could be easier having multi-select lists.

Anyway, if I try to rename a method without using the refactoring engine I just change the selector, save and delete the method with the old selector. In pharo 2.0 when you rename a method and then click on the old selector both methods are selected and shortcut invocation for deleting deletes both. Which is quite annoying. In my opinion there is no reason for two methods being selected. If you agree I'll happily enter a bug.


The problem is not a nautilus bug but a compiled method one if I remember correctly.
because two methods with the same body are equal.

It happens in MethodWidget>>#methodSelectionAt:put. When PluggableIconListMorph updates the list selection it calls the MethodWidget to set true on the new method selected. But MethodWidget uses a Dictionary for instVar methodSelection and finds the old method being equal and enables this.
As I don't see a reason why a selection should be done by equality this behavior can be fixed by using an IdentityDictionary.

Fix:

MethodWidget>>#initialize

super initialize.
methodsSelection := IdentityDictionary new.

Any arguments?

Norbert

Reply | Threaded
Open this post in threaded view
|

Re: Multiselect in method pane

Camillo Bruni-3
please! :) that would save some major pain here and there ;)

On 2013-03-28, at 12:57, Benjamin <[hidden email]> wrote:

> if it works go ahead ;)
>
> Ben
>
> On Mar 28, 2013, at 12:48 PM, Norbert Hartl <[hidden email]> wrote:
>
>>
>> Am 28.03.2013 um 11:51 schrieb stephane ducasse <[hidden email]>:
>>
>>>
>>> On Mar 28, 2013, at 11:21 AM, Norbert Hartl <[hidden email]> wrote:
>>>
>>>> What is the rationale for having the method pane as multi-select list? I don't think it is of greater use when editing code. I could imagine that some refactoring tasks could be easier having multi-select lists.
>>>>
>>>> Anyway, if I try to rename a method without using the refactoring engine I just change the selector, save and delete the method with the old selector. In pharo 2.0 when you rename a method and then click on the old selector both methods are selected and shortcut invocation for deleting deletes both. Which is quite annoying. In my opinion there is no reason for two methods being selected. If you agree I'll happily enter a bug.
>>>
>>>
>>> The problem is not a nautilus bug but a compiled method one if I remember correctly.
>>> because two methods with the same body are equal.
>>>
>> It happens in MethodWidget>>#methodSelectionAt:put. When PluggableIconListMorph updates the list selection it calls the MethodWidget to set true on the new method selected. But MethodWidget uses a Dictionary for instVar methodSelection and finds the old method being equal and enables this.
>> As I don't see a reason why a selection should be done by equality this behavior can be fixed by using an IdentityDictionary.
>>
>> Fix:
>>
>> MethodWidget>>#initialize
>>
>> super initialize.
>> methodsSelection := IdentityDictionary new.
>>
>> Any arguments?
>>
>> Norbert
>


Reply | Threaded
Open this post in threaded view
|

Re: Multiselect in method pane

NorbertHartl
https://pharo.fogbugz.com/f/cases/10162/multiple-selection-of-methods-in-method-pane-if-CompiledMethods-are-equal

Norbert

Am 28.03.2013 um 13:02 schrieb Camillo Bruni <[hidden email]>:

please! :) that would save some major pain here and there ;)

On 2013-03-28, at 12:57, Benjamin <[hidden email]> wrote:

if it works go ahead ;)

Ben

On Mar 28, 2013, at 12:48 PM, Norbert Hartl <[hidden email]> wrote:


Am 28.03.2013 um 11:51 schrieb stephane ducasse <[hidden email]>:


On Mar 28, 2013, at 11:21 AM, Norbert Hartl <[hidden email]> wrote:

What is the rationale for having the method pane as multi-select list? I don't think it is of greater use when editing code. I could imagine that some refactoring tasks could be easier having multi-select lists.

Anyway, if I try to rename a method without using the refactoring engine I just change the selector, save and delete the method with the old selector. In pharo 2.0 when you rename a method and then click on the old selector both methods are selected and shortcut invocation for deleting deletes both. Which is quite annoying. In my opinion there is no reason for two methods being selected. If you agree I'll happily enter a bug.


The problem is not a nautilus bug but a compiled method one if I remember correctly.
because two methods with the same body are equal.

It happens in MethodWidget>>#methodSelectionAt:put. When PluggableIconListMorph updates the list selection it calls the MethodWidget to set true on the new method selected. But MethodWidget uses a Dictionary for instVar methodSelection and finds the old method being equal and enables this.
As I don't see a reason why a selection should be done by equality this behavior can be fixed by using an IdentityDictionary.

Fix:

MethodWidget>>#initialize

super initialize.
methodsSelection := IdentityDictionary new.

Any arguments?

Norbert