private void AddSpacingSuppressOperation(SuppressOperation operation, bool twoTokensOnSameLine) { // don't add stuff if it is empty if (operation == null || operation.TextSpan.IsEmpty) { return; } // we might need to merge bits with enclosing suppress flag var option = operation.Option; if (!option.IsMaskOn(SuppressOption.NoSpacing) || this.suppressSpacingMap.Contains(operation.TextSpan)) { return; } if (!(option.IsOn(SuppressOption.NoSpacingIfOnSingleLine) && twoTokensOnSameLine) && !(option.IsOn(SuppressOption.NoSpacingIfOnMultipleLine) && !twoTokensOnSameLine)) { return; } var data = new SuppressSpacingData(operation.TextSpan, noSpacing: true); this.suppressSpacingMap.Add(operation.TextSpan); this.suppressSpacingTree.AddIntervalInPlace(data); }
private void AddFormattingSuppressOperation(SuppressOperation operation) { // don't add stuff if it is empty if (operation == null || operation.TextSpan.IsEmpty) { return; } // we might need to merge bits with enclosing suppress flag var option = operation.Option; if (!option.IsOn(SuppressOption.DisableFormatting) || _suppressFormattingMap.Contains(operation.TextSpan)) { return; } var data = new SuppressSpacingData(operation.TextSpan); _suppressFormattingMap.Add(operation.TextSpan); _suppressFormattingTree.AddIntervalInPlace(data); }