VSCode setup for CocosCreator


#1

Hi everyone! I’m new in Cocos Creator and JavaScript :slight_smile: (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:
intellisense


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:
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.


#2

So, people. I removed Cocos Creator and installed it through Visual Studio 2017(not directly, now version of CocosCreator is 1.5.2). Apparently there’s some bug. Be happy! Thank you!


#3

Read this: As VSCode is no longer supported. What editor do you use?


#4

Oh, it is my fulish, I should find this topic. Thank you! I hope it will be fiixed


#5

I reinstall Cocos Creator again to 1.8 version, but put the file creator.d.ts from old version and it works. For temporary use it is ok.