[Statement, reprinted from: www.jianshu.com/p/7d168078e… well, before the game is based on the cocos2d – x engine developed by c + + environment, products have been poking fun at the not hot update ☹ ️. Can’t finally decided to switch to CocosCreator JavaScript environment after half a year to develop, Update as often as you like, and because you’re on the CocosCreator bandit, there’s a never-ending stream of stories to follow (; ‘⌒’).

Moving on to today’s topic: VS Code Intelligence prompts fail.

I’m sure many of you have checked out CocosCreator and installed VS Code, the developer’s main editor. Then go to the CocosCreator menu bar – Developers – VS Code Workflow – and update VS Code Smart Tip data (install VS Code extensions, add TypeScript project configuration…). Click on it, yeah, it’s installed, and I’m going to write the demo. \

Official edit environment configuration bootstrap. JPG

The tragedy is always following the documentation, doing everything correctly, and then the results don’t match the documentation. Many people will find VS Code writing the cocos engine API with incomplete prompts or no prompts at all. For example, if you type “cc.”, you should get a bunch of prompts, or if you manually type “cc. Label “, hold down the Command key (Windows is Windows) and click the mouse, you can’t jump to the API of the engine. You’ll find a lot of people asking the same question. And then there are all kinds of answers, and you can see from the feedback that none of them are satisfactory. Cocos Creator + Visual Studio Code?? Problem with intelligent prompts?

Revelation moments

Install the official “Update VS Code Smart Tip data” and you must also hit “Add TypeScript project configuration”!! Well, that’s the reason. VS Code can also be developed in TypeScript, but if you add a TypeScript project configuration to a JavaScript project, a tsconfig.json file will be generated in the Creator project directory, as shown below. This TypeScript configuration conflicts with the COcos engine’s API intellisense functionality in a JavaScript environment. However, when developing games in TypeScript, intelligent hints are unaffected. So I guess TypeScript takes precedence over JavaScript in this case.

\

Delete the.png configuration that conflicts with the JS environment

Solution: Delete the “tsconfig.json” file in the Creator project directory (see figure above).

After removing the redundant configuration, VS Code should be able to enable smart hints normally.