import java.util.Map;
import net.sourceforge.phpdt.internal.ui.util.PHPFileUtil;
+import net.sourceforge.phpeclipse.PHPeclipsePlugin;
import net.sourceforge.phpeclipse.phpeditor.PHPParserAction;
+import net.sourceforge.phpeclipse.resourcesview.PHPProject;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
/**
*
*/
- protected IProject[] build(int kind, Map args, IProgressMonitor monitor)
- throws CoreException {
+ protected IProject[] build(int kind, Map args, IProgressMonitor monitor) throws CoreException {
monitor.beginTask("Parsing files", TOTAL_WORK);
if (kind == IncrementalProjectBuilder.FULL_BUILD) {
IResourceDelta delta = getDelta(getProject());
if (delta != null) {
- delta.accept(new ParserVisitor(monitor));
+ delta.accept(new ParserVisitor(getProject(), monitor));
}
}
*
* @param iProject
*/
- public void processFull(IProject iProject, final IProgressMonitor monitor) {
-
+ public void processFull(final IProject iProject, final IProgressMonitor monitor) {
+ final IdentifierIndexManager indexManager = PHPeclipsePlugin.getDefault().getIndexManager(iProject);
// Create resource visitor logic
IResourceVisitor myVisitor = new IResourceVisitor() {
public boolean visit(IResource resource) throws CoreException {
if (monitor.isCanceled()) {
throw new OperationCanceledException();
}
- if ((resource.getFileExtension() != null)
- && PHPFileUtil.isPHPFile((IFile) resource)) {
+ if ((resource.getFileExtension() != null) && PHPFileUtil.isPHPFile((IFile) resource)) {
monitor.worked(1);
monitor.subTask("Parsing: " + resource.getFullPath());
+ // check for parsing errors
PHPParserAction.parseFile((IFile) resource);
+ // update indexfile for the project:
+ PHPProject nature = (PHPProject) iProject.getNature(PHPeclipsePlugin.PHP_NATURE_ID);
+ indexManager.addFile((IFile) resource);
}
}
// Process the project using the visitor just created
try {
+
+// if (iProject.hasNature(PHPeclipsePlugin.PHP_NATURE_ID)) {
+// thePHPProject = new PHPProject();
+// thePHPProject.setProject(iProject);
+// }
+ indexManager.initialize();
iProject.accept(myVisitor);
+ indexManager.writeFile();
} catch (CoreException e) {
e.printStackTrace();
}
* </pre>
* </p>
*/
- public void setInitializationData(
- IConfigurationElement config,
- String propertyName,
- Object data)
- throws CoreException {
+ public void setInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException {
super.setInitializationData(config, propertyName, data);
}