Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorqiwang2011-02-22 00:20:24 +0000
committerqiwang2011-02-22 00:20:24 +0000
commit6027e73a3c0a708c4ac27eb68967b178e328d373 (patch)
tree6b49596a1834d182194335086a006f8ee3239176
parentb76d4bed4e53bae9f939ae221c75a5020e699220 (diff)
downloadorg.eclipse.pdt-6027e73a3c0a708c4ac27eb68967b178e328d373.tar.gz
org.eclipse.pdt-6027e73a3c0a708c4ac27eb68967b178e328d373.tar.xz
org.eclipse.pdt-6027e73a3c0a708c4ac27eb68967b178e328d373.zip
Fixed the issue of creating script project for non-php project.
-rw-r--r--plugins/org.eclipse.php.core/src/org/eclipse/php/internal/core/PHPCorePlugin.java26
1 files changed, 14 insertions, 12 deletions
diff --git a/plugins/org.eclipse.php.core/src/org/eclipse/php/internal/core/PHPCorePlugin.java b/plugins/org.eclipse.php.core/src/org/eclipse/php/internal/core/PHPCorePlugin.java
index d3bdc383f..ed66900aa 100644
--- a/plugins/org.eclipse.php.core/src/org/eclipse/php/internal/core/PHPCorePlugin.java
+++ b/plugins/org.eclipse.php.core/src/org/eclipse/php/internal/core/PHPCorePlugin.java
@@ -158,15 +158,18 @@ public class PHPCorePlugin extends Plugin {
}
IScriptProject scriptProject = DLTKCore
.create(project);
- IProjectFragment[] projectFragments = scriptProject
- .getProjectFragments();
- for (IProjectFragment projectFragment : projectFragments) {
- ProjectIndexerManager.removeProjectFragment(
- scriptProject, projectFragment
- .getPath());
+ if (scriptProject.isOpen()) {
+ IProjectFragment[] projectFragments = scriptProject
+ .getProjectFragments();
+ for (IProjectFragment projectFragment : projectFragments) {
+ ProjectIndexerManager
+ .removeProjectFragment(
+ scriptProject,
+ projectFragment.getPath());
+ }
+ ProjectIndexerManager.removeProject(project
+ .getFullPath());
}
- ProjectIndexerManager.removeProject(project
- .getFullPath());
}
// add to index:
@@ -250,8 +253,8 @@ public class PHPCorePlugin extends Plugin {
if (oldIncludePath != null) {
newPath.addAll(Arrays.asList(oldIncludePath));
}
- scriptProject.setRawBuildpath(newPath
- .toArray(new IBuildpathEntry[newPath.size()]),
+ scriptProject.setRawBuildpath(
+ newPath.toArray(new IBuildpathEntry[newPath.size()]),
new NullProgressMonitor());
}
@@ -401,8 +404,7 @@ public class PHPCorePlugin extends Plugin {
.createWorkspaceScope(PHPLanguageToolkit.getDefault());
try {
if (monitor != null) {
- monitor
- .subTask(CoreMessages.PHPCorePlugin_initializingSearchEngine);
+ monitor.subTask(CoreMessages.PHPCorePlugin_initializingSearchEngine);
monitor.worked(25);
}

Back to the top