Hi everyone! I’m new in Cocos Creator and JavaScript (from C++). I’m used to coding with intellisense and I have a problem with mixing Cocos Creator + Visual Studio Code. I have done everything are written in here http://www.cocos2d-x.org/docs/creator/en/getting-started/coding-setup.html
and here
How to edit code with VScode.
But my editor doesn’t work properly. Here my screenshots:
The first picture shows ‘cc’ module is not recognizing. But if I write code without cc, for example ‘moveBy’, it is ok.
jsconfig.json
{ "compilerOptions": { "target": "es6", "module": "commonjs", "experimentalDecorators": true }, "exclude": [ "node_modules", ".vscode", "library", "local", "settings", "temp" ] }
settings.json
{ "explorer.confirmDelete": false, "typescript.npm": "C:\\Program Files\\nodejs\\npm.cmd", "search.exclude": { "**/node_modules": true, "**/bower_components": true, "build/": true, "temp/": true, "library/": true, "**/*.anim": true }, "files.exclude": { "**/.git": true, "**/.DS_Store": true, "**/*.meta": true, "library/": true, "local/": true, "temp/": true } }
Project structure:
Node.js and TypeScript are installed (just in case). creator.d.ts and jsconfig.json in the root of the project.
What I have tried:
In jsconfig.json I changed target and module to es2015. Also I have tried to append next (I thought vscode doesn’t see my creator.d.ts, it is stupidly, but still)
"typeAcquisition": { "enable": true, "include": [ "./**" ] }, "include": [ "./**" ]
Please, help me with it. I can’t understand what I can do with it else.