artur-shaik / vim-javacomplete2

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

GetClassPackage fails with `extends` #461

Closed ErrorNoInternet closed 2 years ago

ErrorNoInternet commented 2 years ago

Actual behavior (Required!)

The autocomplete throws an error before showing me the autocomplete options if you try to use autocomplete within a class that uses extends with an external lib

Expected behavior (Required!)

The autocomplete should work without any errors

The steps to reproduce actual behavior (Required!)

  1. Add a libs path
  2. Create a class (for example public class Main extends ...) that uses another lib e. Type System. within the class and use c-x c-o

Environment (Required!)

Q&A

Screenshot (Optional)

The output of :redir and :message (Optional)

Error detected while processing function javacomplete#Complete[1]..javacomplete#complete#complete#Complete[14]..javacomplete#complete#context#ExecuteContext[26]..javacomp
lete#complete#complete#CompleteAfterDot[97]..javacomplete#collector#GetDeclaredClassName[15]..javacomplete#collector#SearchForName[29]..javacomplete#complete#complete#Sea
rchMember[74]..javacomplete#complete#complete#SearchMember:
line    3:
E716: Key not present in Dictionary: "name)"
Press ENTER or type command to continue
Error detected while processing function javacomplete#Complete[1]..javacomplete#complete#complete#Complete[14]..javacomplete#complete#context#ExecuteContext[26]..javacomp
lete#complete#complete#CompleteAfterDot[97]..javacomplete#collector#GetDeclaredClassName[15]..javacomplete#collector#SearchForName[29]..javacomplete#complete#complete#Sea
rchMember[74]..javacomplete#complete#complete#SearchMember:
line    3:
E116: Invalid arguments for function javacomplete#util#GetClassPackage
Press ENTER or type command to continue
Error detected while processing function javacomplete#Complete[1]..javacomplete#complete#complete#Complete[14]..javacomplete#complete#context#ExecuteContext[26]..javacomp
lete#complete#complete#CompleteAfterDot[97]..javacomplete#collector#GetDeclaredClassName[15]..javacomplete#collector#SearchForName[29]..javacomplete#complete#complete#Sea
rchMember[74]..javacomplete#complete#complete#SearchMember:
line    3:
E15: Invalid expression: javacomplete#complete#complete#GetPackageName() == javacomplete#util#GetClassPackage(a:ci.name)

I'm pretty new to Java and I'm just following a tutorial, so please let me know if anything is wrong

artur-shaik commented 2 years ago

Can you attache test project for me, so I can reproduce it?

ErrorNoInternet commented 2 years ago

Nevermind, I managed to fix it by adding the LibsPath to classpath as well