artur-shaik / vim-javacomplete2

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

deoplete throws an exception, possibly due to vim-javacomplete2 #443

Closed NobodyXu closed 3 years ago

NobodyXu commented 3 years ago

Warning: I will close the issue without the minimal init.vim and the reproduction instructions.

Problems summary

After I installed artur-shaik/vim-javacomplete2, nvim often stops me in the middle of editing file due to an exception in python.

Expected

No exception should happen.

Environment Information

git commit 7c781f4a887719e1785b3f0c4d8087d99d201e06

Linux pop-os 5.4.0-7642-generic #46~1598628707~20.04~040157c-Ubuntu SMP Fri Aug 28 18:02:16 UTC  x86_64 x86_64 x86_64 GNU/Linux
:version                                                                                                                                                                                                                                       
NVIM v0.4.3                                                                                                                                                                                                                                    
Build type: Release                                                                                                                                                                                                                            
LuaJIT 2.1.0-beta3                                                                                                                                                                                                                             
Compilation: /usr/bin/cc -g -O2 -fdebug-prefix-map=/build/neovim-gOb7vg/neovim-0.4.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=1 -DDISABLE_LOG -Wdate-time -D_FORTIFY_SOURCE=1 -O2 -DNDEBUG -DM
IN_LOG_LEVEL=3 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fdiagnostics-color=always -DINCLUDE_GENERATED_DEC
LARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -I/build/neovim-gOb7vg/neovim-0.4.3/build/config -I/build/neovim-gOb7vg/neovim-0.4.3/src -I/usr/include -I/usr/include/lua5.1 -I/build/neovim-gOb7vg/neovim-0.4.3/
build/src/nvim/auto -I/build/neovim-gOb7vg/neovim-0.4.3/build/include                                                                                                                                                                          
Compiled by team+vim@tracker.debian.org                                                                                                                                                                                                        

Features: +acl +iconv +tui                                                                                                                                                                                                                     
See ":help feature-compile"                                                                                                                                                                                                                    

   system vimrc file: "$VIM/sysinit.vim"                                                                                                                                                                                                       
  fall-back for $VIM: "/usr/share/nvim"                                                                                                                                                                                                        

Run :checkhealth for more info                                                                                                                                                                                                                 

health#deoplete#check
========================================================================
## deoplete.nvim
  - OK: exists("v:t_list") was successful
  - OK: has("timers") was successful
  - OK: has("python3") was successful
  - OK: Require Python 3.6.1+ was successful
  - ERROR: Require msgpack 1.0.0+ was not successful
    - ADVICE:
      - Please install/upgrade msgpack 1.0.0+.
  - INFO: If you're still having problems, try the following commands:
    - $ export NVIM_PYTHON_LOG_FILE=/tmp/log
    - $ export NVIM_PYTHON_LOG_LEVEL=DEBUG
    - $ nvim
    - $ cat /tmp/log_{PID}
    - and then create an issue on github

health#nvim#check
========================================================================
## Configuration
  - OK: no issues found

## Performance
  - OK: Build type: Release

## Remote Plugins
  - OK: Up to date

## terminal
  - INFO: key_backspace (kbs) terminfo entry: key_backspace=^H
  - INFO: key_dc (kdch1) terminfo entry: key_dc=\E[3~
  - INFO: $VTE_VERSION='6003'
  - INFO: $COLORTERM='truecolor'

## tmux
  - OK: escape-time: 10ms
  - INFO: $TERM: screen-256color
  - WARNING: Neither Tc nor RGB capability set. True colors are disabled. |'termguicolors'| won't work properly.
    - ADVICE:
      - Put this in your ~/.tmux.conf and replace XXX by your $TERM outside of tmux:
          set-option -sa terminal-overrides ',XXX:RGB'
      - For older tmux versions use this instead:
          set-option -ga terminal-overrides ',XXX:Tc'

health#provider#check
========================================================================
## Clipboard (optional)
  - OK: Clipboard tool found: xclip

## Python 2 provider (optional)
  - WARNING: No Python executable found that can `import neovim`. Using the first available executable for diagnostics.
  - ERROR: Python provider error:
    - ADVICE:
      - provider/pythonx: Could not load Python 2:
          /usr/bin/python2 does not have the "neovim" module. :help |provider-python|
          /usr/bin/python2.7 does not have the "neovim" module. :help |provider-python|
          python2.6 not found in search path or not executable.
          /usr/bin/python does not have the "neovim" module. :help |provider-python|
  - INFO: Executable: Not found

## Python 3 provider (optional)
  - INFO: `g:python3_host_prog` is not set.  Searching for python3 in the environment.
  - INFO: Multiple python3 executables found.  Set `g:python3_host_prog` to avoid surprises.
  - INFO: Executable: /usr/bin/python3
  - INFO: Other python executable: /bin/python3
  - INFO: Python version: 3.8.5
  - INFO: pynvim version: 0.4.1 (outdated; from /usr/lib/python3/dist-packages/neovim)
  - WARNING: Latest pynvim is NOT installed: 0.4.2

## Ruby provider (optional)
  - INFO: Ruby: ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux-gnu]
  - WARNING: `neovim-ruby-host` not found.
    - ADVICE:
      - Run `gem install neovim` to ensure the neovim RubyGem is installed.
      - Run `gem environment` to ensure the gem bin directory is in $PATH.
      - If you are using rvm/rbenv/chruby, try "rehashing".
      - See :help |g:ruby_host_prog| for non-standard gem installations.

## Node.js provider (optional)
  - INFO: Node.js: v10.19.0
  - WARNING: Missing "neovim" npm (or yarn) package.
    - ADVICE:
      - Run in shell: npm install -g neovim
      - Run in shell (if you use yarn): yarn global add neovim

Provide a minimal init.vim/vimrc with less than 50 lines (Required!)

" Basic configurations
" Indentation
set expandtab
set tabstop=4
set shiftwidth=4
"set autoindent
set smartindent

set ruler
set number       " Show the lin number
set laststatus=2 " Always show status line

set termguicolors

" Change current dir automatically to current opened file
set autochdir "" This is nvi internal variable

" Map terminal esc to esc
tnoremap <Esc> <C-\><C-n>

if has('nvim')
  let $GIT_EDITOR = 'nvr -cc split --remote-wait'
endif

autocmd FileType gitcommit,gitrebase,gitconfig set bufhidden=delete

" Enable completion where available.
" This setting must be set before ALE is loaded
let g:ale_competion_enabled = 1

call plug#begin('~/.local/share/nvim/plugged')

Plug 'artur-shaik/vim-javacomplete2'

if has('nvim')
  Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
else
  Plug 'Shougo/deoplete.nvim'
  Plug 'roxma/nvim-yarp'
  Plug 'roxma/vim-hug-neovim-rpc'
endif

" This plugin is a supplicant for deoplete.nvim
" It shows function signature during completion
Plug 'Shougo/echodoc.vim'

Plug 'Shougo/deoplete-clangx'

" vim-javacomplete2 configurations
autocmd FileType java setlocal omnifunc=javacomplete#Complete
let g:JavaComplete_EnableDefaultMappings = 0
let g:JavaComplete_ClosingBrace = 1

call plug#end()

" Shougo/deoplete-clangx configuration
call deoplete#custom#var('clangx', 'default_c_options', "-std=c11 -Wall")
call deoplete#custom#var('clangx', 'default_cpp_options', "-std=c++17 -Wall")

" shougo/deoplete.nvim configuration
let g:deoplete#enable_at_startup = 1

" Shougo/echodoc.vim configuration
let g:echodoc#enable_at_startup = 1
"" use neovim's virtual virtual text feature.
let g:echodoc#type = 'virtual'

How to reproduce the problem from neovim/Vim startup (Required!)

Use nvim to edit java managed by gradle, with build.gradle like this:

/*
 * This file was generated by the Gradle 'init' task.
 *
 * This generated file contains a sample Java project to get you started.
 * For more details take a look at the Java Quickstart chapter in the Gradle
 * User Manual available at https://docs.gradle.org/6.6.1/userguide/tutorial_java_projects.html
 */

plugins {
    // Apply the java plugin to add support for Java
    id 'java'

    // Apply the application plugin to add support for building a CLI application.
    id 'application'

    // Generate code coverage
    id 'jacoco'

    id 'org.openjfx.javafxplugin' version '0.0.9'
}

javafx {
    modules = ['javafx.controls', 'javafx.fxml', 'javafx.media']
}

sourceSets {
    main {
        resources {
            srcDirs "src/main/resources"
        }
    }
}

test {
    finalizedBy jacocoTestReport // report is always generated after tests run
    testLogging {
        exceptionFormat = 'full'
    }
}
jacocoTestReport {
    reports {
        xml.enabled false
        csv.enabled false
        html.destination file("$buildDir/reports/tests/jacoco")
    }

    dependsOn test // tests are required to run before generating the report
}

repositories {
    // Use jcenter for resolving dependencies.
    // You can declare any Maven/Ivy/file repository here.
    jcenter()
}

dependencies {
    // This dependency is used by the application.
    implementation 'com.google.guava:guava:29.0-jre'

    // Use JUnit test framework
    testImplementation 'junit:junit:4.13'

    // Use json-simple to parse json file
    implementation 'com.googlecode.json-simple:json-simple:1.1.1'
}

application {
    // Define the main class for the application.
    mainClassName = '...'
}

Output of nvim (when I was typing)

[deoplete] Traceback (most recent call last):                                                                                                                                                                                                  
  File "/home/nobodyxu/.local/share/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/child.py", line 194, in _gather_results                                                                                                                
    result = self._get_result(context, source)                                                                                                                                                                                                 
  File "/home/nobodyxu/.local/share/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/child.py", line 254, in _get_result                                                                                                                    
    ctx['candidates'] = source.gather_candidates(ctx)                                                                                                                                                                                          
  File "/home/nobodyxu/.local/share/nvim/plugged/vim-javacomplete2/rplugin/python3/deoplete/sources/javacomplete2.py", line 21, in gather_candidates                                                                                           
    return self.vim.call('javacomplete#complete#complete#Complete',                                                                                                                                                                            
  File "/usr/lib/python3/dist-packages/pynvim/api/nvim.py", line 299, in call                                                                                                                                                                  
    return self.request('nvim_call_function', name, args, **kwargs)                                                                                                                                                                            
  File "/usr/lib/python3/dist-packages/pynvim/api/nvim.py", line 182, in request                                                                                                                                                               
    res = self._session.request(name, *args, **kwargs)                                                                                                                                                                                         
  File "/usr/lib/python3/dist-packages/pynvim/msgpack_rpc/session.py", line 104, in request                                                                                                                                                    
    raise self.error_wrapper(err)                                                                                                                                                                                                              
pynvim.api.common.NvimError: Vim(echoerr):javacomplete error: {}                                                                                                                                                                               
Error from javacomplete2: Vim(echoerr):javacomplete error: {}.  Use :messages / see above for error details.                                                                                                                                   
NobodyXu commented 3 years ago

I also created a issue in Shougo/deoplete.nvim #1133

artur-shaik commented 3 years ago

Please, can you pack minimal gradle powered project for me, so I can start debug straight away.

NobodyXu commented 3 years ago

Well, it's actually very easy to create a simple project using gradle.

First, make sure that you are using gradle 6.6.1, that is the gradle that causes the bug for me. Then run gradle init, select '2'(application), '3' (Java), '1' (Groovy), 1 (JUnit 4) and give it any project name.

If everything goes well, you then already has a minimal gradle powered project.

NobodyXu commented 3 years ago

I have a project created via gradle init, and under src/main/java/project_name/submodule, there's a submodule.

When I imported a class from the parent module, I sometimes experience unknown error from vim-javacomplete2 when it is auto completeing my input.

artur-shaik commented 3 years ago

can you try this branch: hotfix/issue-443, and paste here shown errors?

NobodyXu commented 3 years ago

Sure

On Mon, 12 Oct 2020 at 16:05, Artur Shaik notifications@github.com wrote:

can you try this branch: https://github.com/artur-shaik/vim-javacomplete2/tree/hotfix/issue-443, and paste here shown errors?

— You are receiving this because you authored the thread.

Reply to this email directly, view it on GitHub https://github.com/artur-shaik/vim-javacomplete2/issues/443#issuecomment-706862537, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHIGZK522KI5I4NKTBPZL7DSKKFDHANCNFSM4SJXXYXA .

NobodyXu commented 3 years ago

I will give you feedback once I get any error.

NobodyXu commented 3 years ago

I just got the error again when I am typing, and mistakenly press space to continue typing xD

NobodyXu commented 3 years ago

This time I get part of it:

[deoplete] Traceback (most recent call last):                                                                           
  File "/home/nobodyxu/.local/share/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/child.py", line 194, in _gather_
    result = self._get_result(context, source)                                                                          
  File "/home/nobodyxu/.local/share/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/child.py", line 254, in _get_res
    ctx['candidates'] = source.gather_candidates(ctx)                                                                   
  File "/home/nobodyxu/.local/share/nvim/plugged/vim-javacomplete2/rplugin/python3/deoplete/sources/javacomplete2.py", l
    raise er                                                                                                            
  File "/home/nobodyxu/.local/share/nvim/plugged/vim-javacomplete2/rplugin/python3/deoplete/sources/javacomplete2.py", l
    return self.vim.call('javacomplete#complete#complete#Complete',                                                     
  File "/usr/lib/python3/dist-packages/pynvim/api/nvim.py", line 299, in call                                           
    return self.request('nvim_call_function', name, args, **kwargs)                                                     
  File "/usr/lib/python3/dist-packages/pynvim/api/nvim.py", line 182, in request                                        
    res = self._session.request(name, *args, **kwargs)                                                                  
  File "/usr/lib/python3/dist-packages/pynvim/msgpack_rpc/session.py", line 104, in request                             
    raise self.error_wrapper(err)                                                                                       
pynvim.api.common.NvimError: Vim(echoerr):javacomplete error: {}                                                        
Error from javacomplete2: Vim(echoerr):javacomplete error: {}.  Use :messages / see above for error details.            
artur-shaik commented 3 years ago

@NobodyXu hm, actually, there is nothing usefull, I thought it should print much more information on error. I've merged that branch to master, so you can switch to latest version.

NobodyXu commented 3 years ago

Thx.

If the errors occur again, I will try to get a more complete log next time.

Or is there any nvim/deoplete function that can show log that I wasn't aware of?

NobodyXu commented 3 years ago
[deoplete] Traceback (most recent call last):                                                                                                                                                                                                  
  File "/home/nobodyxu/.local/share/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/child.py", line 194, in _gather_results                                                                                                                
    result = self._get_result(context, source)                                                                                                                                                                                                 
  File "/home/nobodyxu/.local/share/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/child.py", line 254, in _get_result                                                                                                                    
    ctx['candidates'] = source.gather_candidates(ctx)                                                                                                                                                                                          
  File "/home/nobodyxu/.local/share/nvim/plugged/vim-javacomplete2/rplugin/python3/deoplete/sources/javacomplete2.py", line 27, in gather_candidates                                                                                           
    raise er                                                                                                                                                                                                                                   
  File "/home/nobodyxu/.local/share/nvim/plugged/vim-javacomplete2/rplugin/python3/deoplete/sources/javacomplete2.py", line 23, in gather_candidates                                                                                           
    return self.vim.call('javacomplete#complete#complete#Complete',                                                                                                                                                                            
  File "/usr/lib/python3/dist-packages/pynvim/api/nvim.py", line 299, in call                                                                                                                                                                  
    return self.request('nvim_call_function', name, args, **kwargs)                                                                                                                                                                            
  File "/usr/lib/python3/dist-packages/pynvim/api/nvim.py", line 182, in request                                                                                                                                                               
    res = self._session.request(name, *args, **kwargs)                                                                                                                                                                                         
  File "/usr/lib/python3/dist-packages/pynvim/msgpack_rpc/session.py", line 104, in request                                                                                                                                                    
    raise self.error_wrapper(err)                                                                                                                                                                                                              
pynvim.api.common.NvimError: Vim(echoerr):javacomplete error: {}                                                                                                                                                                               
Error from javacomplete2: Vim(echoerr):javacomplete error: {}.  Use :messages / see above for error details.                                                                                                                                   
NobodyXu commented 3 years ago

Output from :message immediately follows the error:

error: class MenuTest is public, should be declared in a file named MenuTest.java                                                                                                                                                              
error: class MenuTest is public, should be declared in a file named MenuTest.java                                                                                                                                                              
error: class MenuTest is public, should be declared in a file named MenuTest.java                                                                                                                                                              
error: class MenuTest is public, should be declared in a file named MenuTest.java                                                                                                                                                              
error: class MenuTest is public, should be declared in a file named MenuTest.java                                                                                                                                                              
error: class MenuTest is public, should be declared in a file named MenuTest.java                                                                                                                                                              
error: class oTest is public, should be declared in a file named oTest.java                                                                                                                                                                    
error: class oTest is public, should be declared in a file named oTest.java                                                                                                                                                                    
"OptionalTest.java" 5L, 63C written                                                                                                                                                                                                            
"OptionalTest.java" 8L, 122C written                                                                                                                                                                                                           
error: cannot find symbol: Test                                                                                                                                                                                                                
error: ';' expected                                                                                                                                                                                                                            
error: ';' expected                                                                                                                                                                                                                            
error: ';' expected                                                                                                                                                                                                                            
error: ';' expected                                                                                                                                                                                                                            
error: ';' expected                                                                                                                                                                                                                            
error: ';' expected                                                                                                                                                                                                                            
[deoplete] Traceback (most recent call last):                                                                                                                                                                                                  
  File "/home/nobodyxu/.local/share/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/child.py", line 194, in _gather_results                                                                                                                
    result = self._get_result(context, source)                                                                                                                                                                                                 
  File "/home/nobodyxu/.local/share/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/child.py", line 254, in _get_result                                                                                                                    
    ctx['candidates'] = source.gather_candidates(ctx)                                                                                                                                                                                          
  File "/home/nobodyxu/.local/share/nvim/plugged/vim-javacomplete2/rplugin/python3/deoplete/sources/javacomplete2.py", line 27, in gather_candidates                                                                                           
    raise er                                                                                                                                                                                                                                   
  File "/home/nobodyxu/.local/share/nvim/plugged/vim-javacomplete2/rplugin/python3/deoplete/sources/javacomplete2.py", line 23, in gather_candidates                                                                                           
    return self.vim.call('javacomplete#complete#complete#Complete',                                                                                                                                                                            
  File "/usr/lib/python3/dist-packages/pynvim/api/nvim.py", line 299, in call                                                                                                                                                                  
    return self.request('nvim_call_function', name, args, **kwargs)                                                                                                                                                                            
  File "/usr/lib/python3/dist-packages/pynvim/api/nvim.py", line 182, in request                                                                                                                                                               
    res = self._session.request(name, *args, **kwargs)                                                                                                                                                                                         
  File "/usr/lib/python3/dist-packages/pynvim/msgpack_rpc/session.py", line 104, in request                                                                                                                                                    
    raise self.error_wrapper(err)                                                                                                                                                                                                              
pynvim.api.common.NvimError: Vim(echoerr):javacomplete error: {}                                                                                                                                                                               
Error from javacomplete2: Vim(echoerr):javacomplete error: {}.  Use :messages / see above for error details.                                                                                                                                   
[deoplete] Traceback (most recent call last):                                                                                                                                                                                                  
  File "/home/nobodyxu/.local/share/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/child.py", line 194, in _gather_results                                                                                                                
    result = self._get_result(context, source)                                                                                                                                                                                                 
  File "/home/nobodyxu/.local/share/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/child.py", line 254, in _get_result                                                                                                                    
    ctx['candidates'] = source.gather_candidates(ctx)                                                                                                                                                                                          
  File "/home/nobodyxu/.local/share/nvim/plugged/vim-javacomplete2/rplugin/python3/deoplete/sources/javacomplete2.py", line 27, in gather_candidates                                                                                           
    raise er                                                                                                                                                                                                                                   
  File "/home/nobodyxu/.local/share/nvim/plugged/vim-javacomplete2/rplugin/python3/deoplete/sources/javacomplete2.py", line 23, in gather_candidates                                                                                           
    return self.vim.call('javacomplete#complete#complete#Complete',                                                                                                                                                                            
  File "/usr/lib/python3/dist-packages/pynvim/api/nvim.py", line 299, in call                                                                                                                                                                  
    return self.request('nvim_call_function', name, args, **kwargs)                                                                                                                                                                            
  File "/usr/lib/python3/dist-packages/pynvim/api/nvim.py", line 182, in request                                                                                                                                                               
    res = self._session.request(name, *args, **kwargs)                                                                                                                                                                                         
  File "/usr/lib/python3/dist-packages/pynvim/msgpack_rpc/session.py", line 104, in request                                                                                                                                                    
    raise self.error_wrapper(err)                                                                                                                                                                                                              
pynvim.api.common.NvimError: Vim(echoerr):javacomplete error: {}                                                                                                                                                                               
Error from javacomplete2: Vim(echoerr):javacomplete error: {}.  Use :messages / see above for error details.                                                                                                                                   
error: <identifier> expected                                                                                                                                                                                                                   
error: <identifier> expected                                                                                                                                                                                                                   
NobodyXu commented 3 years ago

I've already switched the latest commit in master.

NobodyXu commented 3 years ago

Just got the error again:

search hit BOTTOM, continuing at TOP                                                                                                                                                                                                           
/jtermios                                                                                                                                                                                                                  [1/6] W             
/jtermios                                                                                                                                                                                                                    [2/6]             
/jtermios                                                                                                                                                                                                                    [3/6]             
/jtermios                                                                                                                                                                                                                    [4/6]             
/jtermios                                                                                                                                                                                                                    [5/6]             
/jtermios                                                                                                                                                                                                                    [6/6]             
[deoplete] Traceback (most recent call last):                                                                                                                                                                                                  
  File "/home/nobodyxu/.local/share/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/child.py", line 194, in _gather_results                                                                                                                
    result = self._get_result(context, source)                                                                                                                                                                                                 
  File "/home/nobodyxu/.local/share/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/child.py", line 254, in _get_result                                                                                                                    
    ctx['candidates'] = source.gather_candidates(ctx)                                                                                                                                                                                          
  File "/home/nobodyxu/.local/share/nvim/plugged/vim-javacomplete2/rplugin/python3/deoplete/sources/javacomplete2.py", line 27, in gather_candidates                                                                                           
    raise er                                                                                                                                                                                                                                   
  File "/home/nobodyxu/.local/share/nvim/plugged/vim-javacomplete2/rplugin/python3/deoplete/sources/javacomplete2.py", line 23, in gather_candidates                                                                                           
    return self.vim.call('javacomplete#complete#complete#Complete',                                                                                                                                                                            
  File "/usr/lib/python3/dist-packages/pynvim/api/nvim.py", line 299, in call                                                                                                                                                                  
    return self.request('nvim_call_function', name, args, **kwargs)                                                                                                                                                                            
  File "/usr/lib/python3/dist-packages/pynvim/api/nvim.py", line 182, in request                                                                                                                                                               
    res = self._session.request(name, *args, **kwargs)                                                                                                                                                                                         
  File "/usr/lib/python3/dist-packages/pynvim/msgpack_rpc/session.py", line 104, in request                                                                                                                                                    
    raise self.error_wrapper(err)                                                                                                                                                                                                              
pynvim.api.common.NvimError: Vim(echoerr):javacomplete error: {}                                                                                                                                                                               
Error from javacomplete2: Vim(echoerr):javacomplete error: {}.  Use :messages / see above for error details.                                                                                                                                   
message: packages still empty, try later. indexing...                                                                                                                                                                                          
message: packages still empty, try later. indexing...                                                                                                                                                                                          
[deoplete] Traceback (most recent call last):                                                                                                                                                                                                  
  File "/home/nobodyxu/.local/share/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/child.py", line 194, in _gather_results                                                                                                                
    result = self._get_result(context, source)                                                                                                                                                                                                 
  File "/home/nobodyxu/.local/share/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/child.py", line 254, in _get_result                                                                                                                    
    ctx['candidates'] = source.gather_candidates(ctx)                                                                                                                                                                                          
  File "/home/nobodyxu/.local/share/nvim/plugged/vim-javacomplete2/rplugin/python3/deoplete/sources/javacomplete2.py", line 27, in gather_candidates                                                                                           
    raise er                                                                                                                                                                                                                                   
  File "/home/nobodyxu/.local/share/nvim/plugged/vim-javacomplete2/rplugin/python3/deoplete/sources/javacomplete2.py", line 23, in gather_candidates                                                                                           
    return self.vim.call('javacomplete#complete#complete#Complete',                                                                                                                                                                            
  File "/usr/lib/python3/dist-packages/pynvim/api/nvim.py", line 299, in call                                                                                                                                                                  
    return self.request('nvim_call_function', name, args, **kwargs)                                                                                                                                                                            
  File "/usr/lib/python3/dist-packages/pynvim/api/nvim.py", line 182, in request                                                                                                                                                               
    res = self._session.request(name, *args, **kwargs)                                                                                                                                                                                         
  File "/usr/lib/python3/dist-packages/pynvim/msgpack_rpc/session.py", line 104, in request                                                                                                                                                    
    raise self.error_wrapper(err)                                                                                                                                                                                                              
pynvim.api.common.NvimError: Vim(echoerr):javacomplete error: []                                                                                                                                                                               
Error from javacomplete2: Vim(echoerr):javacomplete error: [].  Use :messages / see above for error details.                                                                                                                                   
[deoplete] Too many errors from "javacomplete2". This source is disabled until Neovim is restarted.                                                                                                                                            
message: packages still empty, try later. indexing...                                                                                                                                                                                          
[deoplete] Too many errors from "javacomplete2". This source is disabled until Neovim is restarted.                                                                                                                                            
"Termios.java" 91L, 2703C written                                                                                                                                                                                                              
NobodyXu commented 3 years ago

It happened again when I was writing javafx code.

[deoplete] Traceback (most recent call last):                                                                                                                                                                                                  
  File "/home/nobodyxu/.local/share/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/child.py", line 194, in _gather_results                                                                                                                
    result = self._get_result(context, source)                                                                                                                                                                                                 
  File "/home/nobodyxu/.local/share/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/child.py", line 254, in _get_result                                                                                                                    
    ctx['candidates'] = source.gather_candidates(ctx)                                                                                                                                                                                          
  File "/home/nobodyxu/.local/share/nvim/plugged/vim-javacomplete2/rplugin/python3/deoplete/sources/javacomplete2.py", line 27, in gather_candidates                                                                                           
    raise er                                                                                                                                                                                                                                   
  File "/home/nobodyxu/.local/share/nvim/plugged/vim-javacomplete2/rplugin/python3/deoplete/sources/javacomplete2.py", line 23, in gather_candidates                                                                                           
    return self.vim.call('javacomplete#complete#complete#Complete',                                                                                                                                                                            
  File "/usr/lib/python3/dist-packages/pynvim/api/nvim.py", line 299, in call                                                                                                                                                                  
    return self.request('nvim_call_function', name, args, **kwargs)                                                                                                                                                                            
  File "/usr/lib/python3/dist-packages/pynvim/api/nvim.py", line 182, in request                                                                                                                                                               
    res = self._session.request(name, *args, **kwargs)                                                                                                                                                                                         
  File "/usr/lib/python3/dist-packages/pynvim/msgpack_rpc/session.py", line 104, in request                                                                                                                                                    
    raise self.error_wrapper(err)                                                                                                                                                                                                              
pynvim.api.common.NvimError: Vim(echoerr):javacomplete error: []                                                                                                                                                                               
Error from javacomplete2: Vim(echoerr):javacomplete error: [].  Use :messages / see above for error details.                                                                                                                                   
Press ENTER or type command to continue                                                                                                                                                                                                        
artur-shaik commented 3 years ago

Ok, lets try one more time on this branch: hotfix/issue-443

NobodyXu commented 3 years ago

OK

NobodyXu commented 3 years ago

After I got on that branch, I found out that all dependencies I specified in build.gradle cannot be found by vim-javacomplete2.

All my imports to these modules gives me error.

NobodyXu commented 3 years ago

I tried to reinstall the plugin from the bran hotfix, but only got more error:

Error detected while processing function <SNR>59_JobNeoVimResponseHandler[3]..javacomplete#server#CompilationJobHandler:                                                                                                                       
line   10:                                                                                                                                                                                                                                     
Note: /home/nobodyxu/.local/share/nvim/plugged/vim-javacomplete2/libs/javavi/src/main/java/kg/ash/javavi/readers/Reflection.java uses unchecked or unsafe operations.                                                                          
:e P                                                                                                                                                                                                                                           
Note: Recompile with -Xlint:unchecked for details.                                                                                                                                                                                             
NobodyXu commented 3 years ago

Switching back to master gives me the same error:

Error detected while processing function <SNR>59_JobNeoVimResponseHandler[3]..javacomplete#server#CompilationJobHandler:                                                                                                                       
line   10:                                                                                                                                                                                                                                     
Note: /home/nobodyxu/.local/share/nvim/plugged/vim-javacomplete2/libs/javavi/src/main/java/kg/ash/javavi/readers/Reflection.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details.                       
Press ENTER or type command to continue                                                                                                                                                                                                        
Error detected while processing function <SNR>59_JobNeoVimResponseHandler[3]..javacomplete#server#CompilationJobHandler:                                                                                                                       
line   10:                                                                                                                                                                                                                                     
Press ENTER or type command to continue                                                                                                                                                                                                        
Javavi compilation finished                                                                                                                                                                                                                    
Press ENTER or type command to continue                                                                                                                                                                                                        

And import still doesn't work in gradle project.

NobodyXu commented 3 years ago

I just verified that the "unable to import" part isn't caused by this package.

It's more likely there is something wrong with the specific git branch I was working on.

Sorry for the false alarm.

NobodyXu commented 3 years ago

BTW, I also received strange error message when I tried to save my file:

"Sqlite3Test.java" 215L, 7830C written
could not open socket, try again
could not open socket, try again
could not open socket, try again

Not sure whether this is caused by vim-javacomplete2.

NobodyXu commented 3 years ago

Just confirmed this is a vim-javacomplete2 problem.

After I removed it, nothing goes wrong.

artur-shaik commented 3 years ago

Can you try to clear jc2 cache by doing: rm ~/.cache/javacomplete2/ ?

NobodyXu commented 3 years ago

I tried, but still got the could not open socket, try again error when saving the file.

NobodyXu commented 3 years ago

Full error:

"App.java" 207L, 7931C written                                                                                                                                                                                                                 
could not open socket, try again                                                                                                                                                                                                               
could not open socket, try again                                                                                                                                                                                                               
could not open socket, try again                                                                                                                                                                                                               
Error detected while processing function <SNR>59_JobNeoVimResponseHandler[3]..javacomplete#server#CompilationJobHandler:                                                                                                                       
line   10:                                                                                                                                                                                                                                     
Note: /home/nobodyxu/.local/share/nvim/plugged/vim-javacomplete2/libs/javavi/src/main/java/kg/ash/javavi/readers/Reflection.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details.                       
Error detected while processing function <SNR>59_JobNeoVimResponseHandler[3]..javacomplete#server#CompilationJobHandler:                                                                                                                       
line   10:                                                                                                                                                                                                                                     
artur-shaik commented 3 years ago

Pull last commit, please.

NobodyXu commented 3 years ago

OK, I will have a try

NobodyXu commented 3 years ago

I got some errors once again:

"FloorTileFactoryTest.java" 56L, 2007C written                                                                                                                                                                                                 
error: generic array creation                                                                                                                                                                                                                  
error: generic array creation                                                                                                                                                                                                                  
error: generic array creation                                                                                                                                                                                                                  
error: generic array creation                                                                                                                                                                                                                  
error: generic array creation                                                                                                                                                                                                                  
[deoplete] Traceback (most recent call last):                                                                                                                                                                                                  
  File "/home/nobodyxu/.local/share/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/child.py", line 194, in _gather_results                                                                                                                
    result = self._get_result(context, source)                                                                                                                                                                                                 
  File "/home/nobodyxu/.local/share/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/child.py", line 254, in _get_result                                                                                                                    
    ctx['candidates'] = source.gather_candidates(ctx)                                                                                                                                                                                          
  File "/home/nobodyxu/.local/share/nvim/plugged/vim-javacomplete2/rplugin/python3/deoplete/sources/javacomplete2.py", line 27, in gather_candidates                                                                                           
    raise er                                                                                                                                                                                                                                   
  File "/home/nobodyxu/.local/share/nvim/plugged/vim-javacomplete2/rplugin/python3/deoplete/sources/javacomplete2.py", line 23, in gather_candidates                                                                                           
    return self.vim.call('javacomplete#complete#complete#Complete',                                                                                                                                                                            
  File "/usr/lib/python3/dist-packages/pynvim/api/nvim.py", line 299, in call                                                                                                                                                                  
    return self.request('nvim_call_function', name, args, **kwargs)                                                                                                                                                                            
  File "/usr/lib/python3/dist-packages/pynvim/api/nvim.py", line 182, in request                                                                                                                                                               
    res = self._session.request(name, *args, **kwargs)                                                                                                                                                                                         
  File "/usr/lib/python3/dist-packages/pynvim/msgpack_rpc/session.py", line 104, in request                                                                                                                                                    
    raise self.error_wrapper(err)                                                                                                                                                                                                              
pynvim.api.common.NvimError: Vim(let):E117: Unknown function: TypeArguments                                                                                                                                                                    
Error from javacomplete2: Vim(let):E117: Unknown function: TypeArguments.  Use :messages / see above for error details.                                                                                                                        
error: illegal start of type                                                                                                                                                                                                                   
"FloorTileFactoryTest.java" 56L, 1996C written                                                                                                                                                                                                 
error: illegal start of type                                                                                                                                                                                                                   
error: illegal start of type                                                                                                                                                                                                                   
error: ';' expected                                                                                                                                                                                                                            
error: ';' expected                                                                                                                                                                                                                            

Seems like a different kind of error.

artur-shaik commented 3 years ago

Yeah, you are right, something new, after what action it happened?

NobodyXu commented 3 years ago

It happened when I was changing the following code:

import javafx.util.Pair;

for (Pair<Path, String> pair: new Pair<Path, String>[](                                           
   Path.A, "A",
   Path.B, "B",
    Path.C, "C",
    Path.D, "D",
    Path.E, "E",
    Path.F, "F"})
{

To:

import javafx.util.Pair;
import java.util.Arrays;

for (Pair<Path, String> pair: Arrays.asList(
    new Pair<Path, String>(Path.A, "A"),
    new Pair<Path, String>(Path.B, "B"),
    new Pair<Path, String>(Path.C, "C"),
    new Pair<Path, String>(Path.D, "D"),
    new Pair<Path, String>(Path.E, "E"),
    new Pair<Path, String>(Path.F, "F")))
{

I recalled that I have already added new Pair<Path, String>( when it happened.

NOTE that Path is an enum.

artur-shaik commented 3 years ago

Pushed some changes, looks like the bug.

NobodyXu commented 3 years ago

Since last update, I haven't yet experienced one error.

artur-shaik commented 3 years ago

Ok, let's merge it, and if any will thrown again, please reopen this issue. And thanks for participation.