public override AdjustSpacesOperation GetAdjustSpacesOperation(SyntaxToken previousToken, SyntaxToken currentToken, OptionSet optionSet, NextOperation <AdjustSpacesOperation> nextOperation) { var spaceOperation = base.GetAdjustSpacesOperation(previousToken, currentToken, optionSet, nextOperation); // if there is force space operation, convert it to ForceSpaceIfSingleLine operation. // (force space basically means remove all line breaks) if (spaceOperation != null && spaceOperation.Option == AdjustSpacesOption.ForceSpaces) { return(FormattingOperations.CreateAdjustSpacesOperation(spaceOperation.Space, AdjustSpacesOption.ForceSpacesIfOnSingleLine)); } return(spaceOperation); }
// return 1 space for every token pairs as a default operation public AdjustSpacesOperation GetAdjustSpacesOperation(SyntaxToken previousToken, SyntaxToken currentToken, OptionSet optionSet, NextOperation <AdjustSpacesOperation> nextOperation) { int space = currentToken.Kind() == SyntaxKind.EndOfFileToken ? 0 : 1; return(FormattingOperations.CreateAdjustSpacesOperation(space, AdjustSpacesOption.DefaultSpacesIfOnSingleLine)); }
protected AdjustSpacesOperation CreateAdjustSpacesOperation(int space, AdjustSpacesOption option) { return(FormattingOperations.CreateAdjustSpacesOperation(space, option)); }
protected AdjustSpacesOperation CreateAdjustSpacesOperation(int space, AdjustSpacesOption option) => FormattingOperations.CreateAdjustSpacesOperation(space, option);