gpt4 book ai didi

java - javaCompletionProposalComputer for Eclipse JSDT 的内容协助没有给出建议

转载 作者:太空宇宙 更新时间:2023-11-04 15:17:15 26 4
gpt4 key购买 nike

针对 Eclipse JSDT 的 org.eclipse.wst.jsdt.ui.javaCompletionProposalComputer 的内容协助未提供建议。

首选项 -> JavaScript -> 编辑器 -> 内容辅助 -> 高级“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 contentassisthttps://github.com/Enide/nodeclipse-1/tree/master/org.nodeclipse.ui/src/org/nodeclipse/ui/contentassist

最佳答案

正如@zulus所说:

try to add activate="true" in javaCompletionProposalComputer and remove

有效的是:

<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>


(来源:nodeclipse.org)

关于java - javaCompletionProposalComputer for Eclipse JSDT 的内容协助没有给出建议,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20779899/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com