mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-08 10:16:03 +02:00
Implementation of source locator.
This commit is contained in:
parent
734438b514
commit
523331e401
1 changed files with 21 additions and 10 deletions
|
@ -261,17 +261,9 @@ public class CSourceLocator implements ICSourceLocator
|
|||
}
|
||||
return false;
|
||||
}
|
||||
if ( fProject.exists( resource.getFullPath() ) )
|
||||
if ( resource instanceof IFile )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
IProject[] projects = getReferencedProjects();
|
||||
for ( int i = 0; i < projects.length; ++i )
|
||||
{
|
||||
if ( projects[i].exists( resource.getFullPath() ) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return containsFile( resource.getLocation() );
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -289,4 +281,23 @@ public class CSourceLocator implements ICSourceLocator
|
|||
}
|
||||
return projects;
|
||||
}
|
||||
|
||||
protected boolean containsFile( IPath path )
|
||||
{
|
||||
try
|
||||
{
|
||||
if ( findFile( (IContainer)fProject, path ) != null )
|
||||
return true;
|
||||
IProject[] p = fProject.getReferencedProjects();
|
||||
for ( int j= 0; j < p.length; j++ )
|
||||
{
|
||||
if ( findFile( (IContainer)p[j], path ) != null )
|
||||
return true;
|
||||
}
|
||||
}
|
||||
catch( CoreException e )
|
||||
{
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue