10 types derived from TypeSyntax
Microsoft.CodeAnalysis.CSharp (10)
_generated\2\Syntax.xml.Syntax.Generated.cs (10)
15public abstract partial class NameSyntax : TypeSyntax 324public sealed partial class PredefinedTypeSyntax : TypeSyntax 364public sealed partial class ArrayTypeSyntax : TypeSyntax 478public sealed partial class PointerTypeSyntax : TypeSyntax 522public sealed partial class FunctionPointerTypeSyntax : TypeSyntax 797public sealed partial class NullableTypeSyntax : TypeSyntax 842public sealed partial class TupleTypeSyntax : TypeSyntax 951public sealed partial class OmittedTypeArgumentSyntax : TypeSyntax 991public sealed partial class RefTypeSyntax : TypeSyntax 1045public sealed partial class ScopedTypeSyntax : TypeSyntax
1334 references to TypeSyntax
ILLink.CodeFixProvider (1)
RequiresUnsafeCodeFixProvider.cs (1)
213TypeSyntax? typeSyntax = localDecl.Declaration.Type;
Microsoft.AspNetCore.App.CodeFixes (4)
RouteParameterUnusedParameterFixer.cs (4)
22private static readonly TypeSyntax DefaultType = SyntaxFactory.ParseTypeName("string"); 81var resolvedType = CalculateTypeFromPolicy(routeParameterPolicy); 88var type = resolvedType.WithAdditionalAnnotations(new SyntaxAnnotation("CodeAction_Navigation")); 124private static TypeSyntax CalculateTypeFromPolicy(string? routeParameterPolicy)
Microsoft.AspNetCore.Components.Analyzers (1)
ComponentParametersShouldBePublicCodeFixProvider.cs (1)
62TypeSyntax type = node.Type;
Microsoft.AspNetCore.Components.SdkAnalyzers (1)
ComponentParametersShouldBePublicCodeFixProvider.cs (1)
62TypeSyntax type = node.Type;
Microsoft.CodeAnalysis.CSharp (540)
_generated\0\Syntax.xml.Main.Generated.cs (144)
1541=> node.Update((TypeSyntax?)Visit(node.ElementType) ?? throw new ArgumentNullException("elementType"), VisitList(node.RankSpecifiers)); 1547=> node.Update((TypeSyntax?)Visit(node.ElementType) ?? throw new ArgumentNullException("elementType"), VisitToken(node.AsteriskToken)); 1565=> node.Update((TypeSyntax?)Visit(node.ElementType) ?? throw new ArgumentNullException("elementType"), VisitToken(node.QuestionToken)); 1571=> node.Update((TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type"), VisitToken(node.Identifier)); 1577=> node.Update(VisitToken(node.RefKeyword), VisitToken(node.ReadOnlyKeyword), (TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type")); 1580=> node.Update(VisitToken(node.ScopedKeyword), (TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type")); 1643=> node.Update(VisitToken(node.Keyword), VisitToken(node.OpenParenToken), (ExpressionSyntax?)Visit(node.Expression) ?? throw new ArgumentNullException("expression"), VisitToken(node.Comma), (TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type"), VisitToken(node.CloseParenToken)); 1649=> node.Update(VisitToken(node.Keyword), VisitToken(node.OpenParenToken), (TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type"), VisitToken(node.CloseParenToken)); 1652=> node.Update(VisitToken(node.Keyword), VisitToken(node.OpenParenToken), (TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type"), VisitToken(node.CloseParenToken)); 1655=> node.Update(VisitToken(node.Keyword), VisitToken(node.OpenParenToken), (TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type"), VisitToken(node.CloseParenToken)); 1679=> node.Update((TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type"), (VariableDesignationSyntax?)Visit(node.Designation) ?? throw new ArgumentNullException("designation")); 1682=> node.Update(VisitToken(node.OpenParenToken), (TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type"), VisitToken(node.CloseParenToken), (ExpressionSyntax?)Visit(node.Expression) ?? throw new ArgumentNullException("expression")); 1694=> node.Update(VisitList(node.AttributeLists), VisitList(node.Modifiers), (TypeSyntax?)Visit(node.ReturnType), (ParameterListSyntax?)Visit(node.ParameterList) ?? throw new ArgumentNullException("parameterList"), VisitToken(node.ArrowToken), (BlockSyntax?)Visit(node.Block), (ExpressionSyntax?)Visit(node.ExpressionBody)); 1703=> node.Update(VisitToken(node.NewKeyword), (TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type"), (ArgumentListSyntax?)Visit(node.ArgumentList), (InitializerExpressionSyntax?)Visit(node.Initializer)); 1721=> node.Update(VisitToken(node.StackAllocKeyword), (TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type"), (InitializerExpressionSyntax?)Visit(node.Initializer)); 1746=> node.Update(VisitToken(node.FromKeyword), (TypeSyntax?)Visit(node.Type), VisitToken(node.Identifier), VisitToken(node.InKeyword), (ExpressionSyntax?)Visit(node.Expression) ?? throw new ArgumentNullException("expression")); 1752=> node.Update(VisitToken(node.JoinKeyword), (TypeSyntax?)Visit(node.Type), VisitToken(node.Identifier), VisitToken(node.InKeyword), (ExpressionSyntax?)Visit(node.InExpression) ?? throw new ArgumentNullException("inExpression"), VisitToken(node.OnKeyword), (ExpressionSyntax?)Visit(node.LeftExpression) ?? throw new ArgumentNullException("leftExpression"), VisitToken(node.EqualsKeyword), (ExpressionSyntax?)Visit(node.RightExpression) ?? throw new ArgumentNullException("rightExpression"), (JoinIntoClauseSyntax?)Visit(node.Into)); 1794=> node.Update((TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type"), (VariableDesignationSyntax?)Visit(node.Designation) ?? throw new ArgumentNullException("designation")); 1800=> node.Update((TypeSyntax?)Visit(node.Type), (PositionalPatternClauseSyntax?)Visit(node.PositionalPatternClause), (PropertyPatternClauseSyntax?)Visit(node.PropertyPatternClause), (VariableDesignationSyntax?)Visit(node.Designation)); 1821=> node.Update((TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type")); 1854=> node.Update(VisitList(node.AttributeLists), VisitList(node.Modifiers), (TypeSyntax?)Visit(node.ReturnType) ?? throw new ArgumentNullException("returnType"), VisitToken(node.Identifier), (TypeParameterListSyntax?)Visit(node.TypeParameterList), (ParameterListSyntax?)Visit(node.ParameterList) ?? throw new ArgumentNullException("parameterList"), VisitList(node.ConstraintClauses), (BlockSyntax?)Visit(node.Body), (ArrowExpressionClauseSyntax?)Visit(node.ExpressionBody), VisitToken(node.SemicolonToken)); 1860=> node.Update((TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type"), VisitList(node.Variables)); 1914=> node.Update(VisitList(node.AttributeLists), VisitToken(node.AwaitKeyword), VisitToken(node.ForEachKeyword), VisitToken(node.OpenParenToken), (TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type"), VisitToken(node.Identifier), VisitToken(node.InKeyword), (ExpressionSyntax?)Visit(node.Expression) ?? throw new ArgumentNullException("expression"), VisitToken(node.CloseParenToken), (StatementSyntax?)Visit(node.Statement) ?? throw new ArgumentNullException("statement")); 1968=> node.Update(VisitToken(node.OpenParenToken), (TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type"), VisitToken(node.Identifier), VisitToken(node.CloseParenToken)); 1983=> node.Update(VisitToken(node.GlobalKeyword), VisitToken(node.UsingKeyword), VisitToken(node.StaticKeyword), VisitToken(node.UnsafeKeyword), (NameEqualsSyntax?)Visit(node.Alias), (TypeSyntax?)Visit(node.NamespaceOrType) ?? throw new ArgumentNullException("namespaceOrType"), VisitToken(node.SemicolonToken)); 2035=> node.Update(VisitList(node.AttributeLists), VisitList(node.Modifiers), VisitToken(node.DelegateKeyword), (TypeSyntax?)Visit(node.ReturnType) ?? throw new ArgumentNullException("returnType"), VisitToken(node.Identifier), (TypeParameterListSyntax?)Visit(node.TypeParameterList), (ParameterListSyntax?)Visit(node.ParameterList) ?? throw new ArgumentNullException("parameterList"), VisitList(node.ConstraintClauses), VisitToken(node.SemicolonToken)); 2047=> node.Update((TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type")); 2050=> node.Update((TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type"), (ArgumentListSyntax?)Visit(node.ArgumentList) ?? throw new ArgumentNullException("argumentList")); 2062=> node.Update((TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type")); 2083=> node.Update(VisitList(node.AttributeLists), VisitList(node.Modifiers), (TypeSyntax?)Visit(node.ReturnType) ?? throw new ArgumentNullException("returnType"), (ExplicitInterfaceSpecifierSyntax?)Visit(node.ExplicitInterfaceSpecifier), VisitToken(node.Identifier), (TypeParameterListSyntax?)Visit(node.TypeParameterList), (ParameterListSyntax?)Visit(node.ParameterList) ?? throw new ArgumentNullException("parameterList"), VisitList(node.ConstraintClauses), (BlockSyntax?)Visit(node.Body), (ArrowExpressionClauseSyntax?)Visit(node.ExpressionBody), VisitToken(node.SemicolonToken)); 2086=> node.Update(VisitList(node.AttributeLists), VisitList(node.Modifiers), (TypeSyntax?)Visit(node.ReturnType) ?? throw new ArgumentNullException("returnType"), (ExplicitInterfaceSpecifierSyntax?)Visit(node.ExplicitInterfaceSpecifier), VisitToken(node.OperatorKeyword), VisitToken(node.CheckedKeyword), VisitToken(node.OperatorToken), (ParameterListSyntax?)Visit(node.ParameterList) ?? throw new ArgumentNullException("parameterList"), (BlockSyntax?)Visit(node.Body), (ArrowExpressionClauseSyntax?)Visit(node.ExpressionBody), VisitToken(node.SemicolonToken)); 2089=> node.Update(VisitList(node.AttributeLists), VisitList(node.Modifiers), VisitToken(node.ImplicitOrExplicitKeyword), (ExplicitInterfaceSpecifierSyntax?)Visit(node.ExplicitInterfaceSpecifier), VisitToken(node.OperatorKeyword), VisitToken(node.CheckedKeyword), (TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type"), (ParameterListSyntax?)Visit(node.ParameterList) ?? throw new ArgumentNullException("parameterList"), (BlockSyntax?)Visit(node.Body), (ArrowExpressionClauseSyntax?)Visit(node.ExpressionBody), VisitToken(node.SemicolonToken)); 2101=> node.Update(VisitList(node.AttributeLists), VisitList(node.Modifiers), (TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type"), (ExplicitInterfaceSpecifierSyntax?)Visit(node.ExplicitInterfaceSpecifier), VisitToken(node.Identifier), (AccessorListSyntax?)Visit(node.AccessorList), (ArrowExpressionClauseSyntax?)Visit(node.ExpressionBody), (EqualsValueClauseSyntax?)Visit(node.Initializer), VisitToken(node.SemicolonToken)); 2107=> node.Update(VisitList(node.AttributeLists), VisitList(node.Modifiers), VisitToken(node.EventKeyword), (TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type"), (ExplicitInterfaceSpecifierSyntax?)Visit(node.ExplicitInterfaceSpecifier), VisitToken(node.Identifier), (AccessorListSyntax?)Visit(node.AccessorList), VisitToken(node.SemicolonToken)); 2110=> node.Update(VisitList(node.AttributeLists), VisitList(node.Modifiers), (TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type"), (ExplicitInterfaceSpecifierSyntax?)Visit(node.ExplicitInterfaceSpecifier), VisitToken(node.ThisKeyword), (BracketedParameterListSyntax?)Visit(node.ParameterList) ?? throw new ArgumentNullException("parameterList"), (AccessorListSyntax?)Visit(node.AccessorList), (ArrowExpressionClauseSyntax?)Visit(node.ExpressionBody), VisitToken(node.SemicolonToken)); 2125=> node.Update(VisitList(node.AttributeLists), VisitList(node.Modifiers), (TypeSyntax?)Visit(node.Type), VisitToken(node.Identifier), (EqualsValueClauseSyntax?)Visit(node.Default)); 2128=> node.Update(VisitList(node.AttributeLists), VisitList(node.Modifiers), (TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type")); 2131=> node.Update(VisitList(node.AttributeLists), VisitList(node.Modifiers), (TypeSyntax?)Visit(node.Type)); 2140=> node.Update((TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type")); 2143=> node.Update((TypeSyntax?)Visit(node.Container) ?? throw new ArgumentNullException("container"), VisitToken(node.DotToken), (MemberCrefSyntax?)Visit(node.Member) ?? throw new ArgumentNullException("member")); 2146=> node.Update((TypeSyntax?)Visit(node.Name) ?? throw new ArgumentNullException("name"), (CrefParameterListSyntax?)Visit(node.Parameters)); 2158=> node.Update(VisitToken(node.ImplicitOrExplicitKeyword), VisitToken(node.OperatorKeyword), VisitToken(node.CheckedKeyword), (TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type"), (CrefParameterListSyntax?)Visit(node.Parameters)); 2167=> node.Update(VisitToken(node.RefKindKeyword), VisitToken(node.ReadOnlyKeyword), (TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type")); 2317public static TypeArgumentListSyntax TypeArgumentList(SyntaxToken lessThanToken, SeparatedSyntaxList<TypeSyntax> arguments, SyntaxToken greaterThanToken) 2325public static TypeArgumentListSyntax TypeArgumentList(SeparatedSyntaxList<TypeSyntax> arguments = default) 2372public static ArrayTypeSyntax ArrayType(TypeSyntax elementType, SyntaxList<ArrayRankSpecifierSyntax> rankSpecifiers) 2379public static ArrayTypeSyntax ArrayType(TypeSyntax elementType) 2395public static PointerTypeSyntax PointerType(TypeSyntax elementType, SyntaxToken asteriskToken) 2403public static PointerTypeSyntax PointerType(TypeSyntax elementType) 2471public static NullableTypeSyntax NullableType(TypeSyntax elementType, SyntaxToken questionToken) 2479public static NullableTypeSyntax NullableType(TypeSyntax elementType) 2495public static TupleElementSyntax TupleElement(TypeSyntax type, SyntaxToken identifier) 2508public static TupleElementSyntax TupleElement(TypeSyntax type) 2523public static RefTypeSyntax RefType(SyntaxToken refKeyword, SyntaxToken readOnlyKeyword, TypeSyntax type) 2537public static RefTypeSyntax RefType(TypeSyntax type) 2541public static ScopedTypeSyntax ScopedType(SyntaxToken scopedKeyword, TypeSyntax type) 2549public static ScopedTypeSyntax ScopedType(TypeSyntax type) 3039public static RefValueExpressionSyntax RefValueExpression(SyntaxToken keyword, SyntaxToken openParenToken, ExpressionSyntax expression, SyntaxToken comma, TypeSyntax type, SyntaxToken closeParenToken) 3051public static RefValueExpressionSyntax RefValueExpression(ExpressionSyntax expression, TypeSyntax type) 3088public static DefaultExpressionSyntax DefaultExpression(SyntaxToken keyword, SyntaxToken openParenToken, TypeSyntax type, SyntaxToken closeParenToken) 3098public static DefaultExpressionSyntax DefaultExpression(TypeSyntax type) 3102public static TypeOfExpressionSyntax TypeOfExpression(SyntaxToken keyword, SyntaxToken openParenToken, TypeSyntax type, SyntaxToken closeParenToken) 3112public static TypeOfExpressionSyntax TypeOfExpression(TypeSyntax type) 3116public static SizeOfExpressionSyntax SizeOfExpression(SyntaxToken keyword, SyntaxToken openParenToken, TypeSyntax type, SyntaxToken closeParenToken) 3126public static SizeOfExpressionSyntax SizeOfExpression(TypeSyntax type) 3213public static DeclarationExpressionSyntax DeclarationExpression(TypeSyntax type, VariableDesignationSyntax designation) 3221public static CastExpressionSyntax CastExpression(SyntaxToken openParenToken, TypeSyntax type, SyntaxToken closeParenToken, ExpressionSyntax expression) 3231public static CastExpressionSyntax CastExpression(TypeSyntax type, ExpressionSyntax expression) 3263public static ParenthesizedLambdaExpressionSyntax ParenthesizedLambdaExpression(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax? returnType, ParameterListSyntax parameterList, SyntaxToken arrowToken, BlockSyntax? block, ExpressionSyntax? expressionBody) 3271public static ParenthesizedLambdaExpressionSyntax ParenthesizedLambdaExpression(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax? returnType, ParameterListSyntax parameterList, BlockSyntax? block, ExpressionSyntax? expressionBody) 3316public static ObjectCreationExpressionSyntax ObjectCreationExpression(SyntaxToken newKeyword, TypeSyntax type, ArgumentListSyntax? argumentList, InitializerExpressionSyntax? initializer) 3324public static ObjectCreationExpressionSyntax ObjectCreationExpression(TypeSyntax type, ArgumentListSyntax? argumentList, InitializerExpressionSyntax? initializer) 3328public static ObjectCreationExpressionSyntax ObjectCreationExpression(TypeSyntax type) 3403public static StackAllocArrayCreationExpressionSyntax StackAllocArrayCreationExpression(SyntaxToken stackAllocKeyword, TypeSyntax type, InitializerExpressionSyntax? initializer) 3411public static StackAllocArrayCreationExpressionSyntax StackAllocArrayCreationExpression(TypeSyntax type, InitializerExpressionSyntax? initializer) 3415public static StackAllocArrayCreationExpressionSyntax StackAllocArrayCreationExpression(TypeSyntax type) 3497public static FromClauseSyntax FromClause(SyntaxToken fromKeyword, TypeSyntax? type, SyntaxToken identifier, SyntaxToken inKeyword, ExpressionSyntax expression) 3507public static FromClauseSyntax FromClause(TypeSyntax? type, SyntaxToken identifier, ExpressionSyntax expression) 3537public static JoinClauseSyntax JoinClause(SyntaxToken joinKeyword, TypeSyntax? type, SyntaxToken identifier, SyntaxToken inKeyword, ExpressionSyntax inExpression, SyntaxToken onKeyword, ExpressionSyntax leftExpression, SyntaxToken equalsKeyword, ExpressionSyntax rightExpression, JoinIntoClauseSyntax? into) 3551public static JoinClauseSyntax JoinClause(TypeSyntax? type, SyntaxToken identifier, ExpressionSyntax inExpression, ExpressionSyntax leftExpression, ExpressionSyntax rightExpression, JoinIntoClauseSyntax? into) 3760public static DeclarationPatternSyntax DeclarationPattern(TypeSyntax type, VariableDesignationSyntax designation) 3780public static RecursivePatternSyntax RecursivePattern(TypeSyntax? type, PositionalPatternClauseSyntax? positionalPatternClause, PropertyPatternClauseSyntax? propertyPatternClause, VariableDesignationSyntax? designation) 3862public static TypePatternSyntax TypePattern(TypeSyntax type) 4015public static LocalFunctionStatementSyntax LocalFunctionStatement(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax returnType, SyntaxToken identifier, TypeParameterListSyntax? typeParameterList, ParameterListSyntax parameterList, SyntaxList<TypeParameterConstraintClauseSyntax> constraintClauses, BlockSyntax? body, ArrowExpressionClauseSyntax? expressionBody, SyntaxToken semicolonToken) 4030public static LocalFunctionStatementSyntax LocalFunctionStatement(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax returnType, SyntaxToken identifier, TypeParameterListSyntax? typeParameterList, ParameterListSyntax parameterList, SyntaxList<TypeParameterConstraintClauseSyntax> constraintClauses, BlockSyntax? body, ArrowExpressionClauseSyntax? expressionBody) 4034public static LocalFunctionStatementSyntax LocalFunctionStatement(TypeSyntax returnType, SyntaxToken identifier) 4038public static LocalFunctionStatementSyntax LocalFunctionStatement(TypeSyntax returnType, string identifier) 4070public static VariableDeclarationSyntax VariableDeclaration(TypeSyntax type, SeparatedSyntaxList<VariableDeclaratorSyntax> variables) 4077public static VariableDeclarationSyntax VariableDeclaration(TypeSyntax type) 4388public static ForEachStatementSyntax ForEachStatement(SyntaxList<AttributeListSyntax> attributeLists, SyntaxToken awaitKeyword, SyntaxToken forEachKeyword, SyntaxToken openParenToken, TypeSyntax type, SyntaxToken identifier, SyntaxToken inKeyword, ExpressionSyntax expression, SyntaxToken closeParenToken, StatementSyntax statement) 4408public static ForEachStatementSyntax ForEachStatement(SyntaxList<AttributeListSyntax> attributeLists, TypeSyntax type, SyntaxToken identifier, ExpressionSyntax expression, StatementSyntax statement) 4412public static ForEachStatementSyntax ForEachStatement(TypeSyntax type, SyntaxToken identifier, ExpressionSyntax expression, StatementSyntax statement) 4416public static ForEachStatementSyntax ForEachStatement(TypeSyntax type, string identifier, ExpressionSyntax expression, StatementSyntax statement) 4738public static CatchDeclarationSyntax CatchDeclaration(SyntaxToken openParenToken, TypeSyntax type, SyntaxToken identifier, SyntaxToken closeParenToken) 4753public static CatchDeclarationSyntax CatchDeclaration(TypeSyntax type, SyntaxToken identifier) 4757public static CatchDeclarationSyntax CatchDeclaration(TypeSyntax type) 4820public static UsingDirectiveSyntax UsingDirective(SyntaxToken globalKeyword, SyntaxToken usingKeyword, SyntaxToken staticKeyword, SyntaxToken unsafeKeyword, NameEqualsSyntax? alias, TypeSyntax namespaceOrType, SyntaxToken semicolonToken) 4847public static UsingDirectiveSyntax UsingDirective(NameEqualsSyntax? alias, TypeSyntax namespaceOrType) 4851public static UsingDirectiveSyntax UsingDirective(TypeSyntax namespaceOrType) 5196public static DelegateDeclarationSyntax DelegateDeclaration(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, SyntaxToken delegateKeyword, TypeSyntax returnType, SyntaxToken identifier, TypeParameterListSyntax? typeParameterList, ParameterListSyntax parameterList, SyntaxList<TypeParameterConstraintClauseSyntax> constraintClauses, SyntaxToken semicolonToken) 5207public static DelegateDeclarationSyntax DelegateDeclaration(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax returnType, SyntaxToken identifier, TypeParameterListSyntax? typeParameterList, ParameterListSyntax parameterList, SyntaxList<TypeParameterConstraintClauseSyntax> constraintClauses) 5211public static DelegateDeclarationSyntax DelegateDeclaration(TypeSyntax returnType, SyntaxToken identifier) 5215public static DelegateDeclarationSyntax DelegateDeclaration(TypeSyntax returnType, string identifier) 5278public static SimpleBaseTypeSyntax SimpleBaseType(TypeSyntax type) 5285public static PrimaryConstructorBaseTypeSyntax PrimaryConstructorBaseType(TypeSyntax type, ArgumentListSyntax argumentList) 5293public static PrimaryConstructorBaseTypeSyntax PrimaryConstructorBaseType(TypeSyntax type) 5367public static TypeConstraintSyntax TypeConstraint(TypeSyntax type) 5453public static MethodDeclarationSyntax MethodDeclaration(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax returnType, ExplicitInterfaceSpecifierSyntax? explicitInterfaceSpecifier, SyntaxToken identifier, TypeParameterListSyntax? typeParameterList, ParameterListSyntax parameterList, SyntaxList<TypeParameterConstraintClauseSyntax> constraintClauses, BlockSyntax? body, ArrowExpressionClauseSyntax? expressionBody, SyntaxToken semicolonToken) 5468public static MethodDeclarationSyntax MethodDeclaration(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax returnType, ExplicitInterfaceSpecifierSyntax? explicitInterfaceSpecifier, SyntaxToken identifier, TypeParameterListSyntax? typeParameterList, ParameterListSyntax parameterList, SyntaxList<TypeParameterConstraintClauseSyntax> constraintClauses, BlockSyntax? body, ArrowExpressionClauseSyntax? expressionBody) 5472public static MethodDeclarationSyntax MethodDeclaration(TypeSyntax returnType, SyntaxToken identifier) 5476public static MethodDeclarationSyntax MethodDeclaration(TypeSyntax returnType, string identifier) 5480public static OperatorDeclarationSyntax OperatorDeclaration(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax returnType, ExplicitInterfaceSpecifierSyntax? explicitInterfaceSpecifier, SyntaxToken operatorKeyword, SyntaxToken checkedKeyword, SyntaxToken operatorToken, ParameterListSyntax parameterList, BlockSyntax? body, ArrowExpressionClauseSyntax? expressionBody, SyntaxToken semicolonToken) 5540public static OperatorDeclarationSyntax OperatorDeclaration(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax returnType, ExplicitInterfaceSpecifierSyntax? explicitInterfaceSpecifier, SyntaxToken operatorToken, ParameterListSyntax parameterList, BlockSyntax? body, ArrowExpressionClauseSyntax? expressionBody) 5544public static OperatorDeclarationSyntax OperatorDeclaration(TypeSyntax returnType, SyntaxToken operatorToken) 5548public static ConversionOperatorDeclarationSyntax ConversionOperatorDeclaration(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, SyntaxToken implicitOrExplicitKeyword, ExplicitInterfaceSpecifierSyntax? explicitInterfaceSpecifier, SyntaxToken operatorKeyword, SyntaxToken checkedKeyword, TypeSyntax type, ParameterListSyntax parameterList, BlockSyntax? body, ArrowExpressionClauseSyntax? expressionBody, SyntaxToken semicolonToken) 5575public static ConversionOperatorDeclarationSyntax ConversionOperatorDeclaration(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, SyntaxToken implicitOrExplicitKeyword, ExplicitInterfaceSpecifierSyntax? explicitInterfaceSpecifier, TypeSyntax type, ParameterListSyntax parameterList, BlockSyntax? body, ArrowExpressionClauseSyntax? expressionBody) 5579public static ConversionOperatorDeclarationSyntax ConversionOperatorDeclaration(SyntaxToken implicitOrExplicitKeyword, TypeSyntax type) 5668public static PropertyDeclarationSyntax PropertyDeclaration(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax type, ExplicitInterfaceSpecifierSyntax? explicitInterfaceSpecifier, SyntaxToken identifier, AccessorListSyntax? accessorList, ArrowExpressionClauseSyntax? expressionBody, EqualsValueClauseSyntax? initializer, SyntaxToken semicolonToken) 5682public static PropertyDeclarationSyntax PropertyDeclaration(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax type, ExplicitInterfaceSpecifierSyntax? explicitInterfaceSpecifier, SyntaxToken identifier, AccessorListSyntax? accessorList, ArrowExpressionClauseSyntax? expressionBody, EqualsValueClauseSyntax? initializer) 5686public static PropertyDeclarationSyntax PropertyDeclaration(TypeSyntax type, SyntaxToken identifier) 5690public static PropertyDeclarationSyntax PropertyDeclaration(TypeSyntax type, string identifier) 5706public static EventDeclarationSyntax EventDeclaration(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, SyntaxToken eventKeyword, TypeSyntax type, ExplicitInterfaceSpecifierSyntax? explicitInterfaceSpecifier, SyntaxToken identifier, AccessorListSyntax? accessorList, SyntaxToken semicolonToken) 5721public static EventDeclarationSyntax EventDeclaration(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax type, ExplicitInterfaceSpecifierSyntax? explicitInterfaceSpecifier, SyntaxToken identifier, AccessorListSyntax? accessorList) 5725public static EventDeclarationSyntax EventDeclaration(TypeSyntax type, SyntaxToken identifier) 5729public static EventDeclarationSyntax EventDeclaration(TypeSyntax type, string identifier) 5733public static IndexerDeclarationSyntax IndexerDeclaration(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax type, ExplicitInterfaceSpecifierSyntax? explicitInterfaceSpecifier, SyntaxToken thisKeyword, BracketedParameterListSyntax parameterList, AccessorListSyntax? accessorList, ArrowExpressionClauseSyntax? expressionBody, SyntaxToken semicolonToken) 5748public static IndexerDeclarationSyntax IndexerDeclaration(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax type, ExplicitInterfaceSpecifierSyntax? explicitInterfaceSpecifier, BracketedParameterListSyntax parameterList, AccessorListSyntax? accessorList, ArrowExpressionClauseSyntax? expressionBody) 5752public static IndexerDeclarationSyntax IndexerDeclaration(TypeSyntax type) 5844public static ParameterSyntax Parameter(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax? type, SyntaxToken identifier, EqualsValueClauseSyntax? @default) 5857public static FunctionPointerParameterSyntax FunctionPointerParameter(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax type) 5864public static FunctionPointerParameterSyntax FunctionPointerParameter(TypeSyntax type) 5868public static IncompleteMemberSyntax IncompleteMember(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax? type) 5875public static IncompleteMemberSyntax IncompleteMember(TypeSyntax? type = default) 5907public static TypeCrefSyntax TypeCref(TypeSyntax type) 5914public static QualifiedCrefSyntax QualifiedCref(TypeSyntax container, SyntaxToken dotToken, MemberCrefSyntax member) 5923public static QualifiedCrefSyntax QualifiedCref(TypeSyntax container, MemberCrefSyntax member) 5927public static NameMemberCrefSyntax NameMemberCref(TypeSyntax name, CrefParameterListSyntax? parameters) 5934public static NameMemberCrefSyntax NameMemberCref(TypeSyntax name) 6026public static ConversionOperatorMemberCrefSyntax ConversionOperatorMemberCref(SyntaxToken implicitOrExplicitKeyword, SyntaxToken operatorKeyword, SyntaxToken checkedKeyword, TypeSyntax type, CrefParameterListSyntax? parameters) 6046public static ConversionOperatorMemberCrefSyntax ConversionOperatorMemberCref(SyntaxToken implicitOrExplicitKeyword, TypeSyntax type, CrefParameterListSyntax? parameters) 6050public static ConversionOperatorMemberCrefSyntax ConversionOperatorMemberCref(SyntaxToken implicitOrExplicitKeyword, TypeSyntax type) 6078public static CrefParameterSyntax CrefParameter(SyntaxToken refKindKeyword, SyntaxToken readOnlyKeyword, TypeSyntax type) 6099public static CrefParameterSyntax CrefParameter(SyntaxToken refKindKeyword, TypeSyntax type) 6103public static CrefParameterSyntax CrefParameter(TypeSyntax type)
_generated\2\Syntax.xml.Syntax.Generated.cs (195)
185public GenericNameSyntax AddTypeArgumentListArguments(params TypeSyntax[] items) => WithTypeArgumentList(this.TypeArgumentList.WithArguments(this.TypeArgumentList.Arguments.AddRange(items))); 208public SeparatedSyntaxList<TypeSyntax> Arguments 213return red != null ? new SeparatedSyntaxList<TypeSyntax>(red, GetChildIndex(1)) : default; 227public TypeArgumentListSyntax Update(SyntaxToken lessThanToken, SeparatedSyntaxList<TypeSyntax> arguments, SyntaxToken greaterThanToken) 240public TypeArgumentListSyntax WithArguments(SeparatedSyntaxList<TypeSyntax> arguments) => Update(this.LessThanToken, arguments, this.GreaterThanToken); 243public TypeArgumentListSyntax AddArguments(params TypeSyntax[] items) => WithArguments(this.Arguments.AddRange(items)); 366private TypeSyntax? elementType; 375public TypeSyntax ElementType => GetRedAtZero(ref this.elementType)!; 399public ArrayTypeSyntax Update(TypeSyntax elementType, SyntaxList<ArrayRankSpecifierSyntax> rankSpecifiers) 411public ArrayTypeSyntax WithElementType(TypeSyntax elementType) => Update(elementType, this.RankSpecifiers); 480private TypeSyntax? elementType; 488public TypeSyntax ElementType => GetRedAtZero(ref this.elementType)!; 500public PointerTypeSyntax Update(TypeSyntax elementType, SyntaxToken asteriskToken) 512public PointerTypeSyntax WithElementType(TypeSyntax elementType) => Update(elementType, this.AsteriskToken); 799private TypeSyntax? elementType; 807public TypeSyntax ElementType => GetRedAtZero(ref this.elementType)!; 819public NullableTypeSyntax Update(TypeSyntax elementType, SyntaxToken questionToken) 831public NullableTypeSyntax WithElementType(TypeSyntax elementType) => Update(elementType, this.QuestionToken); 901private TypeSyntax? type; 909public TypeSyntax Type => GetRedAtZero(ref this.type)!; 928public TupleElementSyntax Update(TypeSyntax type, SyntaxToken identifier) 940public TupleElementSyntax WithType(TypeSyntax type) => Update(type, this.Identifier); 993private TypeSyntax? type; 1012public TypeSyntax Type => GetRed(ref this.type, 2)!; 1021public RefTypeSyntax Update(SyntaxToken refKeyword, SyntaxToken readOnlyKeyword, TypeSyntax type) 1035public RefTypeSyntax WithType(TypeSyntax type) => Update(this.RefKeyword, this.ReadOnlyKeyword, type); 1047private TypeSyntax? type; 1056public TypeSyntax Type => GetRed(ref this.type, 1)!; 1065public ScopedTypeSyntax Update(SyntaxToken scopedKeyword, TypeSyntax type) 1078public ScopedTypeSyntax WithType(TypeSyntax type) => Update(this.ScopedKeyword, type); 2191private TypeSyntax? type; 2211public TypeSyntax Type => GetRed(ref this.type, 4)!; 2235public RefValueExpressionSyntax Update(SyntaxToken keyword, SyntaxToken openParenToken, ExpressionSyntax expression, SyntaxToken comma, TypeSyntax type, SyntaxToken closeParenToken) 2251public RefValueExpressionSyntax WithType(TypeSyntax type) => Update(this.Keyword, this.OpenParenToken, this.Expression, this.Comma, type, this.CloseParenToken); 2318private TypeSyntax? type; 2332public TypeSyntax Type => GetRed(ref this.type, 2)!; 2344public DefaultExpressionSyntax Update(SyntaxToken keyword, SyntaxToken openParenToken, TypeSyntax type, SyntaxToken closeParenToken) 2358public DefaultExpressionSyntax WithType(TypeSyntax type) => Update(this.Keyword, this.OpenParenToken, type, this.CloseParenToken); 2371private TypeSyntax? type; 2385public TypeSyntax Type => GetRed(ref this.type, 2)!; 2397public TypeOfExpressionSyntax Update(SyntaxToken keyword, SyntaxToken openParenToken, TypeSyntax type, SyntaxToken closeParenToken) 2411public TypeOfExpressionSyntax WithType(TypeSyntax type) => Update(this.Keyword, this.OpenParenToken, type, this.CloseParenToken); 2424private TypeSyntax? type; 2438public TypeSyntax Type => GetRed(ref this.type, 2)!; 2450public SizeOfExpressionSyntax Update(SyntaxToken keyword, SyntaxToken openParenToken, TypeSyntax type, SyntaxToken closeParenToken) 2464public SizeOfExpressionSyntax WithType(TypeSyntax type) => Update(this.Keyword, this.OpenParenToken, type, this.CloseParenToken); 2909private TypeSyntax? type; 2917public TypeSyntax Type => GetRedAtZero(ref this.type)!; 2941public DeclarationExpressionSyntax Update(TypeSyntax type, VariableDesignationSyntax designation) 2953public DeclarationExpressionSyntax WithType(TypeSyntax type) => Update(type, this.Designation); 2966private TypeSyntax? type; 2978public TypeSyntax Type => GetRed(ref this.type, 1)!; 3005public CastExpressionSyntax Update(SyntaxToken openParenToken, TypeSyntax type, SyntaxToken closeParenToken, ExpressionSyntax expression) 3018public CastExpressionSyntax WithType(TypeSyntax type) => Update(this.OpenParenToken, type, this.CloseParenToken, this.Expression); 3359private TypeSyntax? returnType; 3380public TypeSyntax? ReturnType => GetRed(ref this.returnType, 2); 3425public ParenthesizedLambdaExpressionSyntax Update(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax? returnType, ParameterListSyntax parameterList, SyntaxToken arrowToken, BlockSyntax? block, ExpressionSyntax? expressionBody) 3441public ParenthesizedLambdaExpressionSyntax WithReturnType(TypeSyntax? returnType) => Update(this.AttributeLists, this.Modifiers, returnType, this.ParameterList, this.ArrowToken, this.Block, this.ExpressionBody); 3634private TypeSyntax? type; 3647public TypeSyntax Type => GetRed(ref this.type, 1)!; 3676public ObjectCreationExpressionSyntax Update(SyntaxToken newKeyword, TypeSyntax type, ArgumentListSyntax? argumentList, InitializerExpressionSyntax? initializer) 3690public ObjectCreationExpressionSyntax WithType(TypeSyntax type) => Update(this.NewKeyword, type, this.ArgumentList, this.Initializer); 4024private TypeSyntax? type; 4036public TypeSyntax Type => GetRed(ref this.type, 1)!; 4060public StackAllocArrayCreationExpressionSyntax Update(SyntaxToken stackAllocKeyword, TypeSyntax type, InitializerExpressionSyntax? initializer) 4073public StackAllocArrayCreationExpressionSyntax WithType(TypeSyntax type) => Update(this.StackAllocKeyword, type, this.Initializer); 4466private TypeSyntax? type; 4476public TypeSyntax? Type => GetRed(ref this.type, 1); 4504public FromClauseSyntax Update(SyntaxToken fromKeyword, TypeSyntax? type, SyntaxToken identifier, SyntaxToken inKeyword, ExpressionSyntax expression) 4517public FromClauseSyntax WithType(TypeSyntax? type) => Update(this.FromKeyword, type, this.Identifier, this.InKeyword, this.Expression); 4580private TypeSyntax? type; 4593public TypeSyntax? Type => GetRed(ref this.type, 1); 4637public JoinClauseSyntax Update(SyntaxToken joinKeyword, TypeSyntax? type, SyntaxToken identifier, SyntaxToken inKeyword, ExpressionSyntax inExpression, SyntaxToken onKeyword, ExpressionSyntax leftExpression, SyntaxToken equalsKeyword, ExpressionSyntax rightExpression, JoinIntoClauseSyntax? into) 4650public JoinClauseSyntax WithType(TypeSyntax? type) => Update(this.JoinKeyword, type, this.Identifier, this.InKeyword, this.InExpression, this.OnKeyword, this.LeftExpression, this.EqualsKeyword, this.RightExpression, this.Into); 5286private TypeSyntax? type; 5294public TypeSyntax Type => GetRedAtZero(ref this.type)!; 5317public DeclarationPatternSyntax Update(TypeSyntax type, VariableDesignationSyntax designation) 5329public DeclarationPatternSyntax WithType(TypeSyntax type) => Update(type, this.Designation); 5383private TypeSyntax? type; 5393public TypeSyntax? Type => GetRedAtZero(ref this.type); 5424public RecursivePatternSyntax Update(TypeSyntax? type, PositionalPatternClauseSyntax? positionalPatternClause, PropertyPatternClauseSyntax? propertyPatternClause, VariableDesignationSyntax? designation) 5436public RecursivePatternSyntax WithType(TypeSyntax? type) => Update(type, this.PositionalPatternClause, this.PropertyPatternClause, this.Designation); 5752private TypeSyntax? type; 5760public TypeSyntax Type => GetRedAtZero(ref this.type)!; 5769public TypePatternSyntax Update(TypeSyntax type) 5781public TypePatternSyntax WithType(TypeSyntax type) => Update(type); 6363private TypeSyntax? returnType; 6386public TypeSyntax ReturnType => GetRed(ref this.returnType, 2)!; 6440public LocalFunctionStatementSyntax Update(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax returnType, SyntaxToken identifier, TypeParameterListSyntax? typeParameterList, ParameterListSyntax parameterList, SyntaxList<TypeParameterConstraintClauseSyntax> constraintClauses, BlockSyntax? body, ArrowExpressionClauseSyntax? expressionBody, SyntaxToken semicolonToken) 6455public LocalFunctionStatementSyntax WithReturnType(TypeSyntax returnType) => Update(this.AttributeLists, this.Modifiers, returnType, this.Identifier, this.TypeParameterList, this.ParameterList, this.ConstraintClauses, this.Body, this.ExpressionBody, this.SemicolonToken); 6589private TypeSyntax? type; 6597public TypeSyntax Type => GetRedAtZero(ref this.type)!; 6627public VariableDeclarationSyntax Update(TypeSyntax type, SeparatedSyntaxList<VariableDeclaratorSyntax> variables) 6639public VariableDeclarationSyntax WithType(TypeSyntax type) => Update(type, this.Variables); 7772private TypeSyntax? type; 7796public TypeSyntax Type => GetRed(ref this.type, 4)!; 7832public ForEachStatementSyntax Update(SyntaxList<AttributeListSyntax> attributeLists, SyntaxToken awaitKeyword, SyntaxToken forEachKeyword, SyntaxToken openParenToken, TypeSyntax type, SyntaxToken identifier, SyntaxToken inKeyword, ExpressionSyntax expression, SyntaxToken closeParenToken, StatementSyntax statement) 7852public ForEachStatementSyntax WithType(TypeSyntax type) => Update(this.AttributeLists, this.AwaitKeyword, this.ForEachKeyword, this.OpenParenToken, type, this.Identifier, this.InKeyword, this.Expression, this.CloseParenToken, this.Statement); 9147private TypeSyntax? type; 9156public TypeSyntax Type => GetRed(ref this.type, 1)!; 9176public CatchDeclarationSyntax Update(SyntaxToken openParenToken, TypeSyntax type, SyntaxToken identifier, SyntaxToken closeParenToken) 9189public CatchDeclarationSyntax WithType(TypeSyntax type) => Update(this.OpenParenToken, type, this.Identifier, this.CloseParenToken); 9426private TypeSyntax? namespaceOrType; 9464public TypeSyntax NamespaceOrType => GetRed(ref this.namespaceOrType, 5)!; 9487public UsingDirectiveSyntax Update(SyntaxToken globalKeyword, SyntaxToken usingKeyword, SyntaxToken staticKeyword, SyntaxToken unsafeKeyword, NameEqualsSyntax? alias, TypeSyntax namespaceOrType, SyntaxToken semicolonToken) 9504public UsingDirectiveSyntax WithNamespaceOrType(TypeSyntax namespaceOrType) => Update(this.GlobalKeyword, this.UsingKeyword, this.StaticKeyword, this.UnsafeKeyword, this.Alias, namespaceOrType, this.SemicolonToken); 11351private TypeSyntax? returnType; 11376public TypeSyntax ReturnType => GetRed(ref this.returnType, 3)!; 11417public DelegateDeclarationSyntax Update(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, SyntaxToken delegateKeyword, TypeSyntax returnType, SyntaxToken identifier, TypeParameterListSyntax? typeParameterList, ParameterListSyntax parameterList, SyntaxList<TypeParameterConstraintClauseSyntax> constraintClauses, SyntaxToken semicolonToken) 11434public DelegateDeclarationSyntax WithReturnType(TypeSyntax returnType) => Update(this.AttributeLists, this.Modifiers, this.DelegateKeyword, returnType, this.Identifier, this.TypeParameterList, this.ParameterList, this.ConstraintClauses, this.SemicolonToken); 11740public abstract TypeSyntax Type { get; } 11741public BaseTypeSyntax WithType(TypeSyntax type) => WithTypeCore(type); 11742internal abstract BaseTypeSyntax WithTypeCore(TypeSyntax type); 11753private TypeSyntax? type; 11760public override TypeSyntax Type => GetRedAtZero(ref this.type)!; 11769public SimpleBaseTypeSyntax Update(TypeSyntax type) 11781internal override BaseTypeSyntax WithTypeCore(TypeSyntax type) => WithType(type); 11782public new SimpleBaseTypeSyntax WithType(TypeSyntax type) => Update(type); 11793private TypeSyntax? type; 11801public override TypeSyntax Type => GetRedAtZero(ref this.type)!; 11824public PrimaryConstructorBaseTypeSyntax Update(TypeSyntax type, ArgumentListSyntax argumentList) 11836internal override BaseTypeSyntax WithTypeCore(TypeSyntax type) => WithType(type); 11837public new PrimaryConstructorBaseTypeSyntax WithType(TypeSyntax type) => Update(type, this.ArgumentList); 12035private TypeSyntax? type; 12043public TypeSyntax Type => GetRedAtZero(ref this.type)!; 12052public TypeConstraintSyntax Update(TypeSyntax type) 12064public TypeConstraintSyntax WithType(TypeSyntax type) => Update(type); 12495private TypeSyntax? returnType; 12520public TypeSyntax ReturnType => GetRed(ref this.returnType, 2)!; 12579public MethodDeclarationSyntax Update(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax returnType, ExplicitInterfaceSpecifierSyntax? explicitInterfaceSpecifier, SyntaxToken identifier, TypeParameterListSyntax? typeParameterList, ParameterListSyntax parameterList, SyntaxList<TypeParameterConstraintClauseSyntax> constraintClauses, BlockSyntax? body, ArrowExpressionClauseSyntax? expressionBody, SyntaxToken semicolonToken) 12595public MethodDeclarationSyntax WithReturnType(TypeSyntax returnType) => Update(this.AttributeLists, this.Modifiers, returnType, this.ExplicitInterfaceSpecifier, this.Identifier, this.TypeParameterList, this.ParameterList, this.ConstraintClauses, this.Body, this.ExpressionBody, this.SemicolonToken); 12645private TypeSyntax? returnType; 12668public TypeSyntax ReturnType => GetRed(ref this.returnType, 2)!; 12731public OperatorDeclarationSyntax Update(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax returnType, ExplicitInterfaceSpecifierSyntax? explicitInterfaceSpecifier, SyntaxToken operatorKeyword, SyntaxToken checkedKeyword, SyntaxToken operatorToken, ParameterListSyntax parameterList, BlockSyntax? body, ArrowExpressionClauseSyntax? expressionBody, SyntaxToken semicolonToken) 12747public OperatorDeclarationSyntax WithReturnType(TypeSyntax returnType) => Update(this.AttributeLists, this.Modifiers, returnType, this.ExplicitInterfaceSpecifier, this.OperatorKeyword, this.CheckedKeyword, this.OperatorToken, this.ParameterList, this.Body, this.ExpressionBody, this.SemicolonToken); 12792private TypeSyntax? type; 12832public TypeSyntax Type => GetRed(ref this.type, 6)!; 12877public ConversionOperatorDeclarationSyntax Update(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, SyntaxToken implicitOrExplicitKeyword, ExplicitInterfaceSpecifierSyntax? explicitInterfaceSpecifier, SyntaxToken operatorKeyword, SyntaxToken checkedKeyword, TypeSyntax type, ParameterListSyntax parameterList, BlockSyntax? body, ArrowExpressionClauseSyntax? expressionBody, SyntaxToken semicolonToken) 12897public ConversionOperatorDeclarationSyntax WithType(TypeSyntax type) => Update(this.AttributeLists, this.Modifiers, this.ImplicitOrExplicitKeyword, this.ExplicitInterfaceSpecifier, this.OperatorKeyword, this.CheckedKeyword, type, this.ParameterList, this.Body, this.ExpressionBody, this.SemicolonToken); 13233public abstract TypeSyntax Type { get; } 13234public BasePropertyDeclarationSyntax WithType(TypeSyntax type) => WithTypeCore(type); 13235internal abstract BasePropertyDeclarationSyntax WithTypeCore(TypeSyntax type); 13266private TypeSyntax? type; 13288public override TypeSyntax Type => GetRed(ref this.type, 2)!; 13337public PropertyDeclarationSyntax Update(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax type, ExplicitInterfaceSpecifierSyntax? explicitInterfaceSpecifier, SyntaxToken identifier, AccessorListSyntax? accessorList, ArrowExpressionClauseSyntax? expressionBody, EqualsValueClauseSyntax? initializer, SyntaxToken semicolonToken) 13353internal override BasePropertyDeclarationSyntax WithTypeCore(TypeSyntax type) => WithType(type); 13354public new PropertyDeclarationSyntax WithType(TypeSyntax type) => Update(this.AttributeLists, this.Modifiers, type, this.ExplicitInterfaceSpecifier, this.Identifier, this.AccessorList, this.ExpressionBody, this.Initializer, this.SemicolonToken); 13428private TypeSyntax? type; 13450public override TypeSyntax Type => GetRed(ref this.type, 3)!; 13491public EventDeclarationSyntax Update(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, SyntaxToken eventKeyword, TypeSyntax type, ExplicitInterfaceSpecifierSyntax? explicitInterfaceSpecifier, SyntaxToken identifier, AccessorListSyntax? accessorList, SyntaxToken semicolonToken) 13508internal override BasePropertyDeclarationSyntax WithTypeCore(TypeSyntax type) => WithType(type); 13509public new EventDeclarationSyntax WithType(TypeSyntax type) => Update(this.AttributeLists, this.Modifiers, this.EventKeyword, type, this.ExplicitInterfaceSpecifier, this.Identifier, this.AccessorList, this.SemicolonToken); 13538private TypeSyntax? type; 13560public override TypeSyntax Type => GetRed(ref this.type, 2)!; 13609public IndexerDeclarationSyntax Update(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax type, ExplicitInterfaceSpecifierSyntax? explicitInterfaceSpecifier, SyntaxToken thisKeyword, BracketedParameterListSyntax parameterList, AccessorListSyntax? accessorList, ArrowExpressionClauseSyntax? expressionBody, SyntaxToken semicolonToken) 13625internal override BasePropertyDeclarationSyntax WithTypeCore(TypeSyntax type) => WithType(type); 13626public new IndexerDeclarationSyntax WithType(TypeSyntax type) => Update(this.AttributeLists, this.Modifiers, type, this.ExplicitInterfaceSpecifier, this.ThisKeyword, this.ParameterList, this.AccessorList, this.ExpressionBody, this.SemicolonToken); 13963public abstract TypeSyntax? Type { get; } 13964public BaseParameterSyntax WithType(TypeSyntax? type) => WithTypeCore(type); 13965internal abstract BaseParameterSyntax WithTypeCore(TypeSyntax? type); 13978private TypeSyntax? type; 14002public override TypeSyntax? Type => GetRed(ref this.type, 2); 14037public ParameterSyntax Update(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax? type, SyntaxToken identifier, EqualsValueClauseSyntax? @default) 14053internal override BaseParameterSyntax WithTypeCore(TypeSyntax? type) => WithType(type); 14054public new ParameterSyntax WithType(TypeSyntax? type) => Update(this.AttributeLists, this.Modifiers, type, this.Identifier, this.Default); 14074private TypeSyntax? type; 14094public override TypeSyntax Type => GetRed(ref this.type, 2)!; 14115public FunctionPointerParameterSyntax Update(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax type) 14131internal override BaseParameterSyntax WithTypeCore(TypeSyntax? type) => WithType(type ?? throw new ArgumentNullException(nameof(type))); 14132public new FunctionPointerParameterSyntax WithType(TypeSyntax type) => Update(this.AttributeLists, this.Modifiers, type); 14149private TypeSyntax? type; 14167public TypeSyntax? Type => GetRed(ref this.type, 2); 14188public IncompleteMemberSyntax Update(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax? type) 14204public IncompleteMemberSyntax WithType(TypeSyntax? type) => Update(this.AttributeLists, this.Modifiers, type); 14331private TypeSyntax? type; 14338public TypeSyntax Type => GetRedAtZero(ref this.type)!; 14347public TypeCrefSyntax Update(TypeSyntax type) 14359public TypeCrefSyntax WithType(TypeSyntax type) => Update(type); 14377private TypeSyntax? container; 14385public TypeSyntax Container => GetRedAtZero(ref this.container)!; 14410public QualifiedCrefSyntax Update(TypeSyntax container, SyntaxToken dotToken, MemberCrefSyntax member) 14422public QualifiedCrefSyntax WithContainer(TypeSyntax container) => Update(container, this.DotToken, this.Member); 14456private TypeSyntax? name; 14464public TypeSyntax Name => GetRedAtZero(ref this.name)!; 14487public NameMemberCrefSyntax Update(TypeSyntax name, CrefParameterListSyntax? parameters) 14499public NameMemberCrefSyntax WithName(TypeSyntax name) => Update(name, this.Parameters); 14575public ExtensionMemberCrefSyntax AddTypeArgumentListArguments(params TypeSyntax[] items) 14714private TypeSyntax? type; 14735public TypeSyntax Type => GetRed(ref this.type, 3)!; 14758public ConversionOperatorMemberCrefSyntax Update(SyntaxToken implicitOrExplicitKeyword, SyntaxToken operatorKeyword, SyntaxToken checkedKeyword, TypeSyntax type, CrefParameterListSyntax? parameters) 14773public ConversionOperatorMemberCrefSyntax WithType(TypeSyntax type) => Update(this.ImplicitOrExplicitKeyword, this.OperatorKeyword, this.CheckedKeyword, type, this.Parameters); 14939private TypeSyntax? type; 14964public TypeSyntax Type => GetRed(ref this.type, 2)!; 14973public CrefParameterSyntax Update(SyntaxToken refKindKeyword, SyntaxToken readOnlyKeyword, TypeSyntax type) 14987public CrefParameterSyntax WithType(TypeSyntax type) => Update(this.RefKindKeyword, this.ReadOnlyKeyword, type);
Binder\Binder.WithQueryLambdaParametersBinder.cs (1)
99var result = BindMemberOfType(node, node, name, 0, invoked: false, indexed: false, receiver, default(SeparatedSyntaxList<TypeSyntax>), default(ImmutableArray<TypeWithAnnotations>), lookupResult, BoundMethodGroupFlags.None, diagnostics);
Binder\Binder_Await.cs (1)
634var qualified = BindInstanceMemberAccess(node, node, receiver, name, 0, default(SeparatedSyntaxList<TypeSyntax>), default(ImmutableArray<TypeWithAnnotations>), invoked: false, indexed: false, diagnostics);
Binder\Binder_Constraints.cs (1)
255var typeSyntax = typeConstraintSyntax.Type;
Binder\Binder_Conversions.cs (1)
1900typeArgumentsSyntax: default(SeparatedSyntaxList<TypeSyntax>),
Binder\Binder_Crefs.cs (4)
83private NamespaceOrTypeSymbol BindNamespaceOrTypeSymbolInCref(TypeSyntax syntax) 1087SeparatedSyntaxList<TypeSyntax> typeArgumentSyntaxes = typeArgumentListSyntax.Arguments; 1099TypeSyntax typeArgumentSyntax = typeArgumentSyntaxes[i]; 1155private TypeSymbol BindCrefParameterOrReturnType(TypeSyntax typeSyntax, MemberCrefSyntax memberCrefSyntax, BindingDiagnosticBag diagnostics)
Binder\Binder_Deconstruct.cs (4)
656typeArgumentsSyntax: default(SeparatedSyntaxList<TypeSyntax>), 823TypeSyntax typeSyntax = declExpr.Type; 882TypeSyntax typeSyntax = declExpr.Type; 933TypeSyntax typeSyntax = declExpr.Type;
Binder\Binder_Expressions.cs (15)
1680SeparatedSyntaxList<TypeSyntax> typeArgumentList = node.Kind() == SyntaxKind.GenericName 1682: default(SeparatedSyntaxList<TypeSyntax>); 3230TypeSyntax typeSyntax = declarationExpression.Type; 3272TypeSyntax typeSyntax = declarationExpression.Type; 4585TypeSyntax typeSyntax = node.Type; 4600var elementTypeSyntax = arrayTypeSyntax.ElementType; 7807SeparatedSyntaxList<TypeSyntax> typeArgumentsSyntax = right.Kind() == SyntaxKind.GenericName ? 7809default(SeparatedSyntaxList<TypeSyntax>); 7862/// <see cref="MakeQueryInvocation(CSharpSyntaxNode, BoundExpression, string, SeparatedSyntaxList{TypeSyntax}, ImmutableArray{TypeWithAnnotations}, ImmutableArray{BoundExpression}, BindingDiagnosticBag, string?)"/>. 7936var typeArgumentsSyntax = right.Kind() == SyntaxKind.GenericName ? ((GenericNameSyntax)right).TypeArgumentList.Arguments : default(SeparatedSyntaxList<TypeSyntax>); 8032SeparatedSyntaxList<TypeSyntax> typeArgumentsSyntax, 8107SeparatedSyntaxList<TypeSyntax> typeArgumentsSyntax, 8289SeparatedSyntaxList<TypeSyntax> typeArgumentsSyntax, 8360SeparatedSyntaxList<TypeSyntax> typeArgumentsSyntax, BindingDiagnosticBag diagnostics) 8626SeparatedSyntaxList<TypeSyntax> typeArgumentsSyntax,
Binder\Binder_Invocation.cs (2)
84SeparatedSyntaxList<TypeSyntax> typeArgsSyntax = default(SeparatedSyntaxList<TypeSyntax>),
Binder\Binder_Lambda.cs (1)
292private (RefKind, ImmutableArray<CustomModifier> refCustomModifiers, TypeWithAnnotations) BindExplicitLambdaReturnType(TypeSyntax syntax, BindingDiagnosticBag diagnostics)
Binder\Binder_Patterns.cs (6)
1449TypeSyntax typeSyntax = node.Type; 1458TypeSyntax typeSyntax, 1476TypeSyntax? typeSyntax, 1534TypeSyntax? typeSyntax, 1586TypeSyntax? typeSyntax = node.Type; 2248typeArgumentsSyntax: default(SeparatedSyntaxList<TypeSyntax>),
Binder\Binder_Query.cs (6)
847private UnboundLambda MakeQueryUnboundLambdaWithCast(RangeVariableMap qvm, RangeVariableSymbol parameter, ExpressionSyntax expression, TypeSyntax castTypeSyntax, TypeWithAnnotations castType, bool withDependencies) 885return MakeQueryInvocation(node, receiver, methodName, default(SeparatedSyntaxList<TypeSyntax>), default(ImmutableArray<TypeWithAnnotations>), ImmutableArray.Create(arg), diagnostics 898return MakeQueryInvocation(node, receiver, methodName, default(SeparatedSyntaxList<TypeSyntax>), default(ImmutableArray<TypeWithAnnotations>), args, diagnostics 905protected BoundCall MakeQueryInvocation(CSharpSyntaxNode node, BoundExpression receiver, string methodName, TypeSyntax typeArgSyntax, TypeWithAnnotations typeArg, BindingDiagnosticBag diagnostics 911return MakeQueryInvocation(node, receiver, methodName, new SeparatedSyntaxList<TypeSyntax>(new SyntaxNodeOrTokenList(typeArgSyntax, 0)), ImmutableArray.Create(typeArg), ImmutableArray<BoundExpression>.Empty, diagnostics 918protected BoundCall MakeQueryInvocation(CSharpSyntaxNode node, BoundExpression receiver, string methodName, SeparatedSyntaxList<TypeSyntax> typeArgsSyntax, ImmutableArray<TypeWithAnnotations> typeArgs, ImmutableArray<BoundExpression> args, BindingDiagnosticBag diagnostics
Binder\Binder_Statements.cs (6)
714var typeSyntax = node.Declaration.Type; 791private TypeWithAnnotations BindVariableTypeWithAnnotations(CSharpSyntaxNode declarationNode, BindingDiagnosticBag diagnostics, TypeSyntax typeSyntax, ref bool isConst, out bool isVar, out AliasSymbol alias) 958TypeSyntax typeSyntax, 984TypeSyntax typeSyntax, 1201private SourceLocalSymbol LocateDeclaredVariableSymbol(VariableDeclaratorSyntax declarator, TypeSyntax typeSyntax, LocalDeclarationKind outerKind, BindingDiagnosticBag diagnostics) 2851var typeSyntax = nodeOpt.Type;
Binder\Binder_Symbols.cs (17)
39internal TypeWithAnnotations BindTypeOrVarKeyword(TypeSyntax syntax, BindingDiagnosticBag diagnostics, out bool isVar) 59private TypeWithAnnotations BindTypeOrConstraintKeyword(TypeSyntax syntax, BindingDiagnosticBag diagnostics, out ConstraintContextualKeyword keyword) 80internal TypeWithAnnotations BindTypeOrVarKeyword(TypeSyntax syntax, BindingDiagnosticBag diagnostics, out bool isVar, out AliasSymbol alias) 109private NamespaceOrTypeOrAliasSymbolWithAnnotations BindTypeOrAliasOrVarKeyword(TypeSyntax syntax, BindingDiagnosticBag diagnostics, out bool isVar) 136private NamespaceOrTypeOrAliasSymbolWithAnnotations BindTypeOrAliasOrConstraintKeyword(TypeSyntax syntax, BindingDiagnosticBag diagnostics, out ConstraintContextualKeyword keyword) 186/// PREREQUISITE: syntax should be checked to match the keyword, like <see cref="TypeSyntax.IsVar"/> or <see cref="TypeSyntax.IsUnmanaged"/>. 481return BindTypeArgument((TypeSyntax)syntax, diagnostics, basesBeingResolved); 554TypeSyntax typeArgumentSyntax = nullableSyntax.ElementType; 1217SeparatedSyntaxList<TypeSyntax> typeArguments = node.TypeArgumentList.Arguments; 1351/// Binds the <see cref="TypeSyntax"/> nodes in <paramref name="typeArguments"/> from some <see 1360private ImmutableArray<TypeWithAnnotations> BindTypeArguments(SeparatedSyntaxList<TypeSyntax> typeArguments, BindingDiagnosticBag diagnostics, ConsList<TypeSymbol> basesBeingResolved = null) 1364foreach (var argSyntax in typeArguments) 1372private TypeWithAnnotations BindTypeArgument(TypeSyntax typeArgument, BindingDiagnosticBag diagnostics, ConsList<TypeSymbol> basesBeingResolved = null) 1395private NamedTypeSymbol ConstructNamedTypeUnlessTypeArgumentOmitted(SyntaxNode typeSyntax, NamedTypeSymbol type, SeparatedSyntaxList<TypeSyntax> typeArgumentsSyntax, ImmutableArray<TypeWithAnnotations> typeArguments, BindingDiagnosticBag diagnostics) 1440SeparatedSyntaxList<TypeSyntax> typeArgumentsSyntax, 1634SeparatedSyntaxList<TypeSyntax> typeArgumentsSyntax,
Binder\ExpressionVariableFinder.cs (7)
287protected abstract TFieldOrLocalSymbol MakePatternVariable(TypeSyntax type, SingleVariableDesignationSyntax designation, SyntaxNode nodeToBind); 497TypeSyntax closestTypeSyntax, 544TypeSyntax closestTypeSyntax, 599protected override LocalSymbol? MakePatternVariable(TypeSyntax type, SingleVariableDesignationSyntax designation, SyntaxNode nodeToBind) 650TypeSyntax closestTypeSyntax, 714protected override Symbol MakePatternVariable(TypeSyntax type, SingleVariableDesignationSyntax designation, SyntaxNode nodeToBind) 735TypeSyntax closestTypeSyntax,
Binder\ForEachLoopBinder.cs (2)
139TypeSyntax closestTypeSyntax, 290TypeSyntax typeSyntax = node.Type;
Binder\ForLoopBinder.cs (1)
75var type = _syntax.Declaration.Type.SkipScoped(out _);
Binder\LocalBinderFactory.cs (1)
54private void VisitRankSpecifiers(TypeSyntax type, Binder enclosing)
Binder\OpenTypeVisitor.cs (2)
42SeparatedSyntaxList<TypeSyntax> typeArguments = node.TypeArgumentList.Arguments; 51foreach (TypeSyntax arg in typeArguments)
Binder\WithCrefTypeParametersBinder.cs (2)
79private void AddTypeParameters(TypeSyntax typeSyntax, MultiDictionary<string, TypeParameterSymbol> map) 122private static void AddTypeParameters(SeparatedSyntaxList<TypeSyntax> typeArguments, MultiDictionary<string, TypeParameterSymbol> map)
BoundTree\VariablePendingInference.cs (1)
70(typeOrDesignationSyntax is TypeSyntax typeSyntax ? typeSyntax.SkipScoped(out _).SkipRef() : typeOrDesignationSyntax).Location);
Compilation\CSharpSemanticModel.cs (8)
165/// then the provided expression should be a <see cref="TypeSyntax"/>.</param> 212if (!(expression is TypeSyntax)) 258Debug.Assert(bindingOption != SpeculativeBindingOption.BindAsTypeOrNamespace || expression is TypeSyntax); 311else if (expression is TypeSyntax typeSyntax) 547if (((TypeSyntax)expression).IsVar) 989if (((TypeSyntax)expression).IsVar) 2576public bool TryGetSpeculativeSemanticModel(int position, TypeSyntax type, out SemanticModel speculativeModel, SpeculativeBindingOption bindingOption = SpeculativeBindingOption.BindAsExpression) 2584internal abstract bool TryGetSpeculativeSemanticModelCore(SyntaxTreeSemanticModel parentModel, int position, TypeSyntax type, SpeculativeBindingOption bindingOption, out PublicSemanticModel speculativeModel);
Compilation\MemberSemanticModel.cs (2)
170internal sealed override bool TryGetSpeculativeSemanticModelCore(SyntaxTreeSemanticModel parentModel, int position, TypeSyntax type, SpeculativeBindingOption bindingOption, out PublicSemanticModel speculativeModel) 1549Debug.Assert((manager is null && (!IsNullableAnalysisEnabled() || syntax != Root || syntax is TypeSyntax ||
Compilation\MemberSemanticModel.SpeculativeMemberSemanticModel.cs (2)
29TypeSyntax root, 51Debug.Assert(boundRoot.Syntax is TypeSyntax);
Compilation\SpeculativeSemanticModelWithMemberModel.cs (2)
91TypeSyntax type, 565internal sealed override bool TryGetSpeculativeSemanticModelCore(SyntaxTreeSemanticModel parentModel, int position, TypeSyntax type, SpeculativeBindingOption bindingOption, out PublicSemanticModel speculativeModel)
Compilation\SpeculativeSyntaxTreeSemanticModel.cs (2)
27public static SpeculativeSyntaxTreeSemanticModel Create(SyntaxTreeSemanticModel parentSemanticModel, TypeSyntax root, Binder rootBinder, int position, SpeculativeBindingOption bindingOption) 41Debug.Assert(root is TypeSyntax || root is CrefSyntax);
Compilation\SyntaxTreeSemanticModel.cs (5)
339var type = node as TypeSyntax; 501private ConsList<TypeSymbol> GetBasesBeingResolved(TypeSyntax expression) 505for (; expression != null && expression.Parent != null; expression = expression.Parent as TypeSyntax) 594internal sealed override bool TryGetSpeculativeSemanticModelCore(SyntaxTreeSemanticModel parentModel, int position, TypeSyntax type, SpeculativeBindingOption bindingOption, out PublicSemanticModel speculativeModel)
CSharpExtensions.cs (1)
1174public static bool TryGetSpeculativeSemanticModel([NotNullWhen(true)] this SemanticModel? semanticModel, int position, TypeSyntax type, [NotNullWhen(true)] out SemanticModel? speculativeModel, SpeculativeBindingOption bindingOption = SpeculativeBindingOption.BindAsExpression)
Lowering\Instrumentation\CodeCoverageInstrumenter.cs (1)
623private static TextSpan SkipAttributes(SyntaxNode syntax, SyntaxList<AttributeListSyntax> attributes, SyntaxTokenList modifiers, SyntaxToken keyword, TypeSyntax? type)
Symbols\AliasSymbol.cs (1)
384var syntax = usingDirective.NamespaceOrType;
Symbols\ConstraintsHelper.cs (1)
680SeparatedSyntaxList<TypeSyntax> typeArgumentsSyntax, // may be omitted in synthesized invocations
Symbols\Source\GlobalExpressionVariable.cs (6)
32TypeSyntax typeSyntax, 45TypeSyntax typeSyntax, 61protected override TypeSyntax TypeSyntax => (TypeSyntax)_typeSyntaxOpt?.GetSyntax(); 80var typeSyntax = TypeSyntax; 171TypeSyntax typeSyntax,
Symbols\Source\LocalFunctionSymbol.cs (1)
283TypeSyntax returnTypeSyntax = Syntax.ReturnType;
Symbols\Source\SourceDelegateMethodSymbol.cs (1)
53TypeSyntax returnTypeSyntax = syntax.ReturnType;
Symbols\Source\SourceEventSymbol.cs (1)
860protected TypeWithAnnotations BindEventType(Binder binder, TypeSyntax typeSyntax, BindingDiagnosticBag diagnostics)
Symbols\Source\SourceLocalSymbol.cs (11)
32private readonly TypeSyntax _typeSyntax; 77TypeSyntax typeSyntax, 142TypeSyntax typeSyntax, 170TypeSyntax closestTypeSyntax, 192TypeSyntax typeSyntax, 239TypeSyntax typeSyntax, 349TypeSyntax typeSyntax = _typeSyntax.SkipScoped(out _).SkipRef(); 625TypeSyntax typeSyntax, 724TypeSyntax typeSyntax, 759TypeSyntax typeSyntax, 806TypeSyntax? typeSyntax,
Symbols\Source\SourceMemberContainerSymbol.cs (3)
4967var typesBuilder = ArrayBuilder<TypeSyntax>.GetInstance(parameterList.Parameters.Count); 4980TypeSyntax? typeSyntax = parameterSyntax.Type; 4999foreach (var typeSyntax in typesBuilder)
Symbols\Source\SourceMemberFieldSymbol.cs (4)
44protected abstract TypeSyntax TypeSyntax { get; } 423protected sealed override TypeSyntax TypeSyntax 493var typeSyntax = fieldSyntax.Declaration.Type; 534var typeOnly = typeSyntax.SkipScoped(out _).SkipRefInField(out refKind);
Symbols\Source\SourceMethodSymbol.cs (1)
32protected static void ReportBadRefToken(TypeSyntax returnTypeSyntax, BindingDiagnosticBag diagnostics)
Symbols\Source\SourceMethodSymbolWithAttributes.cs (1)
1544var returnTypeSyntax = this.SyntaxNode switch
Symbols\Source\SourceNamedTypeSymbol.cs (1)
63TypeSyntax t = baseTypeSyntax.Type;
Symbols\Source\SourceNamedTypeSymbol_Bases.cs (2)
225var b = baseTypeSyntax.Type; 514var typeSyntax = baseTypeSyntax.Type;
Symbols\Source\SourceNamedTypeSymbol_Enum.cs (1)
59var typeSyntax = types[0].Type;
Symbols\Source\SourceOrdinaryMethodSymbol.cs (1)
134var returnTypeSyntax = syntax.ReturnType;
Symbols\Source\SourcePropertySymbol.cs (2)
172private TypeSyntax GetTypeSyntax(SyntaxNode syntax) => ((BasePropertyDeclarationSyntax)syntax).Type; 573var typeSyntax = GetTypeSyntax(syntax);
Symbols\Source\SourceUserDefinedOperatorSymbolBase.cs (1)
310protected (TypeWithAnnotations ReturnType, ImmutableArray<ParameterSymbol> Parameters) MakeParametersAndBindReturnType(BaseMethodDeclarationSyntax declarationSyntax, TypeSyntax returnTypeSyntax, BindingDiagnosticBag diagnostics)
Syntax\ConversionOperatorDeclarationSyntax.cs (2)
14TypeSyntax type, 39TypeSyntax type,
Syntax\ConversionOperatorMemberCrefSyntax.cs (1)
9public ConversionOperatorMemberCrefSyntax Update(SyntaxToken implicitOrExplicitKeyword, SyntaxToken operatorKeyword, TypeSyntax type, CrefParameterListSyntax? parameters)
Syntax\CrefParameterSyntax.cs (2)
18/// Pre C# 7.2 back-compat overload, which simply calls the replacement method <see cref="Update(SyntaxToken, TypeSyntax)"/>. 26public CrefParameterSyntax Update(SyntaxToken refKindKeyword, TypeSyntax type)
Syntax\EventDeclarationSyntax.cs (2)
13public EventDeclarationSyntax Update(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, SyntaxToken eventKeyword, TypeSyntax type, ExplicitInterfaceSpecifierSyntax explicitInterfaceSpecifier, SyntaxToken identifier, AccessorListSyntax accessorList) 18public EventDeclarationSyntax Update(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, SyntaxToken eventKeyword, TypeSyntax type, ExplicitInterfaceSpecifierSyntax explicitInterfaceSpecifier, SyntaxToken identifier, SyntaxToken semicolonToken)
Syntax\ForEachStatementSyntax.cs (4)
11public ForEachStatementSyntax Update(SyntaxToken forEachKeyword, SyntaxToken openParenToken, TypeSyntax type, SyntaxToken identifier, SyntaxToken inKeyword, ExpressionSyntax expression, SyntaxToken closeParenToken, StatementSyntax statement) 14public ForEachStatementSyntax Update(SyntaxToken awaitKeyword, SyntaxToken forEachKeyword, SyntaxToken openParenToken, TypeSyntax type, SyntaxToken identifier, SyntaxToken inKeyword, ExpressionSyntax expression, SyntaxToken closeParenToken, StatementSyntax statement) 23public static ForEachStatementSyntax ForEachStatement(SyntaxToken forEachKeyword, SyntaxToken openParenToken, TypeSyntax type, SyntaxToken identifier, SyntaxToken inKeyword, ExpressionSyntax expression, SyntaxToken closeParenToken, StatementSyntax statement) 26public static ForEachStatementSyntax ForEachStatement(SyntaxToken awaitKeyword, SyntaxToken forEachKeyword, SyntaxToken openParenToken, TypeSyntax type, SyntaxToken identifier, SyntaxToken inKeyword, ExpressionSyntax expression, SyntaxToken closeParenToken, StatementSyntax statement)
Syntax\IndexerDeclarationSyntax.cs (1)
39TypeSyntax type,
Syntax\LocalFunctionStatementSyntax.cs (3)
12public LocalFunctionStatementSyntax Update(SyntaxTokenList modifiers, TypeSyntax returnType, SyntaxToken identifier, TypeParameterListSyntax typeParameterList, ParameterListSyntax parameterList, SyntaxList<TypeParameterConstraintClauseSyntax> constraintClauses, BlockSyntax body, ArrowExpressionClauseSyntax expressionBody, SyntaxToken semicolonToken) 24public static LocalFunctionStatementSyntax LocalFunctionStatement(SyntaxTokenList modifiers, TypeSyntax returnType, SyntaxToken identifier, TypeParameterListSyntax? typeParameterList, ParameterListSyntax parameterList, SyntaxList<TypeParameterConstraintClauseSyntax> constraintClauses, BlockSyntax? body, ArrowExpressionClauseSyntax? expressionBody) 30public static LocalFunctionStatementSyntax LocalFunctionStatement(SyntaxTokenList modifiers, TypeSyntax returnType, SyntaxToken identifier, TypeParameterListSyntax? typeParameterList, ParameterListSyntax parameterList, SyntaxList<TypeParameterConstraintClauseSyntax> constraintClauses, BlockSyntax? body, ArrowExpressionClauseSyntax? expressionBody, SyntaxToken semicolonToken)
Syntax\MethodDeclarationSyntax.cs (1)
30TypeSyntax returnType,
Syntax\OperatorDeclarationSyntax.cs (2)
12TypeSyntax returnType, 36TypeSyntax returnType,
Syntax\RefTypeSyntax.cs (2)
11public RefTypeSyntax Update(SyntaxToken refKeyword, TypeSyntax type) 23public static RefTypeSyntax RefType(SyntaxToken refKeyword, TypeSyntax type)
Syntax\StackAllocArrayCreationExpressionSyntax.cs (2)
11public StackAllocArrayCreationExpressionSyntax Update(SyntaxToken stackAllocKeyword, TypeSyntax type) 20public static StackAllocArrayCreationExpressionSyntax StackAllocArrayCreationExpression(SyntaxToken stackAllocKeyword, TypeSyntax type)
Syntax\SyntaxExtensions.cs (6)
270TypeSyntax type, 292TypeSyntax returnType, 315TypeSyntax returnType, 401internal static void VisitRankSpecifiers<TArg>(this TypeSyntax type, Action<ArrayRankSpecifierSyntax, TArg> action, in TArg argument) 417type = (TypeSyntax)current; 442TypeSyntax? paramType = functionPointerTypeSyntax.ParameterList.Parameters[i].Type;
Syntax\SyntaxFactory.cs (17)
1734public static TypeSyntax ParseTypeName(string text, int offset, bool consumeFullText) 1742public static TypeSyntax ParseTypeName(string text, int offset = 0, ParseOptions? options = null, bool consumeFullText = true) 1749return CreateRed<TypeSyntax>(node, lexer.Options); 2103internal static TypeSyntax? GetStandaloneType(TypeSyntax? node) 2501TypeSyntax type, 2522TypeSyntax type, 2543TypeSyntax type, 2566TypeSyntax type, 2589TypeSyntax type, 2613TypeSyntax returnType, 2636TypeSyntax returnType, 2661TypeSyntax returnType, 2682TypeSyntax returnType, 2757public static EventDeclarationSyntax EventDeclaration(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, SyntaxToken eventKeyword, TypeSyntax type, ExplicitInterfaceSpecifierSyntax explicitInterfaceSpecifier, SyntaxToken identifier, AccessorListSyntax accessorList) 2763public static EventDeclarationSyntax EventDeclaration(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, SyntaxToken eventKeyword, TypeSyntax type, ExplicitInterfaceSpecifierSyntax explicitInterfaceSpecifier, SyntaxToken identifier, SyntaxToken semicolonToken) 2894public static ConversionOperatorMemberCrefSyntax ConversionOperatorMemberCref(SyntaxToken implicitOrExplicitKeyword, SyntaxToken operatorKeyword, TypeSyntax type, CrefParameterListSyntax? parameters)
Syntax\SyntaxNodeExtensions.cs (12)
222internal static RefKind GetRefKindInLocalOrReturn(this TypeSyntax syntax, BindingDiagnosticBag diagnostics) 235internal static TypeSyntax SkipRef(this TypeSyntax syntax) 238internal static TypeSyntax SkipRefInField(this TypeSyntax syntax, out RefKind refKind) 245internal static TypeSyntax SkipRefInLocalOrReturn(this TypeSyntax syntax, BindingDiagnosticBag? diagnostics, out RefKind refKind) 248private static TypeSyntax SkipRefWorker(TypeSyntax syntax, BindingDiagnosticBag? diagnostics, out RefKind refKind) 260var current = syntax; 287internal static TypeSyntax SkipScoped(this TypeSyntax syntax, out bool isScoped)
Syntax\SyntaxNormalizer.cs (1)
700if (token.Parent.IsKind(SyntaxKind.ConditionalExpression) || token.Parent is TypeSyntax)
Microsoft.CodeAnalysis.CSharp.Analyzers (2)
MetaAnalyzers\CSharpDiagnosticAnalyzerAPIUsageAnalyzer.cs (1)
12public class CSharpDiagnosticAnalyzerApiUsageAnalyzer : DiagnosticAnalyzerApiUsageAnalyzer<TypeSyntax>
MetaAnalyzers\CSharpDiagnosticAnalyzerFieldsAnalyzer.cs (1)
12public class CSharpDiagnosticAnalyzerFieldsAnalyzer : DiagnosticAnalyzerFieldsAnalyzer<ClassDeclarationSyntax, StructDeclarationSyntax, FieldDeclarationSyntax, TypeSyntax, VariableDeclarationSyntax, TypeArgumentListSyntax, GenericNameSyntax>
Microsoft.CodeAnalysis.CSharp.CodeStyle (64)
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryDiscardDesignation\CSharpRemoveUnnecessaryDiscardDesignationDiagnosticAnalyzer.cs (1)
60var typeSyntax = declarationPattern.Type;
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (1)
294n => n is TypeSyntax or
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\NullableImpactingSpanWalker.cs (4)
61private static bool IsLanguageRestrictedToNonNullForm(TypeSyntax node) 107static TypeSyntax WalkUpCurrentQualifiedName(TypeSyntax node) 128if (node is TypeSyntax typeSyntax
src\roslyn\src\Analyzers\CSharp\Analyzers\SimplifyLinqExpression\CSharpSimplifyLinqTypeCheckAndCastDiagnosticAnalyzer.cs (3)
75Right: TypeSyntax whereTypeSyntax 94[NotNullWhen(true)] out TypeSyntax? caseOrSelectType) 192out var castTypeArgument))
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (1)
754Func<TArrayCreationExpressionSyntax, TypeSyntax> getType,
src\roslyn\src\Analyzers\CSharp\Analyzers\UseDeconstruction\CSharpUseDeconstructionDiagnosticAnalyzer.cs (2)
137TypeSyntax typeNode, 218private static bool IsViableTupleTypeSyntax(TypeSyntax type)
src\roslyn\src\Analyzers\CSharp\Analyzers\UseImplicitObjectCreation\CSharpUseImplicitObjectCreationDiagnosticAnalyzer.cs (1)
85TypeSyntax? typeNode;
src\roslyn\src\Analyzers\CSharp\Analyzers\UseImplicitOrExplicitType\CSharpTypeStyleDiagnosticAnalyzerBase.cs (1)
51var declaredType = Helper.FindAnalyzableType(declarationStatement, semanticModel, cancellationToken);
src\roslyn\src\Analyzers\CSharp\Analyzers\UsePatternCombinators\AnalyzedPattern.cs (3)
34if (binaryExpression.Right is not TypeSyntax typeSyntax) 75public readonly TypeSyntax TypeSyntax; 77private Type(TypeSyntax type, IOperation target) : base(target)
src\roslyn\src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpUseNotPatternDiagnosticAnalyzer.cs (1)
81BinaryExpressionSyntax(SyntaxKind.IsExpression) { Right: TypeSyntax type } isExpression
src\roslyn\src\Analyzers\CSharp\Analyzers\UseUnboundGenericTypeInNameOf\CSharpUseUnboundGenericTypeInNameOfDiagnosticAnalyzer.cs (1)
70foreach (var argument in typeArgumentList.Arguments)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeStyle\TypeStyle\TypeStyleHelper.cs (1)
202public static bool IsPredefinedType(TypeSyntax type)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\DefaultExpressionSyntaxExtensions.cs (2)
42var typeSyntax = GetTypeSyntax(equalsValueClause); 67private static TypeSyntax GetTypeSyntax(EqualsValueClauseSyntax equalsValueClause)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
606while (topExpression.Parent is TypeSyntax typeSyntax)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\MemberDeclarationSyntaxExtensions.cs (1)
153public static TypeSyntax GetMemberType(this MemberDeclarationSyntax member)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (5)
185TypeSyntax type, 319TypeSyntax type, 344private static TypeSyntax GetOutermostType(TypeSyntax type) 345=> type.GetAncestorsOrThis<TypeSyntax>().Last();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\TypeSyntaxExtensions.cs (5)
13public static bool IsVoid(this TypeSyntax typeSyntax) 17public static bool IsPartial(this TypeSyntax typeSyntax) 26public static bool IsTypeInferred(this TypeSyntax typeSyntax, SemanticModel semanticModel) 52public static TypeSyntax StripRefIfNeeded(this TypeSyntax type)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\VariableDeclaratorExtensions.cs (2)
13public static TypeSyntax GetVariableType(this VariableDeclaratorSyntax declarator) 25var variableTypeName = variable.GetVariableType();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (2)
762var type = memberDeclaration.GetMemberType(); 1479=> node is TypeSyntax;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\NameSyntaxComparer.cs (2)
117var xArg = x.TypeArgumentList.Arguments[i]; 118var yArg = y.TypeArgumentList.Arguments[i];
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (3)
32TypeSyntax, 96=> node is StatementSyntax(kind: not SyntaxKind.Block) or TypeSyntax or CrefSyntax || 141if (nodeToSpeculate is TypeSyntax typeNode)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpTypeStyleHelper.cs (4)
35TypeSyntax typeName, SemanticModel semanticModel, 54TypeSyntax typeName, SemanticModel semanticModel, CSharpSimplifierOptions options, CancellationToken cancellationToken); 57SyntaxToken identifier, TypeSyntax typeName, ExpressionSyntax initializer, SemanticModel semanticModel, CSharpSimplifierOptions options, CancellationToken cancellationToken); 59internal TypeSyntax? FindAnalyzableType(SyntaxNode node, SemanticModel semanticModel, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpTypeStyleHelper.State.cs (3)
109var typeSyntax = GetTypeSyntaxFromDeclaration(declarationStatement); 148var typeSyntax = GetTypeSyntaxFromDeclaration(declarationStatement); 155private static TypeSyntax? GetTypeSyntaxFromDeclaration(SyntaxNode declarationStatement)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseExplicitTypeHelper.cs (3)
60TypeSyntax typeName, SemanticModel semanticModel, 135TypeSyntax typeName, 149private static bool ContainsAnonymousType(TypeSyntax typeName, SemanticModel semanticModel, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (6)
30TypeSyntax typeName, SemanticModel semanticModel, 50var type = variableDeclaration.Type.StripRefIfNeeded(); 61var type = forEachStatement.Type.StripRefIfNeeded(); 92TypeSyntax typeName, SemanticModel semanticModel, 172var declarationTypeNode = declarationExpression.Type; 239TypeSyntax typeName,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeSyntaxComparer.cs (5)
11: IComparer<TypeSyntax?> 16public int Compare(TypeSyntax? x, TypeSyntax? y) 41private static TypeSyntax UnwrapType(TypeSyntax type)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (131)
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs (1)
111var type = cannotUseVar ? declaratorToRemoveType!.GenerateTypeSyntax() : IdentifierName("var");
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (1)
254var type = result.IsInherited
src\roslyn\src\Analyzers\CSharp\CodeFixes\FixReturnType\CSharpFixReturnTypeCodeFixProvider.cs (8)
57static bool IsVoid(TypeSyntax typeSyntax) 61private static async Task<(TypeSyntax declarationToFix, TypeSyntax fixedDeclaration)> TryGetOldAndNewReturnTypeAsync( 89var fixedDeclaration = returnedType.GenerateTypeSyntax(allowVar: false); 117var taskTypeSyntax = taskType.GenerateTypeSyntax(allowVar: false); 118fixedDeclaration = (TypeSyntax)syntaxGenerator.WithTypeArguments(taskTypeSyntax, fixedDeclaration); 134private static (TypeSyntax type, bool isAsync) TryGetDeclarationTypeToFix(SyntaxNode node) 138static (TypeSyntax type, bool isAsync) TryGetReturnTypeToFix(SyntaxNode containingMember)
src\roslyn\src\Analyzers\CSharp\CodeFixes\GenerateDefaultConstructors\CSharpGenerateDefaultConstructorsService.cs (2)
43var node = semanticDocument.Root.FindToken(textSpan.Start).GetAncestor<TypeSyntax>();
src\roslyn\src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateParameterizedMemberService.cs (4)
87foreach (var type in genericName.TypeArgumentList.Arguments) 104TypeSyntax type, 112private ITypeParameterSymbol? GetMethodTypeParameter(TypeSyntax type, CancellationToken cancellationToken) 151foreach (var typeArgument in genericName.TypeArgumentList.Arguments)
src\roslyn\src\Analyzers\CSharp\CodeFixes\HiddenExplicitCast\CSharpHiddenExplicitCastCodeFixProvider.cs (1)
46var typeToInsert = SyntaxFactory.ParseTypeName(diagnostic.Properties[CSharpHiddenExplicitCastDiagnosticAnalyzer.Type]!);
src\roslyn\src\Analyzers\CSharp\CodeFixes\ImplementInterface\CSharpImplementInterfaceCodeFixProvider.cs (1)
19: AbstractImplementInterfaceCodeFixProvider<TypeSyntax>
src\roslyn\src\Analyzers\CSharp\CodeFixes\ImplementInterface\CSharpImplementInterfaceService.cs (1)
56if (node is TypeSyntax interfaceNode && interfaceNode.Parent is BaseTypeSyntax baseType &&
src\roslyn\src\Analyzers\CSharp\CodeFixes\InlineDeclaration\CSharpInlineDeclarationCodeFixProvider.cs (4)
218var newType = GenerateTypeSyntaxOrVar(local.Type, options); 231var explicitType = declaration.Type.IsVar ? local.Type?.GenerateTypeSyntax() : declaration.Type; 240public static TypeSyntax GenerateTypeSyntaxOrVar( 268TypeSyntax newType, VariableDeclaratorSyntax declaratorOpt)
src\roslyn\src\Analyzers\CSharp\CodeFixes\Iterator\CSharpChangeToIEnumerableCodeFixProvider.cs (1)
74var newReturnType = ienumerableGenericSymbol.GenerateTypeSyntax();
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeMethodAsynchronous\CSharpMakeMethodAsynchronousCodeFixProvider.cs (8)
98var fixedReturnType = FixMethodReturnType(keepVoid, methodSymbol, method.ReturnType, knownTypes); 123private static TypeSyntax FixMethodReturnType( 126TypeSyntax returnTypeSyntax, 129var newReturnType = returnTypeSyntax.WithAdditionalAnnotations(Formatter.Annotation); 167static TypeSyntax MakeGenericType(string type, ITypeSymbol typeArgumentFrom) 187private static (SyntaxTokenList newModifiers, TypeSyntax newReturnType) AddAsyncModifierWithCorrectedTrivia(SyntaxTokenList modifiers, TypeSyntax returnType) 208var newReturnType = returnType.WithoutLeadingTrivia();
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeMethodSynchronous\CSharpMakeMethodSynchronousCodeFixProvider.cs (5)
46var newReturnType = FixMethodReturnType(methodSymbol, method.ReturnType, knownTypes); 52var newReturnType = FixMethodReturnType(methodSymbol, localFunction.ReturnType, knownTypes); 56private static TypeSyntax FixMethodReturnType(IMethodSymbol methodSymbol, TypeSyntax returnTypeSyntax, KnownTaskTypes knownTypes) 58var newReturnType = returnTypeSyntax;
src\roslyn\src\Analyzers\CSharp\CodeFixes\MisplacedUsingDirectives\MisplacedUsingDirectivesCodeFixProvider.cs (1)
189var newType = await Simplifier.ExpandAsync(usingDirective.NamespaceOrType, document, cancellationToken: cancellationToken).ConfigureAwait(false);
src\roslyn\src\Analyzers\CSharp\CodeFixes\Nullable\CSharpDeclareAsNullableCodeFixProvider.cs (10)
48var declarationTypeToFix = await TryGetDeclarationTypeToFixAsync( 80using var _ = PooledHashSet<TypeSyntax>.GetInstance(out var alreadyHandled); 99Document document, SemanticModel model, SyntaxEditor editor, SyntaxNode node, HashSet<TypeSyntax> alreadyHandled, CancellationToken cancellationToken) 101var declarationTypeToFix = await TryGetDeclarationTypeToFixAsync( 110private static async Task<TypeSyntax?> TryGetDeclarationTypeToFixAsync( 269static TypeSyntax? TryGetReturnType(TypeSyntax returnType, SyntaxTokenList modifiers, bool onYield) 283static TypeSyntax? TryGetSingleTypeArgument(TypeSyntax type) 301static TypeSyntax? TryGetParameterTypeSyntax(IParameterSymbol? parameterSymbol, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveAsyncModifier\RemoveAsyncModifierHelpers.cs (3)
12internal static SyntaxNode WithoutAsyncModifier(MethodDeclarationSyntax method, TypeSyntax returnType) 18internal static SyntaxNode WithoutAsyncModifier(LocalFunctionStatementSyntax localFunction, TypeSyntax returnType) 33private static SyntaxTokenList RemoveAsyncModifier(SyntaxTokenList modifiers, ref TypeSyntax newReturnType)
src\roslyn\src\Analyzers\CSharp\CodeFixes\SimplifyLinqExpression\CSharpSimplifyLinqTypeCheckAndCastCodeFixProvider.cs (2)
46var typeSyntax = (TypeSyntax)diagnostic.AdditionalLocations[1].FindNode(getInnermostNodeForTie: true, cancellationToken);
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseDeconstruction\CSharpUseDeconstructionCodeFixProvider.cs (2)
145private ExpressionSyntax CreateTupleOrDeclarationExpression(INamedTypeSymbol tupleType, TypeSyntax typeNode) 156private static DeclarationExpressionSyntax CreateDeclarationExpression(INamedTypeSymbol tupleType, TypeSyntax typeNode)
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseExplicitArrayInExpressionTree\CSharpUseExplicitArrayInExpressionTreeCodeFixProvider.cs (1)
147var arrayElementTypeNode = arrayElementType.GenerateTypeSyntax(allowVar: false);
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseExplicitTypeCodeFixProvider.cs (6)
92var typeSyntax = declarationExpression.Type; 140TypeSyntax typeSyntax, 207var typeName = type.GenerateTypeSyntax(allowVar: false); 234private static TypeSyntax GenerateTypeDeclaration(TypeSyntax typeSyntax, ITypeSymbol newTypeSymbol) 238var newTypeSyntax = newTypeSymbol
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseImplicitTypeCodeFixProvider.cs (3)
47var typeSyntax = (TypeSyntax)root.FindNode(diagnostic.Location.SourceSpan, getInnermostNodeForTie: true); 52internal static void ReplaceTypeWithVar(SyntaxEditor editor, TypeSyntax type)
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (2)
39private static readonly TypeSyntax s_objectType = PredefinedType(ObjectKeyword); 219var returnType = delegateMethod.GenerateReturnTypeSyntax();
src\roslyn\src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpAsAndMemberAccessCodeFixProvider.cs (1)
73(TypeSyntax)asExpression.Right.WithAppendedTrailingTrivia(Space),
src\roslyn\src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpAsAndNullCheckCodeFixProvider.cs (2)
132TypeSyntax GetPatternType() 155return (TypeSyntax)asExpression.Right;
src\roslyn\src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpIsAndCastCheckCodeFixProvider.cs (1)
60((TypeSyntax)isExpression.Right).WithoutTrivia(),
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseUnboundGenericTypeInNameOf\CSharpUseUnboundGenericTypeInNameOfCodeFixProvider.cs (1)
67return current.WithArguments(SeparatedList<TypeSyntax>(list));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (1)
783TypeSyntax newTypeSyntax;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\PropertyGenerator.cs (1)
158private static TypeSyntax GenerateTypeSyntax(IPropertySymbol property)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (2)
283if (expr is TypeSyntax) 493targetToken.GetPreviousToken(includeSkipped: true).IsLastTokenOfNode<TypeSyntax>())
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (11)
957{ Parent: TypeSyntax { Parent.RawKind: (int)SyntaxKind.FunctionPointerParameter } } => true, 1523if (leftToken.IsLastTokenOfNode<TypeSyntax>(out var typeSyntax)) 1528while (typeSyntax.Parent is TypeSyntax parentTypeSyntax) 2333if (binary.Left is TypeSyntax type && type.IsPotentialTypeName(semanticModel, cancellationToken)) 2354var type = previousToken.Parent as TypeSyntax; 2360var underlyingType = type is PointerTypeSyntax pointerType 2394return conditionalExpression.Condition is not TypeSyntax type 2855var type = token.GetAncestors<TypeSyntax>().LastOrDefault();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
115var typeSyntax = targetType.GenerateTypeSyntax();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.cs (7)
32public static TypeSyntax GenerateTypeSyntax(this INamespaceOrTypeSymbol symbol, bool allowVar = true) 35private static TypeSyntax GenerateTypeSyntax( 46var syntax = containsAnonymousType 70public static TypeSyntax GenerateRefTypeSyntax( 73var underlyingType = GenerateTypeSyntax(symbol, allowVar) 80public static TypeSyntax GenerateRefReadOnlyTypeSyntax( 83var underlyingType = GenerateTypeSyntax(symbol, allowVar)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.ExpressionSyntaxGeneratorVisitor.cs (1)
43if (!_nameOnly && TypeSyntaxGeneratorVisitor.TryCreateNativeIntegerType(symbol, out var typeSyntax))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (24)
22private sealed class TypeSyntaxGeneratorVisitor(bool nameOnly) : SymbolVisitor<TypeSyntax> 39public override TypeSyntax DefaultVisit(ISymbol node) 43where TTypeSyntax : TypeSyntax 51public override TypeSyntax VisitAlias(IAliasSymbol symbol) 62public override TypeSyntax VisitArrayType(IArrayTypeSymbol symbol) 92var elementTypeSyntax = underlyingType.GenerateTypeSyntax(); 104TypeSyntax arrayTypeSyntax = ArrayType(elementTypeSyntax, [.. ranks]); 114public override TypeSyntax VisitDynamicType(IDynamicTypeSymbol symbol) 122public static bool TryCreateNativeIntegerType(INamedTypeSymbol symbol, [NotNullWhen(true)] out TypeSyntax? syntax) 134public override TypeSyntax VisitFunctionPointerType(IFunctionPointerTypeSymbol symbol) 178public TypeSyntax CreateSimpleTypeSyntax(INamedTypeSymbol symbol) 182var syntax = TryCreateSpecializedNamedTypeSyntax(symbol); 204? Enumerable.Repeat((TypeSyntax)OmittedTypeArgument(), symbol.TypeArguments.Length) 218private static TypeSyntax? TryCreateSpecializedNamedTypeSyntax(INamedTypeSymbol symbol) 257public override TypeSyntax VisitNamedType(INamedTypeSymbol symbol) 259if (TryCreateNativeIntegerType(symbol, out var typeSyntax)) 271var containingTypeSyntax = symbol.ContainingType.Accept(this); 295var container = symbol.ContainingNamespace.Accept(this)!; 312public override TypeSyntax VisitNamespace(INamespaceSymbol symbol) 326var container = symbol.ContainingNamespace.Accept(this)!; 337private static TypeSyntax AddGlobalAlias(INamespaceOrTypeSymbol symbol, SimpleNameSyntax syntax) 345public override TypeSyntax VisitPointerType(IPointerTypeSymbol symbol) 354public override TypeSyntax VisitTypeParameter(ITypeParameterSymbol symbol) 356TypeSyntax typeSyntax = AddInformationTo(symbol.Name.ToIdentifierName(), symbol);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\TypeSyntaxExtensions.cs (2)
16public static bool IsPotentialTypeName([NotNullWhen(true)] this TypeSyntax? typeSyntax, SemanticModel? semanticModelOpt, CancellationToken cancellationToken) 55public static TypeSyntax GenerateReturnTypeSyntax(this IMethodSymbol method)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpMoveDeclarationNearReferenceService.cs (1)
57var type = declarationStatement.Declaration.Type;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSyntaxGeneratorInternal.cs (7)
79type == null ? SyntaxFactory.IdentifierName("var") : (TypeSyntax)type, 248=> SyntaxFactory.TypePattern((TypeSyntax)type); 256=> SyntaxFactory.CastExpression((TypeSyntax)type, (ExpressionSyntax)ParenthesizeNonSimple(expression)).WithAdditionalAnnotations(Simplifier.Annotation); 259=> SyntaxFactory.DefaultExpression((TypeSyntax)type).WithAdditionalAnnotations(Simplifier.Annotation); 298var type = typeSymbol.GenerateTypeSyntax(); 323if (expression is TypeSyntax || 349=> SyntaxFactory.CastExpression((TypeSyntax)type, (ExpressionSyntax)ParenthesizeNonSimple(expression)).WithAdditionalAnnotations(Simplifier.Annotation);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
2252var variableType = variableDeclarator.GetVariableType();
Microsoft.CodeAnalysis.CSharp.Features (170)
CodeRefactorings\ConvertLocalFunctionToMethod\CSharpConvertLocalFunctionToMethodCodeRefactoringProvider.cs (1)
137var additionalTypeArguments = additionalTypeParameters.SelectAsArray(p => (TypeSyntax)p.Name.ToIdentifierName());
CodeRefactorings\InlineTemporary\InlineTemporaryCodeRefactoringProvider.cs (1)
459var type = localSymbol.Type.GenerateTypeSyntax();
CodeRefactorings\SyncNamespace\CSharpChangeNamespaceService.cs (1)
183var container = qualifiedCref.Container;
CodeRefactorings\UseExplicitOrImplicitType\AbstractUseTypeCodeRefactoringProvider.cs (7)
23protected abstract Task HandleDeclarationAsync(Document document, SyntaxEditor editor, TypeSyntax type, CancellationToken cancellationToken); 24protected abstract TypeSyntax FindAnalyzableType(SyntaxNode node, SemanticModel semanticModel, CancellationToken cancellationToken); 25protected abstract TypeStyleResult AnalyzeTypeName(TypeSyntax typeName, SemanticModel semanticModel, CSharpSimplifierOptions options, CancellationToken cancellationToken); 44var declaredType = FindAnalyzableType(declaration, semanticModel, cancellationToken); 94var type = await context.TryGetRelevantNodeAsync<TypeSyntax>().ConfigureAwait(false); 118private async Task<Document> UpdateDocumentAsync(Document document, TypeSyntax type, CancellationToken cancellationToken)
CodeRefactorings\UseExplicitOrImplicitType\UseExplicitTypeCodeRefactoringProvider.cs (3)
29protected override TypeSyntax FindAnalyzableType(SyntaxNode node, SemanticModel semanticModel, CancellationToken cancellationToken) 32protected override TypeStyleResult AnalyzeTypeName(TypeSyntax typeName, SemanticModel semanticModel, CSharpSimplifierOptions options, CancellationToken cancellationToken) 35protected override Task HandleDeclarationAsync(Document document, SyntaxEditor editor, TypeSyntax node, CancellationToken cancellationToken)
CodeRefactorings\UseExplicitOrImplicitType\UseImplicitTypeCodeRefactoringProvider.cs (3)
29protected override TypeSyntax FindAnalyzableType(SyntaxNode node, SemanticModel semanticModel, CancellationToken cancellationToken) 32protected override TypeStyleResult AnalyzeTypeName(TypeSyntax typeName, SemanticModel semanticModel, CSharpSimplifierOptions options, CancellationToken cancellationToken) 35protected override Task HandleDeclarationAsync(Document document, SyntaxEditor editor, TypeSyntax type, CancellationToken cancellationToken)
CodeRefactorings\UseRecursivePatterns\UseRecursivePatternsCodeRefactoringProvider.cs (3)
274TypeSyntax type when originalReceiver.IsParentKind(IsExpression) => TypePattern(type), 360BinaryExpressionSyntax(IsExpression) { Right: TypeSyntax type } expr => (expr.Left, type, Flipped: false), 406private static RecursivePatternSyntax RecursivePattern(TypeSyntax? type, SubpatternSyntax subpattern, VariableDesignationSyntax? designation)
Completion\CompletionProviders\AwaitCompletionProvider.cs (1)
56var existingReturnType = declaration switch
Completion\CompletionProviders\DeclarationName\DeclarationNameInfo.cs (2)
138SemanticModel semanticModel, SyntaxToken token, TypeSyntax type, out NameDeclarationInfo result) 192var type = SyntaxFactory.ParseTypeName(sourceText.ToString(subSpan));
Completion\CompletionProviders\ExplicitInterfaceTypeCompletionProvider.cs (3)
77var typeNode = potentialTypeNode as TypeSyntax; 81if (typeNode.Parent is TypeSyntax parentType && parentType.Span.End < position)
Completion\CompletionProviders\OverrideCompletionProvider.cs (1)
53if (startToken.Parent is TypeSyntax typeSyntax)
Completion\KeywordRecommenders\CheckedKeywordRecommender.cs (2)
30if (previousPossiblySkippedToken.IsLastTokenOfNode<TypeSyntax>()) 41if (firstSpecifierToken.GetPreviousToken(includeSkipped: true).IsLastTokenOfNode<TypeSyntax>())
Completion\KeywordRecommenders\InKeywordRecommender.cs (2)
88var typeSyntax = token.Parent as TypeSyntax;
ConvertCast\CSharpConvertDirectCastToTryCastCodeRefactoringProvider.cs (3)
30: AbstractConvertCastCodeRefactoringProvider<TypeSyntax, CastExpressionSyntax, BinaryExpressionSyntax> 37protected override TypeSyntax GetTypeNode(CastExpressionSyntax from) 42var newTypeNode = castExpression.Type;
ConvertCast\CSharpConvertTryCastToDirectCastCodeRefactoringProvider.cs (4)
26: AbstractConvertCastCodeRefactoringProvider<TypeSyntax, BinaryExpressionSyntax, CastExpressionSyntax> 39protected override TypeSyntax GetTypeNode(BinaryExpressionSyntax expression) 40=> (TypeSyntax)expression.Right; 45var typeNode = GetTypeNode(asExpression);
ConvertForEachToFor\CSharpConvertForEachToForCodeRefactoringProvider.cs (1)
72var collectionStatementType = typeSymbol.GenerateTypeSyntax();
ConvertForToForEach\CSharpConvertForToForEachCodeRefactoringProvider.cs (2)
24TypeSyntax, 114TypeSyntax? typeNode,
ConvertIfToSwitch\CSharpConvertIfToSwitchCodeRefactoringProvider.Rewriting.cs (2)
116AnalyzedPattern.Type p when feature.HasFlag(Feature.TypePattern) => TypePattern((TypeSyntax)p.IsExpressionSyntax.Right), 117AnalyzedPattern.Type p => DeclarationPattern((TypeSyntax)p.IsExpressionSyntax.Right, DiscardDesignation()),
ConvertLinq\ConvertForEachToLinqQuery\DefaultConverter.cs (1)
20private static readonly TypeSyntax s_varNameIdentifier = IdentifierName("var");
ConvertLinq\CSharpConvertLinqQueryToForEachProvider.cs (2)
33private static readonly TypeSyntax VarNameIdentifier = IdentifierName("var"); 520var typeSyntax = generateTypeFromExpression
Debugging\DataTipInfoGetter.cs (1)
36else if (expression is TypeSyntax typeSyntax && typeSyntax.IsVar)
Diagnostics\Analyzers\CSharpPreferFrameworkTypeDiagnosticAnalyzer.cs (1)
18TypeSyntax,
DocumentationComments\CSharpDocumentationCommentSnippetService.cs (3)
138var returnType = member.GetMemberType(); 178else if (expression is ObjectCreationExpressionSyntax { Type: TypeSyntax exceptionType }) 191private static bool IsExceptionCaughtAndNotRethrown(bool hasUsingSystem, TypeSyntax exceptionType)
EditAndContinue\SyntaxComparer.cs (3)
949GetNestedFunctionsParts(leftNode, out var leftParameters, out var leftAsync, out var leftBody, out var leftModifiers, out var leftReturnType, out var leftIdentifier, out var leftTypeParameters); 950GetNestedFunctionsParts(rightNode, out var rightParameters, out var rightAsync, out var rightBody, out var rightModifiers, out var rightReturnType, out var rightIdentifier, out var rightTypeParameters); 979out TypeSyntax? returnType,
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.cs (4)
315private SeparatedSyntaxList<TypeSyntax> CreateMethodCallTypeVariables() 763var typeSyntax = declarationStatement.Declaration.Type; 1069var returnType = syntaxNode is MethodDeclarationSyntax method ? method.ReturnType : ((LocalFunctionStatementSyntax)syntaxNode).ReturnType; 1118TypeSyntax returnType,
GenerateMember\GenerateVariable\CSharpGenerateVariableService.cs (1)
163var parsedType = ParseTypeName(localText, startIndex, consumeFullText: false);
GenerateType\CSharpGenerateTypeService.cs (5)
56if (expression is TypeSyntax typeSyntax && expression.Parent is TypeArgumentListSyntax typeArgumentList) 86if (expression is TypeSyntax { Parent: BaseTypeSyntax { Parent: BaseListSyntax baseList } baseType } && 101if (expression is TypeSyntax { Parent: TypeConstraintSyntax { Parent: TypeParameterConstraintClauseSyntax constraintClause } typeConstraint }) 454state.NameOrMemberAccessExpression as TypeSyntax, cancellationToken); 463state.NameOrMemberAccessExpression as TypeSyntax, cancellationToken);
IntroduceVariable\CSharpIntroduceVariableService.cs (1)
25AbstractIntroduceVariableService<CSharpIntroduceVariableService, ExpressionSyntax, TypeSyntax, TypeDeclarationSyntax, QueryExpressionSyntax, NameSyntax>
IntroduceVariable\CSharpIntroduceVariableService_IntroduceLocal.cs (1)
228private static TypeSyntax GetTypeSyntax(SemanticDocument document, ExpressionSyntax expression, CancellationToken cancellationToken)
Rename\CSharpRenameIssuesService.cs (1)
61TypeSyntax? declaredType = null;
ReplaceConditionalWithStatements\CSharpReplaceConditionalWithStatementsCodeRefactoringProvider.cs (1)
70var type = localDeclarationStatement.Declaration.Type;
ReplacePropertyWithMethods\CSharpReplacePropertyWithMethodsService.cs (1)
312if (parameterType is TypeSyntax typeSyntax)
Snippets\AbstractCSharpAutoPropertySnippetProvider.cs (1)
82var type = propertyDeclaration.Type;
Snippets\AbstractCSharpForLoopSnippetProvider.cs (2)
84(TypeSyntax iteratorType, SyntaxNode? inlineExpression) GetLoopHeaderParts() 93var iteratorType = csharpSimplifierOptions.VarForBuiltInTypes.Value
Snippets\AbstractCSharpMainMethodSnippetProvider.cs (1)
15: AbstractMainMethodSnippetProvider<MethodDeclarationSyntax, StatementSyntax, TypeSyntax>
Snippets\CSharpIntMainSnippetProvider.cs (2)
30protected override TypeSyntax GenerateReturnType(SyntaxGenerator generator) 31=> (TypeSyntax)generator.TypeExpression(SpecialType.System_Int32);
Snippets\CSharpVoidMainSnippetProvider.cs (1)
30protected override TypeSyntax GenerateReturnType(SyntaxGenerator generator)
SolutionExplorer\CSharpSolutionExplorerSymbolTreeItemProvider.cs (1)
443private static void AppendType(TypeSyntax? type, StringBuilder builder)
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryDiscardDesignation\CSharpRemoveUnnecessaryDiscardDesignationDiagnosticAnalyzer.cs (1)
60var typeSyntax = declarationPattern.Type;
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (1)
294n => n is TypeSyntax or
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\NullableImpactingSpanWalker.cs (4)
61private static bool IsLanguageRestrictedToNonNullForm(TypeSyntax node) 107static TypeSyntax WalkUpCurrentQualifiedName(TypeSyntax node) 128if (node is TypeSyntax typeSyntax
src\roslyn\src\Analyzers\CSharp\Analyzers\SimplifyLinqExpression\CSharpSimplifyLinqTypeCheckAndCastDiagnosticAnalyzer.cs (3)
75Right: TypeSyntax whereTypeSyntax 94[NotNullWhen(true)] out TypeSyntax? caseOrSelectType) 192out var castTypeArgument))
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (1)
754Func<TArrayCreationExpressionSyntax, TypeSyntax> getType,
src\roslyn\src\Analyzers\CSharp\Analyzers\UseDeconstruction\CSharpUseDeconstructionDiagnosticAnalyzer.cs (2)
137TypeSyntax typeNode, 218private static bool IsViableTupleTypeSyntax(TypeSyntax type)
src\roslyn\src\Analyzers\CSharp\Analyzers\UseImplicitObjectCreation\CSharpUseImplicitObjectCreationDiagnosticAnalyzer.cs (1)
85TypeSyntax? typeNode;
src\roslyn\src\Analyzers\CSharp\Analyzers\UseImplicitOrExplicitType\CSharpTypeStyleDiagnosticAnalyzerBase.cs (1)
51var declaredType = Helper.FindAnalyzableType(declarationStatement, semanticModel, cancellationToken);
src\roslyn\src\Analyzers\CSharp\Analyzers\UsePatternCombinators\AnalyzedPattern.cs (3)
34if (binaryExpression.Right is not TypeSyntax typeSyntax) 75public readonly TypeSyntax TypeSyntax; 77private Type(TypeSyntax type, IOperation target) : base(target)
src\roslyn\src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpUseNotPatternDiagnosticAnalyzer.cs (1)
81BinaryExpressionSyntax(SyntaxKind.IsExpression) { Right: TypeSyntax type } isExpression
src\roslyn\src\Analyzers\CSharp\Analyzers\UseUnboundGenericTypeInNameOf\CSharpUseUnboundGenericTypeInNameOfDiagnosticAnalyzer.cs (1)
70foreach (var argument in typeArgumentList.Arguments)
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs (1)
111var type = cannotUseVar ? declaratorToRemoveType!.GenerateTypeSyntax() : IdentifierName("var");
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (1)
254var type = result.IsInherited
src\roslyn\src\Analyzers\CSharp\CodeFixes\FixReturnType\CSharpFixReturnTypeCodeFixProvider.cs (8)
57static bool IsVoid(TypeSyntax typeSyntax) 61private static async Task<(TypeSyntax declarationToFix, TypeSyntax fixedDeclaration)> TryGetOldAndNewReturnTypeAsync( 89var fixedDeclaration = returnedType.GenerateTypeSyntax(allowVar: false); 117var taskTypeSyntax = taskType.GenerateTypeSyntax(allowVar: false); 118fixedDeclaration = (TypeSyntax)syntaxGenerator.WithTypeArguments(taskTypeSyntax, fixedDeclaration); 134private static (TypeSyntax type, bool isAsync) TryGetDeclarationTypeToFix(SyntaxNode node) 138static (TypeSyntax type, bool isAsync) TryGetReturnTypeToFix(SyntaxNode containingMember)
src\roslyn\src\Analyzers\CSharp\CodeFixes\GenerateDefaultConstructors\CSharpGenerateDefaultConstructorsService.cs (2)
43var node = semanticDocument.Root.FindToken(textSpan.Start).GetAncestor<TypeSyntax>();
src\roslyn\src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateParameterizedMemberService.cs (4)
87foreach (var type in genericName.TypeArgumentList.Arguments) 104TypeSyntax type, 112private ITypeParameterSymbol? GetMethodTypeParameter(TypeSyntax type, CancellationToken cancellationToken) 151foreach (var typeArgument in genericName.TypeArgumentList.Arguments)
src\roslyn\src\Analyzers\CSharp\CodeFixes\HiddenExplicitCast\CSharpHiddenExplicitCastCodeFixProvider.cs (1)
46var typeToInsert = SyntaxFactory.ParseTypeName(diagnostic.Properties[CSharpHiddenExplicitCastDiagnosticAnalyzer.Type]!);
src\roslyn\src\Analyzers\CSharp\CodeFixes\ImplementInterface\CSharpImplementInterfaceCodeFixProvider.cs (1)
19: AbstractImplementInterfaceCodeFixProvider<TypeSyntax>
src\roslyn\src\Analyzers\CSharp\CodeFixes\ImplementInterface\CSharpImplementInterfaceService.cs (1)
56if (node is TypeSyntax interfaceNode && interfaceNode.Parent is BaseTypeSyntax baseType &&
src\roslyn\src\Analyzers\CSharp\CodeFixes\InlineDeclaration\CSharpInlineDeclarationCodeFixProvider.cs (4)
218var newType = GenerateTypeSyntaxOrVar(local.Type, options); 231var explicitType = declaration.Type.IsVar ? local.Type?.GenerateTypeSyntax() : declaration.Type; 240public static TypeSyntax GenerateTypeSyntaxOrVar( 268TypeSyntax newType, VariableDeclaratorSyntax declaratorOpt)
src\roslyn\src\Analyzers\CSharp\CodeFixes\Iterator\CSharpChangeToIEnumerableCodeFixProvider.cs (1)
74var newReturnType = ienumerableGenericSymbol.GenerateTypeSyntax();
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeMethodAsynchronous\CSharpMakeMethodAsynchronousCodeFixProvider.cs (8)
98var fixedReturnType = FixMethodReturnType(keepVoid, methodSymbol, method.ReturnType, knownTypes); 123private static TypeSyntax FixMethodReturnType( 126TypeSyntax returnTypeSyntax, 129var newReturnType = returnTypeSyntax.WithAdditionalAnnotations(Formatter.Annotation); 167static TypeSyntax MakeGenericType(string type, ITypeSymbol typeArgumentFrom) 187private static (SyntaxTokenList newModifiers, TypeSyntax newReturnType) AddAsyncModifierWithCorrectedTrivia(SyntaxTokenList modifiers, TypeSyntax returnType) 208var newReturnType = returnType.WithoutLeadingTrivia();
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeMethodSynchronous\CSharpMakeMethodSynchronousCodeFixProvider.cs (5)
46var newReturnType = FixMethodReturnType(methodSymbol, method.ReturnType, knownTypes); 52var newReturnType = FixMethodReturnType(methodSymbol, localFunction.ReturnType, knownTypes); 56private static TypeSyntax FixMethodReturnType(IMethodSymbol methodSymbol, TypeSyntax returnTypeSyntax, KnownTaskTypes knownTypes) 58var newReturnType = returnTypeSyntax;
src\roslyn\src\Analyzers\CSharp\CodeFixes\MisplacedUsingDirectives\MisplacedUsingDirectivesCodeFixProvider.cs (1)
189var newType = await Simplifier.ExpandAsync(usingDirective.NamespaceOrType, document, cancellationToken: cancellationToken).ConfigureAwait(false);
src\roslyn\src\Analyzers\CSharp\CodeFixes\Nullable\CSharpDeclareAsNullableCodeFixProvider.cs (10)
48var declarationTypeToFix = await TryGetDeclarationTypeToFixAsync( 80using var _ = PooledHashSet<TypeSyntax>.GetInstance(out var alreadyHandled); 99Document document, SemanticModel model, SyntaxEditor editor, SyntaxNode node, HashSet<TypeSyntax> alreadyHandled, CancellationToken cancellationToken) 101var declarationTypeToFix = await TryGetDeclarationTypeToFixAsync( 110private static async Task<TypeSyntax?> TryGetDeclarationTypeToFixAsync( 269static TypeSyntax? TryGetReturnType(TypeSyntax returnType, SyntaxTokenList modifiers, bool onYield) 283static TypeSyntax? TryGetSingleTypeArgument(TypeSyntax type) 301static TypeSyntax? TryGetParameterTypeSyntax(IParameterSymbol? parameterSymbol, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveAsyncModifier\RemoveAsyncModifierHelpers.cs (3)
12internal static SyntaxNode WithoutAsyncModifier(MethodDeclarationSyntax method, TypeSyntax returnType) 18internal static SyntaxNode WithoutAsyncModifier(LocalFunctionStatementSyntax localFunction, TypeSyntax returnType) 33private static SyntaxTokenList RemoveAsyncModifier(SyntaxTokenList modifiers, ref TypeSyntax newReturnType)
src\roslyn\src\Analyzers\CSharp\CodeFixes\SimplifyLinqExpression\CSharpSimplifyLinqTypeCheckAndCastCodeFixProvider.cs (2)
46var typeSyntax = (TypeSyntax)diagnostic.AdditionalLocations[1].FindNode(getInnermostNodeForTie: true, cancellationToken);
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseDeconstruction\CSharpUseDeconstructionCodeFixProvider.cs (2)
145private ExpressionSyntax CreateTupleOrDeclarationExpression(INamedTypeSymbol tupleType, TypeSyntax typeNode) 156private static DeclarationExpressionSyntax CreateDeclarationExpression(INamedTypeSymbol tupleType, TypeSyntax typeNode)
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseExplicitArrayInExpressionTree\CSharpUseExplicitArrayInExpressionTreeCodeFixProvider.cs (1)
147var arrayElementTypeNode = arrayElementType.GenerateTypeSyntax(allowVar: false);
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseExplicitTypeCodeFixProvider.cs (6)
92var typeSyntax = declarationExpression.Type; 140TypeSyntax typeSyntax, 207var typeName = type.GenerateTypeSyntax(allowVar: false); 234private static TypeSyntax GenerateTypeDeclaration(TypeSyntax typeSyntax, ITypeSymbol newTypeSymbol) 238var newTypeSyntax = newTypeSymbol
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseImplicitTypeCodeFixProvider.cs (3)
47var typeSyntax = (TypeSyntax)root.FindNode(diagnostic.Location.SourceSpan, getInnermostNodeForTie: true); 52internal static void ReplaceTypeWithVar(SyntaxEditor editor, TypeSyntax type)
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (2)
39private static readonly TypeSyntax s_objectType = PredefinedType(ObjectKeyword); 219var returnType = delegateMethod.GenerateReturnTypeSyntax();
src\roslyn\src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpAsAndMemberAccessCodeFixProvider.cs (1)
73(TypeSyntax)asExpression.Right.WithAppendedTrailingTrivia(Space),
src\roslyn\src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpAsAndNullCheckCodeFixProvider.cs (2)
132TypeSyntax GetPatternType() 155return (TypeSyntax)asExpression.Right;
src\roslyn\src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpIsAndCastCheckCodeFixProvider.cs (1)
60((TypeSyntax)isExpression.Right).WithoutTrivia(),
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseUnboundGenericTypeInNameOf\CSharpUseUnboundGenericTypeInNameOfCodeFixProvider.cs (1)
67return current.WithArguments(SeparatedList<TypeSyntax>(list));
UsePatternMatching\CSharpIsAndCastCheckWithoutNameDiagnosticAnalyzer.cs (3)
124var type = (TypeSyntax)isExpression.Right; 224SyntaxFactory.DeclarationPattern((TypeSyntax)isExpression.Right.WithTrailingTrivia(SyntaxFactory.Space),
Microsoft.CodeAnalysis.CSharp.NetAnalyzers (38)
Microsoft.NetCore.Analyzers\InteropServices\CSharpDisableRuntimeMarshalling.Fixer.cs (2)
99editor.ReplaceNode(syntax, SyntaxFactory.SizeOfExpression((TypeSyntax)editor.Generator.TypeExpression(operation.TargetMethod.TypeArguments[0]))); 195static TypeSyntax GetTypeOfTypeSyntax(TypeOfExpressionSyntax syntax)
Microsoft.NetCore.Analyzers\Performance\CSharpPreferDictionaryTryMethodsOverContainsKeyGuardFixer.cs (3)
132TypeSyntax typeSyntax; 135typeSyntax = (TypeSyntax)generator.TypeExpression(type); 137typeSyntax = (TypeSyntax)generator.NullableTypeExpression(typeSyntax);
Microsoft.NetCore.Analyzers\Performance\CSharpUseStartsWithInsteadOfIndexOfComparisonWithZero.Fixer.cs (1)
27(TypeSyntax)generator.TypeExpression(SpecialType.System_Char),
Microsoft.NetCore.Analyzers\Runtime\CSharpAvoidRedundantRegexIsMatchBeforeMatch.Fixer.cs (1)
324TypeSyntax typeSyntax, SemanticModel model, CancellationToken cancellationToken)
Microsoft.NetCore.Analyzers\Runtime\CSharpDetectPreviewFeatureAnalyzer.cs (11)
45TypeSyntax parameterType = fieldDeclaration.Type; 65private static TypeSyntax GetElementTypeForNullableAndArrayTypeNodes(TypeSyntax parameterType) 92TypeSyntax parameterType = parameter.Type!; 123TypeSyntax returnType = propertyDeclaration.Type; 139TypeSyntax returnType = methodDeclaration.ReturnType; 167foreach (TypeSyntax typeArgument in typeArgumentList.Arguments) 169TypeSyntax typeArgumentElementType = GetElementTypeForNullableAndArrayTypeNodes(typeArgument); 227TypeSyntax typeConstraintSyntaxType = typeConstraintSyntax.Type; 277TypeSyntax type = simpleBaseTypeSyntax.Type; 301private static bool IsIdentifierNameSyntax(TypeSyntax identifier, ISymbol previewInterfaceSymbol) => identifier is IdentifierNameSyntax identifierName && IsSyntaxToken(identifierName.Identifier, previewInterfaceSymbol) ||
Microsoft.NetCore.Analyzers\Runtime\CSharpForwardCancellationTokenToInvocationsFixer.TypeNameVisitor.cs (18)
17private class TypeNameVisitor : SymbolVisitor<TypeSyntax> 19public static TypeSyntax GetTypeSyntaxForSymbol(INamespaceOrTypeSymbol symbol) 24public override TypeSyntax DefaultVisit(ISymbol symbol) 27public override TypeSyntax VisitAlias(IAliasSymbol symbol) 32public override TypeSyntax VisitDynamicType(IDynamicTypeSymbol symbol) 37public override TypeSyntax VisitNamedType(INamedTypeSymbol symbol) 39if (TryCreateNativeIntegerType(symbol, out var typeSyntax)) 50var containingTypeSyntax = symbol.ContainingType.Accept(this); 73var container = symbol.ContainingNamespace.Accept(this)!; 89public override TypeSyntax VisitNamespace(INamespaceSymbol symbol) 103var container = symbol.ContainingNamespace.Accept(this)!; 110public override TypeSyntax VisitTypeParameter(ITypeParameterSymbol symbol) 112TypeSyntax typeSyntax = AddInformationTo(ToIdentifierName(symbol.Name)); 119private TypeSyntax CreateSimpleTypeSyntax(INamedTypeSymbol symbol) 142? Enumerable.Repeat((TypeSyntax)OmittedTypeArgument(), symbol.TypeArguments.Length) 160where TTypeSyntax : TypeSyntax 170private static TypeSyntax AddGlobalAlias(SimpleNameSyntax syntax) 181private static bool TryCreateNativeIntegerType(INamedTypeSymbol symbol, [NotNullWhen(true)] out TypeSyntax? syntax)
Microsoft.NetCore.Analyzers\Runtime\CSharpPreventNumericIntPtrUIntPtrBehavioralChanges.cs (2)
55var type = GetType(definition); 85private static TypeSyntax? GetType(SyntaxNode syntax) =>
Microsoft.CodeAnalysis.CSharp.Workspaces (177)
CodeGeneration\CSharpSyntaxGenerator.cs (46)
180(TypeSyntax)type, 198(TypeSyntax?)type, 240returnType: returnType != null ? (TypeSyntax)returnType : SyntaxFactory.PredefinedType(VoidKeyword), 266var returnTypeNode = returnType != null ? (TypeSyntax)returnType : SyntaxFactory.PredefinedType(VoidKeyword); 418(TypeSyntax)type, 510(TypeSyntax)type, 547(TypeSyntax)type, 578(TypeSyntax)type, 706baseTypes.Add(SyntaxFactory.SimpleBaseType((TypeSyntax)baseType)); 709baseTypes.AddRange(interfaceTypes.Select(i => SyntaxFactory.SimpleBaseType((TypeSyntax)i))); 757var itypes = interfaceTypes?.Select(i => (BaseTypeSyntax)SyntaxFactory.SimpleBaseType((TypeSyntax)i)).ToList(); 778var itypes = interfaceTypes?.Select(i => (BaseTypeSyntax)SyntaxFactory.SimpleBaseType((TypeSyntax)i)).ToList(); 885underlyingType != null ? SyntaxFactory.BaseList([SyntaxFactory.SimpleBaseType((TypeSyntax)underlyingType)]) : null, 933returnType != null ? (TypeSyntax)returnType : SyntaxFactory.PredefinedType(VoidKeyword), 1838? SyntaxFactory.SeparatedList<TypeParameterConstraintSyntax>(types.Select(t => SyntaxFactory.TypeConstraint((TypeSyntax)t))) 2143private static TypeSyntax? NotVoid(TypeSyntax type) 2152SyntaxKind.DelegateDeclaration => ((DelegateDeclarationSyntax)declaration).WithReturnType((TypeSyntax)type), 2153SyntaxKind.MethodDeclaration => ((MethodDeclarationSyntax)declaration).WithReturnType((TypeSyntax)type), 2154SyntaxKind.FieldDeclaration => ((FieldDeclarationSyntax)declaration).WithDeclaration(((FieldDeclarationSyntax)declaration).Declaration.WithType((TypeSyntax)type)), 2155SyntaxKind.PropertyDeclaration => ((PropertyDeclarationSyntax)declaration).WithType((TypeSyntax)type), 2156SyntaxKind.IndexerDeclaration => ((IndexerDeclarationSyntax)declaration).WithType((TypeSyntax)type), 2157SyntaxKind.EventFieldDeclaration => ((EventFieldDeclarationSyntax)declaration).WithDeclaration(((EventFieldDeclarationSyntax)declaration).Declaration.WithType((TypeSyntax)type)), 2158SyntaxKind.EventDeclaration => ((EventDeclarationSyntax)declaration).WithType((TypeSyntax)type), 2159SyntaxKind.Parameter => ((ParameterSyntax)declaration).WithType((TypeSyntax)type), 2160SyntaxKind.LocalDeclarationStatement => ((LocalDeclarationStatementSyntax)declaration).WithDeclaration(((LocalDeclarationStatementSyntax)declaration).Declaration.WithType((TypeSyntax)type)), 2161SyntaxKind.VariableDeclaration => ((VariableDeclarationSyntax)declaration).WithType((TypeSyntax)type), 2822return WithBaseList(declaration, baseList.WithTypes(baseList.Types.Insert(0, SyntaxFactory.SimpleBaseType((TypeSyntax)baseType)))); 2826return AddBaseList(declaration, SyntaxFactory.BaseList([SyntaxFactory.SimpleBaseType((TypeSyntax)baseType)])); 2836return WithBaseList(declaration, baseList.WithTypes(baseList.Types.Insert(baseList.Types.Count, SyntaxFactory.SimpleBaseType((TypeSyntax)interfaceType)))); 2840return AddBaseList(declaration, SyntaxFactory.BaseList([SyntaxFactory.SimpleBaseType((TypeSyntax)interfaceType)])); 3317var arrayType = SyntaxFactory.ArrayType((TypeSyntax)elementType, [SyntaxFactory.ArrayRankSpecifier([(ExpressionSyntax)size])]); 3323var arrayType = SyntaxFactory.ArrayType((TypeSyntax)elementType, 3330=> SyntaxFactory.ObjectCreationExpression((TypeSyntax)type, CreateArgumentList(arguments), null); 3334(TypeSyntax)type, 3360=> SyntaxFactory.BinaryExpression(SyntaxKind.IsExpression, (ExpressionSyntax)ParenthesizeNonSimple(expression), (TypeSyntax)type); 3363=> SyntaxFactory.TypeOfExpression((TypeSyntax)type); 3366=> SyntaxFactory.BinaryExpression(SyntaxKind.AsExpression, (ExpressionSyntax)ParenthesizeNonSimple(expression), (TypeSyntax)type); 3456SyntaxFactory.TypeArgumentList([.. typeArguments.Cast<TypeSyntax>()])); 3464return SyntaxFactory.GenericName(sname.Identifier, SyntaxFactory.TypeArgumentList([.. typeArguments.Cast<TypeSyntax>()])); 3468return gname.WithTypeArgumentList(SyntaxFactory.TypeArgumentList([.. typeArguments.Cast<TypeSyntax>()])); 3522=> SyntaxFactory.ArrayType((TypeSyntax)type, [SyntaxFactory.ArrayRankSpecifier()]); 3532return SyntaxFactory.NullableType((TypeSyntax)type); 3540=> SyntaxFactory.TupleElement((TypeSyntax)type, name?.ToIdentifierToken() ?? default); 3587SyntaxFactory.CatchDeclaration((TypeSyntax)type, name.ToIdentifierToken()),
FindSymbols\CSharpDeclaredSymbolInfoFactoryService.cs (3)
131ArrayBuilder<string> builder, TypeSyntax type, 589private static string? GetTypeName(TypeSyntax? type) 660if (node is TypeSyntax typeNode)
Rename\CSharpRenameRewriterLanguageService.cs (2)
1135if (enclosingNameMemberCrefOrnull != null && token.Parent is TypeSyntax && token.Parent.Parent is TypeSyntax)
Simplification\CSharpSimplificationService.Expander.cs (5)
187var typeSyntax = parameterSymbols[i].Type.GenerateTypeSyntax().WithTrailingTrivia(s_oneWhitespaceSeparator); 226var typeSyntax = parameterSymbol.Type.GenerateTypeSyntax().WithTrailingTrivia(s_oneWhitespaceSeparator); 394var rewrittenname = (TypeSyntax)this.Visit(node.Name); 766foreach (var typeArgument in castedTypeArgument.Arguments)
Simplification\Reducers\CSharpVarReducer.Rewriter.cs (1)
23private SyntaxNode ProcessTypeSyntax(TypeSyntax typeSyntax)
Simplification\Simplifiers\AbstractCSharpSimplifier.cs (2)
371protected static TypeSyntax CreatePredefinedTypeSyntax(SyntaxNode nodeToReplace, SyntaxToken token) 373TypeSyntax node = token.Kind() == SyntaxKind.IdentifierToken
Simplification\Simplifiers\ExpressionSimplifier.cs (4)
54if (TryReduceExplicitName(expression, semanticModel, out var replacementTypeNode, out issueSpan, options, cancellationToken)) 66[NotNullWhen(true)] out TypeSyntax? replacementNode, 89[NotNullWhen(true)] out TypeSyntax? replacementNode, 186.WithAdditionalAnnotations<TypeSyntax>(new SyntaxAnnotation(
Simplification\Simplifiers\NameSimplifier.cs (10)
25internal sealed class NameSimplifier : AbstractCSharpSimplifier<NameSyntax, TypeSyntax> 37out TypeSyntax replacementNode, 188out var replacementNodeWithoutAttributeSuffix, 287var oldType = genericName.TypeArgumentList.Arguments.First(); 370NameSyntax name, TypeSyntax replacement, 461out TypeSyntax replacementNode, 487out TypeSyntax replacementNode, 579NameSyntax name, TypeSyntax reducedName, SemanticModel semanticModel) 614private static bool CanReplaceWithReducedName(NameSyntax name, TypeSyntax reducedName, SemanticModel semanticModel, CancellationToken cancellationToken) 625private static bool IsNotNullableReplaceable(NameSyntax name, TypeSyntax reducedName)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeStyle\TypeStyle\TypeStyleHelper.cs (1)
202public static bool IsPredefinedType(TypeSyntax type)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\DefaultExpressionSyntaxExtensions.cs (2)
42var typeSyntax = GetTypeSyntax(equalsValueClause); 67private static TypeSyntax GetTypeSyntax(EqualsValueClauseSyntax equalsValueClause)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
606while (topExpression.Parent is TypeSyntax typeSyntax)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\MemberDeclarationSyntaxExtensions.cs (1)
153public static TypeSyntax GetMemberType(this MemberDeclarationSyntax member)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (5)
185TypeSyntax type, 319TypeSyntax type, 344private static TypeSyntax GetOutermostType(TypeSyntax type) 345=> type.GetAncestorsOrThis<TypeSyntax>().Last();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\TypeSyntaxExtensions.cs (5)
13public static bool IsVoid(this TypeSyntax typeSyntax) 17public static bool IsPartial(this TypeSyntax typeSyntax) 26public static bool IsTypeInferred(this TypeSyntax typeSyntax, SemanticModel semanticModel) 52public static TypeSyntax StripRefIfNeeded(this TypeSyntax type)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\VariableDeclaratorExtensions.cs (2)
13public static TypeSyntax GetVariableType(this VariableDeclaratorSyntax declarator) 25var variableTypeName = variable.GetVariableType();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (2)
762var type = memberDeclaration.GetMemberType(); 1479=> node is TypeSyntax;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\NameSyntaxComparer.cs (2)
117var xArg = x.TypeArgumentList.Arguments[i]; 118var yArg = y.TypeArgumentList.Arguments[i];
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (3)
32TypeSyntax, 96=> node is StatementSyntax(kind: not SyntaxKind.Block) or TypeSyntax or CrefSyntax || 141if (nodeToSpeculate is TypeSyntax typeNode)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpTypeStyleHelper.cs (4)
35TypeSyntax typeName, SemanticModel semanticModel, 54TypeSyntax typeName, SemanticModel semanticModel, CSharpSimplifierOptions options, CancellationToken cancellationToken); 57SyntaxToken identifier, TypeSyntax typeName, ExpressionSyntax initializer, SemanticModel semanticModel, CSharpSimplifierOptions options, CancellationToken cancellationToken); 59internal TypeSyntax? FindAnalyzableType(SyntaxNode node, SemanticModel semanticModel, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpTypeStyleHelper.State.cs (3)
109var typeSyntax = GetTypeSyntaxFromDeclaration(declarationStatement); 148var typeSyntax = GetTypeSyntaxFromDeclaration(declarationStatement); 155private static TypeSyntax? GetTypeSyntaxFromDeclaration(SyntaxNode declarationStatement)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseExplicitTypeHelper.cs (3)
60TypeSyntax typeName, SemanticModel semanticModel, 135TypeSyntax typeName, 149private static bool ContainsAnonymousType(TypeSyntax typeName, SemanticModel semanticModel, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (6)
30TypeSyntax typeName, SemanticModel semanticModel, 50var type = variableDeclaration.Type.StripRefIfNeeded(); 61var type = forEachStatement.Type.StripRefIfNeeded(); 92TypeSyntax typeName, SemanticModel semanticModel, 172var declarationTypeNode = declarationExpression.Type; 239TypeSyntax typeName,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeSyntaxComparer.cs (5)
11: IComparer<TypeSyntax?> 16public int Compare(TypeSyntax? x, TypeSyntax? y) 41private static TypeSyntax UnwrapType(TypeSyntax type)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (1)
783TypeSyntax newTypeSyntax;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\PropertyGenerator.cs (1)
158private static TypeSyntax GenerateTypeSyntax(IPropertySymbol property)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (2)
283if (expr is TypeSyntax) 493targetToken.GetPreviousToken(includeSkipped: true).IsLastTokenOfNode<TypeSyntax>())
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (11)
957{ Parent: TypeSyntax { Parent.RawKind: (int)SyntaxKind.FunctionPointerParameter } } => true, 1523if (leftToken.IsLastTokenOfNode<TypeSyntax>(out var typeSyntax)) 1528while (typeSyntax.Parent is TypeSyntax parentTypeSyntax) 2333if (binary.Left is TypeSyntax type && type.IsPotentialTypeName(semanticModel, cancellationToken)) 2354var type = previousToken.Parent as TypeSyntax; 2360var underlyingType = type is PointerTypeSyntax pointerType 2394return conditionalExpression.Condition is not TypeSyntax type 2855var type = token.GetAncestors<TypeSyntax>().LastOrDefault();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
115var typeSyntax = targetType.GenerateTypeSyntax();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.cs (7)
32public static TypeSyntax GenerateTypeSyntax(this INamespaceOrTypeSymbol symbol, bool allowVar = true) 35private static TypeSyntax GenerateTypeSyntax( 46var syntax = containsAnonymousType 70public static TypeSyntax GenerateRefTypeSyntax( 73var underlyingType = GenerateTypeSyntax(symbol, allowVar) 80public static TypeSyntax GenerateRefReadOnlyTypeSyntax( 83var underlyingType = GenerateTypeSyntax(symbol, allowVar)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.ExpressionSyntaxGeneratorVisitor.cs (1)
43if (!_nameOnly && TypeSyntaxGeneratorVisitor.TryCreateNativeIntegerType(symbol, out var typeSyntax))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (24)
22private sealed class TypeSyntaxGeneratorVisitor(bool nameOnly) : SymbolVisitor<TypeSyntax> 39public override TypeSyntax DefaultVisit(ISymbol node) 43where TTypeSyntax : TypeSyntax 51public override TypeSyntax VisitAlias(IAliasSymbol symbol) 62public override TypeSyntax VisitArrayType(IArrayTypeSymbol symbol) 92var elementTypeSyntax = underlyingType.GenerateTypeSyntax(); 104TypeSyntax arrayTypeSyntax = ArrayType(elementTypeSyntax, [.. ranks]); 114public override TypeSyntax VisitDynamicType(IDynamicTypeSymbol symbol) 122public static bool TryCreateNativeIntegerType(INamedTypeSymbol symbol, [NotNullWhen(true)] out TypeSyntax? syntax) 134public override TypeSyntax VisitFunctionPointerType(IFunctionPointerTypeSymbol symbol) 178public TypeSyntax CreateSimpleTypeSyntax(INamedTypeSymbol symbol) 182var syntax = TryCreateSpecializedNamedTypeSyntax(symbol); 204? Enumerable.Repeat((TypeSyntax)OmittedTypeArgument(), symbol.TypeArguments.Length) 218private static TypeSyntax? TryCreateSpecializedNamedTypeSyntax(INamedTypeSymbol symbol) 257public override TypeSyntax VisitNamedType(INamedTypeSymbol symbol) 259if (TryCreateNativeIntegerType(symbol, out var typeSyntax)) 271var containingTypeSyntax = symbol.ContainingType.Accept(this); 295var container = symbol.ContainingNamespace.Accept(this)!; 312public override TypeSyntax VisitNamespace(INamespaceSymbol symbol) 326var container = symbol.ContainingNamespace.Accept(this)!; 337private static TypeSyntax AddGlobalAlias(INamespaceOrTypeSymbol symbol, SimpleNameSyntax syntax) 345public override TypeSyntax VisitPointerType(IPointerTypeSymbol symbol) 354public override TypeSyntax VisitTypeParameter(ITypeParameterSymbol symbol) 356TypeSyntax typeSyntax = AddInformationTo(symbol.Name.ToIdentifierName(), symbol);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\TypeSyntaxExtensions.cs (2)
16public static bool IsPotentialTypeName([NotNullWhen(true)] this TypeSyntax? typeSyntax, SemanticModel? semanticModelOpt, CancellationToken cancellationToken) 55public static TypeSyntax GenerateReturnTypeSyntax(this IMethodSymbol method)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpMoveDeclarationNearReferenceService.cs (1)
57var type = declarationStatement.Declaration.Type;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSyntaxGeneratorInternal.cs (7)
79type == null ? SyntaxFactory.IdentifierName("var") : (TypeSyntax)type, 248=> SyntaxFactory.TypePattern((TypeSyntax)type); 256=> SyntaxFactory.CastExpression((TypeSyntax)type, (ExpressionSyntax)ParenthesizeNonSimple(expression)).WithAdditionalAnnotations(Simplifier.Annotation); 259=> SyntaxFactory.DefaultExpression((TypeSyntax)type).WithAdditionalAnnotations(Simplifier.Annotation); 298var type = typeSymbol.GenerateTypeSyntax(); 323if (expression is TypeSyntax || 349=> SyntaxFactory.CastExpression((TypeSyntax)type, (ExpressionSyntax)ParenthesizeNonSimple(expression)).WithAdditionalAnnotations(Simplifier.Annotation);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
2252var variableType = variableDeclarator.GetVariableType();
Microsoft.CodeAnalysis.Razor.Compiler (11)
CSharp\GenericTypeNameRewriter.cs (5)
38var parsed = SyntaxFactory.ParseTypeName(typeName); 39var rewritten = (TypeSyntax)new Visitor(_bindings, builder).Visit(parsed); 83var typeArgument = args[i]; 84args = args.Replace(typeArgument, (TypeSyntax)Visit(typeArgument));
CSharp\GlobalQualifiedTypeNameRewriter.cs (3)
33var parsed = SyntaxFactory.ParseTypeName(typeName); 34var rewritten = (TypeSyntax)new Visitor(_ignore).Visit(parsed);
Language\Components\ComponentGenericTypePass.cs (3)
484var parsed = SyntaxFactory.ParseTypeName(typeName); 501static ImmutableArray<string> TryParseCore(TypeSyntax parsed) 516static ImmutableArray<string> ParseCore(TypeSyntax parsed)
Microsoft.Interop.ComInterfaceGenerator (4)
Marshallers\ObjectUnwrapperResolver.cs (2)
13internal sealed record ObjectUnwrapperInfo(TypeSyntax UnwrapperType) : MarshallingInfo; 37TypeSyntax unwrapperType = ((ObjectUnwrapperInfo)info.MarshallingAttributeInfo).UnwrapperType;
VirtualMethodPointerStubGenerator.cs (1)
149(ParameterListSyntax unmanagedParameterList, TypeSyntax returnType, _) = stubGenerator.GenerateAbiMethodSignatureData();
VtableIndexStubGenerator.cs (1)
366var unwrapperSyntax = ParseTypeName(unmanagedObjectUnwrapper.AttributeClass.TypeArguments[0].ToDisplayString());
Microsoft.Interop.JavaScript.JSImportGenerator (7)
JSImportGenerator.cs (1)
285TypeSyntax jsMarshalerArgument = ParseTypeName(Constants.JSMarshalerArgumentGlobal);
JSManagedTypeInfo.cs (2)
179public JSSimpleTypeInfo(KnownManagedType knownType, TypeSyntax syntax) 184public TypeSyntax Syntax { get; init; }
Marshaling\FuncJSGenerator.cs (2)
93private static ArgumentSyntax ArgToJS(int i, TypeSyntax sourceType, MarshalerType marshalerType) => Argument(ParenthesizedLambdaExpression() 108private static ArgumentSyntax ArgToManaged(int i, TypeSyntax sourceType, MarshalerType marshalerType) => Argument(ParenthesizedLambdaExpression()
Marshaling\TaskJSGenerator.cs (2)
68private ExpressionStatementSyntax ToManagedMethod(string target, ArgumentSyntax source, TypeSyntax sourceType) 91private ExpressionStatementSyntax ToJSMethod(string target, ArgumentSyntax source, TypeSyntax sourceType)
Microsoft.Interop.LibraryImportGenerator (1)
LibraryImportGenerator.cs (1)
407(ParameterListSyntax parameterList, TypeSyntax returnType, AttributeListSyntax returnTypeAttributes) = stubGenerator.GenerateTargetMethodSignatureData();
Microsoft.Interop.LibraryImportGenerator.Downlevel (1)
DownlevelLibraryImportGenerator.cs (1)
352(ParameterListSyntax parameterList, TypeSyntax returnType, AttributeListSyntax returnTypeAttributes) = stubGenerator.GenerateTargetMethodSignatureData();
Microsoft.Interop.SourceGeneration (72)
BoundGenerators.cs (1)
205public (ParameterListSyntax ParameterList, TypeSyntax ReturnType, AttributeListSyntax? ReturnTypeAttributes) GenerateTargetMethodSignatureData(StubIdentifierContext context)
ManagedToNativeStubGenerator.cs (1)
196public (ParameterListSyntax ParameterList, TypeSyntax ReturnType, AttributeListSyntax? ReturnTypeAttributes) GenerateTargetMethodSignatureData()
ManagedTypeInfo.cs (2)
15private TypeSyntax? _syntax; 16public TypeSyntax Syntax => _syntax ??= SyntaxFactory.ParseTypeName(FullTypeName);
Marshalling\AttributedMarshallingModelGeneratorResolver.cs (9)
242TypeSyntax unmanagedElementType = elementMarshaller.NativeType.Syntax.GetCompatibleGenericTypeParameterSyntax(); 244TypeSyntax marshallerTypeSyntax = ReplacePlaceholderSyntaxWithUnmanagedTypeSyntax(marshallerType.Syntax, marshalInfo, unmanagedElementType); 266TypeSyntax bufferElementTypeSyntax = marshallerData.BufferElementType.Syntax.IsEquivalentTo(marshalInfo.PlaceholderTypeParameter.Syntax) 312TypeSyntax bufferElementTypeSyntax = marshallerData.BufferElementType.Syntax.IsEquivalentTo(marshalInfo.PlaceholderTypeParameter.Syntax) 392private static ElementsMarshalling CreateElementsMarshalling(CustomTypeMarshallerData marshallerData, IBoundMarshallingGenerator elementMarshaller, TypeSyntax unmanagedElementType, IElementsMarshallingCollectionSource collectionSource) 409private static TypeSyntax ReplacePlaceholderSyntaxWithUnmanagedTypeSyntax( 410TypeSyntax originalTypeSyntax, 412TypeSyntax unmanagedElementType) 414originalTypeSyntax.DescendantNodesAndSelf().OfType<TypeSyntax>().Where(t => t.IsEquivalentTo(marshalInfo.PlaceholderTypeParameter.Syntax)),
Marshalling\ElementsMarshalling.cs (3)
145TypeSyntax managedElementType, 146TypeSyntax unmanagedElementType, 251TypeSyntax unmanagedElementType,
Marshalling\MarshallerHelpers.cs (4)
16public static readonly TypeSyntax SystemIntPtrType = TypeSyntaxes.System_IntPtr; 30public static TypeSyntax GetCompatibleGenericTypeParameterSyntax(this TypeSyntax type) 32TypeSyntax spanElementTypeSyntax = type;
Marshalling\MarshallingGeneratorExtensions.cs (1)
20public static TypeSyntax AsReturnType(this IBoundMarshallingGenerator generator)
Marshalling\StatefulMarshallingStrategy.cs (2)
184internal sealed class StatefulCallerAllocatedBufferMarshalling(ICustomTypeMarshallingStrategy innerMarshaller, TypeSyntax marshallerType, TypeSyntax bufferElementType) : ICustomTypeMarshallingStrategy
Marshalling\StatelessMarshallingStrategy.cs (6)
17internal sealed class StatelessValueMarshalling(TypePositionInfo info, StubCodeContext codeContext, TypeSyntax marshallerTypeSyntax, ManagedTypeInfo unmanagedType, MarshallerShape shape) : ICustomTypeMarshallingStrategy 147internal sealed class StatelessCallerAllocatedBufferMarshalling(ICustomTypeMarshallingStrategy innerMarshaller, TypeSyntax marshallerType, TypeSyntax bufferElementType, bool isLinearCollectionMarshalling) : ICustomTypeMarshallingStrategy 247internal sealed class StatelessFreeMarshalling(ICustomTypeMarshallingStrategy innerMarshaller, TypeSyntax marshallerType) : ICustomTypeMarshallingStrategy 308internal sealed class StatelessLinearCollectionSpaceAllocator(TypePositionInfo info, StubCodeContext codeContext, TypeSyntax marshallerTypeSyntax, ManagedTypeInfo unmanagedType, MarshallerShape shape, CountInfo countInfo, bool countInfoRequiresCast) : ICustomTypeMarshallingStrategy 476internal sealed class StatelessLinearCollectionSource(TypePositionInfo info, StubCodeContext codeContext, TypeSyntax marshallerTypeSyntax) : IElementsMarshallingCollectionSource
Marshalling\StaticPinnableManagedValueMarshaller.cs (1)
13public sealed class StaticPinnableManagedValueMarshaller(IBoundMarshallingGenerator innerMarshallingGenerator, TypeSyntax getPinnableReferenceType) : IBoundMarshallingGenerator
SignatureContext.cs (1)
34public TypeSyntax StubReturnType { get; init; }
TypeNames.cs (34)
46public static TypeSyntax VoidStar { get; } = PointerType(PredefinedType(Token(SyntaxKind.VoidKeyword))); 48private static TypeSyntax? _IUnmanagedVirtualMethodTableProvider; 49public static TypeSyntax IUnmanagedVirtualMethodTableProvider => _IUnmanagedVirtualMethodTableProvider ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.IUnmanagedVirtualMethodTableProvider); 51private static TypeSyntax? _UnmanagedObjectUnwrapper; 52public static TypeSyntax UnmanagedObjectUnwrapper => _UnmanagedObjectUnwrapper ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.UnmanagedObjectUnwrapper); 54private static TypeSyntax? _UnreachableException; 55public static TypeSyntax UnreachableException => _UnreachableException ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.UnreachableException); 57private static TypeSyntax? _System_IntPtr; 58public static TypeSyntax System_IntPtr => _System_IntPtr ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.System_IntPtr); 60private static TypeSyntax? _DllImportSearchPath; 61public static TypeSyntax DllImportSearchPath => _DllImportSearchPath ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.DllImportSearchPath); 63private static TypeSyntax? _System_Type; 64public static TypeSyntax System_Type => _System_Type ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.System_Type); 66private static TypeSyntax? _System_Runtime_InteropServices_Marshal; 67public static TypeSyntax System_Runtime_InteropServices_Marshal => _System_Runtime_InteropServices_Marshal ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.System_Runtime_InteropServices_Marshal); 69private static TypeSyntax? _System_Runtime_InteropServices_UnmanagedType; 70public static TypeSyntax System_Runtime_InteropServices_UnmanagedType => _System_Runtime_InteropServices_UnmanagedType ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.System_Runtime_InteropServices_UnmanagedType); 72private static TypeSyntax? _System_Runtime_InteropServices_MemoryMarshal; 73public static TypeSyntax System_Runtime_InteropServices_MemoryMarshal => _System_Runtime_InteropServices_MemoryMarshal ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.System_Runtime_InteropServices_MemoryMarshal); 75private static TypeSyntax? _System_Exception; 76public static TypeSyntax System_Exception => _System_Exception ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.System_Exception); 78private static TypeSyntax? _System_GC; 79public static TypeSyntax System_GC => _System_GC ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.System_GC); 81private static TypeSyntax? _System_Runtime_InteropServices_ComWrappers_ComInterfaceDispatch; 82public static TypeSyntax System_Runtime_InteropServices_ComWrappers_ComInterfaceDispatch => _System_Runtime_InteropServices_ComWrappers_ComInterfaceDispatch ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.System_Runtime_InteropServices_ComWrappers_ComInterfaceDispatch); 84private static TypeSyntax? _System_Runtime_CompilerServices_Unsafe; 85public static TypeSyntax System_Runtime_CompilerServices_Unsafe => _System_Runtime_CompilerServices_Unsafe ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.System_Runtime_CompilerServices_Unsafe); 87private static TypeSyntax? _CallConvCdecl; 88private static TypeSyntax? _CallConvFastcall; 89private static TypeSyntax? _CallConvMemberFunction; 90private static TypeSyntax? _CallConvStdcall; 91private static TypeSyntax? _CallConvSuppressGCTransition; 92private static TypeSyntax? _CallConvThiscall; 93public static TypeSyntax CallConv(string callConv)
TypeSymbolExtensions.cs (1)
170public static TypeSyntax AsTypeSyntax(this ITypeSymbol type)
UnmanagedToManagedStubGenerator.cs (1)
108public (ParameterListSyntax ParameterList, TypeSyntax ReturnType, AttributeListSyntax? ReturnTypeAttributes) GenerateAbiMethodSignatureData()
Utils\SyntaxFactoryExtensions.cs (4)
18public static LocalDeclarationStatementSyntax Declare(TypeSyntax typeSyntax, string identifier, bool initializeToDefault) 28public static LocalDeclarationStatementSyntax Declare(TypeSyntax typeSyntax, string identifier, ExpressionSyntax? initializer) 81public static GenericNameSyntax SpanOf(TypeSyntax type) => GenericName(_span, TypeArgumentList(SingletonSeparatedList(type))); 84public static GenericNameSyntax ReadOnlySpanOf(TypeSyntax type) => GenericName(_readonlySpan, TypeArgumentList(SingletonSeparatedList(type)));
VariableDeclarations.cs (1)
146TypeSyntax localType = marshaller.NativeType.Syntax;
Roslyn.Diagnostics.CSharp.Analyzers (106)
CSharpExposeMemberForTesting.cs (1)
48return SyntaxFactory.RefType(refKeyword, readOnlyKeyword, (TypeSyntax)type);
PreferNullLiteralCodeFixProvider.cs (1)
56var type = defaultExpression.Type;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeStyle\TypeStyle\TypeStyleHelper.cs (1)
202public static bool IsPredefinedType(TypeSyntax type)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\DefaultExpressionSyntaxExtensions.cs (2)
42var typeSyntax = GetTypeSyntax(equalsValueClause); 67private static TypeSyntax GetTypeSyntax(EqualsValueClauseSyntax equalsValueClause)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
606while (topExpression.Parent is TypeSyntax typeSyntax)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\MemberDeclarationSyntaxExtensions.cs (1)
153public static TypeSyntax GetMemberType(this MemberDeclarationSyntax member)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (5)
185TypeSyntax type, 319TypeSyntax type, 344private static TypeSyntax GetOutermostType(TypeSyntax type) 345=> type.GetAncestorsOrThis<TypeSyntax>().Last();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\TypeSyntaxExtensions.cs (5)
13public static bool IsVoid(this TypeSyntax typeSyntax) 17public static bool IsPartial(this TypeSyntax typeSyntax) 26public static bool IsTypeInferred(this TypeSyntax typeSyntax, SemanticModel semanticModel) 52public static TypeSyntax StripRefIfNeeded(this TypeSyntax type)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\VariableDeclaratorExtensions.cs (2)
13public static TypeSyntax GetVariableType(this VariableDeclaratorSyntax declarator) 25var variableTypeName = variable.GetVariableType();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (2)
762var type = memberDeclaration.GetMemberType(); 1479=> node is TypeSyntax;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\NameSyntaxComparer.cs (2)
117var xArg = x.TypeArgumentList.Arguments[i]; 118var yArg = y.TypeArgumentList.Arguments[i];
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (3)
32TypeSyntax, 96=> node is StatementSyntax(kind: not SyntaxKind.Block) or TypeSyntax or CrefSyntax || 141if (nodeToSpeculate is TypeSyntax typeNode)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpTypeStyleHelper.cs (4)
35TypeSyntax typeName, SemanticModel semanticModel, 54TypeSyntax typeName, SemanticModel semanticModel, CSharpSimplifierOptions options, CancellationToken cancellationToken); 57SyntaxToken identifier, TypeSyntax typeName, ExpressionSyntax initializer, SemanticModel semanticModel, CSharpSimplifierOptions options, CancellationToken cancellationToken); 59internal TypeSyntax? FindAnalyzableType(SyntaxNode node, SemanticModel semanticModel, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpTypeStyleHelper.State.cs (3)
109var typeSyntax = GetTypeSyntaxFromDeclaration(declarationStatement); 148var typeSyntax = GetTypeSyntaxFromDeclaration(declarationStatement); 155private static TypeSyntax? GetTypeSyntaxFromDeclaration(SyntaxNode declarationStatement)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseExplicitTypeHelper.cs (3)
60TypeSyntax typeName, SemanticModel semanticModel, 135TypeSyntax typeName, 149private static bool ContainsAnonymousType(TypeSyntax typeName, SemanticModel semanticModel, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (6)
30TypeSyntax typeName, SemanticModel semanticModel, 50var type = variableDeclaration.Type.StripRefIfNeeded(); 61var type = forEachStatement.Type.StripRefIfNeeded(); 92TypeSyntax typeName, SemanticModel semanticModel, 172var declarationTypeNode = declarationExpression.Type; 239TypeSyntax typeName,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeSyntaxComparer.cs (5)
11: IComparer<TypeSyntax?> 16public int Compare(TypeSyntax? x, TypeSyntax? y) 41private static TypeSyntax UnwrapType(TypeSyntax type)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (1)
783TypeSyntax newTypeSyntax;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\PropertyGenerator.cs (1)
158private static TypeSyntax GenerateTypeSyntax(IPropertySymbol property)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (2)
283if (expr is TypeSyntax) 493targetToken.GetPreviousToken(includeSkipped: true).IsLastTokenOfNode<TypeSyntax>())
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (11)
957{ Parent: TypeSyntax { Parent.RawKind: (int)SyntaxKind.FunctionPointerParameter } } => true, 1523if (leftToken.IsLastTokenOfNode<TypeSyntax>(out var typeSyntax)) 1528while (typeSyntax.Parent is TypeSyntax parentTypeSyntax) 2333if (binary.Left is TypeSyntax type && type.IsPotentialTypeName(semanticModel, cancellationToken)) 2354var type = previousToken.Parent as TypeSyntax; 2360var underlyingType = type is PointerTypeSyntax pointerType 2394return conditionalExpression.Condition is not TypeSyntax type 2855var type = token.GetAncestors<TypeSyntax>().LastOrDefault();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
115var typeSyntax = targetType.GenerateTypeSyntax();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.cs (7)
32public static TypeSyntax GenerateTypeSyntax(this INamespaceOrTypeSymbol symbol, bool allowVar = true) 35private static TypeSyntax GenerateTypeSyntax( 46var syntax = containsAnonymousType 70public static TypeSyntax GenerateRefTypeSyntax( 73var underlyingType = GenerateTypeSyntax(symbol, allowVar) 80public static TypeSyntax GenerateRefReadOnlyTypeSyntax( 83var underlyingType = GenerateTypeSyntax(symbol, allowVar)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.ExpressionSyntaxGeneratorVisitor.cs (1)
43if (!_nameOnly && TypeSyntaxGeneratorVisitor.TryCreateNativeIntegerType(symbol, out var typeSyntax))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (24)
22private sealed class TypeSyntaxGeneratorVisitor(bool nameOnly) : SymbolVisitor<TypeSyntax> 39public override TypeSyntax DefaultVisit(ISymbol node) 43where TTypeSyntax : TypeSyntax 51public override TypeSyntax VisitAlias(IAliasSymbol symbol) 62public override TypeSyntax VisitArrayType(IArrayTypeSymbol symbol) 92var elementTypeSyntax = underlyingType.GenerateTypeSyntax(); 104TypeSyntax arrayTypeSyntax = ArrayType(elementTypeSyntax, [.. ranks]); 114public override TypeSyntax VisitDynamicType(IDynamicTypeSymbol symbol) 122public static bool TryCreateNativeIntegerType(INamedTypeSymbol symbol, [NotNullWhen(true)] out TypeSyntax? syntax) 134public override TypeSyntax VisitFunctionPointerType(IFunctionPointerTypeSymbol symbol) 178public TypeSyntax CreateSimpleTypeSyntax(INamedTypeSymbol symbol) 182var syntax = TryCreateSpecializedNamedTypeSyntax(symbol); 204? Enumerable.Repeat((TypeSyntax)OmittedTypeArgument(), symbol.TypeArguments.Length) 218private static TypeSyntax? TryCreateSpecializedNamedTypeSyntax(INamedTypeSymbol symbol) 257public override TypeSyntax VisitNamedType(INamedTypeSymbol symbol) 259if (TryCreateNativeIntegerType(symbol, out var typeSyntax)) 271var containingTypeSyntax = symbol.ContainingType.Accept(this); 295var container = symbol.ContainingNamespace.Accept(this)!; 312public override TypeSyntax VisitNamespace(INamespaceSymbol symbol) 326var container = symbol.ContainingNamespace.Accept(this)!; 337private static TypeSyntax AddGlobalAlias(INamespaceOrTypeSymbol symbol, SimpleNameSyntax syntax) 345public override TypeSyntax VisitPointerType(IPointerTypeSymbol symbol) 354public override TypeSyntax VisitTypeParameter(ITypeParameterSymbol symbol) 356TypeSyntax typeSyntax = AddInformationTo(symbol.Name.ToIdentifierName(), symbol);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\TypeSyntaxExtensions.cs (2)
16public static bool IsPotentialTypeName([NotNullWhen(true)] this TypeSyntax? typeSyntax, SemanticModel? semanticModelOpt, CancellationToken cancellationToken) 55public static TypeSyntax GenerateReturnTypeSyntax(this IMethodSymbol method)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpMoveDeclarationNearReferenceService.cs (1)
57var type = declarationStatement.Declaration.Type;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSyntaxGeneratorInternal.cs (7)
79type == null ? SyntaxFactory.IdentifierName("var") : (TypeSyntax)type, 248=> SyntaxFactory.TypePattern((TypeSyntax)type); 256=> SyntaxFactory.CastExpression((TypeSyntax)type, (ExpressionSyntax)ParenthesizeNonSimple(expression)).WithAdditionalAnnotations(Simplifier.Annotation); 259=> SyntaxFactory.DefaultExpression((TypeSyntax)type).WithAdditionalAnnotations(Simplifier.Annotation); 298var type = typeSymbol.GenerateTypeSyntax(); 323if (expression is TypeSyntax || 349=> SyntaxFactory.CastExpression((TypeSyntax)type, (ExpressionSyntax)ParenthesizeNonSimple(expression)).WithAdditionalAnnotations(Simplifier.Annotation);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
2252var variableType = variableDeclarator.GetVariableType();
System.Text.RegularExpressions.Generator (3)
UpgradeToGeneratedRegexCodeFixer.cs (3)
173(TypeSyntax)generator.TypeExpression(regexSymbol), 217(TypeSyntax)generator.TypeExpression(regexSymbol), SyntaxFactory.Identifier(variableDeclarator.Identifier.ValueText).WithAdditionalAnnotations(RenameAnnotation.Create())) 267(TypeSyntax)generator.TypeExpression(regexSymbol), SyntaxFactory.Identifier(propertyDeclaration.Identifier.ValueText))