Fix processing unsaved files. Support for searching for declaration first.