Modified missing import diagnosis to include required imports as well as
optional.