Structural search question

Say I'm searching for something like:

$content$.getChildren().add($statement$)

Is it possible to specify that content should be a variable of class Foo?




16 comments
Comment actions Permalink

Actually while on the topic of structural search... I just discoved you
can't search and replace within a selection. This would have been useful.


"Glen Stampoultzis" <gstamp@iinet.net.au> wrote in message
news:ccibrn$tjc$1@is.intellij.net...

Say I'm searching for something like:

>

$content$.getChildren().add($statement$)

>

Is it possible to specify that content should be a variable of class Foo?

>
>
>
>


0
Comment actions Permalink

Hi,

Expression type for content variable should be set to Foo.

Glen Stampoultzis wrote:

Say I'm searching for something like:

$content$.getChildren().add($statement$)

Is it possible to specify that content should be a variable of class Foo?



0
Comment actions Permalink

Hi,
Have you tried to use scope 'selection'?

Glen Stampoultzis wrote:

Actually while on the topic of structural search... I just discoved you
can't search and replace within a selection. This would have been useful.


"Glen Stampoultzis" <gstamp@iinet.net.au> wrote in message
news:ccibrn$tjc$1@is.intellij.net...

>>Say I'm searching for something like:
>>
>>$content$.getChildren().add($statement$)
>>
>>Is it possible to specify that content should be a variable of class Foo?
>>
>>
>>
>>


0
Comment actions Permalink


What the? Where did that come from? Gotta stop drinking and programming.


"Maxim Mossienko" <Maxim.Mossienko@jetbrains.com> wrote in message
news:ccj6ad$d6b$2@is.intellij.net...

Hi,
Have you tried to use scope 'selection'?

>

Glen Stampoultzis wrote:

>

Actually while on the topic of structural search... I just discoved you
can't search and replace within a selection. This would have been

useful.

>
>

"Glen Stampoultzis" <gstamp@iinet.net.au> wrote in message
news:ccibrn$tjc$1@is.intellij.net...

>
>>Say I'm searching for something like:
>>
>>$content$.getChildren().add($statement$)
>>
>>Is it possible to specify that content should be a variable of class

Foo?

>>
>>
>>
>>
>
>
>



0
Comment actions Permalink


"Maxim Mossienko" <Maxim.Mossienko@jetbrains.com> wrote in message
news:ccj68k$d6b$1@is.intellij.net...

Hi,

>

Expression type for content variable should be set to Foo.

>

Thanks. I find the terminology a little confusing. I might post further
comments after I'm a bit more familiar with it.


0
Comment actions Permalink

Hi,

When one has selection in the editor in the scope combo box (available
in SS and find usages) there is 'Selection' scope.

Glen Stampoultzis wrote:

What the? Where did that come from? Gotta stop drinking and programming.


"Maxim Mossienko" <Maxim.Mossienko@jetbrains.com> wrote in message
news:ccj6ad$d6b$2@is.intellij.net...

>>Hi,
>>Have you tried to use scope 'selection'?
>>
>>Glen Stampoultzis wrote:
>>
>>
>>>Actually while on the topic of structural search... I just discoved you
>>>can't search and replace within a selection. This would have been


useful.

>>>
>>>"Glen Stampoultzis" <gstamp@iinet.net.au> wrote in message
>>>news:ccibrn$tjc$1@is.intellij.net...
>>>
>>>
>>>>Say I'm searching for something like:
>>>>
>>>>$content$.getChildren().add($statement$)
>>>>
>>>>Is it possible to specify that content should be a variable of class


Foo?

>>>>
>>>>
>>>>
>>>
>>>


0
Comment actions Permalink

Hi,
$foo$ in $foo$.aa() is java expression, java expression has type,
declaring expression type to be Foo will find expressions of specified
pattern and having expression type $foo$ to be Foo.

Glen Stampoultzis wrote:

"Maxim Mossienko" <Maxim.Mossienko@jetbrains.com> wrote in message
news:ccj68k$d6b$1@is.intellij.net...

>>Hi,
>>
>>Expression type for content variable should be set to Foo.
>>


Thanks. I find the terminology a little confusing. I might post further
comments after I'm a bit more familiar with it.

0
Comment actions Permalink


I understand... and it makes sense. I just think it could be clearer. I
won't bother boring you with how just yet. :)


"Maxim Mossienko" <Maxim.Mossienko@jetbrains.com> wrote in message
news:ccjdgg$qbu$1@is.intellij.net...

Hi,
$foo$ in $foo$.aa() is java expression, java expression has type,
declaring expression type to be Foo will find expressions of specified
pattern and having expression type $foo$ to be Foo.

>

Glen Stampoultzis wrote:

>

"Maxim Mossienko" <Maxim.Mossienko@jetbrains.com> wrote in message
news:ccj68k$d6b$1@is.intellij.net...

>
>>Hi,
>>
>>Expression type for content variable should be set to Foo.
>>
>
>

Thanks. I find the terminology a little confusing. I might post

further

comments after I'm a bit more familiar with it.

>
>



0
Comment actions Permalink


I think you misunderstood. I was just making a joke that I didn't see it
previously. It's really very obvious but I missed it when I was first
looking for some reason.

BTW, I'm really loving structural search and replace. It's great not having
to worry silly things like whitespace matching and to be able to pick out
expressions and put them in new arrangements. Definitely one of the better
features of 4.5.

Regards,

Glen

"Maxim Mossienko" <Maxim.Mossienko@jetbrains.com> wrote in message
news:ccjd04$o4e$1@is.intellij.net...

Hi,

>

When one has selection in the editor in the scope combo box (available
in SS and find usages) there is 'Selection' scope.

>

Glen Stampoultzis wrote:

>

What the? Where did that come from? Gotta stop drinking and

programming.

>
>

"Maxim Mossienko" <Maxim.Mossienko@jetbrains.com> wrote in message
news:ccj6ad$d6b$2@is.intellij.net...

>
>>Hi,
>>Have you tried to use scope 'selection'?
>>
>>Glen Stampoultzis wrote:
>>
>>
>>>Actually while on the topic of structural search... I just discoved

you

>>>can't search and replace within a selection. This would have been
>

useful.

>
>>>
>>>"Glen Stampoultzis" <gstamp@iinet.net.au> wrote in message
>>>news:ccibrn$tjc$1@is.intellij.net...
>>>
>>>
>>>>Say I'm searching for something like:
>>>>
>>>>$content$.getChildren().add($statement$)
>>>>
>>>>Is it possible to specify that content should be a variable of class
>

Foo?

>
>>>>
>>>>
>>>>
>>>
>>>
>
>



0
Comment actions Permalink

Ha!! I knew I wasn't mad Look at this screenshot:



No selection scope... and yes... I do have a selection.


"Maxim Mossienko" <Maxim.Mossienko@jetbrains.com> wrote in message news:ccj6ad$d6b$2@is.intellij.net...

Hi,
Have you tried to use scope 'selection'?

Glen Stampoultzis wrote:

Actually while on the topic of structural search... I just discoved you
can't search and replace within a selection. This would have been useful.


"Glen Stampoultzis" <gstamp@iinet.net.au> wrote in message
news:ccibrn$tjc$1@is.intellij.net...

>>Say I'm searching for something like:
>>
>>$content$.getChildren().add($statement$)
>>
>>Is it possible to specify that content should be a variable of class Foo?
>>
>>
>>
>>


>



Attachment(s):
proof.bmp
0
Comment actions Permalink

Hi,

I am kin to know on how you achieved this effect.

Glen Stampoultzis wrote:

Ha!! I knew I wasn't mad Look at this screenshot:


No selection scope... and yes... I do have a selection.


"Maxim Mossienko" <Maxim.Mossienko@jetbrains.com
<mailto:Maxim.Mossienko@jetbrains.com>> wrote in message
news:ccj6ad$d6b$2@is.intellij.net...
> Hi,
> Have you tried to use scope 'selection'?
>
> Glen Stampoultzis wrote:
>
> > Actually while on the topic of structural search... I just
discoved you
> > can't search and replace within a selection. This would have been
useful.
> >
> >
> > "Glen Stampoultzis" <gstamp@iinet.net.au
<mailto:gstamp@iinet.net.au>> wrote in message
> > news:ccibrn$tjc$1@is.intellij.net...
> >
> >>Say I'm searching for something like:
> >>
> >>$content$.getChildren().add($statement$)
> >>
> >>Is it possible to specify that content should be a variable of
class Foo?
> >>
> >>
> >>
> >>
> >
> >
> >



--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0
Comment actions Permalink


It's always not showing now. I'm not sure what triggered it. If I find out
I'll let you know.

Regards,

Glen

"Maxim Mossienko" <Maxim.Mossienko@jetbrains.com> wrote in message
news:cd07fm$ja$1@is.intellij.net...

Hi,

>

I am kin to know on how you achieved this effect.

>

Glen Stampoultzis wrote:

>

Ha!! I knew I wasn't mad Look at this screenshot:

>
>

No selection scope... and yes... I do have a selection.

>
>

"Maxim Mossienko" <Maxim.Mossienko@jetbrains.com
<mailto:Maxim.Mossienko@jetbrains.com>> wrote in message
news:ccj6ad$d6b$2@is.intellij.net...
> Hi,
> Have you tried to use scope 'selection'?
>
> Glen Stampoultzis wrote:
>
> > Actually while on the topic of structural search... I just
discoved you
> > can't search and replace within a selection. This would have been
useful.
> >
> >
> > "Glen Stampoultzis" <gstamp@iinet.net.au
<mailto:gstamp@iinet.net.au>> wrote in message
> > news:ccibrn$tjc$1@is.intellij.net...
> >
> >>Say I'm searching for something like:
> >>
> >>$content$.getChildren().add($statement$)
> >>
> >>Is it possible to specify that content should be a variable of
class Foo?
> >>
> >>
> >>
> >>
> >
> >
> >

>
>

--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"



0
Comment actions Permalink

Glen Stampoultzis wrote:

It's always not showing now. I'm not sure what triggered it. If I find out
I'll let you know.


Same for me. I tried it with different files and different kinds of selections,
but I never get a selection scope.

Sascha

0
Comment actions Permalink

Hi,

Selection scope appears when there something is selected in editor.
We have request to support selections in Project pane also.

Sascha Weinreuter wrote:

Glen Stampoultzis wrote:

>> It's always not showing now. I'm not sure what triggered it. If I
>> find out
>> I'll let you know.


Same for me. I tried it with different files and different kinds of
selections,
but I never get a selection scope.

Sascha



--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0
Comment actions Permalink

Maxim Mossienko wrote:

Hi,

Selection scope appears when there something is selected in editor.
We have request to support selections in Project pane also.


Sorry for the confusion, I did mean the selection in the editor. And
I also found the "problem": The selection scope only appears if the
selection is made up of a valid block of code. This is quite confusing
though.

Sascha

0

Please sign in to leave a comment.