Closed jidibinlin closed 3 years ago
JCgenerateConstructor reports an error
fix this error
Yes, I tried minimal .vimrc configuraion. no
Yes, I have enabled logs with JCdebugEnableLogs and can put here content of JCdebugGetLogContent command, if you need.
JCdebugEnableLogs
JCdebugGetLogContent
70.227636 [server] communicate: -clear-from-cache "exp2_2.chess" [s:RemoveCurrentFromCache] 70.330391 [server] 70.331317 [server] communicate: -async -recompile-class "exp2_2.chess" [s:RemoveCurrentFromCache] 70.433640 [server] 70.434608 [server] communicate: -async -add-source-to-cache "-source /home/qibin/eclipse-workspace/JavaSwing/src/exp2_2/chess.java -class chess -package exp2_2" [s:RemoveCurrentFromCache] 70.535960 [server] 88.135567 [collector] get class info. class: this 88.163727 [collector] A0. this 88.164004 [collector] get class info. class: java.lang.Object 88.165283 [server] communicate: -E "java.lang.Object" [collector#FetchInfoFromServer] 88.285536 [server] {'java.lang.Object':{'tag':'CLASSDEF','flags':'1','name':'java.lang.Object','classpath':'1','pos':[-1,-1],'endpos':[-1,-1],'fqn':'java.lang.Object','implements':[],'nested':[],'ctors':[{'m':'1','d':'public java.lang.Object()'},],'fields':[],'methods':[{'n':'finalize','c':'void','m':'100','r':'void','d':'@Deprecated protected void java.lang.Object.finalize() throws java.lang.Throwable'},{'n':'toString','c':'java.lang.String','m':'1','r':'java.lang.String','d':'public java.lang.String java.lang.Object.toString()'},{'n':'registerNatives','c':'void','m':'100001010','r':'void','d':'private static native void java.lang.Object.registerNatives()'},{'n':'clone','m':'100000100','r':'java.lang.Object','d':'protected native java.lang.Object java.lang.Object.clone() throws java.lang.CloneNotSupportedException'},{'n':'notify','c':'void','m':'100010001','r':'void','d':'public final native void java.lang.Object.notify()'},{'n':'wait','c':'void','m':'100010001','r':'void','p':['long',],'d':'public final native void java.lang.Object.wait(long) throws java.lang.InterruptedException'},{'n':'wait','c':'void','m':'10001','r':'void','p':['long','int',],'d':'public final void java.lang.Object.wait(long,int) throws java.lang.InterruptedException'},{'n':'wait','c':'void','m':'10001','r':'void','d':'public final void java.lang.Object.wait() throws java.lang.InterruptedException'},{'n':'getClass','c':'java.lang.Class<?>','m':'100010001','r':'java.lang.Class<?>','d':'public final native java.lang.Class<?> java.lang.Object.getClass()'},{'n':'hashCode','c':'int','m':'100000001','r':'int','d':'public native int java.lang.Object.hashCode()'},{'n':'equals','c':'boolean','m':'1','r':'boolean','p':['java.lang.Object',],'d':'public boolean java.lang.Object.equals(java.lang.Object)'},{'n':'notifyAll','c':'void','m':'100010001','r':'void','d':'public final native void java.lang.Object.notifyAll()'},],},} 91.768489 [generators] generate method with template: 'constructor' 91.794059 [generators] function! s:__constructor(class, ...) let parameters = "" let body = "" let idx = 0 if a:0 == 0 || a:1.default != 1 for field in a:class.fields if idx != 0 let parameters .= ", " endif let parameters .= field.type . " ". field.name let body .= "this.". field.name ." = ". field.name .";\n" let idx += 1 endfor endif let result = "public ". a:class.name ."(". parameters. ") {\n" let result .= body return result . "}" endfunction 91.808964 [collector] get class info. class: this 91.810718 [collector] A0. this 91.810933 [collector] get class info. class: java.lang.Object 91.810954 [collector] class info from cache 91.842899 [collector] get class info. class: this 91.844509 [collector] A0. this 91.845738 [collector] get class info. class: java.lang.Object 91.845813 [collector] class info from cache 91.850346 [server] communicate: -clear-from-cache "exp2_2.fdfdf" [s:CurrentFileInfo] 91.954098 [server] 91.958007 [server] communicate: -class-info-by-content -target exp2_2.fdfdf -content [CurrentFileInfo] 92.060887 [server] 92.061157 [generators] {} 104.155983 [server] communicate: -clear-from-cache "exp2_2.chess" [s:RemoveCurrentFromCache] 104.257308 [server] 104.258671 [server] communicate: -async -recompile-class "exp2_2.chess" [s:RemoveCurrentFromCache] 104.359908 [server] 104.361152 [server] communicate: -async -add-source-to-cache "-source /home/qibin/eclipse-workspace/JavaSwing/src/exp2_2/chess.java -class chess -package exp2_2" [s:RemoveCurrentFromCache] 104.462320 [server]
Even, if you wish, I can set g:JavaComplete_JavaviLogLevel to 'debug', then set g:JavaComplete_JavaviLogDirectory, and put here server logs, too.
g:JavaComplete_JavaviLogLevel
'debug'
g:JavaComplete_JavaviLogDirectory
Can you try to use python 3?
Actual behavior (Required!)
JCgenerateConstructor reports an error
Expected behavior (Required!)
fix this error
The steps to reproduce actual behavior (Required!)
Environment (Required!)
Q&A
Yes, I tried minimal .vimrc configuraion. no
Yes, I have enabled logs with
JCdebugEnableLogs
and can put here content ofJCdebugGetLogContent
command, if you need.70.227636 [server] communicate: -clear-from-cache "exp2_2.chess" [s:RemoveCurrentFromCache] 70.330391 [server] 70.331317 [server] communicate: -async -recompile-class "exp2_2.chess" [s:RemoveCurrentFromCache] 70.433640 [server] 70.434608 [server] communicate: -async -add-source-to-cache "-source /home/qibin/eclipse-workspace/JavaSwing/src/exp2_2/chess.java -class chess -package exp2_2" [s:RemoveCurrentFromCache] 70.535960 [server] 88.135567 [collector] get class info. class: this 88.163727 [collector] A0. this 88.164004 [collector] get class info. class: java.lang.Object 88.165283 [server] communicate: -E "java.lang.Object" [collector#FetchInfoFromServer] 88.285536 [server] {'java.lang.Object':{'tag':'CLASSDEF','flags':'1','name':'java.lang.Object','classpath':'1','pos':[-1,-1],'endpos':[-1,-1],'fqn':'java.lang.Object','implements':[],'nested':[],'ctors':[{'m':'1','d':'public java.lang.Object()'},],'fields':[],'methods':[{'n':'finalize','c':'void','m':'100','r':'void','d':'@Deprecated protected void java.lang.Object.finalize() throws java.lang.Throwable'},{'n':'toString','c':'java.lang.String','m':'1','r':'java.lang.String','d':'public java.lang.String java.lang.Object.toString()'},{'n':'registerNatives','c':'void','m':'100001010','r':'void','d':'private static native void java.lang.Object.registerNatives()'},{'n':'clone','m':'100000100','r':'java.lang.Object','d':'protected native java.lang.Object java.lang.Object.clone() throws java.lang.CloneNotSupportedException'},{'n':'notify','c':'void','m':'100010001','r':'void','d':'public final native void java.lang.Object.notify()'},{'n':'wait','c':'void','m':'100010001','r':'void','p':['long',],'d':'public final native void java.lang.Object.wait(long) throws java.lang.InterruptedException'},{'n':'wait','c':'void','m':'10001','r':'void','p':['long','int',],'d':'public final void java.lang.Object.wait(long,int) throws java.lang.InterruptedException'},{'n':'wait','c':'void','m':'10001','r':'void','d':'public final void java.lang.Object.wait() throws java.lang.InterruptedException'},{'n':'getClass','c':'java.lang.Class<?>','m':'100010001','r':'java.lang.Class<?>','d':'public final native java.lang.Class<?> java.lang.Object.getClass()'},{'n':'hashCode','c':'int','m':'100000001','r':'int','d':'public native int java.lang.Object.hashCode()'},{'n':'equals','c':'boolean','m':'1','r':'boolean','p':['java.lang.Object',],'d':'public boolean java.lang.Object.equals(java.lang.Object)'},{'n':'notifyAll','c':'void','m':'100010001','r':'void','d':'public final native void java.lang.Object.notifyAll()'},],},} 91.768489 [generators] generate method with template: 'constructor' 91.794059 [generators] function! s:__constructor(class, ...) let parameters = "" let body = "" let idx = 0 if a:0 == 0 || a:1.default != 1 for field in a:class.fields if idx != 0 let parameters .= ", " endif let parameters .= field.type . " ". field.name let body .= "this.". field.name ." = ". field.name .";\n" let idx += 1 endfor endif let result = "public ". a:class.name ."(". parameters. ") {\n" let result .= body return result . "}" endfunction 91.808964 [collector] get class info. class: this 91.810718 [collector] A0. this 91.810933 [collector] get class info. class: java.lang.Object 91.810954 [collector] class info from cache 91.842899 [collector] get class info. class: this 91.844509 [collector] A0. this 91.845738 [collector] get class info. class: java.lang.Object 91.845813 [collector] class info from cache 91.850346 [server] communicate: -clear-from-cache "exp2_2.fdfdf" [s:CurrentFileInfo] 91.954098 [server] 91.958007 [server] communicate: -class-info-by-content -target exp2_2.fdfdf -content [CurrentFileInfo] 92.060887 [server] 92.061157 [generators] {} 104.155983 [server] communicate: -clear-from-cache "exp2_2.chess" [s:RemoveCurrentFromCache] 104.257308 [server] 104.258671 [server] communicate: -async -recompile-class "exp2_2.chess" [s:RemoveCurrentFromCache] 104.359908 [server] 104.361152 [server] communicate: -async -add-source-to-cache "-source /home/qibin/eclipse-workspace/JavaSwing/src/exp2_2/chess.java -class chess -package exp2_2" [s:RemoveCurrentFromCache] 104.462320 [server]
Even, if you wish, I can set
g:JavaComplete_JavaviLogLevel
to'debug'
, then setg:JavaComplete_JavaviLogDirectory
, and put here server logs, too.Screenshot (Optional)
The output of :redir and :message (Optional)