Search in sources :

Example 1 with StaticFeatureDescriptionWithTypeLiteralReceiver

use of org.eclipse.xtext.xbase.scoping.batch.StaticFeatureDescriptionWithTypeLiteralReceiver in project xtext-eclipse by eclipse.

the class XbaseContentProposalPriorities method adjustCrossReferencePriority.

@Override
public void adjustCrossReferencePriority(final ICompletionProposal proposal, final String prefix) {
    if ((proposal instanceof ConfigurableCompletionProposal)) {
        Object _additionalData = ((ConfigurableCompletionProposal) proposal).getAdditionalData(XbaseProposalProvider.DESCRIPTION_KEY);
        final Object desc = _additionalData;
        boolean _matched = false;
        if (desc instanceof SimpleIdentifiableElementDescription) {
            if (((!Objects.equal(((ConfigurableCompletionProposal) proposal).getReplacementString(), "this")) && (!Objects.equal(((ConfigurableCompletionProposal) proposal).getReplacementString(), "super")))) {
                _matched = true;
                this.adjustPriority(proposal, prefix, 570);
                return;
            }
        }
        if (!_matched) {
            if (desc instanceof StaticFeatureDescriptionWithTypeLiteralReceiver) {
                _matched = true;
                this.adjustPriority(proposal, prefix, 560);
            }
        }
        if (!_matched) {
            if (desc instanceof IIdentifiableElementDescription) {
                _matched = true;
                JvmIdentifiableElement _elementOrProxy = ((IIdentifiableElementDescription) desc).getElementOrProxy();
                boolean _matched_1 = false;
                if (_elementOrProxy instanceof JvmField) {
                    _matched_1 = true;
                    this.adjustPriority(proposal, prefix, 550);
                    return;
                }
                if (!_matched_1) {
                    if (_elementOrProxy instanceof JvmExecutable) {
                        _matched_1 = true;
                        this.adjustPriority(proposal, prefix, 520);
                        return;
                    }
                }
            }
        }
    }
    super.adjustCrossReferencePriority(proposal, prefix);
}
Also used : SimpleIdentifiableElementDescription(org.eclipse.xtext.xbase.scoping.batch.SimpleIdentifiableElementDescription) ConfigurableCompletionProposal(org.eclipse.xtext.ui.editor.contentassist.ConfigurableCompletionProposal) JvmExecutable(org.eclipse.xtext.common.types.JvmExecutable) JvmIdentifiableElement(org.eclipse.xtext.common.types.JvmIdentifiableElement) IIdentifiableElementDescription(org.eclipse.xtext.xbase.scoping.batch.IIdentifiableElementDescription) JvmField(org.eclipse.xtext.common.types.JvmField) StaticFeatureDescriptionWithTypeLiteralReceiver(org.eclipse.xtext.xbase.scoping.batch.StaticFeatureDescriptionWithTypeLiteralReceiver)

Aggregations

JvmExecutable (org.eclipse.xtext.common.types.JvmExecutable)1 JvmField (org.eclipse.xtext.common.types.JvmField)1 JvmIdentifiableElement (org.eclipse.xtext.common.types.JvmIdentifiableElement)1 ConfigurableCompletionProposal (org.eclipse.xtext.ui.editor.contentassist.ConfigurableCompletionProposal)1 IIdentifiableElementDescription (org.eclipse.xtext.xbase.scoping.batch.IIdentifiableElementDescription)1 SimpleIdentifiableElementDescription (org.eclipse.xtext.xbase.scoping.batch.SimpleIdentifiableElementDescription)1 StaticFeatureDescriptionWithTypeLiteralReceiver (org.eclipse.xtext.xbase.scoping.batch.StaticFeatureDescriptionWithTypeLiteralReceiver)1