Search code examples
javadslxtextxtend

xtext, content assist unwanted suggestions


I have a Script language with content assist. but this content assists shows same unwanted suggestions.

enter image description here

in this case I don't want the Value - ID and the . to be shown. the other suggestions are correct.

this my method to implement the content assist.

public override completeAttributeRef_AttributeRef(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {

                val classID = (model as AttributeRef).cosem.classid 
                val CosemClasseManager = new CosemClasses()
                var proposal = CosemClasseManager.getAttributeString(classID)

                for (String s : proposal) {
                acceptor.accept(createCompletionProposal(s, s, null , context))}  

} 

Solution

  • In your ProposalProvider you can override the following three methods and have them return false:

    @Override
    protected boolean doCreateIntProposals() {
        return false;
    }
    
    @Override
    protected boolean doCreateStringProposals() {
        return false;
    }
    
    @Override   
    protected boolean doCreateIdProposals() {
        return false;
    }
    

    Those are responsible for determining whether the default proposals for INT, STRING and ID proposals should be shown.