460 references to IdentifierName
Microsoft.Analyzers.Extra.Tests (5)
SyntaxNodeExtensionsTests.cs (5)
107var node = SyntaxFactory.InvocationExpression(SyntaxFactory.IdentifierName("CheckGetFirstAncestorOfSyntaxKindReturnsNullWhenNodeIsNotfound")); 117var node = SyntaxFactory.IdentifierName("expectedName"); 186var console = SyntaxFactory.IdentifierName("Console"); 187var writeline = SyntaxFactory.IdentifierName("WriteLine"); 197var b = SyntaxFactory.IdentifierName("b");
Microsoft.AspNetCore.App.CodeFixes (3)
Authorization\AddAuthorizationBuilderFixer.cs (1)
130SyntaxFactory.IdentifierName(invokedMemberName)),
Http\HeaderDictionaryIndexerFixer.cs (1)
59var newExpression = SyntaxFactory.MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, expression, SyntaxFactory.IdentifierName(resolvedPropertyName));
WebApplicationBuilderFixer.cs (1)
62if (!CanFixWebApplicationBuilder(diagnostic, SyntaxFactory.IdentifierName(identifierMethod), root, out var invocation))
Microsoft.AspNetCore.Mvc.Api.Analyzers (1)
AddResponseTypeAttributeCodeFixAction.cs (1)
239SyntaxFactory.IdentifierName(constantName));
Microsoft.CodeAnalysis.CSharp (4)
Compilation\CSharpCompilation.UsingsFromOptionsAndDiagnostics.cs (2)
49NameSyntax qualifiedName = SyntaxFactory.IdentifierName(identifiers[0]); 53qualifiedName = SyntaxFactory.QualifiedName(left: qualifiedName, right: SyntaxFactory.IdentifierName(identifiers[j]));
SymbolDisplay\SymbolDisplayVisitor_Minimal.cs (1)
254var identifierName = SyntaxFactory.IdentifierName(symbol.Name);
Syntax\NameColonSyntax.cs (1)
30=> NameColon(IdentifierName(name));
Microsoft.CodeAnalysis.CSharp.CodeStyle (3)
src\Analyzers\CSharp\Analyzers\UsePatternCombinators\AnalyzedPattern.cs (1)
55IdentifierName("_"),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (2)
97var candidateReplacementNode = SyntaxFactory.IdentifierName("var"); 199SyntaxFactory.IdentifierName("var").WithTriviaFrom(declarationTypeNode).WithAdditionalAnnotations(annotation));
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (19)
src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs (1)
111var type = cannotUseVar ? declaratorToRemoveType!.GenerateTypeSyntax() : IdentifierName("var");
src\Analyzers\CSharp\CodeFixes\InlineDeclaration\CSharpInlineDeclarationCodeFixProvider.cs (1)
264? IdentifierName("var")
src\Analyzers\CSharp\CodeFixes\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessCodeFixProvider.cs (2)
93: (invocationExpression.Expression, IdentifierName(nameof(Action.Invoke))); 140: IdentifierName(nameof(Action.Invoke));
src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeFixHelper.cs (2)
158syntaxEditor.ReplaceNode(instanceReference.Syntax, IdentifierName("@this")); 162syntaxEditor.ReplaceNode(name, MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, IdentifierName("@this"), name));
src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseImplicitTypeCodeFixProvider.cs (1)
50var implicitType = SyntaxFactory.IdentifierName("var")
src\Analyzers\CSharp\CodeFixes\UseUtf8StringLiteral\UseUtf8StringLiteralCodeFixProvider.cs (1)
209IdentifierName(nameof(ReadOnlySpan<byte>.ToArray))))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\AttributeGenerator.cs (1)
95NameEquals(IdentifierName(kvp.Key)), null,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ExpressionGenerator.cs (2)
293var result = MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, memberAccess, IdentifierName(constant.Value)); 306var name = IdentifierName(names[i]);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeParameterSymbolExtensions.cs (2)
48constraints.Add(TypeConstraint(IdentifierName("unmanaged"))); 56constraints.Add(TypeConstraint(IdentifierName("notnull")));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.cs (1)
46return IdentifierName("var");
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (4)
112var typeSyntax = IdentifierName("dynamic"); 122syntax = IdentifierName(symbol.SpecialType == SpecialType.System_IntPtr ? "nint" : "nuint"); 217IdentifierName("System")), 218IdentifierName("Object"));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSyntaxGeneratorInternal.cs (1)
71type == null ? SyntaxFactory.IdentifierName("var") : (TypeSyntax)type,
Microsoft.CodeAnalysis.CSharp.Features (29)
AddImport\CSharpAddImportFeatureService.cs (2)
409var namePiece = IdentifierName(part); 463nameSyntax = AddOrReplaceAlias(nameSyntax, IdentifierName(externAlias));
ChangeSignature\UnifiedArgumentSyntax.cs (2)
54? Create(argument.WithNameColon(SyntaxFactory.NameColon(SyntaxFactory.IdentifierName(name)))) 55: Create(((AttributeArgumentSyntax)_argument).WithNameColon(SyntaxFactory.NameColon(SyntaxFactory.IdentifierName(name))));
Completion\Providers\OutVariableArgumentProvider.cs (1)
54type: IdentifierName("var"),
ConvertLinq\ConvertForEachToLinqQuery\AbstractConverter.cs (2)
211IdentifierName(invokedMethodName)), 286IdentifierName(nameof(Enumerable.Where))),
ConvertLinq\ConvertForEachToLinqQuery\DefaultConverter.cs (1)
23private static readonly TypeSyntax VarNameIdentifier = IdentifierName("var");
ConvertLinq\ConvertForEachToLinqQuery\ToToListConverter.cs (1)
52SyntaxFactory.IdentifierName(nameof(List<object>.AddRange))),
ConvertLinq\CSharpConvertLinqQueryToForEachProvider.cs (3)
33private static readonly TypeSyntax VarNameIdentifier = IdentifierName("var"); 203IdentifierName(nameof(object.Equals))), 354IdentifierName(nameof(IList.Add))),
ConvertTupleToStruct\CSharpConvertTupleToStructCodeRefactoringProvider.cs (1)
45var newName = SyntaxFactory.IdentifierName(name).WithTriviaFrom(nameColon.Name);
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.cs (2)
565: ReturnStatement(IdentifierName(identifierName)); 600IdentifierName(nameof(Task.ConfigureAwait))),
IntroduceVariable\CSharpIntroduceLocalForExpressionCodeRefactoringProvider.cs (1)
125IdentifierName("var"),
ReplaceMethodWithProperty\CSharpReplaceMethodWithPropertyService.cs (1)
299return IdentifierName("value").WithTriviaFrom(node);
Snippets\CSharpForEachLoopSnippetProvider.cs (2)
63var varIdentifier = IdentifierName("var"); 73? IdentifierName("collection")
src\Analyzers\CSharp\Analyzers\UsePatternCombinators\AnalyzedPattern.cs (1)
55IdentifierName("_"),
src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs (1)
111var type = cannotUseVar ? declaratorToRemoveType!.GenerateTypeSyntax() : IdentifierName("var");
src\Analyzers\CSharp\CodeFixes\InlineDeclaration\CSharpInlineDeclarationCodeFixProvider.cs (1)
264? IdentifierName("var")
src\Analyzers\CSharp\CodeFixes\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessCodeFixProvider.cs (2)
93: (invocationExpression.Expression, IdentifierName(nameof(Action.Invoke))); 140: IdentifierName(nameof(Action.Invoke));
src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeFixHelper.cs (2)
158syntaxEditor.ReplaceNode(instanceReference.Syntax, IdentifierName("@this")); 162syntaxEditor.ReplaceNode(name, MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, IdentifierName("@this"), name));
src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseImplicitTypeCodeFixProvider.cs (1)
50var implicitType = SyntaxFactory.IdentifierName("var")
src\Analyzers\CSharp\CodeFixes\UseUtf8StringLiteral\UseUtf8StringLiteralCodeFixProvider.cs (1)
209IdentifierName(nameof(ReadOnlySpan<byte>.ToArray))))
UsePatternMatching\CSharpIsAndCastCheckWithoutNameDiagnosticAnalyzer.cs (1)
205var localReference = SyntaxFactory.IdentifierName(localName);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (5)
Semantics\GlobalUsingDirectiveTests.cs (1)
4975var alias1 = SyntaxFactory.IdentifierName("alias1");
Semantics\InteractiveUsingTests.cs (2)
586SyntaxFactory.IdentifierName(name), 596SyntaxFactory.IdentifierName(name),
Semantics\SyntaxTreeRootTests.cs (2)
26var node = SyntaxFactory.UsingDirective(SyntaxFactory.IdentifierName("Blah")); 60var arbitraryTree = SyntaxFactory.SyntaxTree(SyntaxFactory.Attribute(SyntaxFactory.IdentifierName("Wooh")));
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (4)
Compilation\GetUnusedImportDirectivesTests.cs (1)
195var info = model.GetSpeculativeSymbolInfo(position, SyntaxFactory.IdentifierName("Console"), SpeculativeBindingOption.BindAsTypeOrNamespace);
Compilation\SemanticModelAPITests.cs (1)
3585var attributeSyntax = SyntaxFactory.Attribute(SyntaxFactory.IdentifierName("Category"));
Symbols\ConversionTests.cs (2)
413ExpressionSyntax sourceExpression3 = SyntaxFactory.IdentifierName("jj"); 419ExpressionSyntax sourceExpression4 = SyntaxFactory.IdentifierName("ss");
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (32)
Parsing\InterpolationTests.cs (3)
14Assert.Equal("{a}", SyntaxFactory.Interpolation(SyntaxFactory.IdentifierName("a")).ToFullString()); 21SyntaxFactory.IdentifierName("a"), 24SyntaxFactory.IdentifierName("b")),
Syntax\SeparatedSyntaxListTests.cs (7)
284SyntaxFactory.IdentifierName("B"), 304? [SyntaxFactory.IdentifierName("A"), SyntaxFactory.IdentifierName("B"), SyntaxFactory.IdentifierName("C")] 307SyntaxFactory.IdentifierName("A"), 308SyntaxFactory.IdentifierName("B"), 309SyntaxFactory.IdentifierName("C"),
Syntax\StructuredTriviaTests.cs (1)
24var trivia1 = SyntaxFactory.Trivia(SyntaxFactory.IfDirectiveTrivia(SyntaxFactory.IdentifierName(conditionName), false, false, false));
Syntax\SyntaxFactoryTests.cs (8)
260var singleton1 = SyntaxFactory.SeparatedList(new[] { SyntaxFactory.IdentifierName("a") }); 266var singleton2 = SyntaxFactory.SeparatedList((System.Collections.Generic.IEnumerable<ExpressionSyntax>)new[] { SyntaxFactory.IdentifierName("x") }); 272var list1 = SyntaxFactory.SeparatedList(new[] { SyntaxFactory.IdentifierName("a"), SyntaxFactory.IdentifierName("b"), SyntaxFactory.IdentifierName("c") }); 279builder.Add(SyntaxFactory.Argument(SyntaxFactory.IdentifierName("x"))); 280builder.Add(SyntaxFactory.Argument(SyntaxFactory.IdentifierName("y"))); 281builder.Add(SyntaxFactory.Argument(SyntaxFactory.IdentifierName("z")));
Syntax\SyntaxListTests.cs (1)
271SyntaxFactory.IdentifierName("B"),
Syntax\SyntaxNodeTests.cs (8)
55var qname2 = qname.WithRight(SyntaxFactory.IdentifierName("C")); 1856var externAlias = SyntaxFactory.IdentifierName("alias"); 1857var goo = SyntaxFactory.IdentifierName("Goo"); 1858var bar = SyntaxFactory.IdentifierName("Bar"); 3622NameSyntax name = SyntaxFactory.QualifiedName(SyntaxFactory.IdentifierName("System"), SyntaxFactory.IdentifierName("Collections.Generic")); 3738SyntaxNode namedNode = SyntaxFactory.IdentifierName("goo"); 3772nodeOrToken = SyntaxFactory.IdentifierName("goo");
Syntax\SyntaxNormalizerTests.cs (1)
3599SyntaxFactory.IdentifierName("a"), false, false, false)),
Syntax\TrackNodeTests.cs (3)
100var replacedExpr = trackedExpr.ReplaceNode(currentA, SyntaxFactory.IdentifierName("c")); 112var replacedExpr = trackedExpr.ReplaceNode(currentA, SyntaxFactory.IdentifierName("c")); 184Assert.Throws<ArgumentException>(() => expr.TrackNodes(SyntaxFactory.IdentifierName("c")));
Microsoft.CodeAnalysis.CSharp.Workspaces (17)
CodeGeneration\CSharpSyntaxGenerator.cs (1)
1870constraints = constraints.Insert(0, SyntaxFactory.TypeConstraint(SyntaxFactory.IdentifierName("unmanaged")));
Simplification\Reducers\CSharpVarReducer.Rewriter.cs (1)
47return SyntaxFactory.IdentifierName("var")
Simplification\Simplifiers\AbstractCSharpSimplifier.cs (2)
125var aliasIdentifier = SyntaxFactory.IdentifierName(aliasName); 286var aliasIdentifier = SyntaxFactory.IdentifierName(aliasName);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (2)
97var candidateReplacementNode = SyntaxFactory.IdentifierName("var"); 199SyntaxFactory.IdentifierName("var").WithTriviaFrom(declarationTypeNode).WithAdditionalAnnotations(annotation));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\AttributeGenerator.cs (1)
95NameEquals(IdentifierName(kvp.Key)), null,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ExpressionGenerator.cs (2)
293var result = MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, memberAccess, IdentifierName(constant.Value)); 306var name = IdentifierName(names[i]);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeParameterSymbolExtensions.cs (2)
48constraints.Add(TypeConstraint(IdentifierName("unmanaged"))); 56constraints.Add(TypeConstraint(IdentifierName("notnull")));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.cs (1)
46return IdentifierName("var");
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (4)
112var typeSyntax = IdentifierName("dynamic"); 122syntax = IdentifierName(symbol.SpecialType == SpecialType.System_IntPtr ? "nint" : "nuint"); 217IdentifierName("System")), 218IdentifierName("Object"));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSyntaxGeneratorInternal.cs (1)
71type == null ? SyntaxFactory.IdentifierName("var") : (TypeSyntax)type,
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (12)
CodeGeneration\AddAttributesTests.cs (1)
46IdentifierName("System.Reflection.AssemblyVersion(\"1.0.0.0\")"))])
CodeGeneration\SyntaxGeneratorTests.cs (11)
1213IdentifierName("IGeneral"))) 1250TypeArgumentList([IdentifierName("C")])))) 1258IdentifierName("C")), 1263IdentifierName("C"))}))) 1296TypeArgumentList([IdentifierName("C")])))) 1344IdentifierName("IGeneral"))) 1364IdentifierName("IGeneral"))) 1387IdentifierName("IGeneral"))) 1413IdentifierName("IGeneral"))) 1440IdentifierName("EventHandler"), 1444IdentifierName("IGeneral")))
Microsoft.CodeAnalysis.UnitTests (2)
CommonSyntaxTests.cs (2)
80SyntaxNode node = CSharp.SyntaxFactory.IdentifierName("test"); 186var node = CSharp.SyntaxFactory.IdentifierName("a");
Microsoft.Interop.ComInterfaceGenerator (71)
ComClassGenerator.cs (20)
68IdentifierName(ClassInfoTypeName))); 106IdentifierName("AllocateTypeAssociatedMemory"), 107Argument(TypeOfExpression(IdentifierName(ClassInfoTypeName))), 126IdentifierName(detailsTempLocal), 129.Dot(IdentifierName("DefaultIUnknownInterfaceDetailsStrategy")), 130IdentifierName("GetIUnknownDerivedDetails"), 134IdentifierName("TypeHandle")))))); 139IdentifierName(vtablesLocal), 149IdentifierName("IID"), 150IdentifierName(detailsTempLocal) 151.Dot(IdentifierName("Iid"))), 154IdentifierName("Vtable"), 156IdentifierName("nint"), 157IdentifierName(detailsTempLocal) 158.Dot(IdentifierName("ManagedVirtualMethodTable")))) 166IdentifierName(vtablesField), 167IdentifierName(vtablesLocal)))); 173IdentifierName(countIdentifier), 180IdentifierName(vtablesField), 184ReturnStatement(IdentifierName(vtablesField)));
ComInterfaceGenerator.cs (26)
219IdentifierName("InterfaceInformation"), 220IdentifierName("InterfaceImplementation"))); 538IdentifierName("AllocateTypeAssociatedMemory"), 564IdentifierName("GetIUnknownImpl"), 565OutArgument(IdentifierName("v0")), 566OutArgument(IdentifierName("v1")), 567OutArgument(IdentifierName("v2"))), 571IdentifierName(vtableLocalName), 573CastExpression(TypeSyntaxes.VoidStar, IdentifierName("v0"))), 577IdentifierName(vtableLocalName), 579CastExpression(TypeSyntaxes.VoidStar, IdentifierName("v1"))), 583IdentifierName(vtableLocalName), 585CastExpression(TypeSyntaxes.VoidStar, IdentifierName("v2")))); 593IdentifierName("Copy"), 597.Dot(IdentifierName("DefaultIUnknownInterfaceDetailsStrategy")), 598IdentifierName("GetIUnknownDerivedDetails"), 601.Dot(IdentifierName("TypeHandle")))) 602.Dot(IdentifierName("ManagedVirtualMethodTable"))), 603Argument(IdentifierName(vtableLocalName)), 604Argument(CastExpression(IdentifierName("nuint"), 626ReturnStatement(IdentifierName(vtableLocalName))))); 664IdentifierName(vtableFieldName), 666IdentifierName(vtableFieldName), 669IdentifierName(vtableFieldName), 671IdentifierName("InterfaceImplementation"), 672IdentifierName(CreateManagedVirtualFunctionTableMethodName)))))))
ComMethodContext.cs (4)
141CastExpression(OriginalDeclaringInterface.Info.Type.Syntax, IdentifierName("this"))), 142IdentifierName(MethodInfo.MethodName)), 149? Argument(IdentifierName(info.InstanceIdentifier)).WithRefKindKeyword(MarshallerHelpers.GetManagedArgumentRefKindKeyword(info)) 150: Argument(IdentifierName(info.InstanceIdentifier));
Marshallers\ComInterfaceDispatchMarshallingResolver.cs (2)
52IdentifierName(managed), 62IdentifierName(native)))))));
Marshallers\KeepAliveThisMarshaller.cs (1)
28IdentifierName("KeepAlive"),
Marshallers\ManagedHResultExceptionGeneratorResolver.cs (3)
52IdentifierName("ThrowExceptionForHR"), 53Argument(IdentifierName(managedIdentifier))); 81IdentifierName(managedIdentifier),
Marshallers\ObjectUnwrapperResolver.cs (2)
47IdentifierName(managedIdentifier), 57Argument(IdentifierName(nativeIdentifier)))));
Marshallers\StructAsHResultMarshallerFactory.cs (4)
43IdentifierName(unmanaged), 53Argument(IdentifierName(managed)))); 61IdentifierName(managed), 71Argument(IdentifierName(unmanaged))));
UnmanagedToManagedStubGenerator.cs (1)
103allStatements.Add(ReturnStatement(IdentifierName(_context.GetIdentifiers(_marshallers.NativeReturnMarshaller.TypeInfo).native)));
VirtualMethodPointerStubGenerator.cs (8)
51IdentifierName("var"), 64IdentifierName("GetVirtualMethodTableInfoForKey"), 69IdentifierName("var"), 74IdentifierName(VirtualMethodTableIdentifier), 146IdentifierName(ManagedThisParameterIdentifier), 162.WithNameEquals(NameEquals(IdentifierName("CallConvs")))); 249IdentifierName(vtableIdentifier)) 254IdentifierName($"ABI_{method.StubMethodSyntaxTemplate.Identifier}")))))));
Microsoft.Interop.JavaScript.JSImportGenerator (88)
JSExportCodeGenerator.cs (21)
94IdentifierName(InvokeSucceededIdentifier), 107.WithDeclaration(CatchDeclaration(IdentifierName(Constants.ExceptionGlobal)).WithIdentifier(Identifier("ex"))) 111IdentifierName(Constants.ArgumentException), IdentifierName(Constants.ToJSMethod))) 112.WithArgumentList(ArgumentList(SingletonSeparatedList(Argument(IdentifierName("ex"))))))))))) 118finallyStatements.Add(IfStatement(IdentifierName(InvokeSucceededIdentifier), Block(statements.GuaranteedUnmarshal.Concat(statements.CleanupCalleeAllocated)))); 138IdentifierName("initialized"), 140IdentifierName(Constants.OSArchitectureGlobal), 141IdentifierName(Constants.ArchitectureWasmGlobal))), 145IdentifierName("initialized"), 160IdentifierName(Constants.JSFunctionSignatureGlobal), IdentifierName(Constants.BindCSFunctionMethod))) 170return Argument(ArrayCreationExpression(ArrayType(IdentifierName(Constants.JSMarshalerTypeGlobal)) 183statementsToUpdate.Add(LocalDeclarationStatement(VariableDeclaration(RefType(IdentifierName(Constants.JSMarshalerArgumentGlobal))) 185.WithInitializer(EqualsValueClause(RefExpression(ElementAccessExpression(IdentifierName(Constants.ArgumentsBuffer)) 189statementsToUpdate.Add(LocalDeclarationStatement(VariableDeclaration(RefType(IdentifierName(Constants.JSMarshalerArgumentGlobal))) 191.WithInitializer(EqualsValueClause(RefExpression(ElementAccessExpression(IdentifierName(Constants.ArgumentsBuffer)) 206arguments.Add(Argument(IdentifierName(marshaller.TypeInfo.InstanceIdentifier))); 211statements.Add(ExpressionStatement(InvocationExpression(IdentifierName(_signatureContext.MethodName)) 216ExpressionSyntax invocation = InvocationExpression(IdentifierName(_signatureContext.MethodName)) 223IdentifierName(nativeIdentifier), invocation));
JSExportGenerator.cs (12)
147Attribute(IdentifierName(Constants.DebuggerNonUserCodeAttribute)))))) 225if (methods.IsEmpty) return NamespaceDeclaration(IdentifierName(generatedNamespace)); 242Attribute(IdentifierName(Constants.ThreadStaticGlobal)))))); 257IdentifierName(Constants.ModuleInitializerAttributeGlobal)), 260IdentifierName(Constants.DynamicDependencyAttributeGlobal)) 270IdentifierName(Constants.DynamicallyAccessedMemberTypesGlobal), 271IdentifierName("PublicMethods")), 274IdentifierName(Constants.DynamicallyAccessedMemberTypesGlobal), 275IdentifierName("NonPublicMethods")))), 291var ns = NamespaceDeclaration(IdentifierName(generatedNamespace)) 299Attribute(IdentifierName(Constants.CompilerGeneratedAttributeGlobal))) 322AttributeListSyntax registrationAttribute = AttributeList(SingletonSeparatedList(Attribute(IdentifierName(Constants.DynamicDependencyAttributeGlobal))
JSImportCodeGenerator.cs (22)
102IdentifierName(InvokeSucceededIdentifier), 113finallyStatements.Add(IfStatement(IdentifierName(InvokeSucceededIdentifier), Block(statements.GuaranteedUnmarshal.Concat(statements.CleanupCalleeAllocated)))); 130allStatements.Add(ReturnStatement(IdentifierName(_context.GetIdentifiers(_marshallers.ManagedReturnMarshaller.TypeInfo).managed))); 147statementsToUpdate.Add(IfStatement(BinaryExpression(SyntaxKind.EqualsExpression, IdentifierName(_signatureContext.BindingName), LiteralExpression(SyntaxKind.NullLiteralExpression)), 150IdentifierName(_signatureContext.BindingName), 152IdentifierName(Constants.JSFunctionSignatureGlobal), IdentifierName(Constants.BindJSFunctionMethod))) 162return Argument(ArrayCreationExpression(ArrayType(IdentifierName(Constants.JSMarshalerTypeGlobal)) 171TypeArgumentList(SingletonSeparatedList<TypeSyntax>(IdentifierName(Constants.JSMarshalerArgumentGlobal))))) 173.WithInitializer(EqualsValueClause(StackAllocArrayCreationExpression(ArrayType(IdentifierName(Constants.JSMarshalerArgumentGlobal)) 177statementsToUpdate.Add(LocalDeclarationStatement(VariableDeclaration(RefType(IdentifierName(Constants.JSMarshalerArgumentGlobal))) 179.WithInitializer(EqualsValueClause(RefExpression(ElementAccessExpression(IdentifierName(Constants.ArgumentsBuffer)) 185IdentifierName(Constants.ArgumentException), IdentifierName("Initialize"))))); 187statementsToUpdate.Add(LocalDeclarationStatement(VariableDeclaration(RefType(IdentifierName(Constants.JSMarshalerArgumentGlobal))) 189.WithInitializer(EqualsValueClause(RefExpression(ElementAccessExpression(IdentifierName(Constants.ArgumentsBuffer)) 195IdentifierName(Constants.ArgumentReturn), IdentifierName("Initialize"))))); 201MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, IdentifierName(Constants.JSFunctionSignatureGlobal), IdentifierName("InvokeJS"))) 203Argument(IdentifierName(_signatureContext.BindingName)), 204Argument(IdentifierName(Constants.ArgumentsBuffer))}))));
JSImportGenerator.cs (2)
116Attribute(IdentifierName(Constants.DebuggerNonUserCodeAttribute)))))) 121FieldDeclarationSyntax sigField = FieldDeclaration(VariableDeclaration(IdentifierName(Constants.JSFunctionSignatureGlobal))
JSManagedTypeInfo.cs (1)
68Syntax = SyntaxFactory.IdentifierName("nint")
Marshaling\BaseJSGenerator.cs (7)
52yield return LocalDeclarationStatement(VariableDeclaration(RefType(IdentifierName(Constants.JSMarshalerArgumentGlobal))) 54.WithInitializer(EqualsValueClause(RefExpression(ElementAccessExpression(IdentifierName(Constants.ArgumentsBuffer)) 68return IdentifierName(Constants.JSMarshalerTypeGlobalDot + marshalerType.ToString()); 76return IdentifierName(Constants.ToManagedBigMethod); 78return IdentifierName(Constants.ToManagedMethod); 87return IdentifierName(Constants.ToJSBigMethod); 89return IdentifierName(Constants.ToJSMethod);
Marshaling\FuncJSGenerator.cs (9)
40? Argument(IdentifierName(context.GetIdentifiers(TypeInfo).native)) 91IdentifierName(target), GetToManagedMethod(Type))) 112IdentifierName(target), GetToJSMethod(Type))) 121.WithType(IdentifierName(Constants.JSMarshalerArgumentGlobal)), 126IdentifierName("__delegate_arg_arg" + (i + 1)), GetToJSMethod(marshalerType))) 128Argument(IdentifierName("__delegate_arg"+(i+1))), 136.WithType(IdentifierName(Constants.JSMarshalerArgumentGlobal)), 142IdentifierName("__delegate_arg_arg" + (i + 1)), GetToManagedMethod(marshalerType))) 144Argument(IdentifierName("__delegate_arg"+(i+1))).WithRefOrOutKeyword(Token(SyntaxKind.OutKeyword)),
Marshaling\PrimitiveJSGenerator.cs (3)
33? Argument(IdentifierName(context.GetIdentifiers(TypeInfo).native)) 75IdentifierName(target), GetToManagedMethod(Type))) 82IdentifierName(target), GetToJSMethod(Type)))
Marshaling\TaskJSGenerator.cs (11)
46? Argument(IdentifierName(context.GetIdentifiers(TypeInfo).native)) 86IdentifierName(target), GetToManagedMethod(Type))) 93IdentifierName(target), GetToJSMethod(Type))) 100IdentifierName(target), GetToManagedMethod(Type))) 108.WithType(IdentifierName(Constants.JSMarshalerArgumentGlobal)), 114IdentifierName("__task_result_arg"), GetToManagedMethod(_resultMarshalerType))) 116Argument(IdentifierName("__task_result")).WithRefOrOutKeyword(Token(SyntaxKind.OutKeyword)), 123IdentifierName(target), GetToJSMethod(Type))) 131.WithType(IdentifierName(Constants.JSMarshalerArgumentGlobal)), 136IdentifierName("__task_result_arg"), GetToJSMethod(_resultMarshalerType))) 138Argument(IdentifierName("__task_result")),
Microsoft.Interop.LibraryImportGenerator (3)
LibraryImportGenerator.cs (3)
142.WithNameEquals(NameEquals(IdentifierName(CallConvsField)))); 536IdentifierName(typeof(T).FullName), 537IdentifierName(value.ToString()));
Microsoft.Interop.LibraryImportGenerator.Downlevel (1)
DownlevelLibraryImportGenerator.cs (1)
379IdentifierName(nameof(CharSet.Unicode)));
Microsoft.Interop.SourceGeneration (159)
GeneratedStatements.cs (2)
120IdentifierName(targetIdentifier), 148IdentifierName(context.GetIdentifiers(marshallers.ManagedReturnMarshaller.TypeInfo).managed),
ManagedToNativeStubGenerator.cs (4)
111GeneratedStatements statements = GeneratedStatements.Create(_marshallers, StubCodeContext.DefaultManagedToNativeStub, _context, IdentifierName(targetIdentifier)); 158IdentifierName(InvokeSucceededIdentifier), 168finallyStatements.Add(IfStatement(IdentifierName(InvokeSucceededIdentifier), Block(statements.GuaranteedUnmarshal.Concat(statements.CleanupCalleeAllocated)))); 191allStatements.Add(ReturnStatement(IdentifierName(_context.GetIdentifiers(_marshallers.ManagedReturnMarshaller.TypeInfo).managed)));
MarshalAsParser.cs (1)
91.WithNameEquals(NameEquals(IdentifierName(nameof(ArraySubType)))));
Marshalling\BlittableMarshaller.cs (5)
55IdentifierName(managedIdentifier)) 77IdentifierName(nativeIdentifier), 78IdentifierName(managedIdentifier))); 88IdentifierName(managedIdentifier), 89IdentifierName(nativeIdentifier)));
Marshalling\BoolMarshaller.cs (4)
65IdentifierName(nativeIdentifier), 69ConditionalExpression(IdentifierName(managedIdentifier), 86IdentifierName(managedIdentifier), 89IdentifierName(nativeIdentifier),
Marshalling\CharMarshaller.cs (5)
76IdentifierName(PinnedIdentifier(info.InstanceIdentifier)))))))) 98IdentifierName(nativeIdentifier), 99IdentifierName(managedIdentifier))); 110IdentifierName(managedIdentifier), 114IdentifierName(nativeIdentifier))));
Marshalling\DelegateMarshaller.cs (8)
43IdentifierName(nativeIdentifier), 47IdentifierName(managedIdentifier), 52IdentifierName("GetFunctionPointerForDelegate"), 53Argument(IdentifierName(managedIdentifier))), 62IdentifierName(managedIdentifier), 66IdentifierName(nativeIdentifier), 75Argument(IdentifierName(nativeIdentifier))), 85ArgumentList(SingletonSeparatedList(Argument(IdentifierName(managedIdentifier))))));
Marshalling\ElementsMarshalling.cs (33)
47IdentifierName("Clear")); 59IdentifierName("Clear")); 120IdentifierName(numElementsIdentifier), 124IdentifierName("Length")))); 134IdentifierName(numElementsIdentifier), 138IdentifierName("Length")))); 156IdentifierName("CreateSpan"), 160IdentifierName("GetReference"), 165IdentifierName("Length"))))); 170IdentifierName("CopyTo"), 181IdentifierName("CopyTo"), 192IdentifierName("CreateSpan"), 196IdentifierName("GetReference"), 201IdentifierName("Length")))); 209IdentifierName("CopyTo"))) 221IdentifierName("CopyTo"), 281IdentifierName(nativeSpanIdentifier), 282IdentifierName("Clear"))); 288IdentifierName("Length")), 314IdentifierName(numElementsIdentifier), 335IdentifierName("CreateSpan"), 339IdentifierName("AsRef"), 343IdentifierName("GetPinnableReference"))))), 344Argument(IdentifierName(numElementsIdentifier)))); 359IdentifierName(numElementsIdentifier), 371IdentifierName(nativeSpanIdentifier), 372IdentifierName("Length")); 389IdentifierName("_"), 423IdentifierName("CreateSpan"), 427IdentifierName("AsRef"), 431IdentifierName("GetPinnableReference"))))), 432Argument(IdentifierName(numElementsIdentifier)))); 463IdentifierName(numElementsIdentifier),
Marshalling\MarshallerHelpers.cs (11)
48IdentifierName("SetLastSystemError"), 55AssignmentStatement(IdentifierName(lastErrorIdentifier), MethodInvocation(TypeSyntaxes.System_Runtime_InteropServices_Marshal, IdentifierName("GetLastSystemError"))); 62MethodInvocationStatement(TypeSyntaxes.System_Runtime_InteropServices_Marshal, IdentifierName("SetLastPInvokeError"), Argument(IdentifierName(lastErrorIdentifier))); 96ExpressionSyntax indexedManagedElement = IdentifierName(context.GetIdentifiers(info).managed); 100.AddArgumentListArguments(Argument(IdentifierName(GetIndexerIdentifier(i)))); 269MethodInvocation(TypeSyntaxes.System_Runtime_CompilerServices_Unsafe, IdentifierName("SkipInit"), 270Argument(IdentifierName(info.InstanceIdentifier)) 277IdentifierName(info.InstanceIdentifier), 286IdentifierName(info.InstanceIdentifier),
Marshalling\MarshallingGeneratorExtensions.cs (10)
118rehydratedAttributes.Add(Attribute(IdentifierName(TypeNames.System_Runtime_InteropServices_InAttribute))); 122rehydratedAttributes.Add(Attribute(IdentifierName(TypeNames.System_Runtime_InteropServices_OutAttribute))); 145ValueBoundaryBehavior.ManagedIdentifier when !info.IsByRef => Argument(IdentifierName(managedIdentifier)), 146ValueBoundaryBehavior.ManagedIdentifier when info.IsByRef => Argument(IdentifierName(managedIdentifier)).WithRefKindKeyword(MarshallerHelpers.GetManagedArgumentRefKindKeyword(info)), 147ValueBoundaryBehavior.NativeIdentifier => Argument(IdentifierName(nativeIdentifier)), 148ValueBoundaryBehavior.AddressOfNativeIdentifier => Argument(PrefixUnaryExpression(SyntaxKind.AddressOfExpression, IdentifierName(nativeIdentifier))), 149ValueBoundaryBehavior.CastNativeIdentifier => Argument(CastExpression(generator.AsParameter(context).Type, IdentifierName(nativeIdentifier))), 160return Argument(IdentifierName(managedIdentifier)).WithRefKindKeyword(MarshallerHelpers.GetManagedArgumentRefKindKeyword(info)); 162return Argument(IdentifierName(managedIdentifier)); 169return RefExpression(PrefixUnaryExpression(SyntaxKind.PointerIndirectionExpression, IdentifierName(paramIdentifier)));
Marshalling\StatefulMarshallingStrategy.cs (32)
35IdentifierName(context.GetAdditionalIdentifier(info, MarshallerIdentifier)), 36IdentifierName(ShapeMemberNames.Free)); 49IdentifierName(context.GetAdditionalIdentifier(info, MarshallerIdentifier)), 50IdentifierName(ShapeMemberNames.Free)); 62IdentifierName(managedIdentifier), 64IdentifierName(context.GetAdditionalIdentifier(info, MarshallerIdentifier)), 65IdentifierName(ShapeMemberNames.Value.Stateful.ToManagedFinally))); 77IdentifierName(context.GetAdditionalIdentifier(info, MarshallerIdentifier)), 78IdentifierName(ShapeMemberNames.Value.Stateful.FromManaged), 79Argument(IdentifierName(managedIdentifier))); 91IdentifierName(nativeIdentifier), 93IdentifierName(context.GetAdditionalIdentifier(info, MarshallerIdentifier)), 94IdentifierName(ShapeMemberNames.Value.Stateful.ToUnmanaged))); 106IdentifierName(managedIdentifier), 108IdentifierName(context.GetAdditionalIdentifier(info, MarshallerIdentifier)), 109IdentifierName(ShapeMemberNames.Value.Stateful.ToManaged))); 121IdentifierName(context.GetAdditionalIdentifier(info, MarshallerIdentifier)), 122IdentifierName(ShapeMemberNames.Value.Stateful.FromUnmanaged), 123Argument(IdentifierName(nativeIdentifier))); 160.WithInitializer(EqualsValueClause(IdentifierName(context.GetAdditionalIdentifier(info, MarshallerIdentifier)))))), 171IdentifierName(context.GetAdditionalIdentifier(info, MarshallerIdentifier)), 172IdentifierName(ShapeMemberNames.Value.Stateful.OnInvoked)); 215Argument(IdentifierName(managedIdentifier)), 273IdentifierName(marshaller), 283IdentifierName(marshaller), 294IdentifierName(marshaller), 296Argument(IdentifierName(numElementsIdentifier))); 306IdentifierName(marshaller), 308Argument(IdentifierName(numElementsIdentifier))); 448yield return AssignmentStatement(IdentifierName(numElementsIdentifier), ElementsMarshalling.GenerateNumElementsExpression(countInfo, castCountInfo, CodeContext, context)); 487IdentifierName(marshaller), 504IdentifierName(marshaller),
Marshalling\StatelessMarshallingStrategy.cs (39)
42IdentifierName(managedIdentifier), 46IdentifierName(ShapeMemberNames.Value.Stateless.ConvertToManagedFinally)), 48Argument(IdentifierName(nativeIdentifier))))))); 62IdentifierName(ShapeMemberNames.Value.Stateless.ConvertToUnmanaged)), 64Argument(IdentifierName(managedIdentifier))))); 83IdentifierName(nativeIdentifier), 91IdentifierName(nativeIdentifier), 114IdentifierName(managedIdentifier), 118IdentifierName(ShapeMemberNames.Value.Stateless.ConvertToManaged)), 120Argument(IdentifierName(nativeIdentifier))))))); 198IdentifierName(nativeIdentifier), 205Argument(IdentifierName(managedIdentifier)), 206Argument(IdentifierName(bufferIdentifier)), 207Argument(IdentifierName(numElementsIdentifier)) 223IdentifierName(nativeIdentifier), 230Argument(IdentifierName(managedIdentifier)), 231Argument(IdentifierName(bufferIdentifier)) 330IdentifierName(numElementsIdentifier), 351IdentifierName(numElementsIdentifier), 366IdentifierName(numElementsIdentifier), 373IdentifierName(managedIdentifier), 380Argument(IdentifierName(nativeIdentifier)), 381Argument(IdentifierName(numElementsIdentifier)) 401IdentifierName(nativeIdentifier), 408Argument(IdentifierName(managedIdentifier)), 409Argument(IdentifierName(numElementsIdentifier)) 454IdentifierName(numElementsIdentifier), 461IdentifierName(managedIdentifier), 468Argument(IdentifierName(nativeIdentifier)), 469Argument(IdentifierName(numElementsIdentifier)) 495Argument(IdentifierName(nativeIdentifier)), 496Argument(IdentifierName(numElementsIdentifier)), 510Argument(IdentifierName(managedIdentifier))))); 526Argument(IdentifierName(nativeIdentifier)), 527Argument(IdentifierName(numElementsIdentifier)) 541ArgumentList(SingletonSeparatedList(Argument(IdentifierName(managedIdentifier))))); 591IdentifierName(numElementsIdentifier), 600IdentifierName(numElementsIdentifier), 634IdentifierName(numElementsIdentifier),
Marshalling\StaticPinnableManagedValueMarshaller.cs (2)
89IdentifierName(ShapeMemberNames.GetPinnableReference)), 91Argument(IdentifierName(managedIdentifier))))))
Marshalling\UnmanagedToManagedOwnershipTrackingStrategy.cs (1)
44IdentifierName(context.GetAdditionalIdentifier(TypeInfo, OwnershipTrackingHelpers.OwnOriginalValueIdentifier)),
Utils\SyntaxFactoryExtensions.cs (2)
135IdentifierName(indexerIdentifier), 141IdentifierName(indexerIdentifier))));
Microsoft.VisualStudio.LanguageServices.CSharp (1)
CodeModel\CSharpCodeModelService.cs (1)
919return ((AttributeArgumentSyntax)node).WithNameEquals(SyntaxFactory.NameEquals(SyntaxFactory.IdentifierName(name)));
System.Text.RegularExpressions.Generator (1)
UpgradeToGeneratedRegexCodeFixer.cs (1)
219regexOptionsValue ??= generator.MemberAccessExpression(SyntaxFactory.IdentifierName("RegexOptions"), "None");