public CSharpSyntaxFormattingOptions( bool useTabs, int tabSize, int indentationSize, string newLine, bool separateImportDirectiveGroups, SpacePlacement spacing, BinaryOperatorSpacingOptions spacingAroundBinaryOperator, NewLinePlacement newLines, LabelPositionOptions labelPositioning, IndentationPlacement indentation, bool wrappingKeepStatementsOnSingleLine, bool wrappingPreserveSingleLine) : base(useTabs, tabSize, indentationSize, newLine, separateImportDirectiveGroups) { Spacing = spacing; SpacingAroundBinaryOperator = spacingAroundBinaryOperator; NewLines = newLines; LabelPositioning = labelPositioning; Indentation = indentation; WrappingKeepStatementsOnSingleLine = wrappingKeepStatementsOnSingleLine; WrappingPreserveSingleLine = wrappingPreserveSingleLine; }
public void TestParseEditorConfigLabelPositioningTrue( string value, LabelPositionOptions expectedValue ) { Assert.True( ParseEditorConfigLabelPositioning(value) == expectedValue, $"Expected option {value} to be parsed as set." ); }
public CSharpSyntaxFormattingOptions( LineFormattingOptions?lineFormatting = null, bool separateImportDirectiveGroups = false, SpacePlacement spacing = SpacingDefault, BinaryOperatorSpacingOptions spacingAroundBinaryOperator = BinaryOperatorSpacingOptions.Single, NewLinePlacement newLines = NewLinesDefault, LabelPositionOptions labelPositioning = LabelPositionOptions.OneLess, IndentationPlacement indentation = IndentationDefault, bool wrappingKeepStatementsOnSingleLine = true, bool wrappingPreserveSingleLine = true) : base(lineFormatting, separateImportDirectiveGroups) { Spacing = spacing; SpacingAroundBinaryOperator = spacingAroundBinaryOperator; NewLines = newLines; LabelPositioning = labelPositioning; Indentation = indentation; WrappingKeepStatementsOnSingleLine = wrappingKeepStatementsOnSingleLine; WrappingPreserveSingleLine = wrappingPreserveSingleLine; }
private static string GetLabelPositionOptionEditorConfigString( LabelPositionOptions value ) => s_labelPositionOptionsEditorConfigMap.TryGetKey(value, out var key) ? key : "";
public void TestParseLabelPositioning(string rawValue, LabelPositionOptions parsedValue) { Assert.Equal(parsedValue, CSharpFormattingOptions.ParseEditorConfigLabelPositioning(rawValue)); }
static void TestParseEditorConfigLabelPositioningTrue(string value, LabelPositionOptions expectedValue) { Assert.True(ParseEditorConfigLablePositioning(value) == expectedValue, $"Expected option {value} to be parsed as set."); }