10 types derived from TypeSyntax
Microsoft.CodeAnalysis.CSharp (10)
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
1561 references to TypeSyntax
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 (536)
Binder\Binder.WithQueryLambdaParametersBinder.cs (1)
99var result = BindMemberOfType(node, node, name, 0, invoked: false, indexed: false, receiver, default(SeparatedSyntaxList<TypeSyntax>), default(ImmutableArray<TypeWithAnnotations>), lookupResult, BoundMethodGroupFlags.None, diagnostics);
Binder\Binder_Await.cs (1)
618var 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)
1303typeArgumentsSyntax: default(SeparatedSyntaxList<TypeSyntax>),
Binder\Binder_Crefs.cs (4)
83private NamespaceOrTypeSymbol BindNamespaceOrTypeSymbolInCref(TypeSyntax syntax) 1084SeparatedSyntaxList<TypeSyntax> typeArgumentSyntaxes = typeArgumentListSyntax.Arguments; 1096TypeSyntax typeArgumentSyntax = typeArgumentSyntaxes[i]; 1152private TypeSymbol BindCrefParameterOrReturnType(TypeSyntax typeSyntax, MemberCrefSyntax memberCrefSyntax, BindingDiagnosticBag diagnostics)
Binder\Binder_Deconstruct.cs (4)
654typeArgumentsSyntax: default(SeparatedSyntaxList<TypeSyntax>), 821TypeSyntax typeSyntax = declExpr.Type; 880TypeSyntax typeSyntax = declExpr.Type; 931TypeSyntax typeSyntax = declExpr.Type;
Binder\Binder_Expressions.cs (15)
1621SeparatedSyntaxList<TypeSyntax> typeArgumentList = node.Kind() == SyntaxKind.GenericName 1623: default(SeparatedSyntaxList<TypeSyntax>); 3156TypeSyntax typeSyntax = declarationExpression.Type; 3198TypeSyntax typeSyntax = declarationExpression.Type; 4507TypeSyntax typeSyntax = node.Type; 4522var elementTypeSyntax = arrayTypeSyntax.ElementType; 7598SeparatedSyntaxList<TypeSyntax> typeArgumentsSyntax = right.Kind() == SyntaxKind.GenericName ? 7600default(SeparatedSyntaxList<TypeSyntax>); 7647/// <see cref="MakeQueryInvocation(CSharpSyntaxNode, BoundExpression, bool, string, SeparatedSyntaxList{TypeSyntax}, ImmutableArray{TypeWithAnnotations}, ImmutableArray{BoundExpression}, BindingDiagnosticBag, string?)"/>. 7721var typeArgumentsSyntax = right.Kind() == SyntaxKind.GenericName ? ((GenericNameSyntax)right).TypeArgumentList.Arguments : default(SeparatedSyntaxList<TypeSyntax>); 7817SeparatedSyntaxList<TypeSyntax> typeArgumentsSyntax, 7891SeparatedSyntaxList<TypeSyntax> typeArgumentsSyntax, 8073SeparatedSyntaxList<TypeSyntax> typeArgumentsSyntax, 8144SeparatedSyntaxList<TypeSyntax> typeArgumentsSyntax, BindingDiagnosticBag diagnostics) 8406SeparatedSyntaxList<TypeSyntax> typeArgumentsSyntax,
Binder\Binder_Invocation.cs (2)
83SeparatedSyntaxList<TypeSyntax> typeArgsSyntax = default(SeparatedSyntaxList<TypeSyntax>),
Binder\Binder_Lambda.cs (1)
291private (RefKind, TypeWithAnnotations) BindExplicitLambdaReturnType(TypeSyntax syntax, BindingDiagnosticBag diagnostics)
Binder\Binder_Patterns.cs (6)
844TypeSyntax typeSyntax = node.Type; 853TypeSyntax typeSyntax, 870TypeSyntax? typeSyntax, 928TypeSyntax? typeSyntax, 973TypeSyntax? typeSyntax = node.Type; 1556typeArgumentsSyntax: default(SeparatedSyntaxList<TypeSyntax>),
Binder\Binder_Query.cs (6)
848private UnboundLambda MakeQueryUnboundLambdaWithCast(RangeVariableMap qvm, RangeVariableSymbol parameter, ExpressionSyntax expression, TypeSyntax castTypeSyntax, TypeWithAnnotations castType, bool withDependencies) 886return MakeQueryInvocation(node, receiver, receiverIsCheckedForRValue, methodName, default(SeparatedSyntaxList<TypeSyntax>), default(ImmutableArray<TypeWithAnnotations>), ImmutableArray.Create(arg), diagnostics 899return MakeQueryInvocation(node, receiver, receiverIsCheckedForRValue, methodName, default(SeparatedSyntaxList<TypeSyntax>), default(ImmutableArray<TypeWithAnnotations>), args, diagnostics 906protected BoundCall MakeQueryInvocation(CSharpSyntaxNode node, BoundExpression receiver, bool receiverIsCheckedForRValue, string methodName, TypeSyntax typeArgSyntax, TypeWithAnnotations typeArg, BindingDiagnosticBag diagnostics 912return MakeQueryInvocation(node, receiver, receiverIsCheckedForRValue, methodName, new SeparatedSyntaxList<TypeSyntax>(new SyntaxNodeOrTokenList(typeArgSyntax, 0)), ImmutableArray.Create(typeArg), ImmutableArray<BoundExpression>.Empty, diagnostics 919protected BoundCall MakeQueryInvocation(CSharpSyntaxNode node, BoundExpression receiver, bool receiverIsCheckedForRValue, string methodName, SeparatedSyntaxList<TypeSyntax> typeArgsSyntax, ImmutableArray<TypeWithAnnotations> typeArgs, ImmutableArray<BoundExpression> args, BindingDiagnosticBag diagnostics
Binder\Binder_Statements.cs (6)
709var typeSyntax = node.Declaration.Type; 786private TypeWithAnnotations BindVariableTypeWithAnnotations(CSharpSyntaxNode declarationNode, BindingDiagnosticBag diagnostics, TypeSyntax typeSyntax, ref bool isConst, out bool isVar, out AliasSymbol alias) 953TypeSyntax typeSyntax, 979TypeSyntax typeSyntax, 1196private SourceLocalSymbol LocateDeclaredVariableSymbol(VariableDeclaratorSyntax declarator, TypeSyntax typeSyntax, LocalDeclarationKind outerKind, BindingDiagnosticBag diagnostics) 2839var typeSyntax = nodeOpt.Type;
Binder\Binder_Symbols.cs (16)
37internal TypeWithAnnotations BindTypeOrVarKeyword(TypeSyntax syntax, BindingDiagnosticBag diagnostics, out bool isVar) 57private TypeWithAnnotations BindTypeOrConstraintKeyword(TypeSyntax syntax, BindingDiagnosticBag diagnostics, out ConstraintContextualKeyword keyword) 78internal TypeWithAnnotations BindTypeOrVarKeyword(TypeSyntax syntax, BindingDiagnosticBag diagnostics, out bool isVar, out AliasSymbol alias) 107private NamespaceOrTypeOrAliasSymbolWithAnnotations BindTypeOrAliasOrVarKeyword(TypeSyntax syntax, BindingDiagnosticBag diagnostics, out bool isVar) 134private NamespaceOrTypeOrAliasSymbolWithAnnotations BindTypeOrAliasOrConstraintKeyword(TypeSyntax syntax, BindingDiagnosticBag diagnostics, out ConstraintContextualKeyword keyword) 184/// PREREQUISITE: syntax should be checked to match the keyword, like <see cref="TypeSyntax.IsVar"/> or <see cref="TypeSyntax.IsUnmanaged"/>. 477return BindTypeArgument((TypeSyntax)syntax, diagnostics, basesBeingResolved); 550TypeSyntax typeArgumentSyntax = nullableSyntax.ElementType; 1212SeparatedSyntaxList<TypeSyntax> typeArguments = node.TypeArgumentList.Arguments; 1345private ImmutableArray<TypeWithAnnotations> BindTypeArguments(SeparatedSyntaxList<TypeSyntax> typeArguments, BindingDiagnosticBag diagnostics, ConsList<TypeSymbol> basesBeingResolved = null) 1349foreach (var argSyntax in typeArguments) 1357private TypeWithAnnotations BindTypeArgument(TypeSyntax typeArgument, BindingDiagnosticBag diagnostics, ConsList<TypeSymbol> basesBeingResolved = null) 1380private NamedTypeSymbol ConstructNamedTypeUnlessTypeArgumentOmitted(SyntaxNode typeSyntax, NamedTypeSymbol type, SeparatedSyntaxList<TypeSyntax> typeArgumentsSyntax, ImmutableArray<TypeWithAnnotations> typeArguments, BindingDiagnosticBag diagnostics) 1425SeparatedSyntaxList<TypeSyntax> typeArgumentsSyntax, 1619SeparatedSyntaxList<TypeSyntax> typeArgumentsSyntax,
Binder\ExpressionVariableFinder.cs (7)
287protected abstract TFieldOrLocalSymbol MakePatternVariable(TypeSyntax type, SingleVariableDesignationSyntax designation, SyntaxNode nodeToBind); 496TypeSyntax closestTypeSyntax, 539TypeSyntax closestTypeSyntax, 592protected override LocalSymbol MakePatternVariable(TypeSyntax type, SingleVariableDesignationSyntax designation, SyntaxNode nodeToBind) 641TypeSyntax closestTypeSyntax, 705protected override Symbol MakePatternVariable(TypeSyntax type, SingleVariableDesignationSyntax designation, SyntaxNode nodeToBind) 722TypeSyntax 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)
164/// then the provided expression should be a <see cref="TypeSyntax"/>.</param> 211if (!(expression is TypeSyntax)) 257Debug.Assert(bindingOption != SpeculativeBindingOption.BindAsTypeOrNamespace || expression is TypeSyntax); 310else if (expression is TypeSyntax typeSyntax) 546if (((TypeSyntax)expression).IsVar) 976if (((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) 1512Debug.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, 555internal 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)
1150public 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)
256TypeSyntax returnTypeSyntax = Syntax.ReturnType;
Symbols\Source\SourceDelegateMethodSymbol.cs (1)
53TypeSyntax returnTypeSyntax = syntax.ReturnType;
Symbols\Source\SourceEventSymbol.cs (1)
814protected TypeWithAnnotations BindEventType(Binder binder, TypeSyntax typeSyntax, BindingDiagnosticBag diagnostics)
Symbols\Source\SourceLocalSymbol.cs (11)
34private readonly TypeSyntax _typeSyntax; 46TypeSyntax typeSyntax, 111TypeSyntax typeSyntax, 139TypeSyntax closestTypeSyntax, 159TypeSyntax typeSyntax, 205TypeSyntax typeSyntax, 319TypeSyntax typeSyntax = _typeSyntax.SkipScoped(out _).SkipRef(); 527TypeSyntax typeSyntax, 628TypeSyntax typeSyntax, 669TypeSyntax typeSyntax, 733TypeSyntax typeSyntax,
Symbols\Source\SourceMemberFieldSymbol.cs (4)
44protected abstract TypeSyntax TypeSyntax { get; } 388protected sealed override TypeSyntax TypeSyntax 458var typeSyntax = fieldSyntax.Declaration.Type; 499var typeOnly = typeSyntax.SkipScoped(out _).SkipRefInField(out refKind);
Symbols\Source\SourceMethodSymbol.cs (1)
34protected static void ReportBadRefToken(TypeSyntax returnTypeSyntax, BindingDiagnosticBag diagnostics)
Symbols\Source\SourceMethodSymbolWithAttributes.cs (1)
1540var returnTypeSyntax = this.SyntaxNode switch
Symbols\Source\SourceNamedTypeSymbol.cs (1)
62TypeSyntax t = baseTypeSyntax.Type;
Symbols\Source\SourceNamedTypeSymbol_Bases.cs (2)
225var b = baseTypeSyntax.Type; 459var typeSyntax = baseTypeSyntax.Type;
Symbols\Source\SourceNamedTypeSymbol_Enum.cs (1)
59var typeSyntax = types[0].Type;
Symbols\Source\SourceOrdinaryMethodSymbol.cs (1)
133var returnTypeSyntax = syntax.ReturnType;
Symbols\Source\SourcePropertySymbol.cs (2)
173private TypeSyntax GetTypeSyntax(SyntaxNode syntax) => ((BasePropertyDeclarationSyntax)syntax).Type; 574var typeSyntax = GetTypeSyntax(syntax);
Symbols\Source\SourceUserDefinedOperatorSymbolBase.cs (1)
310protected (TypeWithAnnotations ReturnType, ImmutableArray<ParameterSymbol> Parameters) MakeParametersAndBindReturnType(BaseMethodDeclarationSyntax declarationSyntax, TypeSyntax returnTypeSyntax, BindingDiagnosticBag diagnostics)
Syntax.xml.Main.Generated.cs (144)
1525=> node.Update((TypeSyntax?)Visit(node.ElementType) ?? throw new ArgumentNullException("elementType"), VisitList(node.RankSpecifiers)); 1531=> node.Update((TypeSyntax?)Visit(node.ElementType) ?? throw new ArgumentNullException("elementType"), VisitToken(node.AsteriskToken)); 1549=> node.Update((TypeSyntax?)Visit(node.ElementType) ?? throw new ArgumentNullException("elementType"), VisitToken(node.QuestionToken)); 1555=> node.Update((TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type"), VisitToken(node.Identifier)); 1561=> node.Update(VisitToken(node.RefKeyword), VisitToken(node.ReadOnlyKeyword), (TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type")); 1564=> node.Update(VisitToken(node.ScopedKeyword), (TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type")); 1627=> 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)); 1633=> node.Update(VisitToken(node.Keyword), VisitToken(node.OpenParenToken), (TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type"), VisitToken(node.CloseParenToken)); 1636=> node.Update(VisitToken(node.Keyword), VisitToken(node.OpenParenToken), (TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type"), VisitToken(node.CloseParenToken)); 1639=> node.Update(VisitToken(node.Keyword), VisitToken(node.OpenParenToken), (TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type"), VisitToken(node.CloseParenToken)); 1663=> node.Update((TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type"), (VariableDesignationSyntax?)Visit(node.Designation) ?? throw new ArgumentNullException("designation")); 1666=> node.Update(VisitToken(node.OpenParenToken), (TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type"), VisitToken(node.CloseParenToken), (ExpressionSyntax?)Visit(node.Expression) ?? throw new ArgumentNullException("expression")); 1678=> 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)); 1687=> node.Update(VisitToken(node.NewKeyword), (TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type"), (ArgumentListSyntax?)Visit(node.ArgumentList), (InitializerExpressionSyntax?)Visit(node.Initializer)); 1705=> node.Update(VisitToken(node.StackAllocKeyword), (TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type"), (InitializerExpressionSyntax?)Visit(node.Initializer)); 1726=> node.Update(VisitToken(node.FromKeyword), (TypeSyntax?)Visit(node.Type), VisitToken(node.Identifier), VisitToken(node.InKeyword), (ExpressionSyntax?)Visit(node.Expression) ?? throw new ArgumentNullException("expression")); 1732=> 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)); 1774=> node.Update((TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type"), (VariableDesignationSyntax?)Visit(node.Designation) ?? throw new ArgumentNullException("designation")); 1780=> node.Update((TypeSyntax?)Visit(node.Type), (PositionalPatternClauseSyntax?)Visit(node.PositionalPatternClause), (PropertyPatternClauseSyntax?)Visit(node.PropertyPatternClause), (VariableDesignationSyntax?)Visit(node.Designation)); 1801=> node.Update((TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type")); 1834=> 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)); 1840=> node.Update((TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type"), VisitList(node.Variables)); 1894=> 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")); 1948=> node.Update(VisitToken(node.OpenParenToken), (TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type"), VisitToken(node.Identifier), VisitToken(node.CloseParenToken)); 1963=> 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)); 2011=> 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)); 2023=> node.Update((TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type")); 2026=> node.Update((TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type"), (ArgumentListSyntax?)Visit(node.ArgumentList) ?? throw new ArgumentNullException("argumentList")); 2038=> node.Update((TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type")); 2059=> 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)); 2062=> 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)); 2065=> 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)); 2077=> 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)); 2083=> 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)); 2086=> 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)); 2101=> node.Update(VisitList(node.AttributeLists), VisitList(node.Modifiers), (TypeSyntax?)Visit(node.Type), VisitToken(node.Identifier), (EqualsValueClauseSyntax?)Visit(node.Default)); 2104=> node.Update(VisitList(node.AttributeLists), VisitList(node.Modifiers), (TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type")); 2107=> node.Update(VisitList(node.AttributeLists), VisitList(node.Modifiers), (TypeSyntax?)Visit(node.Type)); 2116=> node.Update((TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type")); 2119=> node.Update((TypeSyntax?)Visit(node.Container) ?? throw new ArgumentNullException("container"), VisitToken(node.DotToken), (MemberCrefSyntax?)Visit(node.Member) ?? throw new ArgumentNullException("member")); 2122=> node.Update((TypeSyntax?)Visit(node.Name) ?? throw new ArgumentNullException("name"), (CrefParameterListSyntax?)Visit(node.Parameters)); 2134=> node.Update(VisitToken(node.ImplicitOrExplicitKeyword), VisitToken(node.OperatorKeyword), VisitToken(node.CheckedKeyword), (TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type"), (CrefParameterListSyntax?)Visit(node.Parameters)); 2143=> node.Update(VisitToken(node.RefKindKeyword), VisitToken(node.ReadOnlyKeyword), (TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type")); 2293public static TypeArgumentListSyntax TypeArgumentList(SyntaxToken lessThanToken, SeparatedSyntaxList<TypeSyntax> arguments, SyntaxToken greaterThanToken) 2301public static TypeArgumentListSyntax TypeArgumentList(SeparatedSyntaxList<TypeSyntax> arguments = default) 2348public static ArrayTypeSyntax ArrayType(TypeSyntax elementType, SyntaxList<ArrayRankSpecifierSyntax> rankSpecifiers) 2355public static ArrayTypeSyntax ArrayType(TypeSyntax elementType) 2371public static PointerTypeSyntax PointerType(TypeSyntax elementType, SyntaxToken asteriskToken) 2379public static PointerTypeSyntax PointerType(TypeSyntax elementType) 2447public static NullableTypeSyntax NullableType(TypeSyntax elementType, SyntaxToken questionToken) 2455public static NullableTypeSyntax NullableType(TypeSyntax elementType) 2471public static TupleElementSyntax TupleElement(TypeSyntax type, SyntaxToken identifier) 2484public static TupleElementSyntax TupleElement(TypeSyntax type) 2499public static RefTypeSyntax RefType(SyntaxToken refKeyword, SyntaxToken readOnlyKeyword, TypeSyntax type) 2513public static RefTypeSyntax RefType(TypeSyntax type) 2517public static ScopedTypeSyntax ScopedType(SyntaxToken scopedKeyword, TypeSyntax type) 2525public static ScopedTypeSyntax ScopedType(TypeSyntax type) 3015public static RefValueExpressionSyntax RefValueExpression(SyntaxToken keyword, SyntaxToken openParenToken, ExpressionSyntax expression, SyntaxToken comma, TypeSyntax type, SyntaxToken closeParenToken) 3027public static RefValueExpressionSyntax RefValueExpression(ExpressionSyntax expression, TypeSyntax type) 3064public static DefaultExpressionSyntax DefaultExpression(SyntaxToken keyword, SyntaxToken openParenToken, TypeSyntax type, SyntaxToken closeParenToken) 3074public static DefaultExpressionSyntax DefaultExpression(TypeSyntax type) 3078public static TypeOfExpressionSyntax TypeOfExpression(SyntaxToken keyword, SyntaxToken openParenToken, TypeSyntax type, SyntaxToken closeParenToken) 3088public static TypeOfExpressionSyntax TypeOfExpression(TypeSyntax type) 3092public static SizeOfExpressionSyntax SizeOfExpression(SyntaxToken keyword, SyntaxToken openParenToken, TypeSyntax type, SyntaxToken closeParenToken) 3102public static SizeOfExpressionSyntax SizeOfExpression(TypeSyntax type) 3189public static DeclarationExpressionSyntax DeclarationExpression(TypeSyntax type, VariableDesignationSyntax designation) 3197public static CastExpressionSyntax CastExpression(SyntaxToken openParenToken, TypeSyntax type, SyntaxToken closeParenToken, ExpressionSyntax expression) 3207public static CastExpressionSyntax CastExpression(TypeSyntax type, ExpressionSyntax expression) 3239public static ParenthesizedLambdaExpressionSyntax ParenthesizedLambdaExpression(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax? returnType, ParameterListSyntax parameterList, SyntaxToken arrowToken, BlockSyntax? block, ExpressionSyntax? expressionBody) 3247public static ParenthesizedLambdaExpressionSyntax ParenthesizedLambdaExpression(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax? returnType, ParameterListSyntax parameterList, BlockSyntax? block, ExpressionSyntax? expressionBody) 3292public static ObjectCreationExpressionSyntax ObjectCreationExpression(SyntaxToken newKeyword, TypeSyntax type, ArgumentListSyntax? argumentList, InitializerExpressionSyntax? initializer) 3300public static ObjectCreationExpressionSyntax ObjectCreationExpression(TypeSyntax type, ArgumentListSyntax? argumentList, InitializerExpressionSyntax? initializer) 3304public static ObjectCreationExpressionSyntax ObjectCreationExpression(TypeSyntax type) 3379public static StackAllocArrayCreationExpressionSyntax StackAllocArrayCreationExpression(SyntaxToken stackAllocKeyword, TypeSyntax type, InitializerExpressionSyntax? initializer) 3387public static StackAllocArrayCreationExpressionSyntax StackAllocArrayCreationExpression(TypeSyntax type, InitializerExpressionSyntax? initializer) 3391public static StackAllocArrayCreationExpressionSyntax StackAllocArrayCreationExpression(TypeSyntax type) 3459public static FromClauseSyntax FromClause(SyntaxToken fromKeyword, TypeSyntax? type, SyntaxToken identifier, SyntaxToken inKeyword, ExpressionSyntax expression) 3469public static FromClauseSyntax FromClause(TypeSyntax? type, SyntaxToken identifier, ExpressionSyntax expression) 3499public static JoinClauseSyntax JoinClause(SyntaxToken joinKeyword, TypeSyntax? type, SyntaxToken identifier, SyntaxToken inKeyword, ExpressionSyntax inExpression, SyntaxToken onKeyword, ExpressionSyntax leftExpression, SyntaxToken equalsKeyword, ExpressionSyntax rightExpression, JoinIntoClauseSyntax? into) 3513public static JoinClauseSyntax JoinClause(TypeSyntax? type, SyntaxToken identifier, ExpressionSyntax inExpression, ExpressionSyntax leftExpression, ExpressionSyntax rightExpression, JoinIntoClauseSyntax? into) 3722public static DeclarationPatternSyntax DeclarationPattern(TypeSyntax type, VariableDesignationSyntax designation) 3742public static RecursivePatternSyntax RecursivePattern(TypeSyntax? type, PositionalPatternClauseSyntax? positionalPatternClause, PropertyPatternClauseSyntax? propertyPatternClause, VariableDesignationSyntax? designation) 3824public static TypePatternSyntax TypePattern(TypeSyntax type) 3977public 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) 3992public static LocalFunctionStatementSyntax LocalFunctionStatement(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax returnType, SyntaxToken identifier, TypeParameterListSyntax? typeParameterList, ParameterListSyntax parameterList, SyntaxList<TypeParameterConstraintClauseSyntax> constraintClauses, BlockSyntax? body, ArrowExpressionClauseSyntax? expressionBody) 3996public static LocalFunctionStatementSyntax LocalFunctionStatement(TypeSyntax returnType, SyntaxToken identifier) 4000public static LocalFunctionStatementSyntax LocalFunctionStatement(TypeSyntax returnType, string identifier) 4032public static VariableDeclarationSyntax VariableDeclaration(TypeSyntax type, SeparatedSyntaxList<VariableDeclaratorSyntax> variables) 4039public static VariableDeclarationSyntax VariableDeclaration(TypeSyntax type) 4350public static ForEachStatementSyntax ForEachStatement(SyntaxList<AttributeListSyntax> attributeLists, SyntaxToken awaitKeyword, SyntaxToken forEachKeyword, SyntaxToken openParenToken, TypeSyntax type, SyntaxToken identifier, SyntaxToken inKeyword, ExpressionSyntax expression, SyntaxToken closeParenToken, StatementSyntax statement) 4370public static ForEachStatementSyntax ForEachStatement(SyntaxList<AttributeListSyntax> attributeLists, TypeSyntax type, SyntaxToken identifier, ExpressionSyntax expression, StatementSyntax statement) 4374public static ForEachStatementSyntax ForEachStatement(TypeSyntax type, SyntaxToken identifier, ExpressionSyntax expression, StatementSyntax statement) 4378public static ForEachStatementSyntax ForEachStatement(TypeSyntax type, string identifier, ExpressionSyntax expression, StatementSyntax statement) 4700public static CatchDeclarationSyntax CatchDeclaration(SyntaxToken openParenToken, TypeSyntax type, SyntaxToken identifier, SyntaxToken closeParenToken) 4715public static CatchDeclarationSyntax CatchDeclaration(TypeSyntax type, SyntaxToken identifier) 4719public static CatchDeclarationSyntax CatchDeclaration(TypeSyntax type) 4782public static UsingDirectiveSyntax UsingDirective(SyntaxToken globalKeyword, SyntaxToken usingKeyword, SyntaxToken staticKeyword, SyntaxToken unsafeKeyword, NameEqualsSyntax? alias, TypeSyntax namespaceOrType, SyntaxToken semicolonToken) 4809public static UsingDirectiveSyntax UsingDirective(NameEqualsSyntax? alias, TypeSyntax namespaceOrType) 4813public static UsingDirectiveSyntax UsingDirective(TypeSyntax namespaceOrType) 5131public static DelegateDeclarationSyntax DelegateDeclaration(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, SyntaxToken delegateKeyword, TypeSyntax returnType, SyntaxToken identifier, TypeParameterListSyntax? typeParameterList, ParameterListSyntax parameterList, SyntaxList<TypeParameterConstraintClauseSyntax> constraintClauses, SyntaxToken semicolonToken) 5142public static DelegateDeclarationSyntax DelegateDeclaration(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax returnType, SyntaxToken identifier, TypeParameterListSyntax? typeParameterList, ParameterListSyntax parameterList, SyntaxList<TypeParameterConstraintClauseSyntax> constraintClauses) 5146public static DelegateDeclarationSyntax DelegateDeclaration(TypeSyntax returnType, SyntaxToken identifier) 5150public static DelegateDeclarationSyntax DelegateDeclaration(TypeSyntax returnType, string identifier) 5213public static SimpleBaseTypeSyntax SimpleBaseType(TypeSyntax type) 5220public static PrimaryConstructorBaseTypeSyntax PrimaryConstructorBaseType(TypeSyntax type, ArgumentListSyntax argumentList) 5228public static PrimaryConstructorBaseTypeSyntax PrimaryConstructorBaseType(TypeSyntax type) 5302public static TypeConstraintSyntax TypeConstraint(TypeSyntax type) 5388public 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) 5403public 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) 5407public static MethodDeclarationSyntax MethodDeclaration(TypeSyntax returnType, SyntaxToken identifier) 5411public static MethodDeclarationSyntax MethodDeclaration(TypeSyntax returnType, string identifier) 5415public 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) 5475public static OperatorDeclarationSyntax OperatorDeclaration(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax returnType, ExplicitInterfaceSpecifierSyntax? explicitInterfaceSpecifier, SyntaxToken operatorToken, ParameterListSyntax parameterList, BlockSyntax? body, ArrowExpressionClauseSyntax? expressionBody) 5479public static OperatorDeclarationSyntax OperatorDeclaration(TypeSyntax returnType, SyntaxToken operatorToken) 5483public 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) 5510public static ConversionOperatorDeclarationSyntax ConversionOperatorDeclaration(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, SyntaxToken implicitOrExplicitKeyword, ExplicitInterfaceSpecifierSyntax? explicitInterfaceSpecifier, TypeSyntax type, ParameterListSyntax parameterList, BlockSyntax? body, ArrowExpressionClauseSyntax? expressionBody) 5514public static ConversionOperatorDeclarationSyntax ConversionOperatorDeclaration(SyntaxToken implicitOrExplicitKeyword, TypeSyntax type) 5603public static PropertyDeclarationSyntax PropertyDeclaration(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax type, ExplicitInterfaceSpecifierSyntax? explicitInterfaceSpecifier, SyntaxToken identifier, AccessorListSyntax? accessorList, ArrowExpressionClauseSyntax? expressionBody, EqualsValueClauseSyntax? initializer, SyntaxToken semicolonToken) 5617public static PropertyDeclarationSyntax PropertyDeclaration(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax type, ExplicitInterfaceSpecifierSyntax? explicitInterfaceSpecifier, SyntaxToken identifier, AccessorListSyntax? accessorList, ArrowExpressionClauseSyntax? expressionBody, EqualsValueClauseSyntax? initializer) 5621public static PropertyDeclarationSyntax PropertyDeclaration(TypeSyntax type, SyntaxToken identifier) 5625public static PropertyDeclarationSyntax PropertyDeclaration(TypeSyntax type, string identifier) 5641public static EventDeclarationSyntax EventDeclaration(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, SyntaxToken eventKeyword, TypeSyntax type, ExplicitInterfaceSpecifierSyntax? explicitInterfaceSpecifier, SyntaxToken identifier, AccessorListSyntax? accessorList, SyntaxToken semicolonToken) 5656public static EventDeclarationSyntax EventDeclaration(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax type, ExplicitInterfaceSpecifierSyntax? explicitInterfaceSpecifier, SyntaxToken identifier, AccessorListSyntax? accessorList) 5660public static EventDeclarationSyntax EventDeclaration(TypeSyntax type, SyntaxToken identifier) 5664public static EventDeclarationSyntax EventDeclaration(TypeSyntax type, string identifier) 5668public static IndexerDeclarationSyntax IndexerDeclaration(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax type, ExplicitInterfaceSpecifierSyntax? explicitInterfaceSpecifier, SyntaxToken thisKeyword, BracketedParameterListSyntax parameterList, AccessorListSyntax? accessorList, ArrowExpressionClauseSyntax? expressionBody, SyntaxToken semicolonToken) 5683public static IndexerDeclarationSyntax IndexerDeclaration(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax type, ExplicitInterfaceSpecifierSyntax? explicitInterfaceSpecifier, BracketedParameterListSyntax parameterList, AccessorListSyntax? accessorList, ArrowExpressionClauseSyntax? expressionBody) 5687public static IndexerDeclarationSyntax IndexerDeclaration(TypeSyntax type) 5779public static ParameterSyntax Parameter(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax? type, SyntaxToken identifier, EqualsValueClauseSyntax? @default) 5792public static FunctionPointerParameterSyntax FunctionPointerParameter(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax type) 5799public static FunctionPointerParameterSyntax FunctionPointerParameter(TypeSyntax type) 5803public static IncompleteMemberSyntax IncompleteMember(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax? type) 5810public static IncompleteMemberSyntax IncompleteMember(TypeSyntax? type = default) 5842public static TypeCrefSyntax TypeCref(TypeSyntax type) 5849public static QualifiedCrefSyntax QualifiedCref(TypeSyntax container, SyntaxToken dotToken, MemberCrefSyntax member) 5858public static QualifiedCrefSyntax QualifiedCref(TypeSyntax container, MemberCrefSyntax member) 5862public static NameMemberCrefSyntax NameMemberCref(TypeSyntax name, CrefParameterListSyntax? parameters) 5869public static NameMemberCrefSyntax NameMemberCref(TypeSyntax name) 5961public static ConversionOperatorMemberCrefSyntax ConversionOperatorMemberCref(SyntaxToken implicitOrExplicitKeyword, SyntaxToken operatorKeyword, SyntaxToken checkedKeyword, TypeSyntax type, CrefParameterListSyntax? parameters) 5981public static ConversionOperatorMemberCrefSyntax ConversionOperatorMemberCref(SyntaxToken implicitOrExplicitKeyword, TypeSyntax type, CrefParameterListSyntax? parameters) 5985public static ConversionOperatorMemberCrefSyntax ConversionOperatorMemberCref(SyntaxToken implicitOrExplicitKeyword, TypeSyntax type) 6013public static CrefParameterSyntax CrefParameter(SyntaxToken refKindKeyword, SyntaxToken readOnlyKeyword, TypeSyntax type) 6034public static CrefParameterSyntax CrefParameter(SyntaxToken refKindKeyword, TypeSyntax type) 6038public static CrefParameterSyntax CrefParameter(TypeSyntax type)
Syntax.xml.Syntax.Generated.cs (195)
185public GenericNameSyntax AddTypeArgumentListArguments(params TypeSyntax[] items) => WithTypeArgumentList(this.TypeArgumentList.WithArguments(this.TypeArgumentList.Arguments.AddRange(items))); 208public SeparatedSyntaxList<TypeSyntax> Arguments 213return red != null ? new SeparatedSyntaxList<TypeSyntax>(red, GetChildIndex(1)) : default; 227public TypeArgumentListSyntax Update(SyntaxToken lessThanToken, SeparatedSyntaxList<TypeSyntax> arguments, SyntaxToken greaterThanToken) 240public TypeArgumentListSyntax WithArguments(SeparatedSyntaxList<TypeSyntax> arguments) => Update(this.LessThanToken, arguments, this.GreaterThanToken); 243public TypeArgumentListSyntax AddArguments(params TypeSyntax[] items) => WithArguments(this.Arguments.AddRange(items)); 366private TypeSyntax? elementType; 375public TypeSyntax ElementType => GetRedAtZero(ref this.elementType)!; 399public ArrayTypeSyntax Update(TypeSyntax elementType, SyntaxList<ArrayRankSpecifierSyntax> rankSpecifiers) 411public ArrayTypeSyntax WithElementType(TypeSyntax elementType) => Update(elementType, this.RankSpecifiers); 480private TypeSyntax? elementType; 488public TypeSyntax ElementType => GetRedAtZero(ref this.elementType)!; 500public PointerTypeSyntax Update(TypeSyntax elementType, SyntaxToken asteriskToken) 512public PointerTypeSyntax WithElementType(TypeSyntax elementType) => Update(elementType, this.AsteriskToken); 799private TypeSyntax? elementType; 807public TypeSyntax ElementType => GetRedAtZero(ref this.elementType)!; 819public NullableTypeSyntax Update(TypeSyntax elementType, SyntaxToken questionToken) 831public NullableTypeSyntax WithElementType(TypeSyntax elementType) => Update(elementType, this.QuestionToken); 901private TypeSyntax? type; 909public TypeSyntax Type => GetRedAtZero(ref this.type)!; 928public TupleElementSyntax Update(TypeSyntax type, SyntaxToken identifier) 940public TupleElementSyntax WithType(TypeSyntax type) => Update(type, this.Identifier); 993private TypeSyntax? type; 1012public TypeSyntax Type => GetRed(ref this.type, 2)!; 1021public RefTypeSyntax Update(SyntaxToken refKeyword, SyntaxToken readOnlyKeyword, TypeSyntax type) 1035public RefTypeSyntax WithType(TypeSyntax type) => Update(this.RefKeyword, this.ReadOnlyKeyword, type); 1047private TypeSyntax? type; 1056public TypeSyntax Type => GetRed(ref this.type, 1)!; 1065public ScopedTypeSyntax Update(SyntaxToken scopedKeyword, TypeSyntax type) 1078public ScopedTypeSyntax WithType(TypeSyntax type) => Update(this.ScopedKeyword, type); 2191private TypeSyntax? type; 2211public TypeSyntax Type => GetRed(ref this.type, 4)!; 2235public RefValueExpressionSyntax Update(SyntaxToken keyword, SyntaxToken openParenToken, ExpressionSyntax expression, SyntaxToken comma, TypeSyntax type, SyntaxToken closeParenToken) 2251public RefValueExpressionSyntax WithType(TypeSyntax type) => Update(this.Keyword, this.OpenParenToken, this.Expression, this.Comma, type, this.CloseParenToken); 2318private TypeSyntax? type; 2332public TypeSyntax Type => GetRed(ref this.type, 2)!; 2344public DefaultExpressionSyntax Update(SyntaxToken keyword, SyntaxToken openParenToken, TypeSyntax type, SyntaxToken closeParenToken) 2358public DefaultExpressionSyntax WithType(TypeSyntax type) => Update(this.Keyword, this.OpenParenToken, type, this.CloseParenToken); 2371private TypeSyntax? type; 2385public TypeSyntax Type => GetRed(ref this.type, 2)!; 2397public TypeOfExpressionSyntax Update(SyntaxToken keyword, SyntaxToken openParenToken, TypeSyntax type, SyntaxToken closeParenToken) 2411public TypeOfExpressionSyntax WithType(TypeSyntax type) => Update(this.Keyword, this.OpenParenToken, type, this.CloseParenToken); 2424private TypeSyntax? type; 2438public TypeSyntax Type => GetRed(ref this.type, 2)!; 2450public SizeOfExpressionSyntax Update(SyntaxToken keyword, SyntaxToken openParenToken, TypeSyntax type, SyntaxToken closeParenToken) 2464public SizeOfExpressionSyntax WithType(TypeSyntax type) => Update(this.Keyword, this.OpenParenToken, type, this.CloseParenToken); 2909private TypeSyntax? type; 2917public TypeSyntax Type => GetRedAtZero(ref this.type)!; 2941public DeclarationExpressionSyntax Update(TypeSyntax type, VariableDesignationSyntax designation) 2953public DeclarationExpressionSyntax WithType(TypeSyntax type) => Update(type, this.Designation); 2966private TypeSyntax? type; 2978public TypeSyntax Type => GetRed(ref this.type, 1)!; 3005public CastExpressionSyntax Update(SyntaxToken openParenToken, TypeSyntax type, SyntaxToken closeParenToken, ExpressionSyntax expression) 3018public CastExpressionSyntax WithType(TypeSyntax type) => Update(this.OpenParenToken, type, this.CloseParenToken, this.Expression); 3359private TypeSyntax? returnType; 3380public TypeSyntax? ReturnType => GetRed(ref this.returnType, 2); 3425public ParenthesizedLambdaExpressionSyntax Update(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax? returnType, ParameterListSyntax parameterList, SyntaxToken arrowToken, BlockSyntax? block, ExpressionSyntax? expressionBody) 3441public ParenthesizedLambdaExpressionSyntax WithReturnType(TypeSyntax? returnType) => Update(this.AttributeLists, this.Modifiers, returnType, this.ParameterList, this.ArrowToken, this.Block, this.ExpressionBody); 3634private TypeSyntax? type; 3647public TypeSyntax Type => GetRed(ref this.type, 1)!; 3676public ObjectCreationExpressionSyntax Update(SyntaxToken newKeyword, TypeSyntax type, ArgumentListSyntax? argumentList, InitializerExpressionSyntax? initializer) 3690public ObjectCreationExpressionSyntax WithType(TypeSyntax type) => Update(this.NewKeyword, type, this.ArgumentList, this.Initializer); 4024private TypeSyntax? type; 4036public TypeSyntax Type => GetRed(ref this.type, 1)!; 4060public StackAllocArrayCreationExpressionSyntax Update(SyntaxToken stackAllocKeyword, TypeSyntax type, InitializerExpressionSyntax? initializer) 4073public StackAllocArrayCreationExpressionSyntax WithType(TypeSyntax type) => Update(this.StackAllocKeyword, type, this.Initializer); 4420private TypeSyntax? type; 4430public TypeSyntax? Type => GetRed(ref this.type, 1); 4458public FromClauseSyntax Update(SyntaxToken fromKeyword, TypeSyntax? type, SyntaxToken identifier, SyntaxToken inKeyword, ExpressionSyntax expression) 4471public FromClauseSyntax WithType(TypeSyntax? type) => Update(this.FromKeyword, type, this.Identifier, this.InKeyword, this.Expression); 4534private TypeSyntax? type; 4547public TypeSyntax? Type => GetRed(ref this.type, 1); 4591public JoinClauseSyntax Update(SyntaxToken joinKeyword, TypeSyntax? type, SyntaxToken identifier, SyntaxToken inKeyword, ExpressionSyntax inExpression, SyntaxToken onKeyword, ExpressionSyntax leftExpression, SyntaxToken equalsKeyword, ExpressionSyntax rightExpression, JoinIntoClauseSyntax? into) 4604public JoinClauseSyntax WithType(TypeSyntax? type) => Update(this.JoinKeyword, type, this.Identifier, this.InKeyword, this.InExpression, this.OnKeyword, this.LeftExpression, this.EqualsKeyword, this.RightExpression, this.Into); 5240private TypeSyntax? type; 5248public TypeSyntax Type => GetRedAtZero(ref this.type)!; 5271public DeclarationPatternSyntax Update(TypeSyntax type, VariableDesignationSyntax designation) 5283public DeclarationPatternSyntax WithType(TypeSyntax type) => Update(type, this.Designation); 5337private TypeSyntax? type; 5347public TypeSyntax? Type => GetRedAtZero(ref this.type); 5378public RecursivePatternSyntax Update(TypeSyntax? type, PositionalPatternClauseSyntax? positionalPatternClause, PropertyPatternClauseSyntax? propertyPatternClause, VariableDesignationSyntax? designation) 5390public RecursivePatternSyntax WithType(TypeSyntax? type) => Update(type, this.PositionalPatternClause, this.PropertyPatternClause, this.Designation); 5706private TypeSyntax? type; 5714public TypeSyntax Type => GetRedAtZero(ref this.type)!; 5723public TypePatternSyntax Update(TypeSyntax type) 5735public TypePatternSyntax WithType(TypeSyntax type) => Update(type); 6316private TypeSyntax? returnType; 6339public TypeSyntax ReturnType => GetRed(ref this.returnType, 2)!; 6393public LocalFunctionStatementSyntax Update(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax returnType, SyntaxToken identifier, TypeParameterListSyntax? typeParameterList, ParameterListSyntax parameterList, SyntaxList<TypeParameterConstraintClauseSyntax> constraintClauses, BlockSyntax? body, ArrowExpressionClauseSyntax? expressionBody, SyntaxToken semicolonToken) 6408public LocalFunctionStatementSyntax WithReturnType(TypeSyntax returnType) => Update(this.AttributeLists, this.Modifiers, returnType, this.Identifier, this.TypeParameterList, this.ParameterList, this.ConstraintClauses, this.Body, this.ExpressionBody, this.SemicolonToken); 6542private TypeSyntax? type; 6550public TypeSyntax Type => GetRedAtZero(ref this.type)!; 6580public VariableDeclarationSyntax Update(TypeSyntax type, SeparatedSyntaxList<VariableDeclaratorSyntax> variables) 6592public VariableDeclarationSyntax WithType(TypeSyntax type) => Update(type, this.Variables); 7725private TypeSyntax? type; 7749public TypeSyntax Type => GetRed(ref this.type, 4)!; 7785public ForEachStatementSyntax Update(SyntaxList<AttributeListSyntax> attributeLists, SyntaxToken awaitKeyword, SyntaxToken forEachKeyword, SyntaxToken openParenToken, TypeSyntax type, SyntaxToken identifier, SyntaxToken inKeyword, ExpressionSyntax expression, SyntaxToken closeParenToken, StatementSyntax statement) 7805public ForEachStatementSyntax WithType(TypeSyntax type) => Update(this.AttributeLists, this.AwaitKeyword, this.ForEachKeyword, this.OpenParenToken, type, this.Identifier, this.InKeyword, this.Expression, this.CloseParenToken, this.Statement); 9100private TypeSyntax? type; 9109public TypeSyntax Type => GetRed(ref this.type, 1)!; 9129public CatchDeclarationSyntax Update(SyntaxToken openParenToken, TypeSyntax type, SyntaxToken identifier, SyntaxToken closeParenToken) 9142public CatchDeclarationSyntax WithType(TypeSyntax type) => Update(this.OpenParenToken, type, this.Identifier, this.CloseParenToken); 9379private TypeSyntax? namespaceOrType; 9417public TypeSyntax NamespaceOrType => GetRed(ref this.namespaceOrType, 5)!; 9440public UsingDirectiveSyntax Update(SyntaxToken globalKeyword, SyntaxToken usingKeyword, SyntaxToken staticKeyword, SyntaxToken unsafeKeyword, NameEqualsSyntax? alias, TypeSyntax namespaceOrType, SyntaxToken semicolonToken) 9457public UsingDirectiveSyntax WithNamespaceOrType(TypeSyntax namespaceOrType) => Update(this.GlobalKeyword, this.UsingKeyword, this.StaticKeyword, this.UnsafeKeyword, this.Alias, namespaceOrType, this.SemicolonToken); 11136private TypeSyntax? returnType; 11161public TypeSyntax ReturnType => GetRed(ref this.returnType, 3)!; 11202public DelegateDeclarationSyntax Update(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, SyntaxToken delegateKeyword, TypeSyntax returnType, SyntaxToken identifier, TypeParameterListSyntax? typeParameterList, ParameterListSyntax parameterList, SyntaxList<TypeParameterConstraintClauseSyntax> constraintClauses, SyntaxToken semicolonToken) 11219public DelegateDeclarationSyntax WithReturnType(TypeSyntax returnType) => Update(this.AttributeLists, this.Modifiers, this.DelegateKeyword, returnType, this.Identifier, this.TypeParameterList, this.ParameterList, this.ConstraintClauses, this.SemicolonToken); 11525public abstract TypeSyntax Type { get; } 11526public BaseTypeSyntax WithType(TypeSyntax type) => WithTypeCore(type); 11527internal abstract BaseTypeSyntax WithTypeCore(TypeSyntax type); 11538private TypeSyntax? type; 11545public override TypeSyntax Type => GetRedAtZero(ref this.type)!; 11554public SimpleBaseTypeSyntax Update(TypeSyntax type) 11566internal override BaseTypeSyntax WithTypeCore(TypeSyntax type) => WithType(type); 11567public new SimpleBaseTypeSyntax WithType(TypeSyntax type) => Update(type); 11578private TypeSyntax? type; 11586public override TypeSyntax Type => GetRedAtZero(ref this.type)!; 11609public PrimaryConstructorBaseTypeSyntax Update(TypeSyntax type, ArgumentListSyntax argumentList) 11621internal override BaseTypeSyntax WithTypeCore(TypeSyntax type) => WithType(type); 11622public new PrimaryConstructorBaseTypeSyntax WithType(TypeSyntax type) => Update(type, this.ArgumentList); 11820private TypeSyntax? type; 11828public TypeSyntax Type => GetRedAtZero(ref this.type)!; 11837public TypeConstraintSyntax Update(TypeSyntax type) 11849public TypeConstraintSyntax WithType(TypeSyntax type) => Update(type); 12280private TypeSyntax? returnType; 12305public TypeSyntax ReturnType => GetRed(ref this.returnType, 2)!; 12364public 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) 12380public 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); 12430private TypeSyntax? returnType; 12453public TypeSyntax ReturnType => GetRed(ref this.returnType, 2)!; 12516public 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) 12532public 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); 12577private TypeSyntax? type; 12617public TypeSyntax Type => GetRed(ref this.type, 6)!; 12662public 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) 12682public 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); 13018public abstract TypeSyntax Type { get; } 13019public BasePropertyDeclarationSyntax WithType(TypeSyntax type) => WithTypeCore(type); 13020internal abstract BasePropertyDeclarationSyntax WithTypeCore(TypeSyntax type); 13051private TypeSyntax? type; 13073public override TypeSyntax Type => GetRed(ref this.type, 2)!; 13122public PropertyDeclarationSyntax Update(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax type, ExplicitInterfaceSpecifierSyntax? explicitInterfaceSpecifier, SyntaxToken identifier, AccessorListSyntax? accessorList, ArrowExpressionClauseSyntax? expressionBody, EqualsValueClauseSyntax? initializer, SyntaxToken semicolonToken) 13138internal override BasePropertyDeclarationSyntax WithTypeCore(TypeSyntax type) => WithType(type); 13139public new PropertyDeclarationSyntax WithType(TypeSyntax type) => Update(this.AttributeLists, this.Modifiers, type, this.ExplicitInterfaceSpecifier, this.Identifier, this.AccessorList, this.ExpressionBody, this.Initializer, this.SemicolonToken); 13213private TypeSyntax? type; 13235public override TypeSyntax Type => GetRed(ref this.type, 3)!; 13276public EventDeclarationSyntax Update(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, SyntaxToken eventKeyword, TypeSyntax type, ExplicitInterfaceSpecifierSyntax? explicitInterfaceSpecifier, SyntaxToken identifier, AccessorListSyntax? accessorList, SyntaxToken semicolonToken) 13293internal override BasePropertyDeclarationSyntax WithTypeCore(TypeSyntax type) => WithType(type); 13294public new EventDeclarationSyntax WithType(TypeSyntax type) => Update(this.AttributeLists, this.Modifiers, this.EventKeyword, type, this.ExplicitInterfaceSpecifier, this.Identifier, this.AccessorList, this.SemicolonToken); 13323private TypeSyntax? type; 13345public override TypeSyntax Type => GetRed(ref this.type, 2)!; 13394public IndexerDeclarationSyntax Update(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax type, ExplicitInterfaceSpecifierSyntax? explicitInterfaceSpecifier, SyntaxToken thisKeyword, BracketedParameterListSyntax parameterList, AccessorListSyntax? accessorList, ArrowExpressionClauseSyntax? expressionBody, SyntaxToken semicolonToken) 13410internal override BasePropertyDeclarationSyntax WithTypeCore(TypeSyntax type) => WithType(type); 13411public new IndexerDeclarationSyntax WithType(TypeSyntax type) => Update(this.AttributeLists, this.Modifiers, type, this.ExplicitInterfaceSpecifier, this.ThisKeyword, this.ParameterList, this.AccessorList, this.ExpressionBody, this.SemicolonToken); 13748public abstract TypeSyntax? Type { get; } 13749public BaseParameterSyntax WithType(TypeSyntax? type) => WithTypeCore(type); 13750internal abstract BaseParameterSyntax WithTypeCore(TypeSyntax? type); 13763private TypeSyntax? type; 13784public override TypeSyntax? Type => GetRed(ref this.type, 2); 13819public ParameterSyntax Update(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax? type, SyntaxToken identifier, EqualsValueClauseSyntax? @default) 13835internal override BaseParameterSyntax WithTypeCore(TypeSyntax? type) => WithType(type); 13836public new ParameterSyntax WithType(TypeSyntax? type) => Update(this.AttributeLists, this.Modifiers, type, this.Identifier, this.Default); 13856private TypeSyntax? type; 13876public override TypeSyntax Type => GetRed(ref this.type, 2)!; 13897public FunctionPointerParameterSyntax Update(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax type) 13913internal override BaseParameterSyntax WithTypeCore(TypeSyntax? type) => WithType(type ?? throw new ArgumentNullException(nameof(type))); 13914public new FunctionPointerParameterSyntax WithType(TypeSyntax type) => Update(this.AttributeLists, this.Modifiers, type); 13931private TypeSyntax? type; 13949public TypeSyntax? Type => GetRed(ref this.type, 2); 13970public IncompleteMemberSyntax Update(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, TypeSyntax? type) 13986public IncompleteMemberSyntax WithType(TypeSyntax? type) => Update(this.AttributeLists, this.Modifiers, type); 14113private TypeSyntax? type; 14120public TypeSyntax Type => GetRedAtZero(ref this.type)!; 14129public TypeCrefSyntax Update(TypeSyntax type) 14141public TypeCrefSyntax WithType(TypeSyntax type) => Update(type); 14159private TypeSyntax? container; 14167public TypeSyntax Container => GetRedAtZero(ref this.container)!; 14192public QualifiedCrefSyntax Update(TypeSyntax container, SyntaxToken dotToken, MemberCrefSyntax member) 14204public QualifiedCrefSyntax WithContainer(TypeSyntax container) => Update(container, this.DotToken, this.Member); 14238private TypeSyntax? name; 14246public TypeSyntax Name => GetRedAtZero(ref this.name)!; 14269public NameMemberCrefSyntax Update(TypeSyntax name, CrefParameterListSyntax? parameters) 14281public NameMemberCrefSyntax WithName(TypeSyntax name) => Update(name, this.Parameters); 14357public ExtensionMemberCrefSyntax AddTypeArgumentListArguments(params TypeSyntax[] items) 14496private TypeSyntax? type; 14517public TypeSyntax Type => GetRed(ref this.type, 3)!; 14540public ConversionOperatorMemberCrefSyntax Update(SyntaxToken implicitOrExplicitKeyword, SyntaxToken operatorKeyword, SyntaxToken checkedKeyword, TypeSyntax type, CrefParameterListSyntax? parameters) 14555public ConversionOperatorMemberCrefSyntax WithType(TypeSyntax type) => Update(this.ImplicitOrExplicitKeyword, this.OperatorKeyword, this.CheckedKeyword, type, this.Parameters); 14721private TypeSyntax? type; 14746public TypeSyntax Type => GetRed(ref this.type, 2)!; 14755public CrefParameterSyntax Update(SyntaxToken refKindKeyword, SyntaxToken readOnlyKeyword, TypeSyntax type) 14769public CrefParameterSyntax WithType(TypeSyntax type) => Update(this.RefKindKeyword, this.ReadOnlyKeyword, type);
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)
1704public static TypeSyntax ParseTypeName(string text, int offset, bool consumeFullText) 1712public static TypeSyntax ParseTypeName(string text, int offset = 0, ParseOptions? options = null, bool consumeFullText = true) 1719return CreateRed<TypeSyntax>(node, lexer.Options); 2073internal static TypeSyntax? GetStandaloneType(TypeSyntax? node) 2462TypeSyntax type, 2483TypeSyntax type, 2504TypeSyntax type, 2527TypeSyntax type, 2550TypeSyntax type, 2574TypeSyntax returnType, 2597TypeSyntax returnType, 2622TypeSyntax returnType, 2643TypeSyntax returnType, 2718public static EventDeclarationSyntax EventDeclaration(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, SyntaxToken eventKeyword, TypeSyntax type, ExplicitInterfaceSpecifierSyntax explicitInterfaceSpecifier, SyntaxToken identifier, AccessorListSyntax accessorList) 2724public static EventDeclarationSyntax EventDeclaration(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, SyntaxToken eventKeyword, TypeSyntax type, ExplicitInterfaceSpecifierSyntax explicitInterfaceSpecifier, SyntaxToken identifier, SyntaxToken semicolonToken) 2855public static ConversionOperatorMemberCrefSyntax ConversionOperatorMemberCref(SyntaxToken implicitOrExplicitKeyword, SyntaxToken operatorKeyword, TypeSyntax type, CrefParameterListSyntax? parameters)
Syntax\SyntaxNodeExtensions.cs (12)
222internal static RefKind GetRefKindInLocalOrReturn(this TypeSyntax syntax, BindingDiagnosticBag diagnostics) 235internal static TypeSyntax SkipRef(this TypeSyntax syntax) 238internal static TypeSyntax SkipRefInField(this TypeSyntax syntax, out RefKind refKind) 245internal static TypeSyntax SkipRefInLocalOrReturn(this TypeSyntax syntax, BindingDiagnosticBag? diagnostics, out RefKind refKind) 248private static TypeSyntax SkipRefWorker(TypeSyntax syntax, BindingDiagnosticBag? diagnostics, out RefKind refKind) 260var current = syntax; 287internal static TypeSyntax SkipScoped(this TypeSyntax syntax, out bool isScoped)
Syntax\SyntaxNormalizer.cs (1)
700if (token.Parent.IsKind(SyntaxKind.ConditionalExpression) || token.Parent is TypeSyntax)
Microsoft.CodeAnalysis.CSharp.Analyzers (2)
MetaAnalyzers\CSharpDiagnosticAnalyzerAPIUsageAnalyzer.cs (1)
12public class CSharpDiagnosticAnalyzerApiUsageAnalyzer : DiagnosticAnalyzerApiUsageAnalyzer<TypeSyntax>
MetaAnalyzers\CSharpDiagnosticAnalyzerFieldsAnalyzer.cs (1)
12public class CSharpDiagnosticAnalyzerFieldsAnalyzer : DiagnosticAnalyzerFieldsAnalyzer<ClassDeclarationSyntax, StructDeclarationSyntax, FieldDeclarationSyntax, TypeSyntax, VariableDeclarationSyntax, TypeArgumentListSyntax, GenericNameSyntax>
Microsoft.CodeAnalysis.CSharp.CodeStyle (66)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryDiscardDesignation\CSharpRemoveUnnecessaryDiscardDesignationDiagnosticAnalyzer.cs (1)
61var typeSyntax = declarationPattern.Type;
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (1)
286n => n is TypeSyntax or
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\Analyzers\CSharp\Analyzers\SimplifyLinqExpression\CSharpSimplifyLinqTypeCheckAndCastDiagnosticAnalyzer.cs (3)
75Right: TypeSyntax whereTypeSyntax 94[NotNullWhen(true)] out TypeSyntax? caseOrSelectType) 192out var castTypeArgument))
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (1)
741Func<TArrayCreationExpressionSyntax, TypeSyntax> getType,
src\Analyzers\CSharp\Analyzers\UseDeconstruction\CSharpUseDeconstructionDiagnosticAnalyzer.cs (2)
137TypeSyntax typeNode, 221private static bool IsViableTupleTypeSyntax(TypeSyntax type)
src\Analyzers\CSharp\Analyzers\UseImplicitObjectCreation\CSharpUseImplicitObjectCreationDiagnosticAnalyzer.cs (1)
83TypeSyntax? typeNode;
src\Analyzers\CSharp\Analyzers\UseImplicitOrExplicitType\CSharpTypeStyleDiagnosticAnalyzerBase.cs (1)
38var declaredType = Helper.FindAnalyzableType(declarationStatement, semanticModel, cancellationToken);
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\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpUseNotPatternDiagnosticAnalyzer.cs (1)
81BinaryExpressionSyntax(SyntaxKind.IsExpression) { Right: TypeSyntax type } isExpression
src\Analyzers\CSharp\Analyzers\UseUnboundGenericTypeInNameOf\CSharpUseUnboundGenericTypeInNameOfDiagnosticAnalyzer.cs (1)
70foreach (var argument in typeArgumentList.Arguments)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeStyle\TypeStyle\TypeStyleHelper.cs (1)
202public static bool IsPredefinedType(TypeSyntax type)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\DefaultExpressionSyntaxExtensions.cs (2)
42var typeSyntax = GetTypeSyntax(equalsValueClause); 67private static TypeSyntax GetTypeSyntax(EqualsValueClauseSyntax equalsValueClause)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
606while (topExpression.Parent is TypeSyntax typeSyntax)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\MemberDeclarationSyntaxExtensions.cs (1)
150public static TypeSyntax GetMemberType(this MemberDeclarationSyntax member)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (5)
185TypeSyntax type, 320TypeSyntax type, 345private static TypeSyntax GetOutermostType(TypeSyntax type) 346=> type.GetAncestorsOrThis<TypeSyntax>().Last();
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\VariableDeclaratorExtensions.cs (2)
13public static TypeSyntax GetVariableType(this VariableDeclaratorSyntax declarator) 25var variableTypeName = variable.GetVariableType();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (2)
751var type = memberDeclaration.GetMemberType(); 1502=> node is TypeSyntax;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\NameSyntaxComparer.cs (2)
119var xArg = x.TypeArgumentList.Arguments[i]; 120var yArg = y.TypeArgumentList.Arguments[i];
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpTypeStyleHelper.cs (6)
17private readonly TypeSyntax _typeName; 37public TypeStyleResult(CSharpTypeStyleHelper helper, TypeSyntax typeName, SemanticModel semanticModel, CSharpSimplifierOptions options, bool isStylePreferred, NotificationOption2 notificationOption, CancellationToken cancellationToken) : this() 58TypeSyntax typeName, SemanticModel semanticModel, 76TypeSyntax typeName, SemanticModel semanticModel, CSharpSimplifierOptions options, CancellationToken cancellationToken); 79SyntaxToken identifier, TypeSyntax typeName, ExpressionSyntax initializer, SemanticModel semanticModel, CSharpSimplifierOptions options, CancellationToken cancellationToken); 81internal TypeSyntax? FindAnalyzableType(SyntaxNode node, SemanticModel semanticModel, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpTypeStyleHelper.State.cs (3)
93var typeSyntax = GetTypeSyntaxFromDeclaration(declarationStatement); 132var typeSyntax = GetTypeSyntaxFromDeclaration(declarationStatement); 139private static TypeSyntax? GetTypeSyntaxFromDeclaration(SyntaxNode declarationStatement)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseExplicitTypeHelper.cs (3)
66TypeSyntax typeName, SemanticModel semanticModel, 142TypeSyntax typeName, 156private static bool ContainsAnonymousType(TypeSyntax typeName, SemanticModel semanticModel, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (6)
30TypeSyntax typeName, SemanticModel semanticModel, 50var type = variableDeclaration.Type.StripRefIfNeeded(); 61var type = forEachStatement.Type.StripRefIfNeeded(); 98TypeSyntax typeName, SemanticModel semanticModel, 184var declarationTypeNode = declarationExpression.Type; 251TypeSyntax typeName,
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 (130)
src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs (1)
111var type = cannotUseVar ? declaratorToRemoveType!.GenerateTypeSyntax() : IdentifierName("var");
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (1)
254var type = result.IsInherited
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\Analyzers\CSharp\CodeFixes\GenerateDefaultConstructors\CSharpGenerateDefaultConstructorsService.cs (2)
43var node = semanticDocument.Root.FindToken(textSpan.Start).GetAncestor<TypeSyntax>();
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\Analyzers\CSharp\CodeFixes\ImplementInterface\CSharpImplementInterfaceCodeFixProvider.cs (1)
19: AbstractImplementInterfaceCodeFixProvider<TypeSyntax>
src\Analyzers\CSharp\CodeFixes\ImplementInterface\CSharpImplementInterfaceService.cs (1)
56if (node is TypeSyntax interfaceNode && interfaceNode.Parent is BaseTypeSyntax baseType &&
src\Analyzers\CSharp\CodeFixes\InlineDeclaration\CSharpInlineDeclarationCodeFixProvider.cs (4)
219var newType = GenerateTypeSyntaxOrVar(local.Type, options); 232var explicitType = declaration.Type.IsVar ? local.Type?.GenerateTypeSyntax() : declaration.Type; 241public static TypeSyntax GenerateTypeSyntaxOrVar( 269TypeSyntax newType, VariableDeclaratorSyntax declaratorOpt)
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpChangeToIEnumerableCodeFixProvider.cs (1)
74var newReturnType = ienumerableGenericSymbol.GenerateTypeSyntax();
src\Analyzers\CSharp\CodeFixes\MakeMethodAsynchronous\CSharpMakeMethodAsynchronousCodeFixProvider.cs (8)
98var fixedReturnType = FixMethodReturnType(keepVoid, methodSymbol, method.ReturnType, knownTypes); 123private static TypeSyntax FixMethodReturnType( 126TypeSyntax returnTypeSyntax, 129var newReturnType = returnTypeSyntax.WithAdditionalAnnotations(Formatter.Annotation); 167static TypeSyntax MakeGenericType(string type, ITypeSymbol typeArgumentFrom) 187private static (SyntaxTokenList newModifiers, TypeSyntax newReturnType) AddAsyncModifierWithCorrectedTrivia(SyntaxTokenList modifiers, TypeSyntax returnType) 208var newReturnType = returnType.WithoutLeadingTrivia();
src\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\Analyzers\CSharp\CodeFixes\MisplacedUsingDirectives\MisplacedUsingDirectivesCodeFixProvider.cs (1)
189var newType = await Simplifier.ExpandAsync(usingDirective.NamespaceOrType, document, cancellationToken: cancellationToken).ConfigureAwait(false);
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\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\Analyzers\CSharp\CodeFixes\SimplifyLinqExpression\CSharpSimplifyLinqTypeCheckAndCastCodeFixProvider.cs (2)
47var typeSyntax = (TypeSyntax)diagnostic.AdditionalLocations[1].FindNode(getInnermostNodeForTie: true, cancellationToken);
src\Analyzers\CSharp\CodeFixes\UseDeconstruction\CSharpUseDeconstructionCodeFixProvider.cs (2)
146private ExpressionSyntax CreateTupleOrDeclarationExpression(INamedTypeSymbol tupleType, TypeSyntax typeNode) 157private static DeclarationExpressionSyntax CreateDeclarationExpression(INamedTypeSymbol tupleType, TypeSyntax typeNode)
src\Analyzers\CSharp\CodeFixes\UseExplicitArrayInExpressionTree\CSharpUseExplicitArrayInExpressionTreeCodeFixProvider.cs (1)
147var arrayElementTypeNode = arrayElementType.GenerateTypeSyntax(allowVar: false);
src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseExplicitTypeCodeFixProvider.cs (6)
86var typeSyntax = declarationExpression.Type; 134TypeSyntax typeSyntax, 201var typeName = type.GenerateTypeSyntax(allowVar: false); 228private static TypeSyntax GenerateTypeDeclaration(TypeSyntax typeSyntax, ITypeSymbol newTypeSymbol) 232var newTypeSyntax = newTypeSymbol
src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseImplicitTypeCodeFixProvider.cs (3)
40var typeSyntax = (TypeSyntax)root.FindNode(diagnostic.Location.SourceSpan, getInnermostNodeForTie: true); 47internal static void ReplaceTypeWithVar(SyntaxEditor editor, TypeSyntax type)
src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (2)
38private static readonly TypeSyntax s_objectType = PredefinedType(ObjectKeyword); 216var returnType = delegateMethod.GenerateReturnTypeSyntax();
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpAsAndMemberAccessCodeFixProvider.cs (1)
76(TypeSyntax)asExpression.Right.WithAppendedTrailingTrivia(Space),
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpAsAndNullCheckCodeFixProvider.cs (2)
133TypeSyntax GetPatternType() 156return (TypeSyntax)asExpression.Right;
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpIsAndCastCheckCodeFixProvider.cs (1)
63((TypeSyntax)isExpression.Right).WithoutTrivia(),
src\Analyzers\CSharp\CodeFixes\UseUnboundGenericTypeInNameOf\CSharpUseUnboundGenericTypeInNameOfCodeFixProvider.cs (1)
70return current.WithArguments(SeparatedList<TypeSyntax>(list));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (1)
783TypeSyntax newTypeSyntax;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\PropertyGenerator.cs (1)
158private static TypeSyntax GenerateTypeSyntax(IPropertySymbol property)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (2)
283if (expr is TypeSyntax) 494targetToken.GetPreviousToken(includeSkipped: true).IsLastTokenOfNode<TypeSyntax>())
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (11)
950{ Parent: TypeSyntax { Parent.RawKind: (int)SyntaxKind.FunctionPointerParameter } } => true, 1516if (leftToken.IsLastTokenOfNode<TypeSyntax>(out var typeSyntax)) 1521while (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\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
119var typeSyntax = targetType.GenerateTypeSyntax();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.cs (7)
33public static TypeSyntax GenerateTypeSyntax(this INamespaceOrTypeSymbol symbol, bool allowVar = true) 36private static TypeSyntax GenerateTypeSyntax( 47var syntax = containsAnonymousType 71public static TypeSyntax GenerateRefTypeSyntax( 74var underlyingType = GenerateTypeSyntax(symbol, allowVar) 81public static TypeSyntax GenerateRefReadOnlyTypeSyntax( 84var underlyingType = GenerateTypeSyntax(symbol, allowVar)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.ExpressionSyntaxGeneratorVisitor.cs (1)
43if (!_nameOnly && TypeSyntaxGeneratorVisitor.TryCreateNativeIntegerType(symbol, out var typeSyntax))
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\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\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpMoveDeclarationNearReferenceService.cs (1)
57var type = declarationStatement.Declaration.Type;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSyntaxGeneratorInternal.cs (7)
68type == null ? SyntaxFactory.IdentifierName("var") : (TypeSyntax)type, 237=> SyntaxFactory.TypePattern((TypeSyntax)type); 245=> SyntaxFactory.CastExpression((TypeSyntax)type, (ExpressionSyntax)Parenthesize(expression)).WithAdditionalAnnotations(Simplifier.Annotation); 248=> SyntaxFactory.DefaultExpression((TypeSyntax)type).WithAdditionalAnnotations(Simplifier.Annotation); 287var type = typeSymbol.GenerateTypeSyntax(); 312if (expression is TypeSyntax || 338=> SyntaxFactory.CastExpression((TypeSyntax)type, (ExpressionSyntax)Parenthesize(expression)).WithAdditionalAnnotations(Simplifier.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
2174var variableType = variableDeclarator.GetVariableType();
Microsoft.CodeAnalysis.CSharp.EditorFeatures (2)
AutomaticCompletion\AutomaticLineEnderCommandHandler_Helpers.cs (2)
426var typeNode = objectCreationExpressionNode.Type; 441var newTypeNode = typeNode.WithoutTrivia();
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (1)
TypeInferrer\TypeInferrerTests.cs (1)
43var typeSyntax = inferredType.GenerateTypeSyntax().NormalizeWhitespace();
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (21)
CodeGen\CodeGenDeconstructTests.cs (18)
3587var typeSyntax = GetTypeSyntax(decl); 3628private static TypeSyntax GetTypeSyntax(SingleVariableDesignationSyntax decl) 3699var x1Type = GetTypeSyntax(x1); 3704var x2Type = GetTypeSyntax(x2); 3752var x1Type = GetTypeSyntax(x1); 3801var x1Type = GetTypeSyntax(x1); 3809var x2Type = GetTypeSyntax(x2); 3941var x1Type = GetTypeSyntax(x1); 3946var x2Type = GetTypeSyntax(x2); 3987var x1Type = GetTypeSyntax(x1); 3992var x2Type = GetTypeSyntax(x2); 5034var xType = GetTypeSyntax(x); 5040var yType = GetTypeSyntax(y); 5186var x1Type = GetTypeSyntax(x1); 5817var x1Type = GetTypeSyntax(x1); 5825var x3Type = GetTypeSyntax(x3); 5869var x1Type = GetTypeSyntax(x1); 5875var x3Type = GetTypeSyntax(x3);
CodeGen\CodeGenRefLocalTests.cs (3)
4046var type = refVar.Type; 4083var type = refVar.Type; 4117var type = refInt.Type;
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (5)
Attributes\AttributeTests.cs (1)
7582var typeofArgSyntax = typeofSyntax.Type;
Semantics\OutVarTests.cs (1)
1036var typeSyntax = decl.Type;
Semantics\PatternMatchingTestBase.cs (3)
102var typeSyntax = decl.Type; 130private static void AssertTypeInfo(SemanticModel model, TypeSyntax typeSyntax, ITypeSymbol expectedType) 268var typeSyntax = decl.Type;
Microsoft.CodeAnalysis.CSharp.Features (167)
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 (2)
54var existingReturnType = declaration switch 76string? GetNewTypeName(TypeSyntax existingReturnType)
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)
24: AbstractConvertCastCodeRefactoringProvider<TypeSyntax, CastExpressionSyntax, BinaryExpressionSyntax> 37protected override TypeSyntax GetTypeNode(CastExpressionSyntax from) 42var typeNode = 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)
101AnalyzedPattern.Type p when feature.HasFlag(Feature.TypePattern) => TypePattern((TypeSyntax)p.IsExpressionSyntax.Right), 102AnalyzedPattern.Type p => DeclarationPattern((TypeSyntax)p.IsExpressionSyntax.Right, DiscardDesignation()),
ConvertLinq\ConvertForEachToLinqQuery\DefaultConverter.cs (1)
23private static readonly TypeSyntax 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)
123var returnType = member.GetMemberType(); 163else if (expression is ObjectCreationExpressionSyntax { Type: TypeSyntax exceptionType }) 176private 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 }) 455state.NameOrMemberAccessExpression as TypeSyntax, cancellationToken); 464state.NameOrMemberAccessExpression as TypeSyntax, cancellationToken);
IntroduceVariable\CSharpIntroduceVariableService.cs (1)
25AbstractIntroduceVariableService<CSharpIntroduceVariableService, ExpressionSyntax, TypeSyntax, TypeDeclarationSyntax, QueryExpressionSyntax, NameSyntax>
IntroduceVariable\CSharpIntroduceVariableService_IntroduceLocal.cs (1)
228private static TypeSyntax GetTypeSyntax(SemanticDocument document, ExpressionSyntax expression, CancellationToken cancellationToken)
Rename\CSharpRenameIssuesService.cs (1)
61TypeSyntax? declaredType = null;
ReplaceConditionalWithStatements\CSharpReplaceConditionalWithStatementsCodeRefactoringProvider.cs (1)
70var type = localDeclarationStatement.Declaration.Type;
ReplacePropertyWithMethods\CSharpReplacePropertyWithMethodsService.cs (1)
303if (parameterType is TypeSyntax typeSyntax)
Snippets\AbstractCSharpAutoPropertySnippetProvider.cs (1)
81var type = propertyDeclaration.Type;
Snippets\AbstractCSharpForLoopSnippetProvider.cs (1)
70static (TypeSyntax iteratorTypeSyntax, SyntaxNode? inlineExpression) GetLoopHeaderParts(SyntaxGenerator generator, InlineExpressionInfo? inlineExpressionInfo, Compilation compilation)
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)
379private static void AppendType(TypeSyntax? type, StringBuilder builder)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryDiscardDesignation\CSharpRemoveUnnecessaryDiscardDesignationDiagnosticAnalyzer.cs (1)
61var typeSyntax = declarationPattern.Type;
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (1)
286n => n is TypeSyntax or
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\Analyzers\CSharp\Analyzers\SimplifyLinqExpression\CSharpSimplifyLinqTypeCheckAndCastDiagnosticAnalyzer.cs (3)
75Right: TypeSyntax whereTypeSyntax 94[NotNullWhen(true)] out TypeSyntax? caseOrSelectType) 192out var castTypeArgument))
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (1)
741Func<TArrayCreationExpressionSyntax, TypeSyntax> getType,
src\Analyzers\CSharp\Analyzers\UseDeconstruction\CSharpUseDeconstructionDiagnosticAnalyzer.cs (2)
137TypeSyntax typeNode, 221private static bool IsViableTupleTypeSyntax(TypeSyntax type)
src\Analyzers\CSharp\Analyzers\UseImplicitObjectCreation\CSharpUseImplicitObjectCreationDiagnosticAnalyzer.cs (1)
83TypeSyntax? typeNode;
src\Analyzers\CSharp\Analyzers\UseImplicitOrExplicitType\CSharpTypeStyleDiagnosticAnalyzerBase.cs (1)
38var declaredType = Helper.FindAnalyzableType(declarationStatement, semanticModel, cancellationToken);
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\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpUseNotPatternDiagnosticAnalyzer.cs (1)
81BinaryExpressionSyntax(SyntaxKind.IsExpression) { Right: TypeSyntax type } isExpression
src\Analyzers\CSharp\Analyzers\UseUnboundGenericTypeInNameOf\CSharpUseUnboundGenericTypeInNameOfDiagnosticAnalyzer.cs (1)
70foreach (var argument in typeArgumentList.Arguments)
src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs (1)
111var type = cannotUseVar ? declaratorToRemoveType!.GenerateTypeSyntax() : IdentifierName("var");
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (1)
254var type = result.IsInherited
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\Analyzers\CSharp\CodeFixes\GenerateDefaultConstructors\CSharpGenerateDefaultConstructorsService.cs (2)
43var node = semanticDocument.Root.FindToken(textSpan.Start).GetAncestor<TypeSyntax>();
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\Analyzers\CSharp\CodeFixes\ImplementInterface\CSharpImplementInterfaceCodeFixProvider.cs (1)
19: AbstractImplementInterfaceCodeFixProvider<TypeSyntax>
src\Analyzers\CSharp\CodeFixes\ImplementInterface\CSharpImplementInterfaceService.cs (1)
56if (node is TypeSyntax interfaceNode && interfaceNode.Parent is BaseTypeSyntax baseType &&
src\Analyzers\CSharp\CodeFixes\InlineDeclaration\CSharpInlineDeclarationCodeFixProvider.cs (4)
219var newType = GenerateTypeSyntaxOrVar(local.Type, options); 232var explicitType = declaration.Type.IsVar ? local.Type?.GenerateTypeSyntax() : declaration.Type; 241public static TypeSyntax GenerateTypeSyntaxOrVar( 269TypeSyntax newType, VariableDeclaratorSyntax declaratorOpt)
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpChangeToIEnumerableCodeFixProvider.cs (1)
74var newReturnType = ienumerableGenericSymbol.GenerateTypeSyntax();
src\Analyzers\CSharp\CodeFixes\MakeMethodAsynchronous\CSharpMakeMethodAsynchronousCodeFixProvider.cs (8)
98var fixedReturnType = FixMethodReturnType(keepVoid, methodSymbol, method.ReturnType, knownTypes); 123private static TypeSyntax FixMethodReturnType( 126TypeSyntax returnTypeSyntax, 129var newReturnType = returnTypeSyntax.WithAdditionalAnnotations(Formatter.Annotation); 167static TypeSyntax MakeGenericType(string type, ITypeSymbol typeArgumentFrom) 187private static (SyntaxTokenList newModifiers, TypeSyntax newReturnType) AddAsyncModifierWithCorrectedTrivia(SyntaxTokenList modifiers, TypeSyntax returnType) 208var newReturnType = returnType.WithoutLeadingTrivia();
src\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\Analyzers\CSharp\CodeFixes\MisplacedUsingDirectives\MisplacedUsingDirectivesCodeFixProvider.cs (1)
189var newType = await Simplifier.ExpandAsync(usingDirective.NamespaceOrType, document, cancellationToken: cancellationToken).ConfigureAwait(false);
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\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\Analyzers\CSharp\CodeFixes\SimplifyLinqExpression\CSharpSimplifyLinqTypeCheckAndCastCodeFixProvider.cs (2)
47var typeSyntax = (TypeSyntax)diagnostic.AdditionalLocations[1].FindNode(getInnermostNodeForTie: true, cancellationToken);
src\Analyzers\CSharp\CodeFixes\UseDeconstruction\CSharpUseDeconstructionCodeFixProvider.cs (2)
146private ExpressionSyntax CreateTupleOrDeclarationExpression(INamedTypeSymbol tupleType, TypeSyntax typeNode) 157private static DeclarationExpressionSyntax CreateDeclarationExpression(INamedTypeSymbol tupleType, TypeSyntax typeNode)
src\Analyzers\CSharp\CodeFixes\UseExplicitArrayInExpressionTree\CSharpUseExplicitArrayInExpressionTreeCodeFixProvider.cs (1)
147var arrayElementTypeNode = arrayElementType.GenerateTypeSyntax(allowVar: false);
src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseExplicitTypeCodeFixProvider.cs (6)
86var typeSyntax = declarationExpression.Type; 134TypeSyntax typeSyntax, 201var typeName = type.GenerateTypeSyntax(allowVar: false); 228private static TypeSyntax GenerateTypeDeclaration(TypeSyntax typeSyntax, ITypeSymbol newTypeSymbol) 232var newTypeSyntax = newTypeSymbol
src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseImplicitTypeCodeFixProvider.cs (3)
40var typeSyntax = (TypeSyntax)root.FindNode(diagnostic.Location.SourceSpan, getInnermostNodeForTie: true); 47internal static void ReplaceTypeWithVar(SyntaxEditor editor, TypeSyntax type)
src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (2)
38private static readonly TypeSyntax s_objectType = PredefinedType(ObjectKeyword); 216var returnType = delegateMethod.GenerateReturnTypeSyntax();
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpAsAndMemberAccessCodeFixProvider.cs (1)
76(TypeSyntax)asExpression.Right.WithAppendedTrailingTrivia(Space),
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpAsAndNullCheckCodeFixProvider.cs (2)
133TypeSyntax GetPatternType() 156return (TypeSyntax)asExpression.Right;
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpIsAndCastCheckCodeFixProvider.cs (1)
63((TypeSyntax)isExpression.Right).WithoutTrivia(),
src\Analyzers\CSharp\CodeFixes\UseUnboundGenericTypeInNameOf\CSharpUseUnboundGenericTypeInNameOfCodeFixProvider.cs (1)
70return 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.Semantic.UnitTests (55)
Semantics\ArglistTests.cs (1)
963var type = stmt.Declaration.Type;
Semantics\ForEachTests.cs (1)
2894var varSyntax = foreachSyntax.Type;
Semantics\LambdaTests.cs (1)
5644var returnTypeSyntax = lambdaSyntax.ReturnType;
Semantics\NativeIntegerTests.cs (1)
4080var typeSyntax = SyntaxFactory.ParseTypeName("nuint");
Semantics\NullableContextTests.cs (1)
2229var type = SyntaxFactory.ParseTypeName(typeName);
Semantics\NullableReferenceTypesTests.cs (20)
10536var type1 = foreachSyntax[0].Type; 10540var type2 = foreachSyntax[1].Type; 113852TypeSyntax type = SyntaxFactory.ParseTypeName( 113861private static void AssertGetSpeculativeTypeInfo(string source, NullableContextOptions nullableContextOptions, TypeSyntax type, string expected) 113889TypeSyntax type = SyntaxFactory.ParseTypeName( 113914TypeSyntax type = SyntaxFactory.ParseTypeName( 113939TypeSyntax type = SyntaxFactory.ParseTypeName( 113968TypeSyntax type = SyntaxFactory.ParseTypeName( 113995TypeSyntax type = SyntaxFactory.ParseTypeName( 114023TypeSyntax type = SyntaxFactory.ParseTypeName( 114051TypeSyntax type = SyntaxFactory.ParseTypeName( 114077TypeSyntax type = SyntaxFactory.ParseTypeName( 114086private static void AssertTryGetSpeculativeSemanticModel(string source, NullableContextOptions nullableContextOptions, TypeSyntax type, string expected) 114115TypeSyntax type = SyntaxFactory.ParseTypeName( 114140TypeSyntax type = SyntaxFactory.ParseTypeName( 114165TypeSyntax type = SyntaxFactory.ParseTypeName( 114194TypeSyntax type = SyntaxFactory.ParseTypeName( 114221TypeSyntax type = SyntaxFactory.ParseTypeName( 114249TypeSyntax type = SyntaxFactory.ParseTypeName( 114277TypeSyntax type = SyntaxFactory.ParseTypeName(
Semantics\RefFieldTests.cs (27)
12140var type = ((VariableDeclarationSyntax)decl.Parent).Type; 12208var type = ((VariableDeclarationSyntax)decl.Parent).Type; 12274var type = ((VariableDeclarationSyntax)decl.Parent).Type; 12463var type = ((DeclarationExpressionSyntax)decl.Parent).Type; 12495var type = ((DeclarationExpressionSyntax)decl.Parent).Type; 12647var type = ((DeclarationExpressionSyntax)decl.Parent).Type; 12675var type = ((DeclarationExpressionSyntax)decl.Parent).Type; 12874var type = ((DeclarationExpressionSyntax)decl.Parent).Type; 12908var type = ((DeclarationExpressionSyntax)decl.Parent).Type; 13054var type = ((DeclarationExpressionSyntax)decl.Parent).Type; 13082var type = ((DeclarationExpressionSyntax)decl.Parent).Type; 13520var type = ((VariableDeclarationSyntax)decl.Parent).Type; 13584var type = ((VariableDeclarationSyntax)decl.Parent).Type; 13661var type = ((DeclarationExpressionSyntax)decl.Parent).Type; 13731var type = ((DeclarationExpressionSyntax)decl.Parent).Type; 14428var type = ((VariableDeclarationSyntax)decls[0].Parent).Type; 14470var type = ((VariableDeclarationSyntax)decls[0].Parent).Type; 14674var type = decl.Type; 14922var type = ((DeclarationExpressionSyntax)decl.Parent).Type; 14950var type = ((DeclarationExpressionSyntax)decl.Parent).Type; 15213var type = decl.Type; 27673var type = ((VariableDeclarationSyntax)decl.Parent).Type; 27763var type = ((VariableDeclarationSyntax)decl.Parent).Type; 28034var type = ((VariableDeclarationSyntax)decl.Parent).Type; 28094var type = ((VariableDeclarationSyntax)decl.Parent).Type; 28316var type = ((VariableDeclarationSyntax)decls[0].Parent).Type; 28364var type = ((VariableDeclarationSyntax)decls[0].Parent).Type;
Semantics\RefLocalsAndReturnsTests.cs (1)
5214var type = decl.Type;
Semantics\TypeOfTests.cs (1)
34var identifierName = node.Type;
Semantics\UnsafeTests.cs (1)
11307var typeSyntax = arrayTypeSyntax.ElementType;
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (80)
Compilation\SemanticModelAPITests.cs (17)
534var bbase = bdecl.BaseList.Types[0].Type as TypeSyntax; 560var cbase = cdecl.BaseList.Types[0].Type as TypeSyntax; 586var cbase = cdecl.BaseList.Types[0].Type as TypeSyntax; 609var bbase = bdecl.BaseList.Types[0].Type as TypeSyntax; // A<T> 644var program = staticProgramField.Declaration.Type; 675var type = field.Declaration.Type; 703var type = method.ParameterList.Parameters[0].Type; 729TypeSyntax speculate = SyntaxFactory.IdentifierName(SyntaxFactory.Identifier("A")); 2693TypeSyntax speculatedTypeSyntax, 3254var typeSyntax = SyntaxFactory.ParseTypeName("System.Collections.Generic.IEnumerable<C[]>"); 4359var typeSyntax = SyntaxFactory.ParseTypeName("dynamic"); 4509var varNode = declarationExpression.Type; 4573var varNode = declarationExpression.Type;
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (4)
2427var type = localDecl.Declaration.Type; 2459var type = localDecl.Declaration.Type; 2563var type = methodDecl.ReturnType; 4000var typeofArgSyntax = typeofSyntax.Type;
Compilation\SemanticModelGetSemanticInfoTests.cs (1)
7256var semanticInfo = GetSemanticInfoForTest<TypeSyntax>(sourceCode);
DocumentationComments\CrefTests.cs (8)
5745var parameterType = cref.Parameters.Parameters.Single().Type; 6106var returnTypeSyntax = ((ConversionOperatorMemberCrefSyntax)(((QualifiedCrefSyntax)crefSyntax).Member)).Type; 6144var parameterTypeSyntax = ((NameMemberCrefSyntax)crefSyntax).Parameters.Parameters[0].Type; 6187var parameterTypeSyntax = crefSyntax.DescendantNodes().OfType<CrefParameterSyntax>().Single().Type; 6274var crefName = cref.Name; 6324var crefReturnType = cref.Type; 6325var crefParameterType = cref.Parameters.Parameters.Single().Type; 6638var name = ((GenericNameSyntax)crefSyntax.Name).TypeArgumentList.Arguments.Single();
Symbols\FunctionPointerTypeSymbolTests.cs (3)
51var paramType = syntaxTree.GetRoot() 684var paramType = syntaxTree.GetRoot() 1318var baseNameSyntax = syntaxTree.GetRoot()
Symbols\Source\FileModifierTests.cs (1)
4124var voidTypeSyntax = tree.GetRoot().DescendantNodes().OfType<ParameterSyntax>().Single().Type!;
Symbols\Source\NullablePublicAPITests.cs (22)
2563var type = ((DeclarationExpressionSyntax)variable.Parent).Type; 4240var type = SyntaxFactory.ParseTypeName("string"); 4362var type = tree.GetRoot().DescendantNodes().OfType<DeclarationExpressionSyntax>().Single().Type; 4367var type2 = statement.DescendantNodes().OfType<DeclarationExpressionSyntax>().Single().Type; 4390var type = tree.GetRoot().DescendantNodes().OfType<DeclarationExpressionSyntax>().Single().Type; 4395var type2 = statement.DescendantNodes().OfType<DeclarationExpressionSyntax>().Single().Type; 4418var type = tree.GetRoot().DescendantNodes().OfType<DeclarationExpressionSyntax>().Single().Type; 4425var type2 = statement.DescendantNodes().OfType<DeclarationExpressionSyntax>().Single().Type; 4448var type = tree.GetRoot().DescendantNodes().OfType<DeclarationExpressionSyntax>().Single().Type; 4455var type2 = statement.DescendantNodes().OfType<DeclarationExpressionSyntax>().Single().Type; 4478var type = tree.GetRoot().DescendantNodes().OfType<DeclarationExpressionSyntax>().Single().Type; 4485var type2 = statement.DescendantNodes().OfType<DeclarationExpressionSyntax>().Single().Type; 4508var type = tree.GetRoot().DescendantNodes().OfType<DeclarationExpressionSyntax>().Single().Type; 4517var type2 = methodDeclaration.DescendantNodes().OfType<DeclarationExpressionSyntax>().Single().Type; 4540var type = tree.GetRoot().DescendantNodes().OfType<DeclarationExpressionSyntax>().Single().Type; 4550var type2 = methodDeclaration.DescendantNodes().OfType<DeclarationExpressionSyntax>().Single().Type; 4573var type = tree.GetRoot().DescendantNodes().OfType<DeclarationExpressionSyntax>().Single().Type; 4578var type2 = arrow.DescendantNodes().OfType<DeclarationExpressionSyntax>().Single().Type; 4601var type = tree.GetRoot().DescendantNodes().OfType<DeclarationExpressionSyntax>().Single().Type; 4608var type2 = arrow.DescendantNodes().OfType<DeclarationExpressionSyntax>().Single().Type; 4639var type2 = newInitializer.DescendantNodes().OfType<DeclarationExpressionSyntax>().Single().Type; 4672var type2 = newInitializer.DescendantNodes().OfType<DeclarationExpressionSyntax>().Single().Type;
Symbols\Source\UsingAliasTests.cs (24)
41var base1 = a1.BaseList.Types[0].Type; 42var base2 = a2.BaseList.Types[0].Type; 43var base3 = a3.BaseList.Types[0].Type; 44var base4 = a4.BaseList.Types[0].Type; 98var base1 = a1.BaseList.Types[0].Type; 99var base2 = a2.BaseList.Types[0].Type; 100var base3 = a3.BaseList.Types[0].Type; 101var base4 = a4.BaseList.Types[0].Type; 158var base1 = a1.BaseList.Types[0].Type; 159var base2 = a2.BaseList.Types[0].Type; 160var base3 = a3.BaseList.Types[0].Type; 161var base4 = a4.BaseList.Types[0].Type; 213var base1 = a1.BaseList.Types[0].Type; 214var base2 = a2.BaseList.Types[0].Type; 215var base3 = a3.BaseList.Types[0].Type; 216var base4 = a4.BaseList.Types[0].Type; 305var base1 = a1.BaseList.Types[0].Type; 306var base2 = a2.BaseList.Types[0].Type; 307var base3 = a3.BaseList.Types[0].Type; 308var base4 = a4.BaseList.Types[0].Type; 351var base1 = a1.BaseList.Types[0].Type; 352var base2 = a2.BaseList.Types[0].Type; 353var base3 = a3.BaseList.Types[0].Type; 354var base4 = a4.BaseList.Types[0].Type;
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (45)
Generated\Syntax.Test.xml.Generated.cs (7)
10373=> SyntaxFactory.TypeArgumentList(SyntaxFactory.Token(SyntaxKind.LessThanToken), new SeparatedSyntaxList<TypeSyntax>(), SyntaxFactory.Token(SyntaxKind.GreaterThanToken)); 10535=> SyntaxFactory.ParenthesizedLambdaExpression(new SyntaxList<AttributeListSyntax>(), new SyntaxTokenList(), default(TypeSyntax), GenerateParameterList(), SyntaxFactory.Token(SyntaxKind.EqualsGreaterThanToken), default(BlockSyntax), default(ExpressionSyntax)); 10583=> SyntaxFactory.FromClause(SyntaxFactory.Token(SyntaxKind.FromKeyword), default(TypeSyntax), SyntaxFactory.Identifier("Identifier"), SyntaxFactory.Token(SyntaxKind.InKeyword), GenerateIdentifierName()); 10589=> SyntaxFactory.JoinClause(SyntaxFactory.Token(SyntaxKind.JoinKeyword), default(TypeSyntax), SyntaxFactory.Identifier("Identifier"), SyntaxFactory.Token(SyntaxKind.InKeyword), GenerateIdentifierName(), SyntaxFactory.Token(SyntaxKind.OnKeyword), GenerateIdentifierName(), SyntaxFactory.Token(SyntaxKind.EqualsKeyword), GenerateIdentifierName(), default(JoinIntoClauseSyntax)); 10637=> SyntaxFactory.RecursivePattern(default(TypeSyntax), default(PositionalPatternClauseSyntax), default(PropertyPatternClauseSyntax), default(VariableDesignationSyntax)); 10958=> SyntaxFactory.Parameter(new SyntaxList<AttributeListSyntax>(), new SyntaxTokenList(), default(TypeSyntax), default(SyntaxToken), default(EqualsValueClauseSyntax)); 10964=> SyntaxFactory.IncompleteMember(new SyntaxList<AttributeListSyntax>(), new SyntaxTokenList(), default(TypeSyntax));
IncrementalParsing\ChangingIdentifiers.cs (1)
276var nameTree = method.ReturnType;
LexicalAndXml\XmlDocCommentTests.cs (5)
1834var keyword = ((tree.GetCompilationUnitRoot().Members[0] as TypeDeclarationSyntax).Members[0] as MethodDeclarationSyntax).ReturnType; 1869var keyword = ((tree.GetCompilationUnitRoot().Members[0] as TypeDeclarationSyntax).Members[0] as MethodDeclarationSyntax).ReturnType; 1904var keyword = ((tree.GetCompilationUnitRoot().Members[0] as TypeDeclarationSyntax).Members[0] as PropertyDeclarationSyntax).Type; 1939var keyword = ((tree.GetCompilationUnitRoot().Members[0] as TypeDeclarationSyntax).Members[0] as IndexerDeclarationSyntax).Type; 2049var keyword = ((tree.GetCompilationUnitRoot().Members[0] as TypeDeclarationSyntax).Members[0] as MethodDeclarationSyntax).ReturnType;
Parsing\NameParsingTests.cs (21)
24private TypeSyntax ParseTypeName(string text) 332var tname = ParseTypeName(text); 346var tname = ParseTypeName(text); 360var tname = ParseTypeName(text); 377var tname = ParseTypeName(text); 396var tname = ParseTypeName(text); 438var tname = ParseTypeName(text); 474var tname = ParseTypeName(text); 487var tname = ParseTypeName(text); 502var tname = ParseTypeName(text); 517var tname = ParseTypeName(text); 543var tname = ParseTypeName(text); 565var tname = ParseTypeName(text); 587var tname = ParseTypeName(text); 630var arg = gname.TypeArgumentList.Arguments[0]; 655var arg = gname.TypeArgumentList.Arguments[0]; 681var arg = gname.TypeArgumentList.Arguments[0]; 708var arg = gname.TypeArgumentList.Arguments[0]; 714var arg2 = gname.TypeArgumentList.Arguments[1]; 739var arg = gname.TypeArgumentList.Arguments[0]; 764var arg = gname.TypeArgumentList.Arguments[0];
Syntax\SyntaxFactoryTests.cs (3)
626var parsedWith8 = SyntaxFactory.ParseTypeName(type, options: TestOptions.Regular8); 629var parsedWithPreview = SyntaxFactory.ParseTypeName(type, options: TestOptions.Regular9); 714var typeName = SyntaxFactory.ParseTypeName("", options: parseOptions);
Syntax\SyntaxNodeTests.cs (8)
1854: SyntaxFactory.SingletonSeparatedList<TypeSyntax>(SyntaxFactory.PredefinedType(SyntaxFactory.Token(SyntaxKind.IntKeyword))); 3517SyntaxFactory.SingletonSeparatedList<TypeSyntax>(intType); 3518SyntaxFactory.SeparatedList<TypeSyntax>(new SyntaxNodeOrToken[] { intType, commaToken }); 3519SyntaxFactory.SeparatedList<TypeSyntax>(new SyntaxNodeOrToken[] { intType, commaToken, intType }); 3520SyntaxFactory.SeparatedList<TypeSyntax>(new SyntaxNodeOrToken[] { intType, commaToken, intType, commaToken }); 3522Assert.Throws<ArgumentException>(() => SyntaxFactory.SeparatedList<TypeSyntax>(new SyntaxNodeOrToken[] { commaToken })); 3523Assert.Throws<ArgumentException>(() => SyntaxFactory.SeparatedList<TypeSyntax>(new SyntaxNodeOrToken[] { intType, commaToken, commaToken })); 3524Assert.Throws<ArgumentException>(() => SyntaxFactory.SeparatedList<TypeSyntax>(new SyntaxNodeOrToken[] { intType, intType }));
Microsoft.CodeAnalysis.CSharp.Test.Utilities (3)
FunctionPointerUtilities.cs (3)
243var paramSyntax = paramSyntaxes[i].Type!; 248var returnParam = paramSyntaxes[^1].Type; 252static void assertEqualSemanticInformation(SemanticModel model, TypeSyntax typeSyntax, ITypeSymbol signatureType)
Microsoft.CodeAnalysis.CSharp.Workspaces (179)
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, 713baseTypes.Add(SyntaxFactory.SimpleBaseType((TypeSyntax)baseType)); 716baseTypes.AddRange(interfaceTypes.Select(i => SyntaxFactory.SimpleBaseType((TypeSyntax)i))); 764var itypes = interfaceTypes?.Select(i => (BaseTypeSyntax)SyntaxFactory.SimpleBaseType((TypeSyntax)i)).ToList(); 785var itypes = interfaceTypes?.Select(i => (BaseTypeSyntax)SyntaxFactory.SimpleBaseType((TypeSyntax)i)).ToList(); 898underlyingType != null ? SyntaxFactory.BaseList([SyntaxFactory.SimpleBaseType((TypeSyntax)underlyingType)]) : null, 946returnType != null ? (TypeSyntax)returnType : SyntaxFactory.PredefinedType(VoidKeyword), 1848? SyntaxFactory.SeparatedList<TypeParameterConstraintSyntax>(types.Select(t => SyntaxFactory.TypeConstraint((TypeSyntax)t))) 2153private static TypeSyntax? NotVoid(TypeSyntax type) 2162SyntaxKind.DelegateDeclaration => ((DelegateDeclarationSyntax)declaration).WithReturnType((TypeSyntax)type), 2163SyntaxKind.MethodDeclaration => ((MethodDeclarationSyntax)declaration).WithReturnType((TypeSyntax)type), 2164SyntaxKind.FieldDeclaration => ((FieldDeclarationSyntax)declaration).WithDeclaration(((FieldDeclarationSyntax)declaration).Declaration.WithType((TypeSyntax)type)), 2165SyntaxKind.PropertyDeclaration => ((PropertyDeclarationSyntax)declaration).WithType((TypeSyntax)type), 2166SyntaxKind.IndexerDeclaration => ((IndexerDeclarationSyntax)declaration).WithType((TypeSyntax)type), 2167SyntaxKind.EventFieldDeclaration => ((EventFieldDeclarationSyntax)declaration).WithDeclaration(((EventFieldDeclarationSyntax)declaration).Declaration.WithType((TypeSyntax)type)), 2168SyntaxKind.EventDeclaration => ((EventDeclarationSyntax)declaration).WithType((TypeSyntax)type), 2169SyntaxKind.Parameter => ((ParameterSyntax)declaration).WithType((TypeSyntax)type), 2170SyntaxKind.LocalDeclarationStatement => ((LocalDeclarationStatementSyntax)declaration).WithDeclaration(((LocalDeclarationStatementSyntax)declaration).Declaration.WithType((TypeSyntax)type)), 2171SyntaxKind.VariableDeclaration => ((VariableDeclarationSyntax)declaration).WithType((TypeSyntax)type), 2832return WithBaseList(declaration, baseList.WithTypes(baseList.Types.Insert(0, SyntaxFactory.SimpleBaseType((TypeSyntax)baseType)))); 2836return AddBaseList(declaration, SyntaxFactory.BaseList([SyntaxFactory.SimpleBaseType((TypeSyntax)baseType)])); 2846return WithBaseList(declaration, baseList.WithTypes(baseList.Types.Insert(baseList.Types.Count, SyntaxFactory.SimpleBaseType((TypeSyntax)interfaceType)))); 2850return AddBaseList(declaration, SyntaxFactory.BaseList([SyntaxFactory.SimpleBaseType((TypeSyntax)interfaceType)])); 3327var arrayType = SyntaxFactory.ArrayType((TypeSyntax)elementType, [SyntaxFactory.ArrayRankSpecifier([(ExpressionSyntax)size])]); 3333var arrayType = SyntaxFactory.ArrayType((TypeSyntax)elementType, 3340=> SyntaxFactory.ObjectCreationExpression((TypeSyntax)type, CreateArgumentList(arguments), null); 3344(TypeSyntax)type, 3370=> SyntaxFactory.BinaryExpression(SyntaxKind.IsExpression, (ExpressionSyntax)Parenthesize(expression), (TypeSyntax)type); 3373=> SyntaxFactory.TypeOfExpression((TypeSyntax)type); 3376=> SyntaxFactory.BinaryExpression(SyntaxKind.AsExpression, (ExpressionSyntax)Parenthesize(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)
137ArrayBuilder<string> builder, TypeSyntax type, 597private static string GetTypeName(TypeSyntax type) 655if (node is TypeSyntax typeNode)
Rename\CSharpRenameRewriterLanguageService.cs (2)
1137if (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\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeStyle\TypeStyle\TypeStyleHelper.cs (1)
202public static bool IsPredefinedType(TypeSyntax type)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\DefaultExpressionSyntaxExtensions.cs (2)
42var typeSyntax = GetTypeSyntax(equalsValueClause); 67private static TypeSyntax GetTypeSyntax(EqualsValueClauseSyntax equalsValueClause)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
606while (topExpression.Parent is TypeSyntax typeSyntax)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\MemberDeclarationSyntaxExtensions.cs (1)
150public static TypeSyntax GetMemberType(this MemberDeclarationSyntax member)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (5)
185TypeSyntax type, 320TypeSyntax type, 345private static TypeSyntax GetOutermostType(TypeSyntax type) 346=> type.GetAncestorsOrThis<TypeSyntax>().Last();
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\VariableDeclaratorExtensions.cs (2)
13public static TypeSyntax GetVariableType(this VariableDeclaratorSyntax declarator) 25var variableTypeName = variable.GetVariableType();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (2)
751var type = memberDeclaration.GetMemberType(); 1502=> node is TypeSyntax;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\NameSyntaxComparer.cs (2)
119var xArg = x.TypeArgumentList.Arguments[i]; 120var yArg = y.TypeArgumentList.Arguments[i];
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpTypeStyleHelper.cs (6)
17private readonly TypeSyntax _typeName; 37public TypeStyleResult(CSharpTypeStyleHelper helper, TypeSyntax typeName, SemanticModel semanticModel, CSharpSimplifierOptions options, bool isStylePreferred, NotificationOption2 notificationOption, CancellationToken cancellationToken) : this() 58TypeSyntax typeName, SemanticModel semanticModel, 76TypeSyntax typeName, SemanticModel semanticModel, CSharpSimplifierOptions options, CancellationToken cancellationToken); 79SyntaxToken identifier, TypeSyntax typeName, ExpressionSyntax initializer, SemanticModel semanticModel, CSharpSimplifierOptions options, CancellationToken cancellationToken); 81internal TypeSyntax? FindAnalyzableType(SyntaxNode node, SemanticModel semanticModel, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpTypeStyleHelper.State.cs (3)
93var typeSyntax = GetTypeSyntaxFromDeclaration(declarationStatement); 132var typeSyntax = GetTypeSyntaxFromDeclaration(declarationStatement); 139private static TypeSyntax? GetTypeSyntaxFromDeclaration(SyntaxNode declarationStatement)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseExplicitTypeHelper.cs (3)
66TypeSyntax typeName, SemanticModel semanticModel, 142TypeSyntax typeName, 156private static bool ContainsAnonymousType(TypeSyntax typeName, SemanticModel semanticModel, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (6)
30TypeSyntax typeName, SemanticModel semanticModel, 50var type = variableDeclaration.Type.StripRefIfNeeded(); 61var type = forEachStatement.Type.StripRefIfNeeded(); 98TypeSyntax typeName, SemanticModel semanticModel, 184var declarationTypeNode = declarationExpression.Type; 251TypeSyntax typeName,
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\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (1)
783TypeSyntax newTypeSyntax;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\PropertyGenerator.cs (1)
158private static TypeSyntax GenerateTypeSyntax(IPropertySymbol property)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (2)
283if (expr is TypeSyntax) 494targetToken.GetPreviousToken(includeSkipped: true).IsLastTokenOfNode<TypeSyntax>())
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (11)
950{ Parent: TypeSyntax { Parent.RawKind: (int)SyntaxKind.FunctionPointerParameter } } => true, 1516if (leftToken.IsLastTokenOfNode<TypeSyntax>(out var typeSyntax)) 1521while (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\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
119var typeSyntax = targetType.GenerateTypeSyntax();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.cs (7)
33public static TypeSyntax GenerateTypeSyntax(this INamespaceOrTypeSymbol symbol, bool allowVar = true) 36private static TypeSyntax GenerateTypeSyntax( 47var syntax = containsAnonymousType 71public static TypeSyntax GenerateRefTypeSyntax( 74var underlyingType = GenerateTypeSyntax(symbol, allowVar) 81public static TypeSyntax GenerateRefReadOnlyTypeSyntax( 84var underlyingType = GenerateTypeSyntax(symbol, allowVar)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.ExpressionSyntaxGeneratorVisitor.cs (1)
43if (!_nameOnly && TypeSyntaxGeneratorVisitor.TryCreateNativeIntegerType(symbol, out var typeSyntax))
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\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\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpMoveDeclarationNearReferenceService.cs (1)
57var type = declarationStatement.Declaration.Type;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSyntaxGeneratorInternal.cs (7)
68type == null ? SyntaxFactory.IdentifierName("var") : (TypeSyntax)type, 237=> SyntaxFactory.TypePattern((TypeSyntax)type); 245=> SyntaxFactory.CastExpression((TypeSyntax)type, (ExpressionSyntax)Parenthesize(expression)).WithAdditionalAnnotations(Simplifier.Annotation); 248=> SyntaxFactory.DefaultExpression((TypeSyntax)type).WithAdditionalAnnotations(Simplifier.Annotation); 287var type = typeSymbol.GenerateTypeSyntax(); 312if (expression is TypeSyntax || 338=> SyntaxFactory.CastExpression((TypeSyntax)type, (ExpressionSyntax)Parenthesize(expression)).WithAdditionalAnnotations(Simplifier.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
2174var variableType = variableDeclarator.GetVariableType();
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (28)
CodeGeneration\AddImportsTests.cs (1)
47root = root.ReplaceNodes(root.DescendantNodesAndSelf().OfType<TypeSyntax>(),
CodeGeneration\SyntaxGeneratorTests.cs (27)
288VerifySyntax<TypeSyntax>(Generator.IdentifierName("x"), "x"); 289VerifySyntax<TypeSyntax>(Generator.QualifiedName(Generator.IdentifierName("x"), Generator.IdentifierName("y")), "x.y"); 290VerifySyntax<TypeSyntax>(Generator.DottedName("x.y"), "x.y"); 291VerifySyntax<TypeSyntax>(Generator.GenericName("x", Generator.IdentifierName("y")), "x<y>"); 292VerifySyntax<TypeSyntax>(Generator.GenericName("x", Generator.IdentifierName("y"), Generator.IdentifierName("z")), "x<y, z>"); 294VerifySyntax<TypeSyntax>(Generator.ArrayTypeExpression(Generator.IdentifierName("x")), "x[]"); 295VerifySyntax<TypeSyntax>(Generator.ArrayTypeExpression(Generator.ArrayTypeExpression(Generator.IdentifierName("x"))), "x[][]"); 296VerifySyntax<TypeSyntax>(Generator.NullableTypeExpression(Generator.IdentifierName("x")), "x?"); 297VerifySyntax<TypeSyntax>(Generator.NullableTypeExpression(Generator.NullableTypeExpression(Generator.IdentifierName("x"))), "x?"); 304VerifySyntax<TypeSyntax>(Generator.TupleTypeExpression(Generator.TupleElementExpression(Generator.IdentifierName("x")), Generator.TupleElementExpression(Generator.IdentifierName("y"))), "(x, y)"); 305VerifySyntax<TypeSyntax>(Generator.TupleTypeExpression(new[] { intType, intType }), "(global::System.Int32, global::System.Int32)"); 306VerifySyntax<TypeSyntax>(Generator.TupleTypeExpression(new[] { intType, intType }, ["x", "y"]), "(global::System.Int32 x, global::System.Int32 y)"); 312VerifySyntax<TypeSyntax>(Generator.TypeExpression(SpecialType.System_Byte), "byte"); 313VerifySyntax<TypeSyntax>(Generator.TypeExpression(SpecialType.System_SByte), "sbyte"); 315VerifySyntax<TypeSyntax>(Generator.TypeExpression(SpecialType.System_Int16), "short"); 316VerifySyntax<TypeSyntax>(Generator.TypeExpression(SpecialType.System_UInt16), "ushort"); 318VerifySyntax<TypeSyntax>(Generator.TypeExpression(SpecialType.System_Int32), "int"); 319VerifySyntax<TypeSyntax>(Generator.TypeExpression(SpecialType.System_UInt32), "uint"); 321VerifySyntax<TypeSyntax>(Generator.TypeExpression(SpecialType.System_Int64), "long"); 322VerifySyntax<TypeSyntax>(Generator.TypeExpression(SpecialType.System_UInt64), "ulong"); 324VerifySyntax<TypeSyntax>(Generator.TypeExpression(SpecialType.System_Single), "float"); 325VerifySyntax<TypeSyntax>(Generator.TypeExpression(SpecialType.System_Double), "double"); 327VerifySyntax<TypeSyntax>(Generator.TypeExpression(SpecialType.System_Char), "char"); 328VerifySyntax<TypeSyntax>(Generator.TypeExpression(SpecialType.System_String), "string"); 330VerifySyntax<TypeSyntax>(Generator.TypeExpression(SpecialType.System_Object), "object"); 331VerifySyntax<TypeSyntax>(Generator.TypeExpression(SpecialType.System_Decimal), "decimal"); 5284VerifySyntax<TypeSyntax>(
Microsoft.Interop.ComInterfaceGenerator (4)
Marshallers\ObjectUnwrapperResolver.cs (2)
13internal sealed record ObjectUnwrapperInfo(TypeSyntax UnwrapperType) : MarshallingInfo; 37TypeSyntax unwrapperType = ((ObjectUnwrapperInfo)info.MarshallingAttributeInfo).UnwrapperType;
VirtualMethodPointerStubGenerator.cs (1)
149(ParameterListSyntax unmanagedParameterList, TypeSyntax returnType, _) = stubGenerator.GenerateAbiMethodSignatureData();
VtableIndexStubGenerator.cs (1)
305var unwrapperSyntax = ParseTypeName(unmanagedObjectUnwrapper.AttributeClass.TypeArguments[0].ToDisplayString());
Microsoft.Interop.JavaScript.JSImportGenerator (7)
JSImportGenerator.cs (1)
315TypeSyntax 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)
441(ParameterListSyntax parameterList, TypeSyntax returnType, AttributeListSyntax returnTypeAttributes) = stubGenerator.GenerateTargetMethodSignatureData();
Microsoft.Interop.LibraryImportGenerator.Downlevel (1)
DownlevelLibraryImportGenerator.cs (1)
317(ParameterListSyntax parameterList, TypeSyntax returnType, AttributeListSyntax returnTypeAttributes) = stubGenerator.GenerateTargetMethodSignatureData();
Microsoft.Interop.SourceGeneration (99)
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 (61)
55public static TypeSyntax Void { get; } = PredefinedType(Token(SyntaxKind.VoidKeyword)); 57public static TypeSyntax VoidStar { get; } = PointerType(PredefinedType(Token(SyntaxKind.VoidKeyword))); 59public static TypeSyntax VoidStarStar { get; } = PointerType(PointerType(PredefinedType(Token(SyntaxKind.VoidKeyword)))); 61public static TypeSyntax Nint { get; } = ParseTypeName(TypeNames.Nint); 63private static TypeSyntax? _StringMarshalling; 64public static TypeSyntax StringMarshalling => _StringMarshalling ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.StringMarshalling); 66private static TypeSyntax? _System_Runtime_InteropServices_ComWrappers_ComInterfaceEntry; 67public static TypeSyntax System_Runtime_InteropServices_ComWrappers_ComInterfaceEntry => _System_Runtime_InteropServices_ComWrappers_ComInterfaceEntry ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.System_Runtime_InteropServices_ComWrappers_ComInterfaceEntry); 69private static TypeSyntax? _System_Runtime_InteropServices_NativeMemory; 70public static TypeSyntax System_Runtime_InteropServices_NativeMemory => _System_Runtime_InteropServices_NativeMemory ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.System_Runtime_InteropServices_NativeMemory); 72private static TypeSyntax? _StrategyBasedComWrappers; 73public static TypeSyntax StrategyBasedComWrappers => _StrategyBasedComWrappers ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.StrategyBasedComWrappers); 75private static TypeSyntax? _IUnmanagedVirtualMethodTableProvider; 76public static TypeSyntax IUnmanagedVirtualMethodTableProvider => _IUnmanagedVirtualMethodTableProvider ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.IUnmanagedVirtualMethodTableProvider); 78private static TypeSyntax? _IIUnknownInterfaceType; 79public static TypeSyntax IIUnknownInterfaceType => _IIUnknownInterfaceType ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.IIUnknownInterfaceType); 81private static TypeSyntax? _IIUnknownDerivedDetails; 82public static TypeSyntax IIUnknownDerivedDetails => _IIUnknownDerivedDetails ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.IIUnknownDerivedDetails); 84private static TypeSyntax? _UnmanagedObjectUnwrapper; 85public static TypeSyntax UnmanagedObjectUnwrapper => _UnmanagedObjectUnwrapper ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.UnmanagedObjectUnwrapper); 87private static TypeSyntax? _IComExposedClass; 88public static TypeSyntax IComExposedClass => _IComExposedClass ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.IComExposedClass); 90private static TypeSyntax? _UnreachableException; 91public static TypeSyntax UnreachableException => _UnreachableException ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.UnreachableException); 93private static TypeSyntax? _System_Runtime_CompilerServices_RuntimeHelpers; 94public static TypeSyntax System_Runtime_CompilerServices_RuntimeHelpers => _System_Runtime_CompilerServices_RuntimeHelpers ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.System_Runtime_CompilerServices_RuntimeHelpers); 96private static TypeSyntax? _System_Runtime_InteropServices_ComWrappers; 97public static TypeSyntax System_Runtime_InteropServices_ComWrappers => _System_Runtime_InteropServices_ComWrappers ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.System_Runtime_InteropServices_ComWrappers); 99private static TypeSyntax? _System_IntPtr; 100public static TypeSyntax System_IntPtr => _System_IntPtr ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.System_IntPtr); 102private static TypeSyntax? _System_Guid; 103public static TypeSyntax System_Guid => _System_Guid ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.System_Guid); 105private static TypeSyntax? _DllImportSearchPath; 106public static TypeSyntax DllImportSearchPath => _DllImportSearchPath ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.DllImportSearchPath); 108private static TypeSyntax? _System_Type; 109public static TypeSyntax System_Type => _System_Type ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.System_Type); 111private static TypeSyntax? _System_Activator; 112public static TypeSyntax System_Activator => _System_Activator ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.System_Activator); 114private static TypeSyntax? _System_Runtime_InteropServices_Marshal; 115public static TypeSyntax System_Runtime_InteropServices_Marshal => _System_Runtime_InteropServices_Marshal ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.System_Runtime_InteropServices_Marshal); 117private static TypeSyntax? _System_Runtime_InteropServices_UnmanagedType; 118public static TypeSyntax System_Runtime_InteropServices_UnmanagedType => _System_Runtime_InteropServices_UnmanagedType ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.System_Runtime_InteropServices_UnmanagedType); 120private static TypeSyntax? _System_Runtime_InteropServices_MemoryMarshal; 121public static TypeSyntax System_Runtime_InteropServices_MemoryMarshal => _System_Runtime_InteropServices_MemoryMarshal ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.System_Runtime_InteropServices_MemoryMarshal); 123private static TypeSyntax? _System_Exception; 124public static TypeSyntax System_Exception => _System_Exception ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.System_Exception); 126private static TypeSyntax? _System_GC; 127public static TypeSyntax System_GC => _System_GC ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.System_GC); 129private static TypeSyntax? _System_Runtime_InteropServices_ComWrappers_ComInterfaceDispatch; 130public static TypeSyntax System_Runtime_InteropServices_ComWrappers_ComInterfaceDispatch => _System_Runtime_InteropServices_ComWrappers_ComInterfaceDispatch ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.System_Runtime_InteropServices_ComWrappers_ComInterfaceDispatch); 132private static TypeSyntax? _System_Runtime_CompilerServices_Unsafe; 133public static TypeSyntax System_Runtime_CompilerServices_Unsafe => _System_Runtime_CompilerServices_Unsafe ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.System_Runtime_CompilerServices_Unsafe); 135private static TypeSyntax? _System_Runtime_InteropServices_LayoutKind; 136public static TypeSyntax System_Runtime_InteropServices_LayoutKind => _System_Runtime_InteropServices_LayoutKind ??= ParseTypeName(TypeNames.GlobalAlias + TypeNames.System_Runtime_InteropServices_LayoutKind); 138private static TypeSyntax? _CallConvCdecl; 139private static TypeSyntax? _CallConvFastcall; 140private static TypeSyntax? _CallConvMemberFunction; 141private static TypeSyntax? _CallConvStdcall; 142private static TypeSyntax? _CallConvSuppressGCTransition; 143private static TypeSyntax? _CallConvThiscall; 144public static TypeSyntax CallConv(string callConv)
TypeSymbolExtensions.cs (1)
170public static TypeSyntax AsTypeSyntax(this ITypeSymbol type)
UnmanagedToManagedStubGenerator.cs (1)
108public (ParameterListSyntax ParameterList, TypeSyntax ReturnType, AttributeListSyntax? ReturnTypeAttributes) GenerateAbiMethodSignatureData()
Utils\SyntaxFactoryExtensions.cs (4)
18public static LocalDeclarationStatementSyntax Declare(TypeSyntax typeSyntax, string identifier, bool initializeToDefault) 28public static LocalDeclarationStatementSyntax Declare(TypeSyntax typeSyntax, string identifier, ExpressionSyntax? initializer) 81public static GenericNameSyntax SpanOf(TypeSyntax type) => GenericName(_span, TypeArgumentList(SingletonSeparatedList(type))); 84public static GenericNameSyntax ReadOnlySpanOf(TypeSyntax type) => GenericName(_readonlySpan, TypeArgumentList(SingletonSeparatedList(type)));
VariableDeclarations.cs (1)
146TypeSyntax localType = marshaller.NativeType.Syntax;
Microsoft.VisualStudio.LanguageServices.CSharp (13)
CodeModel\CSharpCodeModelService.CodeModelEventCollector.cs (5)
145if (oldExpression is TypeSyntax typeSyntax) 147return CompareTypes(typeSyntax, (TypeSyntax)newExpression); 774private bool CompareTypes(TypeSyntax oldType, TypeSyntax newType) 828private static TypeSyntax GetReturnType(BaseMethodDeclarationSyntax method)
CodeModel\CSharpCodeModelService.cs (6)
971var typeName = SyntaxFactory.ParseTypeName(name); 2723TypeSyntax? oldType; 2743var newType = SyntaxFactory.ParseTypeName(typeName); 3015var parsedTypeName = SyntaxFactory.ParseTypeName(partialName); 3026var parsedTypeName = SyntaxFactory.ParseTypeName(fullName); 3699var typeName = SyntaxFactory.ParseTypeName(typeSymbol.ToMinimalDisplayString(semanticModel, position));
CodeModel\CSharpCodeModelService.NodeNameGenerator.cs (1)
58private static void AppendTypeName(StringBuilder builder, TypeSyntax type)
CodeModel\MethodXml\MethodXmlBuilder.cs (1)
142private bool TryGenerateType(TypeSyntax type)
Roslyn.Diagnostics.CSharp.Analyzers (108)
CSharpExposeMemberForTesting.cs (1)
48return SyntaxFactory.RefType(refKeyword, readOnlyKeyword, (TypeSyntax)type);
PreferNullLiteralCodeFixProvider.cs (1)
56var type = defaultExpression.Type;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeStyle\TypeStyle\TypeStyleHelper.cs (1)
202public static bool IsPredefinedType(TypeSyntax type)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\DefaultExpressionSyntaxExtensions.cs (2)
42var typeSyntax = GetTypeSyntax(equalsValueClause); 67private static TypeSyntax GetTypeSyntax(EqualsValueClauseSyntax equalsValueClause)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
606while (topExpression.Parent is TypeSyntax typeSyntax)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\MemberDeclarationSyntaxExtensions.cs (1)
150public static TypeSyntax GetMemberType(this MemberDeclarationSyntax member)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (5)
185TypeSyntax type, 320TypeSyntax type, 345private static TypeSyntax GetOutermostType(TypeSyntax type) 346=> type.GetAncestorsOrThis<TypeSyntax>().Last();
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\VariableDeclaratorExtensions.cs (2)
13public static TypeSyntax GetVariableType(this VariableDeclaratorSyntax declarator) 25var variableTypeName = variable.GetVariableType();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (2)
751var type = memberDeclaration.GetMemberType(); 1502=> node is TypeSyntax;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\NameSyntaxComparer.cs (2)
119var xArg = x.TypeArgumentList.Arguments[i]; 120var yArg = y.TypeArgumentList.Arguments[i];
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpTypeStyleHelper.cs (6)
17private readonly TypeSyntax _typeName; 37public TypeStyleResult(CSharpTypeStyleHelper helper, TypeSyntax typeName, SemanticModel semanticModel, CSharpSimplifierOptions options, bool isStylePreferred, NotificationOption2 notificationOption, CancellationToken cancellationToken) : this() 58TypeSyntax typeName, SemanticModel semanticModel, 76TypeSyntax typeName, SemanticModel semanticModel, CSharpSimplifierOptions options, CancellationToken cancellationToken); 79SyntaxToken identifier, TypeSyntax typeName, ExpressionSyntax initializer, SemanticModel semanticModel, CSharpSimplifierOptions options, CancellationToken cancellationToken); 81internal TypeSyntax? FindAnalyzableType(SyntaxNode node, SemanticModel semanticModel, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpTypeStyleHelper.State.cs (3)
93var typeSyntax = GetTypeSyntaxFromDeclaration(declarationStatement); 132var typeSyntax = GetTypeSyntaxFromDeclaration(declarationStatement); 139private static TypeSyntax? GetTypeSyntaxFromDeclaration(SyntaxNode declarationStatement)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseExplicitTypeHelper.cs (3)
66TypeSyntax typeName, SemanticModel semanticModel, 142TypeSyntax typeName, 156private static bool ContainsAnonymousType(TypeSyntax typeName, SemanticModel semanticModel, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (6)
30TypeSyntax typeName, SemanticModel semanticModel, 50var type = variableDeclaration.Type.StripRefIfNeeded(); 61var type = forEachStatement.Type.StripRefIfNeeded(); 98TypeSyntax typeName, SemanticModel semanticModel, 184var declarationTypeNode = declarationExpression.Type; 251TypeSyntax typeName,
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\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (1)
783TypeSyntax newTypeSyntax;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\PropertyGenerator.cs (1)
158private static TypeSyntax GenerateTypeSyntax(IPropertySymbol property)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (2)
283if (expr is TypeSyntax) 494targetToken.GetPreviousToken(includeSkipped: true).IsLastTokenOfNode<TypeSyntax>())
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (11)
950{ Parent: TypeSyntax { Parent.RawKind: (int)SyntaxKind.FunctionPointerParameter } } => true, 1516if (leftToken.IsLastTokenOfNode<TypeSyntax>(out var typeSyntax)) 1521while (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\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
119var typeSyntax = targetType.GenerateTypeSyntax();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.cs (7)
33public static TypeSyntax GenerateTypeSyntax(this INamespaceOrTypeSymbol symbol, bool allowVar = true) 36private static TypeSyntax GenerateTypeSyntax( 47var syntax = containsAnonymousType 71public static TypeSyntax GenerateRefTypeSyntax( 74var underlyingType = GenerateTypeSyntax(symbol, allowVar) 81public static TypeSyntax GenerateRefReadOnlyTypeSyntax( 84var underlyingType = GenerateTypeSyntax(symbol, allowVar)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.ExpressionSyntaxGeneratorVisitor.cs (1)
43if (!_nameOnly && TypeSyntaxGeneratorVisitor.TryCreateNativeIntegerType(symbol, out var typeSyntax))
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\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\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpMoveDeclarationNearReferenceService.cs (1)
57var type = declarationStatement.Declaration.Type;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSyntaxGeneratorInternal.cs (7)
68type == null ? SyntaxFactory.IdentifierName("var") : (TypeSyntax)type, 237=> SyntaxFactory.TypePattern((TypeSyntax)type); 245=> SyntaxFactory.CastExpression((TypeSyntax)type, (ExpressionSyntax)Parenthesize(expression)).WithAdditionalAnnotations(Simplifier.Annotation); 248=> SyntaxFactory.DefaultExpression((TypeSyntax)type).WithAdditionalAnnotations(Simplifier.Annotation); 287var type = typeSymbol.GenerateTypeSyntax(); 312if (expression is TypeSyntax || 338=> SyntaxFactory.CastExpression((TypeSyntax)type, (ExpressionSyntax)Parenthesize(expression)).WithAdditionalAnnotations(Simplifier.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
2174var variableType = variableDeclarator.GetVariableType();