Content help with javaCompletionProposalComputer for Eclipse JSDT doesn't give suggestions

Content support using org.eclipse.wst.jsdt.ui.javaCompletionProposalComputer for Eclipse JSDT gives no suggestions.

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

as Bananaveisen advised, Content support for the Eclipse JSDT 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 a wrapper for NodeContentAssistant
(which implements IContentAssistProcessor ), which works great for a 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

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

+1
source share
2 answers

Just like @zulus said:

try adding activ = "true" in javaCompletionProposalComputer and remove

what worked:

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

0
source

If you need a simple example of implementing the implementation of the Pauls answer, you can check out this tutorial: http://codeandme.blogspot.co.at/2014/05/extending-jsdt-adding-your-own-content.html

0
source

Source: https://habr.com/ru/post/1485754/


All Articles