JS Auto Code Completion not working

JS Auto Code Completion not working


I had just started playing with Creator.
For me Auto code completion is not working with VS Code for JS scripts.
I clicked on all this 5
May i know what else need to be done?
BTW for TypeScript its working fine.

clicked “Install VS Code Extension” first,then clicked “Update VS Code API Source”
reference: https://docs.cocos2d-x.org/creator/manual/en/getting-started/coding-setup.html

Not working…

It’s not working for me too. Maybe in the other IDE (e.g WebStorm) it will work.
But I use VSCode. And my decision is to write code on typescript.
Please, write to this thread if you will find a solution.

If simple auto complete is not working then how anyone can use this tool??
You should fix this first then add new features.

check your config in preference->data editor.

creator version that you used?

it is works well on my computer

you can delete your creator.d.ts file and try again

BTW I am trying on Windows-10, did you guys tested on Win-10?

Currently 1.9.3

I tried again, but still not working. But Type-script its working fine.

Please help me out and others as well.

More VSCode screenshot, if you can debug problem
JS script


@slackmoehrle This is really sad for cocos team.
If you cant support simple auto-complete then how can you see future in this tool??
Very disappointed.
Back to Cocos2d-x…

I tested in win10 + creator 1.9.3
it seems all right


So i think i found the issue, as per your screenshots cocos-creator extension should be installed, but in my case its not installed. Only Cocos Debug is installed.

I tried search in extension marketplace but not found any, see below

I am from India, if region is matter. Let me know how can i install that manually.

you can try to install creator 2.0.8 and following those steps to install this extension.

if you install this extension success,you can change back to 1.9.3version and “Update VS Code API Source”

@smitpatel88 let us know how you make out, ok?

Sure, will try tomorrow now.

So now i am trying in 2.0.9 and its working but its only working if project is created with 2.0.9.
All old projects its not working. (But not big issue)
Big issues :

  1. If i had created one script, Now i am trying to access that script into another script then i am not getting intellisense for the same. (No vars or methods etc)
  2. Still Auto suggestion is not working proper (Not like Cocos2d-x cpp)

Note: this 2 behavior is common for both Win & Mac

you need to add your customized intellisense code in “creator.d.ts” file

You mean manually?
If so then its really hard to make any game on this engine.

yes, manually
or you can write your component used ES6 syntax, the IDE will recognize automatic.
another way is use typescript to develop your project

Hmm Let me more dig into it.
Any example from your side?

I have found the solution, it’s work for me with window 10 + cocos creator 2.1.1:
Step 1: open project in Cocos Creator, choose Developer -> VS Code Workflow -> Install VS Code Extension
Step 2: wait until step 1 done then choose choose Developer -> VS Code Workflow -> Update VS Code API Source
Step 3: wait until step 2 done then go to your project folder (which have creator.d.ts file) and create a js file and add this line to the js file you just created:

And that all !!! now you have intellisense cocos API
Hope this help !!!