History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: IDEADEV-32565
Type: New Feature New Feature
Status: Resolved Resolved
Resolution: Fixed
Priority: Normal Normal
Assignee: Maxim Mossienko
Reporter: Jon Steelman
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
IDEA: Development

SSR: add ability to use counts with conditionals

Created: 24 Sep 08 18:02   Updated: 14 Nov 08 18:05
Component/s: Structural Search and Replace
Fix Version/s: Diana 9144

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown

Build: 8,823
Fixed in build: 9,010


 Description  « Hide
Improve Structural Search to be able to assess counts so that the following can be done:
Identify every interface in a project that has no more than 1 implementation.
Identify every interface in a project that has no more than 1 direct implementation.
Identify every interface in a project that has no more than 1 extending interface
Identify every interface in a project that has no more than 1 direct extending interface
Identify every interface in a project that has no more than 1 of either a direct implementation or a direct extending interface

 All   Comments   Work Log   Change History      Sort Order:
Maxim Mossienko - 25 Sep 08 21:12
Specify interface as pattern
interface $Class$ {}
for Class variable set (groovy) script constraint like:
com.intellij.psi.search.searches.ClassInheritorsSearch.search(_context_).findAll().size() == 1

Jon Steelman - 26 Sep 08 19:10
Thanks Maxim! Very nice.

When you have a bad script constraint, is there no feedback?
Is there no help documentation about script constraints?

I can file issues on these if it would be useful.


Maxim Mossienko - 27 Sep 08 15:03
If there is syntax error then it is reported during SSR constraint editing,

Jon Steelman - 27 Sep 08 20:41
Hmm, this didn't work:
com.intellij.psi.search.searches.ClassInheritorsSearch.search(context).findAll().size() == 1
but the version you put in the newsgroup post did work:
com.intellij.psi.search.searches.ClassInheritorsSearch.search(_context_).findAll().size() == 1
with the extra underscores around context.

So the first version was an error but not a syntax error? Can the first type of error not be caught?


Maxim Mossienko - 27 Sep 08 21:21
JIRA eats leading / trailing underscores , we will use bundled Groovy plugin to have better error checking

Jon Steelman - 20 Oct 08 18:43
Maxim, This can be closed....but we still need documentation and much better error checking! I'd be happy to file jira issues for those if it would be helpful to you.

Maxim Mossienko - 06 Nov 08 13:04
added sample to predefined templates (documentation and other stuff will be handled in other request)

Jon Steelman - 06 Nov 08 22:21
Not sure if you want two new requests or you already have them/on it. If you want new ones, let me know.

Jon Steelman - 06 Nov 08 23:41
What's the name of this template under Existing Templates? I didn't notice it in build 9013 (first 8.0 release).

Maxim Mossienko - 06 Nov 08 23:50
It is available in 9118

Jon Steelman - 14 Nov 08 17:22
I must be going blind because I don't see the template in build 9144. What is it named/which category?
Thanks,
Jon

Maxim Mossienko - 14 Nov 08 17:56
Existing Templates | class-based | interface that is not implemented

Jon Steelman - 14 Nov 08 18:05
Nice. So in the script text you could adjust the null to a number and change to inequality to get other interesting results. Thanks