Hi,
Ok, this is more tricky, but it is supported :). Actually this is one of the
really cool things about Spotter.
For this we have #filter:item:. Look at the senders to find examples in the
image.
For example:
PragmaType>>spotterSendersFor: aStep
<spotterOrder: 50>
^ aStep listProcessor
title: 'Senders';
filter: GTFilterSubstring item: [ :filter :context |
self keyword senders do: [ :sender |
filter value: sender compiledMethod ] ]
or:
GTSpotter>>spotterForReferencesFor: aStep
<spotterOrder: 32>
aStep listProcessor
title: 'References';
filter: GTNullFilter item: [ :filter :context |
context textTrimmed asClassIfPresent: [ :class |
SystemNavigation default allReferencesTo: class
binding do: filter ] ];
keyBinding: $n shift meta;
itemName: [ :method | method gtDisplayString ]
so, the block is being passed a filter which actually behaves like a block :).
So, you can pass it to whatever traversal you have, and this will stream the
results back to Spotter. I find this so cool that I cannot describe it :).
Let me know if this helps.
Cheers,
Doru
> On Feb 24, 2016, at 10:14 PM, Yuriy Tymchuk <[email protected]> wrote:
>
> Also in your case you have `allCandidates`. I don’t have this as I’m going to
> query a remote service base on input and I want to display all that I will
> get :)
>
> Uko
>
>> On 24 Feb 2016, at 21:52, Sven Van Caekenberghe <[email protected]> wrote:
>>
>>>
>>> On 24 Feb 2016, at 21:41, Yuriy Tymchuk <[email protected]> wrote:
>>>
>>> This is super cool! But now I need to lookup: “How to make your own Spotter
>>> engine(whatever you call the thing)” ;)
>>
>> That is actually surprisingly simple.
>>
>> To look up known Unicode Characters by partial name:
>>
>> GTSpotter>>#spotterForUnicodeCharacterFor: aStep
>> <spotterOrder: 30>
>> aStep listProcessor
>> title: 'Unicode Character';
>> allCandidates: [ UnicodeCharacterData database values ];
>> itemName: [ :each | each name ];
>> filter: GTFilterSubstring;
>> wantsToDisplayOnEmptyQuery: false
>>
>> And if you want a preview:
>>
>> UnicodeCharacterData>>#spotterPreviewIn: aComposite
>> <spotterPreview: 10>
>>
>> ... same as GT inspector ...
>>
>>> Cheers!
>>> Uko
>>>
>>>> On 24 Feb 2016, at 21:38, Tudor Girba <[email protected]> wrote:
>>>>
>>>> Hi,
>>>>
>>>> The recent debates around Spotter, showed that some of its features are
>>>> not well understood. In an effort to document it more thoroughly I created
>>>> a couple of (very short) videos. They have no sound. Please take a look
>>>> and let us know what you think.
>>>>
>>>>
>>>> Spotting a class with GTSpotter
>>>> https://www.youtube.com/watch?v=_wIh4fekcD8
>>>>
>>>> Scoping a search to a specific category in GTSpotter
>>>> https://www.youtube.com/watch?v=9-fY4mN6Isc
>>>>
>>>> Using category shortcuts in GTSpotter
>>>> https://www.youtube.com/watch?v=USNZ7_6gLDA
>>>>
>>>> Using preview in GTSpotter
>>>> https://www.youtube.com/watch?v=FSm5xylmTqM
>>>>
>>>> Using the dive-in action in GTSpotter
>>>> https://www.youtube.com/watch?v=C7mJBX3Oblw
>>>>
>>>> Loading a public playground with GTSpotter
>>>> https://www.youtube.com/watch?v=xeDDLLdA1v8
>>>>
>>>> Navigating through files with GTSpotter
>>>> https://www.youtube.com/watch?v=dHQqXcS0vDI
>>>>
>>>> Refining a search through the dive-in-category action with GTSpotter
>>>> https://www.youtube.com/watch?v=IclLett0d6c
>>>>
>>>> Opening a cached playground page with GTSpotter
>>>> https://www.youtube.com/watch?v=V_yndTSsj8c
>>>>
>>>>
>>>> Cheers,
>>>> Doru
>>>>
>>>>
>>>> --
>>>> www.tudorgirba.com
>>>> www.feenk.com
>>>>
>>>> "Yesterday is a fact.
>>>> Tomorrow is a possibility.
>>>> Today is a challenge."
>>>>
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> Moose-dev mailing list
>>>> [email protected]
>>>> https://www.list.inf.unibe.ch/listinfo/moose-dev
>>>
>>> _______________________________________________
>>> Moose-dev mailing list
>>> [email protected]
>>> https://www.list.inf.unibe.ch/listinfo/moose-dev
>>
>> _______________________________________________
>> Moose-dev mailing list
>> [email protected]
>> https://www.list.inf.unibe.ch/listinfo/moose-dev
>
> _______________________________________________
> Moose-dev mailing list
> [email protected]
> https://www.list.inf.unibe.ch/listinfo/moose-dev
--
www.tudorgirba.com
www.feenk.com
"Every thing has its own flow."