看到creator发布3.4版本,重新回归看了一下。遇到一个vs code代码提示问题。对工作效率来说,这个代码提示补全很重要。
环境:
mac : 10.14.6
cocos creator : 3.4.0
VS Code Version: 1.63.2
creator中创建ts文件,在类内部定义一个属性
@property(cc.Node)
myNode: cc.Node = null;
其中cc部分会有如下的提示:
@deprecated — Global variable
ccwas dropped since 3.0. Use ES6 module syntax to import Cocos Creator APIs.‘cc’ is deprecated.ts(6385)
cc.d.ts(5, 8): The declaration was marked as deprecated here.
跳转到cc.d.ts文件,这个文件内容是
reference path="/Applications/CocosCreator/Creator/3.4.0/CocosCreator.app/Contents/Resources/resources/3d/engine/bin/.declarations/cc.d.ts"/>
/**
* @deprecated Global variableccwas dropped since 3.0. Use ES6 module syntax to import Cocos Creator APIs.
*/
declare const cc: never;

