Report error from target file

Fix issue #779
just call it getDeclarationDiagnostics