用于检测继承的eclipse javascript插件
我的项目通过以下代码模式实现继承:用于检测继承的eclipse javascript插件,javascript,eclipse,inheritance,content-assist,jsdt,Javascript,Eclipse,Inheritance,Content Assist,Jsdt,我的项目通过以下代码模式实现继承: ScanTemplate1.prototype = Object.create(ScanTemplateBase.prototype); ScanTemplate1.prototype.contructor = ScanTemplate1; 这里,ScanTemplate1继承自ScanTemplateBase类 现在在任何.js文件中,content assist仅建议ScanTemplate1.js文件中定义的成员函数。它不建议从ScanTemplate
ScanTemplate1.prototype = Object.create(ScanTemplateBase.prototype);
ScanTemplate1.prototype.contructor = ScanTemplate1;
这里,ScanTemplate1继承自ScanTemplateBase类
现在在任何.js文件中,content assist仅建议ScanTemplate1.js文件中定义的成员函数。它不建议从ScanTemplateBase继承成员函数
我正在使用最新JSDT版本的EclipseLuna是否有办法启用内容辅助功能来建议继承的成员函数?
示例:
ScanTemplateBase类有一个函数
ScanTemplateBase.prototype.getInstruction = function(){
return this.instruction;
};
ScanTemplate1.prototype.getTextbox = function() {
return this.textbox;
};
ScanTemplate1有一个函数
ScanTemplateBase.prototype.getInstruction = function(){
return this.instruction;
};
ScanTemplate1.prototype.getTextbox = function() {
return this.textbox;
};
现在,在一个文件main.js中,我有一条语句
var packageScanBox = new ScanTemplate1( ..... constructor args ....);
在键入packageScanBox.并按Ctrl+space时,建议使用getTextbox()而不是getInstruction()
提前谢谢 免责声明,我是 我建议您选择支持
对象的。创建。我已快速测试:
由于tern.java基于,您可以使用测试用例。感谢您的建议Angelo!我试图安装tern,但它似乎不起作用。我安装了3个东西:1。燕鸥特征2。Tern JSDT功能3。Tern Linters然后我将项目转换为Tern,并在Properties->Tern->Modules中检查完成猜测。但是内容辅助没有显示其他建议。如果我再次按Ctrl+Space,它会显示“No Tern Completion Proposal Category”,如果您还没有安装Node,您也需要安装“Tern-Embed Node.js”,因为ternjs是由Node执行的。现在它正试图从Tern服务器获取建议,然后出错并显示一条长消息,其中一部分是“从'computeCompleteProposals()'操作返回扩展花费的时间太长。是否需要为每个提案联系服务器?因为这将是缓慢的任何方式的错误消息还说,删除插件从word建议列表,在我这样做后,它开始工作!!!如果加载了很多JS文件(第一次),ternjs可能会很慢。如果安装1.0.0-SNAPSHOT,则可以排除路径