eclipse-che / che

Kubernetes based Cloud Development Environments for Enterprise Teams
http://eclipse.org/che
Eclipse Public License 2.0
6.99k stars 1.19k forks source link

Upgrade dto generator mojo to support LSP4J 0.4.0 #8304

Closed jonahgraham closed 6 years ago

jonahgraham commented 6 years ago

Description

When trying to use newer (e.g. pre-release 0.4.0) LSP4J the generator fails like below. I need a newer version to support #5508.

[ERROR] Failed to execute goal org.eclipse.che.core:che-core-api-languageserver-maven-plugin:6.0.0-M5-SNAPSHOT:generate (default) on project che-plugin-languageserver-ide: A type incompatibility occurred while executing org.eclipse.che.core:che-core-api-languageserver-maven-plugin:6.0.0-M5-SNAPSHOT:generate: java.lang.Class cannot be cast to java.lang.reflect.ParameterizedType [ERROR] ----------------------------------------------------- [ERROR] realm = plugin>org.eclipse.che.core:che-core-api-languageserver-maven-plugin:6.0.0-M5-SNAPSHOT [ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy [ERROR] urls[0] = file:/home/jonah/.m2/repository/org/eclipse/che/core/che-core-api-languageserver-maven-plugin/6.0.0-M5-SNAPSHOT/che-core-api-languageserver-maven-plugin-6.0.0-M5-SNAPSHOT.jar [ERROR] urls[1] = file:/home/jonah/.m2/repository/org/eclipse/che/core/che-core-api-languageserver-shared/6.0.0-M5-SNAPSHOT/che-core-api-languageserver-shared-6.0.0-M5-SNAPSHOT.jar [ERROR] urls[2] = file:/home/jonah/.m2/repository/org/eclipse/lsp4j/org.eclipse.lsp4j/0.4.0-SNAPSHOT/org.eclipse.lsp4j-0.4.0-SNAPSHOT.jar [ERROR] urls[3] = file:/home/jonah/.m2/repository/org/eclipse/lsp4j/org.eclipse.lsp4j.generator/0.4.0-SNAPSHOT/org.eclipse.lsp4j.generator-0.4.0-SNAPSHOT.jar [ERROR] urls[4] = file:/home/jonah/.m2/repository/org/eclipse/xtend/org.eclipse.xtend.lib/2.14.0-SNAPSHOT/org.eclipse.xtend.lib-2.14.0-SNAPSHOT.jar [ERROR] urls[5] = file:/home/jonah/.m2/repository/org/eclipse/xtext/org.eclipse.xtext.xbase.lib/2.10.0/org.eclipse.xtext.xbase.lib-2.10.0.jar [ERROR] urls[6] = file:/home/jonah/.m2/repository/org/eclipse/xtend/org.eclipse.xtend.lib.macro/2.14.0-SNAPSHOT/org.eclipse.xtend.lib.macro-2.14.0-SNAPSHOT.jar [ERROR] urls[7] = file:/home/jonah/.m2/repository/com/google/guava/guava/20.0/guava-20.0.jar [ERROR] urls[8] = file:/home/jonah/.m2/repository/org/codehaus/plexus/plexus-utils/3.0.20/plexus-utils-3.0.20.jar [ERROR] urls[9] = file:/home/jonah/.m2/repository/javax/enterprise/cdi-api/1.0/cdi-api-1.0.jar [ERROR] urls[10] = file:/home/jonah/.m2/repository/org/eclipse/sisu/org.eclipse.sisu.inject/0.3.0/org.eclipse.sisu.inject-0.3.0.jar [ERROR] urls[11] = file:/home/jonah/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar [ERROR] urls[12] = file:/home/jonah/.m2/repository/org/eclipse/lsp4j/org.eclipse.lsp4j.jsonrpc/0.4.0-SNAPSHOT/org.eclipse.lsp4j.jsonrpc-0.4.0-SNAPSHOT.jar [ERROR] urls[13] = file:/home/jonah/.m2/repository/com/google/code/gson/gson/2.8.2/gson-2.8.2.jar [ERROR] urls[14] = file:/home/jonah/.m2/repository/org/reflections/reflections/0.9.9/reflections-0.9.9.jar [ERROR] urls[15] = file:/home/jonah/.m2/repository/org/javassist/javassist/3.22.0-GA/javassist-3.22.0-GA.jar [ERROR] Number of foreign imports: 1 [ERROR] import: Entry[import from realm ClassRealm[project>org.eclipse.che.plugin:che-plugin-languageserver-ide:6.0.0-M5-SNAPSHOT, parent: ClassRealm[maven.api, parent: null]]] [ERROR] [ERROR] ----------------------------------------------------- [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException

jonahgraham commented 6 years ago

PS I am working on this.

jonahgraham commented 6 years ago

The failure is the assumption that if a type is a collection, that the collection is parameterized. However the FormattingOptions in LSP4J actually extends a Map, so it is no a ParameterizedType. See https://github.com/eclipse/lsp4j/issues/99#issuecomment-313330347 for when the change was made to LSP4J.