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