SS: instance found in Current File scope but not in other scopes

I have modified an SS template to locate a simple
definition of a field in a class as follows:
*
class $Class$ {
$FieldType$ $FieldName$;
}
*
When I search for it in the 'Current File' scope it
correctly finds in in classes where such fields are
defined and are displayed in the active editor window.

However, whenever I widen the search scope to a scope that
includes the class where previous searches using the
template had a match, I get a message that no occurences
were found - clearly in error!

Any idea how to get this to work? Its difficult enough
to define a template that actually works and finds what
you want, but to let it fail just because you search
using a different scope is Not Cool!

Cheers,

Bonny

4 comments
Comment actions Permalink

Hi,

You may some text contraints bound to variables, they are used for
optimization of the global search, in this time seems incorrectly. Could
you, please, supply the text constraints used.

Bonny Rais wrote:

I have modified an SS template to locate a simple
definition of a field in a class as follows:
*
class $Class$ {
$FieldType$ $FieldName$;
}
*
When I search for it in the 'Current File' scope it
correctly finds in in classes where such fields are
defined and are displayed in the active editor window.

However, whenever I widen the search scope to a scope that
includes the class where previous searches using the
template had a match, I get a message that no occurences
were found - clearly in error!

Any idea how to get this to work? Its difficult enough
to define a template that actually works and finds what
you want, but to let it fail just because you search
using a different scope is Not Cool!

Cheers,

Bonny



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

0
Comment actions Permalink

$Class$: '', apply within hierarchy, counts:1,1
$FieldType$: 'int', counts: 1, unlimited
$FieldName$: 'id', counts: 1, unlimited

The single quotes are not in the regex fields, of course.
Note the $Class$ variable is empty, but it makes no
difference even when there's a value there (although I
cannot see how this would work with a value since it would
imply that all classes in the particular hierarcy are
named using the same pattern, which can not always be done).

Cheers,

Bonny

0
Comment actions Permalink

Hi,

As a workaround try use text constraint $FieldType$: '.int.', what
build you are using?

Bonny Rais wrote:

$Class$: '', apply within hierarchy, counts:1,1
$FieldType$: 'int', counts: 1, unlimited
$FieldName$: 'id', counts: 1, unlimited

The single quotes are not in the regex fields, of course.
Note the $Class$ variable is empty, but it makes no
difference even when there's a value there (although I
cannot see how this would work with a value since it would
imply that all classes in the particular hierarcy are
named using the same pattern, which can not always be done).

Cheers,

Bonny



--
Maxim Mossienko
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0
Comment actions Permalink

Maxim,

Thanks for the suggestion. That seemed to do it, although
the CPU usage increased dramatically and the search took
ages, even though the scope was limited to all the classes
in a single package (47 classes).

I'm using build 3354.

Cheers,

Bonny

0

Please sign in to leave a comment.