Broken intellisense and autocomplete for Cocos2dx JS in Visual Studio Code

I couldn’t get intellisense to work for cocos2dx 3.12 project in Visual Studio code. I added the jsconfig.json file that is required by vscode to see the full project, but it doesn’t work.

The IDE finds an empty reference to cc in Base64Images.js (var cc = cc || {}:wink: and then can’t find anything else in cc like cc.view or cc.director etc…

It is difficult to work without autocomplete and cmd+click to go to definition etc… Which IDE is used by cocos developers for developing Cocos2dx JS?

Will this need an extension to be developed by cocos team? Maybe create typescript definitions to be loaded in vscode?

Or are there any steps we can follow to fix it?

SG

hi,l did u manage to fix it? I was planning to use Visual Studio Code to work with cocos2d-x but now I’m not sure its the right call.

Not really. I use Visual Studio Code to debug JSB and sometimes debug with Chrome, but now mostly using Webstorm for development. But Webstorm is too heavy on ram usage etc. Difficult to run it along with Android Studio on a 4GB macbook air.

Eagerly waiting for either VSCode team to improve their JS intellisense or Cocos2dx team to add TypeScript definitions to assist VSCode. I opened a bug for vscode ( https://github.com/Microsoft/vscode/issues/9391 , https://github.com/Microsoft/TypeScript/issues/10141 ), and also discussed this with @zhangxm in this thread: Cocos2d-x v3.12 released! .

@schngrg VSC can not have intellisense and autocomplete for JS codes, it needs Typescript definition. That’s what we did for Cocos Creator. Yep, i think we need provide Typescript definition for JSB too.

Edit: cocos2d-x team always use WebStorm for developing.