Skip to content

Commit

Permalink
Update ASTParser to support Java 13 syntax (#323)
Browse files Browse the repository at this point in the history
Signed-off-by: Jinbo Wang <jinbwan@microsoft.com>
  • Loading branch information
testforstephen authored Mar 6, 2020
1 parent fc691fd commit 32f3a1f
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion com.microsoft.java.debug.core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.microsoft.java</groupId>
<artifactId>java-debug-parent</artifactId>
<version>0.25.0</version>
<version>0.25.1</version>
</parent>
<artifactId>com.microsoft.java.debug.core</artifactId>
<packaging>jar</packaging>
Expand Down
2 changes: 1 addition & 1 deletion com.microsoft.java.debug.plugin/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
<classpathentry kind="src" path="src/main/java"/>
<classpathentry exported="true" kind="lib" path="lib/rxjava-2.1.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/reactive-streams-1.0.0.jar"/>
<classpathentry exported="true" kind="lib" path="lib/com.microsoft.java.debug.core-0.25.0.jar" sourcepath="/com.microsoft.java.debug.core"/>
<classpathentry exported="true" kind="lib" path="lib/com.microsoft.java.debug.core-0.25.1.jar" sourcepath="/com.microsoft.java.debug.core"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
4 changes: 2 additions & 2 deletions com.microsoft.java.debug.plugin/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Java Debug Server Plugin
Bundle-SymbolicName: com.microsoft.java.debug.plugin;singleton:=true
Bundle-Version: 0.25.0
Bundle-Version: 0.25.1
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Bundle-Activator: com.microsoft.java.debug.plugin.internal.JavaDebuggerServerPlugin
Expand All @@ -24,4 +24,4 @@ Bundle-ClassPath: lib/commons-io-2.5.jar,
.,
lib/rxjava-2.1.1.jar,
lib/reactive-streams-1.0.0.jar,
lib/com.microsoft.java.debug.core-0.25.0.jar
lib/com.microsoft.java.debug.core-0.25.1.jar
4 changes: 2 additions & 2 deletions com.microsoft.java.debug.plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.microsoft.java</groupId>
<artifactId>java-debug-parent</artifactId>
<version>0.25.0</version>
<version>0.25.1</version>
</parent>
<artifactId>com.microsoft.java.debug.plugin</artifactId>
<packaging>eclipse-plugin</packaging>
Expand Down Expand Up @@ -45,7 +45,7 @@
<artifactItem>
<groupId>com.microsoft.java</groupId>
<artifactId>com.microsoft.java.debug.core</artifactId>
<version>0.25.0</version>
<version>0.25.1</version>
</artifactItem>
</artifactItems>
</configuration>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ public String[] getFullyQualifiedName(String uri, int[] lines, int[] columns) th
return new String[0];
}

// Currently the highest version the debugger supports is Java SE 9 Edition (JLS9).
final ASTParser parser = ASTParser.newParser(AST.JLS9);
// Currently the highest version the debugger supports is JavaSE-13 Edition (JLS13).
final ASTParser parser = ASTParser.newParser(AST.JLS13);
parser.setResolveBindings(true);
parser.setBindingsRecovery(true);
parser.setStatementsRecovery(true);
Expand Down Expand Up @@ -122,9 +122,9 @@ public String[] getFullyQualifiedName(String uri, int[] lines, int[] columns) th
* the user need specify the compiler options explicitly.
*/
Map<String, String> javaOptions = JavaCore.getOptions();
javaOptions.put(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_9);
javaOptions.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_9);
javaOptions.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_9);
javaOptions.put(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_13);
javaOptions.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_13);
javaOptions.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_13);
parser.setCompilerOptions(javaOptions);
astUnit = (CompilationUnit) parser.createAST(null);
} else {
Expand Down
2 changes: 1 addition & 1 deletion com.microsoft.java.debug.repository/category.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<site>
<bundle id="com.microsoft.java.debug.plugin" version="0.25.0">
<bundle id="com.microsoft.java.debug.plugin" version="0.25.1">
<category name="javadebug" />
</bundle>
<category-def name="javadebug" label="Java Debug Server"/>
Expand Down
2 changes: 1 addition & 1 deletion com.microsoft.java.debug.repository/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.microsoft.java</groupId>
<artifactId>java-debug-parent</artifactId>
<version>0.25.0</version>
<version>0.25.1</version>
</parent>
<artifactId>com.microsoft.java.debug.repository</artifactId>
<packaging>eclipse-repository</packaging>
Expand Down
8 changes: 4 additions & 4 deletions java.debug.target
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@
<unit id="org.apache.commons.io" version="2.2.0.v201405211200"/>
<unit id="org.apache.commons.lang3" version="3.1.0.v201403281430"/>
<unit id="org.apache.log4j" version="1.2.15.v201012070815"/>
<repository location="http://download.eclipse.org/tools/orbit/R-builds/R20170516192513/repository"/>
<repository location="https://download.eclipse.org/tools/orbit/R-builds/R20170516192513/repository"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.xtend.sdk.feature.group" version="0.0.0"/>
<unit id="org.eclipse.xtext.sdk.feature.group" version="0.0.0"/>
<repository location="http://download.eclipse.org/releases/2019-06/"/>
<repository location="https://download.eclipse.org/releases/2019-12/"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.jboss.tools.maven.apt.core" version="0.0.0"/>
<repository location="http://download.jboss.org/jbosstools/updates/m2e-extensions/m2e-apt/1.5.2-2018-12-24_15-46-05-H18/"/>
<repository location="https://download.jboss.org/jbosstools/updates/m2e-extensions/m2e-apt/1.5.2-2018-12-24_15-46-05-H18/"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.jdt.ls.core" version="0.0.0"/>
<repository location="http://download.eclipse.org/jdtls/snapshots/repository/latest/"/>
<repository location="https://download.eclipse.org/jdtls/snapshots/repository/latest/"/>
</location>
</locations>
</target>
12 changes: 6 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<name>${base.name} :: Parent</name>
<description>The Java Debug Server is an implementation of Visual Studio Code (VSCode) Debug Protocol. It can be used in Visual Studio Code to debug Java programs.</description>
<url>https://github.com/Microsoft/java-debug</url>
<version>0.25.0</version>
<version>0.25.1</version>
<packaging>pom</packaging>
<properties>
<base.name>Java Debug Server for Visual Studio Code</base.name>
Expand Down Expand Up @@ -154,9 +154,9 @@
</profiles>
<repositories>
<repository>
<id>201906</id>
<id>201912</id>
<layout>p2</layout>
<url>http://download.eclipse.org/releases/2019-06/</url>
<url>https://download.eclipse.org/releases/2019-12/</url>
</repository>
<repository>
<id>oss.sonatype.org</id>
Expand All @@ -168,17 +168,17 @@
<repository>
<id>JDT.LS</id>
<layout>p2</layout>
<url>http://download.eclipse.org/jdtls/snapshots/repository/latest/</url>
<url>https://download.eclipse.org/jdtls/snapshots/repository/latest/</url>
</repository>
<repository>
<id>JBOLL.TOOLS</id>
<layout>p2</layout>
<url>http://download.jboss.org/jbosstools/updates/m2e-extensions/m2e-apt/1.5.0-2018-05-16_00-46-30-H11</url>
<url>https://download.jboss.org/jbosstools/updates/m2e-extensions/m2e-apt/1.5.0-2018-05-16_00-46-30-H11</url>
</repository>
<repository>
<id>orbit</id>
<layout>p2</layout>
<url>http://download.eclipse.org/tools/orbit/R-builds/R20170516192513/repository/</url>
<url>https://download.eclipse.org/tools/orbit/R-builds/R20170516192513/repository/</url>
</repository>
</repositories>
</project>

0 comments on commit 32f3a1f

Please sign in to comment.