Resolve dangling annotations in files and class bodies