/// <summary> /// Create <see cref="NewFolding"/>s for the specified document and updates the folding manager with them. /// </summary> public void UpdateFoldings(FoldingManager manager, TextDocument document) { int firstErrorOffset; IEnumerable <NewFolding> foldings = _strategy.CreateNewFoldings(document, out firstErrorOffset); var errors = foldings.Where(f => f.StartOffset <0 || f.EndOffset> document.TextLength).ToArray(); manager.UpdateFoldings(foldings, firstErrorOffset); }