475 references to ParameterSyntax
Microsoft.Analyzers.Extra (1)
CallAnalysis\Fixers\LegacyLoggingFixer.cs (1)
374if (loggerParam is ParameterSyntax parameterSyntax)
Microsoft.AspNetCore.App.Analyzers (7)
RouteEmbeddedLanguage\FrameworkParametersCompletionProvider.cs (4)
215if (((ParameterSyntax)container).Identifier == token) 358if (token.Parent?.Parent is ParameterSyntax parameter) 436foreach (var p in parameterList.Parameters) 438if (p is ParameterSyntax parameter &&
RouteEmbeddedLanguage\RoutePatternHighlighter.cs (1)
79if (syntaxNode is ParameterSyntax parameterSyntax)
RouteHandlers\DisallowNonParsableComplexTypesOnParameters.cs (2)
47var syntax = (ParameterSyntax)handlerDelegateParameter.DeclaringSyntaxReferences[0].GetSyntax(context.CancellationToken);
Microsoft.AspNetCore.App.CodeFixes (5)
DetectMismatchedParameterOptionalityFixer.cs (2)
46if (param is ParameterSyntax { Type: { } parameterType } parameterSyntax) 48var newParam = parameterSyntax.WithType(SyntaxFactory.NullableType(parameterType));
RouteParameterUnusedParameterFixer.cs (3)
89var newParameter = SyntaxFactory.Parameter(SyntaxFactory.Identifier(routeParameterName!)).WithType(type); 102private static SyntaxNode AddParameter(BaseMethodDeclarationSyntax syntax, ParameterSyntax parameterSyntax, int parameterIndex) 113private static SyntaxNode AddParameter(ParenthesizedLambdaExpressionSyntax syntax, ParameterSyntax parameterSyntax, int parameterIndex)
Microsoft.CodeAnalysis.CSharp (99)
Binder\Binder.IdentifierUsedAsValueFinder.cs (1)
146case ParameterSyntax:
Binder\Binder.QueryUnboundLambdaState.cs (1)
54public override ParameterSyntax ParameterSyntax(int index) => null;
Binder\Binder_Conversions.cs (2)
1108Debug.Assert(!isParamsModifierValidation || syntax is ParameterSyntax); 1195((ParameterSyntax)node).Modifiers.First(static m => m.IsKind(SyntaxKind.ParamsKeyword)).GetLocation(),
Binder\Binder_Expressions.cs (1)
8062(Flags.Includes(BinderFlags.CollectionExpressionConversionValidation | BinderFlags.CollectionInitializerAddMethod) && name is ParameterSyntax))
Binder\Binder_Initializers.cs (1)
120case ParameterSyntax parameterSyntax: // Initializer for a generated property based on record parameters
Binder\Binder_Lambda.cs (8)
55SeparatedSyntaxList<ParameterSyntax>? parameterSyntaxList = null; 138foreach (var p in parameterSyntaxList.Value) 246static ImmutableArray<bool> computeDiscards(SeparatedSyntaxList<ParameterSyntax> parameters, int underscoresCount) 255foreach (var p in parameters) 307SeparatedSyntaxList<ParameterSyntax> parameterSyntaxList, BindingDiagnosticBag diagnostics) 317var parameter = parameterSyntaxList[i]; 336static void checkForImplicitDefault(bool hasType, ParameterSyntax param, BindingDiagnosticBag diagnostics) 359var paramSyntax = lambda.ParameterSyntax(i);
BoundTree\UnboundLambda.cs (6)
402SeparatedSyntaxList<ParameterSyntax>? syntaxList, 480public ParameterSyntax? ParameterSyntax(int index) => Data.ParameterSyntax(index); 565public abstract ParameterSyntax? ParameterSyntax(int i); 1437private readonly SeparatedSyntaxList<ParameterSyntax>? _parameterSyntaxList; 1452SeparatedSyntaxList<ParameterSyntax>? parameterSyntaxList, 1545public override ParameterSyntax ParameterSyntax(int index)
Compilation\CSharpSemanticModel.cs (3)
3213public abstract IParameterSymbol GetDeclaredSymbol(ParameterSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)); 3225ParameterSyntax parameter, 5120return this.GetDeclaredSymbol((ParameterSyntax)node, cancellationToken);
Compilation\InitializerSemanticModel.cs (4)
59internal static InitializerSemanticModel Create(PublicSemanticModel containingSemanticModel, ParameterSyntax syntax, ParameterSymbol parameterSymbol, Binder rootBinder, ImmutableDictionary<Symbol, Symbol> parentRemappedSymbolsOpt) 89rootSyntax = ((ParameterSyntax)rootSyntax).Default; 130equalsValue = ((ParameterSyntax)node).Default; 283return SourceComplexParameterSymbolBase.GetDefaultValueSyntaxForIsNullableAnalysisEnabled(Root as ParameterSyntax) is { } value &&
Compilation\MemberSemanticModel.cs (3)
814public override IParameterSymbol GetDeclaredSymbol(ParameterSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 829ParameterSyntax parameter, 863ParameterSyntax parameter,
Compilation\PublicSemanticModel.cs (1)
40ParameterSyntax or
Compilation\SpeculativeSemanticModelWithMemberModel.cs (3)
168case ParameterSyntax paramDecl: 185private MemberSemanticModel GetOrAddModelForParameter(SyntaxNode node, MemberSemanticModel containing, ParameterSyntax paramDecl) 365public override IParameterSymbol GetDeclaredSymbol(ParameterSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken))
Compilation\SyntaxTreeSemanticModel.cs (10)
958return GetOrAddModelForParameter((ParameterSyntax)memberDecl, span); 1004private MemberSemanticModel GetOrAddModelForParameter(ParameterSyntax paramDecl, TextSpan span) 1150ParameterSyntax parameterDecl = (ParameterSyntax)node.Parent; 2007ParameterSyntax parameter, 2044ParameterSyntax parameter, 2071ParameterSyntax parameter, 2109public override IParameterSymbol GetDeclaredSymbol(ParameterSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 2123private ParameterSymbol GetDeclaredNonLambdaParameterSymbol(ParameterSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)) 2507case ParameterSyntax param when declaredSymbol.Kind == SymbolKind.Property && param.Parent?.Parent is RecordDeclarationSyntax recordDeclaration && recordDeclaration.ParameterList == param.Parent:
CSharpExtensions.cs (1)
1562public static IParameterSymbol? GetDeclaredSymbol(this SemanticModel? semanticModel, ParameterSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken))
Lowering\Instrumentation\DebugInfoInjector.cs (2)
109else if (original.Syntax is ParameterSyntax parameterSyntax) 412if (original.Syntax is ParameterSyntax parameterSyntax)
Lowering\Instrumentation\DebugInfoInjector_SequencePoints.cs (1)
48private static TextSpan CreateSpan(ParameterSyntax parameter)
Parser\LanguageParser.cs (11)
3366default(SeparatedSyntaxList<ParameterSyntax>), 4584private SeparatedSyntaxList<ParameterSyntax> ParseParameterList( 4611LanguageParser @this, ref SyntaxToken open, SeparatedSyntaxListBuilder<ParameterSyntax> list, SyntaxKind expectedKind, SyntaxKind closeKind) 4643private static bool CanReuseParameter(CSharp.Syntax.ParameterSyntax parameter) 4679private ParameterSyntax ParseParameter() 4681if (this.IsIncrementalAndFactoryContextMatches && CanReuseParameter(this.CurrentNode as CSharp.Syntax.ParameterSyntax)) 4683return (ParameterSyntax)this.EatNode(); 8459var parameter = (ParameterSyntax)separatedParameters[0]; 13403LanguageParser @this, ref SyntaxToken openParen, SeparatedSyntaxListBuilder<ParameterSyntax> list, SyntaxKind expectedKind, SyntaxKind closeKind) 13436private ParameterSyntax ParseLambdaParameter()
src\Compilers\CSharp\CSharpAnalyzerDriver\CSharpDeclarationComputer.cs (1)
350private static IEnumerable<SyntaxNode> GetParameterInitializersAndAttributes(ParameterSyntax parameter) =>
Symbols\FieldOrPropertyInitializer.cs (1)
25/// or <see cref="ParameterSyntax"/> for an initialization of a generated property based on record parameter.
Symbols\Source\LambdaSymbol.cs (1)
357ParameterSyntax? paramSyntax = null;
Symbols\Source\ParameterHelpers.cs (6)
30return MakeParameters<ParameterSyntax, SourceParameterSymbol, Symbol>( 42ParameterSyntax syntax, RefKind refKind, int ordinal, 150if (parameterSyntax is ParameterSyntax concreteParam) 661bool isDefault = syntax is ParameterSyntax { Default: { } }; 688Location loc = ((ParameterSyntax)syntax).Identifier.GetNextToken(includeZeroWidth: true).GetLocation(); //could be missing 710ParameterSyntax parameterSyntax,
Symbols\Source\SourceComplexParameterSymbol.cs (11)
73var parameterSyntax = this.ParameterSyntax; 86private ParameterSyntax ParameterSyntax => (ParameterSyntax)_syntaxRef?.GetSyntax(); 224internal static SyntaxNode? GetDefaultValueSyntaxForIsNullableAnalysisEnabled(ParameterSyntax? parameterSyntax) => 313var parameterSyntax = this.ParameterSyntax; 365var parameterSyntax = this.ParameterSyntax; 516var syntax = this.ParameterSyntax; 1573var syntax = ParameterSyntax; 1632var syntax = ParameterSyntax; 1665bool isAtLeastAsVisible(ParameterSyntax syntax, Binder binder, MethodSymbol method, BindingDiagnosticBag diagnostics) 1676void checkIsAtLeastAsVisible(ParameterSyntax syntax, Binder binder, MethodSymbol method, BindingDiagnosticBag diagnostics)
Symbols\Source\SourceOrdinaryMethodSymbol.cs (1)
100isExtensionMethod: syntax.ParameterList.Parameters.FirstOrDefault() is ParameterSyntax firstParam &&
Symbols\Source\SourceParameterSymbol.cs (2)
34ParameterSyntax syntax, 280GetDeclaringSyntaxReferenceHelper<ParameterSyntax>(this.Locations);
Symbols\Source\SourcePropertySymbol.cs (1)
629ParameterSyntax parameterSyntax = parameterSyntaxOpt.Parameters[0];
Symbols\Synthesized\Records\SynthesizedRecordPropertySymbol.cs (2)
53=> ((ParameterSyntax)CSharpSyntaxNode).Type!.Location; 88((ParameterSyntax)syntax).Identifier.GetLocation(),
Symbols\VarianceSafety.cs (2)
247var syntax = p.GetDeclaringSyntax<ParameterSyntax>();
Syntax\ParameterListSyntax.cs (1)
18foreach (ParameterSyntax parameter in this.Parameters)
Syntax\SimpleLambdaExpressionSyntax.cs (7)
16public SimpleLambdaExpressionSyntax Update(SyntaxToken asyncKeyword, ParameterSyntax parameter, SyntaxToken arrowToken, CSharpSyntaxNode body) 30public SimpleLambdaExpressionSyntax Update(SyntaxToken asyncKeyword, ParameterSyntax parameter, SyntaxToken arrowToken, BlockSyntax? block, ExpressionSyntax? expressionBody) 33public SimpleLambdaExpressionSyntax Update(SyntaxTokenList modifiers, ParameterSyntax parameter, SyntaxToken arrowToken, BlockSyntax? block, ExpressionSyntax? expressionBody) 42public static SimpleLambdaExpressionSyntax SimpleLambdaExpression(SyntaxToken asyncKeyword, ParameterSyntax parameter, SyntaxToken arrowToken, BlockSyntax? block, ExpressionSyntax? expressionBody) 45public static SimpleLambdaExpressionSyntax SimpleLambdaExpression(ParameterSyntax parameter, BlockSyntax? block, ExpressionSyntax? expressionBody) 48public static SimpleLambdaExpressionSyntax SimpleLambdaExpression(SyntaxTokenList modifiers, ParameterSyntax parameter, SyntaxToken arrowToken, BlockSyntax? block, ExpressionSyntax? expressionBody) 51public static SimpleLambdaExpressionSyntax SimpleLambdaExpression(SyntaxTokenList modifiers, ParameterSyntax parameter, BlockSyntax? block, ExpressionSyntax? expressionBody)
Syntax\SyntaxFactory.cs (2)
2743public static SimpleLambdaExpressionSyntax SimpleLambdaExpression(ParameterSyntax parameter, CSharpSyntaxNode body) 2748public static SimpleLambdaExpressionSyntax SimpleLambdaExpression(SyntaxToken asyncKeyword, ParameterSyntax parameter, SyntaxToken arrowToken, CSharpSyntaxNode body)
Syntax\SyntaxNormalizer.cs (2)
251if (currentToken.Parent is AttributeListSyntax && currentToken.Parent.Parent is not ParameterSyntax) 301return (nextToken.Parent is AttributeListSyntax && !(nextToken.Parent.Parent is ParameterSyntax)) ? 1 : 0;
Microsoft.CodeAnalysis.CSharp.CodeStyle (22)
src\Analyzers\CSharp\Analyzers\NamingStyle\CSharpNamingStyleDiagnosticAnalyzer.cs (1)
31&& symbol.DeclaringSyntaxReferences.FirstOrDefault()?.GetSyntax() is ParameterSyntax
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (1)
287private static SeparatedSyntaxList<ParameterSyntax> GetParameters(AnonymousFunctionExpressionSyntax expression)
src\Analyzers\CSharp\Analyzers\SimplifyLinqExpression\CSharpSimplifyLinqTypeCheckAndCastDiagnosticAnalyzer.cs (1)
41[NotNullWhen(true)] out ParameterSyntax? lambdaParameter)
src\Analyzers\CSharp\Analyzers\UseNameofInNullableAttribute\CSharpUseNameofInNullableAttributeDiagnosticAnalyzer.cs (2)
122if (container is ParameterSyntax) 135foreach (var parameter in parameters.Parameters)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\DefaultExpressionSyntaxExtensions.cs (1)
74else if (equalsValueClause?.Parent is ParameterSyntax parameter)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
175if (expression.GetAncestor<ParameterSyntax>() != null)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\MemberDeclarationSyntaxExtensions.DeclarationFinder.cs (1)
57public override void VisitParameter(ParameterSyntax node)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (1)
478public static IParameterSymbol GetRequiredDeclaredSymbol(this SemanticModel semanticModel, ParameterSyntax syntax, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (2)
162ParameterSyntax parameter => parameter.AttributeLists, 745ParameterSyntax parameter => parameter.Modifiers,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\ElasticTriviaFormattingRule.cs (2)
346if (previousToken.GetAncestor<ParameterSyntax>() == null 406if (parent.Parent is ParameterSyntax)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SuppressFormattingRule.cs (1)
221if (node is ParameterSyntax parameterNode)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpAccessibilityFacts.cs (1)
312ParameterSyntax parameter => parameter.Modifiers,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpHeaderFacts.cs (1)
53var node = TryGetAncestorForLocation<ParameterSyntax>(root, position);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (2)
1725var parameter = (ParameterSyntax)node;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (4)
217var originalParam = originalParams[i]; 218var replacedParam = replacedParams[i]; 265private bool HaveSameParameterType(ParameterSyntax originalParam, ParameterSyntax replacedParam)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (22)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (1)
379IEnumerable<ParameterSyntax> propertiesToAddAsParams,
src\Analyzers\CSharp\CodeFixes\Nullable\CSharpDeclareAsNullableCodeFixProvider.cs (2)
254if (node.Parent?.Parent is ParameterSyntax optionalParameter) 304if (parameterSymbol?.DeclaringSyntaxReferences.FirstOrDefault()?.GetSyntax(cancellationToken) is ParameterSyntax parameterSyntax &&
src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (2)
250static ParameterSyntax PromoteParameter(SyntaxGenerator generator, ParameterSyntax parameterNode, IParameterSymbol delegateParameter)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (5)
296var parameterSyntax = ParameterGenerator.GetParameter(parameter, info, isExplicit: false, isFirstParam: isFirstParam, seenOptional: seenOptional); 335ParameterSyntax parameter => Cast<TDeclarationNode>(parameter.AddAttributeLists(attributeSyntaxList)), 422case ParameterSyntax parameter: 844var parameterSyntax = (ParameterSyntax)syntaxNode;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ParameterGenerator.cs (6)
42internal static ImmutableArray<ParameterSyntax> GetParameters( 50var result = new FixedSizeArrayBuilder<ParameterSyntax>(parameterDefinitions.Length); 53var parameter = GetParameter(p, info, isExplicit, isFirstParam, seenOptional); 62internal static ParameterSyntax GetParameter(IParameterSymbol parameter, CSharpCodeGenerationContextInfo info, bool isExplicit, bool isFirstParam, bool seenOptional) 64var reusableSyntax = GetReuseableSyntaxNodeForSymbol<ParameterSyntax>(parameter, info);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\CSharpSyntaxContext.cs (1)
393token.Parent.Parent is ParameterSyntax { Parent: ParameterListSyntax { Parent: RecordDeclarationSyntax record } })
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (4)
1098token.Parent.Parent is ParameterSyntax parameter3 && 1106ParameterSyntax? parameter4 = null; 1109parameter4 = token.Parent as ParameterSyntax; 1114parameter4 = scopedIdentifierName.Parent as ParameterSyntax;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
1813LambdaExpressionSyntax lambdaExpression, ParameterSyntax parameter)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (14)
RefactoringHelpers\RefactoringHelpersTests.cs (14)
757await TestAsync<ParameterSyntax>(testText); 1352await TestAsync<ParameterSyntax>(testText); 1366await TestMissingAsync<ParameterSyntax>(testText); 1380await TestMissingAsync<ParameterSyntax>(testText); 1394await TestMissingAsync<ParameterSyntax>(testText); 1408await TestMissingAsync<ParameterSyntax>(testText); 1422await TestMissingAsync<ParameterSyntax>(testText); 1436await TestAsync<ParameterSyntax>(testText); 1450await TestAsync<ParameterSyntax>(testText); 1464await TestAsync<ParameterSyntax>(testText); 1478await TestAsync<ParameterSyntax>(testText); 1492await TestAsync<ParameterSyntax>(testText); 1506await TestAsync<ParameterSyntax>(testText); 1520await TestAsync<ParameterSyntax>(testText);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (22)
Semantics\OutVarTests.cs (1)
36534var equalsValue = method.DescendantNodes().OfType<ParameterSyntax>().Single()
Semantics\ParamsCollectionTests.cs (8)
2757var parameter = (IParameterSymbol)model.GetDeclaredSymbol(tree.GetRoot().DescendantNodes().OfType<ParameterSyntax>().Single()); 2791parameter = (IParameterSymbol)model.GetDeclaredSymbol(tree.GetRoot().DescendantNodes().OfType<ParameterSyntax>().Single()); 2955var parameter = (IParameterSymbol)model.GetDeclaredSymbol(tree.GetRoot().DescendantNodes().OfType<ParameterSyntax>().Single()); 2986parameter = (IParameterSymbol)model.GetDeclaredSymbol(tree.GetRoot().DescendantNodes().OfType<ParameterSyntax>().Single()); 4340var parameter = (IParameterSymbol)model.GetDeclaredSymbol(tree.GetRoot().DescendantNodes().OfType<ParameterSyntax>().First()); 4346parameter = (IParameterSymbol)model.GetDeclaredSymbol(tree.GetRoot().DescendantNodes().OfType<ParameterSyntax>().Skip(1).First()); 9072var parameterDecl = tree.GetRoot().DescendantNodes().OfType<ParameterSyntax>().Where(p => p.Identifier.ValueText == "paramsParameter").Single();
Semantics\PrimaryConstructorTests.cs (1)
420var parameters = tree.GetRoot().DescendantNodes().OfType<ParameterSyntax>().ToArray();
Semantics\RecordTests.cs (12)
448var parameterSyntax = tree.GetRoot().DescendantNodes().OfType<ParameterSyntax>().Single(); 517Assert.IsType<ParameterSyntax>(primaryCtor.Parameters[1].DeclaringSyntaxReferences.Single().GetSyntax()); 549Assert.IsType<ParameterSyntax>(primaryCtor.Parameters[0].DeclaringSyntaxReferences.Single().GetSyntax()); 550Assert.IsType<ParameterSyntax>(primaryCtor.Parameters[1].DeclaringSyntaxReferences.Single().GetSyntax()); 551Assert.IsType<ParameterSyntax>(primaryCtor.Parameters[2].DeclaringSyntaxReferences.Single().GetSyntax()); 575Assert.IsType<ParameterSyntax>(ctor.Parameters[1].DeclaringSyntaxReferences.Single().GetSyntax()); 603Assert.IsType<ParameterSyntax>(ctor.Parameters[1].DeclaringSyntaxReferences.Single().GetSyntax()); 638Assert.IsType<ParameterSyntax>(comp.GetMember<NamedTypeSymbol>("A").Constructors[0].Parameters[1].DeclaringSyntaxReferences.Single().GetSyntax()); 672Assert.IsType<ParameterSyntax>(comp.GetMember<NamedTypeSymbol>("A").Constructors[0].Parameters[1].DeclaringSyntaxReferences.Single().GetSyntax()); 697Assert.IsType<ParameterSyntax>(ctor.Parameters[0].DeclaringSyntaxReferences.Single().GetSyntax()); 698Assert.IsType<ParameterSyntax>(ctor.Parameters[1].DeclaringSyntaxReferences.Single().GetSyntax());
Microsoft.CodeAnalysis.CSharp.Features (45)
ChangeSignature\CSharpChangeSignatureService.cs (2)
644private static ParameterSyntax CreateNewParameterSyntax(AddedParameter addedParameter) 647private static ParameterSyntax CreateNewParameterSyntax(AddedParameter addedParameter, bool skipParameterType)
CodeRefactorings\ConvertLocalFunctionToMethod\CSharpConvertLocalFunctionToMethodCodeRefactoringProvider.cs (1)
267private static ParameterSyntax GenerateParameter(IParameterSymbol parameter, string name)
Completion\CompletionProviders\DeclarationName\DeclarationNameInfo.cs (3)
435result = IsLastTokenOfType<ParameterSyntax>( 443token.GetAncestor<ParameterSyntax>()?.Parent?.Parent is (kind: SyntaxKind.RecordDeclaration or SyntaxKind.RecordStructDeclaration)) 455result = IsLastTokenOfType<ParameterSyntax>(
Completion\CompletionProviders\DeclarationName\DeclarationNameRecommender.cs (2)
288var parameterSyntax = context.LeftToken.GetAncestor(n => n.IsKind(SyntaxKind.Parameter)) as ParameterSyntax;
ConvertLinq\ConvertForEachToLinqQuery\AbstractConverter.cs (1)
275var lambdaParameter = Parameter(Identifier(parentForEachStatement.Identifier.ValueText));
EditAndContinue\BreakpointSpans.cs (5)
223var parameter = GetParameter(position, typeDeclaration.ParameterList.Parameters); 230static ParameterSyntax? GetParameter(int position, SeparatedSyntaxList<ParameterSyntax> parameters) 527internal static TextSpan CreateSpanForRecordParameter(ParameterSyntax parameter) 530internal static IEnumerable<SyntaxToken> GetActiveTokensForRecordParameter(ParameterSyntax parameter)
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (8)
75/// <see cref="ParameterSyntax"/> for record primary constructor parameters. 1092if (oldNode is ParameterSyntax or TypeParameterSyntax or TypeParameterConstraintClauseSyntax || 1093newNode is ParameterSyntax or TypeParameterSyntax or TypeParameterConstraintClauseSyntax) 1124if (oldNode is ParameterSyntax { Parent.Parent: RecordDeclarationSyntax } || 1125newNode is ParameterSyntax { Parent.Parent: RecordDeclarationSyntax }) 1431Debug.Assert(node is null or ParameterSyntax or TypeParameterSyntax or TypeParameterConstraintClauseSyntax); 1747var parameter = (ParameterSyntax)node;
EditAndContinue\DeclarationBody\RecordParameterDeclarationBody.cs (1)
14internal sealed class RecordParameterDeclarationBody(ParameterSyntax parameter) : PropertyOrIndexerAccessorDeclarationBody
EditAndContinue\SyntaxComparer.cs (3)
909distance = ComputeDistance((ParameterSyntax)leftNode, (ParameterSyntax)rightNode); 1493return ((ParameterSyntax)node).Identifier;
EditAndContinue\SyntaxUtilities.cs (1)
69ParameterSyntax { Parent.Parent: RecordDeclarationSyntax } parameterSyntax when symbol is not IParameterSymbol
InitializeParameter\CSharpAddParameterCheckCodeRefactoringProvider.cs (1)
25ParameterSyntax,
InitializeParameter\CSharpInitializeMemberFromParameterCodeRefactoringProvider.cs (1)
21ParameterSyntax,
InitializeParameter\CSharpInitializeMemberFromPrimaryConstructorParameterCodeRefactoringProvider.cs (1)
43var selectedParameter = await context.TryGetRelevantNodeAsync<ParameterSyntax>().ConfigureAwait(false);
InlineHints\CSharpInlineTypeHintsService.cs (1)
74if (node is ParameterSyntax { Type: null } parameterNode)
LanguageServices\CSharpSymbolDisplayService.SymbolDescriptionBuilder.cs (2)
212var syntax = await GetFirstDeclarationAsync<ParameterSyntax>(symbol).ConfigureAwait(false);
src\Analyzers\CSharp\Analyzers\NamingStyle\CSharpNamingStyleDiagnosticAnalyzer.cs (1)
31&& symbol.DeclaringSyntaxReferences.FirstOrDefault()?.GetSyntax() is ParameterSyntax
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (1)
287private static SeparatedSyntaxList<ParameterSyntax> GetParameters(AnonymousFunctionExpressionSyntax expression)
src\Analyzers\CSharp\Analyzers\SimplifyLinqExpression\CSharpSimplifyLinqTypeCheckAndCastDiagnosticAnalyzer.cs (1)
41[NotNullWhen(true)] out ParameterSyntax? lambdaParameter)
src\Analyzers\CSharp\Analyzers\UseNameofInNullableAttribute\CSharpUseNameofInNullableAttributeDiagnosticAnalyzer.cs (1)
122if (container is ParameterSyntax)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (1)
379IEnumerable<ParameterSyntax> propertiesToAddAsParams,
src\Analyzers\CSharp\CodeFixes\Nullable\CSharpDeclareAsNullableCodeFixProvider.cs (2)
254if (node.Parent?.Parent is ParameterSyntax optionalParameter) 304if (parameterSymbol?.DeclaringSyntaxReferences.FirstOrDefault()?.GetSyntax(cancellationToken) is ParameterSyntax parameterSyntax &&
src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (2)
250static ParameterSyntax PromoteParameter(SyntaxGenerator generator, ParameterSyntax parameterNode, IParameterSymbol delegateParameter)
src\Compilers\CSharp\CSharpAnalyzerDriver\CSharpDeclarationComputer.cs (1)
350private static IEnumerable<SyntaxNode> GetParameterInitializersAndAttributes(ParameterSyntax parameter) =>
Wrapping\SeparatedSyntaxList\CSharpParameterWrapper.cs (2)
17: AbstractCSharpSeparatedSyntaxListWrapper<BaseParameterListSyntax, ParameterSyntax> 44protected override SeparatedSyntaxList<ParameterSyntax> GetListItems(BaseParameterListSyntax listSyntax)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (18)
Semantics\LambdaDiscardParametersTests.cs (4)
68var underscores = tree.GetRoot().DescendantNodes().OfType<ParameterSyntax>().Where(p => p.Identifier.ToString() == "_").ToArray(); 110private static void VerifyDiscardParameterSymbol(ParameterSyntax underscore, string expectedType, CodeAnalysis.NullableAnnotation expectedAnnotation, SemanticModel model) 417var underscoreParameters = tree.GetRoot().DescendantNodes().OfType<ParameterSyntax>().Where(p => p.ToString() == "_").ToArray(); 566var underscoreParameters = tree.GetRoot().DescendantNodes().OfType<ParameterSyntax>().Where(p => p.ToString() == "_").ToArray();
Semantics\LambdaTests.cs (4)
3013ParameterSyntax parameterSyntax = tree.GetCompilationUnitRoot().DescendantNodes().OfType<ParameterSyntax>().Single(); 3054ParameterSyntax parameterSyntax = tree.GetCompilationUnitRoot().DescendantNodes().OfType<ParameterSyntax>().Single();
Semantics\LocalFunctionTests.cs (4)
853var parameter = localFunction.ParameterList.Parameters.Single(); 4726var parameter = descendents.OfType<ParameterSyntax>().Single(); 5113void verifyTypeParameterAndParameter(TypeParameterSyntax typeParameter, ParameterSyntax parameter, string expected)
Semantics\RecordStructTests.cs (2)
5849var parameterSyntax = tree.GetRoot().DescendantNodes().OfType<ParameterSyntax>().Single();
Semantics\TargetTypedDefaultTests.cs (2)
3713var parameters = nodes.OfType<ParameterSyntax>().ToArray(); 3715foreach (var parameter in parameters)
Semantics\UnsafeTests.cs (2)
11837var parameterSyntax = tree.GetCompilationUnitRoot().DescendantNodes().OfType<ParameterSyntax>().Single();
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (55)
Compilation\GetSemanticInfoTests.cs (8)
2566var expr = tree.GetRoot().DescendantNodes().OfType<ParameterSyntax>().First(); 4400var syntax = tree.GetCompilationUnitRoot().DescendantNodes().OfType<ParameterSyntax>().Last(); 4757var parameterSyntax = trueLiteral.FirstAncestorOrSelf<ParameterSyntax>(); 5484var parameterSyntax = invocationSyntax.DescendantNodes().OfType<ParameterSyntax>().First();
Compilation\SemanticModelAPITests.cs (18)
353var paramdecl = tree.GetCompilationUnitRoot().DescendantNodes().OfType<ParameterSyntax>().First(); 375var paramdecl1 = tree1.GetCompilationUnitRoot().DescendantNodes().OfType<ParameterSyntax>().First(); 377var paramdecl2 = tree2.GetCompilationUnitRoot().DescendantNodes().OfType<ParameterSyntax>().First(); 898var pParam01 = tree.GetCompilationUnitRoot().DescendantNodes().OfType<ParameterSyntax>().First(); 899var pParam02 = tree.GetCompilationUnitRoot().DescendantNodes().OfType<ParameterSyntax>().Last(); 966var para1 = tree1.GetCompilationUnitRoot().DescendantNodes().OfType<ParameterSyntax>().First(); 967var para2 = tree2.GetCompilationUnitRoot().DescendantNodes().OfType<ParameterSyntax>().First(); 1195var paras = descendants.OfType<ParameterSyntax>(); 1550var param = methodDecl.ParameterList.Parameters[0]; 1963var lambdaParam = lambdaExpression.ParameterList.Parameters[0]; 2684var lambdaParam = lambdaExpression.ParameterList.Parameters[0];
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (13)
335var paramDecl = indexerDecl.ParameterList.Parameters[0]; 1333var parameterDecl = (ParameterSyntax)methodDecl.ParameterList.Parameters[0]; 1345parameterDecl = (ParameterSyntax)methodDecl.ParameterList.Parameters[1]; 1436var parameterDecl = (ParameterSyntax)methodDecl.ParameterList.Parameters[0]; 1450parameterDecl = (ParameterSyntax)methodDecl.ParameterList.Parameters[1]; 3901var param = tree.GetCompilationUnitRoot().DescendantNodes().OfType<ParameterSyntax>().Where(p => p.Identifier.ValueText == "name").First(); 5222var decls = tree.GetCompilationUnitRoot().DescendantNodes().OfType<ParameterSyntax>().ToArray(); 5243var decls = tree.GetCompilationUnitRoot().DescendantNodes().OfType<ParameterSyntax>().ToArray(); 5264var decls = tree.GetCompilationUnitRoot().DescendantNodes().OfType<ParameterSyntax>().ToArray(); 5644ParameterSyntax decl,
Symbols\PartialPropertiesTests.cs (1)
5006var parameters = tree.GetRoot().DescendantNodes().OfType<ParameterSyntax>().ToArray();
Symbols\Source\EventTests.cs (4)
441var parameterSyntax = lambdaSyntax.DescendantNodes().OfType<ParameterSyntax>().First(); 487var parameterSyntax = lambdaSyntax.DescendantNodes().OfType<ParameterSyntax>().First();
Symbols\Source\FileModifierTests.cs (7)
4124var voidTypeSyntax = tree.GetRoot().DescendantNodes().OfType<ParameterSyntax>().Single().Type!; 4410var node = tree.GetRoot().DescendantNodes().OfType<ParameterSyntax>().Single(); 4454var node = tree.GetRoot().DescendantNodes().OfType<ParameterSyntax>().Single(); 4477var node = tree.GetRoot().DescendantNodes().OfType<ParameterSyntax>().Single();
Symbols\Source\NullablePublicAPITests.cs (4)
3810var parameter = lambda.DescendantNodes().OfType<ParameterSyntax>().Single(); 4048var o1Decl = lambda.Parameter; 4056var o2Ref = root.DescendantNodes().OfType<ParameterSyntax>().Last().Default.Value;
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (41)
Generated\Syntax.Test.xml.Generated.cs (7)
10815=> SyntaxFactory.ParameterList(SyntaxFactory.Token(SyntaxKind.OpenParenToken), new SeparatedSyntaxList<ParameterSyntax>(), SyntaxFactory.Token(SyntaxKind.CloseParenToken)); 10818=> SyntaxFactory.BracketedParameterList(SyntaxFactory.Token(SyntaxKind.OpenBracketToken), new SeparatedSyntaxList<ParameterSyntax>(), SyntaxFactory.Token(SyntaxKind.CloseBracketToken)); 10820private static ParameterSyntax GenerateParameter() 13482var node = GenerateParameter(); 13489var newNode = node.WithAttributeLists(node.AttributeLists).WithModifiers(node.Modifiers).WithType(node.Type).WithIdentifier(node.Identifier).WithDefault(node.Default); 19221var oldNode = GenerateParameter(); 19237var oldNode = GenerateParameter();
Parsing\ExpressionParsingTests.cs (10)
2162var ps = (ParameterSyntax)lambda.ParameterList.Parameters[0]; 2186var ps = (ParameterSyntax)lambda.ParameterList.Parameters[0]; 2189var ps2 = (ParameterSyntax)lambda.ParameterList.Parameters[1]; 2213var ps = (ParameterSyntax)lambda.ParameterList.Parameters[0]; 2238var ps = (ParameterSyntax)lambda.ParameterList.Parameters[0];
Syntax\SeparatedSyntaxListTests.cs (2)
22var node1 = SyntaxFactory.Parameter(SyntaxFactory.Identifier("a")); 23var node2 = SyntaxFactory.Parameter(SyntaxFactory.Identifier("b"));
Syntax\SyntaxFactoryTests.cs (1)
236var null1 = SyntaxFactory.SeparatedList((ParameterSyntax[])null);
Syntax\SyntaxNodeOrTokenListTests.cs (2)
21var node1 = SyntaxFactory.Parameter(SyntaxFactory.Identifier("a")); 22var node2 = SyntaxFactory.Parameter(SyntaxFactory.Identifier("b"));
Syntax\SyntaxNodeTests.cs (19)
2996var m = cu.DescendantNodes().OfType<ParameterSyntax>().FirstOrDefault(); 3037var m = cu.DescendantNodes().OfType<ParameterSyntax>().FirstOrDefault(); 3081var m = cu.DescendantNodes().OfType<ParameterSyntax>().FirstOrDefault(); 3123var m = cu.DescendantNodes().OfType<ParameterSyntax>().FirstOrDefault(); 3165var m = cu.DescendantNodes().OfType<ParameterSyntax>().LastOrDefault(); 3205var m = cu.DescendantNodes().OfType<ParameterSyntax>().LastOrDefault(); 3248var m = cu.DescendantNodes().OfType<ParameterSyntax>().LastOrDefault(); 3289var m = cu.DescendantNodes().OfType<ParameterSyntax>().LastOrDefault(); 3333var list = (SeparatedSyntaxList<ParameterSyntax>)method.ParameterList.Parameters; 4050var parameter = SyntaxFactory.ParseParameterList(text).Parameters[0]; 4051var newParameter = parameter.Update(parameter.AttributeLists, parameter.Modifiers, parameter.Type, parameter.Identifier, parameter.Default);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
Extensions.cs (1)
655declaration is ParameterSyntax ||
Microsoft.CodeAnalysis.CSharp.Workspaces (68)
Classification\ClassificationHelpers.cs (1)
249else if (token.Parent is ParameterSyntax parameterSyntax && parameterSyntax.Identifier == token)
Classification\SyntaxClassification\DiscardSyntaxClassifier.cs (2)
18public override ImmutableArray<Type> SyntaxNodeTypes { get; } = [typeof(DiscardDesignationSyntax), typeof(DiscardPatternSyntax), typeof(ParameterSyntax), typeof(IdentifierNameSyntax)]; 36case ParameterSyntax parameter when parameter.Identifier.Text == "_":
CodeGeneration\CSharpSyntaxGenerator.cs (14)
350? SyntaxFactory.ParameterList([.. parameters.Cast<ParameterSyntax>()]) 512? SyntaxFactory.BracketedParameterList([.. parameters.Cast<ParameterSyntax>()]) 1200ParameterSyntax parameter => parameter.AttributeLists, 1211ParameterSyntax parameter => parameter.WithAttributeLists(attributeLists), 1653ParameterSyntax parameter => parameter.WithModifiers(modifiers), 1788private static SyntaxNode RemoveDefaultValue(ParameterSyntax parameter, bool removeDefaults) 1889ParameterSyntax parameter => parameter.Identifier.ValueText, 1919ParameterSyntax parameter => ReplaceWithTrivia(declaration, parameter.Identifier, id), 1958return ((ParameterSyntax)declaration).Type; 1991SyntaxKind.Parameter => ((ParameterSyntax)declaration).WithType((TypeSyntax)type), 2409return ((ParameterSyntax)declaration).Default; 2449return ((ParameterSyntax)declaration).WithDefault(initializer); 3577var parameters = parameterDeclarations?.Cast<ParameterSyntax>().ToList(); 3585=> node is ParameterSyntax { Type: null, Default: null, Modifiers.Count: 0 };
FindSymbols\CSharpDeclaredSymbolInfoFactoryService.cs (4)
438foreach (var parameter in parameterList.Parameters) 550char openBrace, char closeBrace, SeparatedSyntaxList<ParameterSyntax> parameters) 562private static void AppendParameters(SeparatedSyntaxList<ParameterSyntax> parameters, StringBuilder builder) 565foreach (var parameter in parameters)
ReassignedVariable\CSharpReassignedVariableService.cs (1)
17ParameterSyntax,
Recommendations\CSharpRecommendationServiceRunner.cs (1)
58var parameter = parameters[ordinalInLambda];
Simplification\CSharpSimplificationService.Expander.cs (2)
188var newParameter = parameters[i].WithType(typeSyntax).WithAdditionalAnnotations(Simplifier.Annotation); 190var currentParameter = newParameters[i];
Simplification\Reducers\CSharpMiscellaneousReducer.cs (8)
25private static readonly Func<ParameterSyntax, SemanticModel, SimplifierOptions, CancellationToken, SyntaxNode> s_simplifyParameter = SimplifyParameter; 35ParameterSyntax parameterSyntax, 46var newParameterSyntax = parameterSyntax.WithType(null).WithAdditionalAnnotations(annotation); 51newParameterSyntax = (ParameterSyntax)speculationAnalyzer.ReplacedExpression.GetAnnotatedNodesAndTokens(annotation).First(); 68ParameterSyntax node, 75var newParameterSyntax = node.WithType(null); 94var parameter = parenthesizedLambda.ParameterList.Parameters.First(); 97var newParameterSyntax = parameter.WithType(null);
Simplification\Reducers\CSharpMiscellaneousReducer.Rewriter.cs (1)
19public override SyntaxNode? VisitParameter(ParameterSyntax node)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\DefaultExpressionSyntaxExtensions.cs (1)
74else if (equalsValueClause?.Parent is ParameterSyntax parameter)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
175if (expression.GetAncestor<ParameterSyntax>() != null)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\MemberDeclarationSyntaxExtensions.DeclarationFinder.cs (1)
57public override void VisitParameter(ParameterSyntax node)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (1)
478public static IParameterSymbol GetRequiredDeclaredSymbol(this SemanticModel semanticModel, ParameterSyntax syntax, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (2)
162ParameterSyntax parameter => parameter.AttributeLists, 745ParameterSyntax parameter => parameter.Modifiers,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\ElasticTriviaFormattingRule.cs (2)
346if (previousToken.GetAncestor<ParameterSyntax>() == null 406if (parent.Parent is ParameterSyntax)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SuppressFormattingRule.cs (1)
221if (node is ParameterSyntax parameterNode)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpAccessibilityFacts.cs (1)
312ParameterSyntax parameter => parameter.Modifiers,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpHeaderFacts.cs (1)
53var node = TryGetAncestorForLocation<ParameterSyntax>(root, position);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (2)
1725var parameter = (ParameterSyntax)node;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (4)
217var originalParam = originalParams[i]; 218var replacedParam = replacedParams[i]; 265private bool HaveSameParameterType(ParameterSyntax originalParam, ParameterSyntax replacedParam)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (5)
296var parameterSyntax = ParameterGenerator.GetParameter(parameter, info, isExplicit: false, isFirstParam: isFirstParam, seenOptional: seenOptional); 335ParameterSyntax parameter => Cast<TDeclarationNode>(parameter.AddAttributeLists(attributeSyntaxList)), 422case ParameterSyntax parameter: 844var parameterSyntax = (ParameterSyntax)syntaxNode;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ParameterGenerator.cs (6)
42internal static ImmutableArray<ParameterSyntax> GetParameters( 50var result = new FixedSizeArrayBuilder<ParameterSyntax>(parameterDefinitions.Length); 53var parameter = GetParameter(p, info, isExplicit, isFirstParam, seenOptional); 62internal static ParameterSyntax GetParameter(IParameterSymbol parameter, CSharpCodeGenerationContextInfo info, bool isExplicit, bool isFirstParam, bool seenOptional) 64var reusableSyntax = GetReuseableSyntaxNodeForSymbol<ParameterSyntax>(parameter, info);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\CSharpSyntaxContext.cs (1)
393token.Parent.Parent is ParameterSyntax { Parent: ParameterListSyntax { Parent: RecordDeclarationSyntax record } })
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (4)
1098token.Parent.Parent is ParameterSyntax parameter3 && 1106ParameterSyntax? parameter4 = null; 1109parameter4 = token.Parent as ParameterSyntax; 1114parameter4 = scopedIdentifierName.Parent as ParameterSyntax;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
1813LambdaExpressionSyntax lambdaExpression, ParameterSyntax parameter)
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (5)
CodeGeneration\AddImportsTests.cs (1)
800SyntaxNode p1SyntaxNode = syntaxRoot.DescendantNodes().OfType<ParameterSyntax>().FirstOrDefault();
CodeGeneration\SyntaxGeneratorTests.cs (2)
1253SeparatedList<ParameterSyntax>( 1916VerifySyntax<ParameterSyntax>(
Formatting\FormattingTreeEditTests.cs (2)
43var param = root.DescendantNodes().OfType<ParameterSyntax>().First();
Microsoft.CodeAnalysis.Workspaces.UnitTests (1)
Editing\SyntaxEditorTests.cs (1)
225var param = methodX.ParameterList.Parameters[0];
Microsoft.Extensions.Logging.Generators (2)
LoggerMessageGenerator.Parser.cs (2)
342ParameterSyntax paramSyntax = paramSymbol.DeclaringSyntaxReferences[0].GetSyntax(_cancellationToken) as ParameterSyntax;
Microsoft.Gen.ComplianceReports (1)
Parser.cs (1)
110foreach (var parameter in parameters)
Microsoft.Gen.Logging (3)
Parsing\Parser.cs (2)
523var paramSyntax = paramSymbol.DeclaringSyntaxReferences[0].GetSyntax(_cancellationToken) as ParameterSyntax;
Parsing\Parser.LogProperties.cs (1)
79ParameterSyntax paramSyntax => paramSyntax.Identifier.Text, // a property of a "record"
Microsoft.Interop.SourceGeneration (5)
Marshalling\MarshallingGeneratorExtensions.cs (3)
59public static ParameterSyntax AsParameter(this IBoundMarshallingGenerator generator, StubIdentifierContext context) 104private static ParameterSyntax GenerateForwardingParameter(TypePositionInfo info, string identifier) 106ParameterSyntax param = Parameter(Identifier(identifier))
SignatureContext.cs (1)
36public IEnumerable<ParameterSyntax> StubParameters
TypePositionInfo.cs (1)
99IsExplicitThis = ((ParameterSyntax)paramSymbol.DeclaringSyntaxReferences[0].GetSyntax()).Modifiers.Any(SyntaxKind.ThisKeyword)
Microsoft.ML.InternalCodeAnalyzer (5)
ContractsCheckAnalyzer.cs (1)
170foreach (var param in enclosingParams)
ContractsCheckNameofFixProvider.cs (2)
111ParameterSyntax argParam = null; 116foreach (var param in paramList.Parameters)
ParameterVariableNameAnalyzer.cs (2)
43var node = (ParameterSyntax)context.Node;
Microsoft.VisualStudio.LanguageServices.CSharp (33)
CodeModel\CSharpCodeModelService.CodeModelEventCollector.cs (4)
205private bool CompareParameters(ParameterSyntax oldParameter, ParameterSyntax newParameter, SyntaxNode newNodeParent, CodeModelEventQueue eventQueue) 713private static bool CompareModifiers(ParameterSyntax oldParameter, ParameterSyntax newParameter)
CodeModel\CSharpCodeModelService.cs (22)
331else if (parent is ParameterSyntax parameter) 529return (EnvDTE.CodeElement)CreateInternalCodeParameter(state, fileCodeModel, (ParameterSyntax)node); 773=> node is ParameterSyntax; 902return ((ParameterSyntax)node).WithIdentifier(newIdentifier); 1536foreach (ParameterSyntax parameter in GetParameterNodes(parentNode)) 1752else if (node.GetAncestor<ParameterSyntax>() is ParameterSyntax parameterSyntax) 1857if (node is ParameterSyntax parameter) 1867if (node is ParameterSyntax parameter) 1900if (node is not ParameterSyntax parameter) 2721ParameterSyntax); 2728else if (node is ParameterSyntax parameter) 2825private static Document Delete(Document document, ParameterSyntax node) 2889SyntaxKind.Parameter => Delete(document, (ParameterSyntax)node), 2914var parameter = (ParameterSyntax)node; 2961var parameter = (ParameterSyntax)node; 3444else if (container is ParameterSyntax parameter) 3474var parameterList = method.ParameterList.Parameters.Insert(index, (ParameterSyntax)parameter); 3479var parameterList = indexer.ParameterList.Parameters.Insert(index, (ParameterSyntax)parameter); 3484var parameterList = delegateDeclaration.ParameterList.Parameters.Insert(index, (ParameterSyntax)parameter);
CodeModel\CSharpCodeModelService.NodeLocator.cs (4)
77return GetStartPoint(text, (ParameterSyntax)node, part); 128return GetEndPoint(text, (ParameterSyntax)node, part); 759private static VirtualTreePoint GetStartPoint(SourceText text, ParameterSyntax node, EnvDTE.vsCMPart part) 1300private static VirtualTreePoint GetEndPoint(SourceText text, ParameterSyntax node, EnvDTE.vsCMPart part)
CodeModel\CSharpCodeModelService.NodeNameGenerator.cs (1)
113foreach (var parameter in parameterList.Parameters)
CodeModel\ParameterFlagsExtensions.cs (1)
14public static ParameterFlags GetParameterFlags(this ParameterSyntax parameter)
CodeModel\SyntaxNodeExtensions.cs (1)
51else if (node is ParameterSyntax parameter)