Closed richox closed 8 years ago
tested on two different machine, always happen.
package com.xiaoju.sparksql;
import scala.Tuple3;
public class Main {
public static void main(String[] args) {
Tuple3<String, Long, Long> tuple;
tuple.
}
}
completion for tuple3 is OK, strange.
completion for Tuple4 not works (no popup menu at all) but won't hang. strange too.
@richox is it same as https://github.com/artur-shaik/vim-javacomplete2/issues/180 ?
@wsdjeg i don't think they are the same problem. this issue happens without generic.
Tuple2 a;
a.
will also hang.
where is Tuple2 comes from ,I can not import this class.
@wsdjeg Tuple2 comes from scala-library-2.10.2.jar
I know ,but I can not complete after import scala.
EDIT: mvn compile success
I still can not complete the import statement,
no result after import scala.
scala.
Context: 3
DotExpr: scala.
Communicate: -E "scala" [s:GetMembers for static]
Communicate: -p "scala" [s:DoGetInfoByReflection]
{}
@wsdjeg , check if you have jars in ~/.m2/repository/org/scala-lang
I had the same problem, those directories were empty. I removed them, made mvn verify
, and clean jc2 cache.
I think I have download the necessary jars
I think the problem is not fully fixed, now completion for Tuple2 works, but Tuple3, Tuple4, ... still hang. completion for SparkConf also hang: http://pan.baidu.com/s/1dDZk3sP
Strange, but I have it worked. All tuples and SparkConf
give me completions.
May be you need clear jc2 cache in ~/.cache/javacomplete2/
?
here is my pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.wsdjeg.javalibs</groupId>
<artifactId>JavaLibs</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>JavaLibs</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-core_2.11</artifactId>
<version>1.6.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
and here is my App.java
package com.wsdjeg.javalibs;
import scala.Tuple3;
/**
* Hello world!
*
*/
public class App
{
public static void main( String[] args )
{
System.out.println( "Hello World!" );
Tuple3 s;
}
}
I can use mvn clean compile
,but I can not complete after import scala.
also java check show no error
@wsdjeg, can you look, if you have path to scala lib in classpath cache?
I think g:JavaComplete_LibsPath
contains all the needed jars,because my plugin JavaUnit.vim works well ,and it use g:JavaComplete_LibsPath
as classpath.
@wsdjeg but can you just check, what scala libraries you have in ~/.cache/javacomplete2/classpath/cachefile
?
@artur-shaik I cleared the cache and still have the problem.
it's strange that the problem happens only on some specified class, for example completion works for SparkContext
but hangs for SparkConf
@richox by the way, there was some changes in java lib, have you recompiled it?
@artur-shaik I remove the plugin and cache, then reinstall it from scratch, now:
completion for SparkConf
works
completion for Tuple2
works
completion for Tuple3
works
completion for Tuple2<Object, Object>
works
completion for Tuple3<Object, Object, Object>
Pattern not found
@richox can you complete after import scala._
@wsdjeg yes i can
@artur-shaik it was my fault, completion for Tuple3<Object, Object, Object>
does not hang but reports "Pattern not found"
Ok, some more fixes. Please, recompile javavi, before test.
still can not complete after import scala.
;
I hava update jc2 and recompile ,alse delete the ~/.cache/javacomplete2, restart vim
my ~/.cache/javacomplete2/ contains this files
and the pom_xml is
/home/wsdjeg/.m2/repository/com/esotericsoftware/kryo/kryo/2.21/kryo-2.21.jar:/home/wsdjeg/.m2/repository/org/apache/hadoop/hadoop-mapreduce-client-jobclient/2.2.0/hadoop-mapreduce-client-jobclient-2.2.0.jar:/home/wsdjeg/.m2/repository/org/glassfish/grizzly/grizzly-http/2.1.2/grizzly-http-2.1.2.jar:/home/wsdjeg/.m2/repository/org/slf4j/slf4j-log4j12/1.7.10/slf4j-log4j12-1.7.10.jar:/home/wsdjeg/.m2/repository/io/dropwizard/metrics/metrics-core/3.1.2/metrics-core-3.1.2.jar:/home/wsdjeg/.m2/repository/com/google/protobuf/protobuf-java/2.5.0/protobuf-java-2.5.0.jar:/home/wsdjeg/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar:/home/wsdjeg/.m2/repository/org/scala-lang/scala-reflect/2.11.2/scala-reflect-2.11.2.jar:/home/wsdjeg/.m2/repository/net/razorvine/pyrolite/4.9/pyrolite-4.9.jar:/home/wsdjeg/.m2/repository/com/sun/jersey/jersey-json/1.9/jersey-json-1.9.jar:/home/wsdjeg/.m2/repository/io/dropwizard/metrics/metrics-jvm/3.1.2/metrics-jvm-3.1.2.jar:/home/wsdjeg/.m2/repository/org/tachyonproject/tachyon-client/0.8.2/tachyon-client-0.8.2.jar:/home/wsdjeg/.m2/repository/org/apache/hadoop/hadoop-client/2.2.0/hadoop-client-2.2.0.jar:/home/wsdjeg/.m2/repository/com/typesafe/akka/akka-slf4j_2.11/2.3.11/akka-slf4j_2.11-2.3.11.jar:/home/wsdjeg/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.4.4/jackson-databind-2.4.4.jar:/home/wsdjeg/.m2/repository/com/esotericsoftware/minlog/minlog/1.2/minlog-1.2.jar:/home/wsdjeg/.m2/repository/org/fusesource/leveldbjni/leveldbjni-all/1.8/leveldbjni-all-1.8.jar:/home/wsdjeg/.m2/repository/org/glassfish/grizzly/grizzly-rcm/2.1.2/grizzly-rcm-2.1.2.jar:/home/wsdjeg/.m2/repository/io/dropwizard/metrics/metrics-json/3.1.2/metrics-json-3.1.2.jar:/home/wsdjeg/.m2/repository/net/java/dev/jets3t/jets3t/0.7.1/jets3t-0.7.1.jar:/home/wsdjeg/.m2/repository/org/scala-lang/scala-compiler/2.11.0/scala-compiler-2.11.0.jar:/home/wsdjeg/.m2/repository/org/apache/hadoop/hadoop-common/2.2.0/hadoop-common-2.2.0.jar:/home/wsdjeg/.m2/repository/com/google/inject/guice/3.0/guice-3.0.jar:/home/wsdjeg/.m2/repository/net/sf/py4j/py4j/0.9/py4j-0.9.jar:/home/wsdjeg/.m2/repository/commons-io/commons-io/2.4/commons-io-2.4.jar:/home/wsdjeg/.m2/repository/javax/servlet/javax.servlet-api/3.0.1/javax.servlet-api-3.0.1.jar:/home/wsdjeg/.m2/repository/org/eclipse/jetty/orbit/javax.servlet/3.0.0.v201112011016/javax.servlet-3.0.0.v201112011016.jar:/home/wsdjeg/.m2/repository/org/slf4j/jul-to-slf4j/1.7.10/jul-to-slf4j-1.7.10.jar:/home/wsdjeg/.m2/repository/com/sun/jersey/jersey-core/1.9/jersey-core-1.9.jar:/home/wsdjeg/.m2/repository/org/scala-lang/modules/scala-xml_2.11/1.0.1/scala-xml_2.11-1.0.1.jar:/home/wsdjeg/.m2/repository/org/glassfish/gmbal/gmbal-api-only/3.0.0-b023/gmbal-api-only-3.0.0-b023.jar:/home/wsdjeg/.m2/repository/org/apache/hadoop/hadoop-auth/2.2.0/hadoop-auth-2.2.0.jar:/home/wsdjeg/.m2/repository/org/codehaus/jackson/jackson-core-asl/1.9.13/jackson-core-asl-1.9.13.jar:/home/wsdjeg/.m2/repository/org/tachyonproject/tachyon-underfs-local/0.8.2/tachyon-underfs-local-0.8.2.jar:/home/wsdjeg/.m2/repository/com/sun/jersey/jersey-test-framework/jersey-test-framework-core/1.9/jersey-test-framework-core-1.9.jar:/home/wsdjeg/.m2/repository/net/jpountz/lz4/lz4/1.3.0/lz4-1.3.0.jar:/home/wsdjeg/.m2/repository/com/sun/jersey/contribs/jersey-guice/1.9/jersey-guice-1.9.jar:/home/wsdjeg/.m2/repository/org/apache/hadoop/hadoop-yarn-client/2.2.0/hadoop-yarn-client-2.2.0.jar:/home/wsdjeg/.m2/repository/org/tachyonproject/tachyon-underfs-hdfs/0.8.2/tachyon-underfs-hdfs-0.8.2.jar:/home/wsdjeg/.m2/repository/com/sun/jersey/jersey-client/1.9/jersey-client-1.9.jar:/home/wsdjeg/.m2/repository/io/netty/netty/3.8.0.Final/netty-3.8.0.Final.jar:/home/wsdjeg/.m2/repository/org/apache/mesos/mesos/0.21.1/mesos-0.21.1-shaded-protobuf.jar:/home/wsdjeg/.m2/repository/org/glassfish/external/management-api/3.0.0-b012/management-api-3.0.0-b012.jar:/home/wsdjeg/.m2/repository/com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.jar:/home/wsdjeg/.m2/repository/jline/jline/0.9.94/jline-0.9.94.jar:/home/wsdjeg/.m2/repository/org/glassfish/grizzly/grizzly-http-server/2.1.2/grizzly-http-server-2.1.2.jar:/home/wsdjeg/.m2/repository/javax/xml/bind/jaxb-api/2.2.2/jaxb-api-2.2.2.jar:/home/wsdjeg/.m2/repository/commons-codec/commons-codec/1.3/commons-codec-1.3.jar:/home/wsdjeg/.m2/repository/com/twitter/chill_2.11/0.5.0/chill_2.11-0.5.0.jar:/home/wsdjeg/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar:/home/wsdjeg/.m2/repository/org/codehaus/jackson/jackson-jaxrs/1.8.3/jackson-jaxrs-1.8.3.jar:/home/wsdjeg/.m2/repository/javax/activation/activation/1.1/activation-1.1.jar:/home/wsdjeg/.m2/repository/org/xerial/snappy/snappy-java/1.1.2/snappy-java-1.1.2.jar:/home/wsdjeg/.m2/repository/org/tukaani/xz/1.0/xz-1.0.jar:/home/wsdjeg/.m2/repository/asm/asm/3.1/asm-3.1.jar:/home/wsdjeg/.m2/repository/org/apache/curator/curator-recipes/2.4.0/curator-recipes-2.4.0.jar:/home/wsdjeg/.m2/repository/com/google/guava/guava/14.0.1/guava-14.0.1.jar:/home/wsdjeg/.m2/repository/com/typesafe/config/1.2.1/config-1.2.1.jar:/home/wsdjeg/.m2/repository/org/apache/ivy/ivy/2.4.0/ivy-2.4.0.jar:/home/wsdjeg/.m2/repository/javax/inject/javax.inject/1/javax.inject-1.jar:/home/wsdjeg/.m2/repository/org/apache/hadoop/hadoop-mapreduce-client-core/2.2.0/hadoop-mapreduce-client-core-2.2.0.jar:/home/wsdjeg/.m2/repository/org/glassfish/grizzly/grizzly-http-servlet/2.1.2/grizzly-http-servlet-2.1.2.jar:/home/wsdjeg/.m2/repository/commons-beanutils/commons-beanutils-core/1.8.0/commons-beanutils-core-1.8.0.jar:/home/wsdjeg/.m2/repository/org/apache/commons/commons-math3/3.4.1/commons-math3-3.4.1.jar:/home/wsdjeg/.m2/repository/org/apache/avro/avro/1.7.7/avro-1.7.7.jar:/home/wsdjeg/.m2/repository/org/glassfish/grizzly/grizzly-framework/2.1.2/grizzly-framework-2.1.2.jar:/home/wsdjeg/.m2/repository/org/apache/hadoop/hadoop-mapreduce-client-common/2.2.0/hadoop-mapreduce-client-common-2.2.0.jar:/home/wsdjeg/.m2/repository/org/json4s/json4s-core_2.11/3.2.10/json4s-core_2.11-3.2.10.jar:/home/wsdjeg/.m2/repository/oro/oro/2.0.8/oro-2.0.8.jar:/home/wsdjeg/.m2/repository/org/apache/spark/spark-network-common_2.11/1.6.0/spark-network-common_2.11-1.6.0.jar:/home/wsdjeg/.m2/repository/stax/stax-api/1.0.1/stax-api-1.0.1.jar:/home/wsdjeg/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.4.4/jackson-annotations-2.4.4.jar:/home/wsdjeg/.m2/repository/org/roaringbitmap/RoaringBitmap/0.5.11/RoaringBitmap-0.5.11.jar:/home/wsdjeg/.m2/repository/org/scala-lang/scalap/2.11.0/scalap-2.11.0.jar:/home/wsdjeg/.m2/repository/log4j/log4j/1.2.17/log4j-1.2.17.jar:/home/wsdjeg/.m2/repository/com/sun/jersey/jersey-test-framework/jersey-test-framework-grizzly2/1.9/jersey-test-framework-grizzly2-1.9.jar:/home/wsdjeg/.m2/repository/org/codehaus/jackson/jackson-xc/1.8.3/jackson-xc-1.8.3.jar:/home/wsdjeg/.m2/repository/org/apache/curator/curator-client/2.4.0/curator-client-2.4.0.jar:/home/wsdjeg/.m2/repository/commons-lang/commons-lang/2.4/commons-lang-2.4.jar:/home/wsdjeg/.m2/repository/org/apache/commons/commons-compress/1.4.1/commons-compress-1.4.1.jar:/home/wsdjeg/.m2/repository/com/sun/xml/bind/jaxb-impl/2.2.3-1/jaxb-impl-2.2.3-1.jar:/home/wsdjeg/.m2/repository/org/apache/hadoop/hadoop-mapreduce-client-app/2.2.0/hadoop-mapreduce-client-app-2.2.0.jar:/home/wsdjeg/.m2/repository/org/apache/xbean/xbean-asm5-shaded/4.4/xbean-asm5-shaded-4.4.jar:/home/wsdjeg/.m2/repository/org/objenesis/objenesis/1.2/objenesis-1.2.jar:/home/wsdjeg/.m2/repository/org/mortbay/jetty/jetty-util/6.1.26/jetty-util-6.1.26.jar:/home/wsdjeg/.m2/repository/org/apache/hadoop/hadoop-yarn-server-common/2.2.0/hadoop-yarn-server-common-2.2.0.jar:/home/wsdjeg/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.4.4/jackson-core-2.4.4.jar:/home/wsdjeg/.m2/repository/com/fasterxml/jackson/module/jackson-module-scala_2.11/2.4.4/jackson-module-scala_2.11-2.4.4.jar:/home/wsdjeg/.m2/repository/org/apache/hadoop/hadoop-hdfs/2.2.0/hadoop-hdfs-2.2.0.jar:/home/wsdjeg/.m2/repository/org/codehaus/jackson/jackson-mapper-asl/1.9.13/jackson-mapper-asl-1.9.13.jar:/home/wsdjeg/.m2/repository/org/apache/hadoop/hadoop-yarn-api/2.2.0/hadoop-yarn-:/home/wsdjeg/sources/JavaLibs/target/classes:/home/wsdjeg/sources/JavaLibs/target/test-classes
I found there is no scala-library
@wsdjeg, yeah, and those Tuples live in scala-library
. I don't know why maven doesn't download this library sometimes. I had the same issue, then I cleared maven repository's directory org/scala/
and builded project. After that maven downloaded all libs.
ok I try it again,but can you show me your test pom.xml
?
@artur-shaik now completion for Tuple3<Object, Object, Object>
works! thanks veryMuch
still can not work,still has no scala-library in g:JavaComplete_libpath
@richox, thank you for bugs report.
@wsdjeg, here is it:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>kg.test</groupId>
<artifactId>kg.test</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>kg.test</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-core_2.11</artifactId>
<version>1.6.0</version>
</dependency>
</dependencies>
</project>
:sob: still can not complete after import scala.
and what is the out put of
tree ~/.m2/repository/org/scala-lang -L 3
/home/ash/.m2/repository/org/scala-lang
├── modules
│ ├── scala-parser-combinators_2.11
│ │ └── 1.0.1
│ └── scala-xml_2.11
│ └── 1.0.1
├── scala-compiler
│ └── 2.11.0
│ ├── _remote.repositories
│ ├── scala-compiler-2.11.0.jar
│ ├── scala-compiler-2.11.0.jar.sha1
│ ├── scala-compiler-2.11.0.pom
│ └── scala-compiler-2.11.0.pom.sha1
├── scala-library
│ ├── 2.11.0
│ │ ├── _remote.repositories
│ │ ├── scala-library-2.11.0.pom
│ │ └── scala-library-2.11.0.pom.sha1
│ ├── 2.11.2
│ │ ├── _remote.repositories
│ │ ├── scala-library-2.11.2.pom
│ │ └── scala-library-2.11.2.pom.sha1
│ ├── 2.11.5
│ │ ├── _remote.repositories
│ │ ├── scala-library-2.11.5.pom
│ │ └── scala-library-2.11.5.pom.sha1
│ └── 2.11.7
│ ├── _remote.repositories
│ ├── scala-library-2.11.7.jar
│ ├── scala-library-2.11.7.jar.sha1
│ ├── scala-library-2.11.7.pom
│ └── scala-library-2.11.7.pom.sha1
├── scalap
│ └── 2.11.0
│ ├── _remote.repositories
│ ├── scalap-2.11.0.jar
│ ├── scalap-2.11.0.jar.sha1
│ ├── scalap-2.11.0.pom
│ └── scalap-2.11.0.pom.sha1
└── scala-reflect
├── 2.11.0
│ ├── _remote.repositories
│ ├── scala-reflect-2.11.0.pom
│ └── scala-reflect-2.11.0.pom.sha1
└── 2.11.2
├── _remote.repositories
├── scala-reflect-2.11.2.jar
├── scala-reflect-2.11.2.jar.sha1
├── scala-reflect-2.11.2.pom
└── scala-reflect-2.11.2.pom.sha1
17 directories, 32 files
just same as mine,really do not know why I can not complete after that
can you show me the ~/.cache/javacomplete2/classpath/path to your pom_xml
,I will compare your with mine
@wsdjeg, can you run this command:
mvn --file pom.xml help:effective-pom dependency:build-classpath -DincludeScope=test
and look for dependencies classpath.
this contains scala-library
but the ~/.cache/javacomplete2/classpath/path to your pom_xml
has no ,I do not know why.
you can see my last commens for the pom_xml
hdfs/2.2.0/hadoop-hdfs-2.2.0.jar:/home/wsdjeg/.m2/repository/org/codehaus/jackson/jackson-mapper-asl/1.9.13/jackson-mapper-asl-1.9.13.jar:/home/wsdjeg/.m2/repository/org/apache/hadoop/hadoop-yarn-api/2.2.0/hadoop-yarn-:/home/wsdjeg/sources/JavaLibs/target/classes:/home/wsdjeg/sources/JavaLibs/target/test-classes
the file miss the jars after yarn-api/2.2.0/hadoop-yarn-
Ok I got it,it is the issue of neovim not this plugin,now vim works well,but neovim miss many jars and I will report it to neovim group
Hm, what is the reason of this issue?
because the neovim missed the stdout date of mvn classpath,and do not write it into cache file.
missed after yarn-api/2.2.0/hadoop-yarn-
@artur-shaik another problem, after applying the newest fixes, completion for Map.Entry<Object, Object>
broken (reports "Pattern not found")
you see it only has 8346 chars when i use vim create the cache it has 12488 chars
@wsdjeg ok, now I see. @richox, looks like this one is old issue. It doesn't work for me even if I rollback.
@richox will open another issue.
@artur-shaik I have fix this issue for neovim,should I open the PR,but I think it is not the best selution.
diff --git a/autoload/javacomplete/classpath/maven.vim b/autoload/javacomplete/classpath/maven.vim
index d747b57..fb1092b 100644
--- a/autoload/javacomplete/classpath/maven.vim
+++ b/autoload/javacomplete/classpath/maven.vim
@@ -49,6 +49,9 @@ function! s:ParseMavenOutput()
for i in range(len(s:mavenSettingsOutput))
if s:mavenSettingsOutput[i] =~ 'Dependencies classpath:'
let mvnProperties['project.dependencybuildclasspath'] = s:mavenSettingsOutput[i + 1]
+ if s:mavenSettingsOutput[i+2] !~ '^[\w*'
+ let mvnProperties['project.dependencybuildclasspath'] .= s:mavenSettingsOutput[i + 2]
+ endif
endif
let matches = matchlist(s:mavenSettingsOutput[i], '\m^\s*<\([a-zA-Z0-9\-\.]\+\)>\s*$')
if mvnIsManagedTag && !empty(matches)
Yeah, you can create PR, I will look closer...
I hava opened
code:
log:
maven dependency: