pharo-ide / Calypso

Pharo system browser
http://dionisiydk.blogspot.com/2017/07/calypso-update-many-improvements-and.html
MIT License
38 stars 21 forks source link

should be implemented protocol should not be shown in abstract classes #212

Closed guillep closed 6 years ago

guillep commented 6 years ago

I have the following Scenario

I have a method in A marked as #subclassResponsibility.

Then, I see both in B and C my method marked as "should be implemented" but it should be only shown in C. B is abstract, I don't want to implement my method there.

dionisiydk commented 6 years ago

I do not see any way how to implement it because now any class which inherits subclassResponsibility is shown as abstract (isAbstract = true). We did it during some sprint.

Imagine you create new subclass of abstract superclass. Nobody knows that you are going to create another abstract subclass instead of implement all responsibilities. And there is no way how to detect that class is in "final state". Do you see any solution for this?

dionisiydk commented 6 years ago

Also it is still pretty useful feature for abstract classes too. Because it allows you to see what abstract methods from superclasses are propagating to subclasses.

guillep commented 6 years ago

Well, to answer the first question, it could be implemented by asking the class if it is abstract or not...

In any case, the thing is that it is shown in red, like it is an error, and crying it loud "YOU SHALL IMPLEMENT THIS". But that's not the case, I want that design and I do not want to implement it in that class...

dionisiydk commented 6 years ago

You can check that any new class which is subclassed from abstract superclass will return true for #isAbstract. But such classes are actual use case for this feature: we need to see what methods need to be implemented.

dionisiydk commented 6 years ago

Again: it is impossible to distinguish abstract class and not implemented class

guillep commented 6 years ago

Not true, I implemented in my class #isAbstract, like a normal person :)

Blah class >> isAbstract

    ^ self = Blah

On Wed, Mar 7, 2018 at 11:56 AM, Denis Kudriashov notifications@github.com wrote:

Again: it is impossible to distinguish abstract class and not implemented class

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/dionisiydk/Calypso/issues/212#issuecomment-371102064, or mute the thread https://github.com/notifications/unsubscribe-auth/AArO4idcDr2ypgAcektthGF5N97Og_76ks5tb7zygaJpZM4SgLBC .

--

Guille Polito

Research Engineer

Centre de Recherche en Informatique, Signal et Automatique de Lille

CRIStAL - UMR 9189

French National Center for Scientific Research - http://www.cnrs.fr http://www.cnrs.fr

Web: http://guillep.github.io http://guillep.github.io

Phone: +33 06 52 70 66 13

dionisiydk commented 6 years ago

I found solution. I will use following condition to skip explicitly defined abstract classes:

^(aClass classSide includesLocalSelector: #isAbstract) and: [aClass isAbstract]
dionisiydk commented 6 years ago

in 0.11.0.