120 references to ParameterDeclaration
GenerateDocumentationAndConfigFiles (3)
src\RoslynAnalyzers\Utilities\Workspaces\SyntaxGeneratorExtensions.cs (3)
327generator.ParameterDeclaration(LeftIdentifierName, generator.TypeExpression(containingType)), 328generator.ParameterDeclaration(RightIdentifierName, generator.TypeExpression(containingType)) 386generator.ParameterDeclaration(argumentName.ToString(), generator.TypeExpression(SpecialType.System_Object))
Metrics (3)
src\RoslynAnalyzers\Utilities\Workspaces\SyntaxGeneratorExtensions.cs (3)
327generator.ParameterDeclaration(LeftIdentifierName, generator.TypeExpression(containingType)), 328generator.ParameterDeclaration(RightIdentifierName, generator.TypeExpression(containingType)) 386generator.ParameterDeclaration(argumentName.ToString(), generator.TypeExpression(SpecialType.System_Object))
Metrics.Legacy (3)
src\RoslynAnalyzers\Utilities\Workspaces\SyntaxGeneratorExtensions.cs (3)
327generator.ParameterDeclaration(LeftIdentifierName, generator.TypeExpression(containingType)), 328generator.ParameterDeclaration(RightIdentifierName, generator.TypeExpression(containingType)) 386generator.ParameterDeclaration(argumentName.ToString(), generator.TypeExpression(SpecialType.System_Object))
Microsoft.Analyzers.Extra (4)
CallAnalysis\Fixers\LegacyLoggingFixer.cs (4)
373var loggerParam = gen.ParameterDeclaration("logger", loggerType); 386parameters.Add(gen.ParameterDeclaration("exception", gen.TypeExpression(invocationOp.Arguments[details.ExceptionParamIndex].Value.Type!))); 394parameters.Add(gen.ParameterDeclaration(details.MessageArgs[index++], gen.TypeExpression(o.Type!))); 416parameters.Add(gen.ParameterDeclaration(name, gen.TypeExpression(type)));
Microsoft.CodeAnalysis.Analyzers (3)
src\RoslynAnalyzers\Utilities\Workspaces\SyntaxGeneratorExtensions.cs (3)
327generator.ParameterDeclaration(LeftIdentifierName, generator.TypeExpression(containingType)), 328generator.ParameterDeclaration(RightIdentifierName, generator.TypeExpression(containingType)) 386generator.ParameterDeclaration(argumentName.ToString(), generator.TypeExpression(SpecialType.System_Object))
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
CodeGeneration\CSharpSyntaxGenerator.cs (1)
3680=> this.ParameterDeclaration(identifier, type, initializer: null, RefKind.None);
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (69)
CodeGeneration\SyntaxGeneratorTests.cs (69)
839Generator.MethodDeclaration("m", parameters: [Generator.ParameterDeclaration("z", Generator.IdentifierName("y"))], returnType: Generator.IdentifierName("x")), 843Generator.MethodDeclaration("m", parameters: [Generator.ParameterDeclaration("z", Generator.IdentifierName("y"), Generator.IdentifierName("a"))], returnType: Generator.IdentifierName("x")), 875var parameters = parameterTypes.Select((t, i) => Generator.ParameterDeclaration("p" + i, Generator.TypeExpression(t))).ToList(); 1006var parameters = parameterTypes.Select((t, i) => Generator.ParameterDeclaration("p" + i, Generator.TypeExpression(t))).ToList(); 1120Generator.ConstructorDeclaration("c", [Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))]), 1125parameters: [Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))], 1186Generator.IndexerDeclaration([Generator.ParameterDeclaration("z", Generator.IdentifierName("y"))], Generator.IdentifierName("x"), modifiers: DeclarationModifiers.Abstract | DeclarationModifiers.ReadOnly), 1190Generator.IndexerDeclaration([Generator.ParameterDeclaration("z", Generator.IdentifierName("y"))], Generator.IdentifierName("x"), modifiers: DeclarationModifiers.Abstract | DeclarationModifiers.WriteOnly), 1194Generator.IndexerDeclaration([Generator.ParameterDeclaration("z", Generator.IdentifierName("y"))], Generator.IdentifierName("x"), modifiers: DeclarationModifiers.Abstract), 1198Generator.IndexerDeclaration([Generator.ParameterDeclaration("z", Generator.IdentifierName("y"))], Generator.IdentifierName("x"), modifiers: DeclarationModifiers.ReadOnly), 1202Generator.IndexerDeclaration([Generator.ParameterDeclaration("z", Generator.IdentifierName("y"))], Generator.IdentifierName("x"), modifiers: DeclarationModifiers.WriteOnly), 1206Generator.IndexerDeclaration([Generator.ParameterDeclaration("z", Generator.IdentifierName("y"))], Generator.IdentifierName("x"), modifiers: DeclarationModifiers.ReadOnly, 1211Generator.IndexerDeclaration([Generator.ParameterDeclaration("z", Generator.IdentifierName("y"))], Generator.IdentifierName("x"), modifiers: DeclarationModifiers.WriteOnly, 1216Generator.IndexerDeclaration([Generator.ParameterDeclaration("z", Generator.IdentifierName("y"))], Generator.IdentifierName("x")), 1220Generator.IndexerDeclaration([Generator.ParameterDeclaration("z", Generator.IdentifierName("y"))], Generator.IdentifierName("x"), 1225Generator.IndexerDeclaration([Generator.ParameterDeclaration("z", Generator.IdentifierName("y"))], Generator.IdentifierName("x"), 1283Generator.IndexerDeclaration(parameters: [Generator.ParameterDeclaration("p", Generator.IdentifierName("a"))], type: Generator.IdentifierName("t"), accessibility: Accessibility.Internal, modifiers: DeclarationModifiers.Abstract), 1586Generator.IndexerDeclaration(parameters: [Generator.ParameterDeclaration("p", Generator.IdentifierName("a"))], type: Generator.IdentifierName("t"), accessibility: Accessibility.Protected, modifiers: DeclarationModifiers.Abstract), 1743Generator.InterfaceDeclaration("i", members: [Generator.IndexerDeclaration([Generator.ParameterDeclaration("y", Generator.IdentifierName("x"))], Generator.IdentifierName("t"), Accessibility.Public, DeclarationModifiers.Sealed)]), 1747Generator.InterfaceDeclaration("i", members: [Generator.IndexerDeclaration([Generator.ParameterDeclaration("y", Generator.IdentifierName("x"))], Generator.IdentifierName("t"), Accessibility.Public, DeclarationModifiers.ReadOnly)]), 1813Generator.DelegateDeclaration("d", returnType: Generator.IdentifierName("t"), parameters: [Generator.ParameterDeclaration("p", Generator.IdentifierName("pt"))]), 1977Generator.IndexerDeclaration([Generator.ParameterDeclaration("z", Generator.IdentifierName("y"))], Generator.IdentifierName("x"), modifiers: DeclarationModifiers.Abstract), 2019Generator.ParameterDeclaration("p", Generator.IdentifierName("t")), 3016Assert.Equal(DeclarationKind.Parameter, Generator.GetDeclarationKind(Generator.ParameterDeclaration("p"))); 3018Assert.Equal(DeclarationKind.Indexer, Generator.GetDeclarationKind(Generator.IndexerDeclaration([Generator.ParameterDeclaration("i")], Generator.IdentifierName("t")))); 3039Assert.Equal("p", Generator.GetName(Generator.ParameterDeclaration("p"))); 3041Assert.Equal("", Generator.GetName(Generator.IndexerDeclaration([Generator.ParameterDeclaration("i")], Generator.IdentifierName("t")))); 3062Assert.Equal("p", Generator.GetName(Generator.WithName(Generator.ParameterDeclaration("x"), "p"))); 3064Assert.Equal("", Generator.GetName(Generator.WithName(Generator.IndexerDeclaration([Generator.ParameterDeclaration("i")], Generator.IdentifierName("t")), "this"))); 3085Assert.Equal(Accessibility.NotApplicable, Generator.GetAccessibility(Generator.ParameterDeclaration("p"))); 3087Assert.Equal(Accessibility.Internal, Generator.GetAccessibility(Generator.IndexerDeclaration([Generator.ParameterDeclaration("i")], Generator.IdentifierName("t"), accessibility: Accessibility.Internal))); 3109Assert.Equal(Accessibility.NotApplicable, Generator.GetAccessibility(Generator.WithAccessibility(Generator.ParameterDeclaration("p"), Accessibility.Private))); 3111Assert.Equal(Accessibility.Private, Generator.GetAccessibility(Generator.WithAccessibility(Generator.IndexerDeclaration([Generator.ParameterDeclaration("i")], Generator.IdentifierName("t"), accessibility: Accessibility.Internal), Accessibility.Private))); 3133Assert.Equal(DeclarationModifiers.None, Generator.GetModifiers(Generator.ParameterDeclaration("p"))); 3135Assert.Equal(DeclarationModifiers.Abstract, Generator.GetModifiers(Generator.IndexerDeclaration([Generator.ParameterDeclaration("i")], Generator.IdentifierName("t"), modifiers: DeclarationModifiers.Abstract))); 3156Assert.Equal(DeclarationModifiers.None, Generator.GetModifiers(Generator.WithModifiers(Generator.ParameterDeclaration("p"), DeclarationModifiers.Abstract))); 3158Assert.Equal(DeclarationModifiers.Abstract, Generator.GetModifiers(Generator.WithModifiers(Generator.IndexerDeclaration([Generator.ParameterDeclaration("i")], Generator.IdentifierName("t")), DeclarationModifiers.Abstract))); 3217Generator.GetModifiers(Generator.WithModifiers(Generator.IndexerDeclaration([Generator.ParameterDeclaration("i")], Generator.IdentifierName("t")), allModifiers))); 3350Assert.Equal("t", Generator.GetType(Generator.IndexerDeclaration([Generator.ParameterDeclaration("p", Generator.IdentifierName("pt"))], Generator.IdentifierName("t"))).ToString()); 3351Assert.Equal("t", Generator.GetType(Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))).ToString()); 3371Assert.Equal("t", Generator.GetType(Generator.WithType(Generator.IndexerDeclaration([Generator.ParameterDeclaration("p", Generator.IdentifierName("pt"))], Generator.IdentifierName("x")), Generator.IdentifierName("t"))).ToString()); 3372Assert.Equal("t", Generator.GetType(Generator.WithType(Generator.ParameterDeclaration("p", Generator.IdentifierName("x")), Generator.IdentifierName("t"))).ToString()); 3388Assert.Equal(1, Generator.GetParameters(Generator.MethodDeclaration("m", parameters: [Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))])).Count); 3389Assert.Equal(2, Generator.GetParameters(Generator.MethodDeclaration("m", parameters: [Generator.ParameterDeclaration("p", Generator.IdentifierName("t")), Generator.ParameterDeclaration("p2", Generator.IdentifierName("t2"))])).Count); 3392Assert.Equal(1, Generator.GetParameters(Generator.ConstructorDeclaration(parameters: [Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))])).Count); 3393Assert.Equal(2, Generator.GetParameters(Generator.ConstructorDeclaration(parameters: [Generator.ParameterDeclaration("p", Generator.IdentifierName("t")), Generator.ParameterDeclaration("p2", Generator.IdentifierName("t2"))])).Count); 3395Assert.Equal(1, Generator.GetParameters(Generator.IndexerDeclaration([Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))], Generator.IdentifierName("t"))).Count); 3396Assert.Equal(2, Generator.GetParameters(Generator.IndexerDeclaration([Generator.ParameterDeclaration("p", Generator.IdentifierName("t")), Generator.ParameterDeclaration("p2", Generator.IdentifierName("t2"))], Generator.IdentifierName("t"))).Count); 3405Assert.Equal(1, Generator.GetParameters(Generator.DelegateDeclaration("d", parameters: [Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))])).Count); 3414Assert.Equal(1, Generator.GetParameters(Generator.AddParameters(Generator.MethodDeclaration("m"), [Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))])).Count); 3415Assert.Equal(1, Generator.GetParameters(Generator.AddParameters(Generator.ConstructorDeclaration(), [Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))])).Count); 3416Assert.Equal(3, Generator.GetParameters(Generator.AddParameters(Generator.IndexerDeclaration([Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))], Generator.IdentifierName("t")), [Generator.ParameterDeclaration("p2", Generator.IdentifierName("t2")), Generator.ParameterDeclaration("p3", Generator.IdentifierName("t3"))])).Count); 3421Assert.Equal(1, Generator.GetParameters(Generator.AddParameters(Generator.DelegateDeclaration("d"), [Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))])).Count); 3423Assert.Equal(1, Generator.GetParameters(Generator.AddParameters(Generator.ClassDeclaration("c"), [Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))])).Count); 3424Assert.Equal(1, Generator.GetParameters(Generator.AddParameters(Generator.StructDeclaration("c"), [Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))])).Count); 3425Assert.Equal(1, Generator.GetParameters(Generator.AddParameters(Generator.InterfaceDeclaration("c"), [Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))])).Count); 3426Assert.Equal(0, Generator.GetParameters(Generator.AddParameters(Generator.IdentifierName("x"), [Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))])).Count); 3434Assert.Equal("x", Generator.GetExpression(Generator.ParameterDeclaration("p", Generator.IdentifierName("t"), initializer: Generator.IdentifierName("x"))).ToString()); 3468Assert.Equal("x", Generator.GetExpression(Generator.WithExpression(Generator.ParameterDeclaration("p", Generator.IdentifierName("t")), Generator.IdentifierName("x"))).ToString()); 3578Generator.WithAccessorDeclarations(Generator.IndexerDeclaration([Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))], Generator.IdentifierName("x"))), 3582Generator.WithAccessorDeclarations(Generator.IndexerDeclaration([Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))], Generator.IdentifierName("x")), 3588Generator.IndexerDeclaration([Generator.ParameterDeclaration("p", Generator.IdentifierName("t"))], Generator.IdentifierName("x")), 3749var p = Generator.ParameterDeclaration("p", Generator.IdentifierName("t")); 3782var p = Generator.ParameterDeclaration("p", Generator.IdentifierName("t"));
Microsoft.CodeAnalysis.Features (3)
IntroduceParameter\IntroduceParameterDocumentRewriter.cs (2)
267var parameter = _generator.ParameterDeclaration(parameterName, _generator.TypeExpression(parameterType)); 528var parameter = _generator.ParameterDeclaration(name: parameterName, type:
Snippets\SnippetProviders\AbstractMainMethodSnippetProvider.cs (1)
29parameters: [generator.ParameterDeclaration(
Microsoft.CodeAnalysis.PublicApiAnalyzers.CodeFixes (3)
src\RoslynAnalyzers\Utilities\Workspaces\SyntaxGeneratorExtensions.cs (3)
327generator.ParameterDeclaration(LeftIdentifierName, generator.TypeExpression(containingType)), 328generator.ParameterDeclaration(RightIdentifierName, generator.TypeExpression(containingType)) 386generator.ParameterDeclaration(argumentName.ToString(), generator.TypeExpression(SpecialType.System_Object))
Microsoft.Interop.LibraryImportGenerator (17)
Analyzers\ConvertToLibraryImportFixer.cs (1)
245editor.Generator.ParameterDeclaration("@return", editor.Generator.GetType(generatedDeclaration), refKind: RefKind.Out)
Analyzers\CustomMarshallerAttributeFixer.cs (16)
224parameters: new[] { gen.ParameterDeclaration("managed", gen.TypeExpression(managedType)) }, 236parameters: new[] { gen.ParameterDeclaration("unmanaged", unmanagedTypeSyntax.Value) }, 261gen.ParameterDeclaration("managed", gen.TypeExpression(managedType)), 262gen.ParameterDeclaration("numElements", type: gen.TypeExpression(SpecialType.System_Int32), refKind: RefKind.Out), 277gen.ParameterDeclaration("unmanaged", unmanagedTypeSyntax.Value), 278gen.ParameterDeclaration("numElements", type: gen.TypeExpression(SpecialType.System_Int32)), 293gen.ParameterDeclaration("managed", gen.TypeExpression(managedType)) 308gen.ParameterDeclaration("unmanaged", unmanagedTypeSyntax.Value), 309gen.ParameterDeclaration("numElements", gen.TypeExpression(SpecialType.System_Int32)) 324gen.ParameterDeclaration("unmanaged", unmanagedTypeSyntax.Value), 325gen.ParameterDeclaration("numElements", gen.TypeExpression(SpecialType.System_Int32)) 340gen.ParameterDeclaration("managed", gen.TypeExpression(managedType)) 420parameters: new[] { gen.ParameterDeclaration("managed", gen.TypeExpression(managedType)) }, 440parameters: new[] { gen.ParameterDeclaration("unmanaged", unmanagedTypeSyntax.Value) }, 493gen.ParameterDeclaration("numElements", gen.TypeExpression(SpecialType.System_Int32)) 507gen.ParameterDeclaration("numElements", gen.TypeExpression(SpecialType.System_Int32))
Roslyn.Diagnostics.Analyzers (5)
AbstractCreateTestAccessor`1.cs (1)
87parameters: new[] { syntaxGenerator.ParameterDeclaration(parameterName, syntaxGenerator.TypeExpression(type)) },
AbstractRunIterations`1.cs (1)
115syntaxGenerator.ParameterDeclaration(
src\RoslynAnalyzers\Utilities\Workspaces\SyntaxGeneratorExtensions.cs (3)
327generator.ParameterDeclaration(LeftIdentifierName, generator.TypeExpression(containingType)), 328generator.ParameterDeclaration(RightIdentifierName, generator.TypeExpression(containingType)) 386generator.ParameterDeclaration(argumentName.ToString(), generator.TypeExpression(SpecialType.System_Object))
Test.Utilities (3)
src\RoslynAnalyzers\Utilities\Workspaces\SyntaxGeneratorExtensions.cs (3)
327generator.ParameterDeclaration(LeftIdentifierName, generator.TypeExpression(containingType)), 328generator.ParameterDeclaration(RightIdentifierName, generator.TypeExpression(containingType)) 386generator.ParameterDeclaration(argumentName.ToString(), generator.TypeExpression(SpecialType.System_Object))
Text.Analyzers (3)
src\RoslynAnalyzers\Utilities\Workspaces\SyntaxGeneratorExtensions.cs (3)
327generator.ParameterDeclaration(LeftIdentifierName, generator.TypeExpression(containingType)), 328generator.ParameterDeclaration(RightIdentifierName, generator.TypeExpression(containingType)) 386generator.ParameterDeclaration(argumentName.ToString(), generator.TypeExpression(SpecialType.System_Object))