Re: [Newbies] string search

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

Re: [Newbies] string search

K. K. Subramaniam
On Tuesday 24 April 2007 1:00 pm, [hidden email] wrote:
> subbukk <[hidden email]> wrote:
> > Hi,
> >
> > How do I do string searches in Squeak environment? For example, how
> > do I search which method refers to 'My Squeak'?
>
> Select "My Squeak" with mouse and press alt-shift-e.
This gives me method names containing the string. I am looking for method
bodies, descriptions or literals which contain this string. I was trying
to search out class methods based on text in filenames, descriptions or
balloon help.

Currently, I convert *.sources file to unix format (\n instead of \r. I am
on Linux),use an editor to dig out strings and work backwards from it.
There must be an easier way.

I should have been clearer in my request. Apologies .. Subbu

Reply | Threaded
Open this post in threaded view
|

Re: [Newbies] string search

Bert Freudenberg
On Apr 24, 2007, at 11:30 , subbukk wrote:

> On Tuesday 24 April 2007 1:00 pm, [hidden email] wrote:
>> subbukk <[hidden email]> wrote:
>>> Hi,
>>>
>>> How do I do string searches in Squeak environment? For example, how
>>> do I search which method refers to 'My Squeak'?
>>
>> Select "My Squeak" with mouse and press alt-shift-e.
> This gives me method names containing the string. I am looking for  
> method
> bodies, descriptions or literals which contain this string. I was  
> trying
> to search out class methods based on text in filenames,  
> descriptions or
> balloon help.

Actually, this searches only string literals, so it should fill your  
need perfectly (I use it quite a lot to discover where in the system  
something is implemented). However, there was a bug (I think in some  
3.8 versions) that not only matched strings but symbols, too, which  
is not what you want.

Also note that Ctrl-e searches case-insensitively.

> Currently, I convert *.sources file to unix format (\n instead of  
> \r. I am
> on Linux),use an editor to dig out strings and work backwards from it.
> There must be an easier way.

In the shifted context menu there is "method source with it" which  
actually searches in the sources file - very slow, because it does  
not just go through the sources/changes file, but loads each method  
source separately.

> I should have been clearer in my request. Apologies .. Subbu

Note you won't find a reference to "My Squeak" in the image because  
that just happens to be the name of the user directory on your disk.

- Bert -



Reply | Threaded
Open this post in threaded view
|

Re: [Newbies] string search

Steven Elkins
In reply to this post by K. K. Subramaniam
On 4/24/07, subbukk <[hidden email]> wrote:

> On Tuesday 24 April 2007 1:00 pm, [hidden email] wrote:
> > subbukk <[hidden email]> wrote:
> > > Hi,
> > >
> > > How do I do string searches in Squeak environment? For example, how
> > > do I search which method refers to 'My Squeak'?
> >
> > Select "My Squeak" with mouse and press alt-shift-e.
> This gives me method names containing the string. I am looking for method
> bodies, descriptions or literals which contain this string. I was trying
> to search out class methods based on text in filenames, descriptions or
> balloon help.
>
> Currently, I convert *.sources file to unix format (\n instead of \r. I am
> on Linux),use an editor to dig out strings and work backwards from it.
> There must be an easier way.

I see others helping with keyboard and menu access.  If you want to
hack your own expression, one of these...

   SystemNavigation>>browseMethodsWithLiteral:
   SystemNavigation>>browseMethodsWithSourceString:
   SystemNavigation>>browseMethodsWithString:

...might be a good place to start.  Or one of them might be just what you want.

Steve

Reply | Threaded
Open this post in threaded view
|

Re: [Newbies] string search

Göran Krampe
In reply to this post by K. K. Subramaniam
subbukk <[hidden email]> wrote:

> On Tuesday 24 April 2007 1:00 pm, [hidden email] wrote:
> > subbukk <[hidden email]> wrote:
> > > Hi,
> > >
> > > How do I do string searches in Squeak environment? For example, how
> > > do I search which method refers to 'My Squeak'?
> >
> > Select "My Squeak" with mouse and press alt-shift-e.
> This gives me method names containing the string. I am looking for method
> bodies, descriptions or literals which contain this string. I was trying
> to search out class methods based on text in filenames, descriptions or
> balloon help.

As Bert explained you can also do a full textual search of the source.

Now - to explain why I gave the above answer: You wrote "which method
refers to 'My Squeak'". Since you used single quotes around My Squeak I
presumed you meant a String literal. :)

regards, Göran