Why does autocomplete does not pick up local variables from the editor?

I am using mode “text/x-java”. The libraries that I am using are codemirror.js, show-hint.js and clike.js. The autocomplete works in the sense that any keywords that I included in the clike.js file will get called when I start typing it in the editor. The problem I have is that the autocomplete does not pick up any local variables that I define in the editor as this is not stored in the clike.js files. I am aware this functionality does exist in the autocomplete and xml complete demo. I am also aware that they both have javascript-hint.js and xml-hint.js. I looked into both of these libraries but I do not know which function from the library allows storing local variables from the editor into the autocomplete list and gets recalled when the user starts to type. Can some also describe how the function works, please?

Thank You

Supporting that would require language-specific code, and no such code exists for Java. The JavaScript mode gathers local variables, and javascript-hint accesses those for completion.

Hi Marijn

Thank you for your reply.

Can you please confirm which function in the JavaScript mode takes a local variable and which function in javascript-hint accesses it for completion?

If I need to include this feature for Java mode where/ how would I start?

Thank You

i am using mode as javascript but ,i want Essentially the auto complete should allow user to access JS objects the way vs code allows us ,but it not working can you please tell how this done?thank you