How to edit code with VScode

I’ve seen somewhere that VScode can be used for debugging.

But btw VScode is also a good code editor offering excellent autocompletion and intellisense.
Hence, some questions:

  • Is there a way to use VScode by default instead of the built-in editor?
  • I’ve seen that d.ts files can be installed in the project directory. Does it mean that adding
    ///<reference path="../../creator.d.ts"> in my assets/Scripts/*.js files would do the job?

thanks,

1 Like

To use VS Code as the default editor, open the properties menu (on Mac it’s under CocosCreator). On the left hand side select the “Data Editor” path. There you can change the External Script Editor to be VS Code. Creator will now use VS Code when you click on scripts.

If you look in the developer menu, there’s a VS Code workflow menu, I believe the first option puts the creator.d.ts file in the proper spot for Intellisense.

1 Like

ah “data” = code, script, whatever :confounded:
indeed, the d.ts at the root of the projects does the job. Thanks!

1 Like