Eclipse JSDT的org.eclipse.wst.jsdt.ui.javaCompletionProposalComputer
内容协助不提供任何建议。
Preferences -> JavaScript -> Editor -> Content Assist -> Advanced
“Nodeclipse Proposals”是可见的,并被选中。
根据Bananaweizen的建议Content assist for Eclipse JSDT based Editor
在plugin.xml中
<extension point="org.eclipse.wst.jsdt.ui.javaCompletionProposalComputer"
id="nodeclispe_textual_proposals"
name="Nodeclipse Text Proposals">
<proposalCategory icon="icons/npm/npm.gif"/>
</extension>
<extension point="org.eclipse.wst.jsdt.ui.javaCompletionProposalComputer"
id="NodeclipseProposals"
name="Nodeclipse Proposals">
<javaCompletionProposalComputer
class="org.nodeclipse.ui.contentassist.JSDTProposalComputer"
categoryId="org.eclipse.ui.texteditor.textual_proposals">
<partition type="__java_javadoc"/>
</javaCompletionProposalComputer>
</extension>
JSDTProposalComputer
只是NodeContentAssistant
的包装器
(实现IContentAssistProcessor
),对于基于TextEditor的编辑器非常有效。
public class JSDTProposalComputer implements IJavaCompletionProposalComputer {
IContentAssistProcessor assistant = new NodeContentAssistant();
@Override
public List<ICompletionProposal> computeCompletionProposals(ContentAssistInvocationContext context, IProgressMonitor monitor) {
return Arrays.asList(assistant.computeCompletionProposals(context.getViewer(), context.getInvocationOffset()));
}
@Override
public List<IContextInformation> computeContextInformation(ContentAssistInvocationContext context, IProgressMonitor monitor) {
return Arrays.asList(assistant.computeContextInformation(context.getViewer(), context.getInvocationOffset()));
}
来自help的示例
所有代码都在GitHUb contentassist
包https://github.com/Enide/nodeclipse-1/tree/master/org.nodeclipse.ui/src/org/nodeclipse/ui/contentassist
答案 0 :(得分:0)
正如@zulus所说:
尝试在javaCompletionProposalComputer中添加activate =“true”并删除
有效的是:
<extension point="org.eclipse.wst.jsdt.ui.javaCompletionProposalComputer"
id="nodeclispe_textual_proposals"
name="Nodeclipse Text Proposals">
<proposalCategory icon="icons/npm/npm.gif"/>
</extension>
<extension point="org.eclipse.wst.jsdt.ui.javaCompletionProposalComputer"
id="NodeclipseProposals"
name="Nodeclipse Proposals">
<javaCompletionProposalComputer
class="org.nodeclipse.ui.contentassist.JSDTProposalComputer"
categoryId="org.eclipse.ui.texteditor.textual_proposals"
activate="true">
</javaCompletionProposalComputer>
</extension>
http://www.nodeclipse.org/img/Completion-for-base-Node.js-modules.PNG
答案 1 :(得分:0)
如果您需要一个实现Pauls的简单示例实现,您可以查看本教程:http://codeandme.blogspot.co.at/2014/05/extending-jsdt-adding-your-own-content.html