private string GetSource(string fileName) { var source = languageService.GetSource(fileName); if (source != null) { // file is already open, get the unsaved source from there return source.GetText(); } return File.ReadAllText(fileName); }