CocosCreator代码编辑器配置地址:http://docs.cocos.com/creator/manual/zh/getting-started/coding-setup.html
不懂配置的请自行查看。
正常情况下自动生成的creator.d.ts文件是有错误的,
export function Class(options?: {name?: string; extends?: Function; ctor?: Function; __ctor__?: Function; properties?: any; statics?: any; mixins?: Function[]; editor?: {executeInEditMode?: boolean; requireComponent?: Function; menu?: string; executionOrder?: number; disallowMultiple?: boolean; playOnFocus?: boolean; inspector?: string; icon?: string; help?: string; }; update?: Function; lateUpdate?: Function; onLoad?: Function; start?: Function; onEnable?: Function; onDisable?: Function; onDestroy?: Function; onFocusInEditor?: Function; onLostFocusInEditor?: Function; resetInEditor?: Function; onRestore?: Function; _getLocalBounds?: Function; }): Function;
将上面这段在creator.d.ts文件中搜索,然后将其中的;(分号)全部替换成,(逗号),保存之后,重新打开VS Code即可。
替换代码如下:
export function Class(options?: {name?: string; extends?: Function; ctor?:
Function;
properties?: any, statics?: any, mixins?:
Function[], editor?: {executeInEditMode?: boolean, requireComponent?:
Function, menu?: string, executionOrder?: number, disallowMultiple?:
boolean, playOnFocus?: boolean, inspector?: string, icon?:
string, help?: string, }, update?: Function, lateUpdate?:
Function, onLoad?: Function, start?: Function, onEnable?:
Function, onDisable?: Function, onDestroy?: Function, onFocusInEditor?:
Function, onLostFocusInEditor?: Function, resetInEditor?:
Function, onRestore?: Function, _getLocalBounds?: Function, }):
Function;
![](https://i-blog.csdnimg.cn/blog_migrate/d8b74809bf93f877c4f7998ab833dfde.png)