aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Maksimczyk2014-01-22 13:24:20 (EST)
committerMarek Maksimczyk2014-01-22 13:38:03 (EST)
commit11a7448486c1740329092e204fdf0e46d895e450 (patch)
tree6a7b54cf331b2079ccd5471ca3170f3d705b35b4
parent6fea403c64659ade75758a4e39b8ec6a02dc5473 (diff)
downloadorg.eclipse.pdt-11a7448486c1740329092e204fdf0e46d895e450.zip
org.eclipse.pdt-11a7448486c1740329092e204fdf0e46d895e450.tar.gz
org.eclipse.pdt-11a7448486c1740329092e204fdf0e46d895e450.tar.bz2
Small change to use the latest PHP version in ASTView Level 3.0.refs/changes/69/20969/1
Signed-off-by: Marek Maksimczyk <marek.maksimczyk@mandos.net.pl>
-rw-r--r--plugins/org.eclipse.php.astview/src/org/eclipse/php/astview/views/ASTView.java16
-rw-r--r--plugins/org.eclipse.php.core/src/org/eclipse/php/internal/core/PHPVersion.java8
2 files changed, 16 insertions, 8 deletions
diff --git a/plugins/org.eclipse.php.astview/src/org/eclipse/php/astview/views/ASTView.java b/plugins/org.eclipse.php.astview/src/org/eclipse/php/astview/views/ASTView.java
index 9b15198..6944fcc 100644
--- a/plugins/org.eclipse.php.astview/src/org/eclipse/php/astview/views/ASTView.java
+++ b/plugins/org.eclipse.php.astview/src/org/eclipse/php/astview/views/ASTView.java
@@ -45,6 +45,7 @@ import org.eclipse.php.internal.core.ast.nodes.AST;
import org.eclipse.php.internal.core.ast.nodes.ASTNode;
import org.eclipse.php.internal.core.ast.nodes.ASTParser;
import org.eclipse.php.internal.core.ast.nodes.Program;
+import org.eclipse.php.internal.core.project.ProjectOptions;
import org.eclipse.php.ui.editor.SharedASTProvider;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.SashForm;
@@ -67,7 +68,9 @@ import org.eclipse.ui.texteditor.IWorkbenchActionDefinitionIds;
public class ASTView extends ViewPart implements IShowInSource {
// TODO check with the PHP fields
- private static final PHPVersion PHP5= PHPVersion.PHP5;
+
+ private static final PHPVersion PHP5 = PHPVersion.getLatestVersion();
+
/** (Used to get rid of deprecation warnings in code)
* @deprecated
*/
@@ -478,13 +481,10 @@ public class ASTView extends ViewPart implements IShowInSource {
}
private String getInitialASTLevel(ISourceModule typeRoot) {
- return PHP5.getAlias();
-/* String option= typeRoot.getScriptProject().getOption(DLTKCore. JavaCore.COMPILER_SOURCE, true);
- if (option.compareTo(JavaCore.VERSION_1_5) >= 0) {
- return PHP5;
- }
- return fCurrentASTLevel; // use previous level
-*/ }
+ return ProjectOptions.getPhpVersion(typeRoot.getScriptProject().getProject()).isGreaterThan(PHP4) ?
+ PHP5.getAlias():
+ PHP4.getAlias();
+ }
private Program internalSetInput(ISourceModule input, int offset, int length, String astLevel) throws CoreException {
if (input.getBuffer() == null) {
diff --git a/plugins/org.eclipse.php.core/src/org/eclipse/php/internal/core/PHPVersion.java b/plugins/org.eclipse.php.core/src/org/eclipse/php/internal/core/PHPVersion.java
index d36c68a..9914c17 100644
--- a/plugins/org.eclipse.php.core/src/org/eclipse/php/internal/core/PHPVersion.java
+++ b/plugins/org.eclipse.php.core/src/org/eclipse/php/internal/core/PHPVersion.java
@@ -69,4 +69,12 @@ public enum PHPVersion {
return Aliases.map.values();
}
+ /**
+ *
+ * @return
+ */
+ public static PHPVersion getLatestVersion() {
+ return PHP5_5;
+ }
+
}