javaeclipse-plugincontent-assistjsdtnodeclipse

Content assist with javaCompletionProposalComputer for Eclipse JSDT gives no proposal


Content assist with org.eclipse.wst.jsdt.ui.javaCompletionProposalComputer for Eclipse JSDT gives no proposal.

In Preferences -> JavaScript -> Editor -> Content Assist -> Advanced "Nodeclipse Proposals" are visible, and selected.

as advised by Bananaweizen to Content assist for Eclipse JSDT based Editor

in 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 is just wrapper for NodeContentAssistant
(that implements IContentAssistProcessor), that works perfectly well for TextEditor based Editor.

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()));
    }

examples from help are

All code is on GitHUb contentassist package https://github.com/Enide/nodeclipse-1/tree/master/org.nodeclipse.ui/src/org/nodeclipse/ui/contentassist


Solution

  • Exactly as @zulus said:

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

    what worked is:

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


    (source: nodeclipse.org)