我的项目通过以下代码模式实现继承:
ScanTemplate1.prototype = Object.create(ScanTemplateBase.prototype);
ScanTemplate1.prototype.contructor = ScanTemplate1;
在这里,ScanTemplate1 继承自 ScanTemplateBase 类。
现在在任何 .js 文件中,内容辅助仅建议在 ScanTemplate1.js 文件中定义的成员函数。它不建议从 ScanTemplateBase 继承的成员函数。
我正在使用带有最新 JSDT 版本的 eclipse Luna。有没有办法启用内容辅助来建议继承的成员函数?
示例: ScanTemplateBase 类有一个函数
ScanTemplateBase.prototype.getInstruction = function(){
return this.instruction;
};
ScanTemplate1 有一个功能
ScanTemplate1.prototype.getTextbox = function() {
return this.textbox;
};
现在,在文件main.js中,我有声明
var packageScanBox = new ScanTemplate1( ..... constructor args ....);
在输入packageScanBox。并按Ctrl + space,它建议getTextbox()但不是getInstruction()
提前致谢!