blob: 735707c0a5ed071648a5e1a4b5aca5e07a38ce98 [file] [log] [blame]
/**
*
* Copyright (c) 2011, 2015 - Lunifera GmbH (Gross Enzersdorf, Austria), Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Florian Pirchner - Initial implementation
*
* This copyright notice shows up in the generated Java code
*
*/
package org.eclipse.osbp.xtext.oxtype.scoping.eobject
import java.util.Collections
import java.util.Set
import org.eclipse.xtext.naming.QualifiedName
import org.eclipse.xtext.resource.IEObjectDescription
import org.eclipse.xtext.scoping.IScope
import org.eclipse.xtext.scoping.impl.AbstractScope
/**
* Records the scope for all qualified names
*/
class RecordingEObjectScope extends AbstractScope {
private final Set<QualifiedName> importedNames;
new(IScope parent, boolean ignoreCase, Set<QualifiedName> importedNames) {
super(parent, ignoreCase);
this.importedNames = importedNames;
}
override IEObjectDescription getSingleElement(QualifiedName name) {
importedNames.add(name.toLowerCase());
return super.getSingleElement(name);
}
override protected getAllLocalElements() {
Collections.emptyList
}
}