xtext,内容协助不需要的建议

问题描述:

我有一个脚本语言与内容协助。但此内容有助于显示相同的不需要的建议。xtext,内容协助不需要的建议

enter image description here

在这种情况下,我不希望要显示Value - ID.。 其他建议是正确的。

这是我的方法来实现内容协助。

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

} 

在你ProposalProvider您可以覆盖以下三种方法,让他们返回false

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

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

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

那些负责决定是否对INTSTRINGID建议默认建议应该显示。