[Pharo-users] [spotter] How do I get all the pragmas of the system?

Tudor Girba tudor at tudorgirba.com
Sat May 21 03:16:10 EDT 2016


Hi,

This is not provided because that search is too expensive to happen by default.

Take a look at the current implementation:

GTSpotter>>spotterForPragmasFor: aStep
	<spotterOrder: 40>
	aStep listProcessor 
			allCandidates: [ PragmaType all ];
			title: 'Pragmas';
			itemName: [ :pragma | pragma keyword ];
			filter: GTFilterSubstring;
			wantsToDisplayOnEmptyQuery: false

The last statement says that you have to have a query to start the search. And because it is implemented using as a substring filter, you will only get something when you have a letter in the search.

Now, if you want to have a full text search option, for example using string match patterns, you can do this:

GTSpotter>>spotterForPragmasFor: aStep
	<spotterOrder: 40>
	aStep listProcessor 
			allCandidates: [ PragmaType all ];
			title: 'Pragmas';
			itemName: [ :pragma | pragma keyword ];
			filter: GTFilterStringMatch;
			wantsToDisplayOnEmptyQuery: false

Now, if you type 
	#pragma * you get all pragmas

The StringMatch is slower than the Substring and that is why we do not use it by default. We still would like to work on a more unified search strategy, but we did not get to it. Perhaps someone else could propose something.

Cheers,
Doru


> On May 21, 2016, at 8:41 AM, stepharo <stepharo at free.fr> wrote:
> 
> How do I get all the pragmas of the system with Spotter?
> 
> 

--
www.tudorgirba.com
www.feenk.com

"We cannot reach the flow of things unless we let go."




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-users_lists.pharo.org/attachments/20160521/5fa8cab6/attachment.html>


More information about the Pharo-users mailing list