// to create a new AST.
// TODO Detect whether the file has changed since the definition was created.
if( workspace != null )
{
ASScope s = scope;
ASFileScope fileScope = null;
// Get the file scope, and reconnect the AST to the definitions/scopes that
// already exist
while( s != null )
{
if( s instanceof ASFileScope )
{
fileScope = (ASFileScope)s;
}
s = s.getContainingScope();
}
if( fileScope != null) {
// Grab the lock
synchronized (this)
{
// Check again in case another thread already updated the node reference
node = nodeRef.get();
if(node != null )
return node;
// Get the file node from the file scope
IASNode fileNode = fileScope.getNode();
if (fileNode != null)
{
// Find the node that produced this definition,
// using the starting offset stored in this definition.