spotting methods with TODO, FIXME, etc. comments?

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

spotting methods with TODO, FIXME, etc. comments?

raffaello.giulietti
Hi community,

many IDEs for other language usually offer a way to annotate methods
with special comments like "TODO ...", "FIXME ...". Such methods can
then be later retrieved easily in task lists and selected by simple clicks.

Is there something similar in Pharo?

Thanks

Reply | Threaded
Open this post in threaded view
|

Re: spotting methods with TODO, FIXME, etc. comments?

HilaireFernandes
Hi Raffaello,

You can annotate your methods with a pragma, for example
<workInProgress>, then from the Finder tool (WorldMenu>Tools>Finder),
you search for pragma:

In the left text field, input workInProgress, then in the drop down list
at the right, select Pragmas.

Hilaire

Le 01/03/2017 à 18:53, Raffaello Giulietti a écrit :

> Hi community,
>
> many IDEs for other language usually offer a way to annotate methods
> with special comments like "TODO ...", "FIXME ...". Such methods can
> then be later retrieved easily in task lists and selected by simple clicks.
>
> Is there something similar in Pharo?
>
> Thanks
>

--
Dr. Geo
http://drgeo.eu


Reply | Threaded
Open this post in threaded view
|

Re: spotting methods with TODO, FIXME, etc. comments?

raffaello.giulietti
Hi Hilaire,

great!

Is there a standard or conventional set of pragmas for such kind of
annotations? I mean, pragmas are very flexible but I would like to
adhere to well-established conventions, if possible.



On 2017-03-01 18:59, Hilaire wrote:

> Hi Raffaello,
>
> You can annotate your methods with a pragma, for example
> <workInProgress>, then from the Finder tool (WorldMenu>Tools>Finder),
> you search for pragma:
>
> In the left text field, input workInProgress, then in the drop down list
> at the right, select Pragmas.
>
> Hilaire
>
> Le 01/03/2017 à 18:53, Raffaello Giulietti a écrit :
>> Hi community,
>>
>> many IDEs for other language usually offer a way to annotate methods
>> with special comments like "TODO ...", "FIXME ...". Such methods can
>> then be later retrieved easily in task lists and selected by simple clicks.
>>
>> Is there something similar in Pharo?
>>
>> Thanks
>>
>


Reply | Threaded
Open this post in threaded view
|

Re: spotting methods with TODO, FIXME, etc. comments?

Peter Uhnak
In reply to this post by raffaello.giulietti
On Wed, Mar 01, 2017 at 06:53:16PM +0100, Raffaello Giulietti wrote:

> Hi community,
>
> many IDEs for other language usually offer a way to annotate methods
> with special comments like "TODO ...", "FIXME ...". Such methods can
> then be later retrieved easily in task lists and selected by simple
> clicks.
>
> Is there something similar in Pharo?
>
> Thanks
>

The most common is `self flag: 'text'`. This will give you an icon in Nautilus browser.

But keep in mind that IDEs impose special syntax because they do not provide you with option to retrieve it yourself.
In Pharo there is no such restriction, so you can do whatever you find most practical to you and then just collect the places yourself.

E.g. you can trivally retrieve all methods that have "todo" anywhere in method comment:

('My-Package' asPackage classes flatCollect: #methods)
        select: [ :each | each comment isNotNil and: [ each comment includesSubstring: 'todo' ] ]

Peter

Reply | Threaded
Open this post in threaded view
|

Re: spotting methods with TODO, FIXME, etc. comments?

NorbertHartl
Yes, #flag: is the way to go. I often use something like

self flag: #needsWork

If you use symbols then you can just mark the needsWork and search for senders (cmd-n on Mac). That gives you all of the locations in the image where it is used.

Norbert

> Am 01.03.2017 um 19:06 schrieb Peter Uhnak <[hidden email]>:
>
> On Wed, Mar 01, 2017 at 06:53:16PM +0100, Raffaello Giulietti wrote:
>> Hi community,
>>
>> many IDEs for other language usually offer a way to annotate methods
>> with special comments like "TODO ...", "FIXME ...". Such methods can
>> then be later retrieved easily in task lists and selected by simple
>> clicks.
>>
>> Is there something similar in Pharo?
>>
>> Thanks
>>
>
> The most common is `self flag: 'text'`. This will give you an icon in Nautilus browser.
>
> But keep in mind that IDEs impose special syntax because they do not provide you with option to retrieve it yourself.
> In Pharo there is no such restriction, so you can do whatever you find most practical to you and then just collect the places yourself.
>
> E.g. you can trivally retrieve all methods that have "todo" anywhere in method comment:
>
> ('My-Package' asPackage classes flatCollect: #methods)
> select: [ :each | each comment isNotNil and: [ each comment includesSubstring: 'todo' ] ]
>
> Peter
>


Reply | Threaded
Open this post in threaded view
|

Re: spotting methods with TODO, FIXME, etc. comments?

philippeback
In reply to this post by raffaello.giulietti
One usually puts things like:

self flag: #TODO. "Need to fix this hack"

self flag: #FIXME. "Quick kludgy temp solution"

Some write:

self flag: 'Must add such or such feature'.

Then start Spotter and search for flag: senders with 

flag: #se

There is already quite a list in the image.

Phil

On Wed, Mar 1, 2017 at 7:04 PM, Raffaello Giulietti <[hidden email]> wrote:
Hi Hilaire,

great!

Is there a standard or conventional set of pragmas for such kind of annotations? I mean, pragmas are very flexible but I would like to adhere to well-established conventions, if possible.



On 2017-03-01 18:59, Hilaire wrote:
Hi Raffaello,

You can annotate your methods with a pragma, for example
<workInProgress>, then from the Finder tool (WorldMenu>Tools>Finder),
you search for pragma:

In the left text field, input workInProgress, then in the drop down list
at the right, select Pragmas.

Hilaire

Le 01/03/2017 à 18:53, Raffaello Giulietti a écrit :
Hi community,

many IDEs for other language usually offer a way to annotate methods
with special comments like "TODO ...", "FIXME ...". Such methods can
then be later retrieved easily in task lists and selected by simple clicks.

Is there something similar in Pharo?

Thanks