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
1338 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.AspNetCore.SignalR.Client.SourceGenerator (2)
HubClientProxyGenerator.Parser.cs (1)
250var argType = gns.TypeArgumentList.Arguments[0];
HubServerProxyGenerator.Parser.cs (1)
233var proxyType = ((GenericNameSyntax)memberAccess.Name).TypeArgumentList.Arguments[0];
Microsoft.CodeAnalysis.CSharp (539)
_generated\0\Syntax.xml.Main.Generated.cs (144)
1546=> node.Update((TypeSyntax?)Visit(node.ElementType) ?? throw new ArgumentNullException("elementType"), VisitList(node.RankSpecifiers)); 1552=> node.Update((TypeSyntax?)Visit(node.ElementType) ?? throw new ArgumentNullException("elementType"), VisitToken(node.AsteriskToken)); 1570=> node.Update((TypeSyntax?)Visit(node.ElementType) ?? throw new ArgumentNullException("elementType"), VisitToken(node.QuestionToken)); 1576=> node.Update((TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type"), VisitToken(node.Identifier)); 1582=> node.Update(VisitToken(node.RefKeyword), VisitToken(node.ReadOnlyKeyword), (TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type")); 1585=> node.Update(VisitToken(node.ScopedKeyword), (TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type")); 1648=> 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)); 1658=> node.Update(VisitToken(node.Keyword), VisitToken(node.OpenParenToken), (TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type"), VisitToken(node.CloseParenToken)); 1661=> node.Update(VisitToken(node.Keyword), VisitToken(node.OpenParenToken), (TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type"), VisitToken(node.CloseParenToken)); 1664=> node.Update(VisitToken(node.Keyword), VisitToken(node.OpenParenToken), (TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type"), VisitToken(node.CloseParenToken)); 1688=> node.Update((TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type"), (VariableDesignationSyntax?)Visit(node.Designation) ?? throw new ArgumentNullException("designation")); 1691=> node.Update(VisitToken(node.OpenParenToken), (TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type"), VisitToken(node.CloseParenToken), (ExpressionSyntax?)Visit(node.Expression) ?? throw new ArgumentNullException("expression")); 1703=> 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)); 1712=> node.Update(VisitToken(node.NewKeyword), (TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type"), (ArgumentListSyntax?)Visit(node.ArgumentList), (InitializerExpressionSyntax?)Visit(node.Initializer)); 1730=> node.Update(VisitToken(node.StackAllocKeyword), (TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type"), (InitializerExpressionSyntax?)Visit(node.Initializer)); 1754=> node.Update(VisitToken(node.FromKeyword), (TypeSyntax?)Visit(node.Type), VisitToken(node.Identifier), VisitToken(node.InKeyword), (ExpressionSyntax?)Visit(node.Expression) ?? throw new ArgumentNullException("expression")); 1760=> 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)); 1802=> node.Update((TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type"), (VariableDesignationSyntax?)Visit(node.Designation) ?? throw new ArgumentNullException("designation")); 1808=> node.Update((TypeSyntax?)Visit(node.Type), (PositionalPatternClauseSyntax?)Visit(node.PositionalPatternClause), (PropertyPatternClauseSyntax?)Visit(node.PropertyPatternClause), (VariableDesignationSyntax?)Visit(node.Designation)); 1829=> node.Update((TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type")); 1862=> 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)); 1868=> node.Update((TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type"), VisitList(node.Variables)); 1922=> 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")); 1976=> node.Update(VisitToken(node.OpenParenToken), (TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type"), VisitToken(node.Identifier), VisitToken(node.CloseParenToken)); 1991=> 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)); 2042=> 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)); 2054=> node.Update((TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type")); 2057=> node.Update((TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type"), (ArgumentListSyntax?)Visit(node.ArgumentList) ?? throw new ArgumentNullException("argumentList")); 2069=> node.Update((TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type")); 2090=> 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)); 2093=> 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)); 2096=> 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)); 2108=> 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)); 2114=> 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)); 2117=> 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)); 2132=> node.Update(VisitList(node.AttributeLists), VisitList(node.Modifiers), (TypeSyntax?)Visit(node.Type), VisitToken(node.Identifier), (EqualsValueClauseSyntax?)Visit(node.Default)); 2135=> node.Update(VisitList(node.AttributeLists), VisitList(node.Modifiers), (TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type")); 2138=> node.Update(VisitList(node.AttributeLists), VisitList(node.Modifiers), (TypeSyntax?)Visit(node.Type)); 2147=> node.Update((TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type")); 2150=> node.Update((TypeSyntax?)Visit(node.Container) ?? throw new ArgumentNullException("container"), VisitToken(node.DotToken), (MemberCrefSyntax?)Visit(node.Member) ?? throw new ArgumentNullException("member")); 2153=> node.Update((TypeSyntax?)Visit(node.Name) ?? throw new ArgumentNullException("name"), (CrefParameterListSyntax?)Visit(node.Parameters)); 2165=> node.Update(VisitToken(node.ImplicitOrExplicitKeyword), VisitToken(node.OperatorKeyword), VisitToken(node.CheckedKeyword), (TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type"), (CrefParameterListSyntax?)Visit(node.Parameters)); 2174=> node.Update(VisitToken(node.RefKindKeyword), VisitToken(node.ReadOnlyKeyword), (TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type")); 2324public static TypeArgumentListSyntax TypeArgumentList(SyntaxToken lessThanToken, SeparatedSyntaxList<TypeSyntax> arguments, SyntaxToken greaterThanToken) 2332public static TypeArgumentListSyntax TypeArgumentList(SeparatedSyntaxList<TypeSyntax> arguments = default) 2379public static ArrayTypeSyntax ArrayType(TypeSyntax elementType, SyntaxList<ArrayRankSpecifierSyntax> rankSpecifiers) 2386public static ArrayTypeSyntax ArrayType(TypeSyntax elementType) 2402public static PointerTypeSyntax PointerType(TypeSyntax elementType, SyntaxToken asteriskToken) 2410public static PointerTypeSyntax PointerType(TypeSyntax elementType) 2478public static NullableTypeSyntax NullableType(TypeSyntax elementType, SyntaxToken questionToken) 2486public static NullableTypeSyntax NullableType(TypeSyntax elementType) 2502public static TupleElementSyntax TupleElement(TypeSyntax type, SyntaxToken identifier) 2515public static TupleElementSyntax TupleElement(TypeSyntax type) 2530public static RefTypeSyntax RefType(SyntaxToken refKeyword, SyntaxToken readOnlyKeyword, TypeSyntax type) 2544public static RefTypeSyntax RefType(TypeSyntax type) 2548public static ScopedTypeSyntax ScopedType(SyntaxToken scopedKeyword, TypeSyntax type) 2556public static ScopedTypeSyntax ScopedType(TypeSyntax type) 3046public static RefValueExpressionSyntax RefValueExpression(SyntaxToken keyword, SyntaxToken openParenToken, ExpressionSyntax expression, SyntaxToken comma, TypeSyntax type, SyntaxToken closeParenToken) 3058public static RefValueExpressionSyntax RefValueExpression(ExpressionSyntax expression, TypeSyntax type) 3111public static DefaultExpressionSyntax DefaultExpression(SyntaxToken keyword, SyntaxToken openParenToken, TypeSyntax type, SyntaxToken closeParenToken) 3121public static DefaultExpressionSyntax DefaultExpression(TypeSyntax type) 3125public static TypeOfExpressionSyntax TypeOfExpression(SyntaxToken keyword, SyntaxToken openParenToken, TypeSyntax type, SyntaxToken closeParenToken) 3135public static TypeOfExpressionSyntax TypeOfExpression(TypeSyntax type) 3139public static SizeOfExpressionSyntax SizeOfExpression(SyntaxToken keyword, SyntaxToken openParenToken, TypeSyntax type, SyntaxToken closeParenToken) 3149public static SizeOfExpressionSyntax SizeOfExpression(TypeSyntax type) 3236public static DeclarationExpressionSyntax DeclarationExpression(TypeSyntax type, VariableDesignationSyntax designation) 3244public static CastExpressionSyntax CastExpression(SyntaxToken openParenToken, TypeSyntax type, SyntaxToken closeParenToken, ExpressionSyntax expression) 3254public static CastExpressionSyntax CastExpression(TypeSyntax type, ExpressionSyntax expression) 3286public static ParenthesizedLambdaExpressionSyntax ParenthesizedLambdaExpression(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax? returnType, ParameterListSyntax parameterList, SyntaxToken arrowToken, BlockSyntax? block, ExpressionSyntax? expressionBody) 3294public static ParenthesizedLambdaExpressionSyntax ParenthesizedLambdaExpression(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax? returnType, ParameterListSyntax parameterList, BlockSyntax? block, ExpressionSyntax? expressionBody) 3339public static ObjectCreationExpressionSyntax ObjectCreationExpression(SyntaxToken newKeyword, TypeSyntax type, ArgumentListSyntax? argumentList, InitializerExpressionSyntax? initializer) 3347public static ObjectCreationExpressionSyntax ObjectCreationExpression(TypeSyntax type, ArgumentListSyntax? argumentList, InitializerExpressionSyntax? initializer) 3351public static ObjectCreationExpressionSyntax ObjectCreationExpression(TypeSyntax type) 3426public static StackAllocArrayCreationExpressionSyntax StackAllocArrayCreationExpression(SyntaxToken stackAllocKeyword, TypeSyntax type, InitializerExpressionSyntax? initializer) 3434public static StackAllocArrayCreationExpressionSyntax StackAllocArrayCreationExpression(TypeSyntax type, InitializerExpressionSyntax? initializer) 3438public static StackAllocArrayCreationExpressionSyntax StackAllocArrayCreationExpression(TypeSyntax type) 3518public static FromClauseSyntax FromClause(SyntaxToken fromKeyword, TypeSyntax? type, SyntaxToken identifier, SyntaxToken inKeyword, ExpressionSyntax expression) 3528public static FromClauseSyntax FromClause(TypeSyntax? type, SyntaxToken identifier, ExpressionSyntax expression) 3558public static JoinClauseSyntax JoinClause(SyntaxToken joinKeyword, TypeSyntax? type, SyntaxToken identifier, SyntaxToken inKeyword, ExpressionSyntax inExpression, SyntaxToken onKeyword, ExpressionSyntax leftExpression, SyntaxToken equalsKeyword, ExpressionSyntax rightExpression, JoinIntoClauseSyntax? into) 3572public static JoinClauseSyntax JoinClause(TypeSyntax? type, SyntaxToken identifier, ExpressionSyntax inExpression, ExpressionSyntax leftExpression, ExpressionSyntax rightExpression, JoinIntoClauseSyntax? into) 3781public static DeclarationPatternSyntax DeclarationPattern(TypeSyntax type, VariableDesignationSyntax designation) 3801public static RecursivePatternSyntax RecursivePattern(TypeSyntax? type, PositionalPatternClauseSyntax? positionalPatternClause, PropertyPatternClauseSyntax? propertyPatternClause, VariableDesignationSyntax? designation) 3883public static TypePatternSyntax TypePattern(TypeSyntax type) 4036public 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) 4051public static LocalFunctionStatementSyntax LocalFunctionStatement(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax returnType, SyntaxToken identifier, TypeParameterListSyntax? typeParameterList, ParameterListSyntax parameterList, SyntaxList<TypeParameterConstraintClauseSyntax> constraintClauses, BlockSyntax? body, ArrowExpressionClauseSyntax? expressionBody) 4055public static LocalFunctionStatementSyntax LocalFunctionStatement(TypeSyntax returnType, SyntaxToken identifier) 4059public static LocalFunctionStatementSyntax LocalFunctionStatement(TypeSyntax returnType, string identifier) 4091public static VariableDeclarationSyntax VariableDeclaration(TypeSyntax type, SeparatedSyntaxList<VariableDeclaratorSyntax> variables) 4098public static VariableDeclarationSyntax VariableDeclaration(TypeSyntax type) 4413public static ForEachStatementSyntax ForEachStatement(SyntaxList<AttributeListSyntax> attributeLists, SyntaxToken awaitKeyword, SyntaxToken forEachKeyword, SyntaxToken openParenToken, TypeSyntax type, SyntaxToken identifier, SyntaxToken inKeyword, ExpressionSyntax expression, SyntaxToken closeParenToken, StatementSyntax statement) 4433public static ForEachStatementSyntax ForEachStatement(SyntaxList<AttributeListSyntax> attributeLists, TypeSyntax type, SyntaxToken identifier, ExpressionSyntax expression, StatementSyntax statement) 4437public static ForEachStatementSyntax ForEachStatement(TypeSyntax type, SyntaxToken identifier, ExpressionSyntax expression, StatementSyntax statement) 4441public static ForEachStatementSyntax ForEachStatement(TypeSyntax type, string identifier, ExpressionSyntax expression, StatementSyntax statement) 4763public static CatchDeclarationSyntax CatchDeclaration(SyntaxToken openParenToken, TypeSyntax type, SyntaxToken identifier, SyntaxToken closeParenToken) 4778public static CatchDeclarationSyntax CatchDeclaration(TypeSyntax type, SyntaxToken identifier) 4782public static CatchDeclarationSyntax CatchDeclaration(TypeSyntax type) 4845public static UsingDirectiveSyntax UsingDirective(SyntaxToken globalKeyword, SyntaxToken usingKeyword, SyntaxToken staticKeyword, SyntaxToken unsafeKeyword, NameEqualsSyntax? alias, TypeSyntax namespaceOrType, SyntaxToken semicolonToken) 4872public static UsingDirectiveSyntax UsingDirective(NameEqualsSyntax? alias, TypeSyntax namespaceOrType) 4876public static UsingDirectiveSyntax UsingDirective(TypeSyntax namespaceOrType) 5220public static DelegateDeclarationSyntax DelegateDeclaration(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, SyntaxToken delegateKeyword, TypeSyntax returnType, SyntaxToken identifier, TypeParameterListSyntax? typeParameterList, ParameterListSyntax parameterList, SyntaxList<TypeParameterConstraintClauseSyntax> constraintClauses, SyntaxToken semicolonToken) 5231public static DelegateDeclarationSyntax DelegateDeclaration(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax returnType, SyntaxToken identifier, TypeParameterListSyntax? typeParameterList, ParameterListSyntax parameterList, SyntaxList<TypeParameterConstraintClauseSyntax> constraintClauses) 5235public static DelegateDeclarationSyntax DelegateDeclaration(TypeSyntax returnType, SyntaxToken identifier) 5239public static DelegateDeclarationSyntax DelegateDeclaration(TypeSyntax returnType, string identifier) 5302public static SimpleBaseTypeSyntax SimpleBaseType(TypeSyntax type) 5309public static PrimaryConstructorBaseTypeSyntax PrimaryConstructorBaseType(TypeSyntax type, ArgumentListSyntax argumentList) 5317public static PrimaryConstructorBaseTypeSyntax PrimaryConstructorBaseType(TypeSyntax type) 5391public static TypeConstraintSyntax TypeConstraint(TypeSyntax type) 5477public 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) 5492public 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) 5496public static MethodDeclarationSyntax MethodDeclaration(TypeSyntax returnType, SyntaxToken identifier) 5500public static MethodDeclarationSyntax MethodDeclaration(TypeSyntax returnType, string identifier) 5504public 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) 5564public static OperatorDeclarationSyntax OperatorDeclaration(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax returnType, ExplicitInterfaceSpecifierSyntax? explicitInterfaceSpecifier, SyntaxToken operatorToken, ParameterListSyntax parameterList, BlockSyntax? body, ArrowExpressionClauseSyntax? expressionBody) 5568public static OperatorDeclarationSyntax OperatorDeclaration(TypeSyntax returnType, SyntaxToken operatorToken) 5572public 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) 5599public static ConversionOperatorDeclarationSyntax ConversionOperatorDeclaration(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, SyntaxToken implicitOrExplicitKeyword, ExplicitInterfaceSpecifierSyntax? explicitInterfaceSpecifier, TypeSyntax type, ParameterListSyntax parameterList, BlockSyntax? body, ArrowExpressionClauseSyntax? expressionBody) 5603public static ConversionOperatorDeclarationSyntax ConversionOperatorDeclaration(SyntaxToken implicitOrExplicitKeyword, TypeSyntax type) 5692public static PropertyDeclarationSyntax PropertyDeclaration(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax type, ExplicitInterfaceSpecifierSyntax? explicitInterfaceSpecifier, SyntaxToken identifier, AccessorListSyntax? accessorList, ArrowExpressionClauseSyntax? expressionBody, EqualsValueClauseSyntax? initializer, SyntaxToken semicolonToken) 5706public static PropertyDeclarationSyntax PropertyDeclaration(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax type, ExplicitInterfaceSpecifierSyntax? explicitInterfaceSpecifier, SyntaxToken identifier, AccessorListSyntax? accessorList, ArrowExpressionClauseSyntax? expressionBody, EqualsValueClauseSyntax? initializer) 5710public static PropertyDeclarationSyntax PropertyDeclaration(TypeSyntax type, SyntaxToken identifier) 5714public static PropertyDeclarationSyntax PropertyDeclaration(TypeSyntax type, string identifier) 5730public static EventDeclarationSyntax EventDeclaration(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, SyntaxToken eventKeyword, TypeSyntax type, ExplicitInterfaceSpecifierSyntax? explicitInterfaceSpecifier, SyntaxToken identifier, AccessorListSyntax? accessorList, SyntaxToken semicolonToken) 5745public static EventDeclarationSyntax EventDeclaration(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax type, ExplicitInterfaceSpecifierSyntax? explicitInterfaceSpecifier, SyntaxToken identifier, AccessorListSyntax? accessorList) 5749public static EventDeclarationSyntax EventDeclaration(TypeSyntax type, SyntaxToken identifier) 5753public static EventDeclarationSyntax EventDeclaration(TypeSyntax type, string identifier) 5757public static IndexerDeclarationSyntax IndexerDeclaration(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax type, ExplicitInterfaceSpecifierSyntax? explicitInterfaceSpecifier, SyntaxToken thisKeyword, BracketedParameterListSyntax parameterList, AccessorListSyntax? accessorList, ArrowExpressionClauseSyntax? expressionBody, SyntaxToken semicolonToken) 5772public static IndexerDeclarationSyntax IndexerDeclaration(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax type, ExplicitInterfaceSpecifierSyntax? explicitInterfaceSpecifier, BracketedParameterListSyntax parameterList, AccessorListSyntax? accessorList, ArrowExpressionClauseSyntax? expressionBody) 5776public static IndexerDeclarationSyntax IndexerDeclaration(TypeSyntax type) 5868public static ParameterSyntax Parameter(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax? type, SyntaxToken identifier, EqualsValueClauseSyntax? @default) 5881public static FunctionPointerParameterSyntax FunctionPointerParameter(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax type) 5888public static FunctionPointerParameterSyntax FunctionPointerParameter(TypeSyntax type) 5892public static IncompleteMemberSyntax IncompleteMember(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax? type) 5899public static IncompleteMemberSyntax IncompleteMember(TypeSyntax? type = default) 5931public static TypeCrefSyntax TypeCref(TypeSyntax type) 5938public static QualifiedCrefSyntax QualifiedCref(TypeSyntax container, SyntaxToken dotToken, MemberCrefSyntax member) 5947public static QualifiedCrefSyntax QualifiedCref(TypeSyntax container, MemberCrefSyntax member) 5951public static NameMemberCrefSyntax NameMemberCref(TypeSyntax name, CrefParameterListSyntax? parameters) 5958public static NameMemberCrefSyntax NameMemberCref(TypeSyntax name) 6050public static ConversionOperatorMemberCrefSyntax ConversionOperatorMemberCref(SyntaxToken implicitOrExplicitKeyword, SyntaxToken operatorKeyword, SyntaxToken checkedKeyword, TypeSyntax type, CrefParameterListSyntax? parameters) 6070public static ConversionOperatorMemberCrefSyntax ConversionOperatorMemberCref(SyntaxToken implicitOrExplicitKeyword, TypeSyntax type, CrefParameterListSyntax? parameters) 6074public static ConversionOperatorMemberCrefSyntax ConversionOperatorMemberCref(SyntaxToken implicitOrExplicitKeyword, TypeSyntax type) 6102public static CrefParameterSyntax CrefParameter(SyntaxToken refKindKeyword, SyntaxToken readOnlyKeyword, TypeSyntax type) 6123public static CrefParameterSyntax CrefParameter(SyntaxToken refKindKeyword, TypeSyntax type) 6127public 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); 2373private TypeSyntax? type; 2387public TypeSyntax Type => GetRed(ref this.type, 2)!; 2399public DefaultExpressionSyntax Update(SyntaxToken keyword, SyntaxToken openParenToken, TypeSyntax type, SyntaxToken closeParenToken) 2413public DefaultExpressionSyntax WithType(TypeSyntax type) => Update(this.Keyword, this.OpenParenToken, type, this.CloseParenToken); 2426private TypeSyntax? type; 2440public TypeSyntax Type => GetRed(ref this.type, 2)!; 2452public TypeOfExpressionSyntax Update(SyntaxToken keyword, SyntaxToken openParenToken, TypeSyntax type, SyntaxToken closeParenToken) 2466public TypeOfExpressionSyntax WithType(TypeSyntax type) => Update(this.Keyword, this.OpenParenToken, type, this.CloseParenToken); 2479private TypeSyntax? type; 2493public TypeSyntax Type => GetRed(ref this.type, 2)!; 2505public SizeOfExpressionSyntax Update(SyntaxToken keyword, SyntaxToken openParenToken, TypeSyntax type, SyntaxToken closeParenToken) 2519public SizeOfExpressionSyntax WithType(TypeSyntax type) => Update(this.Keyword, this.OpenParenToken, type, this.CloseParenToken); 2964private TypeSyntax? type; 2972public TypeSyntax Type => GetRedAtZero(ref this.type)!; 2996public DeclarationExpressionSyntax Update(TypeSyntax type, VariableDesignationSyntax designation) 3008public DeclarationExpressionSyntax WithType(TypeSyntax type) => Update(type, this.Designation); 3021private TypeSyntax? type; 3033public TypeSyntax Type => GetRed(ref this.type, 1)!; 3060public CastExpressionSyntax Update(SyntaxToken openParenToken, TypeSyntax type, SyntaxToken closeParenToken, ExpressionSyntax expression) 3073public CastExpressionSyntax WithType(TypeSyntax type) => Update(this.OpenParenToken, type, this.CloseParenToken, this.Expression); 3414private TypeSyntax? returnType; 3435public TypeSyntax? ReturnType => GetRed(ref this.returnType, 2); 3480public ParenthesizedLambdaExpressionSyntax Update(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax? returnType, ParameterListSyntax parameterList, SyntaxToken arrowToken, BlockSyntax? block, ExpressionSyntax? expressionBody) 3496public ParenthesizedLambdaExpressionSyntax WithReturnType(TypeSyntax? returnType) => Update(this.AttributeLists, this.Modifiers, returnType, this.ParameterList, this.ArrowToken, this.Block, this.ExpressionBody); 3689private TypeSyntax? type; 3702public TypeSyntax Type => GetRed(ref this.type, 1)!; 3731public ObjectCreationExpressionSyntax Update(SyntaxToken newKeyword, TypeSyntax type, ArgumentListSyntax? argumentList, InitializerExpressionSyntax? initializer) 3745public ObjectCreationExpressionSyntax WithType(TypeSyntax type) => Update(this.NewKeyword, type, this.ArgumentList, this.Initializer); 4079private TypeSyntax? type; 4091public TypeSyntax Type => GetRed(ref this.type, 1)!; 4115public StackAllocArrayCreationExpressionSyntax Update(SyntaxToken stackAllocKeyword, TypeSyntax type, InitializerExpressionSyntax? initializer) 4128public StackAllocArrayCreationExpressionSyntax WithType(TypeSyntax type) => Update(this.StackAllocKeyword, type, this.Initializer); 4519private TypeSyntax? type; 4529public TypeSyntax? Type => GetRed(ref this.type, 1); 4557public FromClauseSyntax Update(SyntaxToken fromKeyword, TypeSyntax? type, SyntaxToken identifier, SyntaxToken inKeyword, ExpressionSyntax expression) 4570public FromClauseSyntax WithType(TypeSyntax? type) => Update(this.FromKeyword, type, this.Identifier, this.InKeyword, this.Expression); 4633private TypeSyntax? type; 4646public TypeSyntax? Type => GetRed(ref this.type, 1); 4690public JoinClauseSyntax Update(SyntaxToken joinKeyword, TypeSyntax? type, SyntaxToken identifier, SyntaxToken inKeyword, ExpressionSyntax inExpression, SyntaxToken onKeyword, ExpressionSyntax leftExpression, SyntaxToken equalsKeyword, ExpressionSyntax rightExpression, JoinIntoClauseSyntax? into) 4703public JoinClauseSyntax WithType(TypeSyntax? type) => Update(this.JoinKeyword, type, this.Identifier, this.InKeyword, this.InExpression, this.OnKeyword, this.LeftExpression, this.EqualsKeyword, this.RightExpression, this.Into); 5339private TypeSyntax? type; 5347public TypeSyntax Type => GetRedAtZero(ref this.type)!; 5370public DeclarationPatternSyntax Update(TypeSyntax type, VariableDesignationSyntax designation) 5382public DeclarationPatternSyntax WithType(TypeSyntax type) => Update(type, this.Designation); 5436private TypeSyntax? type; 5446public TypeSyntax? Type => GetRedAtZero(ref this.type); 5477public RecursivePatternSyntax Update(TypeSyntax? type, PositionalPatternClauseSyntax? positionalPatternClause, PropertyPatternClauseSyntax? propertyPatternClause, VariableDesignationSyntax? designation) 5489public RecursivePatternSyntax WithType(TypeSyntax? type) => Update(type, this.PositionalPatternClause, this.PropertyPatternClause, this.Designation); 5805private TypeSyntax? type; 5813public TypeSyntax Type => GetRedAtZero(ref this.type)!; 5822public TypePatternSyntax Update(TypeSyntax type) 5834public TypePatternSyntax WithType(TypeSyntax type) => Update(type); 6416private TypeSyntax? returnType; 6439public TypeSyntax ReturnType => GetRed(ref this.returnType, 2)!; 6493public LocalFunctionStatementSyntax Update(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax returnType, SyntaxToken identifier, TypeParameterListSyntax? typeParameterList, ParameterListSyntax parameterList, SyntaxList<TypeParameterConstraintClauseSyntax> constraintClauses, BlockSyntax? body, ArrowExpressionClauseSyntax? expressionBody, SyntaxToken semicolonToken) 6508public LocalFunctionStatementSyntax WithReturnType(TypeSyntax returnType) => Update(this.AttributeLists, this.Modifiers, returnType, this.Identifier, this.TypeParameterList, this.ParameterList, this.ConstraintClauses, this.Body, this.ExpressionBody, this.SemicolonToken); 6642private TypeSyntax? type; 6650public TypeSyntax Type => GetRedAtZero(ref this.type)!; 6680public VariableDeclarationSyntax Update(TypeSyntax type, SeparatedSyntaxList<VariableDeclaratorSyntax> variables) 6692public VariableDeclarationSyntax WithType(TypeSyntax type) => Update(type, this.Variables); 7857private TypeSyntax? type; 7881public TypeSyntax Type => GetRed(ref this.type, 4)!; 7917public ForEachStatementSyntax Update(SyntaxList<AttributeListSyntax> attributeLists, SyntaxToken awaitKeyword, SyntaxToken forEachKeyword, SyntaxToken openParenToken, TypeSyntax type, SyntaxToken identifier, SyntaxToken inKeyword, ExpressionSyntax expression, SyntaxToken closeParenToken, StatementSyntax statement) 7937public ForEachStatementSyntax WithType(TypeSyntax type) => Update(this.AttributeLists, this.AwaitKeyword, this.ForEachKeyword, this.OpenParenToken, type, this.Identifier, this.InKeyword, this.Expression, this.CloseParenToken, this.Statement); 9232private TypeSyntax? type; 9241public TypeSyntax Type => GetRed(ref this.type, 1)!; 9261public CatchDeclarationSyntax Update(SyntaxToken openParenToken, TypeSyntax type, SyntaxToken identifier, SyntaxToken closeParenToken) 9274public CatchDeclarationSyntax WithType(TypeSyntax type) => Update(this.OpenParenToken, type, this.Identifier, this.CloseParenToken); 9511private TypeSyntax? namespaceOrType; 9549public TypeSyntax NamespaceOrType => GetRed(ref this.namespaceOrType, 5)!; 9572public UsingDirectiveSyntax Update(SyntaxToken globalKeyword, SyntaxToken usingKeyword, SyntaxToken staticKeyword, SyntaxToken unsafeKeyword, NameEqualsSyntax? alias, TypeSyntax namespaceOrType, SyntaxToken semicolonToken) 9589public UsingDirectiveSyntax WithNamespaceOrType(TypeSyntax namespaceOrType) => Update(this.GlobalKeyword, this.UsingKeyword, this.StaticKeyword, this.UnsafeKeyword, this.Alias, namespaceOrType, this.SemicolonToken); 11434private TypeSyntax? returnType; 11459public TypeSyntax ReturnType => GetRed(ref this.returnType, 3)!; 11500public DelegateDeclarationSyntax Update(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, SyntaxToken delegateKeyword, TypeSyntax returnType, SyntaxToken identifier, TypeParameterListSyntax? typeParameterList, ParameterListSyntax parameterList, SyntaxList<TypeParameterConstraintClauseSyntax> constraintClauses, SyntaxToken semicolonToken) 11517public DelegateDeclarationSyntax WithReturnType(TypeSyntax returnType) => Update(this.AttributeLists, this.Modifiers, this.DelegateKeyword, returnType, this.Identifier, this.TypeParameterList, this.ParameterList, this.ConstraintClauses, this.SemicolonToken); 11823public abstract TypeSyntax Type { get; } 11824public BaseTypeSyntax WithType(TypeSyntax type) => WithTypeCore(type); 11825internal abstract BaseTypeSyntax WithTypeCore(TypeSyntax type); 11836private TypeSyntax? type; 11843public override TypeSyntax Type => GetRedAtZero(ref this.type)!; 11852public SimpleBaseTypeSyntax Update(TypeSyntax type) 11864internal override BaseTypeSyntax WithTypeCore(TypeSyntax type) => WithType(type); 11865public new SimpleBaseTypeSyntax WithType(TypeSyntax type) => Update(type); 11876private TypeSyntax? type; 11884public override TypeSyntax Type => GetRedAtZero(ref this.type)!; 11907public PrimaryConstructorBaseTypeSyntax Update(TypeSyntax type, ArgumentListSyntax argumentList) 11919internal override BaseTypeSyntax WithTypeCore(TypeSyntax type) => WithType(type); 11920public new PrimaryConstructorBaseTypeSyntax WithType(TypeSyntax type) => Update(type, this.ArgumentList); 12118private TypeSyntax? type; 12126public TypeSyntax Type => GetRedAtZero(ref this.type)!; 12135public TypeConstraintSyntax Update(TypeSyntax type) 12147public TypeConstraintSyntax WithType(TypeSyntax type) => Update(type); 12578private TypeSyntax? returnType; 12603public TypeSyntax ReturnType => GetRed(ref this.returnType, 2)!; 12662public 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) 12678public 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); 12728private TypeSyntax? returnType; 12751public TypeSyntax ReturnType => GetRed(ref this.returnType, 2)!; 12814public 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) 12830public 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); 12875private TypeSyntax? type; 12915public TypeSyntax Type => GetRed(ref this.type, 6)!; 12960public 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) 12980public 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); 13316public abstract TypeSyntax Type { get; } 13317public BasePropertyDeclarationSyntax WithType(TypeSyntax type) => WithTypeCore(type); 13318internal abstract BasePropertyDeclarationSyntax WithTypeCore(TypeSyntax type); 13349private TypeSyntax? type; 13371public override TypeSyntax Type => GetRed(ref this.type, 2)!; 13420public PropertyDeclarationSyntax Update(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax type, ExplicitInterfaceSpecifierSyntax? explicitInterfaceSpecifier, SyntaxToken identifier, AccessorListSyntax? accessorList, ArrowExpressionClauseSyntax? expressionBody, EqualsValueClauseSyntax? initializer, SyntaxToken semicolonToken) 13436internal override BasePropertyDeclarationSyntax WithTypeCore(TypeSyntax type) => WithType(type); 13437public new PropertyDeclarationSyntax WithType(TypeSyntax type) => Update(this.AttributeLists, this.Modifiers, type, this.ExplicitInterfaceSpecifier, this.Identifier, this.AccessorList, this.ExpressionBody, this.Initializer, this.SemicolonToken); 13511private TypeSyntax? type; 13533public override TypeSyntax Type => GetRed(ref this.type, 3)!; 13574public EventDeclarationSyntax Update(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, SyntaxToken eventKeyword, TypeSyntax type, ExplicitInterfaceSpecifierSyntax? explicitInterfaceSpecifier, SyntaxToken identifier, AccessorListSyntax? accessorList, SyntaxToken semicolonToken) 13591internal override BasePropertyDeclarationSyntax WithTypeCore(TypeSyntax type) => WithType(type); 13592public new EventDeclarationSyntax WithType(TypeSyntax type) => Update(this.AttributeLists, this.Modifiers, this.EventKeyword, type, this.ExplicitInterfaceSpecifier, this.Identifier, this.AccessorList, this.SemicolonToken); 13621private TypeSyntax? type; 13643public override TypeSyntax Type => GetRed(ref this.type, 2)!; 13692public IndexerDeclarationSyntax Update(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax type, ExplicitInterfaceSpecifierSyntax? explicitInterfaceSpecifier, SyntaxToken thisKeyword, BracketedParameterListSyntax parameterList, AccessorListSyntax? accessorList, ArrowExpressionClauseSyntax? expressionBody, SyntaxToken semicolonToken) 13708internal override BasePropertyDeclarationSyntax WithTypeCore(TypeSyntax type) => WithType(type); 13709public new IndexerDeclarationSyntax WithType(TypeSyntax type) => Update(this.AttributeLists, this.Modifiers, type, this.ExplicitInterfaceSpecifier, this.ThisKeyword, this.ParameterList, this.AccessorList, this.ExpressionBody, this.SemicolonToken); 14046public abstract TypeSyntax? Type { get; } 14047public BaseParameterSyntax WithType(TypeSyntax? type) => WithTypeCore(type); 14048internal abstract BaseParameterSyntax WithTypeCore(TypeSyntax? type); 14061private TypeSyntax? type; 14085public override TypeSyntax? Type => GetRed(ref this.type, 2); 14120public ParameterSyntax Update(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax? type, SyntaxToken identifier, EqualsValueClauseSyntax? @default) 14136internal override BaseParameterSyntax WithTypeCore(TypeSyntax? type) => WithType(type); 14137public new ParameterSyntax WithType(TypeSyntax? type) => Update(this.AttributeLists, this.Modifiers, type, this.Identifier, this.Default); 14157private TypeSyntax? type; 14177public override TypeSyntax Type => GetRed(ref this.type, 2)!; 14198public FunctionPointerParameterSyntax Update(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax type) 14214internal override BaseParameterSyntax WithTypeCore(TypeSyntax? type) => WithType(type ?? throw new ArgumentNullException(nameof(type))); 14215public new FunctionPointerParameterSyntax WithType(TypeSyntax type) => Update(this.AttributeLists, this.Modifiers, type); 14232private TypeSyntax? type; 14250public TypeSyntax? Type => GetRed(ref this.type, 2); 14271public IncompleteMemberSyntax Update(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax? type) 14287public IncompleteMemberSyntax WithType(TypeSyntax? type) => Update(this.AttributeLists, this.Modifiers, type); 14414private TypeSyntax? type; 14421public TypeSyntax Type => GetRedAtZero(ref this.type)!; 14430public TypeCrefSyntax Update(TypeSyntax type) 14442public TypeCrefSyntax WithType(TypeSyntax type) => Update(type); 14460private TypeSyntax? container; 14468public TypeSyntax Container => GetRedAtZero(ref this.container)!; 14493public QualifiedCrefSyntax Update(TypeSyntax container, SyntaxToken dotToken, MemberCrefSyntax member) 14505public QualifiedCrefSyntax WithContainer(TypeSyntax container) => Update(container, this.DotToken, this.Member); 14539private TypeSyntax? name; 14547public TypeSyntax Name => GetRedAtZero(ref this.name)!; 14570public NameMemberCrefSyntax Update(TypeSyntax name, CrefParameterListSyntax? parameters) 14582public NameMemberCrefSyntax WithName(TypeSyntax name) => Update(name, this.Parameters); 14658public ExtensionMemberCrefSyntax AddTypeArgumentListArguments(params TypeSyntax[] items) 14797private TypeSyntax? type; 14818public TypeSyntax Type => GetRed(ref this.type, 3)!; 14841public ConversionOperatorMemberCrefSyntax Update(SyntaxToken implicitOrExplicitKeyword, SyntaxToken operatorKeyword, SyntaxToken checkedKeyword, TypeSyntax type, CrefParameterListSyntax? parameters) 14856public ConversionOperatorMemberCrefSyntax WithType(TypeSyntax type) => Update(this.ImplicitOrExplicitKeyword, this.OperatorKeyword, this.CheckedKeyword, type, this.Parameters); 15022private TypeSyntax? type; 15047public TypeSyntax Type => GetRed(ref this.type, 2)!; 15056public CrefParameterSyntax Update(SyntaxToken refKindKeyword, SyntaxToken readOnlyKeyword, TypeSyntax type) 15070public CrefParameterSyntax WithType(TypeSyntax type) => Update(this.RefKindKeyword, this.ReadOnlyKeyword, type);
Binder\Binder_Await.cs (1)
642var 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) 1093SeparatedSyntaxList<TypeSyntax> typeArgumentSyntaxes = typeArgumentListSyntax.Arguments; 1105TypeSyntax typeArgumentSyntax = typeArgumentSyntaxes[i]; 1161private 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)
1683SeparatedSyntaxList<TypeSyntax> typeArgumentList = node.Kind() == SyntaxKind.GenericName 1685: default(SeparatedSyntaxList<TypeSyntax>); 3233TypeSyntax typeSyntax = declarationExpression.Type; 3275TypeSyntax typeSyntax = declarationExpression.Type; 4588TypeSyntax typeSyntax = node.Type; 4603var elementTypeSyntax = arrayTypeSyntax.ElementType; 7837SeparatedSyntaxList<TypeSyntax> typeArgumentsSyntax = right.Kind() == SyntaxKind.GenericName ? 7839default(SeparatedSyntaxList<TypeSyntax>); 7892/// <see cref="MakeQueryInvocation(CSharpSyntaxNode, BoundExpression, string, SeparatedSyntaxList{TypeSyntax}, ImmutableArray{TypeWithAnnotations}, ImmutableArray{BoundExpression}, BindingDiagnosticBag, string?)"/>. 7966var typeArgumentsSyntax = right.Kind() == SyntaxKind.GenericName ? ((GenericNameSyntax)right).TypeArgumentList.Arguments : default(SeparatedSyntaxList<TypeSyntax>); 8062SeparatedSyntaxList<TypeSyntax> typeArgumentsSyntax, 8137SeparatedSyntaxList<TypeSyntax> typeArgumentsSyntax, 8319SeparatedSyntaxList<TypeSyntax> typeArgumentsSyntax, 8390SeparatedSyntaxList<TypeSyntax> typeArgumentsSyntax, BindingDiagnosticBag diagnostics) 8645SeparatedSyntaxList<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 (5)
1031TypeSyntax typeSyntax = node.Type; 1045TypeSyntax typeSyntax, 1072TypeSyntax? typeSyntax, 1157TypeSyntax? typeSyntax = node.Type; 1841typeArgumentsSyntax: 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) 2852var 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\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\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) 1556Debug.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)
54TypeSyntax returnTypeSyntax = syntax.ReturnType;
Symbols\Source\SourceEventSymbol.cs (1)
853protected 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)
5002var typesBuilder = ArrayBuilder<TypeSyntax>.GetInstance(parameterList.Parameters.Count); 5015TypeSyntax? typeSyntax = parameterSyntax.Type; 5034foreach (var typeSyntax in typesBuilder)
Symbols\Source\SourceMemberFieldSymbol.cs (4)
44protected abstract TypeSyntax TypeSyntax { get; } 422protected sealed override TypeSyntax TypeSyntax 492var typeSyntax = fieldSyntax.Declaration.Type; 533var typeOnly = typeSyntax.SkipScoped(out _).SkipRefInField(out refKind);
Symbols\Source\SourceMethodSymbol.cs (1)
33protected static void ReportBadRefToken(TypeSyntax returnTypeSyntax, BindingDiagnosticBag diagnostics)
Symbols\Source\SourceMethodSymbolWithAttributes.cs (1)
1544var returnTypeSyntax = this.SyntaxNode switch
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\SourceNamedTypeSymbol.cs (1)
63TypeSyntax t = baseTypeSyntax.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)
223internal static RefKind GetRefKindInLocalOrReturn(this TypeSyntax syntax, BindingDiagnosticBag diagnostics) 236internal static TypeSyntax SkipRef(this TypeSyntax syntax) 239internal static TypeSyntax SkipRefInField(this TypeSyntax syntax, out RefKind refKind) 246internal static TypeSyntax SkipRefInLocalOrReturn(this TypeSyntax syntax, BindingDiagnosticBag? diagnostics, out RefKind refKind) 249private static TypeSyntax SkipRefWorker(TypeSyntax syntax, BindingDiagnosticBag? diagnostics, out RefKind refKind) 261var current = syntax; 288internal 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)
101var fixedReturnType = FixMethodReturnType(keepVoid, methodSymbol, method.ReturnType, knownTypes); 126private static TypeSyntax FixMethodReturnType( 129TypeSyntax returnTypeSyntax, 132var newReturnType = returnTypeSyntax.WithAdditionalAnnotations(Formatter.Annotation); 170static TypeSyntax MakeGenericType(string type, ITypeSymbol typeArgumentFrom) 190private static (SyntaxTokenList newModifiers, TypeSyntax newReturnType) AddAsyncModifierWithCorrectedTrivia(SyntaxTokenList modifiers, TypeSyntax returnType) 211var 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) 2326if (binary.Left is TypeSyntax type && type.IsPotentialTypeName(semanticModel, cancellationToken)) 2347var type = previousToken.Parent as TypeSyntax; 2353var underlyingType = type is PointerTypeSyntax pointerType 2387return conditionalExpression.Condition is not TypeSyntax type 2848var 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_IntroduceLocal.cs (1)
228private static TypeSyntax GetTypeSyntax(SemanticDocument document, ExpressionSyntax expression, CancellationToken cancellationToken)
IntroduceVariable\CSharpIntroduceVariableService.cs (1)
25AbstractIntroduceVariableService<CSharpIntroduceVariableService, ExpressionSyntax, TypeSyntax, TypeDeclarationSyntax, QueryExpressionSyntax, NameSyntax>
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)
101var fixedReturnType = FixMethodReturnType(keepVoid, methodSymbol, method.ReturnType, knownTypes); 126private static TypeSyntax FixMethodReturnType( 129TypeSyntax returnTypeSyntax, 132var newReturnType = returnTypeSyntax.WithAdditionalAnnotations(Formatter.Annotation); 170static TypeSyntax MakeGenericType(string type, ITypeSymbol typeArgumentFrom) 190private static (SyntaxTokenList newModifiers, TypeSyntax newReturnType) AddAsyncModifierWithCorrectedTrivia(SyntaxTokenList modifiers, TypeSyntax returnType) 211var 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]))); 200static TypeSyntax GetTypeOfTypeSyntax(TypeOfExpressionSyntax syntax)
Microsoft.NetCore.Analyzers\Performance\CSharpPreferDictionaryTryMethodsOverContainsKeyGuardFixer.cs (3)
192TypeSyntax typeSyntax; 195typeSyntax = (TypeSyntax)generator.TypeExpression(fix.Type); 197typeSyntax = (TypeSyntax)generator.NullableTypeExpression(typeSyntax);
Microsoft.NetCore.Analyzers\Performance\CSharpUseStartsWithInsteadOfIndexOfComparisonWithZero.Fixer.cs (1)
47(TypeSyntax)generator.TypeExpression(SpecialType.System_Char),
Microsoft.NetCore.Analyzers\Runtime\CSharpAvoidRedundantRegexIsMatchBeforeMatch.Fixer.cs (1)
344TypeSyntax 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), 1846? SyntaxFactory.SeparatedList<TypeParameterConstraintSyntax>(types.Select(t => SyntaxFactory.TypeConstraint((TypeSyntax)t))) 2151private static TypeSyntax? NotVoid(TypeSyntax type) 2160SyntaxKind.DelegateDeclaration => ((DelegateDeclarationSyntax)declaration).WithReturnType((TypeSyntax)type), 2161SyntaxKind.MethodDeclaration => ((MethodDeclarationSyntax)declaration).WithReturnType((TypeSyntax)type), 2162SyntaxKind.FieldDeclaration => ((FieldDeclarationSyntax)declaration).WithDeclaration(((FieldDeclarationSyntax)declaration).Declaration.WithType((TypeSyntax)type)), 2163SyntaxKind.PropertyDeclaration => ((PropertyDeclarationSyntax)declaration).WithType((TypeSyntax)type), 2164SyntaxKind.IndexerDeclaration => ((IndexerDeclarationSyntax)declaration).WithType((TypeSyntax)type), 2165SyntaxKind.EventFieldDeclaration => ((EventFieldDeclarationSyntax)declaration).WithDeclaration(((EventFieldDeclarationSyntax)declaration).Declaration.WithType((TypeSyntax)type)), 2166SyntaxKind.EventDeclaration => ((EventDeclarationSyntax)declaration).WithType((TypeSyntax)type), 2167SyntaxKind.Parameter => ((ParameterSyntax)declaration).WithType((TypeSyntax)type), 2168SyntaxKind.LocalDeclarationStatement => ((LocalDeclarationStatementSyntax)declaration).WithDeclaration(((LocalDeclarationStatementSyntax)declaration).Declaration.WithType((TypeSyntax)type)), 2169SyntaxKind.VariableDeclaration => ((VariableDeclarationSyntax)declaration).WithType((TypeSyntax)type), 2830return WithBaseList(declaration, baseList.WithTypes(baseList.Types.Insert(0, SyntaxFactory.SimpleBaseType((TypeSyntax)baseType)))); 2834return AddBaseList(declaration, SyntaxFactory.BaseList([SyntaxFactory.SimpleBaseType((TypeSyntax)baseType)])); 2844return WithBaseList(declaration, baseList.WithTypes(baseList.Types.Insert(baseList.Types.Count, SyntaxFactory.SimpleBaseType((TypeSyntax)interfaceType)))); 2848return AddBaseList(declaration, SyntaxFactory.BaseList([SyntaxFactory.SimpleBaseType((TypeSyntax)interfaceType)])); 3325var arrayType = SyntaxFactory.ArrayType((TypeSyntax)elementType, [SyntaxFactory.ArrayRankSpecifier([(ExpressionSyntax)size])]); 3331var arrayType = SyntaxFactory.ArrayType((TypeSyntax)elementType, 3338=> SyntaxFactory.ObjectCreationExpression((TypeSyntax)type, CreateArgumentList(arguments), null); 3342(TypeSyntax)type, 3368=> SyntaxFactory.BinaryExpression(SyntaxKind.IsExpression, (ExpressionSyntax)ParenthesizeNonSimple(expression), (TypeSyntax)type); 3371=> SyntaxFactory.TypeOfExpression((TypeSyntax)type); 3374=> SyntaxFactory.BinaryExpression(SyntaxKind.AsExpression, (ExpressionSyntax)ParenthesizeNonSimple(expression), (TypeSyntax)type); 3464SyntaxFactory.TypeArgumentList([.. typeArguments.Cast<TypeSyntax>()])); 3472return SyntaxFactory.GenericName(sname.Identifier, SyntaxFactory.TypeArgumentList([.. typeArguments.Cast<TypeSyntax>()])); 3476return gname.WithTypeArgumentList(SyntaxFactory.TypeArgumentList([.. typeArguments.Cast<TypeSyntax>()])); 3530=> SyntaxFactory.ArrayType((TypeSyntax)type, [SyntaxFactory.ArrayRankSpecifier()]); 3540return SyntaxFactory.NullableType((TypeSyntax)type); 3548=> SyntaxFactory.TupleElement((TypeSyntax)type, name?.ToIdentifierToken() ?? default); 3595SyntaxFactory.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) 2326if (binary.Left is TypeSyntax type && type.IsPotentialTypeName(semanticModel, cancellationToken)) 2347var type = previousToken.Parent as TypeSyntax; 2353var underlyingType = type is PointerTypeSyntax pointerType 2387return conditionalExpression.Condition is not TypeSyntax type 2848var 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 (7)
ComInterfaceGenerator.cs (2)
825TypeSyntax valueType; 928TypeSyntax valueTypeSyntax = isSetter
Marshallers\ObjectUnwrapperResolver.cs (2)
13internal sealed record ObjectUnwrapperInfo(TypeSyntax UnwrapperType) : MarshallingInfo; 37TypeSyntax unwrapperType = ((ObjectUnwrapperInfo)info.MarshallingAttributeInfo).UnwrapperType;
VirtualMethodPointerStubGenerator.cs (2)
159TypeSyntax valueType; 242(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)
291TypeSyntax 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)
420(ParameterListSyntax parameterList, TypeSyntax returnType, AttributeListSyntax returnTypeAttributes) = stubGenerator.GenerateTargetMethodSignatureData();
Microsoft.Interop.LibraryImportGenerator.Downlevel (1)
DownlevelLibraryImportGenerator.cs (1)
354(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)
49public static TypeSyntax VoidStar { get; } = PointerType(PredefinedType(Token(SyntaxKind.VoidKeyword))); 51private static TypeSyntax? _IUnmanagedVirtualMethodTableProvider; 52public static TypeSyntax IUnmanagedVirtualMethodTableProvider => _IUnmanagedVirtualMethodTableProvider ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.IUnmanagedVirtualMethodTableProvider); 54private static TypeSyntax? _UnmanagedObjectUnwrapper; 55public static TypeSyntax UnmanagedObjectUnwrapper => _UnmanagedObjectUnwrapper ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.UnmanagedObjectUnwrapper); 57private static TypeSyntax? _UnreachableException; 58public static TypeSyntax UnreachableException => _UnreachableException ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.UnreachableException); 60private static TypeSyntax? _System_IntPtr; 61public static TypeSyntax System_IntPtr => _System_IntPtr ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.System_IntPtr); 63private static TypeSyntax? _DllImportSearchPath; 64public static TypeSyntax DllImportSearchPath => _DllImportSearchPath ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.DllImportSearchPath); 66private static TypeSyntax? _System_Type; 67public static TypeSyntax System_Type => _System_Type ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.System_Type); 69private static TypeSyntax? _System_Runtime_InteropServices_Marshal; 70public static TypeSyntax System_Runtime_InteropServices_Marshal => _System_Runtime_InteropServices_Marshal ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.System_Runtime_InteropServices_Marshal); 72private static TypeSyntax? _System_Runtime_InteropServices_UnmanagedType; 73public static TypeSyntax System_Runtime_InteropServices_UnmanagedType => _System_Runtime_InteropServices_UnmanagedType ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.System_Runtime_InteropServices_UnmanagedType); 75private static TypeSyntax? _System_Runtime_InteropServices_MemoryMarshal; 76public static TypeSyntax System_Runtime_InteropServices_MemoryMarshal => _System_Runtime_InteropServices_MemoryMarshal ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.System_Runtime_InteropServices_MemoryMarshal); 78private static TypeSyntax? _System_Exception; 79public static TypeSyntax System_Exception => _System_Exception ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.System_Exception); 81private static TypeSyntax? _System_GC; 82public static TypeSyntax System_GC => _System_GC ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.System_GC); 84private static TypeSyntax? _System_Runtime_InteropServices_ComWrappers_ComInterfaceDispatch; 85public static TypeSyntax System_Runtime_InteropServices_ComWrappers_ComInterfaceDispatch => _System_Runtime_InteropServices_ComWrappers_ComInterfaceDispatch ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.System_Runtime_InteropServices_ComWrappers_ComInterfaceDispatch); 87private static TypeSyntax? _System_Runtime_CompilerServices_Unsafe; 88public static TypeSyntax System_Runtime_CompilerServices_Unsafe => _System_Runtime_CompilerServices_Unsafe ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.System_Runtime_CompilerServices_Unsafe); 90private static TypeSyntax? _CallConvCdecl; 91private static TypeSyntax? _CallConvFastcall; 92private static TypeSyntax? _CallConvMemberFunction; 93private static TypeSyntax? _CallConvStdcall; 94private static TypeSyntax? _CallConvSuppressGCTransition; 95private static TypeSyntax? _CallConvThiscall; 96public static TypeSyntax CallConv(string callConv)
TypeSymbolExtensions.cs (1)
170public static TypeSyntax AsTypeSyntax(this ITypeSymbol type)
UnmanagedToManagedStubGenerator.cs (1)
161public (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) 2326if (binary.Left is TypeSyntax type && type.IsPotentialTypeName(semanticModel, cancellationToken)) 2347var type = previousToken.Parent as TypeSyntax; 2353var underlyingType = type is PointerTypeSyntax pointerType 2387return conditionalExpression.Condition is not TypeSyntax type 2848var 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))