Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jdt-core-dev] how to create IJavaSearchScope that would include all necessary projectes/libraries?


I don't really see the difference between adding all package fragment roots of a project and the project itself. What is the benefit ?

To make it more precise. Will your solution work for the following case:

project P0: defines a type T
project P1:
        references project P0 (specified on build path).
        export project P0
        uses type T.
project P2:
        uses type T
        reference project P1. Note project P0 isn't referenced, but T is visible since P1 exports it.


Building the closure would help but would add to many projects in the following case:

project P3:
        references P0
project P4:
        references P3
       
In this constallation P4 can't access type T defined in P0. Therefore P4 doesn't have to be part of the search scope when searching for references to type T.

So how to we compute the "optimal" search scope in this scenario ?

Dirk



Jerome_Lanneluc@xxxxxxx
Sent by: jdt-core-dev-admin@xxxxxxxxxxx

12.03.2002 15:22
Please respond to jdt-core-dev

       
        To:        jdt-core-dev@xxxxxxxxxxx
        cc:        
        Subject:        Re: [jdt-core-dev] how to create IJavaSearchScope that would include all necessary projectes/libraries?



Instead of adding all referencing projects, you could add the package
fragment roots of each referencing project (see
IJavaProject,getPackageFragmentRoots()).

Jerome



                                                                                                                                             
                     "Adam Kiezun"                                                                                                          
                     <adam.kiezun@xxxxxx         To:      <jdt-core-dev@xxxxxxxxxxx>                                                        
                     t>                          cc:                                                                                        
                     Sent by:                    Subject: [jdt-core-dev] how to create IJavaSearchScope that would include all necessary    
                     jdt-core-dev-admin@         projectes/libraries?                                                                        
                     eclipse.org                                                                                                            
                                                                                                                                             
                                                                                                                                             
                     03/12/2002 02:29 PM                                                                                                    
                     Please respond to                                                                                                      
                     jdt-core-dev                                                                                                            
                                                                                                                                             
                                                                                                                                             



hi all,
i have an IJavaElement in hand
how do i create a IJavaSearchScope that would include _everything_ that can
possibly have references to that element (and be smaller than workspace
scope)?

i mean, i have code that adds all referencing projects - but that algorithm
is not correct since projects can export some of their classpath entries
(which wasn't true when i wrote it (basically copied Jerome's suggestions -
thanks :))).

could this be implented in jcore?
if not, can you come up with some code that does it correctly?

thx
a.

_______________________________________________
jdt-core-dev mailing list
jdt-core-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/jdt-core-dev




_______________________________________________
jdt-core-dev mailing list
jdt-core-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/jdt-core-dev



Back to the top