Fix declaration name access if not fully parsed
Summary:
Fixes the crash in KDE bug #363713 that is caused by requesting code
completion on a not fully parsed QML file. For details, please see
backtrace in bug report.
BUG: 363713
Reviewers: mwolff, KDevelop, kfunk
Reviewed By: KDevelop, kfunk
Subscribers: kfunk, kdevelop-devel
Differential Revision: https://phabricator.kde.org/D1740