use of org.eclipse.n4js.ts.types.TVariable in project n4js by eclipse.
the class ExportedVariableBindingImpl method setDefinedVariable.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setDefinedVariable(TVariable newDefinedVariable) {
TVariable oldDefinedVariable = definedVariable;
definedVariable = newDefinedVariable;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, N4JSPackage.EXPORTED_VARIABLE_BINDING__DEFINED_VARIABLE, oldDefinedVariable, definedVariable));
}
use of org.eclipse.n4js.ts.types.TVariable in project n4js by eclipse.
the class ExportedVariableDeclarationImpl method setDefinedVariable.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setDefinedVariable(TVariable newDefinedVariable) {
TVariable oldDefinedVariable = definedVariable;
definedVariable = newDefinedVariable;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, N4JSPackage.EXPORTED_VARIABLE_DECLARATION__DEFINED_VARIABLE, oldDefinedVariable, definedVariable));
}
use of org.eclipse.n4js.ts.types.TVariable in project n4js by eclipse.
the class SymbolOfIdentifierRef method getDeclaration.
@Override
public EObject getDeclaration() {
VariableDeclaration varDecl = null;
IdentifiableElement id = ir.getId();
if (id instanceof TVariable) {
TVariable tvar = (TVariable) id;
varDecl = (VariableDeclaration) tvar.getAstElement();
return varDecl;
} else {
// id instanceof VariableDeclaration
return id;
}
}
use of org.eclipse.n4js.ts.types.TVariable in project n4js by eclipse.
the class UsedBeforeDeclaredAnalyserFastVersion method visit.
@Override
protected void visit(ControlFlowElement cfe) {
if (cfe instanceof VariableDeclaration) {
checkLists.put((VariableDeclaration) cfe, new HashSet<>());
}
if (cfe instanceof IdentifierRef) {
IdentifierRef ir = (IdentifierRef) cfe;
IdentifiableElement id = ir.getId();
if (id instanceof TVariable) {
TVariable tvar = (TVariable) id;
id = (VariableDeclaration) tvar.getAstElement();
}
Set<IdentifierRef> refs = checkLists.get(id);
if (refs != null) {
refs.add(ir);
}
}
}
use of org.eclipse.n4js.ts.types.TVariable in project n4js by eclipse.
the class N4JSResourceDescription method getImportedNames.
@Override
public Iterable<QualifiedName> getImportedNames() {
if (null == lazyImportedNames) {
synchronized (this) {
if (null == lazyImportedNames) {
// get imported names collected during global scoping
// the scope provider registers every request in scoping so that by this
// also all names are collected that cannot be resolved
Iterable<QualifiedName> superImportedNames = super.getImportedNames();
// use sorted set to ensure order of items
final SortedSet<QualifiedName> importedNames;
if (superImportedNames != null) {
importedNames = Sets.newTreeSet(superImportedNames);
} else {
importedNames = Sets.<QualifiedName>newTreeSet();
}
// import our own module name to get a proper change notification
Resource resource = getResource();
List<EObject> contents = resource.getContents();
if (contents.size() > 1) {
TModule module = (TModule) contents.get(1);
importedNames.add(qualifiedNameProvider.getFullyQualifiedName(module));
}
final Set<EObject> crossRefTypes = Sets.newHashSet();
IAcceptor<EObject> acceptor = getCrossRefTypeAcceptor(crossRefTypes);
crossReferenceComputer.computeCrossRefs(resource, acceptor);
for (EObject type : crossRefTypes) {
if (type instanceof Type) {
handleType(importedNames, type);
} else if (type instanceof TVariable) {
handleTVariable(importedNames, (TVariable) type);
} else if (type instanceof TEnumLiteral) {
handleTEnumLiteral(importedNames, (TEnumLiteral) type);
}
}
this.lazyImportedNames = importedNames;
}
}
}
return lazyImportedNames;
}
Aggregations