|
|
|
|
|
|
Re: Xtext Proposal Provider: Remove "super" etc. from list [message #1780031 is a reply to message #1780030] |
Tue, 16 January 2018 15:57 |
|
besides this you can try something like
public class DomainModelFeatureScopes extends FeatureScopes {
@Override
protected IScope createLocalVariableScope(EObject featureCall, IScope parent, IFeatureScopeSession session,
IResolvedTypes resolvedTypes) {
return new LocalVariableScope(parent, session, asAbstractFeatureCall(featureCall)) {
@Override
public IEObjectDescription getSingleElement(QualifiedName name) {
if (IFeatureNames.THIS.equals(name) || IFeatureNames.SUPER.equals(name)) {
return null;
}
return super.getSingleElement(name);
}
@Override
protected List<IEObjectDescription> getLocalElementsByName(QualifiedName name) {
if (IFeatureNames.THIS.equals(name) || IFeatureNames.SUPER.equals(name)) {
return Collections.emptyList();
}
return super.getLocalElementsByName(name);
}
@Override
protected List<IEObjectDescription> getAllLocalElements() {
return IterableExtensions.toList(Iterables.filter(super.getAllLocalElements(), new Predicate<IEObjectDescription>() {
@Override
public boolean apply(IEObjectDescription d) {
return !IFeatureNames.THIS.equals(d.getQualifiedName()) && !IFeatureNames.SUPER.equals(d.getQualifiedName());
}
}));
}
};
}
}
or move the filtering to
org.eclipse.xtext.xbase.ui.contentassist.XbaseReferenceProposalCreator.queryScope(IScope, EObject, EReference, Predicate<IEObjectDescription>)
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
|
Powered by
FUDForum. Page generated in 0.05230 seconds