Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,19 @@ private static SyntaxNode UpdateSyntaxRoot(MemberDeclarationSyntax memberDeclara
var parentDeclaration = memberDeclaration.Parent;
var memberToMove = new MemberOrderHelper(memberDeclaration, elementOrder);

if (parentDeclaration is TypeDeclarationSyntax)
if (parentDeclaration is TypeDeclarationSyntax syntax)
{
return HandleTypeDeclaration(memberToMove, (TypeDeclarationSyntax)parentDeclaration, elementOrder, syntaxRoot, indentationSettings);
return HandleTypeDeclaration(memberToMove, syntax, elementOrder, syntaxRoot, indentationSettings);
}

if (BaseNamespaceDeclarationSyntaxWrapper.IsInstance(parentDeclaration))
{
return HandleBaseNamespaceDeclaration(memberToMove, (BaseNamespaceDeclarationSyntaxWrapper)parentDeclaration, elementOrder, syntaxRoot, indentationSettings);
}

if (parentDeclaration is CompilationUnitSyntax)
if (parentDeclaration is CompilationUnitSyntax syntax1)
{
return HandleCompilationUnitDeclaration(memberToMove, (CompilationUnitSyntax)parentDeclaration, elementOrder, syntaxRoot, indentationSettings);
return HandleCompilationUnitDeclaration(memberToMove, syntax1, elementOrder, syntaxRoot, indentationSettings);
}

return syntaxRoot;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public bool Equals(TreeTextSpan other)
/// <inheritdoc/>
public override bool Equals(object obj)
{
return (obj is TreeTextSpan) && this.Equals((TreeTextSpan)obj);
return (obj is TreeTextSpan span) && this.Equals(span);
}

/// <inheritdoc/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,29 +99,29 @@ internal static SyntaxTokenList AddModifiers(SyntaxTokenList modifiers, ref Synt

internal static SyntaxTokenList GetModifiers(this MemberDeclarationSyntax syntax)
{
if (syntax is BaseMethodDeclarationSyntax)
if (syntax is BaseMethodDeclarationSyntax syntax1)
{
return ((BaseMethodDeclarationSyntax)syntax).Modifiers;
return syntax1.Modifiers;
}
else if (syntax is BasePropertyDeclarationSyntax)
else if (syntax is BasePropertyDeclarationSyntax syntax2)
{
return ((BasePropertyDeclarationSyntax)syntax).Modifiers;
return syntax2.Modifiers;
}
else if (syntax is BaseTypeDeclarationSyntax)
else if (syntax is BaseTypeDeclarationSyntax syntax3)
{
return ((BaseTypeDeclarationSyntax)syntax).Modifiers;
return syntax3.Modifiers;
}
else if (syntax is BaseFieldDeclarationSyntax)
else if (syntax is BaseFieldDeclarationSyntax syntax4)
{
return ((BaseFieldDeclarationSyntax)syntax).Modifiers;
return syntax4.Modifiers;
}
else if (syntax is DelegateDeclarationSyntax)
else if (syntax is DelegateDeclarationSyntax syntax5)
{
return ((DelegateDeclarationSyntax)syntax).Modifiers;
return syntax5.Modifiers;
}
else if (syntax is IncompleteMemberSyntax)
else if (syntax is IncompleteMemberSyntax syntax6)
{
return ((IncompleteMemberSyntax)syntax).Modifiers;
return syntax6.Modifiers;
}

return default;
Expand Down