correctly watch documents for script changes while parsing.