Use getDeclarationLocation to resolve identifiers

In open statements.