artur-shaik / vim-javacomplete2

DEPRECATED in favor of jc.nvim
Vim License
973 stars 83 forks source link

Javacomplete does not find the methods on the original clase - gradle project #281

Closed alnavv closed 7 years ago

alnavv commented 7 years ago

Actual behavior (Required!)

Only methods from the original class, already used in the projects are find by javacomplete2.

Expected behavior (Required!)

For instance, if some class in an external library defines 3 methods (method_1, method_2, method_3), and two of them are already used in the project, calling javacomplete will have the following result:

object._method1 object._method2

and will never show method 3 (which is defined in the class but was not yet used in the project).

Following two pictures depicts that behaviour (comparing the output of nvim/javacomplete from intelliIDEA):

nvim idea

The steps to reproduce actual behavior (Required!)

  1. ...
  2. ...
  3. ...

Environment (Required!)

A few extra notes:

  1. The result of calling :JCclasspathGenerate is shown in picture Error.png error

  2. Creating a file java.gradle with the content allprojects{apply from: '.mypath/vim-javacomplete2/classpath.gradle'}, and calling: gradle -I gradle/java.gradle classpath has brings this output:

    
    The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
        at classpath_jh66c6sjidnabmsea63uoht7.run(/mypath/.config/nvim/plugged/vim-javacomplete2/classpath.gradle:1)

FAILURE: Build failed with an exception.

BUILD FAILED````

artur-shaik commented 7 years ago

@DonnieWest , can you participate, please.

DonnieWest commented 7 years ago

@alnavv can you please show us either the project you're getting this error on or a minimal project that replicates the error?

alnavv commented 7 years ago

@DonnieWest, unfortunately I cannot share anything related to the project itself. However we may find a way..., can you reach me by email?

DonnieWest commented 7 years ago

@alnavv Yeah, but if you can just create a separate project that replicates the error that will suffice as well. If you still need to conduct this over email though you can reach me at:

me at donniewest dot com

alnavv commented 7 years ago

I dont see any contact at : donniewest dot com, however in my git account is my gmail ...

DonnieWest commented 7 years ago

291 might help with this, but I encountered another issue while investigating that might be pertinent. The returned classpath from Gradle is occasionally empty and I don't know why. When run from the command line, the classpath task outputs something like this:

Incremental java compilation is an incubating feature.
The TaskInputs.source(Object) method has been deprecated and is scheduled to be removed in Gradle 4.0. Please use TaskInputs.file(Object).skipWhenEmpty() instead.
:classpath
CLASSPATH:/home/igneo676/.gradle/caches/modules-2/files-2.1/org.jacoco/org.jacoco.report/0.7.5.201505241946/cb1ac5562a45c98cd7b774452f3e8b867b71cd65/org.jacoco.report-0.7.5.201505241946.jar:/home/igneo676/android-sdk-linux/platforms/android-25/android.jar:/home/igneo676/.gradle/caches/modules-2/files-2.1/org.hamcrest/hamcrest-core/1.3/42a25dc3219429f0e5d060061f71acb49bf010a0/hamcrest-core-1.3.jar:/home/igneo676/.gradle/caches/modules-2/files-2.1/com.squareup/javawriter/2.1.1/67ff45d9ae02e583d0f9b3432a5ebbe05c30c966/javawriter-2.1.1.jar:/home/igneo676/Code/Dispatch/app/build/intermediates/exploded-aar/com.android.support/support-core-ui/25.0.0/jars/libs/internal_impl-25.0.0.jar:/home/igneo676/.gradle/caches/modules-2/files-2.1/com.google.code.findbugs/jsr305/2.0.1/516c03b21d50a644d538de0f0369c620989cd8f0/jsr305-2.0.1.jar:/home/igneo676/Code/Dispatch/app/build/intermediates/exploded-aar/com.android.support/support-v4/25.0.0/jars/classes.jar:/home/igneo676/Code/Dispatch/app/build/intermediates/exploded-aar/com.android.support/support-compat/25.0.0/jars/libs/internal_impl-25.0.0.jar:/home/igneo676/Code/Dispatch/app/build/intermediates/exploded-aar/com.android.support/support-fragment/25.0.0/jars/libs/internal_impl-25.0.0.jar:/home/igneo676/Code/Dispatch/app/build/intermediates/exploded-aar/com.android.support/support-core-ui/25.0.0/jars/classes.jar:/home/igneo676/Code/Dispatch/app/build/intermediates/exploded-aar/com.android.support/design/25.0.0/jars/classes.jar:/home/igneo676/.gradle/caches/modules-2/files-2.1/javax.annotation/javax.annotation-api/1.2/479c1e06db31c432330183f5cae684163f186146/javax.annotation-api-1.2.jar:/home/igneo676/Code/Dispatch/app/build/intermediates/exploded-aar/com.android.support/transition/25.0.0/jars/classes.jar:/home/igneo676/Code/Dispatch/app/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/25.0.0/jars/classes.jar:/home/igneo676/Code/Dispatch/app/build/intermediates/exploded-aar/com.android.support/support-media-compat/25.0.0/jars/libs/internal_impl-25.0.0.jar:/home/igneo676/.gradle/caches/modules-2/files-2.1/org.hamcrest/hamcrest-integration/1.3/5de0c73fef18917cd85d0ab70bb23818685e4dfd/hamcrest-integration-1.3.jar:/home/igneo676/.gradle/caches/modules-2/files-2.1/org.ow2.asm/asm-debug-all/5.0.1/f69b5f7d96cec0d448acf1c1a266584170c9643b/asm-debug-all-5.0.1.jar:/home/igneo676/Code/Dispatch/app/build/intermediates/classes/debug:/home/igneo676/android-sdk-linux/extras/android/m2repository/com/android/support/support-annotations/25.0.0/support-annotations-25.0.0.jar:/home/igneo676/Code/Dispatch/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/25.0.0/jars/classes.jar:/home/igneo676/.gradle/caches/modules-2/files-2.1/junit/junit/4.12/2973d150c0dc1fefe998f834810d68f278ea58ec/junit-4.12.jar:/home/igneo676/Code/Dispatch/app/build/intermediates/exploded-aar/com.android.support/animated-vector-drawable/25.0.0/jars/classes.jar:/home/igneo676/Code/Dispatch/app/build/intermediates/exploded-aar/com.android.support/support-compat/25.0.0/jars/classes.jar:/home/igneo676/.gradle/caches/modules-2/files-2.1/org.jacoco/org.jacoco.ant/0.7.5.201505241946/929ea3871a1f11e63b86f092061141cd7c790c9/org.jacoco.ant-0.7.5.201505241946.jar:/home/igneo676/.gradle/caches/modules-2/files-2.1/org.hamcrest/hamcrest-library/1.3/4785a3c21320980282f9f33d0d1264a69040538f/hamcrest-library-1.3.jar:/home/igneo676/Code/Dispatch/app/build/intermediates/exploded-aar/com.android.support/support-core-utils/25.0.0/jars/classes.jar:/home/igneo676/.gradle/caches/modules-2/files-2.1/org.jacoco/org.jacoco.core/0.7.5.201505241946/1ea906dc5201d2a1bc0604f8650534d4bcaf4c95/org.jacoco.core-0.7.5.201505241946.jar:/home/igneo676/Code/Dispatch/app/build/intermediates/exploded-aar/com.android.support/support-fragment/25.0.0/jars/classes.jar:/home/igneo676/Code/Dispatch/app/build/intermediates/exploded-aar/com.android.support/support-media-compat/25.0.0/jars/classes.jar:/home/igneo676/.gradle/caches/modules-2/files-2.1/javax.inject/javax.inject/1/6975da39a7040257bd51d21a231b76c915872d38/javax.inject-1.jar:/home/igneo676/Code/Dispatch/app/build/intermediates/exploded-aar/com.android.support/support-core-utils/25.0.0/jars/libs/internal_impl-25.0.0.jar:/home/igneo676/Code/Dispatch/app/build/intermediates/exploded-aar/com.android.support/support-vector-drawable/25.0.0/jars/classes.jar:/home/igneo676/.gradle/caches/modules-2/files-2.1/org.jacoco/org.jacoco.agent/0.7.5.201505241946/2f0308aaf7b3f2e133d410de8af49739cb0964aa/org.jacoco.agent-0.7.5.201505241946.jar

BUILD SUCCESSFUL

Total time: 0.863 secs

However, whenever I log out the output of the command from within the classpath/gradle.vim file I get

:classpath
CLASSPATH:
BUILD SUCCESSFUL
Total time: 0.691 secs

It's as if some of the output is getting filtered by something.

I've created a sample project that does this here

  1. You can replicate the issue by running :JCclasspathGenerate in vim, closing the editor, reopening the project and running it again. The classpath (occasionally) will be something like ..: as opposed to a full classpath as is originally generated.
  2. You can test the command line output by changing the init.gradle file to the location of your vim-javacomplete2's classpath.gradle file and running ./gradlew -I init.gradle classpath

Any ideas @artur-shaik ? I'm not really sure what's filtering this output

artur-shaik commented 7 years ago

I played, a little bit with your project. So, I've got this issue only when I open vim not in Dispatch directory.

Do you have empty output, even when you in git root?

artur-shaik commented 7 years ago

@DonnieWest , I made some changes, can you test it here: https://github.com/artur-shaik/vim-javacomplete2/tree/DonnieWest-gradleFixes ?

DonnieWest commented 7 years ago

@artur-shaik works perfectly! Good find on the directory, I can't believe I missed that :)

Thanks!

artur-shaik commented 7 years ago

Closed by 02076042992b564d42ce817e45d93c3c167acd61