简体   繁体   中英

xtext, content assist unwanted suggestions

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

在此输入图像描述

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

} 

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM