-1

I am trying to develop a JDT content assist for a custom framework, I am actually writing a plugin for JSDT but even if I can get good reference for JDT, I can relate to JSDT, so far I am able to get my list of type ahead content but not able to filter it out based on user entered text for e.g. I have 1 object at root named "Object" so if the user presses Control + Space on an empty line he will get the only object in assist text if he does Control + Space after typing "Object." it should show an instance of variables inside "Object" it could be, Object.Name, Object.Feature. So far no matter what I have typed I am getting all the list and I don't know how to filter it out then put helper texts on Assists.

My code is as follows

public class CustomCompletionProposalComputer implements ICodeAssist,IJavaCompletionProposalComputer,
                                            IJavadocCompletionProcessor,IQuickAssistProcessor,IQueryParticipant  {

@Override
public void sessionStarted() {
}

@Override
public List computeCompletionProposals(ContentAssistInvocationContext context, IProgressMonitor monitor) {

    ArrayList<CompletionProposal> proposals = new ArrayList<CompletionProposal>();

    proposals.add(new CompletionProposal("Facade", context.getInvocationOffset(), 0, "Object".length()));
    proposals.add(new CompletionProposal("vivek", context.getInvocationOffset(), 0, "Name".length()));
    ......

    return proposals;
}

@Override
public List computeContextInformation(ContentAssistInvocationContext context, IProgressMonitor monitor) {
    return null;
}

@Override
public String getErrorMessage() {
    return null;
}

@Override
public void sessionEnded() {
}

I am not able to find any decent example around it, API doc is not much help, any reference or help is highly appreciated.

Vivek
  • 580
  • 2
  • 7
  • 26

1 Answers1

0

Have located decent resource around this. Link to Grail-IDE project

Vivek
  • 580
  • 2
  • 7
  • 26