Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
josefpihrt committed Jan 28, 2022
1 parent 6a03918 commit f900252
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/Common/ConfigOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public static bool TryGetValue(AnalyzerConfigOptions configOptions, ConfigOption
public static string GetValue(AnalyzerConfigOptions configOptions, ConfigOptionDescriptor option, string defaultValue = null)
{
if (configOptions.TryGetValue(option.Key, out string value))
return value;
return value;

return defaultValue
?? CodeAnalysisConfig.Instance.EditorConfig.Options.GetValueOrDefault(option.Key)
Expand Down
2 changes: 1 addition & 1 deletion src/Common/Configuration/ConfigMigrator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ static void MarkFileAsMigrated(string path)
}

if (!File.Exists(newPath))
File.Move(path, newPath);
File.Move(path, newPath);
}

static (string, string) MapRuleSetOptionToEditorConfigOption(KeyValuePair<string, ReportDiagnostic> kvp)
Expand Down
20 changes: 10 additions & 10 deletions src/Formatting.Analyzers/CSharp/FixFormattingOfCallChainAnalyzer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,18 @@ private static void AnalyzeExpression(SyntaxNodeAnalysisContext context)
{
var memberBinding = (MemberBindingExpressionSyntax)en.Current;

if (!memberBinding.HasLeadingTrivia)
{
SyntaxToken prevToken = memberBinding.GetFirstToken().GetPreviousToken();
if (!memberBinding.HasLeadingTrivia)
{
SyntaxToken prevToken = memberBinding.GetFirstToken().GetPreviousToken();

if (prevToken.IsKind(SyntaxKind.QuestionToken)
&& prevToken.IsParentKind(SyntaxKind.ConditionalAccessExpression)
&& prevToken.HasLeadingTrivia
&& prevToken.TrailingTrivia.IsEmptyOrSingleWhitespaceTrivia())
{
continue;
}
if (prevToken.IsKind(SyntaxKind.QuestionToken)
&& prevToken.IsParentKind(SyntaxKind.ConditionalAccessExpression)
&& prevToken.HasLeadingTrivia
&& prevToken.TrailingTrivia.IsEmptyOrSingleWhitespaceTrivia())
{
continue;
}
}

if (AnalyzeToken(memberBinding.OperatorToken))
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public static async Task ComputeRefactoringsAsync(RefactoringContext context, In
AddAllPropertiesToInitializerRefactoring.ComputeRefactorings(context, initializer, semanticModdel);
}

await ExpandInitializerRefactoring.ComputeRefactoringsAsync(context, initializer).ConfigureAwait(false);
await ExpandInitializerRefactoring.ComputeRefactoringsAsync(context, initializer).ConfigureAwait(false);

if (context.IsRefactoringEnabled(RefactoringDescriptors.UseIndexInitializer)
&& context.SupportsCSharp6)
Expand Down
2 changes: 1 addition & 1 deletion src/VisualStudio/CodeFixesOptionsPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ protected override void OnApply(PageApplyEventArgs e)

internal void UpdateConfig()
{
CodeAnalysisConfig.UpdateVisualStudioConfig(f => f.WithCodeFixes(GetItems()));
CodeAnalysisConfig.UpdateVisualStudioConfig(f => f.WithCodeFixes(GetItems()));
}

protected override void Fill(ICollection<BaseModel> items)
Expand Down

0 comments on commit f900252

Please sign in to comment.