3 types derived from SyntaxNode
Microsoft.CodeAnalysis (1)
Syntax\SyntaxList.cs (1)
11internal abstract partial class SyntaxList : SyntaxNode
Microsoft.CodeAnalysis.CSharp (1)
Syntax\CSharpSyntaxNode.cs (1)
26public abstract partial class CSharpSyntaxNode : SyntaxNode, IFormattable
Microsoft.CodeAnalysis.VisualBasic (1)
Syntax\VisualBasicSyntaxNode.vb (1)
22Inherits SyntaxNode
25948 references to SyntaxNode
AnalyzerRunner (2)
CodeRefactoringRunner.cs (1)
78var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
Program.cs (1)
208var root = await tree.GetRootAsync(cancellationToken).ConfigureAwait(false);
ConfigurationSchemaGenerator (1)
RuntimeSource\Configuration.Binder\Parser\BinderInvocation.cs (1)
34public static bool IsCandidateSyntaxNode(SyntaxNode node)
IdeBenchmarks (2)
FormatterBenchmarks.cs (2)
48var root = document.GetSyntaxRootSynchronously(CancellationToken.None); 61var root = document.GetSyntaxRootSynchronously(CancellationToken.None);
IdeCoreBenchmarks (19)
FormatterBenchmarks.cs (2)
54var root = document.GetSyntaxRootAsync(CancellationToken.None).Result.WithAdditionalAnnotations(Formatter.Annotation); 70var formattedRoot = formattedDoc.GetSyntaxRootAsync(CancellationToken.None).Result;
NavigateToBenchmarks.cs (2)
110var roots = new List<SyntaxNode>(); 194var tree = await d.GetSyntaxRootAsync();
SyntacticChangeRangeBenchmark.cs (15)
24private SyntaxNode _root; 26private SyntaxNode _rootWithSimpleEdit; 27private SyntaxNode _rootWithComplexEdit; 50private SyntaxNode WithSimpleEditAtMiddle() 56var newRoot = newTree.GetRoot(); 60private SyntaxNode WithDestabalizingEditAtMiddle() 65var newRoot = newTree.GetRoot(); 69private SyntaxNode WithSimpleEditAtBeginning() 74var newRoot = newTree.GetRoot(); 78private SyntaxNode WithSimpleEditInTheEnd() 83var newRoot = newTree.GetRoot(); 90var newRoot = WithSimpleEditAtMiddle(); 97var newRoot = WithDestabalizingEditAtMiddle(); 116var newRoot = WithSimpleEditAtBeginning(); 123var newRoot = WithSimpleEditInTheEnd();
ILLink.CodeFixProvider (20)
BaseAttributeCodeFixProvider.cs (8)
42 SyntaxNode targetNode = root.FindNode (diagnostic.Location.SourceSpan, getInnermostNodeForTie: true); 43 if (FindAttributableParent (targetNode, AttributableParentTargets) is not SyntaxNode attributableNode) 56 SyntaxNode targetNode, 57 SyntaxNode attributableNode, 74 var attribute = generator.Attribute ( 93 private static CSharpSyntaxNode? FindAttributableParent (SyntaxNode node, AttributeableParentTargets targets) 95 SyntaxNode? parentNode = node.Parent; 128 protected abstract SyntaxNode[] GetAttributeArguments (
DynamicallyAccessedMembersCodeFixProvider.cs (3)
103 if (root.FindNode (diagnostic.AdditionalLocations[0].SourceSpan, getInnermostNodeForTie: true) is not SyntaxNode targetNode) 122 SyntaxNode targetNode, 136 var attribute = generator.Attribute (
RequiresAssemblyFilesCodeFixProvider.cs (1)
35 protected override SyntaxNode[] GetAttributeArguments (ISymbol? attributableSymbol, ISymbol targetSymbol, SyntaxGenerator syntaxGenerator, Diagnostic diagnostic) =>
RequiresDynamicCodeCodeFixProvider.cs (1)
32 protected override SyntaxNode[] GetAttributeArguments (ISymbol? attributableSymbol, ISymbol targetSymbol, SyntaxGenerator syntaxGenerator, Diagnostic diagnostic) =>
RequiresHelpers.cs (2)
13 internal static SyntaxNode[] GetAttributeArgumentsForRequires (ISymbol targetSymbol, SyntaxGenerator syntaxGenerator, bool hasPublicAccessibility) 17 return Array.Empty<SyntaxNode> ();
RequiresUnreferencedCodeCodeFixProvider.cs (1)
32 protected override SyntaxNode[] GetAttributeArguments (ISymbol? attributableSymbol, ISymbol targetSymbol, SyntaxGenerator syntaxGenerator, Diagnostic diagnostic) =>
UnconditionalSuppressMessageCodeFixProvider.cs (4)
40 protected override SyntaxNode[] GetAttributeArguments (ISymbol? attributableSymbol, ISymbol targetSymbol, SyntaxGenerator syntaxGenerator, Diagnostic diagnostic) 43 var ruleCategory = syntaxGenerator.AttributeArgument ( 50 var ruleId = syntaxGenerator.AttributeArgument ( 55 var suppressionJustification = syntaxGenerator.AttributeArgument (Justification,
Microsoft.Analyzers.Extra (26)
CallAnalysis\Fixers\LegacyLoggingFixer.cs (14)
39internal Func<Document, CancellationToken, Task<SyntaxNode?>> GetSyntaxRootAsync = (d, t) => d.GetSyntaxRootAsync(t); 41internal Func<SemanticModel, SyntaxNode, CancellationToken, IOperation?> GetOperation = (sm, sn, t) => sm.GetOperation(sn, t); 73var root = await GetSyntaxRootAsync(invocationDoc, cancellationToken).ConfigureAwait(false); 324var root = await doc.GetSyntaxRootAsync().ConfigureAwait(false); 361private static List<SyntaxNode> MakeParameterList( 367var loggerType = gen.TypeExpression(t); 373var loggerParam = gen.ParameterDeclaration("logger", loggerType); 379var parameters = new List<SyntaxNode> 476var argList = new List<SyntaxNode>(); 479SyntaxNode loggerSyntaxNode = null!; 519var memberAccessExpression = gen.MemberAccessExpression(loggerSyntaxNode!, methodName); 520var call = gen.InvocationExpression(memberAccessExpression, argList).WithTriviaFrom(invocationExpression); 586var logMethod = gen.MethodDeclaration( 599var attr = gen.Attribute(LoggerMessageAttribute, attrArgs);
MakeExeTypesInternalFixer.cs (3)
28var root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 29var node = root?.FindNode(context.Span); 37private static async Task<Document> MakeInternalAsync(Document document, SyntaxNode decl, CancellationToken cancellationToken)
Utilities\SyntaxNodeExtensions.cs (9)
14/// Class contains <see cref="SyntaxNode"/> extensions. 24public static SyntaxNode? GetFirstAncestorOfSyntaxKind(this SyntaxNode node, SyntaxKind kind) 26var n = node.Parent; 43this SyntaxNode? node, 102public static SyntaxNode? FindNodeInTreeUpToSpecifiedParentByMethodName( 103this SyntaxNode nodeToStart, 108var currentNode = nodeToStart; 111var foundNode = currentNode.DescendantNodesAndSelf()
Microsoft.Analyzers.Extra.Tests (2)
CallAnalysis\LegacyLoggingTests.cs (2)
822var targetRoot = await targetDoc.GetSyntaxRootAsync(CancellationToken.None); 849GetSyntaxRootAsync = (_, _) => Task.FromResult<SyntaxNode?>(null)
Microsoft.AspNetCore.Analyzers (1)
CompilationFeatureDetector.cs (1)
41var syntax = await syntaxReferences[j].GetSyntaxAsync(cancellationToken).ConfigureAwait(false);
Microsoft.AspNetCore.App.Analyzers (76)
Infrastructure\VirtualChars\CSharpVirtualCharService.cs (2)
87var parent = token.GetRequiredParent(); 114private static bool IsInDirective(SyntaxNode? node)
Kestrel\ListenOnIPv6AnyAnalyzer.cs (1)
85var localVarSyntax = localVariableDeclaration.GetSyntax(context.CancellationToken);
RouteEmbeddedLanguage\FrameworkParametersCompletionProvider.cs (10)
96var root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 118var container = TryFindMinimalApiArgument(token.Parent) ?? TryFindMvcActionParameter(token.Parent); 148SyntaxNode methodNode; 321private static SyntaxNode? TryFindMvcActionParameter(SyntaxNode? node) 323var current = node; 337private static SyntaxNode? TryFindMinimalApiArgument(SyntaxNode? node) 339var current = node; 409private static ImmutableArray<string> GetExistingParameterNames(SyntaxNode node)
RouteEmbeddedLanguage\Infrastructure\RouteStringSyntaxDetector.cs (24)
76var container = token.TryFindContainer(); 99var statement = container.FirstAncestorOrSelf<SyntaxNode>(n => n is StatementSyntax); 102GetPartsOfAssignmentStatement(statement, out var left, out var right); 115var variableDeclarator = container.Parent.Parent; 127var property = container.Parent.GetRequiredParent(); 165for (var node = token.Parent; node != null; node = node.Parent) 221public static bool IsStatement([NotNullWhen(true)] SyntaxNode? node) 233public static bool IsEqualsValueOfPropertyDeclaration(SyntaxNode? node) 236private static SyntaxToken GetIdentifierOfVariableDeclarator(SyntaxNode node) 241SyntaxNode left, 250SyntaxNode statement, out SyntaxNode left, out SyntaxNode right) 257SyntaxNode statement, out SyntaxNode left, out SyntaxToken operatorToken, out SyntaxNode right) 259var expression = statement; 273SyntaxNode argument, 283SyntaxNode argument, 367private static ISymbol? FindFieldOrPropertyForAttributeArgument(SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken) 372private static IParameterSymbol? FindParameterForArgument(SemanticModel semanticModel, SyntaxNode argument, bool allowUncertainCandidates, CancellationToken cancellationToken) 375private static IParameterSymbol? FindParameterForAttributeArgument(SemanticModel semanticModel, SyntaxNode argument, bool allowUncertainCandidates, CancellationToken cancellationToken)
RouteEmbeddedLanguage\Infrastructure\RouteUsageDetector.cs (9)
36SyntaxNode? MethodSyntax, 76var container = token.TryFindContainer(); 112var attributeParent = FindAttributeParent(container); 191private static SyntaxNode? FindAttributeParent(SyntaxNode container) 193var argument = container.Parent; 232public static MapMethodParts? FindMapMethodParts(SemanticModel semanticModel, WellKnownTypes wellKnownTypes, SyntaxNode container, CancellationToken cancellationToken) 234var argument = container.Parent; 333private static IMethodSymbol? GetMethodInfo(SemanticModel semanticModel, SyntaxNode syntaxNode, CancellationToken cancellationToken)
RouteEmbeddedLanguage\Infrastructure\SyntaxNodeExtensions.cs (14)
20public static SyntaxNode GetRequiredParent(this SyntaxNode node) 23public static SyntaxNode? GetParent(this SyntaxNode node, bool ascendOutOfTrivia) 25var parent = node.Parent; 37public static bool IsLiteralExpression([NotNullWhen(true)] this SyntaxNode? node) 40public static bool IsBinaryExpression([NotNullWhen(true)] this SyntaxNode? node) 44public static SyntaxNode? WalkUpParentheses(this SyntaxNode? node) 54public static bool IsAnyInitializerExpression([NotNullWhen(true)] this SyntaxNode? node, [NotNullWhen(true)] out SyntaxNode? creationExpression) 69public static bool IsSimpleAssignmentStatement([NotNullWhen(true)] this SyntaxNode? statement) 77this SyntaxNode root, 113SyntaxNode root,
RouteEmbeddedLanguage\Infrastructure\SyntaxTokenExtensions.cs (4)
11public static SyntaxNode? TryFindContainer(this SyntaxToken token) 13var node = token.GetRequiredParent().WalkUpParentheses(); 16if (node.Parent.IsAnyInitializerExpression(out var instance)) 24public static SyntaxNode GetRequiredParent(this SyntaxToken token)
RouteEmbeddedLanguage\RoutePatternAnalyzer.cs (1)
33var root = syntaxTree.GetRoot(cancellationToken);
RouteEmbeddedLanguage\RoutePatternCompletionProvider.cs (1)
95var root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);
RouteEmbeddedLanguage\RoutePatternHighlighter.cs (2)
78var syntaxNode = item.GetSyntax(cancellationToken); 89var methodSyntax = item.GetSyntax(cancellationToken);
RouteHandlers\AtMostOneFromBodyAttribute.cs (1)
52var syntax = symbol.DeclaringSyntaxReferences[0].GetSyntax(context.CancellationToken);
RouteHandlers\DisallowMvcBindArgumentsOnParameters.cs (1)
32var syntax = parameter.DeclaringSyntaxReferences[0].GetSyntax(context.CancellationToken);
RouteHandlers\DisallowReturningActionResultFromMapMethods.cs (2)
21SyntaxNode nodeForError) 32SyntaxNode nodeForError)
RouteHandlers\RouteHandlerAnalyzer.cs (1)
127var syntaxNode = syntaxReference.GetSyntax(context.CancellationToken);
src\Shared\Roslyn\CodeAnalysisExtensions.cs (1)
201SyntaxNode receiverSyntax,
WebApplicationBuilder\PublicPartialProgramClassAnalyzer.cs (2)
24var syntaxNode = context.Node; 34private static bool IsPublicPartialClassProgram(SyntaxNode syntaxNode)
Microsoft.AspNetCore.App.Analyzers.Test (1)
TestDiagnosticAnalyzer.cs (1)
79var root = await document.GetSyntaxRootAsync(CancellationToken.None).ConfigureAwait(false);
Microsoft.AspNetCore.App.CodeFixes (43)
Authorization\AddAuthorizationBuilderFixer.cs (7)
29var root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 55private static bool CanReplaceWithAddAuthorizationBuilder(Diagnostic diagnostic, SyntaxNode root, [NotNullWhen(true)] out InvocationExpressionSyntax? invocation) 59var diagnosticTarget = root.FindNode(diagnostic.Location.SourceSpan, getInnermostNodeForTie: true); 64IEnumerable<SyntaxNode> nodes; 85foreach (var configureAction in nodes) 134private static Task<Document> ReplaceWithAddAuthorizationBuilder(Diagnostic diagnostic, SyntaxNode root, Document document, InvocationExpressionSyntax invocation) 136var diagnosticTarget = root.FindNode(diagnostic.Location.SourceSpan, getInnermostNodeForTie: true);
Dependencies\AddPackageFixer.cs (2)
31var root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 50var node = root.FindNode(location);
Dependencies\ExtensionMethodsCompletionProvider.cs (5)
34var root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 60var nearestMemberAccessExpression = FindNearestMemberAccessExpression(token.Parent); 85private static SyntaxNode? FindNearestMemberAccessExpression(SyntaxNode? node) 87var current = node;
DetectMismatchedParameterOptionalityFixer.cs (2)
39var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 45var param = root.FindNode(diagnostic.Location.SourceSpan);
Http\HeaderDictionaryAddFixer.cs (9)
30var root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 68private static Task<Document> ReplaceWithAppend(Diagnostic diagnostic, WellKnownTypes wellKnownTypes, SyntaxNode root, Document document, InvocationExpressionSyntax invocation) 70var diagnosticTarget = root.FindNode(diagnostic.Location.SourceSpan, getInnermostNodeForTie: true); 78private static bool CanReplaceWithAppend(Diagnostic diagnostic, SyntaxNode root, [NotNullWhen(true)] out InvocationExpressionSyntax? invocation) 87var diagnosticTarget = root.FindNode(diagnostic.Location.SourceSpan, getInnermostNodeForTie: true); 99private static Task<Document> ReplaceWithIndexer(Diagnostic diagnostic, SyntaxNode root, Document document, AssignmentExpressionSyntax assignment) 101var diagnosticTarget = root.FindNode(diagnostic.Location.SourceSpan, getInnermostNodeForTie: true); 106private static bool CanReplaceWithIndexer(Diagnostic diagnostic, SyntaxNode root, [NotNullWhen(true)] out AssignmentExpressionSyntax? assignment) 115var diagnosticTarget = root.FindNode(diagnostic.Location.SourceSpan, getInnermostNodeForTie: true);
Http\HeaderDictionaryIndexerFixer.cs (2)
44var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 51var param = root.FindNode(diagnostic.Location.SourceSpan);
Kestrel\ListenOnIPv6AnyFixer.cs (1)
34var root = await context.Document.GetSyntaxRootAsync(cancellationToken);
PublicPartialProgramClassFixer.cs (1)
32var root = await context.Document.GetSyntaxRootAsync(cancellationToken);
RouteParameterUnusedParameterFixer.cs (9)
31var root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 58private static Task<Document> AddRouteParameterAsync(Diagnostic diagnostic, SyntaxNode root, RouteUsageCache routeUsageCache, Document document, CancellationToken cancellationToken) 60var param = root.FindNode(diagnostic.Location.SourceSpan); 74private static Document UpdateDocument(Diagnostic diagnostic, SyntaxNode root, Document document, SyntaxNode methodSyntax) 90var updatedMethod = methodSyntax switch 98var updatedSyntaxTree = root.ReplaceNode(methodSyntax, updatedMethod); 102private static SyntaxNode AddParameter(BaseMethodDeclarationSyntax syntax, ParameterSyntax parameterSyntax, int parameterIndex) 113private static SyntaxNode AddParameter(ParenthesizedLambdaExpressionSyntax syntax, ParameterSyntax parameterSyntax, int parameterIndex)
WebApplicationBuilderFixer.cs (5)
31var root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 77private static Task<Document> FixWebApplicationBuilderAsync(Diagnostic diagnostic, SyntaxNode root, Document document, InvocationExpressionSyntax invocation) 79var diagnosticTarget = root.FindNode(diagnostic.Location.SourceSpan, getInnermostNodeForTie: true); 84private static bool CanFixWebApplicationBuilder(Diagnostic diagnostic, IdentifierNameSyntax identifierMethod, SyntaxNode root, [NotNullWhen(true)] out InvocationExpressionSyntax? invocationName) 94var diagnosticTarget = root.FindNode(diagnostic.Location.SourceSpan, getInnermostNodeForTie: true);
Microsoft.AspNetCore.Components.Analyzers (5)
ComponentParametersShouldBePublicCodeFixProvider.cs (5)
33var root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 52SyntaxNode root, 55var updatedDeclarationNode = HandlePropertyDeclaration(declarationNode); 56var newSyntaxRoot = root.ReplaceNode(declarationNode, updatedDeclarationNode); 60private static SyntaxNode HandlePropertyDeclaration(PropertyDeclarationSyntax node)
Microsoft.AspNetCore.Components.Analyzers.Tests (1)
Helpers\CodeFixVerifier.Helper.cs (1)
81var root = simplifiedDoc.GetSyntaxRootAsync().Result;
Microsoft.AspNetCore.Components.SdkAnalyzers (5)
ComponentParametersShouldBePublicCodeFixProvider.cs (5)
33var root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 52SyntaxNode root, 55var updatedDeclarationNode = HandlePropertyDeclaration(declarationNode); 56var newSyntaxRoot = root.ReplaceNode(declarationNode, updatedDeclarationNode); 60private static SyntaxNode HandlePropertyDeclaration(PropertyDeclarationSyntax node)
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (1)
Helpers\CodeFixVerifier.Helper.cs (1)
81var root = simplifiedDoc.GetSyntaxRootAsync().Result;
Microsoft.AspNetCore.Http.RequestDelegateGenerator (2)
StaticRouteHandlerModel\InvocationOperationExtensions.cs (2)
70public static bool TryGetMapMethodName(this SyntaxNode node, out string? methodName) 101var syn = syntaxReference.GetSyntax();
Microsoft.AspNetCore.Mvc.Analyzers (2)
AttributesShouldNotBeAppliedToPageModelAnalyzer.cs (1)
139var syntax = attribute.ApplicationSyntaxReference.GetSyntax(context.CancellationToken);
src\Shared\Roslyn\CodeAnalysisExtensions.cs (1)
201SyntaxNode receiverSyntax,
Microsoft.AspNetCore.Mvc.Api.Analyzers (8)
AddResponseTypeAttributeCodeFixAction.cs (4)
100var attributeSyntax = await apiConventionMethodAttribute 110var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 129var root = await _document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 131var diagnosticNode = root.FindNode(_diagnostic.Location.SourceSpan);
ApiActionsDoNotRequireExplicitModelValidationCheckAnalyzer.cs (1)
114var returnStatementSyntax = returnOperation.Syntax;
ApiActionsDoNotRequireExplicitModelValidationCodeFixProvider.cs (2)
54var rootNode = await _document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 57var ifBlockSyntax = rootNode!.FindNode(_ifBlockSpan);
src\Shared\Roslyn\CodeAnalysisExtensions.cs (1)
201SyntaxNode receiverSyntax,
Microsoft.AspNetCore.SignalR.Client.SourceGenerator (4)
HubClientProxyGenerator.Parser.cs (2)
18internal static bool IsSyntaxTargetForAttribute(SyntaxNode node) => node is AttributeSyntax 137internal static bool IsSyntaxTargetForGeneration(SyntaxNode node) => node is MemberAccessExpressionSyntax
HubServerProxyGenerator.Parser.cs (2)
18internal static bool IsSyntaxTargetForAttribute(SyntaxNode node) => node is AttributeSyntax 127internal static bool IsSyntaxTargetForGeneration(SyntaxNode node) => node is MemberAccessExpressionSyntax
Microsoft.CodeAnalysis (989)
Binding\BindingDiagnosticBag.cs (3)
208internal bool Add(SyntaxNode node, CompoundUseSiteInfo<TAssemblySymbol> useSiteInfo) 211internal bool AddDiagnostics(SyntaxNode node, CompoundUseSiteInfo<TAssemblySymbol> useSiteInfo) 273internal bool Add(UseSiteInfo<TAssemblySymbol> useSiteInfo, SyntaxNode node)
CodeGen\ILBuilderEmit.cs (7)
49internal void EmitToken(Cci.IReference value, SyntaxNode? syntaxNode, DiagnosticBag diagnostics, Cci.MetadataWriter.RawTokenEncoding encoding = 0) 59internal void EmitToken(Cci.ISignature value, SyntaxNode? syntaxNode, DiagnosticBag diagnostics) 83internal void EmitArrayBlockInitializer(ImmutableArray<byte> data, SyntaxNode syntaxNode, DiagnosticBag diagnostics) 363internal void EmitArrayCreation(Microsoft.Cci.IArrayTypeReference arrayType, SyntaxNode syntaxNode, DiagnosticBag diagnostics) 377internal void EmitArrayElementLoad(Microsoft.Cci.IArrayTypeReference arrayType, SyntaxNode syntaxNode, DiagnosticBag diagnostics) 391internal void EmitArrayElementAddress(Microsoft.Cci.IArrayTypeReference arrayType, SyntaxNode syntaxNode, DiagnosticBag diagnostics) 405internal void EmitArrayElementStore(Cci.IArrayTypeReference arrayType, SyntaxNode syntaxNode, DiagnosticBag diagnostics)
CodeGen\ITokenDeferral.cs (5)
12uint GetFakeSymbolTokenForIL(Cci.IReference value, SyntaxNode? syntaxNode, DiagnosticBag diagnostics); 13uint GetFakeSymbolTokenForIL(Cci.ISignature value, SyntaxNode? syntaxNode, DiagnosticBag diagnostics); 16Cci.IFieldReference GetFieldForData(ImmutableArray<byte> data, ushort alignment, SyntaxNode syntaxNode, DiagnosticBag diagnostics); 20Cci.IFieldReference GetArrayCachingFieldForData(ImmutableArray<byte> data, Cci.IArrayTypeReference arrayType, SyntaxNode syntaxNode, DiagnosticBag diagnostics); 22Cci.IFieldReference GetArrayCachingFieldForConstants(ImmutableArray<ConstantValue> constants, Cci.IArrayTypeReference arrayType, SyntaxNode syntaxNode, DiagnosticBag diagnostics);
CodeGen\VariableSlotAllocator.cs (4)
35SyntaxNode currentDeclarator, 85public abstract bool TryGetPreviousClosure(SyntaxNode closureSyntax, DebugId? parentClosureId, ImmutableArray<string> structCaptures, out DebugId closureId, out RuntimeRudeEdit? runtimeRudeEdit); 99public abstract bool TryGetPreviousLambda(SyntaxNode lambdaOrLambdaBodySyntax, bool isLambdaBody, int closureOrdinal, ImmutableArray<DebugId> structClosureIds, out DebugId lambdaId, out RuntimeRudeEdit? runtimeRudeEdit); 116public abstract bool TryGetPreviousStateMachineState(SyntaxNode syntax, AwaitDebugId awaitId, out StateMachineState state);
Compilation\Compilation.cs (2)
3600internal abstract int CompareSourceLocations(SyntaxNode loc1, SyntaxNode loc2);
Compilation\ControlFlowAnalysis.cs (4)
11/// information is returned from a call to <see cref="SemanticModel.AnalyzeControlFlow(SyntaxNode)" />. 19public abstract ImmutableArray<SyntaxNode> EntryPoints { get; } 25public abstract ImmutableArray<SyntaxNode> ExitPoints { get; } 38public abstract ImmutableArray<SyntaxNode> ReturnStatements { get; }
Compilation\DataFlowAnalysis.cs (2)
12/// <see cref="SemanticModel.AnalyzeDataFlow(SyntaxNode, SyntaxNode)" />, or one of its language-specific overloads,
Compilation\Extensions.cs (14)
19public static SymbolInfo GetSymbolInfo(this SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken = default(CancellationToken)) 43public static SymbolInfo GetSpeculativeSymbolInfo(this SemanticModel semanticModel, int position, SyntaxNode expression, SpeculativeBindingOption bindingOption) 55public static TypeInfo GetTypeInfo(this SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken = default(CancellationToken)) 68public static IAliasSymbol? GetAliasInfo(this SemanticModel semanticModel, SyntaxNode nameSyntax, CancellationToken cancellationToken = default(CancellationToken)) 90public static IAliasSymbol? GetSpeculativeAliasInfo(this SemanticModel semanticModel, int position, SyntaxNode nameSyntax, SpeculativeBindingOption bindingOption) 114public static TypeInfo GetSpeculativeTypeInfo(this SemanticModel semanticModel, int position, SyntaxNode expression, SpeculativeBindingOption bindingOption) 129public static ISymbol? GetDeclaredSymbol(this SemanticModel semanticModel, SyntaxNode declaration, CancellationToken cancellationToken = default(CancellationToken)) 140public static ImmutableArray<ISymbol> GetMemberGroup(this SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken = default(CancellationToken)) 148public static ControlFlowAnalysis AnalyzeControlFlow(this SemanticModel semanticModel, SyntaxNode firstStatement, SyntaxNode lastStatement) 156public static ControlFlowAnalysis AnalyzeControlFlow(this SemanticModel semanticModel, SyntaxNode statement) 164public static DataFlowAnalysis AnalyzeDataFlow(this SemanticModel semanticModel, SyntaxNode firstStatement, SyntaxNode lastStatement) 173public static DataFlowAnalysis AnalyzeDataFlow(this SemanticModel semanticModel, SyntaxNode statementOrExpression)
Compilation\SemanticModel.cs (48)
76public IOperation? GetOperation(SyntaxNode node, CancellationToken cancellationToken = default(CancellationToken)) 81protected abstract IOperation? GetOperationCore(SyntaxNode node, CancellationToken cancellationToken); 100internal SymbolInfo GetSymbolInfo(SyntaxNode node, CancellationToken cancellationToken = default(CancellationToken)) 111protected abstract SymbolInfo GetSymbolInfoCore(SyntaxNode node, CancellationToken cancellationToken = default(CancellationToken)); 131internal SymbolInfo GetSpeculativeSymbolInfo(int position, SyntaxNode expression, SpeculativeBindingOption bindingOption) 154protected abstract SymbolInfo GetSpeculativeSymbolInfoCore(int position, SyntaxNode expression, SpeculativeBindingOption bindingOption); 174internal TypeInfo GetSpeculativeTypeInfo(int position, SyntaxNode expression, SpeculativeBindingOption bindingOption) 197protected abstract TypeInfo GetSpeculativeTypeInfoCore(int position, SyntaxNode expression, SpeculativeBindingOption bindingOption); 205internal TypeInfo GetTypeInfo(SyntaxNode node, CancellationToken cancellationToken = default(CancellationToken)) 216protected abstract TypeInfo GetTypeInfoCore(SyntaxNode node, CancellationToken cancellationToken = default(CancellationToken)); 225internal IAliasSymbol? GetAliasInfo(SyntaxNode nameSyntax, CancellationToken cancellationToken = default(CancellationToken)) 237protected abstract IAliasSymbol? GetAliasInfoCore(SyntaxNode nameSyntax, CancellationToken cancellationToken = default(CancellationToken)); 300internal IAliasSymbol? GetSpeculativeAliasInfo(int position, SyntaxNode nameSyntax, SpeculativeBindingOption bindingOption) 321protected abstract IAliasSymbol? GetSpeculativeAliasInfoCore(int position, SyntaxNode nameSyntax, SpeculativeBindingOption bindingOption); 387internal ISymbol? GetDeclaredSymbolForNode(SyntaxNode declaration, CancellationToken cancellationToken = default(CancellationToken)) 401protected abstract ISymbol? GetDeclaredSymbolCore(SyntaxNode declaration, CancellationToken cancellationToken = default(CancellationToken)); 404/// Gets the symbols associated with a declaration syntax node. Unlike <see cref="GetDeclaredSymbolForNode(SyntaxNode, CancellationToken)"/>, 419internal ImmutableArray<ISymbol> GetDeclaredSymbolsForNode(SyntaxNode declaration, CancellationToken cancellationToken = default(CancellationToken)) 425/// Gets the symbols associated with a declaration syntax node. Unlike <see cref="GetDeclaredSymbolForNode(SyntaxNode, CancellationToken)"/>, 440protected abstract ImmutableArray<ISymbol> GetDeclaredSymbolsCore(SyntaxNode declaration, CancellationToken cancellationToken = default(CancellationToken)); 639internal ControlFlowAnalysis AnalyzeControlFlow(SyntaxNode firstStatement, SyntaxNode lastStatement) 655protected abstract ControlFlowAnalysis AnalyzeControlFlowCore(SyntaxNode firstStatement, SyntaxNode lastStatement); 667internal ControlFlowAnalysis AnalyzeControlFlow(SyntaxNode statement) 682protected abstract ControlFlowAnalysis AnalyzeControlFlowCore(SyntaxNode statement); 695internal DataFlowAnalysis AnalyzeDataFlow(SyntaxNode firstStatement, SyntaxNode lastStatement) 711protected abstract DataFlowAnalysis AnalyzeDataFlowCore(SyntaxNode firstStatement, SyntaxNode lastStatement); 723internal DataFlowAnalysis AnalyzeDataFlow(SyntaxNode statementOrExpression) 738protected abstract DataFlowAnalysis AnalyzeDataFlowCore(SyntaxNode statementOrExpression); 745public Optional<object?> GetConstantValue(SyntaxNode node, CancellationToken cancellationToken = default(CancellationToken)) 755protected abstract Optional<object?> GetConstantValueCore(SyntaxNode node, CancellationToken cancellationToken = default(CancellationToken)); 762internal ImmutableArray<ISymbol> GetMemberGroup(SyntaxNode node, CancellationToken cancellationToken = default(CancellationToken)) 772protected abstract ImmutableArray<ISymbol> GetMemberGroupCore(SyntaxNode node, CancellationToken cancellationToken = default(CancellationToken)); 862public PreprocessingSymbolInfo GetPreprocessingSymbolInfo(SyntaxNode nameSyntax) 872protected abstract PreprocessingSymbolInfo GetPreprocessingSymbolInfoCore(SyntaxNode nameSyntax); 887internal abstract void ComputeDeclarationsInNode(SyntaxNode node, ISymbol associatedSymbol, bool getSymbol, ArrayBuilder<DeclarationInfo> builder, CancellationToken cancellationToken, int? levelsToCompute = null); 895/// <see cref="ShouldSkipSyntaxNodeAnalysis(SyntaxNode, ISymbol)"/>. 897internal virtual Func<SyntaxNode, bool>? GetSyntaxNodesToAnalyzeFilter(SyntaxNode declaredNode, ISymbol declaredSymbol) => null; 903/// logic to <see cref="GetSyntaxNodesToAnalyzeFilter(SyntaxNode, ISymbol)"/>. 905internal virtual bool ShouldSkipSyntaxNodeAnalysis(SyntaxNode node, ISymbol containingSymbol) => false; 910protected internal virtual SyntaxNode GetTopmostNodeForDiagnosticAnalysis(ISymbol symbol, SyntaxNode declaringSyntax) 918internal SyntaxNode Root => RootCore; 923protected abstract SyntaxNode RootCore { get; }
Diagnostic\CommonMessageProvider.cs (14)
260protected abstract void ReportInvalidAttributeArgument(DiagnosticBag diagnostics, SyntaxNode attributeSyntax, int parameterIndex, AttributeData attribute); 262public void ReportInvalidAttributeArgument(BindingDiagnosticBag diagnostics, SyntaxNode attributeSyntax, int parameterIndex, AttributeData attribute) 270protected abstract void ReportInvalidNamedArgument(DiagnosticBag diagnostics, SyntaxNode attributeSyntax, int namedArgumentIndex, ITypeSymbol attributeClass, string parameterName); 272public void ReportInvalidNamedArgument(BindingDiagnosticBag diagnostics, SyntaxNode attributeSyntax, int namedArgumentIndex, ITypeSymbol attributeClass, string parameterName) 280protected abstract void ReportParameterNotValidForType(DiagnosticBag diagnostics, SyntaxNode attributeSyntax, int namedArgumentIndex); 282public void ReportParameterNotValidForType(BindingDiagnosticBag diagnostics, SyntaxNode attributeSyntax, int namedArgumentIndex) 290protected abstract void ReportMarshalUnmanagedTypeNotValidForFields(DiagnosticBag diagnostics, SyntaxNode attributeSyntax, int parameterIndex, string unmanagedTypeName, AttributeData attribute); 292public void ReportMarshalUnmanagedTypeNotValidForFields(BindingDiagnosticBag diagnostics, SyntaxNode attributeSyntax, int parameterIndex, string unmanagedTypeName, AttributeData attribute) 300protected abstract void ReportMarshalUnmanagedTypeOnlyValidForFields(DiagnosticBag diagnostics, SyntaxNode attributeSyntax, int parameterIndex, string unmanagedTypeName, AttributeData attribute); 302public void ReportMarshalUnmanagedTypeOnlyValidForFields(BindingDiagnosticBag diagnostics, SyntaxNode attributeSyntax, int parameterIndex, string unmanagedTypeName, AttributeData attribute) 310protected abstract void ReportAttributeParameterRequired(DiagnosticBag diagnostics, SyntaxNode attributeSyntax, string parameterName); 312public void ReportAttributeParameterRequired(BindingDiagnosticBag diagnostics, SyntaxNode attributeSyntax, string parameterName) 320protected abstract void ReportAttributeParameterRequired(DiagnosticBag diagnostics, SyntaxNode attributeSyntax, string parameterName1, string parameterName2); 322public void ReportAttributeParameterRequired(BindingDiagnosticBag diagnostics, SyntaxNode attributeSyntax, string parameterName1, string parameterName2)
Diagnostic\SourceLocation.cs (1)
26public SourceLocation(SyntaxNode node)
DiagnosticAnalyzer\AnalysisContextInfo.cs (6)
20private readonly SyntaxNode? _node; 42public AnalysisContextInfo(Compilation compilation, SyntaxNode node) : 52public AnalysisContextInfo(Compilation compilation, ISymbol symbol, SyntaxNode node) : 62SyntaxNode? node) 115sb.AppendLine($"{nameof(SyntaxNode)}: {GetFlattenedNodeText(_node)} [{_node.GetType().Name}]@{_node.Span} {(lineSpan.HasValue ? lineSpan.Value.ToString() : string.Empty)}"); 121private string GetFlattenedNodeText(SyntaxNode node)
DiagnosticAnalyzer\AnalysisScope.cs (3)
238Func<ISymbol, SyntaxReference, Compilation, CancellationToken, SyntaxNode> getTopmostNodeForAnalysis, 256var node = getTopmostNodeForAnalysis(symbolEvent.Symbol, syntaxRef, symbolEvent.Compilation, cancellationToken); 267public bool ShouldAnalyze(SyntaxNode node)
DiagnosticAnalyzer\AnalyzerDriver.cs (27)
38private static readonly Func<ISymbol, SyntaxReference, Compilation, CancellationToken, SyntaxNode> s_getTopmostNodeForAnalysis = GetTopmostNodeForAnalysis; 1267for (var node = location.SourceTree.GetRoot(cancellationToken).FindNode(location.SourceSpan, getInnermostNodeForTie: true); 1320var root = tree.GetRoot(cancellationToken); 1347static bool containsGeneratedCodeToken(SyntaxNode root) 1885private static SyntaxNode GetTopmostNodeForAnalysis(ISymbol symbol, SyntaxReference syntaxReference, Compilation compilation, CancellationToken cancellationToken) 2405private readonly Func<SyntaxNode, TLanguageKindEnum> _getKind; 2416internal AnalyzerDriver(ImmutableArray<DiagnosticAnalyzer> analyzers, Func<SyntaxNode, TLanguageKindEnum> getKind, AnalyzerManager analyzerManager, SeverityFilter severityFilter, Func<SyntaxTrivia, bool> isComment) 2545SyntaxNode declaringReferenceSyntax = declaration.GetSyntax(cancellationToken); 2546SyntaxNode topmostNodeForAnalysis = semanticModel.GetTopmostNodeForDiagnosticAnalysis(symbol, declaringReferenceSyntax); 2556private static void ComputeDeclarationsInNode(SemanticModel semanticModel, ISymbol declaredSymbol, SyntaxNode declaringReferenceSyntax, SyntaxNode topmostNodeForAnalysis, ArrayBuilder<DeclarationInfo> builder, CancellationToken cancellationToken) 2612void executeNodeActionsByKind(ArrayBuilder<SyntaxNode> nodesToAnalyze, GroupedAnalyzerActions groupedActions, bool arePerSymbolActions) 2629var filteredNodesToAnalyze = ArrayBuilder<SyntaxNode>.GetInstance(nodesToAnalyze.Count); 2630foreach (var node in nodesToAnalyze) 2648ArrayBuilder<SyntaxNode> filteredNodesToAnalyze) 2666var executableCodeBlocks = ImmutableArray<SyntaxNode>.Empty; 2795void executeCodeBlockActions(ImmutableArray<SyntaxNode> executableCodeBlocks, IEnumerable<ExecutableCodeBlockAnalyzerActions> codeBlockActions) 2840SyntaxNode declaredNode, 2844ArrayBuilder<SyntaxNode> nodesToAnalyze, 2849HashSet<SyntaxNode>? descendantDeclsToSkip = null; 2873var declarationNodeToSkip = declInNode.DeclaredNode; 2880descendantDeclsToSkip ??= new HashSet<SyntaxNode>(); 2887Func<SyntaxNode, bool>? additionalFilter = semanticModel.GetSyntaxNodesToAnalyzeFilter(declaredNode, declaredSymbol); 2888bool shouldAddNode(SyntaxNode node) => (descendantDeclsToSkip == null || !descendantDeclsToSkip.Contains(node)) && (additionalFilter is null || additionalFilter(node)); 2889foreach (var node in declaredNode.DescendantNodesAndSelf(descendIntoChildren: shouldAddNode, descendIntoTrivia: true)) 2916ImmutableArray<SyntaxNode> executableBlocks, 2922foreach (SyntaxNode executableBlock in executableBlocks)
DiagnosticAnalyzer\AnalyzerDriver.DeclarationAnalysisData.cs (6)
17public readonly SyntaxNode DeclaringReferenceSyntax; 22public readonly SyntaxNode TopmostNodeForAnalysis; 32public readonly ArrayBuilder<SyntaxNode> DescendantNodesToAnalyze = ArrayBuilder<SyntaxNode>.GetInstance(); 40SyntaxNode declaringReferenceSyntax, 41SyntaxNode topmostNodeForAnalysis,
DiagnosticAnalyzer\AnalyzerExecutor.cs (23)
357Func<ISymbol, SyntaxReference, Compilation, CancellationToken, SyntaxNode> getTopMostNodeForAnalysis, 412Func<ISymbol, SyntaxReference, Compilation, CancellationToken, SyntaxNode> getTopMostNodeForAnalysis, 449Func<ISymbol, SyntaxReference, Compilation, CancellationToken, SyntaxNode> getTopMostNodeForAnalysis, 466Func<ISymbol, SyntaxReference, Compilation, CancellationToken, SyntaxNode> getTopMostNodeForAnalysis, 637SyntaxNode node, 693SyntaxNode declaredNode, 695ImmutableArray<SyntaxNode> executableCodeBlocks, 697Func<SyntaxNode, TLanguageKindEnum> getKind, 703ExecuteBlockActionsCore<CodeBlockStartAnalyzerAction<TLanguageKindEnum>, CodeBlockAnalyzerAction, SyntaxNodeAnalyzerAction<TLanguageKindEnum>, SyntaxNode, TLanguageKindEnum>( 730SyntaxNode declaredNode, 750SyntaxNode declaredNode, 755Func<SyntaxNode, TLanguageKindEnum>? getKind, 852var syntaxNodesToAnalyze = (IEnumerable<SyntaxNode>)getNodesToAnalyze(executableBlocks); 873SyntaxNode declaredNode, 954IEnumerable<SyntaxNode> nodesToAnalyze, 958Func<SyntaxNode, TLanguageKindEnum> getKind, 981IEnumerable<SyntaxNode> nodesToAnalyze, 986Func<SyntaxNode, TLanguageKindEnum> getKind, 999foreach (var node in nodesToAnalyze) 1369private Action<Diagnostic> GetAddDiagnostic(ISymbol contextSymbol, ImmutableArray<SyntaxReference> cachedDeclaringReferences, DiagnosticAnalyzer analyzer, Func<ISymbol, SyntaxReference, Compilation, CancellationToken, SyntaxNode> getTopMostNodeForAnalysis, CancellationToken cancellationToken) 1383Func<ISymbol, SyntaxReference, Compilation, CancellationToken, SyntaxNode> getTopMostNodeForAnalysis, 1410var syntax = getTopMostNodeForAnalysis(contextSymbol, syntaxRef, compilation, cancellationToken); 1465private bool ShouldExecuteNode(SyntaxNode node, DiagnosticAnalyzer analyzer, CancellationToken cancellationToken)
DiagnosticAnalyzer\DiagnosticAnalysisContext.cs (53)
133/// Register an action to be executed at completion of semantic analysis of a <see cref="SyntaxNode"/> with an appropriate Kind. 134/// A syntax node action can report <see cref="Diagnostic"/>s about <see cref="SyntaxNode"/>s, and can also collect 138/// <param name="action">Action to be executed at completion of semantic analysis of a <see cref="SyntaxNode"/>.</param> 139/// <param name="syntaxKinds">Action will be executed only if a <see cref="SyntaxNode"/>'s Kind matches one of the syntax kind values.</param> 146/// Register an action to be executed at completion of semantic analysis of a <see cref="SyntaxNode"/> with an appropriate Kind. 147/// A syntax node action can report <see cref="Diagnostic"/>s about <see cref="SyntaxNode"/>s, and can also collect 151/// <param name="action">Action to be executed at completion of semantic analysis of a <see cref="SyntaxNode"/>.</param> 152/// <param name="syntaxKinds">Action will be executed only if a <see cref="SyntaxNode"/>'s Kind matches one of the syntax kind values.</param> 449/// Register an action to be executed at completion of semantic analysis of a <see cref="SyntaxNode"/> with an appropriate Kind. 450/// A syntax node action can report <see cref="Diagnostic"/>s about <see cref="SyntaxNode"/>s, and can also collect 454/// <param name="action">Action to be executed at completion of semantic analysis of a <see cref="SyntaxNode"/>.</param> 455/// <param name="syntaxKinds">Action will be executed only if a <see cref="SyntaxNode"/>'s Kind matches one of the syntax kind values.</param> 462/// Register an action to be executed at completion of semantic analysis of a <see cref="SyntaxNode"/> with an appropriate Kind. 463/// A syntax node action can report <see cref="Diagnostic"/>s about <see cref="SyntaxNode"/>s, and can also collect 467/// <param name="action">Action to be executed at completion of semantic analysis of a <see cref="SyntaxNode"/>.</param> 468/// <param name="syntaxKinds">Action will be executed only if a <see cref="SyntaxNode"/>'s Kind matches one of the syntax kind values.</param> 946/// Register an action to be executed at completion of semantic analysis of a <see cref="SyntaxNode"/> with an appropriate Kind. 947/// A syntax node action can report <see cref="Diagnostic"/>s about <see cref="SyntaxNode"/>s, and can also collect 951/// <param name="action">Action to be executed at completion of semantic analysis of a <see cref="SyntaxNode"/>.</param> 952/// <param name="syntaxKinds">Action will be executed only if a <see cref="SyntaxNode"/>'s Kind matches one of the syntax kind values.</param> 959/// Register an action to be executed at completion of semantic analysis of a <see cref="SyntaxNode"/> with an appropriate Kind. 960/// A syntax node action can report <see cref="Diagnostic"/>s about <see cref="SyntaxNode"/>s, and can also collect 964/// <param name="action">Action to be executed at completion of semantic analysis of a <see cref="SyntaxNode"/>.</param> 965/// <param name="syntaxKinds">Action will be executed only if a <see cref="SyntaxNode"/>'s Kind matches one of the syntax kind values.</param> 1020private readonly SyntaxNode _codeBlock; 1029public SyntaxNode CodeBlock { get { return _codeBlock; } } 1037/// <see cref="CodeAnalysis.SemanticModel"/> that can provide semantic information about the <see cref="SyntaxNode"/>s in the code block. 1069protected CodeBlockStartAnalysisContext(SyntaxNode codeBlock, ISymbol owningSymbol, SemanticModel semanticModel, AnalyzerOptions options, CancellationToken cancellationToken) 1075SyntaxNode codeBlock, 1101/// Register an action to be executed at completion of semantic analysis of a <see cref="SyntaxNode"/> with an appropriate Kind. 1102/// A syntax node action can report <see cref="Diagnostic"/>s about <see cref="SyntaxNode"/>s, and can also collect 1105/// <param name="action">Action to be executed at completion of semantic analysis of a <see cref="SyntaxNode"/>.</param> 1106/// <param name="syntaxKinds">Action will be executed only if a <see cref="SyntaxNode"/>'s Kind matches one of the syntax kind values.</param> 1113/// Register an action to be executed at completion of semantic analysis of a <see cref="SyntaxNode"/> with an appropriate Kind. 1114/// A syntax node action can report <see cref="Diagnostic"/>s about <see cref="SyntaxNode"/>s, and can also collect 1117/// <param name="action">Action to be executed at completion of semantic analysis of a <see cref="SyntaxNode"/>.</param> 1118/// <param name="syntaxKinds">Action will be executed only if a <see cref="SyntaxNode"/>'s Kind matches one of the syntax kind values.</param> 1128private readonly SyntaxNode _codeBlock; 1139public SyntaxNode CodeBlock { get { return _codeBlock; } } 1147/// <see cref="CodeAnalysis.SemanticModel"/> that can provide semantic information about the <see cref="SyntaxNode"/>s in the code block. 1179public CodeBlockAnalysisContext(SyntaxNode codeBlock, ISymbol owningSymbol, SemanticModel semanticModel, AnalyzerOptions options, Action<Diagnostic> reportDiagnostic, Func<Diagnostic, bool> isSupportedDiagnostic, CancellationToken cancellationToken) 1185SyntaxNode codeBlock, 1656/// A syntax node action can use a <see cref="SyntaxNodeAnalysisContext"/> to report <see cref="Diagnostic"/>s for a <see cref="SyntaxNode"/>. 1660private readonly SyntaxNode _node; 1669/// <see cref="SyntaxNode"/> that is the subject of the analysis. 1671public SyntaxNode Node => _node; 1679/// <see cref="CodeAnalysis.SemanticModel"/> that can provide semantic information about the <see cref="SyntaxNode"/>. 1684/// <see cref="CodeAnalysis.Compilation"/> containing the <see cref="SyntaxNode"/>. 1716public SyntaxNodeAnalysisContext(SyntaxNode node, ISymbol? containingSymbol, SemanticModel semanticModel, AnalyzerOptions options, Action<Diagnostic> reportDiagnostic, Func<Diagnostic, bool> isSupportedDiagnostic, CancellationToken cancellationToken) 1722public SyntaxNodeAnalysisContext(SyntaxNode node, SemanticModel semanticModel, AnalyzerOptions options, Action<Diagnostic> reportDiagnostic, Func<Diagnostic, bool> isSupportedDiagnostic, CancellationToken cancellationToken) 1728SyntaxNode node, 1751/// Report a <see cref="Diagnostic"/> about a <see cref="SyntaxNode"/>. 1860/// Report a <see cref="Diagnostic"/> about a <see cref="SyntaxNode"/>.
DiagnosticAnalyzer\DiagnosticStartAnalysisScope.cs (1)
293SyntaxNode codeBlock,
DiagnosticAnalyzer\SuppressMessageAttributeState.cs (1)
166for (var node = location.SourceTree.GetRoot().FindNode(location.SourceSpan, getInnermostNodeForTie: true);
Emit\CommonPEModuleBuilder.cs (8)
122internal abstract Cci.ITypeReference Translate(ITypeSymbolInternal symbol, SyntaxNode syntaxOpt, DiagnosticBag diagnostics); 395public uint GetFakeSymbolTokenForIL(Cci.IReference symbol, SyntaxNode syntaxNode, DiagnosticBag diagnostics) 405public uint GetFakeSymbolTokenForIL(Cci.ISignature symbol, SyntaxNode syntaxNode, DiagnosticBag diagnostics) 586where TSyntaxNode : SyntaxNode 730internal sealed override Cci.ITypeReference Translate(ITypeSymbolInternal symbol, SyntaxNode syntaxNodeOpt, DiagnosticBag diagnostics) 1020Cci.IFieldReference ITokenDeferral.GetFieldForData(ImmutableArray<byte> data, ushort alignment, SyntaxNode syntaxNode, DiagnosticBag diagnostics) 1030Cci.IFieldReference ITokenDeferral.GetArrayCachingFieldForData(ImmutableArray<byte> data, Cci.IArrayTypeReference arrayType, SyntaxNode syntaxNode, DiagnosticBag diagnostics) 1040public Cci.IFieldReference GetArrayCachingFieldForConstants(ImmutableArray<ConstantValue> constants, Cci.IArrayTypeReference arrayType, SyntaxNode syntaxNode, DiagnosticBag diagnostics)
Emit\Context.cs (4)
13private readonly SyntaxNode? _syntaxNode; 22public SyntaxNode? SyntaxNode => _syntaxNode ?? SyntaxReference?.GetSyntax(); 25public EmitContext(CommonPEModuleBuilder module, SyntaxNode? syntaxNode, DiagnosticBag diagnostics, bool metadataOnly, bool includePrivateMembers) 35SyntaxNode? syntaxNode = null,
Emit\EditAndContinue\DefinitionMap.cs (3)
188protected static IReadOnlyDictionary<SyntaxNode, int> CreateDeclaratorToSyntaxOrdinalMap(ImmutableArray<SyntaxNode> declarators) 190var declaratorToIndex = new Dictionary<SyntaxNode, int>();
Emit\EditAndContinue\EncMappedMethod.cs (6)
10internal readonly struct EncMappedMethod(IMethodSymbolInternal previousMethod, Func<SyntaxNode, SyntaxNode?>? syntaxMap, Func<SyntaxNode, RuntimeRudeEdit?>? runtimeRudeEdit) 13public readonly Func<SyntaxNode, SyntaxNode?>? SyntaxMap = syntaxMap; 14public readonly Func<SyntaxNode, RuntimeRudeEdit?>? RuntimeRudeEdit = runtimeRudeEdit;
Emit\EditAndContinue\EncVariableSlotAllocator.cs (13)
102private int CalculateSyntaxOffsetInPreviousMethod(SyntaxNode node) 119private bool TryGetPreviousLocalId(SyntaxNode currentDeclarator, LocalDebugId currentId, out LocalDebugId previousId) 131SyntaxNode? previousDeclarator = _mappedMethod.SyntaxMap(currentDeclarator); 195SyntaxNode currentDeclarator, 247private bool TryGetPreviousSyntaxOffset(SyntaxNode currentSyntax, out int previousSyntaxOffset) 253SyntaxNode? previousSyntax = _mappedMethod.SyntaxMap?.Invoke(currentSyntax); 264private bool TryGetPreviousLambdaSyntaxOffset(SyntaxNode lambdaOrLambdaBodySyntax, bool isLambdaBody, out int previousSyntaxOffset) 268var currentLambdaSyntax = isLambdaBody 276SyntaxNode? previousLambdaSyntax = _mappedMethod.SyntaxMap?.Invoke(currentLambdaSyntax); 283SyntaxNode? previousSyntax; 303SyntaxNode scopeSyntax, 331public override bool TryGetPreviousLambda(SyntaxNode lambdaOrLambdaBodySyntax, bool isLambdaBody, int closureOrdinal, ImmutableArray<DebugId> structClosureIds, out DebugId lambdaId, out RuntimeRudeEdit? runtimeRudeEdit) 361public override bool TryGetPreviousStateMachineState(SyntaxNode syntax, AwaitDebugId awaitId, out StateMachineState state)
Emit\EditAndContinue\LambdaSyntaxFacts.cs (6)
9public abstract SyntaxNode GetLambda(SyntaxNode lambdaOrLambdaBodySyntax); 19public abstract SyntaxNode? TryGetCorrespondingLambdaBody(SyntaxNode previousLambdaSyntax, SyntaxNode lambdaOrLambdaBodySyntax); 25public abstract int GetDeclaratorPosition(SyntaxNode node);
Emit\NoPia\EmbeddedTypesManager.cs (1)
50where TSyntaxNode : SyntaxNode
Emit\SemanticEdit.cs (12)
47public Func<SyntaxNode, SyntaxNode?>? SyntaxMap { get; } 53public Func<SyntaxNode, RuntimeRudeEdit?>? RuntimeRudeEdit { get; } 65public SemanticEdit(SemanticEditKind kind, ISymbol? oldSymbol, ISymbol? newSymbol, Func<SyntaxNode, SyntaxNode?>? syntaxMap, bool preserveLocalVariables) 74public SemanticEdit(SemanticEditKind kind, ISymbol? oldSymbol, ISymbol? newSymbol, Func<SyntaxNode, SyntaxNode?>? syntaxMap, bool preserveLocalVariables, MethodInstrumentation instrumentation) 104public SemanticEdit(SemanticEditKind kind, ISymbol? oldSymbol, ISymbol? newSymbol, Func<SyntaxNode, SyntaxNode?>? syntaxMap = null, Func<SyntaxNode, RuntimeRudeEdit?>? runtimeRudeEdit = null, MethodInstrumentation instrumentation = default) 215internal static SemanticEdit Create(SemanticEditKind kind, ISymbolInternal oldSymbol, ISymbolInternal newSymbol, Func<SyntaxNode, SyntaxNode>? syntaxMap = null)
Generated\Operations.Generated.cs (134)
4001internal BlockOperation(ImmutableArray<IOperation> operations, ImmutableArray<ILocalSymbol> locals, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 4058internal VariableDeclarationGroupOperation(ImmutableArray<IVariableDeclarationOperation> declarations, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 4113internal SwitchOperation(ImmutableArray<ILocalSymbol> locals, IOperation value, ImmutableArray<ISwitchCaseOperation> cases, ILabelSymbol exitLabel, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 4183protected BaseLoopOperation(IOperation body, ImmutableArray<ILocalSymbol> locals, ILabelSymbol continueLabel, ILabelSymbol exitLabel, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 4199internal ForEachLoopOperation(IOperation loopControlVariable, IOperation collection, ImmutableArray<IOperation> nextVariables, ForEachLoopOperationInfo? info, bool isAsynchronous, IOperation body, ImmutableArray<ILocalSymbol> locals, ILabelSymbol continueLabel, ILabelSymbol exitLabel, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 4289internal ForLoopOperation(ImmutableArray<IOperation> before, ImmutableArray<ILocalSymbol> conditionLocals, IOperation? condition, ImmutableArray<IOperation> atLoopBottom, IOperation body, ImmutableArray<ILocalSymbol> locals, ILabelSymbol continueLabel, ILabelSymbol exitLabel, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 4381internal ForToLoopOperation(IOperation loopControlVariable, IOperation initialValue, IOperation limitValue, IOperation stepValue, bool isChecked, ImmutableArray<IOperation> nextVariables, (ILocalSymbol LoopObject, ForToLoopOperationUserDefinedInfo UserDefinedInfo) info, IOperation body, ImmutableArray<ILocalSymbol> locals, ILabelSymbol continueLabel, ILabelSymbol exitLabel, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 4493internal WhileLoopOperation(IOperation? condition, bool conditionIsTop, bool conditionIsUntil, IOperation? ignoredCondition, IOperation body, ImmutableArray<ILocalSymbol> locals, ILabelSymbol continueLabel, ILabelSymbol exitLabel, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 4517internal LabeledOperation(ILabelSymbol label, IOperation? operation, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 4570internal BranchOperation(ILabelSymbol target, BranchKind branchKind, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 4590internal EmptyOperation(SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 4604internal ReturnOperation(IOperation? returnedValue, OperationKind kind, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 4656internal LockOperation(IOperation lockedValue, IOperation body, ILocalSymbol? lockTakenSymbol, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 4720internal TryOperation(IBlockOperation body, ImmutableArray<ICatchClauseOperation> catches, IBlockOperation? @finally, ILabelSymbol? exitLabel, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 4799internal UsingOperation(IOperation resources, IOperation body, ImmutableArray<ILocalSymbol> locals, bool isAsynchronous, DisposeOperationInfo disposeInfo, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 4867internal ExpressionStatementOperation(IOperation operation, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 4918internal LocalFunctionOperation(IMethodSymbol symbol, IBlockOperation? body, IBlockOperation? ignoredBody, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 4982internal StopOperation(SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 4996internal EndOperation(SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 5010internal RaiseEventOperation(IEventReferenceOperation eventReference, ImmutableArray<IArgumentOperation> arguments, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 5076internal LiteralOperation(SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit) 5094internal ConversionOperation(IOperation operand, IConvertibleConversion conversion, bool isTryCast, bool isChecked, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit) 5154internal InvocationOperation(IMethodSymbol targetMethod, ITypeSymbol? constrainedToType, IOperation? instance, bool isVirtual, ImmutableArray<IArgumentOperation> arguments, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 5227internal ArrayElementReferenceOperation(IOperation arrayReference, ImmutableArray<IOperation> indices, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 5294internal LocalReferenceOperation(ILocalSymbol local, bool isDeclaration, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit) 5316internal ParameterReferenceOperation(IParameterSymbol parameter, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 5335protected BaseMemberReferenceOperation(IOperation? instance, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 5345internal FieldReferenceOperation(IFieldSymbol field, bool isDeclaration, IOperation? instance, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit) 5400internal MethodReferenceOperation(IMethodSymbol method, ITypeSymbol? constrainedToType, bool isVirtual, IOperation? instance, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 5456internal PropertyReferenceOperation(IPropertySymbol property, ITypeSymbol? constrainedToType, ImmutableArray<IArgumentOperation> arguments, IOperation? instance, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 5525internal EventReferenceOperation(IEventSymbol @event, ITypeSymbol? constrainedToType, IOperation? instance, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 5579internal UnaryOperation(UnaryOperatorKind operatorKind, IOperation operand, bool isLifted, bool isChecked, IMethodSymbol? operatorMethod, ITypeSymbol? constrainedToType, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit) 5642internal BinaryOperation(BinaryOperatorKind operatorKind, IOperation leftOperand, IOperation rightOperand, bool isLifted, bool isChecked, bool isCompareText, IMethodSymbol? operatorMethod, ITypeSymbol? constrainedToType, IMethodSymbol? unaryOperatorMethod, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit) 5720internal ConditionalOperation(IOperation condition, IOperation whenTrue, IOperation? whenFalse, bool isRef, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit) 5797internal CoalesceOperation(IOperation value, IOperation whenNull, IConvertibleConversion valueConversion, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit) 5864internal AnonymousFunctionOperation(IMethodSymbol symbol, IBlockOperation body, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 5917internal ObjectCreationOperation(IMethodSymbol? constructor, IObjectOrCollectionInitializerOperation? initializer, ImmutableArray<IArgumentOperation> arguments, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit) 5987internal TypeParameterObjectCreationOperation(IObjectOrCollectionInitializerOperation? initializer, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 6039internal ArrayCreationOperation(ImmutableArray<IOperation> dimensionSizes, IArrayInitializerOperation? initializer, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 6106internal InstanceReferenceOperation(InstanceReferenceKind referenceKind, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 6125internal IsTypeOperation(IOperation valueOperand, ITypeSymbol typeOperand, bool isNegated, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 6181internal AwaitOperation(IOperation operation, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 6233protected BaseAssignmentOperation(IOperation target, IOperation value, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 6244internal SimpleAssignmentOperation(bool isRef, IOperation target, IOperation value, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit) 6306internal CompoundAssignmentOperation(IConvertibleConversion inConversion, IConvertibleConversion outConversion, BinaryOperatorKind operatorKind, bool isLifted, bool isChecked, IMethodSymbol? operatorMethod, ITypeSymbol? constrainedToType, IOperation target, IOperation value, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 6381internal ParenthesizedOperation(IOperation operand, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit) 6434internal EventAssignmentOperation(IOperation eventReference, IOperation handlerValue, bool adds, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 6499internal ConditionalAccessOperation(IOperation operation, IOperation whenNotNull, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 6562internal ConditionalAccessInstanceOperation(SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 6579internal InterpolatedStringOperation(ImmutableArray<IInterpolatedStringContentOperation> parts, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit) 6636internal AnonymousObjectCreationOperation(ImmutableArray<IOperation> initializers, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 6692internal ObjectOrCollectionInitializerOperation(ImmutableArray<IOperation> initializers, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 6748internal MemberInitializerOperation(IOperation initializedMember, IObjectOrCollectionInitializerOperation initializer, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 6811internal NameOfOperation(IOperation argument, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit) 6864internal TupleOperation(ImmutableArray<IOperation> elements, ITypeSymbol? naturalType, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 6922internal DynamicMemberReferenceOperation(IOperation? instance, string memberName, ImmutableArray<ITypeSymbol> typeArguments, ITypeSymbol? containingType, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 6980internal TranslatedQueryOperation(IOperation operation, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 7032internal DelegateCreationOperation(IOperation target, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 7084internal DefaultValueOperation(SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit) 7102internal TypeOfOperation(ITypeSymbol typeOperand, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 7121internal SizeOfOperation(ITypeSymbol typeOperand, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit) 7141internal AddressOfOperation(IOperation reference, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 7193internal IsPatternOperation(IOperation value, IPatternOperation pattern, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 7256internal IncrementOrDecrementOperation(bool isPostfix, bool isLifted, bool isChecked, IOperation target, IMethodSymbol? operatorMethod, ITypeSymbol? constrainedToType, OperationKind kind, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 7319internal ThrowOperation(IOperation? exception, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 7371internal DeconstructionAssignmentOperation(IOperation target, IOperation value, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 7430internal DeclarationExpressionOperation(IOperation expression, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 7482internal OmittedArgumentOperation(SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 7499protected BaseSymbolInitializerOperation(ImmutableArray<ILocalSymbol> locals, IOperation value, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 7510internal FieldInitializerOperation(ImmutableArray<IFieldSymbol> initializedFields, ImmutableArray<ILocalSymbol> locals, IOperation value, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 7561internal VariableInitializerOperation(ImmutableArray<ILocalSymbol> locals, IOperation value, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 7608internal PropertyInitializerOperation(ImmutableArray<IPropertySymbol> initializedProperties, ImmutableArray<ILocalSymbol> locals, IOperation value, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 7659internal ParameterInitializerOperation(IParameterSymbol parameter, ImmutableArray<ILocalSymbol> locals, IOperation value, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 7710internal ArrayInitializerOperation(ImmutableArray<IOperation> elementValues, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 7765internal VariableDeclaratorOperation(ILocalSymbol symbol, IVariableInitializerOperation? initializer, ImmutableArray<IOperation> ignoredArguments, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 7833internal VariableDeclarationOperation(ImmutableArray<IVariableDeclaratorOperation> declarators, IVariableInitializerOperation? initializer, ImmutableArray<IOperation> ignoredDimensions, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 7914internal ArgumentOperation(ArgumentKind argumentKind, IParameterSymbol? parameter, IOperation value, IConvertibleConversion inConversion, IConvertibleConversion outConversion, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 7975internal CatchClauseOperation(IOperation? exceptionDeclarationOrExpression, ITypeSymbol exceptionType, ImmutableArray<ILocalSymbol> locals, IOperation? filter, IBlockOperation handler, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 8052internal SwitchCaseOperation(ImmutableArray<ICaseClauseOperation> clauses, ImmutableArray<IOperation> body, ImmutableArray<ILocalSymbol> locals, IOperation? condition, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 8126protected BaseCaseClauseOperation(ILabelSymbol? label, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 8136internal DefaultCaseClauseOperation(ILabelSymbol? label, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 8150internal PatternCaseClauseOperation(ILabelSymbol label, IPatternOperation pattern, IOperation? guard, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 8213internal RangeCaseClauseOperation(IOperation minimumValue, IOperation maximumValue, ILabelSymbol? label, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 8275internal RelationalCaseClauseOperation(IOperation value, BinaryOperatorKind relation, ILabelSymbol? label, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 8328internal SingleValueCaseClauseOperation(IOperation value, ILabelSymbol? label, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 8379protected BaseInterpolatedStringContentOperation(SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 8384internal InterpolatedStringTextOperation(IOperation text, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 8435internal InterpolationOperation(IOperation expression, IOperation? alignment, IOperation? formatString, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 8508protected BasePatternOperation(ITypeSymbol inputType, ITypeSymbol narrowedType, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 8519internal ConstantPatternOperation(IOperation value, ITypeSymbol inputType, ITypeSymbol narrowedType, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 8570internal DeclarationPatternOperation(ITypeSymbol? matchedType, bool matchesNull, ISymbol? declaredSymbol, ITypeSymbol inputType, ITypeSymbol narrowedType, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 8592internal TupleBinaryOperation(BinaryOperatorKind operatorKind, IOperation leftOperand, IOperation rightOperand, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 8657protected BaseMethodBodyBaseOperation(IBlockOperation? blockBody, IBlockOperation? expressionBody, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 8668internal MethodBodyOperation(IBlockOperation? blockBody, IBlockOperation? expressionBody, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 8724internal ConstructorBodyOperation(ImmutableArray<ILocalSymbol> locals, IOperation? initializer, IBlockOperation? blockBody, IBlockOperation? expressionBody, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 8795internal DiscardOperation(IDiscardSymbol discardSymbol, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 8814internal FlowCaptureOperation(CaptureId id, IOperation value, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 8867internal FlowCaptureReferenceOperation(CaptureId id, bool isInitialization, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit) 8889internal IsNullOperation(IOperation operand, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit) 8942internal CaughtExceptionOperation(SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 8959internal StaticLocalInitializationSemaphoreOperation(ILocalSymbol local, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 8978internal CoalesceAssignmentOperation(IOperation target, IOperation value, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 9037internal RangeOperation(IOperation? leftOperand, IOperation? rightOperand, bool isLifted, IMethodSymbol? method, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 9104internal ReDimOperation(ImmutableArray<IReDimClauseOperation> clauses, bool preserve, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 9161internal ReDimClauseOperation(IOperation operand, ImmutableArray<IOperation> dimensionSizes, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 9227internal RecursivePatternOperation(ITypeSymbol matchedType, ISymbol? deconstructSymbol, ImmutableArray<IPatternOperation> deconstructionSubpatterns, ImmutableArray<IPropertySubpatternOperation> propertySubpatterns, ISymbol? declaredSymbol, ITypeSymbol inputType, ITypeSymbol narrowedType, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 9303internal DiscardPatternOperation(ITypeSymbol inputType, ITypeSymbol narrowedType, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 9317internal SwitchExpressionOperation(IOperation value, ImmutableArray<ISwitchExpressionArmOperation> arms, bool isExhaustive, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 9386internal SwitchExpressionArmOperation(IPatternOperation pattern, IOperation? guard, IOperation value, ImmutableArray<ILocalSymbol> locals, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 9461internal PropertySubpatternOperation(IOperation member, IPatternOperation pattern, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 9523internal AggregateQueryOperation(IOperation group, IOperation aggregation, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 9586internal FixedOperation(ImmutableArray<ILocalSymbol> locals, IVariableDeclarationGroupOperation variables, IOperation body, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 9650internal NoPiaObjectCreationOperation(IObjectOrCollectionInitializerOperation? initializer, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 9702internal PlaceholderOperation(PlaceholderKind placeholderKind, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 9721internal WithStatementOperation(IOperation body, IOperation value, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 9783internal UsingDeclarationOperation(IVariableDeclarationGroupOperation declarationGroup, bool isAsynchronous, DisposeOperationInfo disposeInfo, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 9838internal NegatedPatternOperation(IPatternOperation pattern, ITypeSymbol inputType, ITypeSymbol narrowedType, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 9889internal BinaryPatternOperation(BinaryOperatorKind operatorKind, IPatternOperation leftPattern, IPatternOperation rightPattern, ITypeSymbol inputType, ITypeSymbol narrowedType, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 9953internal TypePatternOperation(ITypeSymbol matchedType, ITypeSymbol inputType, ITypeSymbol narrowedType, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 9971internal RelationalPatternOperation(BinaryOperatorKind operatorKind, IOperation value, ITypeSymbol inputType, ITypeSymbol narrowedType, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 10024internal WithOperation(IOperation operand, IMethodSymbol? cloneMethod, IObjectOrCollectionInitializerOperation initializer, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 10089internal InterpolatedStringHandlerCreationOperation(IOperation handlerCreation, bool handlerCreationHasSuccessParameter, bool handlerAppendCallsReturnBool, IOperation content, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 10156internal InterpolatedStringAdditionOperation(IOperation left, IOperation right, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 10218internal InterpolatedStringAppendOperation(IOperation appendCall, OperationKind kind, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 10270internal InterpolatedStringHandlerArgumentPlaceholderOperation(int argumentIndex, InterpolatedStringArgumentPlaceholderKind placeholderKind, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 10290internal FunctionPointerInvocationOperation(IOperation target, ImmutableArray<IArgumentOperation> arguments, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 10357internal ListPatternOperation(ISymbol? lengthSymbol, ISymbol? indexerSymbol, ImmutableArray<IPatternOperation> patterns, ISymbol? declaredSymbol, ITypeSymbol inputType, ITypeSymbol narrowedType, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 10418internal SlicePatternOperation(ISymbol? sliceSymbol, IPatternOperation? pattern, ITypeSymbol inputType, ITypeSymbol narrowedType, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 10471internal ImplicitIndexerReferenceOperation(IOperation instance, IOperation argument, ISymbol lengthSymbol, ISymbol indexerSymbol, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 10538internal Utf8StringOperation(string value, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 10557internal AttributeOperation(IOperation operation, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 10608internal InlineArrayAccessOperation(IOperation instance, IOperation argument, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 10671internal CollectionExpressionOperation(IMethodSymbol? constructMethod, ImmutableArray<IOperation> elements, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 10729internal SpreadOperation(IOperation operand, ITypeSymbol? elementType, IConvertibleConversion elementConversion, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit)
Operations\ControlFlowGraph.cs (2)
80/// Returns null if <see cref="SemanticModel.GetOperation(SyntaxNode, CancellationToken)"/> returns null for the given <paramref name="node"/> and <paramref name="semanticModel"/>. 83public static ControlFlowGraph? Create(SyntaxNode node, SemanticModel semanticModel, CancellationToken cancellationToken = default)
Operations\ControlFlowGraphBuilder.cs (11)
1684private void CaptureResultIfNotAlready(SyntaxNode syntax, int captureId, IOperation result) 2693SyntaxNode leftSyntax = (lazyFallThrough!.GetSingletonPredecessorOrDefault() != null ? condition.LeftOperand : condition).Syntax; 2987SyntaxNode valueSyntax = operationValue.Syntax; 3295private static IOperation MakeInvalidOperation(SyntaxNode syntax, ITypeSymbol? type, IOperation child1, IOperation child2) 3300private static IOperation MakeInvalidOperation(SyntaxNode syntax, ITypeSymbol? type, ImmutableArray<IOperation> children) 3452SyntaxNode defaultValueSyntax = (operation.Operation == testExpression ? testExpression : operation).Syntax; 3530SyntaxNode testExpressionSyntax = testExpression.Syntax; 3790SyntaxNode syntax = exceptionDeclarationOrExpression.Syntax; 4700InvocationOperation makeInvocation(SyntaxNode syntax, IMethodSymbol method, IOperation? instanceOpt, ImmutableArray<IArgumentOperation> arguments) 4778IOperation tryCallObjectForLoopControlHelper(SyntaxNode syntax, WellKnownMember helper) 5843SyntaxNode? assignmentSyntax = null;
Operations\IOperation.cs (2)
35SyntaxNode Syntax { get; } 74/// Non-null for operations generated from source with <see cref="SemanticModel.GetOperation(SyntaxNode, System.Threading.CancellationToken)"/> API
Operations\Operation.cs (3)
27protected Operation(SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 70public SyntaxNode Syntax { get; } 128/// is the semantic model on which <see cref="SemanticModel.GetOperation(SyntaxNode, CancellationToken)"/> was invoked
Operations\OperationFactory.cs (1)
11public static IInvalidOperation CreateInvalidOperation(SemanticModel semanticModel, SyntaxNode syntax, ImmutableArray<IOperation> children, bool isImplicit)
Operations\OperationMapBuilder.cs (8)
19internal static void AddToMap(IOperation root, Dictionary<SyntaxNode, IOperation> dictionary) 25private sealed class Walker : OperationWalker<Dictionary<SyntaxNode, IOperation>> 29public override object? DefaultVisit(IOperation operation, Dictionary<SyntaxNode, IOperation> argument) 35public override object? VisitBinaryOperator([DisallowNull] IBinaryOperation? operation, Dictionary<SyntaxNode, IOperation> argument) 57public override object? VisitConditional(IConditionalOperation operation, Dictionary<SyntaxNode, IOperation> argument) 78public override object? VisitBinaryPattern(IBinaryPatternOperation operation, Dictionary<SyntaxNode, IOperation> argument) 100internal override object? VisitNoneOperation(IOperation operation, Dictionary<SyntaxNode, IOperation> argument) 107private static void RecordOperation(IOperation operation, Dictionary<SyntaxNode, IOperation> argument)
Operations\OperationNodes.cs (13)
18public NoneOperation(ImmutableArray<IOperation> children, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit) : 87public InvalidOperation(ImmutableArray<IOperation> children, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit) : 235protected HasDynamicArgumentsExpression(ImmutableArray<IOperation> arguments, ImmutableArray<string?> argumentNames, ImmutableArray<RefKind> argumentRefKinds, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) : 252public DynamicObjectCreationOperation(IObjectOrCollectionInitializerOperation? initializer, ImmutableArray<IOperation> arguments, ImmutableArray<string?> argumentNames, ImmutableArray<RefKind> argumentRefKinds, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) : 334public DynamicInvocationOperation(IOperation operation, ImmutableArray<IOperation> arguments, ImmutableArray<string?> argumentNames, ImmutableArray<RefKind> argumentRefKinds, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) : 416public DynamicIndexerAccessOperation(IOperation operation, ImmutableArray<IOperation> arguments, ImmutableArray<string?> argumentNames, ImmutableArray<RefKind> argumentRefKinds, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) : 641public FlowCaptureReferenceOperation(int id, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isInitialization = false) : 649public FlowCaptureOperation(int id, SyntaxNode syntax, IOperation value) : 658public IsNullOperation(SyntaxNode syntax, IOperation operand, ITypeSymbol type, ConstantValue? constantValue) : 667public CaughtExceptionOperation(SyntaxNode syntax, ITypeSymbol type) : 675public StaticLocalInitializationSemaphoreOperation(ILocalSymbol local, SyntaxNode syntax, ITypeSymbol type) : 688public static BlockOperation CreateTemporaryBlock(ImmutableArray<IOperation> statements, SemanticModel semanticModel, SyntaxNode syntax) 691private BlockOperation(ImmutableArray<IOperation> statements, SemanticModel semanticModel, SyntaxNode syntax)
SourceGeneration\GeneratedCodeUtilities.cs (3)
55internal static bool IsGeneratedCode(string? filePath, SyntaxNode root, Func<SyntaxTrivia, bool> isComment) 88private static bool BeginsWithAutoGeneratedComment(SyntaxNode root, Func<SyntaxTrivia, bool> isComment) 120var root = tree.GetRoot(cancellationToken);
SourceGeneration\GeneratorContexts.cs (4)
150/// an instance of <see cref="ISyntaxReceiver"/>. This receiver will have its <see cref="ISyntaxReceiver.OnVisitSyntaxNode(SyntaxNode)"/> 233internal GeneratorSyntaxContext(SyntaxNode node, Lazy<SemanticModel>? semanticModel, ISyntaxHelper syntaxHelper) 241/// The <see cref="SyntaxNode"/> currently being visited 243public SyntaxNode Node { get; }
SourceGeneration\GeneratorSyntaxWalker.cs (2)
23public void VisitWithModel(Lazy<SemanticModel>? model, SyntaxNode node) 28foreach (var child in node.DescendantNodesAndSelf())
SourceGeneration\ISyntaxHelper.cs (24)
15bool IsAnyNamespaceBlock(SyntaxNode node); 17bool IsAttributeList(SyntaxNode node); 18SeparatedSyntaxList<SyntaxNode> GetAttributesOfAttributeList(SyntaxNode node); 20void AddAttributeTargets(SyntaxNode node, ArrayBuilder<SyntaxNode> targets); 22bool IsAttribute(SyntaxNode node); 23SyntaxNode GetNameOfAttribute(SyntaxNode node); 25bool IsLambdaExpression(SyntaxNode node); 27string GetUnqualifiedIdentifierOfName(SyntaxNode node); 35bool ContainsGlobalAliases(SyntaxNode root); 44public abstract string GetUnqualifiedIdentifierOfName(SyntaxNode name); 46public abstract bool IsAnyNamespaceBlock(SyntaxNode node); 48public abstract bool IsAttribute(SyntaxNode node); 49public abstract SyntaxNode GetNameOfAttribute(SyntaxNode node); 51public abstract bool IsAttributeList(SyntaxNode node); 52public abstract SeparatedSyntaxList<SyntaxNode> GetAttributesOfAttributeList(SyntaxNode node); 53public abstract void AddAttributeTargets(SyntaxNode node, ArrayBuilder<SyntaxNode> targets); 55public abstract bool IsLambdaExpression(SyntaxNode node); 60public abstract bool ContainsGlobalAliases(SyntaxNode root);
SourceGeneration\ISyntaxReceiver.cs (6)
8/// Receives notifications of each <see cref="SyntaxNode"/> in the compilation before generation runs 16/// <see cref="OnVisitSyntaxNode(SyntaxNode)"/> called for every syntax node in the compilation. 32/// Called for each <see cref="SyntaxNode"/> in the compilation 34/// <param name="syntaxNode">The current <see cref="SyntaxNode"/> being visited</param> 35void OnVisitSyntaxNode(SyntaxNode syntaxNode); 45/// Receives notifications of each <see cref="SyntaxNode"/> in the compilation, along with a
SourceGeneration\Nodes\ISyntaxStrategy.cs (1)
20void VisitTree(Lazy<SyntaxNode> root, EntryState state, Lazy<SemanticModel>? model, CancellationToken cancellationToken);
SourceGeneration\Nodes\PredicateSyntaxStrategy.cs (12)
20private readonly Func<SyntaxNode, CancellationToken, bool> _filterFunc; 24Func<SyntaxNode, CancellationToken, bool> filterFunc, 41private readonly NodeStateTable<SyntaxNode>.Builder _filterTable; 51_filterTable = table.GetStateTableOrEmpty<SyntaxNode>(_owner._filterKey).ToBuilder(stepName: null, trackIncrementalSteps); 62Lazy<SyntaxNode> root, 83if (state != EntryState.Cached || !_filterTable.TryUseCachedEntries(TimeSpan.Zero, noInputStepsStepInfo, out NodeStateTable<SyntaxNode>.TableEntry entry)) 118static ImmutableArray<SyntaxNode> getFilteredNodes(SyntaxNode root, Func<SyntaxNode, CancellationToken, bool> func, CancellationToken token) 120ArrayBuilder<SyntaxNode>? results = null; 121foreach (var node in root.DescendantNodesAndSelf()) 127(results ??= ArrayBuilder<SyntaxNode>.GetInstance()).Add(node);
SourceGeneration\Nodes\SyntaxReceiverStrategy.cs (1)
68Lazy<SyntaxNode> root,
SourceGeneration\Nodes\SyntaxValueProvider.cs (3)
36/// Creates an <see cref="IncrementalValueProvider{T}"/> that can provide a transform over <see cref="SyntaxNode"/>s 39/// <param name="predicate">A function that determines if the given <see cref="SyntaxNode"/> should be transformed</param> 42public IncrementalValuesProvider<T> CreateSyntaxProvider<T>(Func<SyntaxNode, CancellationToken, bool> predicate, Func<GeneratorSyntaxContext, CancellationToken, T> transform)
SourceGeneration\Nodes\SyntaxValueProvider_ForAttributeWithMetadataName.cs (7)
21public SyntaxNode TargetNode { get; } 45SyntaxNode targetNode, 65/// cref="SyntaxNode"/>s if that node has an attribute on it that binds to a <see cref="INamedTypeSymbol"/> with the 71/// <param name="predicate">A function that determines if the given <see cref="SyntaxNode"/> attribute target (<see 80Func<SyntaxNode, CancellationToken, bool> predicate, 106foreach (var targetNode in syntaxNodes) 138SyntaxNode attributeTarget,
SourceGeneration\Nodes\SyntaxValueProvider_ForAttributeWithSimpleName.cs (20)
32private static readonly ObjectPool<Stack<SyntaxNode>> s_nodeStackPool = new ObjectPool<Stack<SyntaxNode>>(static () => new Stack<SyntaxNode>()); 55internal IncrementalValuesProvider<(SyntaxTree tree, ImmutableArray<SyntaxNode> matches)> ForAttributeWithSimpleName( 57Func<SyntaxNode, CancellationToken, bool> predicate) 114SyntaxNode compilationUnit) 151private static ImmutableArray<SyntaxNode> GetMatchingNodes( 156Func<SyntaxNode, CancellationToken, bool> predicate, 159var compilationUnit = syntaxTree.GetRoot(cancellationToken); 174var results = ArrayBuilder<SyntaxNode>.GetInstance(); 175var attributeTargets = ArrayBuilder<SyntaxNode>.GetInstance(); 192void processCompilationUnit(SyntaxNode compilationUnit) 202void processCompilationOrNamespaceMembers(SyntaxNode node) 208if (child.AsNode(out var childNode)) 218void processNamespaceBlock(SyntaxNode namespaceBlock) 231void processMember(SyntaxNode member) 247var node = nodeStack.Pop(); 255foreach (var attribute in syntaxHelper.GetAttributesOfAttributeList(node)) 266foreach (var target in attributeTargets) 285if (child.AsNode(out var childNode))
SourceGeneration\SyntaxStore.cs (1)
89var root = new Lazy<SyntaxNode>(() => tree.GetRoot(_cancellationToken));
src\Compilers\Core\AnalyzerDriver\DeclarationComputer.cs (12)
15internal static DeclarationInfo GetDeclarationInfo(SemanticModel model, SyntaxNode node, bool getSymbol, IEnumerable<SyntaxNode>? executableCodeBlocks, CancellationToken cancellationToken) 21internal static DeclarationInfo GetDeclarationInfo(SyntaxNode node, ISymbol? declaredSymbol, IEnumerable<SyntaxNode>? executableCodeBlocks) 23var codeBlocks = executableCodeBlocks?.Where(c => c != null).AsImmutableOrEmpty() ?? ImmutableArray<SyntaxNode>.Empty; 27internal static DeclarationInfo GetDeclarationInfo(SemanticModel model, SyntaxNode node, bool getSymbol, CancellationToken cancellationToken) 29return GetDeclarationInfo(model, node, getSymbol, (IEnumerable<SyntaxNode>?)null, cancellationToken); 32internal static DeclarationInfo GetDeclarationInfo(SemanticModel model, SyntaxNode node, bool getSymbol, SyntaxNode executableCodeBlock, CancellationToken cancellationToken) 37internal static DeclarationInfo GetDeclarationInfo(SemanticModel model, SyntaxNode node, bool getSymbol, CancellationToken cancellationToken, params SyntaxNode[] executableCodeBlocks) 42private static ISymbol? GetDeclaredSymbol(SemanticModel model, SyntaxNode node, bool getSymbol, CancellationToken cancellationToken)
src\Compilers\Core\AnalyzerDriver\DeclarationInfo.cs (4)
15internal DeclarationInfo(SyntaxNode declaredNode, ImmutableArray<SyntaxNode> executableCodeBlocks, ISymbol? declaredSymbol) 32public SyntaxNode DeclaredNode { get; } 37public ImmutableArray<SyntaxNode> ExecutableCodeBlocks { get; }
Symbols\Attributes\CommonAttributeData.cs (2)
396where TAttributeSyntaxNode : SyntaxNode 457where TAttributeSyntaxNode : SyntaxNode
Symbols\Attributes\DecodeWellKnownAttributeArguments.cs (1)
13where TAttributeSyntax : SyntaxNode
Symbols\Attributes\EarlyDecodeWellKnownAttributeArguments.cs (1)
18where TAttributeSyntax : SyntaxNode
Symbols\Attributes\MarshalAsAttributeDecoder.cs (1)
17where TAttributeSyntax : SyntaxNode
Symbols\ILocalSymbolInternal.cs (1)
13SyntaxNode GetDeclaratorSyntax();
Syntax\AnnotationExtensions.cs (5)
18where TNode : SyntaxNode 29where TNode : SyntaxNode 40where TNode : SyntaxNode 51where TNode : SyntaxNode 62where TNode : SyntaxNode
Syntax\ChildSyntaxList.cs (15)
16private readonly SyntaxNode? _node; 19internal ChildSyntaxList(SyntaxNode node) 76internal SyntaxNode? Node 103public SlotData(SyntaxNode node) 116internal static SyntaxNodeOrToken ItemInternal(SyntaxNode node, int index) 127internal static SyntaxNodeOrToken ItemInternal(SyntaxNode node, int index, ref SlotData slotData) 175var red = node.GetNodeSlot(slotIndex); 189var redChild = red.GetNodeSlot(idx); 213/// Locate the node or token that is a child of the given <see cref="SyntaxNode"/> and contains the given position. 215/// <param name="node">The <see cref="SyntaxNode"/> to search.</param> 221internal static SyntaxNodeOrToken ChildThatContainsPosition(SyntaxNode node, int targetPosition) 256var red = node.GetNodeSlot(slot); 302internal static SyntaxNode? ItemInternalAsNode(SyntaxNode node, int index, ref SlotData slotData) 345var red = node.GetNodeSlot(slotIndex);
Syntax\ChildSyntaxList.Enumerator.cs (6)
18private SyntaxNode? _node; 23internal Enumerator(SyntaxNode node, int count) 33internal void InitializeFrom(SyntaxNode node) 86internal SyntaxNode? TryMoveNextAndGetCurrentAsNode() 90var nodeValue = ItemInternalAsNode(_node, _childIndex, ref _slotData); 105internal EnumeratorImpl(SyntaxNode node, int count)
Syntax\ChildSyntaxList.Reversed.cs (5)
18private readonly SyntaxNode? _node; 21internal Reversed(SyntaxNode node, int count) 71private readonly SyntaxNode? _node; 75internal Enumerator(SyntaxNode node, int count) 107internal EnumeratorImpl(SyntaxNode node, int count)
Syntax\CommonSyntaxNodeRemover.cs (1)
35var node = nodesAndSeparators[nodeIndex].AsNode();
Syntax\GreenNode.cs (5)
888public abstract SyntaxNode GetStructure(SyntaxTrivia parentTrivia); 892public abstract SyntaxToken CreateSeparator(SyntaxNode element); 955public SyntaxNode CreateRed() 960internal abstract SyntaxNode CreateRed(SyntaxNode? parent, int position);
Syntax\ICompilationUnitSyntax.cs (1)
15/// given any <see cref="SyntaxNode"/>, as well as a common way for handling the special
Syntax\InternalSyntax\GreenNodeExtensions.cs (2)
9internal static SyntaxList<T> ToGreenList<T>(this SyntaxNode? node) where T : GreenNode 16internal static SeparatedSyntaxList<T> ToGreenSeparatedList<T>(this SyntaxNode? node) where T : GreenNode
Syntax\InternalSyntax\SyntaxList.cs (2)
160public sealed override SyntaxNode GetStructure(SyntaxTrivia parentTrivia) 165public sealed override SyntaxToken CreateSeparator(SyntaxNode element)
Syntax\InternalSyntax\SyntaxList.WithManyChildren.cs (4)
61internal override SyntaxNode CreateRed(SyntaxNode? parent, int position) 68: (SyntaxNode)new Syntax.SyntaxList.WithManyWeakChildren(this, parent, position); 74: (SyntaxNode)new Syntax.SyntaxList.WithManyChildren(this, parent, position);
Syntax\InternalSyntax\SyntaxList.WithThreeChildren.cs (2)
62internal override SyntaxNode CreateRed(SyntaxNode? parent, int position)
Syntax\InternalSyntax\SyntaxList.WithTwoChildren.cs (2)
54internal override SyntaxNode CreateRed(SyntaxNode? parent, int position)
Syntax\LineDirectiveMap.cs (1)
23where TDirective : SyntaxNode
Syntax\SeparatedSyntaxList.cs (11)
19public static SeparatedSyntaxList<TNode> Create<TNode>(ReadOnlySpan<TNode> nodes) where TNode : SyntaxNode 44public readonly partial struct SeparatedSyntaxList<TNode> : IEquatable<SeparatedSyntaxList<TNode>>, IReadOnlyList<TNode> where TNode : SyntaxNode 82internal SeparatedSyntaxList(SyntaxNode node, int index) 87internal SyntaxNode? Node 115var node = _list.Node; 145var node = _list.Node; 441var node = nodesWithSeps[insertionIndex].AsNode(); 627public static implicit operator SeparatedSyntaxList<SyntaxNode>(SeparatedSyntaxList<TNode> nodes) 629return new SeparatedSyntaxList<SyntaxNode>(nodes._list); 634public static SeparatedSyntaxList<TNode> op_Implicit(SeparatedSyntaxList<SyntaxNode> nodes) 639public static explicit operator SeparatedSyntaxList<TNode>(SeparatedSyntaxList<SyntaxNode> nodes)
Syntax\SeparatedSyntaxListBuilder.cs (1)
10internal struct SeparatedSyntaxListBuilder<TNode> where TNode : SyntaxNode
Syntax\SyntaxDiffer.cs (6)
27private SyntaxDiffer(SyntaxNode oldNode, SyntaxNode newNode, bool computeNewText) 58internal static IList<TextChange> GetTextChanges(SyntaxNode oldNode, SyntaxNode newNode) 94internal static IList<TextSpan> GetPossiblyDifferentTextSpans(SyntaxNode oldNode, SyntaxNode newNode)
Syntax\SyntaxList.cs (17)
13internal SyntaxList(InternalSyntax.SyntaxList green, SyntaxNode? parent, int position) 29protected internal override SyntaxNode ReplaceCore<TNode>(IEnumerable<TNode>? nodes = null, Func<TNode, TNode, SyntaxNode>? computeReplacementNode = null, IEnumerable<SyntaxToken>? tokens = null, Func<SyntaxToken, SyntaxToken, SyntaxToken>? computeReplacementToken = null, IEnumerable<SyntaxTrivia>? trivia = null, Func<SyntaxTrivia, SyntaxTrivia, SyntaxTrivia>? computeReplacementTrivia = null) 34protected internal override SyntaxNode ReplaceNodeInListCore(SyntaxNode originalNode, IEnumerable<SyntaxNode> replacementNodes) 39protected internal override SyntaxNode InsertNodesInListCore(SyntaxNode nodeInList, IEnumerable<SyntaxNode> nodesToInsert, bool insertBefore) 44protected internal override SyntaxNode ReplaceTokenInListCore(SyntaxToken originalToken, IEnumerable<SyntaxToken> newTokens) 49protected internal override SyntaxNode InsertTokensInListCore(SyntaxToken originalToken, IEnumerable<SyntaxToken> newTokens, bool insertBefore) 54protected internal override SyntaxNode ReplaceTriviaInListCore(SyntaxTrivia originalTrivia, IEnumerable<SyntaxTrivia> newTrivia) 59protected internal override SyntaxNode InsertTriviaInListCore(SyntaxTrivia originalTrivia, IEnumerable<SyntaxTrivia> newTrivia, bool insertBefore) 64protected internal override SyntaxNode RemoveNodesCore(IEnumerable<SyntaxNode> nodes, SyntaxRemoveOptions options) 69protected internal override SyntaxNode NormalizeWhitespaceCore(string indentation, string eol, bool elasticTrivia) 74protected override bool IsEquivalentToCore(SyntaxNode node, bool topLevel = false)
Syntax\SyntaxList.SeparatedWithManyChildren.cs (5)
11private readonly ArrayElement<SyntaxNode?>[] _children; 13internal SeparatedWithManyChildren(InternalSyntax.SyntaxList green, SyntaxNode? parent, int position) 16_children = new ArrayElement<SyntaxNode?>[(green.SlotCount + 1) >> 1]; 19internal override SyntaxNode? GetNodeSlot(int i) 30internal override SyntaxNode? GetCachedSlot(int i)
Syntax\SyntaxList.SeparatedWithManyWeakChildren.cs (7)
13private readonly ArrayElement<WeakReference<SyntaxNode>?>[] _children; 15internal SeparatedWithManyWeakChildren(InternalSyntax.SyntaxList green, SyntaxNode parent, int position) 18_children = new ArrayElement<WeakReference<SyntaxNode>?>[(((green.SlotCount + 1) >> 1) - 1)]; 21internal override SyntaxNode? GetNodeSlot(int i) 23SyntaxNode? result = null; 34internal override SyntaxNode? GetCachedSlot(int i) 36SyntaxNode? result = null;
Syntax\SyntaxList.WithManyChildren.cs (5)
13private readonly ArrayElement<SyntaxNode?>[] _children; 15internal WithManyChildren(InternalSyntax.SyntaxList green, SyntaxNode? parent, int position) 18_children = new ArrayElement<SyntaxNode?>[green.SlotCount]; 21internal override SyntaxNode? GetNodeSlot(int index) 26internal override SyntaxNode? GetCachedSlot(int index)
Syntax\SyntaxList.WithManyWeakChildren.cs (6)
14private readonly ArrayElement<WeakReference<SyntaxNode>?>[] _children; 21internal WithManyWeakChildren(InternalSyntax.SyntaxList.WithManyChildrenBase green, SyntaxNode parent, int position) 25_children = new ArrayElement<WeakReference<SyntaxNode>?>[count]; 45internal override SyntaxNode GetNodeSlot(int index) 50internal override SyntaxNode? GetCachedSlot(int index) 52SyntaxNode? value = null;
Syntax\SyntaxList.WithThreeChildren.cs (6)
13private SyntaxNode? _child0; 14private SyntaxNode? _child1; 15private SyntaxNode? _child2; 17internal WithThreeChildren(InternalSyntax.SyntaxList green, SyntaxNode? parent, int position) 22internal override SyntaxNode? GetNodeSlot(int index) 37internal override SyntaxNode? GetCachedSlot(int index)
Syntax\SyntaxList.WithTwoChildren.cs (5)
15private SyntaxNode? _child0; 16private SyntaxNode? _child1; 18internal WithTwoChildren(InternalSyntax.SyntaxList green, SyntaxNode? parent, int position) 23internal override SyntaxNode? GetNodeSlot(int index) 36internal override SyntaxNode? GetCachedSlot(int index)
Syntax\SyntaxList`1.cs (13)
20public static SyntaxList<TNode> Create<TNode>(ReadOnlySpan<TNode> nodes) where TNode : SyntaxNode 48/// A list of <see cref="SyntaxNode"/>. 52where TNode : SyntaxNode 54private readonly SyntaxNode? _node; 56internal SyntaxList(SyntaxNode? node) 66: this((SyntaxNode?)node) 79private static SyntaxNode? CreateNode(IEnumerable<TNode>? nodes) 97internal SyntaxNode? Node 143internal SyntaxNode? ItemInternal(int index) 487public static SyntaxList<TNode> op_Implicit(SyntaxList<SyntaxNode> nodes) 492public static implicit operator SyntaxList<SyntaxNode>(SyntaxList<TNode> nodes) 494return new SyntaxList<SyntaxNode>(nodes.Node); 497public static explicit operator SyntaxList<TNode>(SyntaxList<SyntaxNode> nodes)
Syntax\SyntaxListBuilder.cs (11)
25public void Add(SyntaxNode item) 45public void AddRange(SyntaxNode[] items) 50public void AddRange(SyntaxNode[] items, int offset, int length) 79public void AddRange(SyntaxList<SyntaxNode> list) 84public void AddRange(SyntaxList<SyntaxNode> list, int offset, int count) 103public void AddRange<TNode>(SyntaxList<TNode> list) where TNode : SyntaxNode 108public void AddRange<TNode>(SyntaxList<TNode> list, int offset, int count) where TNode : SyntaxNode 110this.AddRange(new SyntaxList<SyntaxNode>(list.Node), offset, count); 145this.AddRange(new SyntaxList<SyntaxNode>(list.Node.CreateRed()), offset, length); 191public static implicit operator SyntaxList<SyntaxNode>(SyntaxListBuilder builder) 195return default(SyntaxList<SyntaxNode>);
Syntax\SyntaxListBuilder`1.cs (1)
7internal readonly struct SyntaxListBuilder<TNode> where TNode : SyntaxNode
Syntax\SyntaxListBuilderExtensions.cs (4)
19public static SyntaxList<SyntaxNode> ToList(this SyntaxListBuilder? builder) 27return new SyntaxList<SyntaxNode>(listNode.CreateRed()); 31where TNode : SyntaxNode 42public static SeparatedSyntaxList<TNode> ToSeparatedList<TNode>(this SyntaxListBuilder? builder) where TNode : SyntaxNode
Syntax\SyntaxNavigator.cs (9)
62internal SyntaxToken GetFirstToken(in SyntaxNode current, bool includeZeroWidth, bool includeSkipped, bool includeDirectives, bool includeDocumentationComments) 67internal SyntaxToken GetLastToken(in SyntaxNode current, bool includeZeroWidth, bool includeSkipped, bool includeDirectives, bool includeDocumentationComments) 95internal SyntaxToken GetFirstToken(SyntaxNode current, Func<SyntaxToken, bool>? predicate, Func<SyntaxTrivia, bool>? stepInto) 141internal SyntaxToken GetLastToken(SyntaxNode current, Func<SyntaxToken, bool> predicate, Func<SyntaxTrivia, bool>? stepInto) 193if (trivia.TryGetStructure(out var structure) && stepInto(trivia)) 233if (!trivia.TryGetStructure(out var structure) || stepInto == null || !stepInto(trivia)) 386if (trivia.TryGetStructure(out var structure) && stepInto != null && stepInto(trivia)) 431SyntaxNode node, 481SyntaxNode node,
Syntax\SyntaxNode.cs (100)
28private readonly SyntaxNode? _parent; 31internal SyntaxNode(GreenNode green, SyntaxNode? parent, int position) 136internal SyntaxNode? GetRed(ref SyntaxNode? field, int slot) 138var result = field; 154internal SyntaxNode? GetRedAtZero(ref SyntaxNode? field) 156var result = field; 171protected T? GetRed<T>(ref T? field, int slot) where T : SyntaxNode 189protected T? GetRedAtZero<T>(ref T? field) where T : SyntaxNode 211internal SyntaxNode? GetRedElement(ref SyntaxNode? element, int slot) 215var result = element; 231internal SyntaxNode? GetRedElementIfNotToken(ref SyntaxNode? element) 235var result = element; 251internal SyntaxNode GetWeakRedElement(ref WeakReference<SyntaxNode>? slot, int index) 253SyntaxNode? value = null; 263private SyntaxNode CreateWeakItem(ref WeakReference<SyntaxNode>? slot, int index) 266var newNode = greenChild.CreateRed(this.Parent, GetChildPosition(index)); 267var newWeakReference = new WeakReference<SyntaxNode>(newNode); 271SyntaxNode? previousNode = null; 272WeakReference<SyntaxNode>? previousWeakReference = slot; 336public bool IsEquivalentTo([NotNullWhen(true)] SyntaxNode? other) 355/// new tree. In this case, the <see cref="SyntaxNode.ToFullString()"/> of each node will be the same, though 365public bool IsIncrementallyIdenticalTo([NotNullWhen(true)] SyntaxNode? other) 387for (SyntaxNode? node = this; node != null; node = node.Parent) 527public bool Contains(SyntaxNode? node) 584internal abstract SyntaxNode? GetCachedSlot(int index); 628var prevSibling = this.GetCachedSlot(index); 658var nextSibling = this.GetCachedSlot(index); 722public SyntaxNode? Parent 738internal SyntaxNode? ParentOrStructuredTriviaParent 773internal abstract SyntaxNode? GetNodeSlot(int slot); 775internal SyntaxNode GetRequiredNodeSlot(int slot) 777var syntaxNode = GetNodeSlot(slot); 785public IEnumerable<SyntaxNode> ChildNodes() 789if (nodeOrToken.AsNode(out var node)) 799public IEnumerable<SyntaxNode> Ancestors(bool ascendOutOfTrivia = true) 803SpecializedCollections.EmptyEnumerable<SyntaxNode>(); 809public IEnumerable<SyntaxNode> AncestorsAndSelf(bool ascendOutOfTrivia = true) 811for (SyntaxNode? node = this; node != null; node = GetParent(node, ascendOutOfTrivia)) 817private static SyntaxNode? GetParent(SyntaxNode node, bool ascendOutOfTrivia) 819var parent = node.Parent; 836where TNode : SyntaxNode 838for (SyntaxNode? node = this; node != null; node = GetParent(node, ascendOutOfTrivia)) 855where TNode : SyntaxNode 857for (var node = this; node != null; node = GetParent(node, ascendOutOfTrivia)) 873public IEnumerable<SyntaxNode> DescendantNodes(Func<SyntaxNode, bool>? descendIntoChildren = null, bool descendIntoTrivia = false) 884public IEnumerable<SyntaxNode> DescendantNodes(TextSpan span, Func<SyntaxNode, bool>? descendIntoChildren = null, bool descendIntoTrivia = false) 894public IEnumerable<SyntaxNode> DescendantNodesAndSelf(Func<SyntaxNode, bool>? descendIntoChildren = null, bool descendIntoTrivia = false) 905public IEnumerable<SyntaxNode> DescendantNodesAndSelf(TextSpan span, Func<SyntaxNode, bool>? descendIntoChildren = null, bool descendIntoTrivia = false) 915public IEnumerable<SyntaxNodeOrToken> DescendantNodesAndTokens(Func<SyntaxNode, bool>? descendIntoChildren = null, bool descendIntoTrivia = false) 926public IEnumerable<SyntaxNodeOrToken> DescendantNodesAndTokens(TextSpan span, Func<SyntaxNode, bool>? descendIntoChildren = null, bool descendIntoTrivia = false) 936public IEnumerable<SyntaxNodeOrToken> DescendantNodesAndTokensAndSelf(Func<SyntaxNode, bool>? descendIntoChildren = null, bool descendIntoTrivia = false) 947public IEnumerable<SyntaxNodeOrToken> DescendantNodesAndTokensAndSelf(TextSpan span, Func<SyntaxNode, bool>? descendIntoChildren = null, bool descendIntoTrivia = false) 962public SyntaxNode FindNode(TextSpan span, bool findInsideTrivia = false, bool getInnermostNodeForTie = false) 969var node = FindToken(span.Start, findInsideTrivia) 971!.FirstAncestorOrSelf<SyntaxNode, TextSpan>((a, span) => a.FullSpan.Contains(span), span); 974SyntaxNode? cuRoot = node.SyntaxTree?.GetRoot(); 981var parent = node.Parent; 1044public IEnumerable<SyntaxToken> DescendantTokens(Func<SyntaxNode, bool>? descendIntoChildren = null, bool descendIntoTrivia = false) 1052public IEnumerable<SyntaxToken> DescendantTokens(TextSpan span, Func<SyntaxNode, bool>? descendIntoChildren = null, bool descendIntoTrivia = false) 1110internal static SyntaxTrivia FindTriviaByOffset(SyntaxNode node, int textOffset, Func<SyntaxTrivia, bool>? stepInto = null) 1120if (element.AsNode(out var elementNode)) 1181public IEnumerable<SyntaxTrivia> DescendantTrivia(Func<SyntaxNode, bool>? descendIntoChildren = null, bool descendIntoTrivia = false) 1189public IEnumerable<SyntaxTrivia> DescendantTrivia(TextSpan span, Func<SyntaxNode, bool>? descendIntoChildren = null, bool descendIntoTrivia = false) 1281public IEnumerable<SyntaxNode> GetAnnotatedNodes(SyntaxAnnotation syntaxAnnotation) 1291public IEnumerable<SyntaxNode> GetAnnotatedNodes(string annotationKind) 1339internal SyntaxNode WithAdditionalAnnotationsInternal(IEnumerable<SyntaxAnnotation> annotations) 1344internal SyntaxNode GetNodeWithoutAnnotations(IEnumerable<SyntaxAnnotation> annotations) 1362public T? CopyAnnotationsTo<T>(T? node) where T : SyntaxNode 1388public bool IsEquivalentTo(SyntaxNode node, bool topLevel = false) 1420protected virtual bool EquivalentToCore(SyntaxNode other) 1488var node = curNode.AsNode(); 1578protected internal abstract SyntaxNode ReplaceCore<TNode>( 1580Func<TNode, TNode, SyntaxNode>? computeReplacementNode = null, 1585where TNode : SyntaxNode; 1587protected internal abstract SyntaxNode ReplaceNodeInListCore(SyntaxNode originalNode, IEnumerable<SyntaxNode> replacementNodes); 1588protected internal abstract SyntaxNode InsertNodesInListCore(SyntaxNode nodeInList, IEnumerable<SyntaxNode> nodesToInsert, bool insertBefore); 1589protected internal abstract SyntaxNode ReplaceTokenInListCore(SyntaxToken originalToken, IEnumerable<SyntaxToken> newTokens); 1590protected internal abstract SyntaxNode InsertTokensInListCore(SyntaxToken originalToken, IEnumerable<SyntaxToken> newTokens, bool insertBefore); 1591protected internal abstract SyntaxNode ReplaceTriviaInListCore(SyntaxTrivia originalTrivia, IEnumerable<SyntaxTrivia> newTrivia); 1592protected internal abstract SyntaxNode InsertTriviaInListCore(SyntaxTrivia originalTrivia, IEnumerable<SyntaxTrivia> newTrivia, bool insertBefore); 1597protected internal abstract SyntaxNode? RemoveNodesCore( 1598IEnumerable<SyntaxNode> nodes, 1601protected internal abstract SyntaxNode NormalizeWhitespaceCore(string indentation, string eol, bool elasticTrivia); 1612protected abstract bool IsEquivalentToCore(SyntaxNode node, bool topLevel = false); 1650internal static T CloneNodeAsRoot<T>(T node, SyntaxTree syntaxTree) where T : SyntaxNode
Syntax\SyntaxNode.Iterators.cs (31)
17private IEnumerable<SyntaxNode> DescendantNodesImpl(TextSpan span, Func<SyntaxNode, bool>? descendIntoChildren, bool descendIntoTrivia, bool includeSelf) 24private IEnumerable<SyntaxNodeOrToken> DescendantNodesAndTokensImpl(TextSpan span, Func<SyntaxNode, bool>? descendIntoChildren, bool descendIntoTrivia, bool includeSelf) 31private IEnumerable<SyntaxTrivia> DescendantTriviaImpl(TextSpan span, Func<SyntaxNode, bool>? descendIntoChildren = null, bool descendIntoTrivia = false) 52public ChildSyntaxListEnumeratorStack(SyntaxNode startingNode, Func<SyntaxNode, bool>? descendIntoChildren) 84public SyntaxNode? TryGetNextAsNodeInSpan(in TextSpan span) 87SyntaxNode? nodeValue; 100public void PushChildren(SyntaxNode node) 112public void PushChildren(SyntaxNode node, Func<SyntaxNode, bool>? descendIntoChildren) 199public TwoEnumeratorListStack(SyntaxNode startingNode, Func<SyntaxNode, bool>? descendIntoChildren) 246public void PushChildren(SyntaxNode node, Func<SyntaxNode, bool>? descendIntoChildren) 292public ThreeEnumeratorListStack(SyntaxNode startingNode, Func<SyntaxNode, bool>? descendIntoChildren) 349public void PushChildren(SyntaxNode node, Func<SyntaxNode, bool>? descendIntoChildren) 390private IEnumerable<SyntaxNode> DescendantNodesOnly(TextSpan span, Func<SyntaxNode, bool>? descendIntoChildren, bool includeSelf) 401SyntaxNode? nodeValue = stack.TryGetNextAsNodeInSpan(in span); 415private IEnumerable<SyntaxNodeOrToken> DescendantNodesAndTokensOnly(TextSpan span, Func<SyntaxNode, bool>? descendIntoChildren, bool includeSelf) 432var nodeValue = value.AsNode(); 444private IEnumerable<SyntaxNodeOrToken> DescendantNodesAndTokensIntoTrivia(TextSpan span, Func<SyntaxNode, bool>? descendIntoChildren, bool includeSelf) 510if (trivia.TryGetStructure(out var structureNode) && IsInSpan(in span, trivia.FullSpan)) 532private IEnumerable<SyntaxTrivia> DescendantTriviaOnly(TextSpan span, Func<SyntaxNode, bool>? descendIntoChildren) 541if (value.AsNode(out var nodeValue)) 570private IEnumerable<SyntaxTrivia> DescendantTriviaIntoTrivia(TextSpan span, Func<SyntaxNode, bool>? descendIntoChildren) 582if (value.AsNode(out var nodeValue)) 612if (trivia.TryGetStructure(out var structureNode))
Syntax\SyntaxNodeExtensions.cs (53)
32IEnumerable<SyntaxNode>? nodes, 33Func<SyntaxNode, SyntaxNode, SyntaxNode>? computeReplacementNode, 38where TRoot : SyntaxNode 56public static TRoot ReplaceNodes<TRoot, TNode>(this TRoot root, IEnumerable<TNode> nodes, Func<TNode, TNode, SyntaxNode> computeReplacementNode) 57where TRoot : SyntaxNode 58where TNode : SyntaxNode 70public static TRoot ReplaceNode<TRoot>(this TRoot root, SyntaxNode oldNode, SyntaxNode newNode) 71where TRoot : SyntaxNode 88public static TRoot ReplaceNode<TRoot>(this TRoot root, SyntaxNode oldNode, IEnumerable<SyntaxNode> newNodes) 89where TRoot : SyntaxNode 101public static TRoot InsertNodesBefore<TRoot>(this TRoot root, SyntaxNode nodeInList, IEnumerable<SyntaxNode> newNodes) 102where TRoot : SyntaxNode 114public static TRoot InsertNodesAfter<TRoot>(this TRoot root, SyntaxNode nodeInList, IEnumerable<SyntaxNode> newNodes) 115where TRoot : SyntaxNode 128where TRoot : SyntaxNode 141where TRoot : SyntaxNode 154where TRoot : SyntaxNode 167where TRoot : SyntaxNode 180where TRoot : SyntaxNode 193where TRoot : SyntaxNode 208where TRoot : SyntaxNode 210return (TRoot)root.ReplaceCore<SyntaxNode>(tokens: tokens, computeReplacementToken: computeReplacementToken); 222where TRoot : SyntaxNode 224return (TRoot)root.ReplaceCore<SyntaxNode>(tokens: new[] { oldToken }, computeReplacementToken: (o, r) => newToken); 237where TRoot : SyntaxNode 239return (TRoot)root.ReplaceCore<SyntaxNode>(trivia: trivia, computeReplacementTrivia: computeReplacementTrivia); 250where TRoot : SyntaxNode 252return (TRoot)root.ReplaceCore<SyntaxNode>(trivia: new[] { trivia }, computeReplacementTrivia: (o, r) => newTrivia); 264SyntaxNode node, 266where TRoot : SyntaxNode 280IEnumerable<SyntaxNode> nodes, 282where TRoot : SyntaxNode 299where TNode : SyntaxNode 314where TNode : SyntaxNode 322public static TSyntax WithTriviaFrom<TSyntax>(this TSyntax syntax, SyntaxNode node) 323where TSyntax : SyntaxNode 332where TSyntax : SyntaxNode 349SyntaxTriviaList trivia) where TSyntax : SyntaxNode 361IEnumerable<SyntaxTrivia>? trivia) where TSyntax : SyntaxNode 373) where TSyntax : SyntaxNode 383params SyntaxTrivia[]? trivia) where TSyntax : SyntaxNode 393SyntaxTriviaList trivia) where TSyntax : SyntaxNode 405IEnumerable<SyntaxTrivia>? trivia) where TSyntax : SyntaxNode 415public static TSyntax WithoutTrailingTrivia<TSyntax>(this TSyntax node) where TSyntax : SyntaxNode 425params SyntaxTrivia[]? trivia) where TSyntax : SyntaxNode 434internal static SyntaxNode? AsRootOfNewTreeWithOptionsFrom(this SyntaxNode? node, SyntaxTree oldTree)
Syntax\SyntaxNodeExtensions_Tracking.cs (36)
18private static readonly ConditionalWeakTable<SyntaxNode, SyntaxAnnotation> s_nodeToIdMap 19= new ConditionalWeakTable<SyntaxNode, SyntaxAnnotation>(); 21private static readonly ConditionalWeakTable<SyntaxNode, CurrentNodes> s_rootToCurrentNodesMap 22= new ConditionalWeakTable<SyntaxNode, CurrentNodes>(); 34public static TRoot TrackNodes<TRoot>(this TRoot root, IEnumerable<SyntaxNode> nodes) 35where TRoot : SyntaxNode 43foreach (var node in nodes) 64public static TRoot TrackNodes<TRoot>(this TRoot root, params SyntaxNode[] nodes) 65where TRoot : SyntaxNode 67return TrackNodes(root, (IEnumerable<SyntaxNode>)nodes); 76public static IEnumerable<TNode> GetCurrentNodes<TNode>(this SyntaxNode root, TNode node) 77where TNode : SyntaxNode 93public static TNode? GetCurrentNode<TNode>(this SyntaxNode root, TNode node) 94where TNode : SyntaxNode 105public static IEnumerable<TNode> GetCurrentNodes<TNode>(this SyntaxNode root, IEnumerable<TNode> nodes) 106where TNode : SyntaxNode 113var trueRoot = GetRoot(root); 124private static IReadOnlyList<SyntaxNode> GetCurrentNodeFromTrueRoots(SyntaxNode trueRoot, SyntaxNode node) 134return SpecializedCollections.EmptyReadOnlyList<SyntaxNode>(); 138private static SyntaxAnnotation? GetId(SyntaxNode original) 145private static SyntaxNode GetRoot(SyntaxNode node) 166private static bool IsDescendant(SyntaxNode root, SyntaxNode node) 196private readonly ImmutableSegmentedDictionary<SyntaxAnnotation, IReadOnlyList<SyntaxNode>> _idToNodeMap; 198public CurrentNodes(SyntaxNode root) 202var map = new SegmentedDictionary<SyntaxAnnotation, List<SyntaxNode>>(); 204foreach (var node in root.GetAnnotatedNodesAndTokens(IdAnnotationKind).Select(n => n.AsNode()!)) 209List<SyntaxNode>? list; 212list = new List<SyntaxNode>(); 220_idToNodeMap = map.ToImmutableSegmentedDictionary(kv => kv.Key, kv => (IReadOnlyList<SyntaxNode>)ImmutableArray.CreateRange(kv.Value)); 223public IReadOnlyList<SyntaxNode> GetNodes(SyntaxAnnotation id) 225IReadOnlyList<SyntaxNode>? nodes; 232return SpecializedCollections.EmptyReadOnlyList<SyntaxNode>();
Syntax\SyntaxNodeLocationComparer.cs (3)
9internal class SyntaxNodeLocationComparer : IComparer<SyntaxNode> 17public int Compare(SyntaxNode? x, SyntaxNode? y)
Syntax\SyntaxNodeOrToken.cs (18)
16/// A wrapper for either a syntax node (<see cref="SyntaxNode"/>) or a syntax token (<see 29private readonly SyntaxNode? _nodeOrParent; 43internal SyntaxNodeOrToken(SyntaxNode node) 52internal SyntaxNodeOrToken(SyntaxNode? parent, GreenNode? token, int position, int index) 126public SyntaxNode? Parent => _token != null ? _nodeOrParent : _nodeOrParent?.Parent; 187public SyntaxNode? AsNode() 197internal bool AsNode([NotNullWhen(true)] out SyntaxNode? node) 214if (AsNode(out var node)) 761/// See <see cref="SyntaxNode.IsIncrementallyIdenticalTo"/> and <see cref="SyntaxToken.IsIncrementallyIdenticalTo"/>. 799public static implicit operator SyntaxNodeOrToken(SyntaxNode? node) 815public static explicit operator SyntaxNode?(SyntaxNodeOrToken nodeOrToken) 842where TDirective : SyntaxNode 849where TDirective : SyntaxNode 868private static void GetDirectives<TDirective>(SyntaxNode node, Func<TDirective, bool>? filter, ref List<TDirective>? directives) 869where TDirective : SyntaxNode 878where TDirective : SyntaxNode 899public static int GetFirstChildIndexSpanningPosition(SyntaxNode node, int position) 951var parent = this.Parent;
Syntax\SyntaxNodeOrTokenList.cs (6)
27private readonly SyntaxNode? _node; 39internal SyntaxNodeOrTokenList(SyntaxNode? node, int index) 76private static SyntaxNode? CreateNodeFromSpan(ReadOnlySpan<SyntaxNodeOrToken> nodesAndTokens) 101private static SyntaxNode? CreateNode(IEnumerable<SyntaxNodeOrToken> nodesAndTokens) 114internal SyntaxNode? Node => _node; 118internal SyntaxNode? Parent => _node?.Parent;
Syntax\SyntaxNodeOrTokenListBuilder.cs (1)
70public void Add(SyntaxNode item)
Syntax\SyntaxReference.cs (2)
31public abstract SyntaxNode GetSyntax(CancellationToken cancellationToken = default); 38public virtual Task<SyntaxNode> GetSyntaxAsync(CancellationToken cancellationToken = default)
Syntax\SyntaxToken.cs (2)
28internal SyntaxToken(SyntaxNode? parent, GreenNode? token, int position, int index) 75public SyntaxNode? Parent { get; }
Syntax\SyntaxTokenList.cs (2)
25private readonly SyntaxNode? _parent; 28internal SyntaxTokenList(SyntaxNode? parent, GreenNode? tokenOrList, int position, int index)
Syntax\SyntaxTokenList.Enumerator.cs (1)
51private readonly SyntaxNode? _parent;
Syntax\SyntaxTokenList.Reversed.cs (1)
73private readonly SyntaxNode? _parent;
Syntax\SyntaxTree.cs (10)
127public bool TryGetRoot([NotNullWhen(true)] out SyntaxNode? root) 135protected abstract bool TryGetRootCore([NotNullWhen(true)] out SyntaxNode? root); 140public SyntaxNode GetRoot(CancellationToken cancellationToken = default) 148protected abstract SyntaxNode GetRootCore(CancellationToken cancellationToken); 153public Task<SyntaxNode> GetRootAsync(CancellationToken cancellationToken = default) 162protected abstract Task<SyntaxNode> GetRootAsyncCore(CancellationToken cancellationToken); 185public abstract IEnumerable<Diagnostic> GetDiagnostics(SyntaxNode node); 357public abstract SyntaxReference GetReference(SyntaxNode node); 390public abstract SyntaxTree WithRootAndOptions(SyntaxNode root, ParseOptions options); 429var root = this.GetRoot(cancellationToken);
Syntax\SyntaxTreeExtensions.cs (2)
22var root = tree.GetRoot(); 25SyntaxNode? node = null;
Syntax\SyntaxTrivia.cs (2)
207public SyntaxNode? GetStructure() 212internal bool TryGetStructure([NotNullWhen(true)] out SyntaxNode? structure)
Syntax\SyntaxWalker.cs (1)
34public virtual void Visit(SyntaxNode node)
Syntax\TranslationSyntaxReference.cs (3)
34public sealed override SyntaxNode GetSyntax(CancellationToken cancellationToken = default(CancellationToken)) 36var node = Translate(_reference, cancellationToken); 41protected abstract SyntaxNode Translate(SyntaxReference reference, CancellationToken cancellationToken);
Microsoft.CodeAnalysis.CodeStyle (1297)
src\Analyzers\Core\Analyzers\AddAccessibilityModifiers\AbstractAddAccessibilityModifiers.cs (2)
11where TMemberDeclarationSyntax : SyntaxNode 15SyntaxNode member,
src\Analyzers\Core\Analyzers\AddAccessibilityModifiers\AbstractAddAccessibilityModifiersDiagnosticAnalyzer.cs (1)
13where TCompilationUnitSyntax : SyntaxNode
src\Analyzers\Core\Analyzers\AddAccessibilityModifiers\IAddAccessibilityModifiersService.cs (1)
19SyntaxNode member,
src\Analyzers\Core\Analyzers\AddRequiredParentheses\AbstractAddRequiredParenthesesDiagnosticAnalyzer.cs (1)
20where TExpressionSyntax : SyntaxNode
src\Analyzers\Core\Analyzers\ConvertTypeofToNameof\AbstractConvertTypeOfToNameOfDiagnosticAnalyzer.cs (2)
41var node = context.Operation.Syntax; 42var parent = node.Parent;
src\Analyzers\Core\Analyzers\FileHeaders\AbstractFileHeaderDiagnosticAnalyzer.cs (1)
48var root = tree.GetRoot(context.CancellationToken);
src\Analyzers\Core\Analyzers\FileHeaders\AbstractFileHeaderHelper.cs (1)
41public FileHeader ParseFileHeader(SyntaxNode root)
src\Analyzers\Core\Analyzers\ForEachCast\AbstractForEachCastDiagnosticAnalyzer.cs (1)
24where TForEachStatementSyntax : SyntaxNode
src\Analyzers\Core\Analyzers\Formatting\AbstractFormattingAnalyzer.cs (1)
50var root = tree.GetRoot(cancellationToken);
src\Analyzers\Core\Analyzers\MakeFieldReadonly\AbstractMakeFieldReadonlyDiagnosticAnalyzer.cs (1)
21where TThisExpression : SyntaxNode
src\Analyzers\Core\Analyzers\MatchFolderAndNamespace\AbstractMatchFolderAndNamespaceDiagnosticAnalyzer.cs (4)
22where TNamespaceSyntax : SyntaxNode 79var nameSyntax = GetSyntaxFacts().GetNameOfBaseNamespaceDeclaration(namespaceDecl); 95var root = namespaceDeclaration.SyntaxTree.GetRoot(cancellationToken); 177foreach (var typeDecl in typeDeclarations)
src\Analyzers\Core\Analyzers\NewLines\ConsecutiveStatementPlacement\AbstractConsecutiveStatementPlacementDiagnosticAnalyzer.cs (6)
17where TExecutableStatementSyntax : SyntaxNode 31protected abstract bool IsBlockLikeStatement(SyntaxNode node); 32protected abstract Location GetDiagnosticLocation(SyntaxNode block); 50private void Recurse(SyntaxTreeAnalysisContext context, NotificationOption2 notificationOption, SyntaxNode node, CancellationToken cancellationToken) 63if (child.AsNode(out var childNode)) 68private void ProcessBlockLikeStatement(SyntaxTreeAnalysisContext context, NotificationOption2 notificationOption, SyntaxNode block)
src\Analyzers\Core\Analyzers\NewLines\MultipleBlankLines\AbstractMultipleBlankLinesDiagnosticAnalyzer.cs (2)
48SyntaxNode node, 62if (child.AsNode(out var childNode))
src\Analyzers\Core\Analyzers\OrderModifiers\AbstractOrderModifiersDiagnosticAnalyzer.cs (3)
51var analysisRoot = context.GetAnalysisRoot(findInTrivia: false); 64SyntaxNode root); 70SyntaxNode memberDeclaration)
src\Analyzers\Core\Analyzers\PopulateSwitch\AbstractPopulateSwitchDiagnosticAnalyzer.cs (1)
18where TSwitchSyntax : SyntaxNode
src\Analyzers\Core\Analyzers\PopulateSwitch\AbstractPopulateSwitchExpressionDiagnosticAnalyzer.cs (1)
13where TSwitchSyntax : SyntaxNode
src\Analyzers\Core\Analyzers\PopulateSwitch\AbstractPopulateSwitchStatementDiagnosticAnalyzer.cs (1)
13where TSwitchSyntax : SyntaxNode
src\Analyzers\Core\Analyzers\QualifyMemberAccess\AbstractQualifyMemberAccessDiagnosticAnalyzer.cs (2)
21where TExpressionSyntax : SyntaxNode 45protected abstract bool CanMemberAccessBeQualified(ISymbol containingSymbol, SyntaxNode node);
src\Analyzers\Core\Analyzers\RemoveRedundantEquality\AbstractRemoveRedundantEqualityDiagnosticAnalyzer.cs (3)
34var syntax = context.Operation.Syntax; 56var syntax = context.Operation.Syntax; 69syntaxFacts.GetPartsOfBinaryExpression(syntax, out _, out var operatorToken, out _);
src\Analyzers\Core\Analyzers\RemoveUnnecessaryCast\AbstractRemoveUnnecessaryCastDiagnosticAnalyzer.cs (1)
18where TCastExpression : SyntaxNode
src\Analyzers\Core\Analyzers\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsDiagnosticAnalyzer.cs (9)
20where TSyntaxNode : SyntaxNode 70protected abstract ImmutableArray<SyntaxNode> MergeImports(ImmutableArray<TSyntaxNode> unnecessaryImports); 74protected abstract SyntaxToken? TryGetLastToken(SyntaxNode node); 141private IEnumerable<TextSpan> GetContiguousSpans(ImmutableArray<SyntaxNode> nodes) 144(SyntaxNode node, TextSpan textSpan)? previous = null; 147foreach (var node in nodes.OrderBy(n => n.SpanStart)) 179int GetEnd(SyntaxNode node) 209IEnumerable<SyntaxNode> nodes, SyntaxTree tree, CancellationToken cancellationToken); 212IEnumerable<SyntaxNode> nodes, SyntaxTree tree, CancellationToken cancellationToken)
src\Analyzers\Core\Analyzers\RemoveUnnecessaryParentheses\AbstractRemoveUnnecessaryParenthesesDiagnosticAnalyzer.cs (2)
22where TParenthesizedExpressionSyntax : SyntaxNode 71var child = syntaxFacts.GetExpressionOfParenthesizedExpression(parenthesizedExpression);
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryAttributeSuppressionsDiagnosticAnalyzer.cs (1)
74public void AnalyzeAssemblyOrModuleAttribute(SyntaxNode attributeSyntax, SemanticModel model, Action<Diagnostic> reportDiagnostic, CancellationToken cancellationToken)
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (19)
49protected abstract bool ContainsPragmaDirective(SyntaxNode root); 127var root = tree.GetRoot(cancellationToken); 166using var _5 = PooledDictionary<string, List<SyntaxNode>>.GetInstance(out var idToSuppressMessageAttributesMap); 167using var _6 = PooledDictionary<SyntaxNode, bool>.GetInstance(out var suppressMessageAttributesToIsUsedMap); 210foreach (var attributeNode in attributeNodes) 226SyntaxNode root, 297SyntaxNode idNode, 391SyntaxNode root, 512PooledDictionary<string, List<SyntaxNode>> idToSuppressMessageAttributesMap, 513PooledDictionary<SyntaxNode, bool> suppressMessageAttributesToIsUsedMap, 586PooledDictionary<string, List<SyntaxNode>> idToSuppressMessageAttributesMap, 587PooledDictionary<SyntaxNode, bool> suppressMessageAttributesToIsUsedMap, 596var attributeNode = await attribute.ApplicationSyntaxReference.GetSyntaxAsync(cancellationToken).ConfigureAwait(false); 597foreach (var node in suppressMessageAttributesForId) 611PooledDictionary<SyntaxNode, bool> suppressMessageAttributesToIsUsedMap, 663PooledDictionary<SyntaxNode, bool> suppressMessageAttributesToIsUsedMap, 733SyntaxNode root, 736PooledDictionary<string, List<SyntaxNode>> idToSuppressMessageAttributesMap, 737PooledDictionary<SyntaxNode, bool> suppressMessageAttributesToIsUsedMap,
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\SuppressMessageAttributeState.cs (1)
46SyntaxNode attributeSyntax,
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (7)
34where TDocumentationCommentTriviaSyntax : SyntaxNode 35where TIdentifierNameSyntax : SyntaxNode 37where TMemberDeclarationSyntax : SyntaxNode 67protected abstract SyntaxNode GetParentIfSoleDeclarator(SyntaxNode declaration); 543var fadingNode = fadingLocation?.GetSyntax(cancellationToken) ?? diagnosticLocation.FindNode(cancellationToken); 673SyntaxNode memberDeclaration, ArrayBuilder<TDocumentationCommentTriviaSyntax> documentationComments)
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.cs (2)
113protected abstract bool IsIfConditionalDirective(SyntaxNode node); 114protected abstract bool ReturnsThrow(SyntaxNode node);
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (1)
126var root = firstBlock.Syntax.SyntaxTree.GetRoot(context.CancellationToken);
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.cs (2)
80var syntax = syntaxRef.GetSyntax(cancellationToken); 263var methodSyntax = method.DeclaringSyntaxReferences.FirstOrDefault()?.GetSyntax(cancellationToken);
src\Analyzers\Core\Analyzers\SimplifyBooleanExpression\AbstractSimplifyConditionalDiagnosticAnalyzer.cs (4)
23where TExpressionSyntax : SyntaxNode 77conditionalExpression, out var conditionNode, out var whenTrueNode, out var whenFalseNode);
src\Analyzers\Core\Analyzers\SimplifyInterpolation\AbstractSimplifyInterpolationDiagnosticAnalyzer.cs (2)
17where TInterpolationSyntax : SyntaxNode 18where TExpressionSyntax : SyntaxNode
src\Analyzers\Core\Analyzers\SimplifyInterpolation\AbstractSimplifyInterpolationHelpers.cs (5)
24protected abstract SyntaxNode GetPreservedInterpolationExpressionSyntax(IOperation operation); 30where TInterpolationSyntax : SyntaxNode 31where TExpressionSyntax : SyntaxNode 194where TExpressionSyntax : SyntaxNode 214var alignmentSyntax = alignmentOp.Syntax;
src\Analyzers\Core\Analyzers\SimplifyLinqExpression\AbstractSimplifyLinqExpressionDiagnosticAnalyzer.cs (3)
17where TInvocationExpressionSyntax : SyntaxNode 18where TMemberAccessExpressionSyntax : SyntaxNode 166SyntaxFacts.GetExpressionOfMemberAccessExpression(memberAccess) is SyntaxNode expression)
src\Analyzers\Core\Analyzers\SimplifyTypeNames\SimplifyTypeNamesDiagnosticAnalyzerBase.cs (8)
78internal abstract bool IsCandidate(SyntaxNode node); 80SemanticModel model, SyntaxNode node, TSimplifierOptions options, 110protected abstract bool IsIgnoredCodeBlock(SyntaxNode codeBlock); 111protected abstract ImmutableArray<Diagnostic> AnalyzeCodeBlock(CodeBlockAnalysisContext context, SyntaxNode root); 112protected abstract ImmutableArray<Diagnostic> AnalyzeSemanticModel(SemanticModelAnalysisContext context, SyntaxNode root, TextSpanMutableIntervalTree? codeBlockIntervalTree); 114public bool TrySimplify(SemanticModel model, SyntaxNode node, [NotNullWhen(true)] out Diagnostic? diagnostic, TSimplifierOptions options, AnalyzerOptions analyzerOptions, CancellationToken cancellationToken) 237var root = context.GetAnalysisRoot(findInTrivia: true); 293var root = context.GetAnalysisRoot(findInTrivia: true);
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (27)
33where TPropertyDeclaration : SyntaxNode 34where TConstructorDeclaration : SyntaxNode 35where TFieldDeclaration : SyntaxNode 36where TVariableDeclarator : SyntaxNode 37where TExpression : SyntaxNode 44private static readonly ObjectPool<ConcurrentSet<SyntaxNode>> s_nodeSetPool = new(() => []); 46private static readonly ObjectPool<ConcurrentDictionary<IFieldSymbol, ConcurrentSet<SyntaxNode>>> s_fieldToUsageLocationPool = new(() => []); 63protected static void AddFieldUsage(ConcurrentDictionary<IFieldSymbol, ConcurrentSet<SyntaxNode>> fieldWrites, IFieldSymbol field, SyntaxNode location) 66private static void ClearAndFree(ConcurrentDictionary<IFieldSymbol, ConcurrentSet<SyntaxNode>> multiMap) 98protected abstract SyntaxNode GetFieldNode(TFieldDeclaration fieldDeclaration, TVariableDeclarator variableDeclarator); 103HashSet<string> fieldNames, ConcurrentDictionary<IFieldSymbol, ConcurrentSet<SyntaxNode>> ineligibleFieldUsageIfOutsideProperty, SemanticModel semanticModel, SyntaxNode codeBlock, CancellationToken cancellationToken); 209var analysisRoot = context.GetAnalysisRoot(findInTrivia: false); 210foreach (var node in analysisRoot.DescendantNodes()) 219if (!shouldAnalyze && analysisRoot.FirstAncestorOrSelf<SyntaxNode>(node => node is TPropertyDeclaration or TFieldDeclaration) == null) 229ConcurrentDictionary<IFieldSymbol, ConcurrentSet<SyntaxNode>> fieldReads, 230ConcurrentDictionary<IFieldSymbol, ConcurrentSet<SyntaxNode>> fieldWrites, 232SyntaxNode codeBlock, 539ConcurrentDictionary<IFieldSymbol, ConcurrentSet<SyntaxNode>> ineligibleFieldUsageIfOutsideProperty, 540ConcurrentDictionary<IFieldSymbol, ConcurrentSet<SyntaxNode>> fieldReads, 541ConcurrentDictionary<IFieldSymbol, ConcurrentSet<SyntaxNode>> fieldWrites, 626static bool NotWithinProperty(IEnumerable<SyntaxNode> nodes, TPropertyDeclaration propertyDeclaration) 628foreach (var node in nodes) 637static IEnumerable<SyntaxNode> NonConstructorLocations(IEnumerable<SyntaxNode> nodes) 644var fieldNode = GetFieldNode(result.FieldDeclaration, variableDeclarator);
src\Analyzers\Core\Analyzers\UseCoalesceExpression\AbstractUseCoalesceExpressionForIfNullCheckDiagnosticAnalyzer.cs (14)
25where TExpressionSyntax : SyntaxNode 26where TStatementSyntax : SyntaxNode 27where TVariableDeclarator : SyntaxNode 46protected abstract SyntaxNode GetDeclarationNode(TVariableDeclarator declarator); 89var thrownExpression = syntaxFacts.GetExpressionOfThrowStatement(whenTrueStatement); 152var equalsValue = syntaxFacts.GetInitializerOfVariableDeclarator(declarator); 170if (!IsLegalWhenTrueStatementForAssignment(out var whenPartToAnalyze)) 176foreach (var identifier in whenPartToAnalyze.DescendantNodesAndSelf()) 189bool IsLegalWhenTrueStatementForAssignment([NotNullWhen(true)] out SyntaxNode? whenPartToAnalyze) 208syntaxFacts.GetPartsOfAssignmentStatement(whenTrueStatement, out var left, out var right); 231syntaxFacts.GetPartsOfAssignmentStatement(assignmentStatement, out var topAssignmentLeft, out var topAssignmentRight); 254syntaxFacts.GetPartsOfAssignmentStatement(whenTrueStatement, out var innerAssignmentLeft, out _);
src\Analyzers\Core\Analyzers\UseCoalesceExpression\AbstractUseCoalesceExpressionForNullableTernaryConditionalCheckDiagnosticAnalyzer.cs (12)
24where TExpressionSyntax : SyntaxNode 64conditionalExpression, out var conditionNode, out var whenTrueNodeHigh, out var whenFalseNodeHigh); 67var whenTrueNodeLow = syntaxFacts.WalkDownParentheses(whenTrueNodeHigh); 68var whenFalseNodeLow = syntaxFacts.WalkDownParentheses(whenFalseNodeHigh); 80syntaxFacts.GetPartsOfMemberAccessExpression(conditionMemberAccess, out var conditionExpression, out var conditionSimpleName); 86var whenPartToCheck = notHasValueExpression ? whenFalseNodeLow : whenTrueNodeLow; 90syntaxFacts.GetPartsOfMemberAccessExpression(whenPartMemberAccess, out var whenPartExpression, out var whenPartSimpleName); 118var whenPartToKeep = notHasValueExpression ? whenTrueNodeHigh : whenFalseNodeHigh;
src\Analyzers\Core\Analyzers\UseCoalesceExpression\AbstractUseCoalesceExpressionForTernaryConditionalCheckDiagnosticAnalyzer.cs (12)
21where TExpressionSyntax : SyntaxNode 58conditionalExpression, out var conditionNode, out var whenTrueNodeHigh, out var whenFalseNodeHigh); 61var whenTrueNodeLow = syntaxFacts.WalkDownParentheses(whenTrueNodeHigh); 62var whenFalseNodeLow = syntaxFacts.WalkDownParentheses(whenFalseNodeHigh); 73syntaxFacts.GetPartsOfBinaryExpression(condition, out var conditionLeftHigh, out var conditionRightHigh); 75var conditionLeftLow = syntaxFacts.WalkDownParentheses(conditionLeftHigh); 76var conditionRightLow = syntaxFacts.WalkDownParentheses(conditionRightHigh); 121var conditionPartToCheck = conditionRightIsNull ? conditionLeftHigh : conditionRightHigh; 122var whenPartToCheck = isEquals ? whenTrueNodeHigh : whenFalseNodeHigh;
src\Analyzers\Core\Analyzers\UseCollectionExpression\CollectionExpressionMatch.cs (1)
19bool UseSpread) where TMatchNode : SyntaxNode;
src\Analyzers\Core\Analyzers\UseCollectionInitializer\AbstractObjectCreationExpressionAnalyzer.cs (5)
24where TExpressionSyntax : SyntaxNode 25where TStatementSyntax : SyntaxNode 28where TVariableDeclaratorSyntax : SyntaxNode 164out var left, out var right);
src\Analyzers\Core\Analyzers\UseCollectionInitializer\AbstractUseCollectionInitializerAnalyzer.cs (18)
30CollectionMatch<SyntaxNode>, TAnalyzer> 31where TExpressionSyntax : SyntaxNode 32where TStatementSyntax : SyntaxNode 38where TVariableDeclaratorSyntax : SyntaxNode 50protected abstract bool IsComplexElementInitializer(SyntaxNode expression); 53ArrayBuilder<CollectionMatch<SyntaxNode>> preMatches, ArrayBuilder<CollectionMatch<SyntaxNode>> postMatches, CancellationToken cancellationToken); 91ArrayBuilder<CollectionMatch<SyntaxNode>> preMatches, ArrayBuilder<CollectionMatch<SyntaxNode>> postMatches, CancellationToken cancellationToken) 96var initializer = this.SyntaxFacts.GetInitializerOfBaseObjectCreationExpression(_objectCreationExpression); 135private CollectionMatch<SyntaxNode>? TryAnalyzeStatement( 143private CollectionMatch<SyntaxNode>? TryAnalyzeStatementForCollectionInitializer( 212this.SyntaxFacts.GetPartsOfAssignmentStatement(statement, out var left, out var right); 224this.SyntaxFacts.GetPartsOfElementAccessExpression(left, out var elementInstance, out var argumentList); 226foreach (var argument in elementAccessArguments) 233var argExpression = this.SyntaxFacts.GetExpressionOfArgument(argument);
src\Analyzers\Core\Analyzers\UseCollectionInitializer\AbstractUseCollectionInitializerDiagnosticAnalyzer.cs (8)
31where TExpressionSyntax : SyntaxNode 32where TStatementSyntax : SyntaxNode 38where TVariableDeclaratorSyntax : SyntaxNode 86ImmutableArray<CollectionMatch<SyntaxNode>> preMatches, 176? ImmutableArray<SyntaxNode>.Empty 201(ImmutableArray<CollectionMatch<SyntaxNode>> matches, bool shouldUseCollectionExpression, bool changesSemantics)? GetCollectionInitializerMatches() 218(ImmutableArray<CollectionMatch<SyntaxNode>> matches, bool shouldUseCollectionExpression, bool changesSemantics)? GetCollectionExpressionMatches() 244ImmutableArray<CollectionMatch<SyntaxNode>> matches,
src\Analyzers\Core\Analyzers\UseCollectionInitializer\IUpdateExpressionSyntaxHelper.cs (2)
12where TExpressionSyntax : SyntaxNode 13where TStatementSyntax : SyntaxNode
src\Analyzers\Core\Analyzers\UseCollectionInitializer\UpdateExpressionState.cs (14)
24where TExpressionSyntax : SyntaxNode 25where TStatementSyntax : SyntaxNode 107SyntaxNode expression, 226var memberAccess = instance.GetRequiredParent(); 275out SeparatedSyntaxList<SyntaxNode> arguments) 290var memberAccess = this.SyntaxFacts.GetExpressionOfInvocationExpression(invocationExpression); 294this.SyntaxFacts.GetPartsOfMemberAccessExpression(memberAccess, out var localInstance, out var memberName); 300foreach (var argument in arguments) 305var argumentExpression = this.SyntaxFacts.GetExpressionOfArgument(argument); 341public CollectionMatch<SyntaxNode>? TryAnalyzeStatementForCollectionExpression( 359CollectionMatch<SyntaxNode>? TryAnalyzeExpressionStatement(TStatementSyntax expressionStatement) 373CollectionMatch<SyntaxNode>? TryAnalyzeForeachStatement(TStatementSyntax foreachStatement) 403CollectionMatch<SyntaxNode>? TryAnalyzeIfStatement(TStatementSyntax ifStatement)
src\Analyzers\Core\Analyzers\UseCollectionInitializer\UseCollectionInitializerHelpers.cs (8)
24CollectionMatch<SyntaxNode> matchInfo) 26var match = matchInfo.Node; 30var expression = syntaxFacts.GetExpressionOfExpressionStatement(match); 46var expression = syntaxFacts.GetExpressionOfForeachStatement(match); 59TStatementSyntax initialStatement) where TStatementSyntax : SyntaxNode 64var containingBlockOrCompilationUnit = initialStatement.GetRequiredParent(); 77var childNode = child.AsNode()!; 78var extractedChild = syntaxFacts.IsGlobalStatement(childNode)
src\Analyzers\Core\Analyzers\UseCompoundAssignment\AbstractUseCompoundAssignmentDiagnosticAnalyzer.cs (6)
20where TAssignmentSyntax : SyntaxNode 21where TBinaryExpressionSyntax : SyntaxNode 88out var assignmentLeft, out var assignmentToken, out var assignmentRight); 112out var binaryLeft, out var binaryRight);
src\Analyzers\Core\Analyzers\UseCompoundAssignment\UseCompoundAssignmentUtilities.cs (7)
41ISyntaxFacts syntaxFacts, SyntaxNode expr, SemanticModel semanticModel, CancellationToken cancellationToken) 47ISyntaxFacts syntaxFacts, SyntaxNode expr, SemanticModel semanticModel, 74out _, out var expression, out _); 82out var subExpr, out _); 90out var expression, out var whenNotNull); 100SyntaxNode expr, SemanticModel semanticModel, bool isTopLevel, CancellationToken cancellationToken)
src\Analyzers\Core\Analyzers\UseConditionalExpression\AbstractUseConditionalExpressionDiagnosticAnalyzer.cs (1)
16where TIfStatementSyntax : SyntaxNode
src\Analyzers\Core\Analyzers\UseConditionalExpression\ForAssignment\AbstractUseConditionalExpressionForAssignmentDiagnosticAnalyzer.cs (1)
14where TIfStatementSyntax : SyntaxNode
src\Analyzers\Core\Analyzers\UseConditionalExpression\ForReturn\AbstractUseConditionalExpressionForReturnDiagnosticAnalyzer.cs (1)
14where TIfStatementSyntax : SyntaxNode
src\Analyzers\Core\Analyzers\UseConditionalExpression\UseConditionalExpressionHelpers.cs (1)
64public static bool HasRegularComments(ISyntaxFacts syntaxFacts, SyntaxNode syntax)
src\Analyzers\Core\Analyzers\UseExplicitTupleName\UseExplicitTupleNameDiagnosticAnalyzer.cs (2)
57var memberAccessSyntax = fieldReferenceOperation.Syntax; 58var nameNode = memberAccessSyntax.ChildNodesAndTokens().Reverse().FirstOrDefault().AsNode();
src\Analyzers\Core\Analyzers\UseIsNullCheck\AbstractUseIsNullForReferenceEqualsDiagnosticAnalyzer.cs (9)
68var invocation = context.Node; 71var expression = syntaxFacts.GetExpressionOfInvocationExpression(invocation); 72var nameNode = syntaxFacts.IsIdentifierName(expression) 148private static ITypeParameterSymbol? GetGenericParameterSymbol(ISyntaxFacts syntaxFacts, SemanticModel semanticModel, SyntaxNode node1, SyntaxNode node2, CancellationToken cancellationToken) 150var valueNode = syntaxFacts.IsNullLiteralExpression(syntaxFacts.GetExpressionOfArgument(node1)) ? node2 : node1; 151var argumentExpression = syntaxFacts.GetExpressionOfArgument(valueNode); 161private static bool MatchesPattern(ISyntaxFacts syntaxFacts, SyntaxNode node1, SyntaxNode node2)
src\Analyzers\Core\Analyzers\UseNullPropagation\AbstractUseNullPropagationDiagnosticAnalyzer.cs (12)
41where TExpressionSyntax : SyntaxNode 42where TStatementSyntax : SyntaxNode 116conditionalExpression, out var condition, out var whenTrue, out var whenFalse); 168syntaxFacts.GetPartsOfMemberAccessExpression(whenPartToCheck, out _, out var name); 245syntaxFacts.GetPartsOfBinaryExpression(condition, out var conditionLeft, out var conditionRight); 265var expression = syntaxFacts.GetExpressionOfInvocationExpression(invocation); 266var nameNode = syntaxFacts.IsIdentifierName(expression) 358syntaxFacts.GetPartsOfCastExpression(node, out var type, out var expression);
src\Analyzers\Core\Analyzers\UseObjectInitializer\AbstractUseObjectInitializerDiagnosticAnalyzer.cs (4)
27where TExpressionSyntax : SyntaxNode 28where TStatementSyntax : SyntaxNode 33where TVariableDeclaratorSyntax : SyntaxNode 119var nodes = ImmutableArray.Create<SyntaxNode>(containingStatement).AddRange(matches.Select(m => m.Statement));
src\Analyzers\Core\Analyzers\UseObjectInitializer\UseNamedMemberInitializerAnalyzer.cs (14)
32where TExpressionSyntax : SyntaxNode 33where TStatementSyntax : SyntaxNode 38where TVariableDeclaratorSyntax : SyntaxNode 76var initializer = this.SyntaxFacts.GetInitializerOfBaseObjectCreationExpression(_objectCreationExpression); 79foreach (var init in this.SyntaxFacts.GetInitializersOfObjectMemberInitializer(initializer)) 83this.SyntaxFacts.GetPartsOfNamedMemberInitializer(init, out var name, out _); 100statement, out var left, out var right); 162var name = this.SyntaxFacts.GetNameOfMemberAccessExpression(leftMemberAccess); 193private bool ImplicitMemberAccessWouldBeAffected(SyntaxNode node) 199if (child.AsNode(out var childNode) && 208var expression = this.SyntaxFacts.GetExpressionOfMemberAccessExpression( 233where TExpressionSyntax : SyntaxNode 234where TStatementSyntax : SyntaxNode
src\Analyzers\Core\Analyzers\UseThrowExpression\AbstractUseThrowExpressionDiagnosticAnalyzer.cs (2)
78var throwStatementSyntax = throwOperation.Syntax; 273var throwStatement = throwOperation.Syntax;
src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (18)
63protected abstract SyntaxNode GetArgumentExpression(SyntaxNode syntaxNode); 64protected abstract SyntaxNode? TryGetMatchingNamedArgument(SeparatedSyntaxList<SyntaxNode> arguments, string searchArgumentName); 92var expression = syntaxFacts.GetExpressionOfInvocationExpression(context.Node); 125var formatStringLiteralExpressionSyntax = TryGetFormatStringLiteralExpressionSyntax( 158private static bool IsValidFormatMethod(ISyntaxFacts syntaxFacts, SyntaxNode expression) 163var nameOfMemberAccessExpression = syntaxFacts.GetNameOfMemberAccessExpression(expression); 182SeparatedSyntaxList<SyntaxNode> arguments, 192SeparatedSyntaxList<SyntaxNode> arguments, 196var argsArgument = TryGetArgument(NameOfArgsParameter, arguments, parameters); 203var expression = syntaxFacts.GetExpressionOfArgument(argsArgument)!; 207protected SyntaxNode? TryGetArgument( 209SeparatedSyntaxList<SyntaxNode> arguments, 213var matchingNamedArgument = TryGetMatchingNamedArgument(arguments, searchArgumentName); 257protected SyntaxNode? TryGetFormatStringLiteralExpressionSyntax( 258SeparatedSyntaxList<SyntaxNode> arguments, 262var formatArgumentSyntax = TryGetArgument(
src\Compilers\Core\Portable\SourceGeneration\GeneratedCodeUtilities.cs (3)
55internal static bool IsGeneratedCode(string? filePath, SyntaxNode root, Func<SyntaxTrivia, bool> isComment) 88private static bool BeginsWithAutoGeneratedComment(SyntaxNode root, Func<SyntaxTrivia, bool> isComment) 120var root = tree.GetRoot(cancellationToken);
src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (2)
22var root = tree.GetRoot(); 25SyntaxNode? node = null;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\AnalysisContextExtensions.cs (10)
150public static SyntaxNode GetAnalysisRoot(this SyntaxTreeAnalysisContext context, bool findInTrivia, bool getInnermostNodeForTie = false) 156public static SyntaxNode GetAnalysisRoot(this SemanticModelAnalysisContext context, bool findInTrivia, bool getInnermostNodeForTie = false) 164public static SyntaxNode GetAnalysisRoot(this SymbolStartAnalysisContext context, bool findInTrivia, bool getInnermostNodeForTie = false) 176public static SyntaxNode GetAnalysisRoot(this SymbolAnalysisContext context, bool findInTrivia, bool getInnermostNodeForTie = false) 186public static SyntaxNode GetAnalysisRoot(this OperationBlockStartAnalysisContext context, IOperation operationBlock, bool findInTrivia, bool getInnermostNodeForTie = false) 192public static SyntaxNode GetAnalysisRoot(this OperationBlockAnalysisContext context, IOperation operationBlock, bool findInTrivia, bool getInnermostNodeForTie = false) 198public static SyntaxNode GetAnalysisRoot(this OperationAnalysisContext context, bool findInTrivia, bool getInnermostNodeForTie = false) 204public static SyntaxNode GetAnalysisRoot(this SyntaxNodeAnalysisContext context, bool findInTrivia, bool getInnermostNodeForTie = false) 210public static SyntaxNode GetAnalysisRoot<TSyntaxKind>(this CodeBlockStartAnalysisContext<TSyntaxKind> context, bool findInTrivia, bool getInnermostNodeForTie = false) where TSyntaxKind : struct 216public static SyntaxNode GetAnalysisRoot(this CodeBlockAnalysisContext context, bool findInTrivia, bool getInnermostNodeForTie = false)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DirectiveInfo.cs (1)
14where TDirectiveTriviaSyntax : SyntaxNode
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\IParameterSymbolExtensions.cs (3)
37var parameterSyntax = parameter.DeclaringSyntaxReferences[0].GetSyntax(cancellationToken); 38var constructorSyntax = constructor.DeclaringSyntaxReferences[0].GetSyntax(cancellationToken); 68var constructorSyntax = constructorReference.GetSyntax(cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (1)
593var declarationSyntax = symbol.DeclaringSyntaxReferences.Select(r => r.GetSyntax()).FirstOrDefault();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\LocationExtensions.cs (3)
22public static SyntaxNode FindNode(this Location location, CancellationToken cancellationToken) 25public static SyntaxNode FindNode(this Location location, bool getInnermostNodeForTie, CancellationToken cancellationToken) 28public static SyntaxNode FindNode(this Location location, bool findInsideTrivia, bool getInnermostNodeForTie, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticEquivalence.cs (8)
17public static bool AreEquivalent(SemanticModel semanticModel, SyntaxNode node1, SyntaxNode node2) 23SyntaxNode node1, 24SyntaxNode node2, 25Func<SyntaxNode, bool> predicate = null) 53SyntaxNode node1, 54SyntaxNode node2, 55Func<SyntaxNode, bool> predicate)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (18)
35public static DataFlowAnalysis AnalyzeRequiredDataFlow(this SemanticModel semanticModel, SyntaxNode statementOrExpression) 38public static DataFlowAnalysis AnalyzeRequiredDataFlow(this SemanticModel semanticModel, SyntaxNode firstStatement, SyntaxNode lastStatement) 41public static ControlFlowAnalysis AnalyzeRequiredControlFlow(this SemanticModel semanticModel, SyntaxNode statement) 44public static ControlFlowAnalysis AnalyzeRequiredControlFlow(this SemanticModel semanticModel, SyntaxNode firstStatement, SyntaxNode lastStatement) 47public static ISymbol GetRequiredDeclaredSymbol(this SemanticModel semanticModel, SyntaxNode declaration, CancellationToken cancellationToken) 53public static IOperation GetRequiredOperation(this SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken) 94this SemanticModel semanticModel, SyntaxNode? container, CancellationToken cancellationToken, Func<SyntaxNode, bool>? descendInto = null) 116this SemanticModel semanticModel, SyntaxNode? container, CancellationToken cancellationToken, Func<SyntaxNode, bool>? filter = null) 128SemanticModel semanticModel, SyntaxNode node, 129HashSet<ISymbol> symbols, CancellationToken cancellationToken, Func<SyntaxNode, bool>? descendInto = null) 140if (child.AsNode(out var childNode) && 147static bool ShouldDescendInto(SyntaxNode node, Func<SyntaxNode, bool>? filter) 233SyntaxNode expression,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (111)
23public static SyntaxNode GetRequiredParent(this SyntaxNode node) 26public static IEnumerable<SyntaxNodeOrToken> DepthFirstTraversal(this SyntaxNode node) 29public static IEnumerable<SyntaxNode> DepthFirstTraversalNodes(this SyntaxNode node) 32public static IEnumerable<SyntaxNode> GetAncestors(this SyntaxNode node) 34var current = node.Parent; 44public static IEnumerable<TNode> GetAncestors<TNode>(this SyntaxNode node) 45where TNode : SyntaxNode 47var current = node.Parent; 59public static TNode? GetAncestor<TNode>(this SyntaxNode node) 60where TNode : SyntaxNode 62var current = node.Parent; 76public static TNode? GetAncestorOrThis<TNode>(this SyntaxNode? node) 77where TNode : SyntaxNode 82public static IEnumerable<TNode> GetAncestorsOrThis<TNode>(this SyntaxNode? node) 83where TNode : SyntaxNode 85var current = node; 97public static bool HasAncestor<TNode>(this SyntaxNode node) 98where TNode : SyntaxNode 104this SyntaxNode node, TextSpan searchSpan, Func<SyntaxNode, bool> predicate) 105where TSyntaxNode : SyntaxNode 109var nodes = new LinkedList<SyntaxNode>(); 114var currentNode = nodes.First!.Value; 129public static bool CheckParent<T>([NotNullWhen(returnValue: true)] this SyntaxNode? node, Func<T, bool> valueChecker) where T : SyntaxNode 145public static bool IsChildNode<TParent>(this SyntaxNode node, Func<TParent, SyntaxNode?> childGetter) 146where TParent : SyntaxNode 154var ancestorNode = childGetter(ancestor); 162public static bool IsFoundUnder<TParent>(this SyntaxNode node, Func<TParent, SyntaxNode?> childGetter) 163where TParent : SyntaxNode 171var child = childGetter(ancestor); 174return node.GetAncestorsOrThis<SyntaxNode>().Contains(child); 177public static SyntaxNode GetCommonRoot(this SyntaxNode node1, SyntaxNode node2) 183using var _ = PooledHashSet<SyntaxNode>.GetInstance(out var set); 184set.AddRange(node2.GetAncestorsOrThis<SyntaxNode>()); 186foreach (var ancestor in node1.AncestorsAndSelf()) 195public static int Width(this SyntaxNode node) 198public static int FullWidth(this SyntaxNode node) 201public static SyntaxNode? FindInnermostCommonNode(this IEnumerable<SyntaxNode> nodes, Func<SyntaxNode, bool> predicate) 204public static SyntaxNode? FindInnermostCommonNode(this IEnumerable<SyntaxNode> nodes) 214using var _1 = ArrayBuilder<SyntaxNode>.GetInstance(out var commonAncestorsStack); 215using var _2 = PooledHashSet<SyntaxNode>.GetInstance(out var commonAncestorsSet); 218foreach (var node in nodes) 239var commonAncestor = FindCommonAncestor(node, commonAncestorsSet); 281static SyntaxNode? FindCommonAncestor(SyntaxNode node, HashSet<SyntaxNode> commonAncestorsSet) 293public static TSyntaxNode? FindInnermostCommonNode<TSyntaxNode>(this IEnumerable<SyntaxNode> nodes) where TSyntaxNode : SyntaxNode 296public static TextSpan GetContainedSpan(this IEnumerable<SyntaxNode> nodes) 302foreach (var node in nodes) 312public static bool OverlapsHiddenPosition(this SyntaxNode node, CancellationToken cancellationToken) 315public static bool OverlapsHiddenPosition(this SyntaxNode node, TextSpan span, CancellationToken cancellationToken) 318public static bool OverlapsHiddenPosition(this SyntaxNode declaration, SyntaxNode startNode, SyntaxNode endNode, CancellationToken cancellationToken) 327public static IEnumerable<T> GetAnnotatedNodes<T>(this SyntaxNode node, SyntaxAnnotation syntaxAnnotation) where T : SyntaxNode 341IEnumerable<SyntaxNode> nodes, 342Func<SyntaxNode, SyntaxNode, CancellationToken, Task<SyntaxNode>> computeReplacementAsync, 343CancellationToken cancellationToken) where TRootNode : SyntaxNode 365CancellationToken cancellationToken) where TRootNode : SyntaxNode 378CancellationToken cancellationToken) where TRoot : SyntaxNode 389IEnumerable<SyntaxNode>? nodes, 390Func<SyntaxNode, SyntaxNode, CancellationToken, Task<SyntaxNode>>? computeReplacementNodeAsync, 396where TRoot : SyntaxNode 403var nodeReplacements = new Dictionary<SyntaxNode, SyntaxNode>(); 441var original = (SyntaxNode?)retryAnnotations.GetAnnotations(currentNode).SingleOrDefault() ?? currentNode; 472if (rewritten != original || !nodeReplacements.TryGetValue(original, out var replaced)) 598SyntaxNode root, 614this SyntaxNode root, 653this SyntaxNode root, 690params SyntaxTrivia[] trivia) where T : SyntaxNode 702SyntaxTriviaList trivia) where T : SyntaxNode 714IEnumerable<SyntaxTrivia> trivia) where T : SyntaxNode 724params SyntaxTrivia[] trivia) where T : SyntaxNode 736SyntaxTriviaList trivia) where T : SyntaxNode 748IEnumerable<SyntaxTrivia> trivia) where T : SyntaxNode 759IEnumerable<SyntaxTrivia> trailingTrivia) where T : SyntaxNode 784public static SyntaxNode FindNode(this SyntaxNode root, TextSpan? span, bool findInTrivia, bool getInnermostNodeForTie) 792public static SyntaxNode? GetParent(this SyntaxNode node, bool ascendOutOfTrivia) 794var parent = node.Parent; 806public static TNode? FirstAncestorOrSelfUntil<TNode>(this SyntaxNode? node, Func<SyntaxNode, bool> predicate) 807where TNode : SyntaxNode 809for (var current = node; current != null; current = current.GetParent(ascendOutOfTrivia: true)) 826SyntaxNode root, 829where TDirectiveTriviaSyntax : SyntaxNode 835where TDirectiveTriviaSyntax : SyntaxNode 855SyntaxNode root, 946public static ValueAncestorsAndSelfEnumerable ValueAncestorsAndSelf(this SyntaxNode syntaxNode, bool ascendOutOfTrivia = true) 949public readonly struct ValueAncestorsAndSelfEnumerable(SyntaxNode syntaxNode, bool ascendOutOfTrivia) 954public struct Enumerator(SyntaxNode syntaxNode, bool ascendOutOfTrivia) 956public SyntaxNode Current { get; private set; } = null!;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeOrTokenExtensions.cs (4)
14public static bool AsNode(this SyntaxNodeOrToken nodeOrToken, [NotNullWhen(true)] out SyntaxNode? node) 44public static IEnumerable<SyntaxNode> DepthFirstTraversalNodes(this SyntaxNodeOrToken node) 48if (t.AsNode(out var childNode)) 60=> nodeOrToken.AsNode(out var node) ? node.WithAppendedTrailingTrivia(trivia) : nodeOrToken.AsToken().WithAppendedTrailingTrivia(trivia);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTokenExtensions.cs (12)
15public static SyntaxNode? GetAncestor(this SyntaxToken token, Func<SyntaxNode, bool>? predicate) 16=> token.GetAncestor<SyntaxNode>(predicate); 18public static T? GetAncestor<T>(this SyntaxToken token, Func<T, bool>? predicate = null) where T : SyntaxNode 21public static T GetRequiredAncestor<T>(this SyntaxToken token, Func<T, bool>? predicate = null) where T : SyntaxNode 25where T : SyntaxNode 32public static IEnumerable<SyntaxNode> GetAncestors(this SyntaxToken token, Func<SyntaxNode, bool> predicate) 39public static SyntaxNode? GetCommonRoot(this SyntaxToken token1, SyntaxToken token2) 53public static bool CheckParent<T>(this SyntaxToken token, Func<T, bool> valueChecker) where T : SyntaxNode 69public static SyntaxToken FindTokenFromEnd(this SyntaxNode root, int position, bool includeZeroWidth = true, bool findInsideTrivia = false) 164public static SyntaxNode GetRequiredParent(this SyntaxToken token)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTreeExtensions.cs (6)
76var root = await syntaxTree.GetRootAsync(cancellationToken).ConfigureAwait(false); 122var root = syntaxTree.GetRoot(cancellationToken); 133var root = syntaxTree.GetRoot(cancellationToken); 170var root = syntaxTree.GetRoot(cancellationToken); 249public static SyntaxNode FindNode(this SyntaxTree syntaxTree, TextSpan? span, bool findInTrivia, bool getInnermostNodeForTie, CancellationToken cancellationToken) 251var root = syntaxTree.GetRoot(cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\AbstractSyntaxFormatting.cs (3)
28protected abstract IFormattingResult CreateAggregatedFormattingResult(SyntaxNode node, IList<AbstractFormattingResult> results, TextSpanMutableIntervalTree? formattingSpans = null); 30protected abstract AbstractFormattingResult Format(SyntaxNode node, SyntaxFormattingOptions options, ImmutableArray<AbstractFormattingRule> rules, SyntaxToken startToken, SyntaxToken endToken, CancellationToken cancellationToken); 32public IFormattingResult GetFormattingResult(SyntaxNode node, IEnumerable<TextSpan>? spans, SyntaxFormattingOptions options, ImmutableArray<AbstractFormattingRule> rules, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (11)
109SyntaxNode root, 136SyntaxNode root, 185SyntaxNode root, List<IndentBlockOperation> list, int position) 229private static IEnumerable<SyntaxNode> GetParentNodes(SyntaxToken token) 231var current = token.Parent; 249var startNode = token.Parent; 252var currentNode = startNode; 278private IndentBlockOperation? GetIndentationDataFor(SyntaxNode root, SyntaxToken token, int position) 280var startNode = token.Parent; 285var currentNode = startNode; 311private static IEnumerable<IndentBlockOperation> GetIndentBlockOperationsFromSmallestSpan(SyntaxNode root, List<IndentBlockOperation> list, int position)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (1)
79var rootNode = this.TreeData.Root;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.InitialContextFinder.cs (7)
28private readonly SyntaxNode _rootNode; 33SyntaxNode rootNode) 70var node = startToken.GetCommonRoot(endToken)!.GetParentWithBiggerSpan(); 71var previous = (SyntaxNode?)null; 145var startNode = token.Parent; 152var currentIndentationNode = startNode;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractAggregatedFormattingResult.cs (7)
19protected readonly SyntaxNode Node; 25private readonly CancellableLazy<SyntaxNode> _lazyNode; 28SyntaxNode node, 40_lazyNode = new CancellableLazy<SyntaxNode>(CreateFormattedRoot); 46protected abstract SyntaxNode Rewriter(Dictionary<ValueTuple<SyntaxToken, SyntaxToken>, TriviaData> changeMap, CancellationToken cancellationToken); 64public SyntaxNode GetFormattedRoot(CancellationToken cancellationToken) 99private SyntaxNode CreateFormattedRoot(CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.cs (6)
40private readonly SyntaxNode _commonRoot; 173foreach (var node in _commonRoot.DescendantNodesAndSelf(this.SpanToFormat)) 189private static void AddOperations<T>(SegmentedList<T> operations, List<T> scratch, SyntaxNode node, Action<List<T>, SyntaxNode> addOperations) 203private static void AddOperations<T>(SegmentedList<T> operations, ArrayBuilder<T> scratch, SyntaxNode node, Action<ArrayBuilder<T>, SyntaxNode> addOperations)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormattingResult.cs (5)
21private readonly CancellableLazy<SyntaxNode> _lazyNode; 38_lazyNode = new CancellableLazy<SyntaxNode>(CreateFormattedRoot); 44protected abstract SyntaxNode Rewriter(Dictionary<ValueTuple<SyntaxToken, SyntaxToken>, TriviaData> map, CancellationToken cancellationToken); 51public SyntaxNode GetFormattedRoot(CancellationToken cancellationToken) 88private SyntaxNode CreateFormattedRoot(CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\ChainedFormattingRules.cs (4)
47public void AddSuppressOperations(ArrayBuilder<SuppressOperation> list, SyntaxNode currentNode) 53public void AddAnchorIndentationOperations(List<AnchorIndentationOperation> list, SyntaxNode currentNode) 59public void AddIndentBlockOperations(List<IndentBlockOperation> list, SyntaxNode currentNode) 65public void AddAlignTokensOperations(List<AlignTokensOperation> list, SyntaxNode currentNode)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TokenData.cs (2)
83var commonRoot = this.Token.GetCommonRoot(other.Token); 100static SyntaxNodeOrToken GetAncestorUnderRoot(SyntaxNodeOrToken start, SyntaxNode root)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.cs (3)
18public static TreeData Create(SyntaxNode root) 39public TreeData(SyntaxNode root) 51public SyntaxNode Root { get; }
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.Debug.cs (1)
12private sealed class Debug(SyntaxNode root, SourceText text) : NodeAndText(root, text)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.Node.cs (1)
15public Node(SyntaxNode root)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.NodeAndText.cs (1)
17public NodeAndText(SyntaxNode root, SourceText text)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.StructuredTrivia.cs (3)
26var root = trivia.GetStructure()!; 50var root = _trivia.GetStructure()!; 56var parent = _trivia.Token.Parent;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (7)
22public static SyntaxNode GetParentWithBiggerSpan(this SyntaxNode node) 268internal static IEnumerable<TextSpan> GetAnnotatedSpans(SyntaxNode node, SyntaxAnnotation annotation) 278static IEnumerable<TextSpan> EnumerateAnnotatedSpans(SyntaxNode node, SyntaxAnnotation annotation) 282var (firstToken, lastToken) = nodeOrToken.AsNode(out var childNode) 342this IndentBlockOperation operation, IHeaderFacts headerFacts, SyntaxNode root, SyntaxToken indentationAnchor) 363if (headerFacts.IsOnIfStatementHeader(root, operation.BaseToken.SpanStart, out var conditionStatement)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\IFormattingResult.cs (1)
18SyntaxNode GetFormattedRoot(CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\ISyntaxFormatting.cs (1)
20IFormattingResult GetFormattingResult(SyntaxNode node, IEnumerable<TextSpan>? spans, SyntaxFormattingOptions options, ImmutableArray<AbstractFormattingRule> rules, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\AbstractFormattingRule.cs (4)
23public virtual void AddSuppressOperations(ArrayBuilder<SuppressOperation> list, SyntaxNode node, in NextSuppressOperationAction nextOperation) 29public virtual void AddAnchorIndentationOperations(List<AnchorIndentationOperation> list, SyntaxNode node, in NextAnchorIndentationOperationAction nextOperation) 35public virtual void AddIndentBlockOperations(List<IndentBlockOperation> list, SyntaxNode node, in NextIndentBlockOperationAction nextOperation) 41public virtual void AddAlignTokensOperations(List<AlignTokensOperation> list, SyntaxNode node, in NextAlignTokensOperationAction nextOperation)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\BaseIndentationFormattingRule.cs (7)
19private readonly SyntaxNode? _commonNode; 22public BaseIndentationFormattingRule(SyntaxNode root, TextSpan span, int baseIndentation, AbstractFormattingRule? vbHelperFormattingRule = null) 31public override void AddIndentBlockOperations(List<IndentBlockOperation> list, SyntaxNode node, in NextIndentBlockOperationAction nextOperation) 54private void AddNextIndentBlockOperations(List<IndentBlockOperation> list, SyntaxNode node, in NextIndentBlockOperationAction nextOperation) 133private static void SetInnermostNodeForSpan(SyntaxNode root, ref TextSpan span, out SyntaxToken token1, out SyntaxToken token2, out SyntaxNode? commonNode) 149private static void GetTokens(SyntaxNode root, TextSpan span, out SyntaxToken token1, out SyntaxToken token2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\CompatAbstractFormattingRule.cs (8)
17public sealed override void AddSuppressOperations(ArrayBuilder<SuppressOperation> list, SyntaxNode node, in NextSuppressOperationAction nextOperation) 25public sealed override void AddAnchorIndentationOperations(List<AnchorIndentationOperation> list, SyntaxNode node, in NextAnchorIndentationOperationAction nextOperation) 33public sealed override void AddIndentBlockOperations(List<IndentBlockOperation> list, SyntaxNode node, in NextIndentBlockOperationAction nextOperation) 41public sealed override void AddAlignTokensOperations(List<AlignTokensOperation> list, SyntaxNode node, in NextAlignTokensOperationAction nextOperation) 72public virtual void AddSuppressOperationsSlow(ArrayBuilder<SuppressOperation> list, SyntaxNode node, ref NextSuppressOperationAction nextOperation) 78public virtual void AddAnchorIndentationOperationsSlow(List<AnchorIndentationOperation> list, SyntaxNode node, ref NextAnchorIndentationOperationAction nextOperation) 84public virtual void AddIndentBlockOperationsSlow(List<IndentBlockOperation> list, SyntaxNode node, ref NextIndentBlockOperationAction nextOperation) 90public virtual void AddAlignTokensOperationsSlow(List<AlignTokensOperation> list, SyntaxNode node, ref NextAlignTokensOperationAction nextOperation)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\NextAlignTokensOperationAction.cs (1)
15SyntaxNode node,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\NextAnchorIndentationOperationAction.cs (1)
15SyntaxNode node,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\NextIndentBlockOperationAction.cs (1)
15SyntaxNode node,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\NextSuppressOperationAction.cs (1)
16SyntaxNode node,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\FormattingOperations.cs (3)
147internal static IEnumerable<AnchorIndentationOperation> GetAnchorIndentationOperations(IEnumerable<AbstractFormattingRule> formattingRules, SyntaxNode node, SyntaxFormattingOptions options) 159internal static IEnumerable<IndentBlockOperation> GetIndentBlockOperations(IEnumerable<AbstractFormattingRule> formattingRules, SyntaxNode node, SyntaxFormattingOptions options) 171internal static IEnumerable<AlignTokensOperation> GetAlignTokensOperations(IEnumerable<AbstractFormattingRule> formattingRules, SyntaxNode node, SyntaxFormattingOptions options)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Helpers\RemoveUnnecessaryImports\AbstractUnnecessaryImportsProvider.cs (4)
18where TSyntaxNode : SyntaxNode 21SemanticModel model, Func<SyntaxNode, bool>? predicate, CancellationToken cancellationToken); 27SemanticModel model, TextSpan? span, Func<SyntaxNode, bool>? predicate, CancellationToken cancellationToken) 32var node = model.SyntaxTree.FindNode(span, findInTrivia: false, getInnermostNodeForTie: false, cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Helpers\RemoveUnnecessaryImports\IUnnecessaryImportsProvider.cs (2)
13where TSyntaxNode : SyntaxNode 20Func<SyntaxNode, bool>? predicate,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Indentation\AbstractIndentation.cs (1)
13where TSyntaxRoot : SyntaxNode, ICompilationUnitSyntax
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\BlockFacts\AbstractBlockFacts.cs (9)
12public abstract bool IsScopeBlock([NotNullWhen(true)] SyntaxNode? node); 13public abstract bool IsExecutableBlock([NotNullWhen(true)] SyntaxNode? node); 14public abstract IReadOnlyList<SyntaxNode> GetExecutableBlockStatements(SyntaxNode? node); 15public abstract SyntaxNode? FindInnermostCommonExecutableBlock(IEnumerable<SyntaxNode> nodes); 16public abstract bool IsStatementContainer([NotNullWhen(true)] SyntaxNode? node); 17public abstract IReadOnlyList<SyntaxNode> GetStatementContainerStatements(SyntaxNode? node);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\BlockFacts\IBlockFacts.cs (9)
22bool IsScopeBlock([NotNullWhen(true)] SyntaxNode? node); 28bool IsExecutableBlock([NotNullWhen(true)] SyntaxNode? node); 30IReadOnlyList<SyntaxNode> GetExecutableBlockStatements(SyntaxNode? node); 31SyntaxNode? FindInnermostCommonExecutableBlock(IEnumerable<SyntaxNode> nodes); 37bool IsStatementContainer([NotNullWhen(true)] SyntaxNode? node); 39IReadOnlyList<SyntaxNode> GetStatementContainerStatements(SyntaxNode? node);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\BlockFacts\IBlockFactsExtensions.cs (3)
13public static SyntaxNode? GetStatementContainer(this IBlockFacts blockFacts, SyntaxNode node) 15for (var current = node; current is not null; current = current.Parent)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\FileBannerFacts\AbstractFileBannerFacts.cs (10)
61public string GetBannerText(SyntaxNode? documentationCommentTriviaSyntax, int bannerLength, CancellationToken cancellationToken) 64public ImmutableArray<SyntaxTrivia> GetLeadingBlankLines(SyntaxNode node) 65=> GetLeadingBlankLines<SyntaxNode>(node); 68where TSyntaxNode : SyntaxNode 75where TSyntaxNode : SyntaxNode 82where TSyntaxNode : SyntaxNode 95where TSyntaxNode : SyntaxNode 103where TSyntaxNode : SyntaxNode 110where TSyntaxNode : SyntaxNode 164public ImmutableArray<SyntaxTrivia> GetFileBanner(SyntaxNode root)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\FileBannerFacts\IFileBannerFacts.cs (8)
12ImmutableArray<SyntaxTrivia> GetFileBanner(SyntaxNode root); 14string GetBannerText(SyntaxNode? documentationCommentTriviaSyntax, int maxBannerLength, CancellationToken cancellationToken); 16ImmutableArray<SyntaxTrivia> GetLeadingBlankLines(SyntaxNode node); 18TSyntaxNode GetNodeWithoutLeadingBlankLines<TSyntaxNode>(TSyntaxNode node) where TSyntaxNode : SyntaxNode; 20TSyntaxNode node, out ImmutableArray<SyntaxTrivia> strippedTrivia) where TSyntaxNode : SyntaxNode; 22ImmutableArray<SyntaxTrivia> GetLeadingBannerAndPreprocessorDirectives<TSyntaxNode>(TSyntaxNode node) where TSyntaxNode : SyntaxNode; 24TSyntaxNode GetNodeWithoutLeadingBannerAndPreprocessorDirectives<TSyntaxNode>(TSyntaxNode node) where TSyntaxNode : SyntaxNode; 25TSyntaxNode GetNodeWithoutLeadingBannerAndPreprocessorDirectives<TSyntaxNode>(TSyntaxNode node, out ImmutableArray<SyntaxTrivia> strippedTrivia) where TSyntaxNode : SyntaxNode;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\FileBannerFacts\IFileBannerFactsExtensions.cs (1)
13this IFileBannerFacts bannerService, SyntaxNode node)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\HeaderFacts\AbstractHeaderFacts.cs (28)
23public abstract bool IsOnTypeHeader(SyntaxNode root, int position, bool fullHeader, [NotNullWhen(true)] out SyntaxNode? typeDeclaration); 24public abstract bool IsOnPropertyDeclarationHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? propertyDeclaration); 25public abstract bool IsOnParameterHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? parameter); 26public abstract bool IsOnMethodHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? method); 27public abstract bool IsOnLocalFunctionHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? localFunction); 28public abstract bool IsOnLocalDeclarationHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? localDeclaration); 29public abstract bool IsOnIfStatementHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? ifStatement); 30public abstract bool IsOnWhileStatementHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? whileStatement); 31public abstract bool IsOnForeachHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? foreachStatement); 33public bool IsOnHeader(SyntaxNode root, int position, SyntaxNode ownerOfHeader, SyntaxNodeOrToken lastTokenOrNodeOfHeader) 34=> IsOnHeader(root, position, ownerOfHeader, lastTokenOrNodeOfHeader, ImmutableArray<SyntaxNode>.Empty); 37SyntaxNode root, 39SyntaxNode ownerOfHeader, 42where THoleSyntax : SyntaxNode 71protected TNode? TryGetAncestorForLocation<TNode>(SyntaxNode root, int position) where TNode : SyntaxNode 89protected int GetStartOfNodeExcludingAttributes(SyntaxNode root, SyntaxNode node)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\HeaderFacts\IHeaderFacts.cs (18)
16bool IsOnTypeHeader(SyntaxNode root, int position, bool fullHeader, [NotNullWhen(true)] out SyntaxNode? typeDeclaration); 18bool IsOnPropertyDeclarationHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? propertyDeclaration); 19bool IsOnParameterHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? parameter); 20bool IsOnMethodHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? method); 21bool IsOnLocalFunctionHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? localFunction); 22bool IsOnLocalDeclarationHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? localDeclaration); 23bool IsOnIfStatementHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? ifStatement); 24bool IsOnWhileStatementHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? whileStatement); 25bool IsOnForeachHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? foreachStatement);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\HeaderFacts\IHeaderFactsExtensions.cs (2)
14public static bool IsOnTypeHeader(this IHeaderFacts headerFacts, SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? typeDeclaration)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\Precedence\IPrecedenceService.cs (4)
23int GetOperatorPrecedence(SyntaxNode expression); 29where TExpressionSyntax : SyntaxNode 32int IPrecedenceService.GetOperatorPrecedence(SyntaxNode expression) 44public static PrecedenceKind GetPrecedenceKind(this IPrecedenceService service, SyntaxNode expression)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SelectedMembers\AbstractSelectedMembers.cs (12)
25where TMemberDeclarationSyntax : SyntaxNode 29where TVariableSyntax : SyntaxNode 32protected abstract ImmutableArray<(SyntaxNode declarator, SyntaxToken identifier)> GetDeclaratorsAndIdentifiers(TMemberDeclarationSyntax member); 34public Task<ImmutableArray<SyntaxNode>> GetSelectedFieldsAndPropertiesAsync( 38public Task<ImmutableArray<SyntaxNode>> GetSelectedMembersAsync( 42private async Task<ImmutableArray<SyntaxNode>> GetSelectedMembersAsync( 47var root = await tree.GetRootAsync(cancellationToken).ConfigureAwait(false); 77private ImmutableArray<SyntaxNode> GetMembersInSpan( 78SyntaxNode root, SourceText text, TextSpan textSpan, 88using var _ = ArrayBuilder<SyntaxNode>.GetInstance(out var selectedMembers); 165SourceText text, SyntaxNode root, SyntaxNode member, int position)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFacts.cs (23)
53bool IsWrittenTo(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 60bool IsOnlyWrittenTo(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 61bool IsInOutContext(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 62bool IsInRefContext(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 63bool IsInInContext(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 65bool CanReplaceWithRValue(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? expression, CancellationToken cancellationToken); 74bool TryGetSpeculativeSemanticModel(SemanticModel oldSemanticModel, SyntaxNode oldNode, SyntaxNode newNode, [NotNullWhen(true)] out SemanticModel? speculativeModel); 81ForEachSymbols GetForEachSymbols(SemanticModel semanticModel, SyntaxNode forEachStatement); 82SymbolInfo GetCollectionInitializerSymbolInfo(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken); 84IMethodSymbol? GetGetAwaiterMethod(SemanticModel semanticModel, SyntaxNode node); 86ImmutableArray<IMethodSymbol> GetDeconstructionAssignmentMethods(SemanticModel semanticModel, SyntaxNode node); 88ImmutableArray<IMethodSymbol> GetDeconstructionForEachMethods(SemanticModel semanticModel, SyntaxNode node); 92IEnumerable<ISymbol> GetDeclaredSymbols(SemanticModel semanticModel, SyntaxNode memberDeclaration, CancellationToken cancellationToken); 94IParameterSymbol? FindParameterForArgument(SemanticModel semanticModel, SyntaxNode argument, bool allowUncertainCandidates, bool allowParams, CancellationToken cancellationToken); 95IParameterSymbol? FindParameterForAttributeArgument(SemanticModel semanticModel, SyntaxNode argument, bool allowUncertainCandidates, bool allowParams, CancellationToken cancellationToken); 97ISymbol? FindFieldOrPropertyForArgument(SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken); 98ISymbol? FindFieldOrPropertyForAttributeArgument(SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken); 100ImmutableArray<ISymbol> GetBestOrAllSymbols(SemanticModel semanticModel, SyntaxNode? node, SyntaxToken token, CancellationToken cancellationToken); 102bool IsInsideNameOfExpression(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 109bool IsInExpressionTree(SemanticModel semanticModel, SyntaxNode node, [NotNullWhen(true)] INamedTypeSymbol? expressionType, CancellationToken cancellationToken); 111string GenerateNameForExpression(SemanticModel semanticModel, SyntaxNode expression, bool capitalize, CancellationToken cancellationToken); 122IPreprocessingSymbol? GetPreprocessingSymbol(SemanticModel semanticModel, SyntaxNode node);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFactsExtensions.cs (5)
18where TBinaryExpressionSyntax : SyntaxNode 46semanticFacts.SyntaxFacts.GetPartsOfBinaryExpression(parentBinary, out var parentBinaryLeft, out var parentBinaryRight); 121public static IParameterSymbol? FindParameterForArgument(this ISemanticFacts semanticFacts, SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken) 124public static IParameterSymbol? FindParameterForAttributeArgument(this ISemanticFacts semanticFacts, SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\AbstractDocumentationCommentService.cs (8)
26where TDocumentationCommentTriviaSyntax : SyntaxNode 27where TXmlNodeSyntax : SyntaxNode 28where TXmlAttributeSyntax : SyntaxNode 29where TCrefSyntax : SyntaxNode 100foreach (var node in summaryElement.ChildNodes()) 106private void HandleNode(SyntaxNode node, StringBuilder sb) 160protected abstract SyntaxNode GetName(TXmlElementSyntax xmlElement); 190public string GetBannerText(SyntaxNode documentationCommentTriviaSyntax, int maxBannerLength, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\IAccessibilityFacts.cs (2)
14bool CanHaveAccessibility(SyntaxNode declaration, bool ignoreDeclarationModifiers = false); 15Accessibility GetAccessibility(SyntaxNode declaration);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\IDocumentationCommentService.cs (1)
13string GetBannerText(SyntaxNode documentationCommentTriviaSyntax, int bannerLength, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFacts.cs (294)
116bool IsPredefinedType([NotNullWhen(true)] SyntaxNode? node); 117bool IsPredefinedType([NotNullWhen(true)] SyntaxNode? node, PredefinedType type); 166bool IsUsingOrExternOrImport([NotNullWhen(true)] SyntaxNode? node); 167bool IsGlobalAssemblyAttribute([NotNullWhen(true)] SyntaxNode? node); 168bool IsGlobalModuleAttribute([NotNullWhen(true)] SyntaxNode? node); 169bool IsDeclaration([NotNullWhen(true)] SyntaxNode? node); 170bool IsTypeDeclaration(SyntaxNode node); 172bool IsUsingAliasDirective([NotNullWhen(true)] SyntaxNode? node); 177bool IsPragmaDirective(SyntaxTrivia trivia, out bool isDisable, out bool isActive, out SeparatedSyntaxList<SyntaxNode> errorCodes); 181bool IsDocumentationComment(SyntaxNode node); 188bool TryGetExternalSourceInfo([NotNullWhen(true)] SyntaxNode? directive, out ExternalSourceInfo info); 190bool IsDeclarationExpression([NotNullWhen(true)] SyntaxNode? node); 192bool IsConversionExpression([NotNullWhen(true)] SyntaxNode? node); 193bool IsCastExpression([NotNullWhen(true)] SyntaxNode? node); 195bool IsExpressionOfForeach([NotNullWhen(true)] SyntaxNode? node); 196SyntaxNode GetExpressionOfForeachStatement(SyntaxNode statement); 198void GetPartsOfTupleExpression<TArgumentSyntax>(SyntaxNode node, 199out SyntaxToken openParen, out SeparatedSyntaxList<TArgumentSyntax> arguments, out SyntaxToken closeParen) where TArgumentSyntax : SyntaxNode; 201bool IsVerbatimInterpolatedStringExpression([NotNullWhen(true)] SyntaxNode? node); 204bool IsLeftSideOfAssignment([NotNullWhen(true)] SyntaxNode? node); 206bool IsAnyAssignmentStatement([NotNullWhen(true)] SyntaxNode? statement); 207bool IsSimpleAssignmentStatement([NotNullWhen(true)] SyntaxNode? statement); 208void GetPartsOfAssignmentStatement(SyntaxNode statement, out SyntaxNode left, out SyntaxToken operatorToken, out SyntaxNode right); 209void GetPartsOfAssignmentExpressionOrStatement(SyntaxNode statement, out SyntaxNode left, out SyntaxToken operatorToken, out SyntaxNode right); 212bool IsLeftSideOfAnyAssignment([NotNullWhen(true)] SyntaxNode? node); 214bool IsLeftSideOfCompoundAssignment([NotNullWhen(true)] SyntaxNode? node); 215SyntaxNode GetRightHandSideOfAssignment(SyntaxNode node); 217bool IsInferredAnonymousObjectMemberDeclarator([NotNullWhen(true)] SyntaxNode? node); 218bool IsOperandOfIncrementExpression([NotNullWhen(true)] SyntaxNode? node); 219bool IsOperandOfIncrementOrDecrementExpression([NotNullWhen(true)] SyntaxNode? node); 221bool IsLeftSideOfDot([NotNullWhen(true)] SyntaxNode? node); 222SyntaxNode? GetRightSideOfDot(SyntaxNode? node); 236SyntaxNode? GetLeftSideOfDot(SyntaxNode? node, bool allowImplicitTarget = false); 238bool IsLeftSideOfExplicitInterfaceSpecifier([NotNullWhen(true)] SyntaxNode? node); 240bool IsNameOfSimpleMemberAccessExpression([NotNullWhen(true)] SyntaxNode? node); 241bool IsNameOfAnyMemberAccessExpression([NotNullWhen(true)] SyntaxNode? node); 242bool IsNameOfMemberBindingExpression([NotNullWhen(true)] SyntaxNode? node); 251SyntaxNode? GetStandaloneExpression(SyntaxNode? node); 260SyntaxNode? GetRootConditionalAccessExpression(SyntaxNode? node); 269SyntaxNode? GetExpressionOfMemberAccessExpression(SyntaxNode node, bool allowImplicitTarget = false); 271SyntaxNode? GetTargetOfMemberBinding(SyntaxNode? node); 273SyntaxNode GetNameOfMemberBindingExpression(SyntaxNode node); 275bool IsPointerMemberAccessExpression([NotNullWhen(true)] SyntaxNode? node); 277bool IsNamedArgument([NotNullWhen(true)] SyntaxNode? node); 278bool IsNameOfNamedArgument([NotNullWhen(true)] SyntaxNode? node); 279SyntaxNode? GetParameterList(SyntaxNode node); 280bool IsParameterList([NotNullWhen(true)] SyntaxNode? node); 284void GetPartsOfElementAccessExpression(SyntaxNode node, out SyntaxNode expression, out SyntaxNode argumentList); 286SyntaxNode GetExpressionOfArgument(SyntaxNode node); 287SyntaxNode GetExpressionOfAttributeArgument(SyntaxNode node); 288SyntaxNode GetExpressionOfInterpolation(SyntaxNode node); 290bool IsElementBindingExpression([NotNullWhen(true)] SyntaxNode? node); 291bool IsMemberBindingExpression([NotNullWhen(true)] SyntaxNode? node); 292bool IsPostfixUnaryExpression([NotNullWhen(true)] SyntaxNode? node); 294SyntaxToken GetIdentifierOfSimpleName(SyntaxNode node); 295SyntaxToken GetIdentifierOfTypeDeclaration(SyntaxNode node); 296SyntaxToken GetIdentifierOfVariableDeclarator(SyntaxNode node); 297SyntaxNode GetTypeOfVariableDeclarator(SyntaxNode node); 303bool IsSimpleArgument([NotNullWhen(true)] SyntaxNode? node); 304bool IsArgument([NotNullWhen(true)] SyntaxNode? node); 305bool IsAttributeArgument([NotNullWhen(true)] SyntaxNode? node); 306RefKind GetRefKindOfArgument(SyntaxNode node); 308void GetNameAndArityOfSimpleName(SyntaxNode node, out string name, out int arity); 309bool LooksGeneric(SyntaxNode simpleName); 311SeparatedSyntaxList<SyntaxNode> GetTypeArgumentsOfGenericName(SyntaxNode? genericName); 313SyntaxList<SyntaxNode> GetContentsOfInterpolatedString(SyntaxNode interpolatedString); 315SeparatedSyntaxList<SyntaxNode> GetArgumentsOfObjectCreationExpression(SyntaxNode node); 316SeparatedSyntaxList<SyntaxNode> GetArgumentsOfArgumentList(SyntaxNode node); 317SeparatedSyntaxList<SyntaxNode> GetArgumentsOfAttributeArgumentList(SyntaxNode node); 319bool IsUsingDirectiveName([NotNullWhen(true)] SyntaxNode? node); 322SyntaxList<SyntaxNode> GetAttributeLists(SyntaxNode? node); 323SeparatedSyntaxList<SyntaxNode> GetAttributesOfAttributeList(SyntaxNode node); 325bool IsAttributeNamedArgumentIdentifier([NotNullWhen(true)] SyntaxNode? node); 326bool IsMemberInitializerNamedAssignmentIdentifier([NotNullWhen(true)] SyntaxNode? node, [NotNullWhen(true)] out SyntaxNode? initializedInstance); 327bool IsAnyInitializerExpression([NotNullWhen(true)] SyntaxNode? node, [NotNullWhen(true)] out SyntaxNode? creationExpression); 329bool IsDirective([NotNullWhen(true)] SyntaxNode? node); 330bool IsStatement([NotNullWhen(true)] SyntaxNode? node); 331bool IsExecutableStatement([NotNullWhen(true)] SyntaxNode? node); 332bool IsGlobalStatement([NotNullWhen(true)] SyntaxNode? node); 333SyntaxNode GetStatementOfGlobalStatement(SyntaxNode node); 334bool AreStatementsInSameContainer(SyntaxNode firstStatement, SyntaxNode secondStatement); 336bool IsDeconstructionAssignment([NotNullWhen(true)] SyntaxNode? node); 337bool IsDeconstructionForEachStatement([NotNullWhen(true)] SyntaxNode? node); 351bool IsMethodBody([NotNullWhen(true)] SyntaxNode? node); 353bool IsDeclaratorOfLocalDeclarationStatement(SyntaxNode declarator, SyntaxNode localDeclarationStatement); 354SeparatedSyntaxList<SyntaxNode> GetVariablesOfLocalDeclarationStatement(SyntaxNode node); 355SyntaxNode? GetInitializerOfVariableDeclarator(SyntaxNode node); 356SyntaxNode? GetInitializerOfPropertyDeclaration(SyntaxNode node); 361bool IsElementAccessExpression([NotNullWhen(true)] SyntaxNode? node); 379bool IsInStaticContext(SyntaxNode node); 380bool IsUnsafeContext(SyntaxNode node); 382bool IsInNamespaceOrTypeContext([NotNullWhen(true)] SyntaxNode? node); 384bool IsBaseTypeList([NotNullWhen(true)] SyntaxNode? node); 386bool IsInConstantContext([NotNullWhen(true)] SyntaxNode? node); 387bool IsInConstructor(SyntaxNode node); 388bool IsMethodLevelMember([NotNullWhen(true)] SyntaxNode? node); 389bool IsTopLevelNodeWithMembers([NotNullWhen(true)] SyntaxNode? node); 392bool AreEquivalent(SyntaxNode? node1, SyntaxNode? node2); 394string GetDisplayName(SyntaxNode? node, DisplayNameOptions options, string? rootNamespace = null); 397SyntaxNode? GetContainingTypeDeclaration(SyntaxNode root, int position); 398SyntaxNode? GetContainingMemberDeclaration(SyntaxNode root, int position, bool useFullSpan = true); 399SyntaxNode? GetContainingMethodDeclaration(SyntaxNode root, int position, bool useFullSpan = true); 400SyntaxNode? GetContainingVariableDeclaratorOfFieldDeclaration(SyntaxNode? node); 404SyntaxNode? ConvertToSingleLine(SyntaxNode? node, bool useElasticTrivia = false); 407PooledObject<List<SyntaxNode>> GetTopLevelAndMethodLevelMembers(SyntaxNode? root); 409PooledObject<List<SyntaxNode>> GetMethodLevelMembers(SyntaxNode? root); 410SyntaxList<SyntaxNode> GetMembersOfTypeDeclaration(SyntaxNode typeDeclaration); 413bool ContainsInMemberBody([NotNullWhen(true)] SyntaxNode? node, TextSpan span); 418/// Given a <see cref="SyntaxNode"/>, return the <see cref="TextSpan"/> representing the span of the member body 424TextSpan GetMemberBodySpanForSpeculativeBinding(SyntaxNode node); 432SyntaxNode? TryGetBindableParent(SyntaxToken token); 435IEnumerable<SyntaxNode> GetConstructors(SyntaxNode? root, CancellationToken cancellationToken); 438/// Given a <see cref="SyntaxNode"/>, that represents and argument return the string representation of 442string GetNameForArgument(SyntaxNode? argument); 445/// Given a <see cref="SyntaxNode"/>, that represents an attribute argument return the string representation of 449string GetNameForAttributeArgument(SyntaxNode? argument); 451bool IsNameOfSubpattern([NotNullWhen(true)] SyntaxNode? node); 452bool IsPropertyPatternClause(SyntaxNode node); 454bool IsAnyPattern([NotNullWhen(true)] SyntaxNode? node); 455bool IsBinaryPattern([NotNullWhen(true)] SyntaxNode? node); 456bool IsUnaryPattern([NotNullWhen(true)] SyntaxNode? node); 458SyntaxNode GetExpressionOfConstantPattern(SyntaxNode node); 459SyntaxNode GetTypeOfTypePattern(SyntaxNode node); 461void GetPartsOfParenthesizedPattern(SyntaxNode node, out SyntaxToken openParen, out SyntaxNode pattern, out SyntaxToken closeParen); 462void GetPartsOfBinaryPattern(SyntaxNode node, out SyntaxNode left, out SyntaxToken operatorToken, out SyntaxNode right); 463void GetPartsOfDeclarationPattern(SyntaxNode node, out SyntaxNode type, out SyntaxNode designation); 464void GetPartsOfRecursivePattern(SyntaxNode node, out SyntaxNode? type, out SyntaxNode? positionalPart, out SyntaxNode? propertyPart, out SyntaxNode? designation); 465void GetPartsOfRelationalPattern(SyntaxNode node, out SyntaxToken operatorToken, out SyntaxNode expression); 466void GetPartsOfUnaryPattern(SyntaxNode node, out SyntaxToken operatorToken, out SyntaxNode pattern); 470SyntaxTokenList GetModifiers(SyntaxNode? node); 474SyntaxNode? WithModifiers(SyntaxNode? node, SyntaxTokenList modifiers); 477Location GetDeconstructionReferenceLocation(SyntaxNode node); 482bool IsParameterNameXmlElementSyntax([NotNullWhen(true)] SyntaxNode? node); 484SyntaxList<SyntaxNode> GetContentFromDocumentationCommentTriviaSyntax(SyntaxTrivia trivia); 490bool IsAnonymousFunctionExpression([NotNullWhen(true)] SyntaxNode? node); 491bool IsBaseNamespaceDeclaration([NotNullWhen(true)] SyntaxNode? node); 492bool IsBinaryExpression([NotNullWhen(true)] SyntaxNode? node); 493bool IsLiteralExpression([NotNullWhen(true)] SyntaxNode? node); 494bool IsMemberAccessExpression([NotNullWhen(true)] SyntaxNode? node); 495bool IsMethodDeclaration([NotNullWhen(true)] SyntaxNode? node); 496bool IsSimpleName([NotNullWhen(true)] SyntaxNode? node); 497bool IsAnyName([NotNullWhen(true)] SyntaxNode? node); 498bool IsAnyType([NotNullWhen(true)] SyntaxNode? node); 500bool IsNamedMemberInitializer([NotNullWhen(true)] SyntaxNode? node); 501bool IsElementAccessInitializer([NotNullWhen(true)] SyntaxNode? node); 503bool IsObjectMemberInitializer([NotNullWhen(true)] SyntaxNode? node); 504bool IsObjectCollectionInitializer([NotNullWhen(true)] SyntaxNode? node); 510void GetPartsOfAnyIsTypeExpression(SyntaxNode node, out SyntaxNode expression, out SyntaxNode type); 511void GetPartsOfArgumentList(SyntaxNode node, out SyntaxToken openParenToken, out SeparatedSyntaxList<SyntaxNode> arguments, out SyntaxToken closeParenToken); 512void GetPartsOfAttribute(SyntaxNode node, out SyntaxNode name, out SyntaxNode? argumentList); 513void GetPartsOfBaseNamespaceDeclaration(SyntaxNode node, out SyntaxNode name, out SyntaxList<SyntaxNode> imports, out SyntaxList<SyntaxNode> members); 514void GetPartsOfBaseObjectCreationExpression(SyntaxNode node, out SyntaxNode? argumentList, out SyntaxNode? initializer); 515void GetPartsOfBinaryExpression(SyntaxNode node, out SyntaxNode left, out SyntaxToken operatorToken, out SyntaxNode right); 516void GetPartsOfCastExpression(SyntaxNode node, out SyntaxNode type, out SyntaxNode expression); 517void GetPartsOfCompilationUnit(SyntaxNode node, out SyntaxList<SyntaxNode> imports, out SyntaxList<SyntaxNode> attributeLists, out SyntaxList<SyntaxNode> members); 518void GetPartsOfConditionalAccessExpression(SyntaxNode node, out SyntaxNode expression, out SyntaxToken operatorToken, out SyntaxNode whenNotNull); 519void GetPartsOfConditionalExpression(SyntaxNode node, out SyntaxNode condition, out SyntaxNode whenTrue, out SyntaxNode whenFalse); 520void GetPartsOfGenericName(SyntaxNode node, out SyntaxToken identifier, out SeparatedSyntaxList<SyntaxNode> typeArguments); 521void GetPartsOfInterpolationExpression(SyntaxNode node, out SyntaxToken stringStartToken, out SyntaxList<SyntaxNode> contents, out SyntaxToken stringEndToken); 522void GetPartsOfInvocationExpression(SyntaxNode node, out SyntaxNode expression, out SyntaxNode? argumentList); 523void GetPartsOfIsPatternExpression(SyntaxNode node, out SyntaxNode left, out SyntaxToken isToken, out SyntaxNode right); 524void GetPartsOfMemberAccessExpression(SyntaxNode node, out SyntaxNode expression, out SyntaxToken operatorToken, out SyntaxNode name); 525void GetPartsOfNamedMemberInitializer(SyntaxNode node, out SyntaxNode name, out SyntaxNode expression); 526void GetPartsOfObjectCreationExpression(SyntaxNode node, out SyntaxToken keyword, out SyntaxNode type, out SyntaxNode? argumentList, out SyntaxNode? initializer); 527void GetPartsOfImplicitObjectCreationExpression(SyntaxNode node, out SyntaxToken keyword, out SyntaxNode argumentList, out SyntaxNode? initializer); 528void GetPartsOfParameter(SyntaxNode node, out SyntaxToken identifier, out SyntaxNode? @default); 529void GetPartsOfParenthesizedExpression(SyntaxNode node, out SyntaxToken openParen, out SyntaxNode expression, out SyntaxToken closeParen); 530void GetPartsOfPrefixUnaryExpression(SyntaxNode node, out SyntaxToken operatorToken, out SyntaxNode operand); 531void GetPartsOfQualifiedName(SyntaxNode node, out SyntaxNode left, out SyntaxToken dotToken, out SyntaxNode right); 532void GetPartsOfUsingAliasDirective(SyntaxNode node, out SyntaxToken globalKeyword, out SyntaxToken alias, out SyntaxNode name); 542SyntaxNode GetArgumentListOfImplicitElementAccess(SyntaxNode node); 544SyntaxNode GetExpressionOfAwaitExpression(SyntaxNode node); 545SyntaxNode GetExpressionOfExpressionStatement(SyntaxNode node); 546SyntaxNode GetExpressionOfRefExpression(SyntaxNode node); 547SyntaxNode? GetExpressionOfReturnStatement(SyntaxNode node); 548SyntaxNode GetExpressionOfThrowExpression(SyntaxNode node); 549SyntaxNode? GetExpressionOfThrowStatement(SyntaxNode node); 551bool IsEqualsValueOfPropertyDeclaration([NotNullWhen(true)] SyntaxNode? node); 552SyntaxNode GetValueOfEqualsValueClause(SyntaxNode node); 554SeparatedSyntaxList<SyntaxNode> GetInitializersOfObjectMemberInitializer(SyntaxNode node); 555SeparatedSyntaxList<SyntaxNode> GetExpressionsOfObjectCollectionInitializer(SyntaxNode node); 557SyntaxToken GetTokenOfLiteralExpression(SyntaxNode node);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFactsExtensions.cs (199)
23public static bool IsMemberInitializerNamedAssignmentIdentifier(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 26public static bool IsOnSingleLine(this ISyntaxFacts syntaxFacts, SyntaxNode node, bool fullSpan) 62var currentNode = currentNodeOrToken.AsNode()!; 160this ISyntaxFacts syntaxFacts, ImmutableArray<SyntaxNode> nodes, CancellationToken cancellationToken) 166foreach (var node in nodes) 178public static bool ContainsInterleavedDirective(this ISyntaxFacts syntaxFacts, SyntaxNode node, CancellationToken cancellationToken) 182this ISyntaxFacts syntaxFacts, TextSpan span, SyntaxNode node, CancellationToken cancellationToken) 193public static bool SpansPreprocessorDirective(this ISyntaxFacts syntaxFacts, IEnumerable<SyntaxNode> nodes) 286public static SyntaxNode? WalkDownParentheses(this ISyntaxFacts syntaxFacts, SyntaxNode? node) 290syntaxFacts.GetPartsOfParenthesizedExpression(node, out _, out var child, out _); 298public static SyntaxNode? WalkUpParentheses(this ISyntaxFacts syntaxFacts, SyntaxNode? node) 307this ISyntaxFacts syntaxFacts, SyntaxNode statement, 308out SyntaxNode left, out SyntaxNode right) 313public static SyntaxNode GetExpressionOfInvocationExpression( 314this ISyntaxFacts syntaxFacts, SyntaxNode node) 316syntaxFacts.GetPartsOfInvocationExpression(node, out var expression, out _); 320public static SyntaxNode Unparenthesize( 321this ISyntaxFacts syntaxFacts, SyntaxNode node) 324SyntaxNode operand; 348var resultNode = operand 383public static bool SpansPreprocessorDirective(this ISyntaxFacts service, SyntaxNode node) 386public static bool SpansPreprocessorDirective(this ISyntaxFacts service, params SyntaxNode[] nodes) 387=> service.SpansPreprocessorDirective((IEnumerable<SyntaxNode>)nodes); 392public static void GetPartsOfBinaryExpression(this ISyntaxFacts syntaxFacts, SyntaxNode node, out SyntaxNode left, out SyntaxNode right) 395public static SyntaxNode GetPatternOfParenthesizedPattern(this ISyntaxFacts syntaxFacts, SyntaxNode node) 397syntaxFacts.GetPartsOfParenthesizedPattern(node, out _, out var pattern, out _); 401public static SyntaxToken GetOperatorTokenOfBinaryExpression(this ISyntaxFacts syntaxFacts, SyntaxNode node) 407public static bool IsAnonymousOrLocalFunction(this ISyntaxFacts syntaxFacts, SyntaxNode node) 411public static SyntaxNode? GetExpressionOfElementAccessExpression(this ISyntaxFacts syntaxFacts, SyntaxNode node) 413syntaxFacts.GetPartsOfElementAccessExpression(node, out var expression, out _); 417public static SyntaxNode? GetArgumentListOfElementAccessExpression(this ISyntaxFacts syntaxFacts, SyntaxNode node) 419syntaxFacts.GetPartsOfElementAccessExpression(node, out _, out var argumentList); 423public static SyntaxNode GetExpressionOfConditionalAccessExpression(this ISyntaxFacts syntaxFacts, SyntaxNode node) 425syntaxFacts.GetPartsOfConditionalAccessExpression(node, out var expression, out _); 429public static SyntaxToken GetOperatorTokenOfMemberAccessExpression(this ISyntaxFacts syntaxFacts, SyntaxNode node) 435public static void GetPartsOfMemberAccessExpression(this ISyntaxFacts syntaxFacts, SyntaxNode node, out SyntaxNode expression, out SyntaxNode name) 438public static void GetPartsOfConditionalAccessExpression(this ISyntaxFacts syntaxFacts, SyntaxNode node, out SyntaxNode expression, out SyntaxNode whenNotNull) 441public static TextSpan GetSpanWithoutAttributes(this ISyntaxFacts syntaxFacts, SyntaxNode root, SyntaxNode node) 468/// Similar to <see cref="ISyntaxFacts.GetStandaloneExpression(SyntaxNode)"/>, this gets the containing 478public static SyntaxNode GetRootStandaloneExpression(this ISyntaxFacts syntaxFacts, SyntaxNode node) 481var standalone = syntaxFacts.GetStandaloneExpression(node); 489public static SyntaxNode? GetArgumentListOfInvocationExpression(this ISyntaxFacts syntaxFacts, SyntaxNode node) 491syntaxFacts.GetPartsOfInvocationExpression(node, out _, out var argumentList); 495public static SeparatedSyntaxList<SyntaxNode> GetArgumentsOfInvocationExpression(this ISyntaxFacts syntaxFacts, SyntaxNode node) 497var argumentList = syntaxFacts.GetArgumentListOfInvocationExpression(node); 501public static SyntaxNode? GetArgumentListOfBaseObjectCreationExpression(this ISyntaxFacts syntaxFacts, SyntaxNode node) 503syntaxFacts.GetPartsOfBaseObjectCreationExpression(node, out var argumentList, out _); 507public static SyntaxNode? GetDefaultOfParameter(this ISyntaxFacts syntaxFacts, SyntaxNode node) 509syntaxFacts.GetPartsOfParameter(node, out _, out var @default); 513public static SyntaxNode GetExpressionOfParenthesizedExpression(this ISyntaxFacts syntaxFacts, SyntaxNode node) 515syntaxFacts.GetPartsOfParenthesizedExpression(node, out _, out var expression, out _); 519public static SyntaxToken GetIdentifierOfGenericName(this ISyntaxFacts syntaxFacts, SyntaxNode node) 525public static SyntaxToken GetIdentifierOfIdentifierName(this ISyntaxFacts syntaxFacts, SyntaxNode node) 528public static SyntaxToken GetIdentifierOfParameter(this ISyntaxFacts syntaxFacts, SyntaxNode node) 534public static SyntaxList<SyntaxNode> GetImportsOfBaseNamespaceDeclaration(this ISyntaxFacts syntaxFacts, SyntaxNode node) 540public static SyntaxList<SyntaxNode> GetImportsOfCompilationUnit(this ISyntaxFacts syntaxFacts, SyntaxNode node) 546public static SyntaxNode? GetInitializerOfBaseObjectCreationExpression(this ISyntaxFacts syntaxFacts, SyntaxNode node) 548syntaxFacts.GetPartsOfBaseObjectCreationExpression(node, out _, out var initializer); 552public static SyntaxList<SyntaxNode> GetMembersOfBaseNamespaceDeclaration(this ISyntaxFacts syntaxFacts, SyntaxNode node) 558public static SyntaxList<SyntaxNode> GetMembersOfCompilationUnit(this ISyntaxFacts syntaxFacts, SyntaxNode node) 564public static SyntaxNode GetNameOfAttribute(this ISyntaxFacts syntaxFacts, SyntaxNode node) 566syntaxFacts.GetPartsOfAttribute(node, out var name, out _); 570public static SyntaxNode GetNameOfBaseNamespaceDeclaration(this ISyntaxFacts syntaxFacts, SyntaxNode node) 572syntaxFacts.GetPartsOfBaseNamespaceDeclaration(node, out var name, out _, out _); 576public static SyntaxNode GetNameOfMemberAccessExpression(this ISyntaxFacts syntaxFacts, SyntaxNode node) 578syntaxFacts.GetPartsOfMemberAccessExpression(node, out _, out var name); 582public static SyntaxNode GetOperandOfPrefixUnaryExpression(this ISyntaxFacts syntaxFacts, SyntaxNode node) 584syntaxFacts.GetPartsOfPrefixUnaryExpression(node, out _, out var operand); 588public static SyntaxToken GetOperatorTokenOfPrefixUnaryExpression(this ISyntaxFacts syntaxFacts, SyntaxNode node) 594public static SeparatedSyntaxList<SyntaxNode> GetTypeArgumentsOfGenericName(this ISyntaxFacts syntaxFacts, SyntaxNode node) 600public static SyntaxNode GetTypeOfObjectCreationExpression(this ISyntaxFacts syntaxFacts, SyntaxNode node) 602syntaxFacts.GetPartsOfObjectCreationExpression(node, out _, out var type, out _, out _); 610public static bool IsExpressionOfAwaitExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 612var parent = node?.Parent; 619public static bool IsExpressionOfInvocationExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 621var parent = node?.Parent; 625syntaxFacts.GetPartsOfInvocationExpression(parent, out var expression, out _); 629public static bool IsExpressionOfMemberAccessExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 631var parent = node?.Parent; 635syntaxFacts.GetPartsOfMemberAccessExpression(parent, out var expression, out _); 639public static bool IsNameOfAttribute(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 644syntaxFacts.GetPartsOfAttribute(node.Parent, out var name, out _); 648public static bool IsRightOfQualifiedName(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 650var parent = node?.Parent; 654syntaxFacts.GetPartsOfQualifiedName(parent, out _, out _, out var right); 658public static bool IsTypeOfObjectCreationExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 660var parent = node?.Parent; 664syntaxFacts.GetPartsOfObjectCreationExpression(parent, out _, out var type, out _, out _); 695public static bool IsSkippedTokensTrivia(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 735public static bool IsGenericName(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 738public static bool IsIdentifierName(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 741public static bool IsQualifiedName(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 748public static bool IsTupleType(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 755public static bool IsCharacterLiteralExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 758public static bool IsDefaultLiteralExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 761public static bool IsFalseLiteralExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 764public static bool IsNumericLiteralExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 767public static bool IsNullLiteralExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 770public static bool IsStringLiteralExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 773public static bool IsTrueLiteralExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 780public static bool IsArrayCreationExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 783public static bool IsAwaitExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 786public static bool IsBaseExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 789public static bool IsConditionalExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 792public static bool IsConditionalAccessExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 795public static bool IsImplicitArrayCreationExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 798public static bool IsImplicitObjectCreationExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 801public static bool IsIndexExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 804public static bool IsInterpolatedStringExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 807public static bool IsInterpolation(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 810public static bool IsInterpolatedStringText(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 813public static bool IsInvocationExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 816public static bool IsIsTypeExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 819public static bool IsIsNotTypeExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 822public static bool IsIsPatternExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 825public static bool IsLogicalAndExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 828public static bool IsLogicalOrExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 831public static bool IsLogicalNotExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 834public static bool IsObjectCreationExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 837public static bool IsParenthesizedExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 840public static bool IsQueryExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 843public static bool IsRangeExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 846public static bool IsRefExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 849public static bool IsSimpleMemberAccessExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 852public static bool IsThisExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 855public static bool IsThrowExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 858public static bool IsTupleExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 861public static bool ContainsGlobalStatement(this ISyntaxFacts syntaxFacts, SyntaxNode node) 868public static bool IsAndPattern(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 871public static bool IsConstantPattern(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 874public static bool IsDeclarationPattern(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 877public static bool IsListPattern(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 880public static bool IsNotPattern(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 883public static bool IsOrPattern(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 886public static bool IsParenthesizedPattern(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 889public static bool IsRecursivePattern(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 892public static bool IsRelationalPattern(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 895public static bool IsTypePattern(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 898public static bool IsVarPattern(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 905public static bool IsExpressionStatement(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 908public static bool IsForEachStatement(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 911public static bool IsForStatement(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 914public static bool IsIfStatement(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 917public static bool IsLocalDeclarationStatement(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 920public static bool IsLocalFunctionStatement(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 923public static bool IsLockStatement(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 926public static bool IsReturnStatement(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 929public static bool IsThrowStatement(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 932public static bool IsUsingStatement(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 935public static bool IsWhileStatement(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 938public static bool IsYieldReturnStatement(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 945public static bool IsAttribute(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 948public static bool IsClassDeclaration(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 951public static bool IsConstructorDeclaration(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 954public static bool IsEnumDeclaration(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 957public static bool IsGlobalAttribute(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 960public static bool IsInterfaceDeclaration(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 963public static bool IsParameter(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 966public static bool IsTypeConstraint(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 969public static bool IsVariableDeclarator(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 972public static bool IsFieldDeclaration(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 975public static bool IsPropertyDeclaration(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 978public static bool IsStructDeclaration(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 981public static bool IsTypeArgumentList(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 988public static bool IsElseClause(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 990public static bool IsEqualsValueClause(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 997public static bool IsImplicitElementAccess(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 1000public static bool IsIndexerMemberCref(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AliasSymbolKey.cs (2)
59SemanticModel semanticModel, SyntaxNode syntaxNode, string name, ISymbol target, 84if (child.AsNode(out var childNode))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AnonymousFunctionOrDelegateSymbolKey.cs (1)
55var node = root.FindNode(location.SourceSpan, getInnermostNodeForTie: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.BodyLevelSymbolKey.cs (6)
83var containerDeclaration = TryGetContainerDeclaration(container, syntaxTree, cancellationToken); 101private static SyntaxNode? TryGetContainerDeclaration(ISymbol container, SyntaxTree? syntaxTree, CancellationToken cancellationToken) 183var containerDeclaration = GetContainerDeclaration(firstSourceTree); 203SyntaxNode? GetContainerDeclaration(SyntaxTree? syntaxTree) 256SemanticModel semanticModel, SyntaxNode containerDeclaration, SymbolKind kind, string localName, CancellationToken cancellationToken) 262foreach (var node in containerDeclaration.DescendantNodes())
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (1)
727var node = location.FindNode(findInsideTrivia: true, getInnermostNodeForTie: true, CancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (39)
35where TExpressionSyntax : SyntaxNode 37where TAttributeSyntax : SyntaxNode 38where TArgumentSyntax : SyntaxNode 39where TForEachStatementSyntax : SyntaxNode 40where TThrowStatementSyntax : SyntaxNode 49private SyntaxNode? _lazySemanticRootOfOriginalExpression; 51private SyntaxNode? _lazySemanticRootOfReplacedExpression; 97protected abstract SyntaxNode GetSemanticRootForSpeculation(TExpressionSyntax expression); 98protected abstract SemanticModel CreateSpeculativeSemanticModel(SyntaxNode originalNode, SyntaxNode nodeToSpeculate, SemanticModel semanticModel); 101protected abstract bool ExpressionMightReferenceMember([NotNullWhen(true)] SyntaxNode? node); 116protected abstract bool ReplacementChangesSemanticsForNodeLanguageSpecific(SyntaxNode currentOriginalNode, SyntaxNode currentReplacedNode, SyntaxNode? previousOriginalNode, SyntaxNode? previousReplacedNode); 118protected abstract bool IsParenthesizedExpression([NotNullWhen(true)] SyntaxNode? node); 130SyntaxNode ISpeculationAnalyzer.OriginalExpression => OriginalExpression; 137public SyntaxNode SemanticRootOfOriginalExpression 170SyntaxNode ISpeculationAnalyzer.ReplacedExpression => ReplacedExpression; 177public SyntaxNode SemanticRootOfReplacedExpression 200protected virtual SyntaxNode GetSemanticRootOfReplacedExpression(SyntaxNode semanticRootOfOriginalExpression, TExpressionSyntax annotatedReplacedExpression) 223protected abstract void ValidateSpeculativeSemanticModel(SemanticModel speculativeSemanticModel, SyntaxNode nodeToSpeculate); 230var nodeToSpeculate = this.SemanticRootOfReplacedExpression; 316protected bool SymbolsAreCompatible(SyntaxNode originalNode, SyntaxNode newNode, bool requireNonNullSymbols = false) 518protected bool ReplacementChangesSemantics(SyntaxNode currentOriginalNode, SyntaxNode currentReplacedNode, SyntaxNode originalRoot, bool skipVerificationForCurrentNode) 526SyntaxNode? previousOriginalNode = null, previousReplacedNode = null; 571private bool ReplacementChangesSemanticsForNode(SyntaxNode currentOriginalNode, SyntaxNode currentReplacedNode, SyntaxNode? previousOriginalNode, SyntaxNode? previousReplacedNode) 688var originalExpressionOfMemberAccess = syntaxFacts.GetExpressionOfMemberAccessExpression(originalExpression); 731private bool ReplacementBreaksSystemObjectMethodResolution(SyntaxNode currentOriginalNode, SyntaxNode currentReplacedNode, [NotNullWhen(true)] SyntaxNode? previousOriginalNode, [NotNullWhen(true)] SyntaxNode? previousReplacedNode)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AnnotationTable.cs (17)
75public TSyntaxNode WithAdditionalAnnotations<TSyntaxNode>(TSyntaxNode node, params TAnnotation[] annotations) where TSyntaxNode : SyntaxNode 87public TSyntaxNode WithoutAnnotations<TSyntaxNode>(TSyntaxNode node, params TAnnotation[] annotations) where TSyntaxNode : SyntaxNode 111public IEnumerable<TAnnotation> GetAnnotations(SyntaxNode node) 123public IEnumerable<TSpecificAnnotation> GetAnnotations<TSpecificAnnotation>(SyntaxNode node) where TSpecificAnnotation : TAnnotation 135public bool HasAnnotations(SyntaxNode node) 147public bool HasAnnotations<TSpecificAnnotation>(SyntaxNode node) where TSpecificAnnotation : TAnnotation 159public bool HasAnnotation(SyntaxNode node, TAnnotation annotation) 171public IEnumerable<SyntaxNodeOrToken> GetAnnotatedNodesAndTokens(SyntaxNode node) 174public IEnumerable<SyntaxNode> GetAnnotatedNodes(SyntaxNode node) 177public IEnumerable<SyntaxToken> GetAnnotatedTokens(SyntaxNode node) 180public IEnumerable<SyntaxTrivia> GetAnnotatedTrivia(SyntaxNode node) 183public IEnumerable<SyntaxNodeOrToken> GetAnnotatedNodesAndTokens<TSpecificAnnotation>(SyntaxNode node) where TSpecificAnnotation : TAnnotation 186public IEnumerable<SyntaxNode> GetAnnotatedNodes<TSpecificAnnotation>(SyntaxNode node) where TSpecificAnnotation : TAnnotation 189public IEnumerable<SyntaxToken> GetAnnotatedTokens<TSpecificAnnotation>(SyntaxNode node) where TSpecificAnnotation : TAnnotation 192public IEnumerable<SyntaxTrivia> GetAnnotatedTrivia<TSpecificAnnotation>(SyntaxNode node) where TSpecificAnnotation : TAnnotation
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (8)
46public static IEnumerable<(SyntaxToken, SyntaxToken)> ConvertToTokenPairs(this SyntaxNode root, IReadOnlyList<TextSpan> spans) 82public static ValueTuple<SyntaxToken, SyntaxToken> ConvertToTokenPair(this SyntaxNode root, TextSpan textSpan) 128public static bool IsInvalidTokenRange(this SyntaxNode root, SyntaxToken startToken, SyntaxToken endToken) 279var parentNode = GetParentThatContainsGivenSpan(token.Parent, backwardPosition, forward: false); 310var parentNode = GetParentThatContainsGivenSpan(token.Parent, forwardPosition, forward: true); 321private static SyntaxNode? GetParentThatContainsGivenSpan(SyntaxNode? node, int position, bool forward) 358public static TextSpan GetFormattingSpan(SyntaxNode root, TextSpan span)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\ISpeculationAnalyzer.cs (2)
13SyntaxNode OriginalExpression { get; } 19SyntaxNode ReplacedExpression { get; }
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SyntaxPath.cs (5)
56var parent = nodeOrToken.Parent; 91public bool TryResolve(SyntaxNode? root, out SyntaxNodeOrToken nodeOrToken) 137where TNode : SyntaxNode 142public bool TryResolve<TNode>(SyntaxNode? root, [NotNullWhen(true)] out TNode? node) 143where TNode : SyntaxNode
Microsoft.CodeAnalysis.CodeStyle.Fixes (1294)
LanguageServices\SemanticModelWorkspaceService\SemanticModelWorkspaceServiceFactory.SemanticModelWorkspaceService.cs (1)
20public ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(Document document, SyntaxNode node, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\AddAccessibilityModifiers\AbstractAddAccessibilityModifiersCodeFixProvider.cs (3)
21protected abstract SyntaxNode MapToDeclarator(SyntaxNode declaration); 52var declarator = MapToDeclarator(declaration);
src\Analyzers\Core\CodeFixes\AddAccessibilityModifiers\AddAccessibilityModifiersHelpers.cs (3)
15SyntaxEditor editor, ISymbol symbol, SyntaxNode declaration) 29SyntaxNode UpdateAccessibility(SyntaxNode declaration, Accessibility preferredAccessibility)
src\Analyzers\Core\CodeFixes\AddAnonymousTypeMemberName\AbstractAddAnonymousTypeMemberNameCodeFixProvider.cs (5)
24where TExpressionSyntax : SyntaxNode 25where TAnonymousObjectInitializer : SyntaxNode 26where TAnonymousObjectMemberDeclaratorSyntax : SyntaxNode 57var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 126var anonymousType = current.Parent;
src\Analyzers\Core\CodeFixes\AddExplicitCast\AbstractAddExplicitCastCodeFixProvider.cs (13)
22where TExpressionSyntax : SyntaxNode 31protected abstract void GetPartsOfCastOrConversionExpression(TExpressionSyntax expression, out SyntaxNode type, out TExpressionSyntax castedExpression); 49Document document, SemanticModel semanticModel, SyntaxNode root, 61Document document, SemanticModel semanticModel, SyntaxNode root, 72var root = await document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 116private (SyntaxNode finalTarget, SyntaxNode finalReplacement) ApplyFix( 136(SyntaxNode finalTarget, SyntaxNode finalReplacement) ApplyFixWorker() 141GetPartsOfCastOrConversionExpression(targetNode, out var castTypeNode, out var castedExpression); 161protected virtual (SyntaxNode finalTarget, SyntaxNode finalReplacement) Cast(SemanticModel semanticModel, TExpressionSyntax targetNode, ITypeSymbol conversionType) 218var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\AddExplicitCast\Fixer.cs (8)
19where TArgumentSyntax : SyntaxNode 20where TArgumentListSyntax : SyntaxNode 21where TInvocationSyntax : SyntaxNode 41SyntaxNode root, 111SyntaxNode root, 205SyntaxNode root, 208SyntaxNode targetNode) 210var newRoot = root.ReplaceNode(oldArgumentList, GenerateNewArgumentList(oldArgumentList, newArguments));
src\Analyzers\Core\CodeFixes\AddExplicitCast\InheritanceDistanceComparer.cs (1)
35where TExpressionSyntax : SyntaxNode
src\Analyzers\Core\CodeFixes\AddObsoleteAttribute\AbstractAddObsoleteAttributeCodeFixProvider.cs (6)
44var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 48var container = GetContainer(root, node); 65private SyntaxNode? GetContainer(SyntaxNode root, SyntaxNode node) 80var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (14)
29where TArgumentSyntax : SyntaxNode 30where TArgumentListSyntax : SyntaxNode 31where TAttributeArgumentListSyntax : SyntaxNode 32where TInvocationExpressionSyntax : SyntaxNode 33where TObjectCreationExpressionSyntax : SyntaxNode 38protected abstract ITypeSymbol GetArgumentType(SyntaxNode argumentNode, SemanticModel semanticModel, CancellationToken cancellationToken); 48SyntaxNode node, 58var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 60var initialNode = root.FindNode(diagnostic.Location.SourceSpan); 64for (var node = initialNode; node != null; node = node.Parent) 99SyntaxNode initialNode, SyntaxNode node, Diagnostic diagnostic) 118SyntaxNode node, 139SyntaxNode node,
src\Analyzers\Core\CodeFixes\AddParameter\AddParameterService.cs (3)
123var argumentInitializer = parameterMustBeOptional ? generator.DefaultExpression(newParameterType) : null; 124var parameterDeclaration = generator.ParameterDeclaration(parameterSymbol, argumentInitializer) 140var newRoot = editor.GetChangedRoot();
src\Analyzers\Core\CodeFixes\AddParameter\ArgumentInsertPositionData.cs (1)
7internal readonly struct ArgumentInsertPositionData<TArgumentSyntax>(IMethodSymbol methodToUpdate, TArgumentSyntax argumentToInsert, int argumentInsertionIndex) where TArgumentSyntax : SyntaxNode
src\Analyzers\Core\CodeFixes\AddParameter\RegisterFixData.cs (1)
10where TArgumentSyntax : SyntaxNode
src\Analyzers\Core\CodeFixes\AliasAmbiguousType\AbstractAliasAmbiguousTypeCodeFixProvider.cs (4)
35var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 38var diagnosticNode = root.FindNode(context.Span, getInnermostNodeForTie: true); 63var aliasDirective = syntaxGenerator.AliasImportDeclaration(typeName, symbol); 64var newRoot = addImportService.AddImport(compilation, root, diagnosticNode, aliasDirective, syntaxGenerator, placementOption, cancellationToken);
src\Analyzers\Core\CodeFixes\ConflictMarkerResolution\AbstractConflictMarkerCodeFixProvider.cs (3)
73var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 84SyntaxNode root, SourceText text, int position, 405var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\ConvertToAsync\AbstractConvertToAsyncCodeFixProvider.cs (10)
20protected abstract Task<string> GetDescriptionAsync(Diagnostic diagnostic, SyntaxNode node, SemanticModel semanticModel, CancellationToken cancellationToken); 21protected abstract Task<Tuple<SyntaxTree, SyntaxNode>> GetRootInOtherSyntaxTreeAsync(SyntaxNode node, SemanticModel semanticModel, Diagnostic diagnostic, CancellationToken cancellationToken); 32var root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 33if (!TryGetNode(root, context.Span, out var node)) 48private static bool TryGetNode(SyntaxNode root, TextSpan span, out SyntaxNode node) 51var ancestors = root.FindToken(span.Start).GetAncestors<SyntaxNode>(); 62SyntaxNode node, Document document, Diagnostic diagnostic, CancellationToken cancellationToken) 71var newRoot = result.Item2;
src\Analyzers\Core\CodeFixes\ConvertTypeOfToNameOf\AbstractConvertTypeOfToNameOfCodeFixProvider.cs (4)
18where TMemberAccessExpressionSyntax : SyntaxNode 22protected abstract SyntaxNode GetSymbolTypeExpression(SemanticModel model, TMemberAccessExpressionSyntax node, CancellationToken cancellationToken); 53var typeExpression = GetSymbolTypeExpression(semanticModel, nodeToReplace, cancellationToken); 54var nameOfSyntax = editor.Generator.NameOfExpression(typeExpression);
src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractAddDocCommentNodesCodeFixProvider.cs (13)
22where TXmlElementSyntax : SyntaxNode 23where TXmlNameAttributeSyntax : SyntaxNode 24where TXmlTextSyntax : SyntaxNode 25where TMemberDeclarationSyntax : SyntaxNode 32var root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 37var docCommentNode = TryGetDocCommentNode(parentMethod.GetLeadingTrivia()); 53protected abstract SyntaxNode? TryGetDocCommentNode(SyntaxTriviaList parameter); 59Document document, TMemberDeclarationSyntax parentMethod, SyntaxNode docCommentNode, CancellationToken cancellationToken) 61var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 63var newDocComment = docCommentNode; 103var nodeAfterNewParamNode = paramNodes.FirstOrDefault() ?? newDocComment.ChildNodes().First(); 121var newRoot = root.ReplaceNode(docCommentNode, newDocComment.WithAdditionalAnnotations(Formatter.Annotation)); 125private List<TXmlElementSyntax> GetElementNodes(SyntaxNode docComment, string nodeName)
src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractRemoveDocCommentNodeCodeFixProvider.cs (10)
19where TXmlElementSyntax : SyntaxNode 20where TXmlTextSyntax : SyntaxNode 36var root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 49private static TXmlElementSyntax? GetParamNode(SyntaxNode root, TextSpan span) 55var paramNode = root.FindNode(span, findInsideTrivia: true); 62var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 64var removedNodes = new List<SyntaxNode> { paramNode }; 81var newRoot = root.RemoveNodes(removedNodes, SyntaxRemoveOptions.KeepNoTrivia); 86private bool ShouldRemovePreviousSibling(List<SyntaxNode> paramNodeSiblings, int paramNodeIndex) 98var nextSibling = paramNodeSiblings[paramNodeIndex + 1];
src\Analyzers\Core\CodeFixes\FileHeaders\AbstractFileHeaderCodeFixProvider.cs (8)
49private async Task<SyntaxNode> GetTransformedSyntaxRootAsync(Document document, CancellationToken cancellationToken) 58internal static async Task<SyntaxNode> GetTransformedSyntaxRootAsync(ISyntaxFacts syntaxFacts, AbstractFileHeaderHelper fileHeaderHelper, SyntaxTrivia newLineTrivia, Document document, string? fileHeaderTemplate, CancellationToken cancellationToken) 61var root = await tree.GetRootAsync(cancellationToken).ConfigureAwait(false); 81SyntaxNode newSyntaxRoot; 94private static SyntaxNode ReplaceHeader(ISyntaxFacts syntaxFacts, AbstractFileHeaderHelper fileHeaderHelper, SyntaxTrivia newLineTrivia, SyntaxNode root, string expectedFileHeader) 176private static SyntaxNode AddHeader(ISyntaxFacts syntaxFacts, AbstractFileHeaderHelper fileHeaderHelper, SyntaxTrivia newLineTrivia, SyntaxNode root, string expectedFileHeader)
src\Analyzers\Core\CodeFixes\ForEachCast\AbstractForEachCastCodeFixProvider.cs (6)
23where TForEachStatementSyntax : SyntaxNode 34RegisterCodeFix(context, AnalyzersResources.Add_explicit_cast, nameof(AbstractForEachCastCodeFixProvider<SyntaxNode>)); 51var node = editor.OriginalRoot.FindNode(diagnostic.Location.SourceSpan, getInnermostNodeForTie: true); 76var rewritten = GetRewrittenCollection(editor.Generator, expression, variableDeclarator.Symbol.Type, conversion); 85private SyntaxNode GetRewrittenCollection( 87SyntaxNode collection,
src\Analyzers\Core\CodeFixes\Formatting\FormattingCodeFixProvider.cs (1)
64var root = await context.Document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.cs (9)
26where TExpressionSyntax : SyntaxNode 29protected abstract bool IsSimpleNameGeneration(SemanticDocument document, SyntaxNode node, CancellationToken cancellationToken); 30protected abstract bool IsConstructorInitializerGeneration(SemanticDocument document, SyntaxNode node, CancellationToken cancellationToken); 31protected abstract bool IsImplicitObjectCreation(SemanticDocument document, SyntaxNode node, CancellationToken cancellationToken); 33protected abstract bool TryInitializeImplicitObjectCreation(SemanticDocument document, SyntaxNode node, CancellationToken cancellationToken, out SyntaxToken token, out ImmutableArray<Argument> arguments, out INamedTypeSymbol typeToGenerateIn); 34protected abstract bool TryInitializeSimpleNameGenerationState(SemanticDocument document, SyntaxNode simpleName, CancellationToken cancellationToken, out SyntaxToken token, out ImmutableArray<Argument> arguments, out INamedTypeSymbol typeToGenerateIn); 35protected abstract bool TryInitializeConstructorInitializerGeneration(SemanticDocument document, SyntaxNode constructorInitializer, CancellationToken cancellationToken, out SyntaxToken token, out ImmutableArray<Argument> arguments, out INamedTypeSymbol typeToGenerateIn); 36protected abstract bool TryInitializeSimpleAttributeNameGenerationState(SemanticDocument document, SyntaxNode simpleName, CancellationToken cancellationToken, out SyntaxToken token, out ImmutableArray<Argument> arguments, out INamedTypeSymbol typeToGenerateIn); 78public async Task<ImmutableArray<CodeAction>> GenerateConstructorAsync(Document document, SyntaxNode node, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.State.cs (6)
78SyntaxNode node, 95SyntaxNode node, CancellationToken cancellationToken) 298SyntaxNode constructorInitializer, CancellationToken cancellationToken) 316private async Task<bool> TryInitializeImplicitObjectCreationAsync(SyntaxNode implicitObjectCreation, CancellationToken cancellationToken) 334SyntaxNode simpleName, 615private async Task<(ImmutableArray<ISymbol>, ImmutableArray<SyntaxNode>)> GenerateMembersAndAssignmentsAsync(
src\Analyzers\Core\CodeFixes\GenerateConstructor\GenerateConstructorHelpers.cs (2)
22where TExpressionSyntax : SyntaxNode 76where TExpressionSyntax : SyntaxNode
src\Analyzers\Core\CodeFixes\GenerateConstructor\IGenerateConstructorService.cs (1)
16Task<ImmutableArray<CodeAction>> GenerateConstructorAsync(Document document, SyntaxNode node, CancellationToken cancellationToken);
src\Analyzers\Core\CodeFixes\GenerateDefaultConstructors\AbstractGenerateDefaultConstructorCodeFixProvider.cs (2)
18protected abstract SyntaxToken? TryGetTypeName(SyntaxNode typeDeclaration); 28var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\GenerateEnumMember\AbstractGenerateEnumMemberService.cs (3)
20where TExpressionSyntax : SyntaxNode 26protected abstract bool IsIdentifierNameGeneration(SyntaxNode node); 29public async Task<ImmutableArray<CodeAction>> GenerateEnumMemberAsync(Document document, SyntaxNode node, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\GenerateEnumMember\AbstractGenerateEnumMemberService.State.cs (2)
30SyntaxNode node, 43SyntaxNode node,
src\Analyzers\Core\CodeFixes\GenerateEnumMember\IGenerateEnumMemberService.cs (1)
15Task<ImmutableArray<CodeAction>> GenerateEnumMemberAsync(Document document, SyntaxNode node, CancellationToken cancellationToken);
src\Analyzers\Core\CodeFixes\GenerateMember\AbstractGenerateMemberCodeFixProvider.cs (10)
27protected abstract Task<ImmutableArray<CodeAction>> GetCodeActionsAsync(Document document, SyntaxNode node, CancellationToken cancellationToken); 28protected abstract bool IsCandidate(SyntaxNode node, SyntaxToken token, Diagnostic diagnostic); 43var root = await document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 45foreach (var name in names) 58protected virtual SyntaxNode? GetTargetNode(SyntaxNode node) 61private IEnumerable<SyntaxNode> GetTargetNodes( 62ISyntaxFactsService syntaxFacts, SyntaxNode root, 69foreach (var ancestor in token.GetAncestors<SyntaxNode>()) 88var name = GetTargetNode(ancestor);
src\Analyzers\Core\CodeFixes\GenerateMember\AbstractGenerateMemberService.cs (2)
17where TExpressionSyntax : SyntaxNode 180SyntaxNode expression,
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateConversionService.cs (6)
21where TExpressionSyntax : SyntaxNode 24protected abstract bool IsImplicitConversionGeneration(SyntaxNode node); 25protected abstract bool IsExplicitConversionGeneration(SyntaxNode node); 26protected abstract bool TryInitializeImplicitConversionState(SemanticDocument document, SyntaxNode expression, ISet<TypeKind> classInterfaceModuleStructTypes, CancellationToken cancellationToken, out SyntaxToken identifierToken, out IMethodSymbol methodSymbol, out INamedTypeSymbol typeToGenerateIn); 27protected abstract bool TryInitializeExplicitConversionState(SemanticDocument document, SyntaxNode expression, ISet<TypeKind> classInterfaceModuleStructTypes, CancellationToken cancellationToken, out SyntaxToken identifierToken, out IMethodSymbol methodSymbol, out INamedTypeSymbol typeToGenerateIn); 31SyntaxNode node,
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateConversionService.State.cs (4)
21SyntaxNode interfaceNode, 36SyntaxNode node, 57private bool TryInitializeExplicitConversion(TService service, SemanticDocument document, SyntaxNode node, CancellationToken cancellationToken) 81private bool TryInitializeImplicitConversion(TService service, SemanticDocument document, SyntaxNode node, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateDeconstructMethodService.cs (3)
19where TExpressionSyntax : SyntaxNode 22public abstract ImmutableArray<IParameterSymbol> TryMakeParameters(SemanticModel semanticModel, SyntaxNode target, CancellationToken cancellationToken); 26SyntaxNode leftSide,
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateDeconstructMethodService.State.cs (2)
28SyntaxNode targetVariables, 44SyntaxNode targetVariables,
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateMethodService.cs (5)
21where TExpressionSyntax : SyntaxNode 24protected abstract bool IsSimpleNameGeneration(SyntaxNode node); 25protected abstract bool IsExplicitInterfaceGeneration(SyntaxNode node); 26protected abstract bool TryInitializeExplicitInterfaceState(SemanticDocument document, SyntaxNode node, CancellationToken cancellationToken, out SyntaxToken identifierToken, out IMethodSymbol methodSymbol, out INamedTypeSymbol typeToGenerateIn); 32SyntaxNode node,
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateMethodService.State.cs (3)
29SyntaxNode interfaceNode, 44SyntaxNode node, 83SyntaxNode methodDeclaration,
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.cs (1)
21where TExpressionSyntax : SyntaxNode
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.SignatureInfo.cs (2)
196private ImmutableArray<SyntaxNode> GenerateStatements( 200var throwStatement = CodeGenerationHelpers.GenerateThrowStatement(factory, Document, "System.NotImplementedException");
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\IGenerateConversionService.cs (1)
15Task<ImmutableArray<CodeAction>> GenerateConversionAsync(Document document, SyntaxNode node, CancellationToken cancellationToken);
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\IGenerateDeconstructMemberService.cs (1)
17Document document, SyntaxNode targetVariables, INamedTypeSymbol typeToGenerateIn, CancellationToken cancellationToken);
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\IGenerateParameterizedMemberService.cs (1)
16Task<ImmutableArray<CodeAction>> GenerateMethodAsync(Document document, SyntaxNode node, CancellationToken cancellationToken);
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.CodeAction.cs (2)
114private ImmutableArray<SyntaxNode> GenerateStatements() 118var throwStatement = CodeGenerationHelpers.GenerateThrowStatement(
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.cs (6)
25where TExpressionSyntax : SyntaxNode 31protected abstract bool IsExplicitInterfaceGeneration(SyntaxNode node); 32protected abstract bool IsIdentifierNameGeneration(SyntaxNode node); 34protected abstract bool TryInitializeExplicitInterfaceState(SemanticDocument document, SyntaxNode node, CancellationToken cancellationToken, out SyntaxToken identifierToken, out IPropertySymbol propertySymbol, out INamedTypeSymbol typeToGenerateIn); 37protected abstract bool TryConvertToLocalDeclaration(ITypeSymbol type, SyntaxToken identifierToken, SemanticModel semanticModel, CancellationToken cancellationToken, out SyntaxNode newRoot); 41SyntaxNode node,
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.GenerateLocalCodeAction.cs (4)
41var newRoot = await GetNewRootAsync(cancellationToken).ConfigureAwait(false); 47private async Task<SyntaxNode> GetNewRootAsync(CancellationToken cancellationToken) 51if (_service.TryConvertToLocalDeclaration(_state.LocalType, _state.IdentifierToken, semanticModel, cancellationToken, out var newRoot)) 65var root = _state.IdentifierToken.GetAncestors<SyntaxNode>().Last();
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.State.cs (6)
76SyntaxNode interfaceNode, 112SyntaxNode node, 192SyntaxNode propertyDeclaration, 378var siblingNode = sibling.AsNode(); 416private static int GetStatementIndex(ChildSyntaxList children, SyntaxNode statement) 496private bool DetermineIsInConstructor(SyntaxNode simpleName)
src\Analyzers\Core\CodeFixes\GenerateVariable\IGenerateVariableService.cs (1)
17Task<ImmutableArray<CodeAction>> GenerateVariableAsync(Document document, SyntaxNode node, CancellationToken cancellationToken);
src\Analyzers\Core\CodeFixes\ImplementAbstractClass\AbstractImplementAbstractClassCodeFixProvider.cs (2)
15where TClassNode : SyntaxNode 32var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\ImplementAbstractClass\ImplementAbstractClassData.cs (10)
33Document document, ImplementTypeOptions options, SyntaxNode classNode, SyntaxToken classIdentifier, 39private readonly SyntaxNode _classNode = classNode; 47Document document, SyntaxNode classNode, SyntaxToken classIdentifier, CancellationToken cancellationToken) 79Document document, SyntaxNode classNode, SyntaxToken classIdentifier, CancellationToken cancellationToken) 182var body = throughMember == null 250Func<SyntaxNode, SyntaxNode, SyntaxNode> createAddOrRemoveHandler) 256var throughExpression = generator.CreateDelegateThroughExpression(@event, throughMember); 257var statement = generator.ExpressionStatement(createAddOrRemoveHandler(
src\Analyzers\Core\CodeFixes\ImplementInterface\AbstractImplementInterfaceCodeFixProvider.cs (2)
22where TTypeSyntax : SyntaxNode 35var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\ImplementInterface\AbstractImplementInterfaceService.cs (10)
30protected abstract bool TryInitializeState(Document document, SemanticModel model, SyntaxNode interfaceNode, CancellationToken cancellationToken, out SyntaxNode classOrStructDecl, out INamedTypeSymbol classOrStructType, out ImmutableArray<INamedTypeSymbol> interfaceTypes); 33protected abstract SyntaxNode AddCommentInsideIfStatement(SyntaxNode ifDisposingStatement, SyntaxTriviaList trivia); 34protected abstract SyntaxNode CreateFinalizer(SyntaxGenerator generator, INamedTypeSymbol classType, string disposeMethodDisplayString); 37Document document, ImplementTypeOptions options, SyntaxNode node, CancellationToken cancellationToken) 57public async Task<IImplementInterfaceInfo?> AnalyzeAsync(Document document, SyntaxNode interfaceType, CancellationToken cancellationToken) 63protected TNode AddComment<TNode>(string comment, TNode node) where TNode : SyntaxNode 66protected TNode AddComments<TNode>(string comment1, string comment2, TNode node) where TNode : SyntaxNode 69protected TNode AddComments<TNode>(string[] comments, TNode node) where TNode : SyntaxNode
src\Analyzers\Core\CodeFixes\ImplementInterface\AbstractImplementInterfaceService.State.cs (5)
16SyntaxNode interfaceNode, 17SyntaxNode classOrStructDecl, 22public SyntaxNode InterfaceNode { get; } = interfaceNode; 23public SyntaxNode ClassOrStructDecl { get; } = classOrStructDecl; 41SyntaxNode interfaceNode,
src\Analyzers\Core\CodeFixes\ImplementInterface\IImplementInterfaceInfo.cs (2)
20SyntaxNode ClassOrStructDecl { get; } 22SyntaxNode InterfaceNode { get; }
src\Analyzers\Core\CodeFixes\ImplementInterface\IImplementInterfaceService.cs (2)
24Task<Document> ImplementInterfaceAsync(Document document, ImplementTypeOptions options, SyntaxNode node, CancellationToken cancellationToken); 26Task<IImplementInterfaceInfo?> AnalyzeAsync(Document document, SyntaxNode interfaceType, CancellationToken cancellationToken);
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementHelpers.cs (3)
72var declarator = syntaxRef.GetSyntax(cancellationToken); 88var declarator = syntaxRef.GetSyntax(cancellationToken); 100bool InitializerReferencesParameter(SyntaxNode? initializer, IParameterSymbol parameter)
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator.cs (5)
329Func<SyntaxNode, SyntaxNode, SyntaxNode> createAddOrRemoveHandler) 334var throughExpression = generator.CreateDelegateThroughExpression(@event, ThroughMember); 335var statement = generator.ExpressionStatement(createAddOrRemoveHandler(
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator_DisposePattern.cs (8)
95Document document, SyntaxNode finalizer, CancellationToken cancellationToken) 97var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 99var lastGeneratedMember = root.GetAnnotatedNodes(CodeGenerator.Annotation) 113var finalRoot = root.ReplaceNode(lastGeneratedMember, lastMemberWithComments); 117private (ImmutableArray<ISymbol>, SyntaxNode) CreateDisposableMethods( 155var ifDisposingStatement = g.IfStatement(g.IdentifierName(DisposingName), []); 170var ifStatement = g.IfStatement( 191using var _ = ArrayBuilder<SyntaxNode>.GetInstance(out var statements);
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator_Method.cs (1)
50private SyntaxNode CreateStatement(Compilation compilation, IMethodSymbol method)
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator_Property.cs (2)
150private ImmutableArray<SyntaxNode> GetSetAccessorStatements( 164private ImmutableArray<SyntaxNode> GetGetAccessorStatements(
src\Analyzers\Core\CodeFixes\Iterator\AbstractIteratorCodeFixProvider.cs (7)
24protected abstract Task<CodeAction> GetCodeFixAsync(SyntaxNode root, SyntaxNode node, Document document, Diagnostic diagnostics, CancellationToken cancellationToken); 28var root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 29if (!TryGetNode(root, context.Span, out var node)) 44protected virtual bool TryGetNode(SyntaxNode root, TextSpan span, out SyntaxNode node) 47var ancestors = root.FindToken(span.Start).GetAncestors<SyntaxNode>();
src\Analyzers\Core\CodeFixes\MakeFieldReadonly\AbstractMakeFieldReadonlyCodeFixProvider.cs (5)
23where TSymbolSyntax : SyntaxNode 24where TFieldDeclarationSyntax : SyntaxNode 29protected abstract SyntaxNode? GetInitializerNode(TSymbolSyntax declaration); 45var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 84var newDeclaration = generator
src\Analyzers\Core\CodeFixes\MakeMemberStatic\AbstractMakeMemberStaticCodeFixProvider.cs (4)
19protected abstract bool TryGetMemberDeclaration(SyntaxNode node, [NotNullWhen(true)] out SyntaxNode? memberDeclaration); 39if (TryGetMemberDeclaration(declaration, out var memberDeclaration)) 42var newNode = generator.WithModifiers(memberDeclaration, generator.GetModifiers(declaration).WithIsStatic(true));
src\Analyzers\Core\CodeFixes\MakeMethodAsynchronous\AbstractMakeMethodAsynchronousCodeFixProvider.cs (14)
21protected abstract bool IsAsyncSupportingFunctionSyntax(SyntaxNode node); 28protected abstract SyntaxNode AddAsyncTokenAndFixReturnType( 29bool keepVoid, IMethodSymbol methodSymbol, SyntaxNode node, KnownTaskTypes knownTypes, CancellationToken cancellationToken); 42var node = GetContainingFunction(diagnostic, cancellationToken); 87private static IMethodSymbol? GetMethodSymbol(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken) 109var node = GetContainingFunction(diagnostic, cancellationToken); 147private SyntaxNode? GetContainingFunction(Diagnostic diagnostic, CancellationToken cancellationToken) 157SyntaxNode node, 173var newRoot = await newDocument.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 174if (syntaxPath.TryResolve(newRoot, out SyntaxNode? newNode)) 189SyntaxNode node, 192var newNode = AddAsyncTokenAndFixReturnType(keepVoid, methodSymbol, node, knownTypes, cancellationToken); 194var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 195var newRoot = root.ReplaceNode(node, newNode);
src\Analyzers\Core\CodeFixes\MakeMethodSynchronous\AbstractMakeMethodSynchronousCodeFixProvider.cs (15)
24protected abstract bool IsAsyncSupportingFunctionSyntax(SyntaxNode node); 25protected abstract SyntaxNode RemoveAsyncTokenAndFixReturnType(IMethodSymbol methodSymbol, SyntaxNode node, KnownTaskTypes knownTypes); 52Document document, SyntaxNode node, CancellationToken cancellationToken) 73private async Task<Solution> RenameThenRemoveAsyncTokenAsync(Document document, SyntaxNode node, IMethodSymbol methodSymbol, CancellationToken cancellationToken) 85var newRoot = await newDocument.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 86if (syntaxPath.TryResolve(newRoot, out SyntaxNode? newNode)) 97Document document, IMethodSymbol methodSymbol, SyntaxNode node, CancellationToken cancellationToken) 103var newNode = RemoveAsyncTokenAndFixReturnType(methodSymbol, node, knownTypes) 106var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 107var newRoot = root.ReplaceNode(node, newNode); 122var syntaxRoot = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 123var methodDeclaration = syntaxRoot.GetAnnotatedNodes(annotation).FirstOrDefault(); 175var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 182var newRoot = editor.GetChangedRoot();
src\Analyzers\Core\CodeFixes\MakeTypeAbstract\AbstractMakeTypeAbstractCodeFixProvider.cs (2)
18where TTypeDeclarationSyntax : SyntaxNode 20protected abstract bool IsValidRefactoringContext(SyntaxNode? node, [NotNullWhen(true)] out TTypeDeclarationSyntax? typeDeclaration);
src\Analyzers\Core\CodeFixes\MakeTypePartial\AbstractMakeTypePartialCodeFixProvider.cs (3)
31var syntaxRoot = editor.OriginalRoot; 37var declaration = syntaxRoot.FindNode(diagnostic.Location.SourceSpan); 48var node = await reference.GetSyntaxAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\NamingStyle\NamingStyleCodeFixProvider.cs (2)
57var root = await document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 58var node = root.FindNode(span);
src\Analyzers\Core\CodeFixes\NewLines\ConsecutiveStatementPlacement\ConsecutiveStatementPlacementCodeFixProvider.cs (2)
46var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 53var newRoot = root.ReplaceTokens(
src\Analyzers\Core\CodeFixes\NewLines\MultipleBlankLines\AbstractMultipleBlankLinesCodeFixProvider.cs (2)
48var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 58var newRoot = root.ReplaceTokens(replacements.Keys, (token, _) => replacements[token]);
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchCodeFixProvider.cs (5)
30where TSwitchSyntax : SyntaxNode 31where TSwitchArmSyntax : SyntaxNode 32where TMemberAccessExpression : SyntaxNode 205ref SyntaxNode root, 213root, switchNode, out var newRoot, out var newSwitchNode);
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchExpressionCodeFixProvider.cs (2)
19where TExpressionSyntax : SyntaxNode 21where TSwitchArmSyntax : SyntaxNode
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchStatementCodeFixProvider.cs (5)
21where TSwitchSyntax : SyntaxNode 22where TSwitchArmSyntax : SyntaxNode 23where TMemberAccessExpression : SyntaxNode 47var root = editor.OriginalRoot; 50var newRoot = root.ReplaceNode(switchNode, newSwitchNode);
src\Analyzers\Core\CodeFixes\QualifyMemberAccess\AbstractQualifyMemberAccessCodeFixProvider.cs (3)
19where TSimpleNameSyntax : SyntaxNode 20where TInvocationSyntax : SyntaxNode 46var qualifiedAccess =
src\Analyzers\Core\CodeFixes\RemoveAsyncModifier\AbstractRemoveAsyncModifierCodeFixProvider.cs (35)
22where TReturnStatementSyntax : SyntaxNode 23where TExpressionSyntax : SyntaxNode 25protected abstract bool IsAsyncSupportingFunctionSyntax(SyntaxNode node); 26protected abstract SyntaxNode RemoveAsyncModifier(SyntaxGenerator generator, SyntaxNode methodLikeNode); 27protected abstract SyntaxNode? ConvertToBlockBody(SyntaxNode node, TExpressionSyntax expressionBody); 104private static IMethodSymbol? GetMethodSymbol(SyntaxNode node, SemanticModel semanticModel, CancellationToken cancellationToken) 117private SyntaxNode RemoveAsyncModifier( 121SyntaxNode node, 128var expression = generator.GetExpression(node); 134var blockBodiedNode = ConvertToBlockBody(node, expressionBody); 146var newExpressionBody = WrapExpressionWithTaskFromResult(generator, expressionBody, returnType, knownTypes); 166private static ControlFlowAnalysis? GetControlFlowAnalysis(SyntaxGenerator generator, SemanticModel semanticModel, SyntaxNode node) 177private static SyntaxNode AddReturnStatement(SyntaxGenerator generator, SyntaxNode node) 180private SyntaxNode ChangeReturnStatements( 184SyntaxNode node, 200var returnTaskCompletedTask = GetReturnTaskCompletedTaskStatement(generator, returnType, knownTypes); 206var newExpression = WrapExpressionWithTaskFromResult(generator, returnExpression, returnType, knownTypes); 214private static SyntaxNode GetReturnTaskCompletedTaskStatement(SyntaxGenerator generator, ITypeSymbol returnType, KnownTaskTypes knownTypes) 216SyntaxNode invocation; 219var taskTypeExpression = TypeExpressionForStaticMemberAccess(generator, knownTypes.TaskType); 227var statement = generator.ReturnStatement(invocation); 231private static SyntaxNode WrapExpressionWithTaskFromResult(SyntaxGenerator generator, SyntaxNode expression, ITypeSymbol returnType, KnownTaskTypes knownTypes) 235var taskTypeExpression = TypeExpressionForStaticMemberAccess(generator, knownTypes.TaskType!); 237var memberName = generator.GenericName(nameof(Task.FromResult), unwrappedReturnType); 238var taskFromResult = generator.MemberAccessExpression(taskTypeExpression, memberName); 249private static SyntaxNode TypeExpressionForStaticMemberAccess(SyntaxGenerator generator, INamedTypeSymbol typeSymbol) 254var typeExpression = generator.TypeExpression(typeSymbol); 258static SyntaxNode QualifiedNameToMemberAccess(int qualifiedNameSyntaxKind, int memberAccessExpressionSyntaxKind, SyntaxNode expression, SyntaxGenerator generator) 262var left = QualifiedNameToMemberAccess(qualifiedNameSyntaxKind, memberAccessExpressionSyntaxKind, expression.ChildNodes().First(), generator); 263var right = expression.ChildNodes().Last();
src\Analyzers\Core\CodeFixes\RemoveRedundantEquality\RemoveRedundantEqualityCodeFixProvider.cs (6)
24internal sealed class RemoveRedundantEqualityCodeFixProvider() : ForkingSyntaxEditorBasedCodeFixProvider<SyntaxNode> 34SyntaxNode node, 38var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 49SyntaxNode RewriteNode() 77static SyntaxNode WithElasticTrailingTrivia(SyntaxNode node)
src\Analyzers\Core\CodeFixes\RemoveUnnecessaryParentheses\AbstractRemoveUnnecessaryParenthesesCodeFixProvider.cs (1)
20where TParenthesizedExpressionSyntax : SyntaxNode
src\Analyzers\Core\CodeFixes\RemoveUnnecessarySuppressions\RemoveUnnecessaryAttributeSuppressionsCodeFixProvider.cs (2)
29var root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 44var node = editor.OriginalRoot.FindNode(diagnostic.Location.SourceSpan);
src\Analyzers\Core\CodeFixes\RemoveUnnecessarySuppressions\RemoveUnnecessaryPragmaSuppressionsCodeFixProvider.cs (4)
34var root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 54using var _ = PooledHashSet<SyntaxNode>.GetInstance(out var processedNodes); 71HashSet<SyntaxNode> processedNodes, 74SyntaxNode node;
src\Analyzers\Core\CodeFixes\RemoveUnusedMembers\AbstractRemoveUnusedMembersCodeFixProvider.cs (9)
23where TFieldDeclarationSyntax : SyntaxNode 34protected abstract void AdjustAndAddAppropriateDeclaratorsToRemove(HashSet<TFieldDeclarationSyntax> fieldDeclarators, HashSet<SyntaxNode> declarators); 48var declarators = new HashSet<SyntaxNode>(); 64var node = await declReference.GetSyntaxAsync(cancellationToken).ConfigureAwait(false); 86foreach (var declarator in declarators) 97protected static void AdjustAndAddAppropriateDeclaratorsToRemove(SyntaxNode parentDeclaration, IEnumerable<SyntaxNode> childDeclarators, HashSet<SyntaxNode> declarators) 106foreach (var childDeclarator in childDeclarators)
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (73)
48where TExpressionSyntax : SyntaxNode 49where TStatementSyntax : SyntaxNode 54where TVariableDeclaratorSyntax : SyntaxNode 55where TSwitchCaseBlockSyntax : SyntaxNode 56where TSwitchCaseLabelOrClauseSyntax : SyntaxNode 76protected abstract SyntaxNode? TryUpdateNameForFlaggedNode(SyntaxNode node, SyntaxToken newName); 100protected abstract SyntaxNode GetReplacementNodeForCompoundAssignment( 101SyntaxNode originalCompoundAssignment, 102SyntaxNode newAssignmentTarget, 110protected abstract SyntaxNode GetReplacementNodeForVarPattern(SyntaxNode originalVarPattern, SyntaxNode newNameNode); 122protected virtual SyntaxNode? TryUpdateParentOfUpdatedNode(SyntaxNode parent, SyntaxNode newNameNode, SyntaxEditor editor, ISyntaxFacts syntaxFacts, SemanticModel semanticModel) => null; 131protected abstract SyntaxNode ComputeReplacementNode(SyntaxNode originalOldNode, SyntaxNode changedOldNode, SyntaxNode proposedReplacementNode); 165var root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 166var node = root.FindNode(context.Span, getInnermostNodeForTie: true); 240private static IEnumerable<IGrouping<SyntaxNode, Diagnostic>> GetDiagnosticsGroupedByMember( 243SyntaxNode root, 265private static IEnumerable<IGrouping<SyntaxNode, Diagnostic>> GetDiagnosticsGroupedByMember( 268SyntaxNode root) 279var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 293private async Task<SyntaxNode> GetNewRootAsync( 299var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 325var containingMemberDeclaration = diagnosticsToFix.Key; 335var currentRoot = editor.GetChangedRoot(); 336var newRoot = await PostProcessDocumentAsync(document, options, currentRoot, 350SyntaxNode root, 351SyntaxNode containingMemberDeclaration, 387SyntaxNode root, 430var localDecl = editor.Generator.LocalDeclarationStatement( 446SyntaxNode root, 447SyntaxNode containingMemberDeclaration, 470using var _1 = PooledDictionary<SyntaxNode, SyntaxNode>.GetInstance(out var nodeReplacementMap); 471using var _2 = PooledHashSet<SyntaxNode>.GetInstance(out var nodesToRemove); 472using var _3 = PooledHashSet<(TLocalDeclarationStatementSyntax declarationStatement, SyntaxNode node)>.GetInstance(out var nodesToAdd); 474using var _4 = PooledHashSet<SyntaxNode>.GetInstance(out var processedNodes); 550var newNameNode = TryUpdateNameForFlaggedNode(node, newNameToken); 570var newParentNode = TryUpdateParentOfUpdatedNode(node.GetRequiredParent(), newNameNode, editor, syntaxFacts, semanticModel); 674IEnumerable<(SyntaxNode node, bool isUnusedLocalAssignment)> GetNodesToFix() 678var node = root.FindNode(diagnostic.Location.SourceSpan, getInnermostNodeForTie: true); 692void InsertLocalDeclarationStatement(TLocalDeclarationStatementSyntax declarationStatement, SyntaxNode node) 695var insertionNode = node.FirstAncestorOrSelf<SyntaxNode>( 726bool ShouldRemoveStatement(TLocalDeclarationStatementSyntax localDeclarationStatement, out SeparatedSyntaxList<SyntaxNode> variables) 732foreach (var variable in variables) 746private async Task<SyntaxNode> PostProcessDocumentAsync( 749SyntaxNode currentRoot, 775private static async Task<SyntaxNode> PostProcessDocumentCoreAsync( 776Func<SyntaxNode, Document, SyntaxFormattingOptions, CancellationToken, Task<SyntaxNode>> processMemberDeclarationAsync, 777SyntaxNode currentRoot, 786var newRoot = await newDocument.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 787using var _1 = PooledDictionary<SyntaxNode, SyntaxNode>.GetInstance(out var memberDeclReplacementsMap); 789foreach (var memberDecl in newRoot.DescendantNodes().Where(n => n.HasAnnotation(s_memberAnnotation))) 791var newMemberDecl = await processMemberDeclarationAsync(memberDecl, newDocument, options, cancellationToken).ConfigureAwait(false); 807private async Task<SyntaxNode> ReplaceDiscardDeclarationsWithAssignmentsAsync(SyntaxNode memberDeclaration, Document document, SyntaxFormattingOptions options, CancellationToken cancellationToken) 823private async Task<SyntaxNode> AdjustLocalDeclarationsAsync( 824SyntaxNode memberDeclaration, 846var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 847var rootWithTrackedNodes = root.TrackNodes(originalDeclStatementsToMoveOrRemove); 900var rootWithRemovedDeclaration = root.RemoveNode(newDecl, SyntaxGenerator.DefaultRemoveOptions | SyntaxRemoveOptions.KeepLeadingTrivia); 927SyntaxNode memberDeclaration, 932private readonly SyntaxNode _memberDeclaration = memberDeclaration; 938public SyntaxToken GenerateUniqueNameAtSpanStart(SyntaxNode node)
src\Analyzers\Core\CodeFixes\SimplifyBooleanExpression\SimplifyConditionalCodeFixProvider.cs (2)
61SyntaxNode SimplifyConditional(SemanticModel semanticModel, Diagnostic diagnostic, SyntaxNode expr)
src\Analyzers\Core\CodeFixes\SimplifyInterpolation\AbstractSimplifyInterpolationCodeFixProvider.cs (4)
27where TInterpolationSyntax : SyntaxNode 28where TExpressionSyntax : SyntaxNode 29where TInterpolationAlignmentClause : SyntaxNode 30where TInterpolationFormatClause : SyntaxNode
src\Analyzers\Core\CodeFixes\SimplifyLinqExpression\SimplifyLinqExpressionCodeFixProvider.cs (2)
40var root = editor.OriginalRoot; 44var invocation = root.FindNode(diagnostic.Location.SourceSpan, getInnermostNodeForTie: true);
src\Analyzers\Core\CodeFixes\UnsealClass\AbstractUnsealClassCodeFixProvider.cs (4)
34var syntaxRoot = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 37var node = syntaxRoot.FindNode(context.Span, getInnermostNodeForTie: true); 64var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 76var newDeclaration = generator.WithModifiers(declaration, modifiers.WithIsSealed(false));
src\Analyzers\Core\CodeFixes\UpdateLegacySuppressions\UpdateLegacySuppressionsCodeFixProvider.cs (2)
30var root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 45var node = editor.OriginalRoot.FindNode(diagnostic.Location.SourceSpan, getInnermostNodeForTie: true);
src\Analyzers\Core\CodeFixes\UseCoalesceExpression\AbstractUseCoalesceExpressionForIfNullStatementCheckCodeFixProvider.cs (8)
30SemanticModel semanticModel, SyntaxNode expressionToCoalesce, 31SyntaxNode leftAssignmentPart, SyntaxNode rightAssignmentPart, 58SyntaxNode TryAddExplicitCast(SyntaxNode expressionToCoalesce, SyntaxNode whenTrueStatement) 81SyntaxNode GetWhenNullExpression(SyntaxNode whenTrueStatement)
src\Analyzers\Core\CodeFixes\UseCoalesceExpression\UseCoalesceExpressionForNullableTernaryConditionalCheckCodeFixProvider.cs (4)
47var root = editor.OriginalRoot; 51var conditionalExpression = root.FindNode(diagnostic.AdditionalLocations[0].SourceSpan, getInnermostNodeForTie: true); 52var conditionExpression = root.FindNode(diagnostic.AdditionalLocations[1].SourceSpan); 53var whenPart = root.FindNode(diagnostic.AdditionalLocations[2].SourceSpan);
src\Analyzers\Core\CodeFixes\UseCoalesceExpression\UseCoalesceExpressionForTernaryConditionalCheckCodeFixProvider.cs (10)
62var root = editor.OriginalRoot; 63var conditionalExpression = root.FindNode(diagnostic.AdditionalLocations[0].SourceSpan, getInnermostNodeForTie: true); 64var conditionalPartHigh = root.FindNode(diagnostic.AdditionalLocations[1].SourceSpan); 65var whenPart = root.FindNode(diagnostic.AdditionalLocations[2].SourceSpan); 92private static SyntaxNode GetCoalesceExpression( 94SyntaxNode whenPart, SyntaxNode whenTrue, 95SyntaxNode conditionalPartLow, 96SyntaxNode currentWhenTrue, SyntaxNode currentWhenFalse)
src\Analyzers\Core\CodeFixes\UseCollectionExpression\AbstractUseCollectionExpressionCodeFixProvider.cs (1)
14where TExpressionSyntax : SyntaxNode
src\Analyzers\Core\CodeFixes\UseCollectionInitializer\AbstractUseCollectionInitializerCodeFixProvider.cs (7)
31where TExpressionSyntax : SyntaxNode 32where TStatementSyntax : SyntaxNode 38where TVariableDeclaratorSyntax : SyntaxNode 55protected abstract Task<(SyntaxNode oldNode, SyntaxNode newNode)> GetReplacementNodesAsync( 57ImmutableArray<CollectionMatch<SyntaxNode>> preMatches, 58ImmutableArray<CollectionMatch<SyntaxNode>> postMatches, CancellationToken cancellationToken);
src\Analyzers\Core\CodeFixes\UseCompoundAssignment\AbstractUseCompoundAssignmentCodeFixProvider.cs (2)
22where TAssignmentSyntax : SyntaxNode 23where TExpressionSyntax : SyntaxNode
src\Analyzers\Core\CodeFixes\UseConditionalExpression\AbstractUseConditionalExpressionCodeFixProvider.cs (10)
27where TStatementSyntax : SyntaxNode 29where TExpressionSyntax : SyntaxNode 48var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 63var changedRoot = nestedEditor.GetChangedRoot(); 94var condition = WrapIfStatementIfNecessary(ifOperation); 125protected virtual SyntaxNode WrapIfStatementIfNecessary(IConditionalOperation operation) 138Document document, SyntaxNode condition, SyntaxNode trueSyntax, SyntaxNode falseSyntax, SyntaxFormattingOptions formattingOptions, 164var sourceSyntax = value.Syntax;
src\Analyzers\Core\CodeFixes\UseConditionalExpression\ForAssignment\AbstractUseConditionalExpressionForAssignmentCodeFixProvider.cs (5)
30where TStatementSyntax : SyntaxNode 33where TVariableDeclaratorSyntax : SyntaxNode 34where TExpressionSyntax : SyntaxNode 133var localDeclaration = localDeclarationOperation.Syntax; 142var updatedLocalDeclaration = localDeclaration.ReplaceNode(variable, updatedVariable);
src\Analyzers\Core\CodeFixes\UseConditionalExpression\ForReturn\AbstractUseConditionalExpressionForReturnCodeFixProvider.cs (2)
29where TStatementSyntax : SyntaxNode 31where TExpressionSyntax : SyntaxNode
src\Analyzers\Core\CodeFixes\UseConditionalExpression\UseConditionalExpressionHelpers.cs (1)
16ISyntaxFactsService syntaxFacts, SyntaxNode syntax)
src\Analyzers\Core\CodeFixes\UseExplicitTupleName\UseExplicitTupleNameCodeFixProvider.cs (1)
48var newNameNode = generator.IdentifierName(preferredName).WithTriviaFrom(oldNameNode);
src\Analyzers\Core\CodeFixes\UseInferredMemberName\AbstractUseInferredMemberNameCodeFixProvider.cs (3)
20protected abstract void LanguageSpecificRemoveSuggestedNode(SyntaxEditor editor, SyntaxNode node); 35var root = editor.OriginalRoot; 39var node = root.FindNode(diagnostic.Location.SourceSpan);
src\Analyzers\Core\CodeFixes\UseIsNullCheck\AbstractUseIsNullForReferenceEqualsCodeFixProvider.cs (3)
22where TExpressionSyntax : SyntaxNode 29protected abstract SyntaxNode CreateNullCheck(TExpressionSyntax argument, bool isUnconstrainedGeneric); 30protected abstract SyntaxNode CreateNotNullCheck(TExpressionSyntax argument);
src\Analyzers\Core\CodeFixes\UseNullPropagation\AbstractUseNullPropagationCodeFixProvider.cs (21)
38where TExpressionSyntax : SyntaxNode 39where TStatementSyntax : SyntaxNode 49where TElementBindingArgumentListSyntax : SyntaxNode 51protected abstract bool TryGetBlock(SyntaxNode? node, [NotNullWhen(true)] out TStatementSyntax? block); 53protected abstract SyntaxNode PostProcessElseIf(TIfStatementSyntax ifStatement, TStatementSyntax newWhenTrueStatement); 73var root = editor.OriginalRoot; 77var conditionalExpressionOrIfStatement = root.FindNode(diagnostic.AdditionalLocations[0].SourceSpan, getInnermostNodeForTie: true); 94SyntaxNode conditionalExpression, 97var root = editor.OriginalRoot; 102var conditionalPart = root.FindNode(diagnostic.AdditionalLocations[1].SourceSpan, getInnermostNodeForTie: true); 103var whenPart = root.FindNode(diagnostic.AdditionalLocations[2].SourceSpan, getInnermostNodeForTie: true); 145var root = editor.OriginalRoot; 155SyntaxNode nodeToBeReplaced = ifStatement; 156SyntaxNode? replacementNode = null; 216TContainer container, SyntaxNode match) where TContainer : SyntaxNode 222var memberAccess = match.Parent; 245TContainer whenPart, SyntaxNode match, SyntaxNode matchParent) where TContainer : SyntaxNode 249var memberAccess = matchParent;
src\Analyzers\Core\CodeFixes\UseObjectInitializer\AbstractUseObjectInitializerCodeFixProvider.cs (4)
30where TExpressionSyntax : SyntaxNode 31where TStatementSyntax : SyntaxNode 36where TVariableDeclaratorSyntax : SyntaxNode 68var currentRoot = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\UseSystemHashCode\UseSystemHashCodeCodeFixProvider.cs (2)
64var methodBlock = declarationService.GetDeclarations(method)[0].GetSyntax(cancellationToken); 78var updatedDecl = generator.WithStatements(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\ForkingSyntaxEditorBasedCodeFixProvider.cs (3)
27where TDiagnosticNode : SyntaxNode 63var originalRoot = editor.OriginalRoot; 96var changedRoot = subEditor.GetChangedRoot();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\SyntaxEditorBasedCodeFixProvider.cs (2)
74var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 79var newRoot = editor.GetChangedRoot();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (83)
48public TDeclarationNode AddEvent<TDeclarationNode>(TDeclarationNode destination, IEventSymbol @event, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode 51public TDeclarationNode AddField<TDeclarationNode>(TDeclarationNode destination, IFieldSymbol field, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode 54public TDeclarationNode AddMethod<TDeclarationNode>(TDeclarationNode destination, IMethodSymbol method, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode 57public TDeclarationNode AddProperty<TDeclarationNode>(TDeclarationNode destination, IPropertySymbol property, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode 60public TDeclarationNode AddNamedType<TDeclarationNode>(TDeclarationNode destination, INamedTypeSymbol namedType, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode 63public TDeclarationNode AddNamespace<TDeclarationNode>(TDeclarationNode destination, INamespaceSymbol @namespace, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode 67where TDeclarationNode : SyntaxNode 70private static TNode WithAnnotations<TNode>(TNode node, CodeGenerationContextInfo info) where TNode : SyntaxNode 77public SyntaxNode CreateEventDeclaration(IEventSymbol @event, CodeGenerationDestination destination, CodeGenerationContextInfo info, CancellationToken cancellationToken) 80public SyntaxNode CreateFieldDeclaration(IFieldSymbol field, CodeGenerationDestination destination, CodeGenerationContextInfo info, CancellationToken cancellationToken) 83public SyntaxNode? CreateMethodDeclaration(IMethodSymbol method, CodeGenerationDestination destination, CodeGenerationContextInfo info, CancellationToken cancellationToken) 86public SyntaxNode CreatePropertyDeclaration(IPropertySymbol property, CodeGenerationDestination destination, CodeGenerationContextInfo info, CancellationToken cancellationToken) 89public SyntaxNode CreateNamedTypeDeclaration(INamedTypeSymbol namedType, CodeGenerationDestination destination, CodeGenerationContextInfo info, CancellationToken cancellationToken) 92public SyntaxNode CreateNamespaceDeclaration(INamespaceSymbol @namespace, CodeGenerationDestination destination, CodeGenerationContextInfo info, CancellationToken cancellationToken) 95public TDeclarationNode AddParameters<TDeclarationNode>(TDeclarationNode destination, IEnumerable<IParameterSymbol> parameters, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode 98public TDeclarationNode AddAttributes<TDeclarationNode>(TDeclarationNode destination, IEnumerable<AttributeData> attributes, SyntaxToken? target, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode 101public TDeclarationNode RemoveAttribute<TDeclarationNode>(TDeclarationNode destination, SyntaxNode attributeToRemove, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode 104public TDeclarationNode RemoveAttribute<TDeclarationNode>(TDeclarationNode destination, AttributeData attributeToRemove, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode 107public TDeclarationNode UpdateDeclarationModifiers<TDeclarationNode>(TDeclarationNode declaration, IEnumerable<SyntaxToken> newModifiers, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode 110public TDeclarationNode UpdateDeclarationAccessibility<TDeclarationNode>(TDeclarationNode declaration, Accessibility newAccessibility, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode 113public TDeclarationNode UpdateDeclarationType<TDeclarationNode>(TDeclarationNode declaration, ITypeSymbol newType, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode 116public TDeclarationNode UpdateDeclarationMembers<TDeclarationNode>(TDeclarationNode declaration, IList<ISymbol> newMembers, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode 119public TDeclarationNode AddStatements<TDeclarationNode>(TDeclarationNode destination, IEnumerable<SyntaxNode> statements, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode 124protected abstract TDeclarationNode AddEvent<TDeclarationNode>(TDeclarationNode destination, IEventSymbol @event, TCodeGenerationContextInfo info, IList<bool>? availableIndices, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 125protected abstract TDeclarationNode AddField<TDeclarationNode>(TDeclarationNode destination, IFieldSymbol field, TCodeGenerationContextInfo info, IList<bool>? availableIndices, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 126protected abstract TDeclarationNode AddMethod<TDeclarationNode>(TDeclarationNode destination, IMethodSymbol method, TCodeGenerationContextInfo info, IList<bool>? availableIndices, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 127protected abstract TDeclarationNode AddProperty<TDeclarationNode>(TDeclarationNode destination, IPropertySymbol property, TCodeGenerationContextInfo info, IList<bool>? availableIndices, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 128protected abstract TDeclarationNode AddNamedType<TDeclarationNode>(TDeclarationNode destination, INamedTypeSymbol namedType, TCodeGenerationContextInfo info, IList<bool>? availableIndices, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 129protected abstract TDeclarationNode AddNamespace<TDeclarationNode>(TDeclarationNode destination, INamespaceSymbol @namespace, TCodeGenerationContextInfo info, IList<bool>? availableIndices, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 130protected abstract TDeclarationNode AddMembers<TDeclarationNode>(TDeclarationNode destination, IEnumerable<SyntaxNode> members) where TDeclarationNode : SyntaxNode; 132public abstract TDeclarationNode AddParameters<TDeclarationNode>(TDeclarationNode destinationMember, IEnumerable<IParameterSymbol> parameters, TCodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 133public abstract TDeclarationNode AddAttributes<TDeclarationNode>(TDeclarationNode destination, IEnumerable<AttributeData> attributes, SyntaxToken? target, TCodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 134public abstract TDeclarationNode RemoveAttribute<TDeclarationNode>(TDeclarationNode destination, SyntaxNode attributeToRemove, TCodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 135public abstract TDeclarationNode RemoveAttribute<TDeclarationNode>(TDeclarationNode destination, AttributeData attributeToRemove, TCodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 136public abstract TDeclarationNode AddStatements<TDeclarationNode>(TDeclarationNode destinationMember, IEnumerable<SyntaxNode> statements, TCodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 138public abstract TDeclarationNode UpdateDeclarationModifiers<TDeclarationNode>(TDeclarationNode declaration, IEnumerable<SyntaxToken> newModifiers, TCodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 139public abstract TDeclarationNode UpdateDeclarationAccessibility<TDeclarationNode>(TDeclarationNode declaration, Accessibility newAccessibility, TCodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 140public abstract TDeclarationNode UpdateDeclarationType<TDeclarationNode>(TDeclarationNode declaration, ITypeSymbol newType, TCodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 141public abstract TDeclarationNode UpdateDeclarationMembers<TDeclarationNode>(TDeclarationNode declaration, IList<ISymbol> newMembers, TCodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 143public abstract CodeGenerationDestination GetDestination(SyntaxNode node); 144public abstract SyntaxNode CreateEventDeclaration(IEventSymbol @event, CodeGenerationDestination destination, TCodeGenerationContextInfo info, CancellationToken cancellationToken); 145public abstract SyntaxNode CreateFieldDeclaration(IFieldSymbol field, CodeGenerationDestination destination, TCodeGenerationContextInfo info, CancellationToken cancellationToken); 148public abstract SyntaxNode? CreateMethodDeclaration(IMethodSymbol method, CodeGenerationDestination destination, TCodeGenerationContextInfo info, CancellationToken cancellationToken); 150public abstract SyntaxNode CreatePropertyDeclaration(IPropertySymbol property, CodeGenerationDestination destination, TCodeGenerationContextInfo info, CancellationToken cancellationToken); 151public abstract SyntaxNode CreateNamedTypeDeclaration(INamedTypeSymbol namedType, CodeGenerationDestination destination, TCodeGenerationContextInfo info, CancellationToken cancellationToken); 152public abstract SyntaxNode CreateNamespaceDeclaration(INamespaceSymbol @namespace, CodeGenerationDestination destination, TCodeGenerationContextInfo info, CancellationToken cancellationToken); 157protected static void CheckDeclarationNode<TDeclarationNode>(SyntaxNode destination) where TDeclarationNode : SyntaxNode 172protected static void CheckDeclarationNode<TDeclarationNode1, TDeclarationNode2>(SyntaxNode destination) 173where TDeclarationNode1 : SyntaxNode 174where TDeclarationNode2 : SyntaxNode 191protected static void CheckDeclarationNode<TDeclarationNode1, TDeclarationNode2, TDeclarationNode3>(SyntaxNode destination) 192where TDeclarationNode1 : SyntaxNode 193where TDeclarationNode2 : SyntaxNode 194where TDeclarationNode3 : SyntaxNode 212protected static void CheckDeclarationNode<TDeclarationNode1, TDeclarationNode2, TDeclarationNode3, TDeclarationNode4>(SyntaxNode destination) 213where TDeclarationNode1 : SyntaxNode 214where TDeclarationNode2 : SyntaxNode 215where TDeclarationNode3 : SyntaxNode 216where TDeclarationNode4 : SyntaxNode 233Func<SyntaxNode, TCodeGenerationContextInfo, IList<bool>?, CancellationToken, SyntaxNode> declarationTransform, 248var transformedDeclaration = declarationTransform(destinationDeclaration, info, availableIndices, cancellationToken); 250var root = await destinationTree.GetRootAsync(cancellationToken).ConfigureAwait(false); 251var currentRoot = root.ReplaceNode(destinationDeclaration, transformedDeclaration); 276where TDeclarationNode : SyntaxNode 298where TDeclarationSyntax : SyntaxNode 300var newMembers = new List<SyntaxNode>(); 305var newMember = GetNewMember(info, codeGenerationDestination, member, cancellationToken); 330where TDeclarationSyntax : SyntaxNode 343private SyntaxNode? GetNewMember(TCodeGenerationContextInfo info, CodeGenerationDestination codeGenerationDestination, ISymbol member, CancellationToken cancellationToken) 360CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode 380protected abstract IComparer<SyntaxNode> GetMemberComparer(); 482protected static void CheckLocation(SyntaxNode destinationMember, [NotNull] Location? location) 501SyntaxNode attributeList, 521SyntaxNode attributeToRemove, 527var root = attributeToRemove.SyntaxTree.GetRoot(); 536where T : SyntaxNode
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (16)
19protected abstract IList<bool>? GetAvailableInsertionIndices(SyntaxNode destination, CancellationToken cancellationToken); 21private IList<bool>? GetAvailableInsertionIndices<TDeclarationNode>(TDeclarationNode destination, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode 22=> GetAvailableInsertionIndices((SyntaxNode)destination, cancellationToken); 30protected static SyntaxToken GetEndToken(SyntaxNode node) 46protected static TextSpan GetSpan(SyntaxNode node) 54public bool CanAddTo(SyntaxNode destination, Solution solution, CancellationToken cancellationToken) 57private bool CanAddTo(SyntaxNode? destination, Solution solution, CancellationToken cancellationToken, 126public async Task<SyntaxNode?> FindMostRelevantNameSpaceOrTypeDeclarationAsync( 136private async Task<(SyntaxNode? declaration, IList<bool>? availableIndices)> FindMostRelevantDeclarationAsync( 142var declaration = (SyntaxNode?)null; 149var fallbackDeclaration = (SyntaxNode?)null; 215private static async Task<SyntaxNode?> SelectFirstOrDefaultAsync(IEnumerable<SyntaxReference> references, Func<SyntaxNode, bool> predicate, CancellationToken cancellationToken) 219var node = await r.GetSyntaxAsync(cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractFlagsEnumGenerator.cs (8)
15protected abstract SyntaxNode CreateExplicitlyCastedLiteralValue(SyntaxGenerator generator, INamedTypeSymbol enumType, SpecialType underlyingSpecialType, object constantValue); 18public SyntaxNode CreateEnumConstantValue(SyntaxGenerator generator, INamedTypeSymbol enumType, object constantValue) 63private SyntaxNode CreateFlagsEnumConstantValue(SyntaxGenerator generator, INamedTypeSymbol enumType, object constantValue) 73private SyntaxNode CreateFlagsEnumConstantValue( 106SyntaxNode? finalNode = null; 110var node = CreateMemberAccessExpression(generator, field.field, enumType, underlyingSpecialType); 140private SyntaxNode CreateMemberAccessExpression( 188private SyntaxNode CreateNonFlagsEnumConstantValue(SyntaxGenerator generator, INamedTypeSymbol enumType, object constantValue)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (9)
19public static SyntaxNode? GenerateThrowStatement( 33var exceptionCreationExpression = factory.ObjectCreationExpression(exceptionType, arguments: []); 38public static TSyntaxNode? AddAnnotationsTo<TSyntaxNode>(ISymbol symbol, TSyntaxNode? syntax) where TSyntaxNode : SyntaxNode 43public static TSyntaxNode AddFormatterAndCodeGeneratorAnnotationsTo<TSyntaxNode>(TSyntaxNode node) where TSyntaxNode : SyntaxNode 172public static T RemoveLeadingDirectiveTrivia<T>(T node) where T : SyntaxNode 179where T : SyntaxNode 197where TDeclaration : SyntaxNode 302where TDeclarationSyntax : SyntaxNode 327where TDeclarationSyntax : SyntaxNode
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (16)
60SyntaxNode? initializer = null) 113SyntaxNode? initializer = null) 129ImmutableArray<SyntaxNode> statements = default, 130ImmutableArray<SyntaxNode> baseConstructorArguments = default, 131ImmutableArray<SyntaxNode> thisConstructorArguments = default, 144ImmutableArray<SyntaxNode> statements = default) 162ImmutableArray<SyntaxNode> statements = default, 163ImmutableArray<SyntaxNode> handlesExpressions = default, 183ImmutableArray<SyntaxNode> statements = default, 184ImmutableArray<SyntaxNode> handlesExpressions = default, 202ImmutableArray<SyntaxNode> statements = default, 228ImmutableArray<SyntaxNode> statements = default, 256ImmutableArray<SyntaxNode> statements = default, 365ImmutableArray<SyntaxNode> statements = default) 389ImmutableArray<SyntaxNode> statements) 522ImmutableArray<SyntaxNode> statements = default,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\ICodeGenerationService.cs (26)
23SyntaxNode CreateEventDeclaration(IEventSymbol @event, CodeGenerationDestination destination, CodeGenerationContextInfo info, CancellationToken cancellationToken); 28SyntaxNode CreateFieldDeclaration(IFieldSymbol field, CodeGenerationDestination destination, CodeGenerationContextInfo info, CancellationToken cancellationToken); 34SyntaxNode? CreateMethodDeclaration(IMethodSymbol method, CodeGenerationDestination destination, CodeGenerationContextInfo info, CancellationToken cancellationToken); 39SyntaxNode CreatePropertyDeclaration(IPropertySymbol property, CodeGenerationDestination destination, CodeGenerationContextInfo info, CancellationToken cancellationToken); 44SyntaxNode CreateNamedTypeDeclaration(INamedTypeSymbol namedType, CodeGenerationDestination destination, CodeGenerationContextInfo info, CancellationToken cancellationToken); 49SyntaxNode CreateNamespaceDeclaration(INamespaceSymbol @namespace, CodeGenerationDestination destination, CodeGenerationContextInfo info, CancellationToken cancellationToken); 54TDeclarationNode AddEvent<TDeclarationNode>(TDeclarationNode destination, IEventSymbol @event, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 59TDeclarationNode AddField<TDeclarationNode>(TDeclarationNode destination, IFieldSymbol field, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 64TDeclarationNode AddMethod<TDeclarationNode>(TDeclarationNode destination, IMethodSymbol method, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 69TDeclarationNode AddProperty<TDeclarationNode>(TDeclarationNode destination, IPropertySymbol property, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 74TDeclarationNode AddNamedType<TDeclarationNode>(TDeclarationNode destination, INamedTypeSymbol namedType, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 79TDeclarationNode AddNamespace<TDeclarationNode>(TDeclarationNode destination, INamespaceSymbol @namespace, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 84TDeclarationNode AddMembers<TDeclarationNode>(TDeclarationNode destination, IEnumerable<ISymbol> members, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 89TDeclarationNode AddParameters<TDeclarationNode>(TDeclarationNode destination, IEnumerable<IParameterSymbol> parameters, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 94TDeclarationNode AddAttributes<TDeclarationNode>(TDeclarationNode destination, IEnumerable<AttributeData> attributes, SyntaxToken? target, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 99TDeclarationNode RemoveAttribute<TDeclarationNode>(TDeclarationNode destination, SyntaxNode attributeToRemove, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 104TDeclarationNode RemoveAttribute<TDeclarationNode>(TDeclarationNode destination, AttributeData attributeToRemove, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 109TDeclarationNode UpdateDeclarationModifiers<TDeclarationNode>(TDeclarationNode declaration, IEnumerable<SyntaxToken> newModifiers, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 114TDeclarationNode UpdateDeclarationAccessibility<TDeclarationNode>(TDeclarationNode declaration, Accessibility newAccessibility, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 119TDeclarationNode UpdateDeclarationType<TDeclarationNode>(TDeclarationNode declaration, ITypeSymbol newType, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 124TDeclarationNode UpdateDeclarationMembers<TDeclarationNode>(TDeclarationNode declaration, IList<ISymbol> newMembers, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 129TDeclarationNode AddStatements<TDeclarationNode>(TDeclarationNode destination, IEnumerable<SyntaxNode> statements, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 184bool CanAddTo(SyntaxNode destination, Solution solution, CancellationToken cancellationToken); 192Task<SyntaxNode?> FindMostRelevantNameSpaceOrTypeDeclarationAsync(Solution solution, INamespaceOrTypeSymbol namespaceOrType, Location? location, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationConstructorInfo.cs (15)
17private readonly ImmutableArray<SyntaxNode> _baseConstructorArguments; 18private readonly ImmutableArray<SyntaxNode> _thisConstructorArguments; 19private readonly ImmutableArray<SyntaxNode> _statements; 25ImmutableArray<SyntaxNode> statements, 26ImmutableArray<SyntaxNode> baseConstructorArguments, 27ImmutableArray<SyntaxNode> thisConstructorArguments) 42ImmutableArray<SyntaxNode> statements, 43ImmutableArray<SyntaxNode> baseConstructorArguments, 44ImmutableArray<SyntaxNode> thisConstructorArguments) 56public static ImmutableArray<SyntaxNode> GetThisConstructorArgumentsOpt(IMethodSymbol constructor) 59public static ImmutableArray<SyntaxNode> GetBaseConstructorArgumentsOpt(IMethodSymbol constructor) 62public static ImmutableArray<SyntaxNode> GetStatements(IMethodSymbol constructor) 74private static ImmutableArray<SyntaxNode> GetThisConstructorArgumentsOpt(CodeGenerationConstructorInfo? info) 77private static ImmutableArray<SyntaxNode> GetBaseConstructorArgumentsOpt(CodeGenerationConstructorInfo? info) 80private static ImmutableArray<SyntaxNode> GetStatements(CodeGenerationConstructorInfo? info)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationDestructorInfo.cs (5)
17private readonly ImmutableArray<SyntaxNode> _statements; 21ImmutableArray<SyntaxNode> statements) 30ImmutableArray<SyntaxNode> statements) 42public static ImmutableArray<SyntaxNode> GetStatements(IMethodSymbol destructor) 48private static ImmutableArray<SyntaxNode> GetStatements(CodeGenerationDestructorInfo info)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationFieldInfo.cs (5)
17private readonly SyntaxNode _initializer; 22SyntaxNode initializer) 33SyntaxNode initializer) 57private static SyntaxNode GetInitializer(CodeGenerationFieldInfo info) 60public static SyntaxNode GetInitializer(IFieldSymbol field)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationMethodInfo.cs (10)
20private readonly ImmutableArray<SyntaxNode> _statements; 21private readonly ImmutableArray<SyntaxNode> _handlesExpressions; 28ImmutableArray<SyntaxNode> statements, 29ImmutableArray<SyntaxNode> handlesExpressions) 45ImmutableArray<SyntaxNode> statements, 46ImmutableArray<SyntaxNode> handlesExpressions) 58public static ImmutableArray<SyntaxNode> GetStatements(IMethodSymbol method) 61public static ImmutableArray<SyntaxNode> GetHandlesExpressions(IMethodSymbol method) 76private static ImmutableArray<SyntaxNode> GetStatements(CodeGenerationMethodInfo info) 79private static ImmutableArray<SyntaxNode> GetHandlesExpressions(CodeGenerationMethodInfo info)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationPropertyInfo.cs (5)
17private readonly SyntaxNode _initializer; 22SyntaxNode initializer) 33SyntaxNode initializer) 45public static SyntaxNode GetInitializer(CodeGenerationPropertyInfo info) 48public static SyntaxNode GetInitializer(IPropertySymbol property)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationSymbol.cs (1)
148public static ImmutableArray<SyntaxNode> DeclaringSyntaxNodes
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeRefactorings\AbstractRefactoringHelpersService.cs (47)
18where TExpressionSyntax : SyntaxNode 19where TArgumentSyntax : SyntaxNode 20where TExpressionStatementSyntax : SyntaxNode 24public abstract bool IsBetweenTypeMembers(SourceText sourceText, SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? typeDeclaration); 26private static void AddNode<TSyntaxNode>(bool allowEmptyNodes, ref TemporaryArray<TSyntaxNode> result, TSyntaxNode node) where TSyntaxNode : SyntaxNode 35ParsedDocument document, TextSpan selectionRaw, bool allowEmptyNodes, int maxCount, ref TemporaryArray<TSyntaxNode> result, CancellationToken cancellationToken) where TSyntaxNode : SyntaxNode 42var root = document.Root; 137private static bool IsWantedTypeExpressionLike<TSyntaxNode>() where TSyntaxNode : SyntaxNode 157SyntaxNode root, 268CancellationToken cancellationToken) where TSyntaxNode : SyntaxNode 275var leftNode = tokenToLeft.Parent; 302SyntaxNode root, 307CancellationToken cancellationToken) where TSyntaxNode : SyntaxNode 313var rightNode = tokenToRightOrIn.Parent; 347SyntaxNode root, 352CancellationToken cancellationToken) where TSyntaxNode : SyntaxNode 354var selectionNode = root.FindNode(selectionTrimmed, getInnermostNodeForTie: true); 355var prevNode = selectionNode; 393protected virtual IEnumerable<SyntaxNode> ExtractNodesSimple(SyntaxNode? node, ISyntaxFactsService syntaxFacts) 411var localDeclarationStatement = syntaxFacts.IsLocalDeclarationStatement(node) ? node : node.Parent!; 480protected virtual IEnumerable<SyntaxNode> ExtractNodesInHeader(SyntaxNode root, int location, IHeaderFactsService headerFacts) 520CancellationToken cancellationToken) where TSyntaxNode : SyntaxNode 524var root = document.Root; 559IEnumerable<SyntaxNode> nodes, bool allowEmptyNodes, int maxCount, ref TemporaryArray<TSyntaxNode> result, CancellationToken cancellationToken) where TSyntaxNode : SyntaxNode 561foreach (var node in nodes) 573public bool IsOnTypeHeader(SyntaxNode root, int position, bool fullHeader, [NotNullWhen(true)] out SyntaxNode? typeDeclaration) 576public bool IsOnPropertyDeclarationHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? propertyDeclaration) 579public bool IsOnParameterHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? parameter) 582public bool IsOnMethodHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? method) 585public bool IsOnLocalFunctionHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? localFunction) 588public bool IsOnLocalDeclarationHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? localDeclaration) 591public bool IsOnIfStatementHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? ifStatement) 594public bool IsOnWhileStatementHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? whileStatement) 597public bool IsOnForeachHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? foreachStatement)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeRefactorings\CodeRefactoringHelpers.cs (3)
41public static bool IsNodeUnderselected(SyntaxNode? node, TextSpan selection) 84var beginningNode = node.FindToken(node.Span.Start).Parent; 85var endNode = node.FindToken(node.Span.End - 1).Parent;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeRefactorings\IRefactoringHelpersService.cs (4)
25bool IsBetweenTypeMembers(SourceText sourceText, SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? typeDeclaration); 51/// name="selection"/>. The trimmed version is then used to determine relevant <see cref="SyntaxNode"/>. It also 57ParsedDocument document, TextSpan selection, bool allowEmptyNodes, int maxCount, ref TemporaryArray<TSyntaxNode> result, CancellationToken cancellationToken) where TSyntaxNode : SyntaxNode;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\AddParameterEditor.cs (10)
20SyntaxNode declaration, 22SyntaxNode parameterDeclaration, 54var firstParameter = existingParameters[0]; 66var nextParameter = existingParameters[insertionIndex]; 91var nextParameter = existingParameters[insertionIndex]; 108var nextParameter = existingParameters[insertionIndex]; 122ISyntaxFacts syntaxFacts, SyntaxNode node, bool includeLeadingNewLine) 152IReadOnlyList<SyntaxNode> parameters, CancellationToken cancellationToken) 162var lastParameter = parameters[i - 1]; 163var thisParameter = parameters[i];
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (19)
39var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 66bool OverlapsWithSpan(SyntaxNode n) => spansTree.HasIntervalThatOverlapsWith(n.FullSpan.Start, n.FullSpan.Length); 69protected abstract INamespaceSymbol? GetExplicitNamespaceSymbol(SyntaxNode node, SemanticModel model); 73SyntaxNode container, 91SyntaxNode container, 96private static SyntaxNode GenerateNamespaceImportDeclaration(INamespaceSymbol namespaceSymbol, SyntaxGenerator generator) 107IEnumerable<SyntaxNode> syntaxNodes, 113using var _1 = ArrayBuilder<SyntaxNode>.GetInstance(out var importsToAdd); 114using var _2 = ArrayBuilder<SyntaxNode>.GetInstance(out var nodesToSimplify); 116var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 135var namespaceSyntax = GenerateNamespaceImportDeclaration(namespaceSymbol, generator); 155var first = root.DescendantNodesAndSelf().First(x => x.HasAnnotation(annotation)); 156var last = root.DescendantNodesAndSelf().Last(x => x.HasAnnotation(annotation)); 168IEnumerable<SyntaxNode> syntaxNodes, 174using var _ = PooledDictionary<INamespaceSymbol, SyntaxNode>.GetInstance(out var importToSyntax); 184SyntaxNode? first = null, last = null; 215var namespaceSyntax = GenerateNamespaceImportDeclaration(namespaceSymbol, generator); 233var importContainer = addImportsService.GetImportContainer(root, context, importToSyntax.First().Value, options); 254private static bool IsInsideNamespace(SyntaxNode node, INamespaceSymbol symbol, SemanticModel model, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (5)
79public static async ValueTask<SyntaxNode> GetRequiredSyntaxRootAsync(this Document document, CancellationToken cancellationToken) 81if (document.TryGetSyntaxRoot(out var root)) 137var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 139var node = token.Parent!.AncestorsAndSelf().First(a => a.FullSpan.Contains(span)); 158public static ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(this Document document, SyntaxNode? node, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ITypeInferenceServiceExtensions.cs (5)
15public static ImmutableArray<ITypeSymbol> InferTypes(this ITypeInferenceService service, SemanticModel semanticModel, SyntaxNode expression, CancellationToken cancellationToken) 24public static ImmutableArray<TypeInferenceInfo> GetTypeInferenceInfo(this ITypeInferenceService service, SemanticModel semanticModel, SyntaxNode expression, CancellationToken cancellationToken) 30SyntaxNode expression, 56SyntaxNode expression, 68SyntaxNode expression,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxEditorExtensions.cs (29)
31Func<SemanticModel, SyntaxNode, TType, TNode, SyntaxNode> updateRoot, 32CancellationToken cancellationToken) where TNode : SyntaxNode 54Func<SemanticModel, SyntaxNode, TType, TNode, SyntaxNode> updateRoot, 55CancellationToken cancellationToken) where TNode : SyntaxNode 76Func<SemanticModel, SyntaxNode, TNode, SyntaxNode> updateRoot, 77CancellationToken cancellationToken) where TNode : SyntaxNode 98Func<SemanticModel, SyntaxNode, TType, TNode, SyntaxNode> updateRoot, 99CancellationToken cancellationToken) where TNode : SyntaxNode 120Func<SemanticModel, SyntaxNode, TNode, SyntaxNode> updateRoot, 121CancellationToken cancellationToken) where TNode : SyntaxNode 154Func<ISyntaxFactsService, SyntaxNode, SyntaxNode> getSemanticBoundary, 156Func<SemanticModel, SyntaxNode, TType, TNode, SyntaxNode> updateRoot, 157CancellationToken cancellationToken) where TNode : SyntaxNode 170var originalRoot = editor.OriginalRoot; 173var currentRoot = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 183var replacementRoot = updateRoot(semanticModel, currentRoot, instance, currentNode); 195private static SyntaxNode GetExpressionSemanticBoundary(ISyntaxFactsService syntaxFacts, SyntaxNode node) 202return node.FirstAncestorOrSelf<SyntaxNode, ISyntaxFactsService>( 210private static SyntaxNode GetMethodBodySemanticBoundary(ISyntaxFactsService syntaxFacts, SyntaxNode node) 212return node.FirstAncestorOrSelf<SyntaxNode, ISyntaxFactsService>(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions.cs (46)
30public static SyntaxNode CreateThrowNotImplementedStatement( 37public static SyntaxNode CreateThrowNotImplementedExpression( 44private static SyntaxNode CreateNewNotImplementedException(SyntaxGenerator codeDefinitionFactory, Compilation compilation) 46var notImplementedExceptionTypeSyntax = compilation.NotImplementedExceptionType() is INamedTypeSymbol symbol 55public static ImmutableArray<SyntaxNode> CreateThrowNotImplementedStatementBlock( 59public static ImmutableArray<SyntaxNode> CreateArguments( 66private static SyntaxNode CreateArgument( 73public static SyntaxNode GetDefaultEqualityComparer( 95public static SyntaxNode IsPatternExpression(this SyntaxGeneratorInternal generator, SyntaxNode expression, SyntaxNode pattern) 102public static SyntaxNode GenerateDelegateThroughMemberStatement( 105var through = generator.MemberAccessExpression( 111var invocationExpression = generator.InvocationExpression(through, generator.CreateArguments(method.Parameters)); 117public static SyntaxNode CreateDelegateThroughExpression( 120var name = generator.IdentifierName(throughMember.Name); 121var through = throughMember.IsStatic 167var explicitImplementationCast = generator.CastExpression( 182static SyntaxNode GenerateContainerName(SyntaxGenerator factory, ISymbol throughMember) 191public static ImmutableArray<SyntaxNode> GetGetAccessorStatements( 197var throughExpression = CreateDelegateThroughExpression(generator, property, throughMember); 198var expression = property.IsIndexer 215public static ImmutableArray<SyntaxNode> GetSetAccessorStatements( 221var throughExpression = CreateDelegateThroughExpression(generator, property, throughMember); 222var expression = property.IsIndexer 315public static ImmutableArray<SyntaxNode> CreateAssignmentStatements( 325var nullCheckStatements = ArrayBuilder<SyntaxNode>.GetInstance(); 326var assignStatements = ArrayBuilder<SyntaxNode>.GetInstance(); 338var assignExpression = factory.AssignmentStatement( 341var statement = factory.ExpressionStatement(assignExpression); 351var fieldAccess = factory.MemberAccessExpression(factory.ThisExpression(), factory.IdentifierName(fieldName)) 371SyntaxNode fieldAccess, 374ArrayBuilder<SyntaxNode> nullCheckStatements, 375ArrayBuilder<SyntaxNode> assignStatements) 406public static SyntaxNode CreateAssignWithNullCheckStatement( 407this SyntaxGenerator factory, Compilation compilation, IParameterSymbol parameter, SyntaxNode fieldAccess) 416public static SyntaxNode CreateThrowArgumentNullExpression(this SyntaxGenerator factory, Compilation compilation, IParameterSymbol parameter) 419private static SyntaxNode CreateNewArgumentNullException(SyntaxGenerator factory, Compilation compilation, IParameterSymbol parameter) 428public static SyntaxNode CreateNullCheckAndThrowStatement( 434var condition = factory.CreateNullCheckExpression(generatorInternal, semanticModel, parameter.Name); 435var throwStatement = factory.CreateThrowArgumentNullExceptionStatement(semanticModel.Compilation, parameter); 440public static SyntaxNode CreateNullCheckExpression( 443var identifier = factory.IdentifierName(identifierName); 444var nullExpr = factory.NullLiteralExpression(); 445var condition = generatorInternal.SupportsPatterns(semanticModel.SyntaxTree.Options) 451public static SyntaxNode CreateThrowArgumentNullExceptionStatement(this SyntaxGenerator factory, Compilation compilation, IParameterSymbol parameter)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (21)
49public static IMethodSymbol CreateEqualsMethod(this Compilation compilation, ImmutableArray<SyntaxNode> statements) 109private static ImmutableArray<SyntaxNode> CreateEqualsMethodStatements( 127using var statements = TemporaryArray<SyntaxNode>.Empty; 136var localNameExpression = factory.IdentifierName(localName); 137var objNameExpression = factory.IdentifierName(ObjName); 141using var _2 = ArrayBuilder<SyntaxNode>.GetInstance(out var expressions); 159var ifStatement = factory.IfStatement( 170var localDeclaration = factory.SimpleLocalDeclarationStatement(generatorInternal, 182var localDeclaration = factory.SimpleLocalDeclarationStatement(generatorInternal, 220ImmutableArray<ISymbol> members, SyntaxNode localNameExpression, 221ArrayBuilder<SyntaxNode> expressions) 231var symbolNameExpression = factory.IdentifierName(member.Name); 232var thisSymbol = factory.MemberAccessExpression(factory.ThisExpression(), symbolNameExpression) 234var otherSymbol = factory.MemberAccessExpression(localNameExpression, symbolNameExpression); 271private static ImmutableArray<SyntaxNode> CreateIEquatableEqualsMethodStatements( 279var statements = ArrayBuilder<SyntaxNode>.GetInstance(); 281var otherNameExpression = factory.IdentifierName(OtherName); 285using var _ = ArrayBuilder<SyntaxNode>.GetInstance(out var expressions); 323SyntaxGenerator factory, SyntaxGeneratorInternal generatorInternal, Compilation compilation, ParseOptions parseOptions, SyntaxNode otherNameExpression, ArrayBuilder<SyntaxNode> expressions) 325var nullLiteral = factory.NullLiteralExpression();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateGetHashCodeMethod.cs (20)
17public static ImmutableArray<SyntaxNode> GetGetHashCodeComponents( 25var result = ArrayBuilder<SyntaxNode>.GetInstance(); 41public static ImmutableArray<SyntaxNode> CreateGetHashCodeStatementsUsingSystemHashCode( 43INamedTypeSymbol hashCodeType, ImmutableArray<SyntaxNode> memberReferences) 47var statement = factory.ReturnStatement( 55var statements = ArrayBuilder<SyntaxNode>.GetInstance(); 59var localReference = factory.IdentifierName(hashName); 60foreach (var member in memberReferences) 79public static ImmutableArray<SyntaxNode> CreateGetHashCodeMethodStatements( 128var statements = ArrayBuilder<SyntaxNode>.GetInstance(); 139var hashCodeNameExpression = factory.IdentifierName(HashCodeName); 142var permuteValue = CreateLiteralExpression(factory, hashFactor); 143foreach (var component in components) 146var rightSide = 178private static SyntaxNode SimpleLocalDeclarationStatement( 180string name, SyntaxNode initializer) 187private static SyntaxNode CreateLiteralExpression(SyntaxGenerator factory, int value) 217private static SyntaxNode GetMemberForGetHashCode( 224var getHashCodeNameExpression = factory.IdentifierName(GetHashCodeName); 225var thisSymbol = factory.MemberAccessExpression(factory.ThisExpression(),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_Negate.cs (34)
35public static SyntaxNode Negate( 38SyntaxNode expression, 45public static SyntaxNode Negate( 48SyntaxNode expressionOrPattern, 56public static SyntaxNode Negate( 59SyntaxNode expressionOrPattern, 140private static SyntaxNode GetNegationOfBinaryExpression( 141SyntaxNode expressionNode, 194SyntaxNode innerPattern; 203var typeExpression = generatorInternal.Type(isTypeOperation.TypeOperand, typeContext: false); 232private static SyntaxNode GetNegationOfBinaryPattern( 233SyntaxNode pattern, 247var newLeft = generator.Negate(generatorInternal, left, semanticModel, cancellationToken); 248var newRight = generator.Negate(generatorInternal, right, semanticModel, cancellationToken); 262private static SyntaxNode GetNegationOfIsPatternExpression(SyntaxNode isExpression, SyntaxGenerator generator, SyntaxGeneratorInternal generatorInternal, SemanticModel semanticModel, CancellationToken cancellationToken) 269SyntaxNode? negatedPattern = null; 304private static SyntaxNode GetNegationOfRelationalPattern( 305SyntaxNode expressionNode, 331private static bool IsLegalPattern(ISyntaxFacts syntaxFacts, SyntaxNode pattern, bool designatorsLegal) 380private static SyntaxNode NegateRelational( 383SyntaxNode leftOperand, 385SyntaxNode rightOperand) 471private static SyntaxNode GetNegationOfLiteralExpression( 472SyntaxNode expression, 477SyntaxNode newLiteralExpression; 495private static SyntaxNode GetNegationOfConstantPattern( 496SyntaxNode pattern, 520private static SyntaxNode GetNegationOfLogicalNotExpression( 521SyntaxNode expression, 531private static SyntaxNode GetNegationOfUnaryPattern( 532SyntaxNode pattern, 548private static SyntaxNode GetNegationOfNotPattern( 549SyntaxNode pattern,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Indentation\AbstractIndentationService.cs (1)
17where TSyntaxRoot : SyntaxNode, ICompilationUnitSyntax
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Indentation\IIndentationService.cs (1)
53var newRoot = document.Root.ReplaceToken(token, newToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\AddImports\AbstractAddImportsService.cs (62)
20where TCompilationUnitSyntax : SyntaxNode 21where TNamespaceDeclarationSyntax : SyntaxNode 22where TUsingOrAliasSyntax : SyntaxNode 23where TExternSyntax : SyntaxNode 30protected abstract SyntaxNode? GetAlias(TUsingOrAliasSyntax usingOrAlias); 31protected abstract ImmutableArray<SyntaxNode> GetGlobalImports(Compilation compilation, SyntaxGenerator generator); 32protected abstract SyntaxList<TUsingOrAliasSyntax> GetUsingsAndAliases(SyntaxNode node); 33protected abstract SyntaxList<TExternSyntax> GetExterns(SyntaxNode node); 48private bool HasAliases(SyntaxNode node) => GetUsingsAndAliases(node).Any(IsAlias); 49private bool HasUsings(SyntaxNode node) => GetUsingsAndAliases(node).Any(IsSimpleUsing); 50private bool HasStaticUsings(SyntaxNode node) => GetUsingsAndAliases(node).Any(IsStaticUsing); 51private bool HasExterns(SyntaxNode node) => GetExterns(node).Any(); 52private bool HasAnyImports(SyntaxNode node) => GetUsingsAndAliases(node).Any() || GetExterns(node).Any(); 56SyntaxNode root, 57SyntaxNode? contextLocation, 58SyntaxNode import, 66private static ImmutableArray<SyntaxNode> GetAllContainers(SyntaxNode root, SyntaxNode? contextLocation) 70var applicableContainer = GetFirstApplicableContainer(contextLocation); 71return applicableContainer.GetAncestorsOrThis<SyntaxNode>().ToImmutableArray(); 75SyntaxNode import, ImmutableArray<SyntaxNode> containers, ImmutableArray<SyntaxNode> globalImports) 77foreach (var node in containers) 90foreach (var node in globalImports) 101protected abstract bool IsEquivalentImport(SyntaxNode a, SyntaxNode b); 103public SyntaxNode GetImportContainer(SyntaxNode root, SyntaxNode? contextLocation, SyntaxNode import, AddImportPlacementOptions options) 107out var externContainer, out var usingContainer, out var staticUsingContainer, out var aliasContainer); 130public SyntaxNode AddImports( 132SyntaxNode root, 133SyntaxNode? contextLocation, 134IEnumerable<SyntaxNode> newImports, 151out var externContainer, out var usingContainer, out var aliasContainer, out var staticUsingContainer); 153var newRoot = Rewrite( 161protected abstract SyntaxNode Rewrite( 163SyntaxNode externContainer, SyntaxNode usingContainer, SyntaxNode staticUsingContainer, SyntaxNode aliasContainer, 164AddImportPlacementOptions options, SyntaxNode root, CancellationToken cancellationToken); 166private void GetContainers(SyntaxNode root, SyntaxNode contextLocation, AddImportPlacementOptions options, out SyntaxNode externContainer, out SyntaxNode usingContainer, out SyntaxNode staticUsingContainer, out SyntaxNode aliasContainer) 168var applicableContainer = GetFirstApplicableContainer(contextLocation); 169var contextSpine = applicableContainer.GetAncestorsOrThis<SyntaxNode>().ToImmutableArray(); 194private static SyntaxNode? GetFirstApplicableContainer(SyntaxNode contextNode) 200(SyntaxNode?)node.GetAncestorOrThis<TCompilationUnitSyntax>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\AddImports\AddImportHelpers.cs (2)
20where TRootSyntax : SyntaxNode 21where TImportDirectiveSyntax : SyntaxNode
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\AddImports\IAddImportsService.cs (15)
29bool HasExistingImport(Compilation compilation, SyntaxNode root, SyntaxNode? contextLocation, SyntaxNode import, SyntaxGenerator generator); 35SyntaxNode GetImportContainer(SyntaxNode root, SyntaxNode? contextLocation, SyntaxNode import, AddImportPlacementOptions options); 37SyntaxNode AddImports( 38Compilation compilation, SyntaxNode root, SyntaxNode? contextLocation, 39IEnumerable<SyntaxNode> newImports, SyntaxGenerator generator, AddImportPlacementOptions options, CancellationToken cancellationToken); 44public static SyntaxNode AddImport( 45this IAddImportsService service, Compilation compilation, SyntaxNode root, 46SyntaxNode contextLocation, SyntaxNode newImport, SyntaxGenerator generator, AddImportPlacementOptions options,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.cs (14)
26where TStatementSyntax : SyntaxNode 28where TVariableDeclaratorSyntax : SyntaxNode 30protected abstract bool IsMeaningfulBlock(SyntaxNode node); 31protected abstract bool CanMoveToBlock(ILocalSymbol localSymbol, SyntaxNode currentBlock, SyntaxNode destinationBlock); 32protected abstract SyntaxNode GetVariableDeclaratorSymbolNode(TVariableDeclaratorSyntax variableDeclarator); 35protected abstract Task<bool> TypesAreCompatibleAsync(Document document, ILocalSymbol localSymbol, TLocalDeclarationStatementSyntax declarationStatement, SyntaxNode right, CancellationToken cancellationToken); 37public async Task<bool> CanMoveDeclarationNearReferenceAsync(Document document, SyntaxNode node, CancellationToken cancellationToken) 43private async Task<State> ComputeStateAsync(Document document, SyntaxNode node, CancellationToken cancellationToken) 74Document document, SyntaxNode localDeclarationStatement, CancellationToken cancellationToken) 82var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 112var newRoot = editor.GetChangedRoot(); 149var originalNextStatement = state.OutermostBlockStatements[statementIndex + 1]; 185var blocks = state.InnermostBlock.GetAncestorsOrThis<SyntaxNode>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (5)
30public SyntaxNode OutermostBlock { get; private set; } 31public SyntaxNode InnermostBlock { get; private set; } 32public IReadOnlyList<SyntaxNode> OutermostBlockStatements { get; private set; } 33public IReadOnlyList<SyntaxNode> InnermostBlockStatements { get; private set; } 104var syntaxRoot = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\IMoveDeclarationNearReferenceService.cs (2)
19Task<bool> CanMoveDeclarationNearReferenceAsync(Document document, SyntaxNode localDeclarationStatement, CancellationToken cancellationToken); 26Task<Document> MoveDeclarationNearReferenceAsync(Document document, SyntaxNode localDeclarationStatement, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsService.cs (3)
19IEqualityComparer<T> where T : SyntaxNode 26public abstract Task<Document> RemoveUnnecessaryImportsAsync(Document fromDocument, Func<SyntaxNode, bool>? predicate, CancellationToken cancellationToken); 29Document document, Func<SyntaxNode, bool> predicate, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\RemoveUnnecessaryImports\IRemoveUnnecessaryImportsService.cs (1)
16Task<Document> RemoveUnnecessaryImportsAsync(Document fromDocument, Func<SyntaxNode, bool>? predicate, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\ReplaceDiscardDeclarationsWithAssignments\IReplaceDiscardDeclarationsWithAssignmentsService.cs (2)
32Task<SyntaxNode> ReplaceAsync(Document document, SyntaxNode memberDeclaration, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SemanticsFactsService\AbstractSemanticFactsService.cs (35)
40SemanticModel semanticModel, SyntaxNode location, SyntaxNode containerOpt, 48SemanticModel semanticModel, SyntaxNode location, SyntaxNode containerOpt, 56SemanticModel semanticModel, SyntaxNode location, SyntaxNode containerOpt, 64SemanticModel semanticModel, SyntaxNode location, SyntaxNode containerOpt, 73SyntaxNode location, SyntaxNode containerOpt, 91protected virtual IEnumerable<ISymbol> GetCollidableSymbols(SemanticModel semanticModel, SyntaxNode location, SyntaxNode container, CancellationToken cancellationToken) 179public bool IsWrittenTo(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken) 182public bool IsOnlyWrittenTo(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken) 185public bool IsInOutContext(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken) 188public bool IsInRefContext(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken) 191public bool IsInInContext(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken) 194public bool CanReplaceWithRValue(SemanticModel semanticModel, SyntaxNode expression, CancellationToken cancellationToken) 203public bool TryGetSpeculativeSemanticModel(SemanticModel oldSemanticModel, SyntaxNode oldNode, SyntaxNode newNode, out SemanticModel speculativeModel) 209public ForEachSymbols GetForEachSymbols(SemanticModel semanticModel, SyntaxNode forEachStatement) 212public SymbolInfo GetCollectionInitializerSymbolInfo(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken) 215public IMethodSymbol GetGetAwaiterMethod(SemanticModel semanticModel, SyntaxNode node) 218public ImmutableArray<IMethodSymbol> GetDeconstructionAssignmentMethods(SemanticModel semanticModel, SyntaxNode node) 221public ImmutableArray<IMethodSymbol> GetDeconstructionForEachMethods(SemanticModel semanticModel, SyntaxNode node) 227public IEnumerable<ISymbol> GetDeclaredSymbols(SemanticModel semanticModel, SyntaxNode memberDeclaration, CancellationToken cancellationToken) 230public IParameterSymbol FindParameterForArgument(SemanticModel semanticModel, SyntaxNode argumentNode, bool allowUncertainCandidates, bool allowParams, CancellationToken cancellationToken) 233public IParameterSymbol FindParameterForAttributeArgument(SemanticModel semanticModel, SyntaxNode argumentNode, bool allowUncertainCandidates, bool allowParams, CancellationToken cancellationToken) 236public ISymbol FindFieldOrPropertyForArgument(SemanticModel semanticModel, SyntaxNode argumentNode, CancellationToken cancellationToken) 239public ISymbol FindFieldOrPropertyForAttributeArgument(SemanticModel semanticModel, SyntaxNode argumentNode, CancellationToken cancellationToken) 242public ImmutableArray<ISymbol> GetBestOrAllSymbols(SemanticModel semanticModel, SyntaxNode node, SyntaxToken token, CancellationToken cancellationToken) 245public bool IsInsideNameOfExpression(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken) 251public bool IsInExpressionTree(SemanticModel semanticModel, SyntaxNode node, INamedTypeSymbol expressionTypeOpt, CancellationToken cancellationToken) 254public string GenerateNameForExpression(SemanticModel semanticModel, SyntaxNode expression, bool capitalize, CancellationToken cancellationToken) 257public IPreprocessingSymbol GetPreprocessingSymbol(SemanticModel semanticModel, SyntaxNode node)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SemanticsFactsService\ISemanticFactsService.cs (12)
27SemanticModel semanticModel, SyntaxNode location, 28SyntaxNode? container, string baseName, CancellationToken cancellationToken); 31SemanticModel semanticModel, SyntaxNode location, 32SyntaxNode? container, string baseName, IEnumerable<string> usedNames, CancellationToken cancellationToken); 34SyntaxToken GenerateUniqueName(SemanticModel semanticModel, SyntaxNode location, SyntaxNode? container, string baseName, 38SemanticModel semanticModel, SyntaxNode location, 39SyntaxNode? container, string baseName, CancellationToken cancellationToken); 42SemanticModel semanticModel, SyntaxNode location, 43SyntaxNode? container, string baseName, IEnumerable<string> usedNames, CancellationToken cancellationToken); 47CommonConversion ClassifyConversion(SemanticModel semanticModel, SyntaxNode expression, ITypeSymbol destination); 49IMethodSymbol? TryGetDisposeMethod(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SyntaxFactsService\ISyntaxFactsService.cs (4)
20Task<ImmutableArray<SyntaxNode>> GetSelectedFieldsAndPropertiesAsync(SyntaxTree syntaxTree, TextSpan textSpan, bool allowPartialSelection, CancellationToken cancellationToken); 28SyntaxNode root, TContextNode contextNode, 29out SyntaxNode newRoot, out TContextNode newContextNode) where TContextNode : SyntaxNode;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SyntaxGeneratorInternalExtensions\SyntaxGeneratorInternal.cs (68)
36public abstract SyntaxNode LocalDeclarationStatement( 37SyntaxNode? type, SyntaxToken identifier, SyntaxNode? initializer = null, bool isConst = false); 42public SyntaxNode LocalDeclarationStatement(SyntaxToken name, SyntaxNode initializer) 45public abstract SyntaxNode WithInitializer(SyntaxNode variableDeclarator, SyntaxNode initializer); 47public abstract SyntaxNode EqualsValueClause(SyntaxToken operatorToken, SyntaxNode value); 51public abstract SyntaxNode ConditionalAccessExpression(SyntaxNode expression, SyntaxNode whenNotNull); 53public abstract SyntaxNode MemberBindingExpression(SyntaxNode name); 55public abstract SyntaxNode RefExpression(SyntaxNode expression); 60public abstract SyntaxNode AddParentheses(SyntaxNode expression, bool includeElasticTrivia = true, bool addSimplifierAnnotation = true); 66public abstract SyntaxNode YieldReturnStatement(SyntaxNode expression); 71/// <see cref="LocalDeclarationStatement(SyntaxNode, SyntaxToken, SyntaxNode, bool)"/>. 77public abstract SyntaxNode InterpolatedStringText(SyntaxToken textToken); 78public abstract SyntaxNode Interpolation(SyntaxNode syntaxNode); 79public abstract SyntaxNode InterpolatedStringExpression(SyntaxToken startToken, IEnumerable<SyntaxNode> content, SyntaxToken endToken); 80public abstract SyntaxNode InterpolationAlignmentClause(SyntaxNode alignment); 81public abstract SyntaxNode InterpolationFormatClause(string format); 82public abstract SyntaxNode TypeParameterList(IEnumerable<string> typeParameterNames); 99public abstract SyntaxNode Type(ITypeSymbol typeSymbol, bool typeContext); 101public abstract SyntaxNode NegateEquality(SyntaxGenerator generator, SyntaxNode binaryExpression, SyntaxNode left, BinaryOperatorKind negatedKind, SyntaxNode right); 103public abstract SyntaxNode IsNotTypeExpression(SyntaxNode expression, SyntaxNode type); 108public abstract SyntaxNode IsPatternExpression(SyntaxNode expression, SyntaxToken isToken, SyntaxNode pattern); 110public abstract SyntaxNode AndPattern(SyntaxNode left, SyntaxNode right); 111public abstract SyntaxNode ConstantPattern(SyntaxNode expression); 112public abstract SyntaxNode DeclarationPattern(INamedTypeSymbol type, string name); 113public abstract SyntaxNode GreaterThanRelationalPattern(SyntaxNode expression); 114public abstract SyntaxNode GreaterThanEqualsRelationalPattern(SyntaxNode expression); 115public abstract SyntaxNode LessThanRelationalPattern(SyntaxNode expression); 116public abstract SyntaxNode LessThanEqualsRelationalPattern(SyntaxNode expression); 117public abstract SyntaxNode NotPattern(SyntaxNode pattern); 118public abstract SyntaxNode OrPattern(SyntaxNode left, SyntaxNode right); 119public abstract SyntaxNode ParenthesizedPattern(SyntaxNode pattern); 120public abstract SyntaxNode TypePattern(SyntaxNode type); 121public abstract SyntaxNode UnaryPattern(SyntaxToken operatorToken, SyntaxNode pattern);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\AbstractTypeInferenceService.AbstractTypeInferrer.cs (6)
24private readonly HashSet<SyntaxNode> _seenExpressionInferType = []; 25private readonly HashSet<SyntaxNode> _seenExpressionGetType = []; 37protected abstract IEnumerable<TypeInferenceInfo> InferTypesWorker_DoNotCallDirectly(SyntaxNode expression); 38protected abstract IEnumerable<TypeInferenceInfo> GetTypes_DoNotCallDirectly(SyntaxNode expression, bool objectAsDefault); 49public ImmutableArray<TypeInferenceInfo> InferTypes(SyntaxNode expression, bool filterUnusable = true) 63protected IEnumerable<TypeInferenceInfo> GetTypes(SyntaxNode expression, bool objectAsDefault = false)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\AbstractTypeInferenceService.cs (2)
94SemanticModel semanticModel, SyntaxNode expression, 114SemanticModel semanticModel, SyntaxNode expression,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\ITypeInferenceService.cs (2)
29ImmutableArray<ITypeSymbol> InferTypes(SemanticModel semanticModel, SyntaxNode expression, string nameOpt, CancellationToken cancellationToken); 33ImmutableArray<TypeInferenceInfo> GetTypeInferenceInfo(SemanticModel semanticModel, SyntaxNode expression, string nameOpt, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (31)
26where TCompilationUnitSyntax : SyntaxNode 27where TExpressionSyntax : SyntaxNode 28where TStatementSyntax : SyntaxNode 29where TCrefSyntax : SyntaxNode 31protected static readonly Func<SyntaxNode, bool> s_containsAnnotations = n => n.ContainsAnnotations; 39protected abstract ImmutableArray<NodeOrTokenToReduce> GetNodesAndTokensToReduce(SyntaxNode root, Func<SyntaxNodeOrToken, bool> isNodeOrTokenOutsideSimplifySpans); 40protected abstract SemanticModel GetSpeculativeSemanticModel(ref SyntaxNode nodeToSpeculate, SemanticModel originalSemanticModel, SyntaxNode originalNode); 41protected abstract bool NodeRequiresNonSpeculativeSemanticModel(SyntaxNode node); 42protected abstract void AddImportDeclarations(TCompilationUnitSyntax root, ArrayBuilder<SyntaxNode> importDeclarations); 47protected virtual SyntaxNode TransformReducedNode(SyntaxNode reducedNode, SyntaxNode originalNode) 50public abstract SyntaxNode Expand(SyntaxNode node, SemanticModel semanticModel, SyntaxAnnotation? annotationForReplacedAliasIdentifier, Func<SyntaxNode, bool>? expandInsideNode, bool expandParameter, CancellationToken cancellationToken); 51public abstract SyntaxToken Expand(SyntaxToken token, SemanticModel semanticModel, Func<SyntaxNode, bool>? expandInsideNode, CancellationToken cancellationToken); 76var root = await semanticModel.SyntaxTree.GetRootAsync(cancellationToken).ConfigureAwait(false); 137var reducedNodesMap = new ConcurrentDictionary<SyntaxNode, SyntaxNode>(); 174SyntaxNode root, 178ConcurrentDictionary<SyntaxNode, SyntaxNode> reducedNodesMap, 240var replacedParent = isNode 251var currentNode = currentNodeOrToken.AsNode()!; 256var newRoot = root.ReplaceNode(nodeOrToken.AsNode()!, currentNode.WithAdditionalAnnotations(marker)); 299using var _ = ArrayBuilder<SyntaxNode>.GetInstance(out var importDeclarations); 314var root = await model.SyntaxTree.GetRootAsync(cancellationToken).ConfigureAwait(false); 316var unusedImports = new HashSet<SyntaxNode>(); 325var newRoot = gen.RemoveNodes(root, unusedImports); 334protected abstract void GetUnusedNamespaceImports(SemanticModel model, HashSet<SyntaxNode> namespaceImports, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\ISimplificationService.cs (4)
16SyntaxNode Expand( 17SyntaxNode node, 20Func<SyntaxNode, bool>? expandInsideNode, 27Func<SyntaxNode, bool>? expandInsideNode,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\SimplificationHelpers.cs (4)
18public static TNode CopyAnnotations<TNode>(SyntaxNode from, TNode to) where TNode : SyntaxNode 64public static ISymbol? GetOriginalSymbolInfo(SemanticModel semanticModel, SyntaxNode expression) 100public static bool IsNamespaceOrTypeOrThisParameter(SyntaxNode expression, SemanticModel semanticModel)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\Simplifiers\AbstractMemberAccessExpressionSimplifier.cs (1)
18where TExpressionSyntax : SyntaxNode
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\Simplifiers\AbstractSimplifier.cs (2)
12where TSyntax : SyntaxNode 13where TSimplifiedSyntax : SyntaxNode
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\ParsedDocument.cs (4)
28internal readonly record struct ParsedDocument(DocumentId Id, SourceText Text, SyntaxNode Root, HostLanguageServices HostLanguageServices) 38var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 53var root = SyntaxTree.WithChangedText(text).GetRoot(cancellationToken); 57public ParsedDocument WithChangedRoot(SyntaxNode root, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\SemanticDocument.cs (3)
12internal sealed class SemanticDocument(Document document, SourceText text, SyntaxNode root, SemanticModel semanticModel) 20var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 25public new async ValueTask<SemanticDocument> WithSyntaxRootAsync(SyntaxNode root, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\SyntacticDocument.cs (4)
16public readonly SyntaxNode Root; 18protected SyntacticDocument(Document document, SourceText text, SyntaxNode root) 31var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 35public ValueTask<SyntacticDocument> WithSyntaxRootAsync(SyntaxNode root, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\WorkspaceServices\SemanticModelReuse\ISemanticModelReuseWorkspaceService.cs (2)
19/// Don't call this directly. use <see cref="DocumentExtensions.ReuseExistingSpeculativeModelAsync(Document, SyntaxNode, CancellationToken)"/> (or an overload). 21ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(Document document, SyntaxNode node, CancellationToken cancellationToken);
Microsoft.CodeAnalysis.CSharp (1880)
Binder\Binder.CapturedParametersFinder.cs (1)
168if (isTypeOrValueReceiver(enclosingBinder, id, parameter.Type, out SyntaxNode? memberAccessNode, out string? memberName, out int targetMemberArity, out bool invoked))
Binder\Binder.cs (7)
77protected virtual SyntaxNode? EnclosingNameofArgument => NextRequired.EnclosingNameofArgument; 165internal virtual Binder? GetBinder(SyntaxNode node) 175internal Binder GetRequiredBinder(SyntaxNode node) 185internal virtual ImmutableArray<LocalSymbol> GetDeclaredLocalsForScope(SyntaxNode scopeDesignator) 204internal virtual SyntaxNode? ScopeDesignator 529internal static void Error(BindingDiagnosticBag diagnostics, DiagnosticInfo info, SyntaxNode syntax) 592internal void ReportDiagnosticsIfObsolete(DiagnosticBag diagnostics, Symbol symbol, SyntaxNode node, bool hasBaseReceiver)
Binder\Binder.IdentifierUsedAsValueFinder.cs (5)
35foreach (var n in nodesOfInterest) 107static Binder getEnclosingBinderForNode(CSharpSyntaxNode contextNode, Binder contextBinder, SyntaxNode targetNode) 128static bool childrenNeedChecking(SyntaxNode n) 211[NotNullWhen(true)] out SyntaxNode? memberAccessNode, 253SyntaxNode memberAccessNode,
Binder\Binder.ValueChecks.cs (31)
674internal bool CheckValueKind(SyntaxNode node, BoundExpression expr, BindValueKind valueKind, bool checkingReceiver, BindingDiagnosticBag diagnostics) 954bool checkArrayAccessValueKind(SyntaxNode node, BindValueKind valueKind, ImmutableArray<BoundExpression> indices, BindingDiagnosticBag diagnostics) 976private static void ReportThisLvalueError(SyntaxNode node, BindValueKind valueKind, bool isValueType, bool isPrimaryConstructorParameter, BindingDiagnosticBag diagnostics) 1004private void CheckAddressOfInAsyncOrIteratorMethod(SyntaxNode node, BindValueKind valueKind, BindingDiagnosticBag diagnostics) 1019private bool CheckLocalValueKind(SyntaxNode node, BoundLocal local, BindValueKind valueKind, bool checkingReceiver, BindingDiagnosticBag diagnostics) 1064private bool CheckLocalRefEscape(SyntaxNode node, BoundLocal local, SafeContext escapeTo, bool checkingReceiver, BindingDiagnosticBag diagnostics) 1109private bool CheckParameterValueKind(SyntaxNode node, BoundParameter parameter, BindValueKind valueKind, bool checkingReceiver, BindingDiagnosticBag diagnostics) 1172static void reportReadOnlyParameterError(ParameterSymbol parameterSymbol, SyntaxNode node, BindValueKind valueKind, bool checkingReceiver, BindingDiagnosticBag diagnostics) 1256private bool CheckParameterValEscape(SyntaxNode node, ParameterSymbol parameter, SafeContext escapeTo, BindingDiagnosticBag diagnostics) 1274private bool CheckParameterRefEscape(SyntaxNode node, BoundExpression parameter, ParameterSymbol parameterSymbol, SafeContext escapeTo, bool checkingReceiver, BindingDiagnosticBag diagnostics) 1317private bool CheckFieldValueKind(SyntaxNode node, BoundFieldAccess fieldAccess, BindValueKind valueKind, bool checkingReceiver, BindingDiagnosticBag diagnostics) 1457private bool CheckSimpleAssignmentValueKind(SyntaxNode node, BoundAssignmentOperator assignment, BindValueKind valueKind, BindingDiagnosticBag diagnostics) 1495private bool CheckFieldRefEscape(SyntaxNode node, BoundFieldAccess fieldAccess, SafeContext escapeFrom, SafeContext escapeTo, BindingDiagnosticBag diagnostics) 1519private bool CheckFieldLikeEventRefEscape(SyntaxNode node, BoundEventAccess eventAccess, SafeContext escapeFrom, SafeContext escapeTo, BindingDiagnosticBag diagnostics) 1544SyntaxNode eventSyntax = GetEventName(boundEvent); //does not include receiver 1605private bool CheckIsValidReceiverForVariable(SyntaxNode node, BoundExpression receiver, BindValueKind kind, BindingDiagnosticBag diagnostics) 1633SyntaxNode callSyntaxOpt, 1634SyntaxNode node, 1676private bool CheckPropertyValueKind(SyntaxNode node, BoundExpression expr, BindValueKind valueKind, bool checkingReceiver, BindingDiagnosticBag diagnostics) 1684SyntaxNode propertySyntax; 1899private bool IsBadBaseAccess(SyntaxNode node, BoundExpression receiverOpt, Symbol member, BindingDiagnosticBag diagnostics, 2111SyntaxNode syntax, 2204SyntaxNode syntax, 2728SyntaxNode syntax, 2769SyntaxNode syntax, 2869SyntaxNode syntax, 3064private static void ReportReadonlyLocalError(SyntaxNode node, LocalSymbol local, BindValueKind kind, bool checkingReceiver, BindingDiagnosticBag diagnostics) 3223private static void ReportReadOnlyFieldError(FieldSymbol field, SyntaxNode node, BindValueKind kind, bool checkingReceiver, BindingDiagnosticBag diagnostics) 3259private static void ReportReadOnlyError(Symbol symbol, SyntaxNode node, BindValueKind kind, bool checkingReceiver, BindingDiagnosticBag diagnostics) 3625internal bool CheckRefEscape(SyntaxNode node, BoundExpression expr, SafeContext escapeFrom, SafeContext escapeTo, bool checkingReceiver, BindingDiagnosticBag diagnostics) 4703internal bool CheckValEscape(SyntaxNode node, BoundExpression expr, SafeContext escapeFrom, SafeContext escapeTo, bool checkingReceiver, BindingDiagnosticBag diagnostics)
Binder\Binder_Await.cs (10)
28private BoundAwaitExpression BindAwait(BoundExpression expression, SyntaxNode node, BindingDiagnosticBag diagnostics) 51internal BoundAwaitableInfo BindAwaitInfo(BoundAwaitableValuePlaceholder placeholder, SyntaxNode node, BindingDiagnosticBag diagnostics, ref bool hasErrors, BoundExpression? expressionOpt = null) 120var syntax = expression.Syntax; 245SyntaxNode node, 259SyntaxNode node, 295private static bool ValidateAwaitedExpression(BoundExpression expression, SyntaxNode node, BindingDiagnosticBag diagnostics) 323private bool GetGetAwaiterMethod(BoundExpression expression, SyntaxNode node, BindingDiagnosticBag diagnostics, [NotNullWhen(true)] out BoundExpression? getAwaiterCall) 368private bool GetIsCompletedProperty(TypeSymbol awaiterType, SyntaxNode node, TypeSymbol awaitedExpressionType, BindingDiagnosticBag diagnostics, [NotNullWhen(true)] out PropertySymbol? isCompletedProperty) 411private bool AwaiterImplementsINotifyCompletion(TypeSymbol awaiterType, SyntaxNode node, BindingDiagnosticBag diagnostics) 435private bool GetGetResultMethod(BoundExpression awaiterExpression, SyntaxNode node, TypeSymbol awaitedExpressionType, BindingDiagnosticBag diagnostics, out MethodSymbol? getResultMethod, [NotNullWhen(true)] out BoundExpression? getAwaiterGetResultCall)
Binder\Binder_Conversions.cs (6)
42SyntaxNode syntax, 54SyntaxNode syntax, 96SyntaxNode syntax, 300void reportUseSiteDiagnostics(SyntaxNode syntax, Conversion conversion, BoundExpression source, TypeSymbol destination, BindingDiagnosticBag diagnostics) 314void ensureAllUnderlyingConversionsChecked(SyntaxNode syntax, BoundExpression source, Conversion conversion, bool wasCompilerGenerated, TypeSymbol destination, BindingDiagnosticBag diagnostics) 407void checkConstraintLanguageVersionAndRuntimeSupportForConversion(SyntaxNode syntax, Conversion conversion, BoundExpression source, TypeSymbol destination, BindingDiagnosticBag diagnostics)
Binder\Binder_Crefs.cs (1)
1027SyntaxNode? parentSyntax = syntax.Parent; // Could be null when speculating.
Binder\Binder_Deconstruct.cs (7)
244SyntaxNode syntax, 245SyntaxNode rightSyntax, 436internal DeconstructionVariable(BoundExpression variable, SyntaxNode syntax) 443internal DeconstructionVariable(ArrayBuilder<DeconstructionVariable> variables, SyntaxNode syntax) 614SyntaxNode rightSyntax, 714private BoundBadExpression MissingDeconstruct(BoundExpression receiver, SyntaxNode rightSyntax, int numParameters, BindingDiagnosticBag diagnostics, 852SyntaxNode syntax,
Binder\Binder_Expressions.cs (105)
106private BoundBadExpression BadExpression(SyntaxNode syntax) 114private BoundBadExpression BadExpression(SyntaxNode syntax, BoundExpression childNode) 122private BoundBadExpression BadExpression(SyntaxNode syntax, ImmutableArray<BoundExpression> childNodes) 130protected BoundBadExpression BadExpression(SyntaxNode syntax, LookupResultKind lookupResultKind) 138protected BoundBadExpression BadExpression(SyntaxNode syntax, LookupResultKind lookupResultKind, BoundExpression childNode) 146private BoundBadExpression BadExpression(SyntaxNode syntax, LookupResultKind resultKind, ImmutableArray<Symbol> symbols) 159private BoundBadExpression BadExpression(SyntaxNode syntax, LookupResultKind resultKind, ImmutableArray<Symbol> symbols, BoundExpression childNode) 172private BoundBadExpression BadExpression(SyntaxNode syntax, LookupResultKind resultKind, ImmutableArray<Symbol> symbols, ImmutableArray<BoundExpression> childNodes, bool wasCompilerGenerated = false) 413var syntax = expr.Syntax; 455TryGetPrimaryConstructorParameterUsedAsValue(primaryConstructor, result) is (ParameterSymbol parameter, SyntaxNode syntax) && 1199private static string InferTupleElementName(SyntaxNode syntax) 2209var declarator = localSymbol.GetDeclaratorSyntax(); 2245private BoundExpression SynthesizeReceiver(SyntaxNode node, Symbol member, BindingDiagnosticBag diagnostics) 2321private BoundExpression TryBindInteractiveReceiver(SyntaxNode syntax, NamedTypeSymbol memberDeclaringType) 2472private BoundThisReference ThisReference(SyntaxNode node, NamedTypeSymbol thisTypeOpt, bool hasErrors = false, bool wasCompilerGenerated = false) 2721SyntaxNode syntax, 2931private static NameSyntax GetNameSyntax(SyntaxNode syntax) 2944internal static NameSyntax GetNameSyntax(SyntaxNode syntax, out string nameString) 3245internal static void CheckRestrictedTypeInAsyncMethod(Symbol containingSymbol, TypeSymbol type, BindingDiagnosticBag diagnostics, SyntaxNode syntax) 3260internal GlobalExpressionVariable LookupDeclaredField(SyntaxNode node, string identifier) 3376SyntaxNode node, 3591SyntaxNode node, 3853SyntaxNode placeholderSyntax; 4522private bool ReportBadStackAllocPosition(SyntaxNode node, BindingDiagnosticBag diagnostics) 4547private TypeSymbol GetStackAllocType(SyntaxNode node, TypeWithAnnotations elementTypeWithAnnotations, BindingDiagnosticBag diagnostics, out bool hasErrors) 4573static bool isStackallocTargetTyped(SyntaxNode node) 4577SyntaxNode equalsValueClause = node.Parent; 4584SyntaxNode variableDeclarator = equalsValueClause.Parent; 4591SyntaxNode variableDeclaration = variableDeclarator.Parent; 4604SyntaxNode node, 4984if (TryGetPrimaryConstructorParameterUsedAsValue(primaryConstructor, analyzedArguments.Argument(i)) is (ParameterSymbol parameter, SyntaxNode syntax)) 5079private static (ParameterSymbol, SyntaxNode) TryGetPrimaryConstructorParameterUsedAsValue(SynthesizedPrimaryConstructor primaryConstructor, BoundExpression boundExpression) 5290private BoundExpression BindDelegateCreationExpression(SyntaxNode node, NamedTypeSymbol type, AnalyzedArguments analyzedArguments, InitializerExpressionSyntax initializerOpt, bool wasTargetTyped, BindingDiagnosticBag diagnostics) 5497SyntaxNode node, 5538private BoundExpression MakeBadExpressionForObjectCreation(SyntaxNode node, TypeSymbol type, AnalyzedArguments analyzedArguments, InitializerExpressionSyntax? initializerOpt, SyntaxNode? typeSyntax, BindingDiagnosticBag diagnostics, bool wasCompilerGenerated = false) 5559SyntaxNode typeSyntax, 5592SyntaxNode typeSyntax, 6063var memberInitializerSyntax = boundMemberInitializer.Syntax; 6096SyntaxNode creationSyntax, 6159private static void ReportMembersRequiringInitialization(SyntaxNode creationSyntax, ImmutableSegmentedDictionary<string, Symbol>.Builder requiredMembersBuilder, BindingDiagnosticBag diagnostics) 6360SyntaxNode elementInitializer, 6412SyntaxNode elementInitializer, 6614SyntaxNode node, 6616SyntaxNode typeNode, 6711SyntaxNode node, 6712SyntaxNode typeNode, 6796SyntaxNode node, 6797SyntaxNode typeNode, 6855private BoundObjectInitializerExpressionBase MakeBoundInitializerOpt(SyntaxNode typeNode, NamedTypeSymbol type, InitializerExpressionSyntax initializerSyntaxOpt, TypeSymbol initializerTypeOpt, BindingDiagnosticBag diagnostics) 6877private BoundExpression BindInterfaceCreationExpression(SyntaxNode node, NamedTypeSymbol type, BindingDiagnosticBag diagnostics, SyntaxNode typeNode, AnalyzedArguments analyzedArguments, InitializerExpressionSyntax initializerOpt, bool wasTargetTyped) 6903private BoundExpression BindComImportCoClassCreationExpression(SyntaxNode node, NamedTypeSymbol interfaceType, NamedTypeSymbol coClassType, BindingDiagnosticBag diagnostics, SyntaxNode typeNode, AnalyzedArguments analyzedArguments, InitializerExpressionSyntax initializerOpt, bool wasTargetTyped) 6985SyntaxNode node, 6989SyntaxNode typeNode, 7036private static bool TypeParameterHasParameterlessConstructor(SyntaxNode node, TypeParameterSymbol typeParameter, BindingDiagnosticBag diagnostics) 7048SyntaxNode node, TypeParameterSymbol typeParameter, AnalyzedArguments analyzedArguments, InitializerExpressionSyntax? initializerOpt, 7049SyntaxNode typeSyntax, bool wasTargetTyped, BindingDiagnosticBag diagnostics) 7875private void WarnOnAccessOfOffDefault(SyntaxNode node, BoundExpression boundLeft, BindingDiagnosticBag diagnostics) 7924SyntaxNode node, 7925SyntaxNode right, 8022var nameSyntax = node.NameSyntax; 8032SyntaxNode node, 8033SyntaxNode name, 8113var nameSyntax = node.NameSyntax; 8122SyntaxNode node, 8221SyntaxNode node, 8222SyntaxNode right, 8340SyntaxNode expression, 8462SyntaxNode node, 8514SyntaxNode node, 8674SyntaxNode node, 8694private void CheckReceiverAndRuntimeSupportForSymbolAccess(SyntaxNode node, BoundExpression receiverOpt, Symbol symbol, BindingDiagnosticBag diagnostics) 8754SyntaxNode node, 8800SyntaxNode node, 8850private Symbol GetSymbolOrMethodOrPropertyGroup(LookupResult result, SyntaxNode node, string plainName, int arity, ArrayBuilder<Symbol> methodOrPropertyGroup, BindingDiagnosticBag diagnostics, out bool wasError, NamespaceOrTypeSymbol qualifierOpt) 9209static void checkInlineArrayBounds(SyntaxNode location, int index, int end, bool excludeEnd, BindingDiagnosticBag diagnostics) 9219SyntaxNode location; 9229internal static int? InferConstantIndexFromSystemIndex(CSharpCompilation compilation, BoundExpression convertedIndex, int length, out SyntaxNode location) 9262private BoundExpression BadIndexerExpression(SyntaxNode node, BoundExpression expr, AnalyzedArguments analyzedArguments, DiagnosticInfo errorOpt, BindingDiagnosticBag diagnostics) 9274SyntaxNode node, 9308private BoundExpression BindArrayAccess(SyntaxNode node, BoundExpression expr, AnalyzedArguments arguments, BindingDiagnosticBag diagnostics) 9406var node = index.Syntax; 9458private BoundExpression TryImplicitConversionToArrayIndex(BoundExpression expr, WellKnownType wellKnownType, SyntaxNode node, BindingDiagnosticBag diagnostics) 9479private BoundExpression TryImplicitConversionToArrayIndex(BoundExpression expr, SpecialType specialType, SyntaxNode node, BindingDiagnosticBag diagnostics) 9496private BoundExpression TryImplicitConversionToArrayIndex(BoundExpression expr, TypeSymbol targetType, SyntaxNode node, BindingDiagnosticBag diagnostics) 9520private BoundExpression BindPointerElementAccess(SyntaxNode node, BoundExpression expr, AnalyzedArguments analyzedArguments, BindingDiagnosticBag diagnostics) 9581private BoundExpression BindIndexerAccess(SyntaxNode node, BoundExpression expr, AnalyzedArguments analyzedArguments, BindingDiagnosticBag diagnostics) 9653var syntax = propertyGroup.Syntax; 9681private BoundExpression BindIndexedPropertyAccess(SyntaxNode syntax, BoundExpression receiver, ImmutableArray<PropertySymbol> propertyGroup, AnalyzedArguments arguments, BindingDiagnosticBag diagnostics) 9695SyntaxNode syntax, 9739SyntaxNode syntax, 9779SyntaxNode syntax, 9886SyntaxNode syntax, 9971SyntaxNode syntax, 10004SyntaxNode syntax, 10109void makeCall(SyntaxNode syntax, BoundExpression receiver, MethodSymbol method, 10142SyntaxNode syntax, 10167SyntaxNode syntax, 10182bool tryLookupLengthOrCount(SyntaxNode syntax, string propertyName, [NotNullWhen(true)] out PropertySymbol? valid, BindingDiagnosticBag diagnostics) 10260SyntaxNode expression, 10308SyntaxNode expression, 10793SyntaxNode syntax, 10905Location location = null, SyntaxNode node = null)
Binder\Binder_InterpolatedString.cs (5)
339SyntaxNode syntax = unconvertedSource.Syntax; 370ImmutableArray<BoundExpression> makeInterpolatedStringFactoryArguments(SyntaxNode syntax, ImmutableArray<BoundExpression> parts, BindingDiagnosticBag diagnostics) 515private BoundBinaryOperator UpdateBinaryOperatorWithInterpolatedContents(BoundBinaryOperator originalOperator, ImmutableArray<ImmutableArray<BoundExpression>> appendCalls, InterpolatedStringHandlerData data, SyntaxNode rootSyntax, BindingDiagnosticBag diagnostics) 633SyntaxNode syntax, 817static void populateArguments(SyntaxNode syntax, ImmutableArray<BoundInterpolatedStringArgumentPlaceholder> additionalConstructorArguments, int baseStringLength, int numFormatHoles, NamedTypeSymbol intType, ArrayBuilder<BoundExpression> argumentsBuilder)
Binder\Binder_Invocation.cs (30)
78SyntaxNode node, 158private static void ReportMakeInvocationExpressionBadMemberKind(SyntaxNode node, string methodName, BoundExpression boundExpression, BindingDiagnosticBag diagnostics) 321SyntaxNode node, 322SyntaxNode expression, 391SyntaxNode node, 543SyntaxNode node, 621SyntaxNode node, 622SyntaxNode expression, 677private void ReportMemberNotSupportedByDynamicDispatch<TMember>(SyntaxNode syntax, MemberResolutionResult<TMember> candidate, BindingDiagnosticBag diagnostics) 690SyntaxNode syntax, 691SyntaxNode expression, 846private void ReportDynamicInvocationWarnings(SyntaxNode syntax, BoundMethodGroup methodGroup, BindingDiagnosticBag diagnostics, ImmutableArray<MemberResolutionResult<MethodSymbol>> finalApplicableCandidates) 856private bool IsAmbiguousDynamicParamsArgument<TMethodOrPropertySymbol>(ArrayBuilder<BoundExpression> arguments, MemberResolutionResult<TMethodOrPropertySymbol> candidate, out SyntaxNode argumentSyntax) 882SyntaxNode syntax, 916if (IsAmbiguousDynamicParamsArgument(resolution.AnalyzedArguments.Arguments, methodResolutionResult, out SyntaxNode argumentSyntax)) 935SyntaxNode syntax, 936SyntaxNode expression, 971SyntaxNode syntax, 1099SyntaxNode node, 1100SyntaxNode expression, 1348private static SourceLocation GetCallerLocation(SyntaxNode syntax) 1363private BoundExpression GetDefaultParameterSpecialNoConversion(SyntaxNode syntax, ParameterSymbol parameter, BindingDiagnosticBag diagnostics) 1464SyntaxNode node, 1597BoundExpression bindDefaultArgument(SyntaxNode syntax, ParameterSymbol parameter, Symbol? containingMember, bool enableCallerInfo, BindingDiagnosticBag diagnostics, ArrayBuilder<BoundExpression> argumentsBuilder, int argumentsCount, ImmutableArray<int> argsToParamsOpt) 1717private BoundExpression CreateParamsCollection(SyntaxNode node, ParameterSymbol paramsParameter, ImmutableArray<BoundExpression> collectionArgs, BindingDiagnosticBag diagnostics) 1802private static Location GetLocationForOverloadResolutionDiagnostic(SyntaxNode node, SyntaxNode expression) 1913SyntaxNode node, 2167SyntaxNode node, 2342private BoundFunctionPointerInvocation BindFunctionPointerInvocation(SyntaxNode node, BoundExpression boundExpression, AnalyzedArguments analyzedArguments, BindingDiagnosticBag diagnostics)
Binder\Binder_Lambda.cs (4)
428[ThreadStatic] private static PooledDictionary<SyntaxNode, int>? s_lambdaBindings; 435where TSyntax : SyntaxNode 439var bindings = PooledDictionary<SyntaxNode, int>.GetInstance(); 470internal static void RecordLambdaBinding(SyntaxNode syntax)
Binder\Binder_Lookup.cs (1)
1673internal bool IsAccessible(Symbol symbol, SyntaxNode syntax, BindingDiagnosticBag diagnostics)
Binder\Binder_Operators.cs (4)
2380private bool CheckConstraintLanguageVersionAndRuntimeSupportForOperator(SyntaxNode node, MethodSymbol? methodOpt, bool isUnsignedRightShift, TypeSymbol? constrainedToTypeOpt, BindingDiagnosticBag diagnostics) 4375private void ValidateRefConditionalOperator(SyntaxNode node, BoundExpression trueExpr, BoundExpression falseExpr, BindingDiagnosticBag diagnostics) 4434private void CheckNativeIntegerFeatureAvailability(BinaryOperatorKind operatorKind, SyntaxNode syntax, BindingDiagnosticBag diagnostics) 4450private void CheckNativeIntegerFeatureAvailability(UnaryOperatorKind operatorKind, SyntaxNode syntax, BindingDiagnosticBag diagnostics)
Binder\Binder_Patterns.cs (9)
46SyntaxNode node, 346private bool IsCountableAndIndexable(SyntaxNode node, TypeSymbol inputType, out PropertySymbol? lengthProperty) 354private bool BindLengthAndIndexerForListPattern(SyntaxNode node, TypeSymbol inputType, BindingDiagnosticBag diagnostics, 417SyntaxNode node, 722SyntaxNode typeSyntax, 896CheckRestrictedTypeInAsyncMethod(this.ContainingMemberOrLambda, declType.Type, diagnostics, typeSyntax ?? (SyntaxNode)designation); 1234SyntaxNode node, 1296private static FieldSymbol? CheckIsTupleElement(SyntaxNode node, NamedTypeSymbol tupleType, string name, int tupleIndex, BindingDiagnosticBag diagnostics) 1797TypeSymbol? leastSpecificType(SyntaxNode node, ArrayBuilder<TypeSymbol> candidates, BindingDiagnosticBag diagnostics)
Binder\Binder_Query.cs (1)
121private static string GetFirstInvokedMethodName(QueryExpressionSyntax query, out SyntaxNode correspondingAccessNode)
Binder\Binder_QueryErrors.cs (2)
26SyntaxNode queryClause, 33for (SyntaxNode node = queryClause; ; node = node.Parent)
Binder\Binder_Statements.cs (21)
754internal MethodSymbol TryFindDisposePatternMethod(BoundExpression expr, SyntaxNode syntaxNode, bool hasAwait, BindingDiagnosticBag diagnostics, out bool isExpanded) 1233SyntaxNode initializerSyntax = initializerOpt.Syntax; 1363SyntaxNode initializerSyntax = initializer.Syntax; 1474SyntaxNode node, 1531SyntaxNode node, 1625internal static PropertySymbol GetPropertySymbol(BoundExpression expr, out BoundExpression receiver, out SyntaxNode propertySyntax) 1678var syntax = expr.Syntax; 1724private static SyntaxNode GetEventName(BoundEventAccess expr) 1726SyntaxNode syntax = expr.Syntax; 1994private static Location GetAnonymousFunctionLocation(SyntaxNode node) 2002internal void GenerateAnonymousFunctionConversionError(BindingDiagnosticBag diagnostics, SyntaxNode syntax, 2231protected static void GenerateImplicitConversionError(BindingDiagnosticBag diagnostics, CSharpCompilation compilation, SyntaxNode syntax, 2301SyntaxNode syntax, 2446var nodeForError = syntax; 3127SyntaxNode syntax, 3372private void ReportCantConvertLambdaReturn(SyntaxNode syntax, BindingDiagnosticBag diagnostics) 3399private static Location GetLocationForDiagnostics(SyntaxNode node) 3416private static bool IsValidStatementExpression(SyntaxNode syntax, BoundExpression expression) 3535private static bool IsValidExpressionBody(SyntaxNode expressionSyntax, BoundExpression expression) 3781internal BoundExpressionStatement? BindImplicitConstructorInitializer(SyntaxNode ctorSyntax, BindingDiagnosticBag diagnostics) 4098SyntaxNode syntaxNode, BindingDiagnosticBag diagnostics, out MethodSymbol result, out bool isExpanded)
Binder\Binder_Symbols.cs (24)
192private NamespaceOrTypeOrAliasSymbolWithAnnotations BindTypeOrAliasOrKeyword(SyntaxToken identifier, SyntaxNode syntax, BindingDiagnosticBag diagnostics, out bool isKeyword) 1094private NamespaceOrTypeOrAliasSymbolWithAnnotations UnwrapAlias(in NamespaceOrTypeOrAliasSymbolWithAnnotations symbol, BindingDiagnosticBag diagnostics, SyntaxNode syntax, ConsList<TypeSymbol> basesBeingResolved = null) 1105private NamespaceOrTypeOrAliasSymbolWithAnnotations UnwrapAlias(in NamespaceOrTypeOrAliasSymbolWithAnnotations symbol, out AliasSymbol alias, BindingDiagnosticBag diagnostics, SyntaxNode syntax, ConsList<TypeSymbol> basesBeingResolved = null) 1116private Symbol UnwrapAlias(Symbol symbol, BindingDiagnosticBag diagnostics, SyntaxNode syntax, ConsList<TypeSymbol> basesBeingResolved = null) 1122private Symbol UnwrapAlias(Symbol symbol, out AliasSymbol alias, BindingDiagnosticBag diagnostics, SyntaxNode syntax, ConsList<TypeSymbol> basesBeingResolved = null) 1372private NamedTypeSymbol ConstructNamedTypeUnlessTypeArgumentOmitted(SyntaxNode typeSyntax, NamedTypeSymbol type, SeparatedSyntaxList<TypeSyntax> typeArgumentsSyntax, ImmutableArray<TypeWithAnnotations> typeArguments, BindingDiagnosticBag diagnostics) 1416SyntaxNode syntax, 1570SyntaxNode typeSyntax, 1649internal NamedTypeSymbol GetSpecialType(SpecialType typeId, BindingDiagnosticBag diagnostics, SyntaxNode node) 1654internal static NamedTypeSymbol GetSpecialType(CSharpCompilation compilation, SpecialType typeId, SyntaxNode node, BindingDiagnosticBag diagnostics) 1674internal Symbol GetSpecialTypeMember(SpecialMember member, BindingDiagnosticBag diagnostics, SyntaxNode syntax) 1679internal static Symbol GetSpecialTypeMember(CSharpCompilation compilation, SpecialMember member, BindingDiagnosticBag diagnostics, SyntaxNode syntax) 1687internal static bool TryGetSpecialTypeMember<TSymbol>(CSharpCompilation compilation, SpecialMember specialMember, SyntaxNode syntax, BindingDiagnosticBag diagnostics, out TSymbol symbol, bool isOptional = false) 1743internal static bool ReportUseSite(Symbol symbol, BindingDiagnosticBag diagnostics, SyntaxNode node) 1768internal NamedTypeSymbol GetWellKnownType(WellKnownType type, BindingDiagnosticBag diagnostics, SyntaxNode node) 1786internal static NamedTypeSymbol GetWellKnownType(CSharpCompilation compilation, WellKnownType type, BindingDiagnosticBag diagnostics, SyntaxNode node) 1811internal Symbol GetWellKnownTypeMember(WellKnownMember member, BindingDiagnosticBag diagnostics, Location location = null, SyntaxNode syntax = null, bool isOptional = false) 1820internal static Symbol GetWellKnownTypeMember(CSharpCompilation compilation, WellKnownMember member, BindingDiagnosticBag diagnostics, Location location = null, SyntaxNode syntax = null, bool isOptional = false) 1906SyntaxNode where, 1935SyntaxNode where, 2304SyntaxNode node = where; 2545private CSDiagnosticInfo NotFound(SyntaxNode where, string simpleName, int arity, string whereText, BindingDiagnosticBag diagnostics, string aliasOpt, NamespaceOrTypeSymbol qualifierOpt, LookupOptions options) 2736internal static bool CheckFeatureAvailability(SyntaxNode syntax, MessageID feature, BindingDiagnosticBag diagnostics, Location? location = null) 2745private static bool CheckFeatureAvailability(SyntaxNode syntax, MessageID feature, DiagnosticBag? diagnostics, Location? location = null)
Binder\Binder_Unsafe.cs (1)
27internal bool ReportUnsafeIfNotAllowed(SyntaxNode node, BindingDiagnosticBag diagnostics, TypeSymbol sizeOfTypeOpt = null)
Binder\BinderFactory.BinderFactoryVisitor.cs (4)
85public override Binder DefaultVisit(SyntaxNode parent) 92public override Binder Visit(SyntaxNode node) 98private Binder VisitCore(SyntaxNode node) 1084var node = token.Parent;
Binder\BinderFactory.cs (2)
109internal Binder GetBinder(SyntaxNode node, CSharpSyntaxNode memberDeclarationOpt = null, Symbol memberOpt = null) 124internal Binder GetBinder(SyntaxNode node, int position, CSharpSyntaxNode memberDeclarationOpt = null, Symbol memberOpt = null)
Binder\BindingDiagnosticBag.cs (2)
95internal bool ReportUseSite(Symbol? symbol, SyntaxNode node) 161internal CSDiagnosticInfo Add(ErrorCode code, SyntaxNode syntax, params object[] args)
Binder\BlockBinder.cs (2)
66internal override ImmutableArray<LocalSymbol> GetDeclaredLocalsForScope(SyntaxNode scopeDesignator) 76internal override SyntaxNode ScopeDesignator
Binder\BuckStopsHereBinder.cs (3)
64protected override SyntaxNode? EnclosingNameofArgument => null; 171internal override Binder? GetBinder(SyntaxNode node) 176internal override ImmutableArray<LocalSymbol> GetDeclaredLocalsForScope(SyntaxNode scopeDesignator)
Binder\CatchClauseBinder.cs (2)
45internal override ImmutableArray<LocalSymbol> GetDeclaredLocalsForScope(SyntaxNode scopeDesignator) 60internal override SyntaxNode ScopeDesignator
Binder\CollectionInitializerAddMethodBinder.cs (2)
14public SyntaxNode Syntax { get; } 17internal CollectionInitializerAddMethodBinder(SyntaxNode syntax, TypeSymbol collectionType, Binder next)
Binder\DecisionDagBuilder.cs (19)
83SyntaxNode syntax, 99SyntaxNode syntax, 115SyntaxNode syntax, 128SyntaxNode syntax, 142SyntaxNode syntax, 167SyntaxNode syntax, 185SyntaxNode syntax, 324var syntax = pattern.Syntax; 432SyntaxNode syntax, 450SyntaxNode syntax, 540SyntaxNode syntax = pattern.Syntax; 561SyntaxNode syntax = pattern.Syntax; 737private BoundDecisionDag MakeBoundDecisionDag(SyntaxNode syntax, ref TemporaryArray<StateForCase> cases) 1033BoundDecisionDagNode finalState(SyntaxNode syntax, LabelSymbol label, ImmutableArray<BoundPatternBinding> bindings) 1246SyntaxNode syntax, 1410SyntaxNode syntax, 1988public readonly SyntaxNode Syntax; 1995SyntaxNode Syntax, 2146SyntaxNode syntax = test.Syntax;
Binder\DecisionDagBuilder_ListPatterns.cs (1)
21var syntax = list.Syntax;
Binder\EmbeddedStatementBinder.cs (2)
69internal override ImmutableArray<LocalSymbol> GetDeclaredLocalsForScope(SyntaxNode scopeDesignator) 79internal override SyntaxNode ScopeDesignator
Binder\ExecutableCodeBinder.cs (10)
28private readonly SyntaxNode _root; 29private readonly Action<Binder, SyntaxNode> _binderUpdatedHandler; 30private SmallDictionary<SyntaxNode, Binder> _lazyBinderMap; 32internal ExecutableCodeBinder(SyntaxNode root, Symbol memberSymbol, Binder next, Action<Binder, SyntaxNode> binderUpdatedHandler = null) 38internal ExecutableCodeBinder(SyntaxNode root, Symbol memberSymbol, Binder next, BinderFlags additionalFlags) 58internal override Binder GetBinder(SyntaxNode node) 66SmallDictionary<SyntaxNode, Binder> map; 83map = SmallDictionary<SyntaxNode, Binder>.Empty; 90private SmallDictionary<SyntaxNode, Binder> BinderMap
Binder\ExpressionListVariableBinder.cs (2)
33internal override SyntaxNode ScopeDesignator 41internal override ImmutableArray<LocalSymbol> GetDeclaredLocalsForScope(SyntaxNode scopeDesignator)
Binder\ExpressionVariableBinder.cs (3)
19internal override SyntaxNode ScopeDesignator { get; } 21internal ExpressionVariableBinder(SyntaxNode scopeDesignator, Binder next) : base(next) 34internal override ImmutableArray<LocalSymbol> GetDeclaredLocalsForScope(SyntaxNode scopeDesignator)
Binder\ExpressionVariableFinder.cs (10)
21private SyntaxNode _nodeToBind; 76SyntaxNode previousNodeToBind = _nodeToBind; 105SyntaxNode previousNodeToBind = _nodeToBind; 146SyntaxNode previousNodeToBind = _nodeToBind; 287protected abstract TFieldOrLocalSymbol MakePatternVariable(TypeSyntax type, SingleVariableDesignationSyntax designation, SyntaxNode nodeToBind); 532protected abstract TFieldOrLocalSymbol MakeDeclarationExpressionVariable(DeclarationExpressionSyntax node, SingleVariableDesignationSyntax designation, BaseArgumentListSyntax argumentListSyntax, SyntaxNode nodeToBind); 592protected override LocalSymbol MakePatternVariable(TypeSyntax type, SingleVariableDesignationSyntax designation, SyntaxNode nodeToBind) 618protected override LocalSymbol MakeDeclarationExpressionVariable(DeclarationExpressionSyntax node, SingleVariableDesignationSyntax designation, BaseArgumentListSyntax argumentListSyntaxOpt, SyntaxNode nodeToBind) 705protected override Symbol MakePatternVariable(TypeSyntax type, SingleVariableDesignationSyntax designation, SyntaxNode nodeToBind) 713protected override Symbol MakeDeclarationExpressionVariable(DeclarationExpressionSyntax node, SingleVariableDesignationSyntax designation, BaseArgumentListSyntax argumentListSyntaxOpt, SyntaxNode nodeToBind)
Binder\FixedStatementBinder.cs (2)
60internal override ImmutableArray<LocalSymbol> GetDeclaredLocalsForScope(SyntaxNode scopeDesignator) 75internal override SyntaxNode ScopeDesignator
Binder\ForEachLoopBinder.cs (32)
47internal override ImmutableArray<LocalSymbol> GetDeclaredLocalsForScope(SyntaxNode scopeDesignator) 62internal override SyntaxNode ScopeDesignator 105SyntaxNode deconstructionStatement, 142SyntaxNode deconstructionStatement, 660SyntaxNode syntax, 661SyntaxNode collectionSyntax, 706SyntaxNode exprSyntax = collectionExpr.Syntax; 756SyntaxNode syntax, 757SyntaxNode collectionSyntax, 812private EnumeratorResult GetEnumeratorInfoCore(SyntaxNode syntax, SyntaxNode collectionSyntax, ref BoundExpression collectionExpr, bool isAsync, BindingDiagnosticBag diagnostics, out ForEachEnumeratorInfo.Builder builder) 914EnumeratorResult getEnumeratorInfo(SyntaxNode syntax, SyntaxNode collectionSyntax, ref BoundExpression collectionExpr, bool isAsync, BindingDiagnosticBag diagnostics, out ForEachEnumeratorInfo.Builder builder) 1042private EnumeratorResult SatisfiesIEnumerableInterfaces(SyntaxNode collectionSyntax, ref ForEachEnumeratorInfo.Builder builder, BoundExpression collectionExpr, bool isAsync, BindingDiagnosticBag diagnostics, TypeSymbol unwrappedCollectionExprType) 1054SyntaxNode errorLocationSyntax = collectionSyntax; 1185private void GetDisposalInfoForEnumerator(SyntaxNode syntax, ref ForEachEnumeratorInfo.Builder builder, BoundExpression expr, bool isAsync, BindingDiagnosticBag diagnostics) 1278private ForEachEnumeratorInfo.Builder GetDefaultEnumeratorInfo(SyntaxNode syntax, ForEachEnumeratorInfo.Builder builder, BindingDiagnosticBag diagnostics, TypeSymbol collectionExprType) 1323private bool SatisfiesGetEnumeratorPattern(SyntaxNode syntax, SyntaxNode collectionSyntax, ref ForEachEnumeratorInfo.Builder builder, BoundExpression collectionExpr, bool isAsync, bool viaExtensionMethod, BindingDiagnosticBag diagnostics) 1352private MethodArgumentInfo FindForEachPatternMethod(SyntaxNode syntax, SyntaxNode collectionSyntax, TypeSymbol patternType, string methodName, LookupResult lookupResult, bool warningsOnly, BindingDiagnosticBag diagnostics, bool isAsync) 1419private MethodArgumentInfo PerformForEachPatternOverloadResolution(SyntaxNode syntax, SyntaxNode collectionSyntax, TypeSymbol patternType, ArrayBuilder<MethodSymbol> candidateMethods, bool warningsOnly, BindingDiagnosticBag diagnostics, bool isAsync) 1497private MethodArgumentInfo FindForEachPatternMethodViaExtension(SyntaxNode syntax, SyntaxNode collectionSyntax, BoundExpression collectionExpr, string methodName, BindingDiagnosticBag diagnostics) 1592private bool SatisfiesForEachPattern(SyntaxNode syntax, SyntaxNode collectionSyntax, ref ForEachEnumeratorInfo.Builder builder, bool isAsync, BindingDiagnosticBag diagnostics) 1710private void ReportEnumerableWarning(SyntaxNode collectionSyntax, BindingDiagnosticBag diagnostics, TypeSymbol enumeratorType, Symbol patternMemberCandidate) 1750SyntaxNode collectionSyntax, 1858private void ReportPatternMemberLookupDiagnostics(SyntaxNode collectionSyntax, LookupResult lookupResult, TypeSymbol patternType, string memberName, bool warningsOnly, BindingDiagnosticBag diagnostics) 1896private MethodArgumentInfo GetParameterlessSpecialTypeMemberInfo(SpecialMember member, SyntaxNode syntax, BindingDiagnosticBag diagnostics) 1906private MethodArgumentInfo BindDefaultArguments(MethodSymbol method, BoundExpression extensionReceiverOpt, bool expanded, SyntaxNode syntax, BindingDiagnosticBag diagnostics)
Binder\ForLoopBinder.cs (2)
140internal override ImmutableArray<LocalSymbol> GetDeclaredLocalsForScope(SyntaxNode scopeDesignator) 155internal override SyntaxNode ScopeDesignator
Binder\ImportChain.cs (1)
132private static Cci.ITypeReference GetTypeReference(TypeSymbol type, SyntaxNode syntaxNode, Emit.PEModuleBuilder moduleBuilder, DiagnosticBag diagnostics)
Binder\LocalBinderFactory.cs (9)
35private readonly SmallDictionary<SyntaxNode, Binder> _map; 38private readonly SyntaxNode _root; 72public static SmallDictionary<SyntaxNode, Binder> BuildMap( 74SyntaxNode syntax, 76Action<Binder, SyntaxNode> binderUpdatedHandler = null) 135private LocalBinderFactory(Symbol containingMemberOrLambda, SyntaxNode root, Binder enclosing) 140_map = new SmallDictionary<SyntaxNode, Binder>(ReferenceEqualityComparer.Instance); 1001public override void DefaultVisit(SyntaxNode node) 1009private void AddToMap(SyntaxNode node, Binder binder)
Binder\LockBinder.cs (1)
75internal static LockTypeInfo? TryFindLockTypeInfo(TypeSymbol lockType, BindingDiagnosticBag diagnostics, SyntaxNode syntax)
Binder\NameofBinder.cs (1)
58protected override SyntaxNode? EnclosingNameofArgument => IsNameofOperator ? _nameofArgument : base.EnclosingNameofArgument;
Binder\RefSafetyAnalysis.cs (1)
921private void VisitDeconstructionArguments(ArrayBuilder<DeconstructionVariable> variables, SyntaxNode syntax, Conversion conversion, BoundExpression right)
Binder\ScriptLocalScopeBinder.cs (1)
42internal override ImmutableArray<LocalSymbol> GetDeclaredLocalsForScope(SyntaxNode scopeDesignator)
Binder\Semantics\Conversions\Conversions.cs (3)
162var syntax = node.Syntax; 376public Conversion MethodGroupConversion(SyntaxNode syntax, MethodGroup methodGroup, NamedTypeSymbol delegateType, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 402public static void GetDelegateOrFunctionPointerArguments(SyntaxNode syntax, AnalyzedArguments analyzedArguments, ImmutableArray<ParameterSymbol> delegateParameters, CSharpCompilation compilation)
Binder\Semantics\OverloadResolution\OverloadResolution.cs (1)
1333SyntaxNode syntax = CSharpSyntaxTree.Dummy.GetRoot();
Binder\Semantics\OverloadResolution\OverloadResolutionResult.cs (3)
191SyntaxNode nodeOpt, 195SyntaxNode invokedExpression, 645SyntaxNode nodeOpt,
Binder\SimpleLocalScopeBinder.cs (1)
30internal override ImmutableArray<LocalSymbol> GetDeclaredLocalsForScope(SyntaxNode scopeDesignator)
Binder\SimpleProgramBinder.cs (2)
87internal override ImmutableArray<LocalSymbol> GetDeclaredLocalsForScope(SyntaxNode scopeDesignator) 97internal override SyntaxNode ScopeDesignator
Binder\SimpleProgramUnitBinder.cs (2)
57internal override ImmutableArray<LocalSymbol> GetDeclaredLocalsForScope(SyntaxNode scopeDesignator) 62internal override SyntaxNode? ScopeDesignator
Binder\SwitchBinder.cs (6)
328internal override ImmutableArray<LocalSymbol> GetDeclaredLocalsForScope(SyntaxNode scopeDesignator) 348internal override SyntaxNode ScopeDesignator 449private Dictionary<SyntaxNode, LabelSymbol> _labelsByNode; 450protected Dictionary<SyntaxNode, LabelSymbol> LabelsByNode 456var result = new Dictionary<SyntaxNode, LabelSymbol>(); 459var node = ((SourceLabelSymbol)label).IdentifierNodeOrToken.AsNode();
Binder\SwitchBinder_Patterns.cs (2)
99var syntax = label.Syntax; 190Dictionary<SyntaxNode, LabelSymbol> labelsByNode = LabelsByNode;
Binder\UsingStatementBinder.cs (3)
90internal static BoundStatement BindUsingStatementOrDeclarationFromParts(SyntaxNode syntax, SyntaxToken usingKeyword, SyntaxToken awaitKeyword, Binder originalBinder, UsingStatementBinder? usingBinderOpt, BindingDiagnosticBag diagnostics) 306internal override ImmutableArray<LocalSymbol> GetDeclaredLocalsForScope(SyntaxNode scopeDesignator) 321internal override SyntaxNode ScopeDesignator
Binder\WhileBinder.cs (2)
69internal override ImmutableArray<LocalSymbol> GetDeclaredLocalsForScope(SyntaxNode scopeDesignator) 84internal override SyntaxNode ScopeDesignator
Binder\WithLambdaParametersBinder.cs (1)
170internal override ImmutableArray<LocalSymbol> GetDeclaredLocalsForScope(SyntaxNode scopeDesignator)
BoundTree\BoundDagTemp.cs (1)
21public static BoundDagTemp ForOriginalInput(SyntaxNode syntax, TypeSymbol type) => new BoundDagTemp(syntax, type, source: null, 0);
BoundTree\BoundExpression.cs (1)
303public BoundLocal(SyntaxNode syntax, LocalSymbol localSymbol, ConstantValue? constantValueOpt, TypeSymbol type, bool hasErrors = false)
BoundTree\BoundExpressionWithNullability.cs (1)
11public BoundExpressionWithNullability(SyntaxNode syntax, BoundExpression expression, NullableAnnotation nullableAnnotation, TypeSymbol? type)
BoundTree\BoundMethodGroup.cs (3)
14SyntaxNode syntax, 28private static FunctionTypeSymbol? GetFunctionType(Binder binder, SyntaxNode syntax) 41public SyntaxNode NameSyntax
BoundTree\BoundNode.cs (3)
24public readonly SyntaxNode Syntax; 73protected BoundNode(BoundKind kind, SyntaxNode syntax) 85protected BoundNode(BoundKind kind, SyntaxNode syntax, bool hasErrors)
BoundTree\BoundObjectCreationExpression.cs (1)
12public BoundObjectCreationExpression(SyntaxNode syntax, MethodSymbol constructor, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt,
BoundTree\BoundSequencePoint.cs (2)
11public static BoundStatement Create(SyntaxNode? syntax, TextSpan? part, BoundStatement statement, bool hasErrors = false) 25public static BoundStatement Create(SyntaxNode? syntax, BoundStatement? statementOpt, bool hasErrors = false, bool wasCompilerGenerated = false)
BoundTree\BoundSpillSequence.cs (1)
16SyntaxNode syntax,
BoundTree\BoundTreeVisitors.cs (1)
185SyntaxNode syntax = node.Syntax;
BoundTree\Constructors.cs (48)
15SyntaxNode syntax, 25SyntaxNode syntax, 37SyntaxNode syntax, 87SyntaxNode syntax, 122SyntaxNode node, 168public static BoundCall Synthesized(SyntaxNode syntax, BoundExpression? receiverOpt, ThreeState initialBindingReceiverIsSubjectToCloning, MethodSymbol method) 173public static BoundCall Synthesized(SyntaxNode syntax, BoundExpression? receiverOpt, ThreeState initialBindingReceiverIsSubjectToCloning, MethodSymbol method, BoundExpression arg0) 178public static BoundCall Synthesized(SyntaxNode syntax, BoundExpression? receiverOpt, ThreeState initialBindingReceiverIsSubjectToCloning, MethodSymbol method, BoundExpression arg0, BoundExpression arg1) 183public static BoundCall Synthesized(SyntaxNode syntax, BoundExpression? receiverOpt, ThreeState initialBindingReceiverIsSubjectToCloning, MethodSymbol method, ImmutableArray<BoundExpression> arguments, ImmutableArray<RefKind> argumentRefKindsOpt = default) 253public BoundObjectCreationExpression(SyntaxNode syntax, MethodSymbol constructor, params BoundExpression[] arguments) 257public BoundObjectCreationExpression(SyntaxNode syntax, MethodSymbol constructor, ImmutableArray<BoundExpression> arguments) 266SyntaxNode node, 291SyntaxNode syntax, 328public static BoundConversion SynthesizedNonUserDefined(SyntaxNode syntax, BoundExpression operand, Conversion conversion, TypeSymbol type, ConstantValue? constantValueOpt = null) 350SyntaxNode syntax, 376SyntaxNode syntax, 400SyntaxNode syntax, 428SyntaxNode syntax, 451SyntaxNode syntax, 487SyntaxNode syntax, 530public BoundParameter(SyntaxNode syntax, ParameterSymbol parameterSymbol, bool hasErrors = false) 535public BoundParameter(SyntaxNode syntax, ParameterSymbol parameterSymbol) 543public BoundTypeExpression(SyntaxNode syntax, AliasSymbol? aliasOpt, BoundTypeExpression? boundContainingTypeOpt, ImmutableArray<BoundExpression> boundDimensionsOpt, TypeWithAnnotations typeWithAnnotations, bool hasErrors = false) 549public BoundTypeExpression(SyntaxNode syntax, AliasSymbol? aliasOpt, BoundTypeExpression? boundContainingTypeOpt, TypeWithAnnotations typeWithAnnotations, bool hasErrors = false) 554public BoundTypeExpression(SyntaxNode syntax, AliasSymbol? aliasOpt, TypeWithAnnotations typeWithAnnotations, bool hasErrors = false) 559public BoundTypeExpression(SyntaxNode syntax, AliasSymbol? aliasOpt, TypeSymbol type, bool hasErrors = false) 564public BoundTypeExpression(SyntaxNode syntax, AliasSymbol? aliasOpt, ImmutableArray<BoundExpression> dimensionsOpt, TypeWithAnnotations typeWithAnnotations, bool hasErrors = false) 572public BoundNamespaceExpression(SyntaxNode syntax, NamespaceSymbol namespaceSymbol, bool hasErrors = false) 577public BoundNamespaceExpression(SyntaxNode syntax, NamespaceSymbol namespaceSymbol) 590public BoundAssignmentOperator(SyntaxNode syntax, BoundExpression left, BoundExpression right, 599public BoundBadExpression(SyntaxNode syntax, LookupResultKind resultKind, ImmutableArray<Symbol?> symbols, ImmutableArray<BoundExpression> childBoundNodes, TypeSymbol type) 608public static BoundStatementList Synthesized(SyntaxNode syntax, params BoundStatement[] statements) 613public static BoundStatementList Synthesized(SyntaxNode syntax, bool hasErrors, params BoundStatement[] statements) 618public static BoundStatementList Synthesized(SyntaxNode syntax, ImmutableArray<BoundStatement> statements) 623public static BoundStatementList Synthesized(SyntaxNode syntax, bool hasErrors, ImmutableArray<BoundStatement> statements) 631public static BoundReturnStatement Synthesized(SyntaxNode syntax, RefKind refKind, BoundExpression expression, bool hasErrors = false) 639public static BoundYieldBreakStatement Synthesized(SyntaxNode syntax, bool hasErrors = false) 647public BoundGotoStatement(SyntaxNode syntax, LabelSymbol label, bool hasErrors = false) 655public BoundBlock(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, ImmutableArray<BoundStatement> statements, bool hasErrors = false) 660public static BoundBlock SynthesizedNoLocals(SyntaxNode syntax, BoundStatement statement) 666public static BoundBlock SynthesizedNoLocals(SyntaxNode syntax, ImmutableArray<BoundStatement> statements) 671public static BoundBlock SynthesizedNoLocals(SyntaxNode syntax, params BoundStatement[] statements) 679public BoundDefaultExpression(SyntaxNode syntax, TypeSymbol type, bool hasErrors = false) 687public BoundTryStatement(SyntaxNode syntax, BoundBlock tryBlock, ImmutableArray<BoundCatchBlock> catchBlocks, BoundBlock? finallyBlockOpt, LabelSymbol? finallyLabelOpt = null) 695public BoundAddressOfOperator(SyntaxNode syntax, BoundExpression operand, TypeSymbol type, bool hasErrors = false) 703public BoundDagTemp(SyntaxNode syntax, TypeSymbol type, BoundDagEvaluation? source) 713public BoundCompoundAssignmentOperator(SyntaxNode syntax, 743SyntaxNode syntax,
BoundTree\UnboundLambda.cs (6)
24SyntaxNode Syntax { get; } 33SyntaxNode IBoundLambdaOrFunction.Syntax { get { return Syntax; } } 80SyntaxNode IBoundLambdaOrFunction.Syntax { get { return Syntax; } } 82public BoundLambda(SyntaxNode syntax, UnboundLambda unboundLambda, BoundBlock body, ReadOnlyBindingDiagnostic<AssemblySymbol> diagnostics, Binder binder, TypeSymbol? delegateType, InferredLambdaReturnType inferredReturnType) 420private UnboundLambda(SyntaxNode syntax, UnboundLambdaState state, FunctionTypeSymbol? functionType, bool withDependencies, NullableWalker.VariableState? nullableState, bool hasErrors) : 1502var syntax = UnboundLambda.Syntax;
BoundTree\VariablePendingInference.cs (1)
61SyntaxNode typeOrDesignationSyntax = this.Syntax.Kind() == SyntaxKind.DeclarationExpression ?
CodeGen\CodeGenerator.cs (10)
27private readonly SyntaxNode _methodBodySyntaxOpt; 151_methodBodySyntaxOpt = (SyntaxNode)blockBody ?? expressionBody ?? sourceMethod?.SyntaxNode; 173var bodySyntax = _methodBodySyntaxOpt; 339private void EmitTypeReferenceToken(Cci.ITypeReference symbol, SyntaxNode syntaxNode) 344private void EmitSymbolToken(TypeSymbol symbol, SyntaxNode syntaxNode) 349private void EmitSymbolToken(MethodSymbol method, SyntaxNode syntaxNode, BoundArgListOperator optArgList, bool encodeAsRawDefinitionToken = false) 355private void EmitSymbolToken(FieldSymbol symbol, SyntaxNode syntaxNode) 361private void EmitSignatureToken(FunctionPointerTypeSymbol symbol, SyntaxNode syntaxNode) 368SyntaxNode syntax = node.Syntax; 491private void EmitSequencePoint(SyntaxNode syntax)
CodeGen\EmitAddress.cs (1)
456private void EmitStaticFieldAddress(FieldSymbol field, SyntaxNode syntaxNode)
CodeGen\EmitArrayInitializer.cs (1)
777bool tryGetReadOnlySpanArrayCtor(SyntaxNode syntax, [NotNullWhen(true)] out MethodSymbol? rosArrayCtor)
CodeGen\EmitConversion.cs (1)
377private MethodSymbol DelegateConstructor(SyntaxNode syntax, TypeSymbol delegateType)
CodeGen\EmitExpression.cs (14)
834var syntax = node.Syntax; 1431private void EmitLoadIndirect(TypeSymbol type, SyntaxNode syntaxNode) 3195private void EmitArrayElementStore(ArrayTypeSymbol arrayType, SyntaxNode syntaxNode) 3210private void EmitVectorElementStore(ArrayTypeSymbol arrayType, SyntaxNode syntaxNode) 3310private void EmitIndirectStore(TypeSymbol type, SyntaxNode syntaxNode) 3431private void EmitDefaultValue(TypeSymbol type, bool used, SyntaxNode syntaxNode) 3475private void EmitConstantExpression(TypeSymbol type, ConstantValue constantValue, bool used, SyntaxNode syntaxNode) 3491private void EmitInitObj(TypeSymbol type, bool used, SyntaxNode syntaxNode) 3573private void EmitHoistedVariableId(FieldSymbol field, SyntaxNode syntax) 3609private void EmitThrowIfModuleCancellationRequested(SyntaxNode syntax) 3631private void EmitModuleCancellationTokenLoad(SyntaxNode syntax) 3986private void EmitStaticCast(TypeSymbol to, SyntaxNode syntax) 4006private void EmitBox(TypeSymbol type, SyntaxNode syntaxNode) 4044private void EmitCallCleanup(SyntaxNode syntax, UseKind useKind, MethodSymbol method)
CodeGen\EmitStackAllocInitializer.cs (1)
69var syntaxNode = inits.Syntax;
CodeGen\EmitStatement.cs (13)
1117var localSyntax = !declaringReferences.IsEmpty ? (CSharpSyntaxNode)declaringReferences[0].GetSyntax() : catchBlock.Syntax; 1344SyntaxNode syntaxNode, 1382void emitLengthDispatch(LengthBasedStringSwitchData lengthBasedSwitchInfo, LocalOrParameter keyTemp, LabelSymbol fallThroughLabel, SyntaxNode syntaxNode) 1416void emitCharDispatches(LengthBasedStringSwitchData lengthBasedSwitchInfo, LocalOrParameter keyTemp, LabelSymbol fallThroughLabel, SyntaxNode syntaxNode) 1454void emitFinalDispatches(LengthBasedStringSwitchData lengthBasedSwitchInfo, LocalOrParameter keyTemp, TypeSymbol keyType, LabelSymbol fallThroughLabel, SyntaxNode syntaxNode) 1483SyntaxNode syntaxNode, 1624private Cci.IMethodReference? GetLengthMethodRef(SyntaxNode syntaxNode, TypeSymbol keyType, bool isReadOnlySpan, bool isSpanOrReadOnlySpan) 1648private Microsoft.Cci.IMethodReference? GetIndexerRef(SyntaxNode syntaxNode, TypeSymbol keyType, bool isReadOnlySpan, bool isSpanOrReadOnlySpan) 1683private void EmitStringCompareAndBranch(LocalOrParameter key, SyntaxNode syntaxNode, ConstantValue stringConstant, object targetLabel, Microsoft.Cci.IReference stringEqualityMethodRef) 1721private void EmitCharCompareAndBranch(LocalOrParameter key, SyntaxNode syntaxNode, ConstantValue stringConstant, object targetLabel, Cci.IReference sequenceEqualsRef, Cci.IReference asSpanRef) 1756private LocalDefinition DefineLocal(LocalSymbol local, SyntaxNode syntaxNode) 1867var syntax = local.GetDeclaratorSyntax(); 1900private LocalDefinition AllocateTemp(TypeSymbol type, SyntaxNode syntaxNode, LocalSlotConstraints slotConstraints = LocalSlotConstraints.None)
CodeGen\Optimizer.cs (4)
2354internal override SyntaxNode ScopeDesignatorOpt 2360SynthesizedLocalKind kind, SyntaxNode syntax 2406internal override ConstantValue GetConstantValue(SyntaxNode node, LocalSymbol inProgress, BindingDiagnosticBag diagnostics) 2421internal override SyntaxNode GetDeclaratorSyntax()
Compilation\CSharpCompilation.cs (5)
242internal bool IsNullableAnalysisEnabledIn(SyntaxNode syntax) 3206var root = syntaxTree.GetRoot(cancellationToken); 4546internal override int CompareSourceLocations(SyntaxNode loc1, SyntaxNode loc2) 4735Func<SyntaxNode, SyntaxKind> getKind = node => node.Kind();
Compilation\CSharpCompilationExtensions.cs (1)
17internal static bool IsFeatureEnabled(this SyntaxNode? syntax, MessageID feature)
Compilation\CSharpSemanticModel.cs (35)
474protected override IOperation GetOperationCore(SyntaxNode node, CancellationToken cancellationToken) 1008public Conversion GetConversion(SyntaxNode expression, CancellationToken cancellationToken = default(CancellationToken)) 1229internal abstract MemberSemanticModel GetMemberModel(SyntaxNode node); 1231internal bool IsInTree(SyntaxNode node) 1310protected int GetAdjustedNodePosition(SyntaxNode node) 1844var curr = token.Parent; 3973SyntaxNode parentSyntax = boundNodeForSyntacticParent.Syntax; 4948protected sealed override SyntaxNode RootCore => this.Root; 4950private SymbolInfo GetSymbolInfoFromNode(SyntaxNode node, CancellationToken cancellationToken) 4977private TypeInfo GetTypeInfoFromNode(SyntaxNode node, CancellationToken cancellationToken) 4998private ImmutableArray<ISymbol> GetMemberGroupFromNode(SyntaxNode node, CancellationToken cancellationToken) 5015protected sealed override ImmutableArray<ISymbol> GetMemberGroupCore(SyntaxNode node, CancellationToken cancellationToken) 5021protected sealed override SymbolInfo GetSpeculativeSymbolInfoCore(int position, SyntaxNode node, SpeculativeBindingOption bindingOption) 5040protected sealed override TypeInfo GetSpeculativeTypeInfoCore(int position, SyntaxNode node, SpeculativeBindingOption bindingOption) 5047protected sealed override IAliasSymbol GetSpeculativeAliasInfoCore(int position, SyntaxNode nameSyntax, SpeculativeBindingOption bindingOption) 5054protected sealed override SymbolInfo GetSymbolInfoCore(SyntaxNode node, CancellationToken cancellationToken) 5059protected sealed override TypeInfo GetTypeInfoCore(SyntaxNode node, CancellationToken cancellationToken) 5064protected sealed override IAliasSymbol GetAliasInfoCore(SyntaxNode node, CancellationToken cancellationToken) 5069protected sealed override PreprocessingSymbolInfo GetPreprocessingSymbolInfoCore(SyntaxNode node) 5076protected sealed override ISymbol GetDeclaredSymbolCore(SyntaxNode node, CancellationToken cancellationToken) 5164protected sealed override ImmutableArray<ISymbol> GetDeclaredSymbolsCore(SyntaxNode declaration, CancellationToken cancellationToken = default(CancellationToken)) 5221internal InterceptableLocation GetInterceptableLocationInternal(SyntaxNode nameSyntax, CancellationToken cancellationToken) 5253internal override void ComputeDeclarationsInNode(SyntaxNode node, ISymbol associatedSymbol, bool getSymbol, ArrayBuilder<DeclarationInfo> builder, CancellationToken cancellationToken, int? levelsToCompute = null) 5258internal abstract override Func<SyntaxNode, bool> GetSyntaxNodesToAnalyzeFilter(SyntaxNode declaredNode, ISymbol declaredSymbol); 5259internal abstract override bool ShouldSkipSyntaxNodeAnalysis(SyntaxNode node, ISymbol containingSymbol); 5261protected internal override SyntaxNode GetTopmostNodeForDiagnosticAnalysis(ISymbol symbol, SyntaxNode declaringSyntax) 5304protected sealed override ControlFlowAnalysis AnalyzeControlFlowCore(SyntaxNode firstStatement, SyntaxNode lastStatement) 5329protected sealed override ControlFlowAnalysis AnalyzeControlFlowCore(SyntaxNode statement) 5344protected sealed override DataFlowAnalysis AnalyzeDataFlowCore(SyntaxNode firstStatement, SyntaxNode lastStatement) 5369protected sealed override DataFlowAnalysis AnalyzeDataFlowCore(SyntaxNode statementOrExpression) 5388protected sealed override Optional<object> GetConstantValueCore(SyntaxNode node, CancellationToken cancellationToken)
Compilation\MemberSemanticModel.cs (21)
32private readonly Dictionary<SyntaxNode, OneOrMany<BoundNode>> _guardedBoundNodeMap = new Dictionary<SyntaxNode, OneOrMany<BoundNode>>(); 33private readonly Dictionary<SyntaxNode, IOperation> _guardedIOperationNodeMap = new Dictionary<SyntaxNode, IOperation>(); 34private Dictionary<SyntaxNode, BoundStatement> _lazyGuardedSynthesizedStatementsMap; 145internal override MemberSemanticModel GetMemberModel(SyntaxNode node) 214private Binder GetEnclosingBinderInternalWithinRoot(SyntaxNode node, int position) 220private static Binder GetEnclosingBinderInternalWithinRoot(SyntaxNode node, int position, Binder rootBinder, SyntaxNode root) 234for (var current = node; binder == null; current = current.ParentOrStructuredTriviaParent) 1415_lazyGuardedSynthesizedStatementsMap = new Dictionary<SyntaxNode, BoundStatement>(); 1473protected void UnguardedAddBoundTreeForStandaloneSyntax(SyntaxNode syntax, BoundNode bound, NullableWalker.SnapshotManager manager = null, ImmutableDictionary<Symbol, Symbol> remappedSymbols = null) 1481protected void GuardedAddBoundTreeForStandaloneSyntax(SyntaxNode syntax, BoundNode bound, NullableWalker.SnapshotManager manager = null, ImmutableDictionary<Symbol, Symbol> remappedSymbols = null) 1876private static SyntaxNode AdjustStartingNodeAccordingToNewRoot(SyntaxNode startingNode, SyntaxNode root) 1878SyntaxNode result = startingNode.Contains(root) ? root : startingNode; 2361internal sealed override Func<SyntaxNode, bool> GetSyntaxNodesToAnalyzeFilter(SyntaxNode declaredNode, ISymbol declaredSymbol) 2366internal sealed override bool ShouldSkipSyntaxNodeAnalysis(SyntaxNode node, ISymbol containingSymbol) 2405internal override Binder GetBinder(SyntaxNode node)
Compilation\MemberSemanticModel.NodeMapBuilder.cs (7)
21private NodeMapBuilder(OrderPreservingMultiDictionary<SyntaxNode, BoundNode> map, SyntaxTree tree, SyntaxNode thisSyntaxNodeOnly) 28private readonly OrderPreservingMultiDictionary<SyntaxNode, BoundNode> _map; 30private readonly SyntaxNode _thisSyntaxNodeOnly; 39public static void AddToMap(BoundNode root, Dictionary<SyntaxNode, OneOrMany<BoundNode>> map, SyntaxTree tree, SyntaxNode node = null) 49var additionMap = OrderPreservingMultiDictionary<SyntaxNode, BoundNode>.GetInstance();
Compilation\PublicSemanticModel.cs (1)
34Symbol? getAttributeTarget(SyntaxNode? targetSyntax)
Compilation\SpeculativeSemanticModelWithMemberModel.cs (10)
59var attributedNode = model.SyntaxTree.GetRoot().FindToken(position).Parent; 139SyntaxNode? node = Root.FindTokenIncludingCrefAndNameAttributes(position).Parent; 143private MemberSemanticModel GetEnclosingMemberModel(SyntaxNode node) 150var attributeOrParameter = node.FirstAncestorOrSelf<SyntaxNode>(static n => n.Kind() is SyntaxKind.Attribute or SyntaxKind.Parameter); 185private MemberSemanticModel GetOrAddModelForParameter(SyntaxNode node, MemberSemanticModel containing, ParameterSyntax paramDecl) 215internal override MemberSemanticModel GetMemberModel(SyntaxNode node) 505internal sealed override Func<SyntaxNode, bool> GetSyntaxNodesToAnalyzeFilter(SyntaxNode declaredNode, ISymbol declaredSymbol) 510internal override bool ShouldSkipSyntaxNodeAnalysis(SyntaxNode node, ISymbol containingSymbol)
Compilation\SyntaxTreeSemanticModel.cs (8)
766internal bool IsNullableAnalysisEnabledAtSpeculativePosition(int position, SyntaxNode speculativeSyntax) 835internal override MemberSemanticModel GetMemberModel(SyntaxNode node) 989private static bool IsInDocumentationComment(SyntaxNode node) 991for (SyntaxNode curr = node; curr != null; curr = curr.Parent) 1040private static CSharpSyntaxNode GetMemberDeclaration(SyntaxNode node) 2405internal override Func<SyntaxNode, bool> GetSyntaxNodesToAnalyzeFilter(SyntaxNode declaredNode, ISymbol declaredSymbol) 2515internal override bool ShouldSkipSyntaxNodeAnalysis(SyntaxNode node, ISymbol containingSymbol)
Compiler\DocumentationCommentCompiler.DocumentationCommentWalker.cs (1)
139public override void DefaultVisit(SyntaxNode node)
Compiler\MethodBodySynthesizer.cs (3)
34SyntaxNode syntax = loweredBody.Syntax; 85SyntaxNode syntax, 530var syntax = block.Syntax;
Compiler\MethodCompiler.cs (3)
1127var syntax = body.Syntax; 2213if (!LambdaUtilities.TryGetLambdaBodies(node.Syntax, out var body1, out var body2))
Compiler\TypeCompilationState.cs (1)
202internal void ReportCtorInitializerCycles(MethodSymbol method1, MethodSymbol method2, SyntaxNode syntax, BindingDiagnosticBag diagnostics)
Compiler\UnprocessedDocumentationCommentFinder.cs (1)
43public override void DefaultVisit(SyntaxNode node)
CSharpExtensions.cs (19)
42/// Determines if <see cref="SyntaxNode"/> is of a specified kind. 47public static bool IsKind([NotNullWhen(true)] this SyntaxNode? node, SyntaxKind kind) 63/// <inheritdoc cref="SyntaxNode.ContainsDirective"/> 64public static bool ContainsDirective(this SyntaxNode node, SyntaxKind kind) 84where TNode : SyntaxNode 93where TNode : SyntaxNode 105where TNode : SyntaxNode 114where TNode : SyntaxNode 205/// Returns <see cref="SyntaxKind"/> for <see cref="SyntaxNode"/> from <see cref="SyntaxNode.RawKind"/> property. 207public static SyntaxKind Kind(this SyntaxNode node) 214/// Returns <see cref="SyntaxKind"/> for <see cref="SyntaxNode"/> from <see cref="SyntaxNodeOrToken.RawKind"/> property. 322internal static Syntax.InternalSyntax.DirectiveStack ApplyDirectives(this SyntaxNode node, Syntax.InternalSyntax.DirectiveStack stack) 352internal static SeparatedSyntaxList<TOther> AsSeparatedList<TOther>(this SyntaxNodeOrTokenList list) where TOther : SyntaxNode 357var node = i.AsNode(); 372internal static IList<DirectiveTriviaSyntax> GetDirectives(this SyntaxNode node, Func<DirectiveTriviaSyntax, bool>? filter = null) 380public static DirectiveTriviaSyntax? GetFirstDirective(this SyntaxNode node, Func<DirectiveTriviaSyntax, bool>? predicate = null) 388public static DirectiveTriviaSyntax? GetLastDirective(this SyntaxNode node, Func<DirectiveTriviaSyntax, bool>? predicate = null) 764public static Conversion GetConversion(this SemanticModel? semanticModel, SyntaxNode expression, CancellationToken cancellationToken = default(CancellationToken))
Declarations\DeclarationTreeBuilder.cs (1)
1002SyntaxNode parent,
Declarations\MergedTypeDeclaration.cs (1)
72var typeDecl = syntaxRef.GetSyntax();
Emitter\EditAndContinue\CSharpLambdaSyntaxFacts.cs (6)
17public override SyntaxNode GetLambda(SyntaxNode lambdaOrLambdaBodySyntax) 20public override SyntaxNode? TryGetCorrespondingLambdaBody(SyntaxNode previousLambdaSyntax, SyntaxNode lambdaOrLambdaBodySyntax) 23public override int GetDeclaratorPosition(SyntaxNode node)
Emitter\Model\PEModuleBuilder.cs (24)
26internal abstract class PEModuleBuilder : PEModuleBuilder<CSharpCompilation, SourceModuleSymbol, AssemblySymbol, TypeSymbol, NamedTypeSymbol, MethodSymbol, SyntaxNode, NoPia.EmbeddedTypesManager, ModuleCompilationState> 814private NamedTypeSymbol GetUntranslatedSpecialType(SpecialType specialType, SyntaxNode syntaxNodeOpt, DiagnosticBag diagnostics) 831internal sealed override Cci.INamedTypeReference GetSpecialType(SpecialType specialType, SyntaxNode syntaxNodeOpt, DiagnosticBag diagnostics) 956SyntaxNode syntaxNodeOpt, 1077private void CheckTupleUnderlyingType(NamedTypeSymbol namedTypeSymbol, SyntaxNode syntaxNodeOpt, DiagnosticBag diagnostics) 1137SyntaxNode syntaxNodeOpt, 1169SyntaxNode syntaxNodeOpt, 1210SyntaxNode syntaxNodeOpt, 1244SyntaxNode syntaxNodeOpt, 1436SyntaxNode syntaxNodeOpt, 1485protected override Cci.IMethodDefinition CreatePrivateImplementationDetailsStaticConstructor(SyntaxNode syntaxOpt, DiagnosticBag diagnostics) 1820internal MethodSymbol EnsureThrowSwitchExpressionExceptionExists(SyntaxNode syntaxNode, SyntheticBoundNodeFactory factory, DiagnosticBag diagnostics) 1833private MethodSymbol EnsurePrivateImplClassMethodExists<TArg>(SyntaxNode syntaxNode, string methodName, Func<SynthesizedPrivateImplementationDetailsType, TArg, MethodSymbol> createMethodSymbol, TArg arg, DiagnosticBag diagnostics) 1851internal new SynthesizedPrivateImplementationDetailsType GetPrivateImplClass(SyntaxNode syntaxNodeOpt, DiagnosticBag diagnostics) 1867internal MethodSymbol EnsureThrowSwitchExpressionExceptionParameterlessExists(SyntaxNode syntaxNode, SyntheticBoundNodeFactory factory, DiagnosticBag diagnostics) 1887internal MethodSymbol EnsureThrowInvalidOperationExceptionExists(SyntaxNode syntaxNode, SyntheticBoundNodeFactory factory, DiagnosticBag diagnostics) 1904internal MethodSymbol EnsureInlineArrayAsSpanExists(SyntaxNode syntaxNode, NamedTypeSymbol spanType, NamedTypeSymbol intType, DiagnosticBag diagnostics) 1921internal NamedTypeSymbol EnsureInlineArrayTypeExists(SyntaxNode syntaxNode, SyntheticBoundNodeFactory factory, int arrayLength, DiagnosticBag diagnostics) 1944internal NamedTypeSymbol EnsureReadOnlyListTypeExists(SyntaxNode syntaxNode, SynthesizedReadOnlyListKind kind, DiagnosticBag diagnostics) 1973internal MethodSymbol EnsureInlineArrayAsReadOnlySpanExists(SyntaxNode syntaxNode, NamedTypeSymbol spanType, NamedTypeSymbol intType, DiagnosticBag diagnostics) 1990internal MethodSymbol EnsureInlineArrayElementRefExists(SyntaxNode syntaxNode, NamedTypeSymbol intType, DiagnosticBag diagnostics) 2006internal MethodSymbol EnsureInlineArrayElementRefReadOnlyExists(SyntaxNode syntaxNode, NamedTypeSymbol intType, DiagnosticBag diagnostics) 2022internal MethodSymbol EnsureInlineArrayFirstElementRefExists(SyntaxNode syntaxNode, DiagnosticBag diagnostics) 2035internal MethodSymbol EnsureInlineArrayFirstElementRefReadOnlyExists(SyntaxNode syntaxNode, DiagnosticBag diagnostics)
Emitter\NoPia\EmbeddedEvent.cs (3)
44protected override Cci.ITypeReference GetType(PEModuleBuilder moduleBuilder, SyntaxNode syntaxNodeOpt, DiagnosticBag diagnostics) 65protected override void EmbedCorrespondingComEventInterfaceMethodInternal(SyntaxNode syntaxNodeOpt, DiagnosticBag diagnostics, bool isUsedForComAwareEventBinding) 128private bool EmbedMatchingInterfaceMethods(NamedTypeSymbol sourceInterface, SyntaxNode syntaxNodeOpt, DiagnosticBag diagnostics)
Emitter\NoPia\EmbeddedType.cs (5)
38public void EmbedAllMembersOfImplementedInterface(SyntaxNode syntaxNodeOpt, DiagnosticBag diagnostics) 82protected override Cci.ITypeReference GetBaseClass(PEModuleBuilder moduleBuilder, SyntaxNode syntaxNodeOpt, DiagnosticBag diagnostics) 249protected override CSharpAttributeData CreateTypeIdentifierAttribute(bool hasGuid, SyntaxNode syntaxNodeOpt, DiagnosticBag diagnostics) 290protected override void ReportMissingAttribute(AttributeDescription description, SyntaxNode syntaxNodeOpt, DiagnosticBag diagnostics) 295protected override void EmbedDefaultMembers(string defaultMember, SyntaxNode syntaxNodeOpt, DiagnosticBag diagnostics)
Emitter\NoPia\EmbeddedTypesManager.cs (17)
33EmbeddedTypesManager<PEModuleBuilder, ModuleCompilationState, EmbeddedTypesManager, SyntaxNode, CSharpAttributeData, 55public NamedTypeSymbol GetSystemStringType(SyntaxNode syntaxNodeOpt, DiagnosticBag diagnostics) 82public MethodSymbol GetWellKnownMethod(WellKnownMember method, SyntaxNode syntaxNodeOpt, DiagnosticBag diagnostics) 90private MethodSymbol LazyGetWellKnownTypeMethod(ref MethodSymbol lazyMethod, WellKnownMember member, SyntaxNode syntaxNodeOpt, DiagnosticBag diagnostics) 124internal override CSharpAttributeData CreateSynthesizedAttribute(WellKnownMember constructor, ImmutableArray<TypedConstant> constructorArguments, ImmutableArray<KeyValuePair<string, TypedConstant>> namedArguments, SyntaxNode syntaxNodeOpt, DiagnosticBag diagnostics) 156internal override bool TryGetAttributeArguments(CSharpAttributeData attrData, out ImmutableArray<TypedConstant> constructorArguments, out ImmutableArray<KeyValuePair<string, TypedConstant>> namedArguments, SyntaxNode syntaxNodeOpt, DiagnosticBag diagnostics) 253SyntaxNode syntaxNodeOpt, 329private static void ReportNotEmbeddableSymbol(ErrorCode error, Symbol symbol, SyntaxNode syntaxNodeOpt, DiagnosticBag diagnostics, EmbeddedTypesManager optTypeManager) 338internal static void Error(DiagnosticBag diagnostics, ErrorCode code, SyntaxNode syntaxOpt, params object[] args) 343private static void Error(DiagnosticBag diagnostics, SyntaxNode syntaxOpt, DiagnosticInfo info) 351SyntaxNode syntaxNodeOpt, 368SyntaxNode syntaxNodeOpt, 434SyntaxNode syntaxNodeOpt, 470SyntaxNode syntaxNodeOpt, 531SyntaxNode syntaxNodeOpt, 565SyntaxNode syntaxNodeOpt, 604protected override EmbeddedType GetEmbeddedTypeForMember(SymbolAdapter member, SyntaxNode syntaxNodeOpt, DiagnosticBag diagnostics)
Errors\DiagnosticBagExtensions.cs (1)
64SyntaxNode node,
Errors\MessageID.cs (2)
350SyntaxNode syntax, 378SyntaxNode syntax,
Errors\MessageProvider.cs (7)
258protected override void ReportInvalidAttributeArgument(DiagnosticBag diagnostics, SyntaxNode attributeSyntax, int parameterIndex, AttributeData attribute) 264protected override void ReportInvalidNamedArgument(DiagnosticBag diagnostics, SyntaxNode attributeSyntax, int namedArgumentIndex, ITypeSymbol attributeClass, string parameterName) 270protected override void ReportParameterNotValidForType(DiagnosticBag diagnostics, SyntaxNode attributeSyntax, int namedArgumentIndex) 276protected override void ReportMarshalUnmanagedTypeNotValidForFields(DiagnosticBag diagnostics, SyntaxNode attributeSyntax, int parameterIndex, string unmanagedTypeName, AttributeData attribute) 281protected override void ReportMarshalUnmanagedTypeOnlyValidForFields(DiagnosticBag diagnostics, SyntaxNode attributeSyntax, int parameterIndex, string unmanagedTypeName, AttributeData attribute) 286protected override void ReportAttributeParameterRequired(DiagnosticBag diagnostics, SyntaxNode attributeSyntax, string parameterName) 292protected override void ReportAttributeParameterRequired(DiagnosticBag diagnostics, SyntaxNode attributeSyntax, string parameterName1, string parameterName2)
FlowAnalysis\AbstractFlowPass.cs (4)
329SyntaxNode syntax, 338protected virtual void LeaveParameter(ParameterSymbol parameter, SyntaxNode syntax, Location location) 1395protected void VisitLocalFunctionUse(LocalFunctionSymbol symbol, SyntaxNode syntax, bool isCall) 1404SyntaxNode syntax,
FlowAnalysis\ControlFlowAnalysis.cs (9)
24private ImmutableArray<SyntaxNode> _entryPoints; 25private ImmutableArray<SyntaxNode> _exitPoints; 38public override ImmutableArray<SyntaxNode> EntryPoints 45var result = _context.Failed ? ImmutableArray<SyntaxNode>.Empty : 46((IEnumerable<SyntaxNode>)EntryPointsWalker.Analyze(_context.Compilation, _context.Member, _context.BoundNode, _context.FirstInRegion, _context.LastInRegion, out _succeeded)).ToImmutableArray(); 57public override ImmutableArray<SyntaxNode> ExitPoints 64? ImmutableArray<SyntaxNode>.CastUp(ExitPointsWalker.Analyze(_context.Compilation, _context.Member, _context.BoundNode, _context.FirstInRegion, _context.LastInRegion)) 65: ImmutableArray<SyntaxNode>.Empty; 125public override ImmutableArray<SyntaxNode> ReturnStatements
FlowAnalysis\ControlFlowPass.cs (1)
379var syntax = node.SwitchLabels.Last().Syntax;
FlowAnalysis\DataFlowsInWalker.cs (2)
103protected override void ReportUnassigned(Symbol symbol, SyntaxNode node, int slot, bool skipIfUseBeforeDeclaration) 118SyntaxNode node,
FlowAnalysis\DataFlowsOutWalker.cs (2)
252protected override void ReportUnassigned(Symbol symbol, SyntaxNode node, int slot, bool skipIfUseBeforeDeclaration) 264protected override void ReportUnassignedOutParameter(ParameterSymbol parameter, SyntaxNode node, Location location)
FlowAnalysis\DefiniteAssignment.cs (8)
449protected virtual void ReportUnassignedOutParameter(ParameterSymbol parameter, SyntaxNode node, Location location) 1151protected void CheckAssigned(Symbol symbol, SyntaxNode node) 1170private void ReportUnassignedIfNotCapturedInLocalFunction(Symbol symbol, SyntaxNode node, int slot, bool skipIfUseBeforeDeclaration = true) 1187protected virtual void ReportUnassigned(Symbol symbol, SyntaxNode node, int slot, bool skipIfUseBeforeDeclaration) 1368protected virtual void CheckAssigned(BoundExpression expr, FieldSymbol fieldSymbol, SyntaxNode node) 1932protected override void LeaveParameters(ImmutableArray<ParameterSymbol> parameters, SyntaxNode syntax, Location location) 1943protected override void LeaveParameter(ParameterSymbol parameter, SyntaxNode syntax, Location location) 2590protected void CheckAssigned(BoundExpression expr, SyntaxNode node)
FlowAnalysis\DefiniteAssignment.LocalFunctions.cs (2)
38SyntaxNode syntax, 68private void CheckIfAssignedDuringLocalFunctionReplay(Symbol symbol, SyntaxNode node, int slot)
FlowAnalysis\FlowAnalysisPass.cs (1)
192SyntaxNode syntax = body.Syntax;
FlowAnalysis\NullableWalker.cs (24)
622void enforceMemberNotNull(SyntaxNode? syntaxOpt, LocalState state) 980private void EnforceMemberNotNullOnMember(SyntaxNode? syntaxOpt, LocalState state, MethodSymbol method, string memberName) 1030void enforceMemberNotNullWhenIfAffected(SyntaxNode? syntaxOpt, bool sense, ImmutableArray<Symbol> members, LocalState state, LocalState otherState) 1042void enforceMemberNotNullWhen(SyntaxNode? syntaxOpt, bool sense, LocalState state) 1058private void ReportFailedMemberNotNullIfNeeded(SyntaxNode? syntaxOpt, bool sense, Symbol member, LocalState state) 1191private void EnforceParameterNotNullOnExit(SyntaxNode? syntaxOpt, LocalState state) 1231private void EnforceParameterNotNullWhenOnExit(SyntaxNode syntax, ImmutableArray<ParameterSymbol> parameters, bool sense, LocalState stateWhen) 1244private void ReportParameterIfBadConditionalState(SyntaxNode syntax, ParameterSymbol parameter, bool sense, LocalState stateWhen) 1291private void EnforceNotNullIfNotNull(SyntaxNode? syntaxOpt, LocalState state, ImmutableArray<ParameterSymbol> parameters, ImmutableHashSet<string> inputParamNames, NullableFlowState outputState, ParameterSymbol? outputParam) 1320private void EnforceDoesNotReturn(SyntaxNode? syntaxOpt) 1632internal static bool NeedsAnalysis(CSharpCompilation compilation, SyntaxNode syntaxNode) 1643SyntaxNode syntax, 2505private void ReportNullabilityMismatchInAssignment(SyntaxNode syntaxNode, object sourceType, object destinationType) 2572private void ReportDiagnostic(ErrorCode errorCode, SyntaxNode syntaxNode, params object[] arguments) 3334void enforceMemberNotNull(SyntaxNode? syntax, LocalState state) 3350SyntaxNode syntax, 6687var syntax = node.Syntax; 6696private static bool HasImplicitTypeArguments(SyntaxNode syntax) 6835var syntax = node.Syntax; 7431private bool CheckDisallowedNullAssignment(TypeWithState state, FlowAnalysisAnnotations annotations, SyntaxNode node, BoundExpression? boundValueOpt = null) 8003private void CheckMethodConstraints(SyntaxNode syntax, MethodSymbol method) 9810var syntax = group.Syntax; 10621private void ReportNullabilityMismatchInArgument(SyntaxNode argument, TypeSymbol argumentType, ParameterSymbol parameter, TypeSymbol parameterType, bool forOutput) 11816private bool ReportPossibleNullReceiverIfNeeded(TypeSymbol type, NullableFlowState state, bool checkNullableValueType, SyntaxNode syntax, out bool reportedDiagnostic)
FlowAnalysis\NullableWalker.PlaceholderLocal.cs (4)
48internal override SyntaxNode ScopeDesignatorOpt => null; 61internal override ConstantValue GetConstantValue(SyntaxNode node, LocalSymbol inProgress, BindingDiagnosticBag diagnostics = null) => null; 63internal override SyntaxNode GetDeclaratorSyntax() => throw ExceptionUtilities.Unreachable(); 66SynthesizedLocalKind kind, SyntaxNode syntax
FlowAnalysis\NullableWalker_Patterns.cs (1)
375SyntaxNode node,
FlowAnalysis\ReadWriteWalker.cs (2)
139protected override void CheckAssigned(BoundExpression expr, FieldSymbol fieldSymbol, SyntaxNode node) 181var receiverSyntax = receiver.Syntax;
FlowAnalysis\UnassignedAddressTakenVariablesWalker.cs (1)
52protected override void ReportUnassigned(Symbol symbol, SyntaxNode node, int slot, bool skipIfUseBeforeDeclaration)
FlowAnalysis\UnassignedVariablesWalker.cs (2)
56protected override void ReportUnassigned(Symbol symbol, SyntaxNode node, int slot, bool skipIfUseBeforeDeclaration) 70protected override void ReportUnassignedOutParameter(ParameterSymbol parameter, SyntaxNode node, Location location)
Generated\BoundNodes.xml.Generated.cs (333)
278protected BoundInitializer(BoundKind kind, SyntaxNode syntax, bool hasErrors) 283protected BoundInitializer(BoundKind kind, SyntaxNode syntax) 292protected BoundEqualsValue(BoundKind kind, SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, BoundExpression value, bool hasErrors = false) 309public BoundFieldEqualsValue(SyntaxNode syntax, FieldSymbol field, ImmutableArray<LocalSymbol> locals, BoundExpression value, bool hasErrors = false) 339public BoundPropertyEqualsValue(SyntaxNode syntax, PropertySymbol property, ImmutableArray<LocalSymbol> locals, BoundExpression value, bool hasErrors = false) 369public BoundParameterEqualsValue(SyntaxNode syntax, ParameterSymbol parameter, ImmutableArray<LocalSymbol> locals, BoundExpression value, bool hasErrors = false) 399public BoundGlobalStatementInitializer(SyntaxNode syntax, BoundStatement statement, bool hasErrors = false) 427protected BoundExpression(BoundKind kind, SyntaxNode syntax, TypeSymbol? type, bool hasErrors) 433protected BoundExpression(BoundKind kind, SyntaxNode syntax, TypeSymbol? type) 444protected BoundValuePlaceholderBase(BoundKind kind, SyntaxNode syntax, TypeSymbol? type, bool hasErrors) 449protected BoundValuePlaceholderBase(BoundKind kind, SyntaxNode syntax, TypeSymbol? type) 458protected BoundEarlyValuePlaceholderBase(BoundKind kind, SyntaxNode syntax, TypeSymbol? type, bool hasErrors) 463protected BoundEarlyValuePlaceholderBase(BoundKind kind, SyntaxNode syntax, TypeSymbol? type) 472public BoundValuePlaceholder(SyntaxNode syntax, TypeSymbol? type, bool hasErrors) 477public BoundValuePlaceholder(SyntaxNode syntax, TypeSymbol? type) 500public BoundCapturedReceiverPlaceholder(SyntaxNode syntax, BoundExpression receiver, SafeContext localScopeDepth, TypeSymbol? type, bool hasErrors = false) 530public BoundDeconstructValuePlaceholder(SyntaxNode syntax, Symbol? variableSymbol, bool isDiscardExpression, TypeSymbol type, bool hasErrors) 540public BoundDeconstructValuePlaceholder(SyntaxNode syntax, Symbol? variableSymbol, bool isDiscardExpression, TypeSymbol type) 571public BoundTupleOperandPlaceholder(SyntaxNode syntax, TypeSymbol type, bool hasErrors) 579public BoundTupleOperandPlaceholder(SyntaxNode syntax, TypeSymbol type) 606public BoundAwaitableValuePlaceholder(SyntaxNode syntax, TypeSymbol? type, bool hasErrors) 611public BoundAwaitableValuePlaceholder(SyntaxNode syntax, TypeSymbol? type) 635public BoundDisposableValuePlaceholder(SyntaxNode syntax, TypeSymbol type, bool hasErrors) 643public BoundDisposableValuePlaceholder(SyntaxNode syntax, TypeSymbol type) 670public BoundObjectOrCollectionValuePlaceholder(SyntaxNode syntax, bool isNewInstance, TypeSymbol type, bool hasErrors) 679public BoundObjectOrCollectionValuePlaceholder(SyntaxNode syntax, bool isNewInstance, TypeSymbol type) 708public BoundImplicitIndexerValuePlaceholder(SyntaxNode syntax, TypeSymbol type, bool hasErrors) 716public BoundImplicitIndexerValuePlaceholder(SyntaxNode syntax, TypeSymbol type) 743public BoundImplicitIndexerReceiverPlaceholder(SyntaxNode syntax, bool isEquivalentToThisReference, TypeSymbol type, bool hasErrors) 752public BoundImplicitIndexerReceiverPlaceholder(SyntaxNode syntax, bool isEquivalentToThisReference, TypeSymbol type) 781public BoundListPatternReceiverPlaceholder(SyntaxNode syntax, TypeSymbol type, bool hasErrors) 789public BoundListPatternReceiverPlaceholder(SyntaxNode syntax, TypeSymbol type) 816public BoundListPatternIndexPlaceholder(SyntaxNode syntax, TypeSymbol type, bool hasErrors) 824public BoundListPatternIndexPlaceholder(SyntaxNode syntax, TypeSymbol type) 851public BoundSlicePatternReceiverPlaceholder(SyntaxNode syntax, TypeSymbol type, bool hasErrors) 859public BoundSlicePatternReceiverPlaceholder(SyntaxNode syntax, TypeSymbol type) 886public BoundSlicePatternRangePlaceholder(SyntaxNode syntax, TypeSymbol type, bool hasErrors) 894public BoundSlicePatternRangePlaceholder(SyntaxNode syntax, TypeSymbol type) 921public BoundDup(SyntaxNode syntax, RefKind refKind, TypeSymbol? type, bool hasErrors) 927public BoundDup(SyntaxNode syntax, RefKind refKind, TypeSymbol? type) 952public BoundPassByCopy(SyntaxNode syntax, BoundExpression expression, TypeSymbol? type, bool hasErrors = false) 980public BoundBadExpression(SyntaxNode syntax, LookupResultKind resultKind, ImmutableArray<Symbol?> symbols, ImmutableArray<BoundExpression> childBoundNodes, TypeSymbol? type, bool hasErrors = false) 1013public BoundBadStatement(SyntaxNode syntax, ImmutableArray<BoundNode> childBoundNodes, bool hasErrors = false) 1041public BoundExtractedFinallyBlock(SyntaxNode syntax, BoundBlock finallyBlock, bool hasErrors = false) 1069public BoundTypeExpression(SyntaxNode syntax, AliasSymbol? aliasOpt, BoundTypeExpression? boundContainingTypeOpt, ImmutableArray<BoundExpression> boundDimensionsOpt, TypeWithAnnotations typeWithAnnotations, TypeSymbol type, bool hasErrors = false) 1104public BoundTypeOrValueExpression(SyntaxNode syntax, BoundTypeOrValueData data, TypeSymbol type, bool hasErrors) 1113public BoundTypeOrValueExpression(SyntaxNode syntax, BoundTypeOrValueData data, TypeSymbol type) 1142public BoundNamespaceExpression(SyntaxNode syntax, NamespaceSymbol namespaceSymbol, AliasSymbol? aliasOpt, bool hasErrors) 1152public BoundNamespaceExpression(SyntaxNode syntax, NamespaceSymbol namespaceSymbol, AliasSymbol? aliasOpt) 1183public BoundUnaryOperator(SyntaxNode syntax, UnaryOperatorKind operatorKind, BoundExpression operand, ConstantValue? constantValueOpt, MethodSymbol? methodOpt, TypeSymbol? constrainedToTypeOpt, LookupResultKind resultKind, ImmutableArray<MethodSymbol> originalUserDefinedOperatorsOpt, TypeSymbol type, bool hasErrors = false) 1225public BoundIncrementOperator(SyntaxNode syntax, UnaryOperatorKind operatorKind, BoundExpression operand, MethodSymbol? methodOpt, TypeSymbol? constrainedToTypeOpt, BoundValuePlaceholder? operandPlaceholder, BoundExpression? operandConversion, BoundValuePlaceholder? resultPlaceholder, BoundExpression? resultConversion, LookupResultKind resultKind, ImmutableArray<MethodSymbol> originalUserDefinedOperatorsOpt, TypeSymbol type, bool hasErrors = false) 1273public BoundAddressOfOperator(SyntaxNode syntax, BoundExpression operand, bool isManaged, TypeSymbol type, bool hasErrors = false) 1305public BoundUnconvertedAddressOfOperator(SyntaxNode syntax, BoundMethodGroup operand, bool hasErrors = false) 1334public BoundFunctionPointerLoad(SyntaxNode syntax, MethodSymbol targetMethod, TypeSymbol? constrainedToTypeOpt, TypeSymbol type, bool hasErrors) 1345public BoundFunctionPointerLoad(SyntaxNode syntax, MethodSymbol targetMethod, TypeSymbol? constrainedToTypeOpt, TypeSymbol type) 1377public BoundPointerIndirectionOperator(SyntaxNode syntax, BoundExpression operand, bool refersToLocation, TypeSymbol type, bool hasErrors = false) 1409public BoundPointerElementAccess(SyntaxNode syntax, BoundExpression expression, BoundExpression index, bool @checked, bool refersToLocation, TypeSymbol type, bool hasErrors = false) 1446public BoundFunctionPointerInvocation(SyntaxNode syntax, BoundExpression invokedExpression, ImmutableArray<BoundExpression> arguments, ImmutableArray<RefKind> argumentRefKindsOpt, LookupResultKind resultKind, TypeSymbol type, bool hasErrors = false) 1483public BoundRefTypeOperator(SyntaxNode syntax, BoundExpression operand, MethodSymbol? getTypeFromHandle, TypeSymbol type, bool hasErrors = false) 1515public BoundMakeRefOperator(SyntaxNode syntax, BoundExpression operand, TypeSymbol type, bool hasErrors = false) 1545public BoundRefValueOperator(SyntaxNode syntax, NullableAnnotation nullableAnnotation, BoundExpression operand, TypeSymbol type, bool hasErrors = false) 1577public BoundFromEndIndexExpression(SyntaxNode syntax, BoundExpression operand, MethodSymbol? methodOpt, TypeSymbol type, bool hasErrors = false) 1609public BoundRangeExpression(SyntaxNode syntax, BoundExpression? leftOperandOpt, BoundExpression? rightOperandOpt, MethodSymbol? methodOpt, TypeSymbol type, bool hasErrors = false) 1642protected BoundBinaryOperatorBase(BoundKind kind, SyntaxNode syntax, BoundExpression left, BoundExpression right, TypeSymbol type, bool hasErrors = false) 1661public BoundBinaryOperator(SyntaxNode syntax, BinaryOperatorKind operatorKind, BoundBinaryOperator.UncommonData? data, LookupResultKind resultKind, BoundExpression left, BoundExpression right, TypeSymbol type, bool hasErrors = false) 1695public BoundTupleBinaryOperator(SyntaxNode syntax, BoundExpression left, BoundExpression right, BinaryOperatorKind operatorKind, TupleBinaryOperatorInfo.Multiple operators, TypeSymbol type, bool hasErrors = false) 1733public BoundUserDefinedConditionalLogicalOperator(SyntaxNode syntax, BinaryOperatorKind operatorKind, MethodSymbol logicalOperator, MethodSymbol trueOperator, MethodSymbol falseOperator, TypeSymbol? constrainedToTypeOpt, LookupResultKind resultKind, ImmutableArray<MethodSymbol> originalUserDefinedOperatorsOpt, BoundExpression left, BoundExpression right, TypeSymbol type, bool hasErrors = false) 1778public BoundCompoundAssignmentOperator(SyntaxNode syntax, BinaryOperatorSignature @operator, BoundExpression left, BoundExpression right, BoundValuePlaceholder? leftPlaceholder, BoundExpression? leftConversion, BoundValuePlaceholder? finalPlaceholder, BoundExpression? finalConversion, LookupResultKind resultKind, ImmutableArray<MethodSymbol> originalUserDefinedOperatorsOpt, TypeSymbol type, bool hasErrors = false) 1825public BoundAssignmentOperator(SyntaxNode syntax, BoundExpression left, BoundExpression right, bool isRef, TypeSymbol type, bool hasErrors = false) 1859public BoundDeconstructionAssignmentOperator(SyntaxNode syntax, BoundTupleExpression left, BoundConversion right, bool isUsed, TypeSymbol type, bool hasErrors = false) 1894public BoundNullCoalescingOperator(SyntaxNode syntax, BoundExpression leftOperand, BoundExpression rightOperand, BoundValuePlaceholder? leftPlaceholder, BoundExpression? leftConversion, BoundNullCoalescingOperatorResultKind operatorResultKind, bool @checked, TypeSymbol type, bool hasErrors = false) 1935public BoundNullCoalescingAssignmentOperator(SyntaxNode syntax, BoundExpression leftOperand, BoundExpression rightOperand, TypeSymbol? type, bool hasErrors = false) 1966public BoundUnconvertedConditionalOperator(SyntaxNode syntax, BoundExpression condition, BoundExpression consequence, BoundExpression alternative, ConstantValue? constantValueOpt, ErrorCode noCommonTypeError, bool hasErrors = false) 2005public BoundConditionalOperator(SyntaxNode syntax, bool isRef, BoundExpression condition, BoundExpression consequence, BoundExpression alternative, ConstantValue? constantValueOpt, TypeSymbol? naturalTypeOpt, bool wasTargetTyped, TypeSymbol type, bool hasErrors = false) 2049public BoundArrayAccess(SyntaxNode syntax, BoundExpression expression, ImmutableArray<BoundExpression> indices, TypeSymbol type, bool hasErrors = false) 2082public BoundRefArrayAccess(SyntaxNode syntax, BoundArrayAccess arrayAccess, bool hasErrors = false) 2111public BoundArrayLength(SyntaxNode syntax, BoundExpression expression, TypeSymbol type, bool hasErrors = false) 2141public BoundAwaitableInfo(SyntaxNode syntax, BoundAwaitableValuePlaceholder? awaitableInstancePlaceholder, bool isDynamic, BoundExpression? getAwaiter, PropertySymbol? isCompleted, MethodSymbol? getResult, bool hasErrors = false) 2174public BoundAwaitExpression(SyntaxNode syntax, BoundExpression expression, BoundAwaitableInfo awaitableInfo, BoundAwaitExpressionDebugInfo debugInfo, TypeSymbol type, bool hasErrors = false) 2209protected BoundTypeOf(BoundKind kind, SyntaxNode syntax, MethodSymbol? getTypeFromHandle, TypeSymbol type, bool hasErrors) 2218protected BoundTypeOf(BoundKind kind, SyntaxNode syntax, MethodSymbol? getTypeFromHandle, TypeSymbol type) 2233public BoundTypeOfOperator(SyntaxNode syntax, BoundTypeExpression sourceType, MethodSymbol? getTypeFromHandle, TypeSymbol type, bool hasErrors = false) 2262public BoundBlockInstrumentation(SyntaxNode syntax, OneOrMany<LocalSymbol> locals, BoundStatement? prologue, BoundStatement? epilogue, bool hasErrors = false) 2294public BoundMethodDefIndex(SyntaxNode syntax, MethodSymbol method, TypeSymbol type, bool hasErrors) 2304public BoundMethodDefIndex(SyntaxNode syntax, MethodSymbol method, TypeSymbol type) 2334public BoundLocalId(SyntaxNode syntax, LocalSymbol local, FieldSymbol? hoistedField, TypeSymbol type, bool hasErrors) 2345public BoundLocalId(SyntaxNode syntax, LocalSymbol local, FieldSymbol? hoistedField, TypeSymbol type) 2377public BoundParameterId(SyntaxNode syntax, ParameterSymbol parameter, FieldSymbol? hoistedField, TypeSymbol type, bool hasErrors) 2388public BoundParameterId(SyntaxNode syntax, ParameterSymbol parameter, FieldSymbol? hoistedField, TypeSymbol type) 2420public BoundStateMachineInstanceId(SyntaxNode syntax, TypeSymbol type, bool hasErrors) 2428public BoundStateMachineInstanceId(SyntaxNode syntax, TypeSymbol type) 2455public BoundMaximumMethodDefIndex(SyntaxNode syntax, TypeSymbol type, bool hasErrors) 2463public BoundMaximumMethodDefIndex(SyntaxNode syntax, TypeSymbol type) 2490public BoundInstrumentationPayloadRoot(SyntaxNode syntax, int analysisKind, TypeSymbol type, bool hasErrors) 2499public BoundInstrumentationPayloadRoot(SyntaxNode syntax, int analysisKind, TypeSymbol type) 2528public BoundThrowIfModuleCancellationRequested(SyntaxNode syntax, TypeSymbol type, bool hasErrors) 2536public BoundThrowIfModuleCancellationRequested(SyntaxNode syntax, TypeSymbol type) 2563public ModuleCancellationTokenExpression(SyntaxNode syntax, TypeSymbol type, bool hasErrors) 2571public ModuleCancellationTokenExpression(SyntaxNode syntax, TypeSymbol type) 2598public BoundModuleVersionId(SyntaxNode syntax, TypeSymbol type, bool hasErrors) 2606public BoundModuleVersionId(SyntaxNode syntax, TypeSymbol type) 2633public BoundModuleVersionIdString(SyntaxNode syntax, TypeSymbol type, bool hasErrors) 2641public BoundModuleVersionIdString(SyntaxNode syntax, TypeSymbol type) 2668public BoundSourceDocumentIndex(SyntaxNode syntax, Cci.DebugSourceDocument document, TypeSymbol type, bool hasErrors) 2678public BoundSourceDocumentIndex(SyntaxNode syntax, Cci.DebugSourceDocument document, TypeSymbol type) 2708public BoundMethodInfo(SyntaxNode syntax, MethodSymbol method, MethodSymbol? getMethodFromHandle, TypeSymbol type, bool hasErrors) 2719public BoundMethodInfo(SyntaxNode syntax, MethodSymbol method, MethodSymbol? getMethodFromHandle, TypeSymbol type) 2751public BoundFieldInfo(SyntaxNode syntax, FieldSymbol field, MethodSymbol? getFieldFromHandle, TypeSymbol type, bool hasErrors) 2762public BoundFieldInfo(SyntaxNode syntax, FieldSymbol field, MethodSymbol? getFieldFromHandle, TypeSymbol type) 2794public BoundDefaultLiteral(SyntaxNode syntax, bool hasErrors) 2799public BoundDefaultLiteral(SyntaxNode syntax) 2817public BoundDefaultExpression(SyntaxNode syntax, BoundTypeExpression? targetType, ConstantValue? constantValueOpt, TypeSymbol type, bool hasErrors = false) 2848public BoundIsOperator(SyntaxNode syntax, BoundExpression operand, BoundTypeExpression targetType, ConversionKind conversionKind, TypeSymbol type, bool hasErrors = false) 2883public BoundAsOperator(SyntaxNode syntax, BoundExpression operand, BoundTypeExpression targetType, BoundValuePlaceholder? operandPlaceholder, BoundExpression? operandConversion, TypeSymbol type, bool hasErrors = false) 2920public BoundSizeOfOperator(SyntaxNode syntax, BoundTypeExpression sourceType, ConstantValue? constantValueOpt, TypeSymbol type, bool hasErrors = false) 2952public BoundConversion(SyntaxNode syntax, BoundExpression operand, Conversion conversion, bool isBaseConversion, bool @checked, bool explicitCastInCode, ConstantValue? constantValueOpt, ConversionGroup? conversionGroupOpt, ImmutableArray<MethodSymbol> originalUserDefinedConversionsOpt, TypeSymbol type, bool hasErrors = false) 2996public BoundReadOnlySpanFromArray(SyntaxNode syntax, BoundExpression operand, MethodSymbol conversionMethod, TypeSymbol type, bool hasErrors = false) 3029public BoundArgList(SyntaxNode syntax, TypeSymbol type, bool hasErrors) 3037public BoundArgList(SyntaxNode syntax, TypeSymbol type) 3064public BoundArgListOperator(SyntaxNode syntax, ImmutableArray<BoundExpression> arguments, ImmutableArray<RefKind> argumentRefKindsOpt, TypeSymbol? type, bool hasErrors = false) 3095public BoundFixedLocalCollectionInitializer(SyntaxNode syntax, TypeSymbol elementPointerType, BoundValuePlaceholder? elementPointerPlaceholder, BoundExpression? elementPointerConversion, BoundExpression expression, MethodSymbol? getPinnableOpt, TypeSymbol type, bool hasErrors = false) 3134protected BoundStatement(BoundKind kind, SyntaxNode syntax, bool hasErrors) 3139protected BoundStatement(BoundKind kind, SyntaxNode syntax) 3148public BoundSequencePoint(SyntaxNode syntax, BoundStatement? statementOpt, bool hasErrors = false) 3173public BoundSequencePointWithSpan(SyntaxNode syntax, BoundStatement? statementOpt, TextSpan span, bool hasErrors = false) 3200public BoundSavePreviousSequencePoint(SyntaxNode syntax, object identifier, bool hasErrors) 3209public BoundSavePreviousSequencePoint(SyntaxNode syntax, object identifier) 3237public BoundRestorePreviousSequencePoint(SyntaxNode syntax, object identifier, bool hasErrors) 3246public BoundRestorePreviousSequencePoint(SyntaxNode syntax, object identifier) 3274public BoundStepThroughSequencePoint(SyntaxNode syntax, TextSpan span, bool hasErrors) 3280public BoundStepThroughSequencePoint(SyntaxNode syntax, TextSpan span) 3305public BoundBlock(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, ImmutableArray<LocalFunctionSymbol> localFunctions, bool hasUnsafeModifier, BoundBlockInstrumentation? instrumentation, ImmutableArray<BoundStatement> statements, bool hasErrors = false) 3341public BoundScope(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, ImmutableArray<BoundStatement> statements, bool hasErrors = false) 3370public BoundStateMachineScope(SyntaxNode syntax, ImmutableArray<StateMachineFieldSymbol> fields, BoundStatement statement, bool hasErrors = false) 3401public BoundLocalDeclaration(SyntaxNode syntax, LocalSymbol localSymbol, BoundTypeExpression? declaredTypeOpt, BoundExpression? initializerOpt, ImmutableArray<BoundExpression> argumentsOpt, bool inferredType, bool hasErrors = false) 3437protected BoundMultipleLocalDeclarationsBase(BoundKind kind, SyntaxNode syntax, ImmutableArray<BoundLocalDeclaration> localDeclarations, bool hasErrors = false) 3451public BoundMultipleLocalDeclarations(SyntaxNode syntax, ImmutableArray<BoundLocalDeclaration> localDeclarations, bool hasErrors = false) 3477public BoundUsingLocalDeclarations(SyntaxNode syntax, MethodArgumentInfo? patternDisposeInfoOpt, BoundAwaitableInfo? awaitOpt, ImmutableArray<BoundLocalDeclaration> localDeclarations, bool hasErrors = false) 3507public BoundLocalFunctionStatement(SyntaxNode syntax, LocalFunctionSymbol symbol, BoundBlock? blockBody, BoundBlock? expressionBody, bool hasErrors = false) 3539public BoundNoOpStatement(SyntaxNode syntax, NoOpStatementFlavor flavor, bool hasErrors) 3545public BoundNoOpStatement(SyntaxNode syntax, NoOpStatementFlavor flavor) 3570public BoundReturnStatement(SyntaxNode syntax, RefKind refKind, BoundExpression? expressionOpt, bool @checked, bool hasErrors = false) 3599public BoundYieldReturnStatement(SyntaxNode syntax, BoundExpression expression, bool hasErrors = false) 3627public BoundYieldBreakStatement(SyntaxNode syntax, bool hasErrors) 3632public BoundYieldBreakStatement(SyntaxNode syntax) 3644public BoundThrowStatement(SyntaxNode syntax, BoundExpression? expressionOpt, bool hasErrors = false) 3669public BoundExpressionStatement(SyntaxNode syntax, BoundExpression expression, bool hasErrors = false) 3697public BoundBreakStatement(SyntaxNode syntax, GeneratedLabelSymbol label, bool hasErrors) 3706public BoundBreakStatement(SyntaxNode syntax, GeneratedLabelSymbol label) 3734public BoundContinueStatement(SyntaxNode syntax, GeneratedLabelSymbol label, bool hasErrors) 3743public BoundContinueStatement(SyntaxNode syntax, GeneratedLabelSymbol label) 3771public BoundSwitchStatement(SyntaxNode syntax, BoundExpression expression, ImmutableArray<LocalSymbol> innerLocals, ImmutableArray<LocalFunctionSymbol> innerLocalFunctions, ImmutableArray<BoundSwitchSection> switchSections, BoundDecisionDag reachabilityDecisionDag, BoundSwitchLabel? defaultLabel, GeneratedLabelSymbol breakLabel, bool hasErrors = false) 3816public BoundSwitchDispatch(SyntaxNode syntax, BoundExpression expression, ImmutableArray<(ConstantValue value, LabelSymbol label)> cases, LabelSymbol defaultLabel, LengthBasedStringSwitchData? lengthBasedStringSwitchDataOpt, bool hasErrors = false) 3852public BoundIfStatement(SyntaxNode syntax, BoundExpression condition, BoundStatement consequence, BoundStatement? alternativeOpt, bool hasErrors = false) 3885protected BoundLoopStatement(BoundKind kind, SyntaxNode syntax, GeneratedLabelSymbol breakLabel, GeneratedLabelSymbol continueLabel, bool hasErrors) 3896protected BoundLoopStatement(BoundKind kind, SyntaxNode syntax, GeneratedLabelSymbol breakLabel, GeneratedLabelSymbol continueLabel) 3913protected BoundConditionalLoopStatement(BoundKind kind, SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, BoundExpression condition, BoundStatement body, GeneratedLabelSymbol breakLabel, GeneratedLabelSymbol continueLabel, bool hasErrors = false) 3935public BoundDoStatement(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, BoundExpression condition, BoundStatement body, GeneratedLabelSymbol breakLabel, GeneratedLabelSymbol continueLabel, bool hasErrors = false) 3965public BoundWhileStatement(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, BoundExpression condition, BoundStatement body, GeneratedLabelSymbol breakLabel, GeneratedLabelSymbol continueLabel, bool hasErrors = false) 3995public BoundForStatement(SyntaxNode syntax, ImmutableArray<LocalSymbol> outerLocals, BoundStatement? initializer, ImmutableArray<LocalSymbol> innerLocals, BoundExpression? condition, BoundStatement? increment, BoundStatement body, GeneratedLabelSymbol breakLabel, GeneratedLabelSymbol continueLabel, bool hasErrors = false) 4037public BoundForEachStatement(SyntaxNode syntax, ForEachEnumeratorInfo? enumeratorInfoOpt, BoundValuePlaceholder? elementPlaceholder, BoundExpression? elementConversion, BoundTypeExpression iterationVariableType, ImmutableArray<LocalSymbol> iterationVariables, BoundExpression? iterationErrorExpressionOpt, BoundExpression expression, BoundForEachDeconstructStep? deconstructionOpt, BoundAwaitableInfo? awaitOpt, BoundStatement body, GeneratedLabelSymbol breakLabel, GeneratedLabelSymbol continueLabel, bool hasErrors = false) 4088public BoundForEachDeconstructStep(SyntaxNode syntax, BoundDeconstructionAssignmentOperator deconstructionAssignment, BoundDeconstructValuePlaceholder targetPlaceholder, bool hasErrors = false) 4119public BoundUsingStatement(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, BoundMultipleLocalDeclarations? declarationsOpt, BoundExpression? expressionOpt, BoundStatement body, BoundAwaitableInfo? awaitOpt, MethodArgumentInfo? patternDisposeInfoOpt, bool hasErrors = false) 4158public BoundFixedStatement(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, BoundMultipleLocalDeclarations declarations, BoundStatement body, bool hasErrors = false) 4192public BoundLockStatement(SyntaxNode syntax, BoundExpression argument, BoundStatement body, bool hasErrors = false) 4223public BoundTryStatement(SyntaxNode syntax, BoundBlock tryBlock, ImmutableArray<BoundCatchBlock> catchBlocks, BoundBlock? finallyBlockOpt, LabelSymbol? finallyLabelOpt, bool preferFaultHandler, bool hasErrors = false) 4260public BoundCatchBlock(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, BoundExpression? exceptionSourceOpt, TypeSymbol? exceptionTypeOpt, BoundStatementList? exceptionFilterPrologueOpt, BoundExpression? exceptionFilterOpt, BoundBlock body, bool isSynthesizedAsyncCatchAll, bool hasErrors = false) 4301public BoundLiteral(SyntaxNode syntax, ConstantValue? constantValueOpt, TypeSymbol? type, bool hasErrors) 4307public BoundLiteral(SyntaxNode syntax, ConstantValue? constantValueOpt, TypeSymbol? type) 4332public BoundUtf8String(SyntaxNode syntax, string value, TypeSymbol type, bool hasErrors) 4342public BoundUtf8String(SyntaxNode syntax, string value, TypeSymbol type) 4372public BoundThisReference(SyntaxNode syntax, TypeSymbol type, bool hasErrors) 4380public BoundThisReference(SyntaxNode syntax, TypeSymbol type) 4407public BoundPreviousSubmissionReference(SyntaxNode syntax, TypeSymbol type, bool hasErrors) 4415public BoundPreviousSubmissionReference(SyntaxNode syntax, TypeSymbol type) 4442public BoundHostObjectMemberReference(SyntaxNode syntax, TypeSymbol type, bool hasErrors) 4450public BoundHostObjectMemberReference(SyntaxNode syntax, TypeSymbol type) 4477public BoundBaseReference(SyntaxNode syntax, TypeSymbol? type, bool hasErrors) 4482public BoundBaseReference(SyntaxNode syntax, TypeSymbol? type) 4506public BoundLocal(SyntaxNode syntax, LocalSymbol localSymbol, BoundLocalDeclarationKind declarationKind, ConstantValue? constantValueOpt, bool isNullableUnknown, TypeSymbol type, bool hasErrors) 4519public BoundLocal(SyntaxNode syntax, LocalSymbol localSymbol, BoundLocalDeclarationKind declarationKind, ConstantValue? constantValueOpt, bool isNullableUnknown, TypeSymbol type) 4555public BoundPseudoVariable(SyntaxNode syntax, LocalSymbol localSymbol, PseudoVariableExpressions emitExpressions, TypeSymbol type, bool hasErrors) 4567public BoundPseudoVariable(SyntaxNode syntax, LocalSymbol localSymbol, PseudoVariableExpressions emitExpressions, TypeSymbol type) 4600public BoundRangeVariable(SyntaxNode syntax, RangeVariableSymbol rangeVariableSymbol, BoundExpression value, TypeSymbol type, bool hasErrors = false) 4633public BoundParameter(SyntaxNode syntax, ParameterSymbol parameterSymbol, TypeSymbol type, bool hasErrors) 4643public BoundParameter(SyntaxNode syntax, ParameterSymbol parameterSymbol, TypeSymbol type) 4673public BoundLabelStatement(SyntaxNode syntax, LabelSymbol label, bool hasErrors) 4682public BoundLabelStatement(SyntaxNode syntax, LabelSymbol label) 4710public BoundGotoStatement(SyntaxNode syntax, LabelSymbol label, BoundExpression? caseExpressionOpt, BoundLabel? labelExpressionOpt, bool hasErrors = false) 4742public BoundLabeledStatement(SyntaxNode syntax, LabelSymbol label, BoundStatement body, bool hasErrors = false) 4773public BoundLabel(SyntaxNode syntax, LabelSymbol label, TypeSymbol? type, bool hasErrors) 4782public BoundLabel(SyntaxNode syntax, LabelSymbol label, TypeSymbol? type) 4810protected BoundStatementList(BoundKind kind, SyntaxNode syntax, ImmutableArray<BoundStatement> statements, bool hasErrors = false) 4819public BoundStatementList(SyntaxNode syntax, ImmutableArray<BoundStatement> statements, bool hasErrors = false) 4847public BoundConditionalGoto(SyntaxNode syntax, BoundExpression condition, bool jumpIfTrue, LabelSymbol label, bool hasErrors = false) 4880protected BoundSwitchExpression(BoundKind kind, SyntaxNode syntax, BoundExpression expression, ImmutableArray<BoundSwitchExpressionArm> switchArms, BoundDecisionDag reachabilityDecisionDag, LabelSymbol? defaultLabel, bool reportedNotExhaustive, TypeSymbol? type, bool hasErrors = false) 4904public BoundSwitchExpressionArm(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, BoundPattern pattern, BoundExpression? whenClause, BoundExpression value, LabelSymbol label, bool hasErrors = false) 4943public BoundUnconvertedSwitchExpression(SyntaxNode syntax, BoundExpression expression, ImmutableArray<BoundSwitchExpressionArm> switchArms, BoundDecisionDag reachabilityDecisionDag, LabelSymbol? defaultLabel, bool reportedNotExhaustive, TypeSymbol? type, bool hasErrors = false) 4971public BoundConvertedSwitchExpression(SyntaxNode syntax, TypeSymbol? naturalTypeOpt, bool wasTargetTyped, BoundExpression expression, ImmutableArray<BoundSwitchExpressionArm> switchArms, BoundDecisionDag reachabilityDecisionDag, LabelSymbol? defaultLabel, bool reportedNotExhaustive, TypeSymbol type, bool hasErrors = false) 5005public BoundDecisionDag(SyntaxNode syntax, BoundDecisionDagNode rootNode, bool hasErrors = false) 5033protected BoundDecisionDagNode(BoundKind kind, SyntaxNode syntax, bool hasErrors) 5038protected BoundDecisionDagNode(BoundKind kind, SyntaxNode syntax) 5047public BoundEvaluationDecisionDagNode(SyntaxNode syntax, BoundDagEvaluation evaluation, BoundDecisionDagNode next, bool hasErrors = false) 5078public BoundTestDecisionDagNode(SyntaxNode syntax, BoundDagTest test, BoundDecisionDagNode whenTrue, BoundDecisionDagNode whenFalse, bool hasErrors = false) 5112public BoundWhenDecisionDagNode(SyntaxNode syntax, ImmutableArray<BoundPatternBinding> bindings, BoundExpression? whenExpression, BoundDecisionDagNode whenTrue, BoundDecisionDagNode? whenFalse, bool hasErrors = false) 5147public BoundLeafDecisionDagNode(SyntaxNode syntax, LabelSymbol label, bool hasErrors) 5156public BoundLeafDecisionDagNode(SyntaxNode syntax, LabelSymbol label) 5184protected BoundDagTest(BoundKind kind, SyntaxNode syntax, BoundDagTemp input, bool hasErrors = false) 5198public BoundDagTemp(SyntaxNode syntax, TypeSymbol type, BoundDagEvaluation? source, int index, bool hasErrors = false) 5230public BoundDagTypeTest(SyntaxNode syntax, TypeSymbol type, BoundDagTemp input, bool hasErrors = false) 5259public BoundDagNonNullTest(SyntaxNode syntax, bool isExplicitTest, BoundDagTemp input, bool hasErrors = false) 5287public BoundDagExplicitNullTest(SyntaxNode syntax, BoundDagTemp input, bool hasErrors = false) 5313public BoundDagValueTest(SyntaxNode syntax, ConstantValue value, BoundDagTemp input, bool hasErrors = false) 5342public BoundDagRelationalTest(SyntaxNode syntax, BinaryOperatorKind operatorKind, ConstantValue value, BoundDagTemp input, bool hasErrors = false) 5373protected BoundDagEvaluation(BoundKind kind, SyntaxNode syntax, BoundDagTemp input, bool hasErrors = false) 5385public BoundDagDeconstructEvaluation(SyntaxNode syntax, MethodSymbol deconstructMethod, BoundDagTemp input, bool hasErrors = false) 5414public BoundDagTypeEvaluation(SyntaxNode syntax, TypeSymbol type, BoundDagTemp input, bool hasErrors = false) 5443public BoundDagFieldEvaluation(SyntaxNode syntax, FieldSymbol field, BoundDagTemp input, bool hasErrors = false) 5472public BoundDagPropertyEvaluation(SyntaxNode syntax, PropertySymbol property, bool isLengthOrCount, BoundDagTemp input, bool hasErrors = false) 5503public BoundDagIndexEvaluation(SyntaxNode syntax, PropertySymbol property, int index, BoundDagTemp input, bool hasErrors = false) 5534public BoundDagIndexerEvaluation(SyntaxNode syntax, TypeSymbol indexerType, BoundDagTemp lengthTemp, int index, BoundExpression indexerAccess, BoundListPatternReceiverPlaceholder receiverPlaceholder, BoundListPatternIndexPlaceholder argumentPlaceholder, BoundDagTemp input, bool hasErrors = false) 5581public BoundDagSliceEvaluation(SyntaxNode syntax, TypeSymbol sliceType, BoundDagTemp lengthTemp, int startIndex, int endIndex, BoundExpression indexerAccess, BoundSlicePatternReceiverPlaceholder receiverPlaceholder, BoundSlicePatternRangePlaceholder argumentPlaceholder, BoundDagTemp input, bool hasErrors = false) 5630public BoundDagAssignmentEvaluation(SyntaxNode syntax, BoundDagTemp target, BoundDagTemp input, bool hasErrors = false) 5659public BoundSwitchSection(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, ImmutableArray<BoundSwitchLabel> switchLabels, ImmutableArray<BoundStatement> statements, bool hasErrors = false) 5691public BoundSwitchLabel(SyntaxNode syntax, LabelSymbol label, BoundPattern pattern, BoundExpression? whenClause, bool hasErrors = false) 5724protected BoundMethodOrPropertyGroup(BoundKind kind, SyntaxNode syntax, BoundExpression? receiverOpt, LookupResultKind resultKind, bool hasErrors = false) 5738public BoundSequencePointExpression(SyntaxNode syntax, BoundExpression expression, TypeSymbol? type, bool hasErrors = false) 5766public BoundSequence(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, ImmutableArray<BoundExpression> sideEffects, BoundExpression value, TypeSymbol type, bool hasErrors = false) 5802public BoundSpillSequence(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, ImmutableArray<BoundStatement> sideEffects, BoundExpression value, TypeSymbol type, bool hasErrors = false) 5838public BoundDynamicMemberAccess(SyntaxNode syntax, BoundExpression receiver, ImmutableArray<TypeWithAnnotations> typeArgumentsOpt, string name, bool invoked, bool indexed, TypeSymbol type, bool hasErrors = false) 5877protected BoundDynamicInvocableBase(BoundKind kind, SyntaxNode syntax, BoundExpression expression, ImmutableArray<BoundExpression> arguments, TypeSymbol? type, bool hasErrors = false) 5894public BoundDynamicInvocation(SyntaxNode syntax, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, ImmutableArray<MethodSymbol> applicableMethods, BoundExpression expression, ImmutableArray<BoundExpression> arguments, TypeSymbol type, bool hasErrors = false) 5930public BoundConditionalAccess(SyntaxNode syntax, BoundExpression receiver, BoundExpression accessExpression, TypeSymbol type, bool hasErrors = false) 5963public BoundLoweredConditionalAccess(SyntaxNode syntax, BoundExpression receiver, MethodSymbol? hasValueMethodOpt, BoundExpression whenNotNull, BoundExpression? whenNullOpt, int id, bool forceCopyOfNullableValueType, TypeSymbol type, bool hasErrors = false) 6004public BoundConditionalReceiver(SyntaxNode syntax, int id, TypeSymbol type, bool hasErrors) 6013public BoundConditionalReceiver(SyntaxNode syntax, int id, TypeSymbol type) 6042public BoundComplexConditionalReceiver(SyntaxNode syntax, BoundExpression valueTypeReceiver, BoundExpression referenceTypeReceiver, TypeSymbol type, bool hasErrors = false) 6075public BoundMethodGroup(SyntaxNode syntax, ImmutableArray<TypeWithAnnotations> typeArgumentsOpt, string name, ImmutableArray<MethodSymbol> methods, Symbol? lookupSymbolOpt, DiagnosticInfo? lookupError, BoundMethodGroupFlags? flags, FunctionTypeSymbol? functionType, BoundExpression? receiverOpt, LookupResultKind resultKind, bool hasErrors = false) 6116public BoundPropertyGroup(SyntaxNode syntax, ImmutableArray<PropertySymbol> properties, BoundExpression? receiverOpt, LookupResultKind resultKind, bool hasErrors = false) 6144public BoundCall(SyntaxNode syntax, BoundExpression? receiverOpt, ThreeState initialBindingReceiverIsSubjectToCloning, MethodSymbol method, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, bool isDelegateCall, bool expanded, bool invokedAsExtensionMethod, ImmutableArray<int> argsToParamsOpt, BitVector defaultArguments, LookupResultKind resultKind, ImmutableArray<MethodSymbol> originalMethodsOpt, TypeSymbol type, bool hasErrors = false) 6199public BoundEventAssignmentOperator(SyntaxNode syntax, EventSymbol @event, bool isAddition, bool isDynamic, BoundExpression? receiverOpt, BoundExpression argument, TypeSymbol type, bool hasErrors = false) 6238public BoundAttribute(SyntaxNode syntax, MethodSymbol? constructor, ImmutableArray<BoundExpression> constructorArguments, ImmutableArray<string?> constructorArgumentNamesOpt, ImmutableArray<int> constructorArgumentsToParamsOpt, bool constructorExpanded, BitVector constructorDefaultArguments, ImmutableArray<BoundAssignmentOperator> namedArguments, LookupResultKind resultKind, TypeSymbol type, bool hasErrors = false) 6283public BoundUnconvertedObjectCreationExpression(SyntaxNode syntax, ImmutableArray<BoundExpression> arguments, ImmutableArray<(string Name, Location Location)?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, InitializerExpressionSyntax? initializerOpt, Binder binder, bool hasErrors = false) 6321protected BoundObjectCreationExpressionBase(BoundKind kind, SyntaxNode syntax, TypeSymbol type, bool hasErrors) 6329protected BoundObjectCreationExpressionBase(BoundKind kind, SyntaxNode syntax, TypeSymbol type) 6342public BoundObjectCreationExpression(SyntaxNode syntax, MethodSymbol constructor, ImmutableArray<MethodSymbol> constructorsGroup, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, bool expanded, ImmutableArray<int> argsToParamsOpt, BitVector defaultArguments, ConstantValue? constantValueOpt, BoundObjectInitializerExpressionBase? initializerExpressionOpt, bool wasTargetTyped, TypeSymbol type, bool hasErrors = false) 6393protected BoundCollectionExpressionBase(BoundKind kind, SyntaxNode syntax, ImmutableArray<BoundNode> elements, TypeSymbol? type, bool hasErrors = false) 6407public BoundUnconvertedCollectionExpression(SyntaxNode syntax, ImmutableArray<BoundNode> elements, bool hasErrors = false) 6434public BoundCollectionExpression(SyntaxNode syntax, CollectionExpressionTypeKind collectionTypeKind, BoundObjectOrCollectionValuePlaceholder? placeholder, BoundExpression? collectionCreation, MethodSymbol? collectionBuilderMethod, BoundValuePlaceholder? collectionBuilderInvocationPlaceholder, BoundExpression? collectionBuilderInvocationConversion, bool wasTargetTyped, BoundUnconvertedCollectionExpression unconvertedCollectionExpression, ImmutableArray<BoundNode> elements, TypeSymbol type, bool hasErrors = false) 6479public BoundCollectionExpressionSpreadExpressionPlaceholder(SyntaxNode syntax, TypeSymbol? type, bool hasErrors) 6484public BoundCollectionExpressionSpreadExpressionPlaceholder(SyntaxNode syntax, TypeSymbol? type) 6507public BoundCollectionExpressionSpreadElement(SyntaxNode syntax, BoundExpression expression, BoundCollectionExpressionSpreadExpressionPlaceholder? expressionPlaceholder, BoundExpression? conversion, ForEachEnumeratorInfo? enumeratorInfoOpt, BoundExpression? lengthOrCount, BoundValuePlaceholder? elementPlaceholder, BoundStatement? iteratorBody, bool hasErrors = false) 6547protected BoundTupleExpression(BoundKind kind, SyntaxNode syntax, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<bool> inferredNamesOpt, TypeSymbol? type, bool hasErrors = false) 6565public BoundTupleLiteral(SyntaxNode syntax, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<bool> inferredNamesOpt, TypeSymbol? type, bool hasErrors = false) 6592public BoundConvertedTupleLiteral(SyntaxNode syntax, BoundTupleLiteral? sourceTuple, bool wasTargetTyped, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<bool> inferredNamesOpt, TypeSymbol? type, bool hasErrors = false) 6622public BoundDynamicObjectCreationExpression(SyntaxNode syntax, string name, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, BoundObjectInitializerExpressionBase? initializerExpressionOpt, ImmutableArray<MethodSymbol> applicableMethods, bool wasTargetTyped, TypeSymbol type, bool hasErrors = false) 6665public BoundNoPiaObjectCreationExpression(SyntaxNode syntax, string? guidString, BoundObjectInitializerExpressionBase? initializerExpressionOpt, bool wasTargetTyped, TypeSymbol type, bool hasErrors = false) 6697protected BoundObjectInitializerExpressionBase(BoundKind kind, SyntaxNode syntax, BoundObjectOrCollectionValuePlaceholder placeholder, ImmutableArray<BoundExpression> initializers, TypeSymbol type, bool hasErrors = false) 6716public BoundObjectInitializerExpression(SyntaxNode syntax, BoundObjectOrCollectionValuePlaceholder placeholder, ImmutableArray<BoundExpression> initializers, TypeSymbol type, bool hasErrors = false) 6744public BoundObjectInitializerMember(SyntaxNode syntax, Symbol? memberSymbol, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, bool expanded, ImmutableArray<int> argsToParamsOpt, BitVector defaultArguments, LookupResultKind resultKind, AccessorKind accessorKind, TypeSymbol receiverType, TypeSymbol type, bool hasErrors = false) 6793public BoundDynamicObjectInitializerMember(SyntaxNode syntax, string memberName, TypeSymbol receiverType, TypeSymbol type, bool hasErrors) 6805public BoundDynamicObjectInitializerMember(SyntaxNode syntax, string memberName, TypeSymbol receiverType, TypeSymbol type) 6838public BoundCollectionInitializerExpression(SyntaxNode syntax, BoundObjectOrCollectionValuePlaceholder placeholder, ImmutableArray<BoundExpression> initializers, TypeSymbol type, bool hasErrors = false) 6866public BoundCollectionElementInitializer(SyntaxNode syntax, MethodSymbol addMethod, ImmutableArray<BoundExpression> arguments, BoundExpression? implicitReceiverOpt, bool expanded, ImmutableArray<int> argsToParamsOpt, BitVector defaultArguments, bool invokedAsExtensionMethod, LookupResultKind resultKind, TypeSymbol type, bool hasErrors = false) 6911public BoundDynamicCollectionElementInitializer(SyntaxNode syntax, ImmutableArray<MethodSymbol> applicableMethods, BoundExpression expression, ImmutableArray<BoundExpression> arguments, TypeSymbol type, bool hasErrors = false) 6943public BoundImplicitReceiver(SyntaxNode syntax, TypeSymbol type, bool hasErrors) 6951public BoundImplicitReceiver(SyntaxNode syntax, TypeSymbol type) 6978public BoundAnonymousObjectCreationExpression(SyntaxNode syntax, MethodSymbol constructor, ImmutableArray<BoundExpression> arguments, ImmutableArray<BoundAnonymousPropertyDeclaration> declarations, TypeSymbol type, bool hasErrors = false) 7014public BoundAnonymousPropertyDeclaration(SyntaxNode syntax, PropertySymbol property, TypeSymbol type, bool hasErrors) 7024public BoundAnonymousPropertyDeclaration(SyntaxNode syntax, PropertySymbol property, TypeSymbol type) 7054public BoundNewT(SyntaxNode syntax, BoundObjectInitializerExpressionBase? initializerExpressionOpt, bool wasTargetTyped, TypeSymbol type, bool hasErrors = false) 7084public BoundDelegateCreationExpression(SyntaxNode syntax, BoundExpression argument, MethodSymbol? methodOpt, bool isExtensionMethod, bool wasTargetTyped, TypeSymbol type, bool hasErrors = false) 7120public BoundArrayCreation(SyntaxNode syntax, ImmutableArray<BoundExpression> bounds, BoundArrayInitialization? initializerOpt, TypeSymbol type, bool hasErrors = false) 7152public BoundArrayInitialization(SyntaxNode syntax, bool isInferred, ImmutableArray<BoundExpression> initializers, bool hasErrors = false) 7183protected BoundStackAllocArrayCreationBase(BoundKind kind, SyntaxNode syntax, TypeSymbol elementType, BoundExpression count, BoundArrayInitialization? initializerOpt, TypeSymbol? type, bool hasErrors = false) 7202public BoundStackAllocArrayCreation(SyntaxNode syntax, TypeSymbol elementType, BoundExpression count, BoundArrayInitialization? initializerOpt, TypeSymbol? type, bool hasErrors = false) 7229public BoundConvertedStackAllocExpression(SyntaxNode syntax, TypeSymbol elementType, BoundExpression count, BoundArrayInitialization? initializerOpt, TypeSymbol type, bool hasErrors = false) 7258public BoundFieldAccess(SyntaxNode syntax, BoundExpression? receiverOpt, FieldSymbol fieldSymbol, ConstantValue? constantValueOpt, LookupResultKind resultKind, bool isByValue, bool isDeclaration, TypeSymbol type, bool hasErrors = false) 7298public BoundHoistedFieldAccess(SyntaxNode syntax, FieldSymbol fieldSymbol, TypeSymbol type, bool hasErrors) 7308public BoundHoistedFieldAccess(SyntaxNode syntax, FieldSymbol fieldSymbol, TypeSymbol type) 7338public BoundPropertyAccess(SyntaxNode syntax, BoundExpression? receiverOpt, ThreeState initialBindingReceiverIsSubjectToCloning, PropertySymbol propertySymbol, AccessorKind autoPropertyAccessorKind, LookupResultKind resultKind, TypeSymbol type, bool hasErrors = false) 7376public BoundEventAccess(SyntaxNode syntax, BoundExpression? receiverOpt, EventSymbol eventSymbol, bool isUsableAsField, LookupResultKind resultKind, TypeSymbol type, bool hasErrors = false) 7412public BoundIndexerAccess(SyntaxNode syntax, BoundExpression? receiverOpt, ThreeState initialBindingReceiverIsSubjectToCloning, PropertySymbol indexer, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, bool expanded, AccessorKind accessorKind, ImmutableArray<int> argsToParamsOpt, BitVector defaultArguments, ImmutableArray<PropertySymbol> originalIndexersOpt, TypeSymbol type, bool hasErrors = false) 7463public BoundImplicitIndexerAccess(SyntaxNode syntax, BoundExpression receiver, BoundExpression argument, BoundExpression lengthOrCountAccess, BoundImplicitIndexerReceiverPlaceholder receiverPlaceholder, BoundExpression indexerOrSliceAccess, ImmutableArray<BoundImplicitIndexerValuePlaceholder> argumentPlaceholders, TypeSymbol type, bool hasErrors = false) 7512public BoundInlineArrayAccess(SyntaxNode syntax, BoundExpression expression, BoundExpression argument, bool isValue, WellKnownMember getItemOrSliceHelper, TypeSymbol type, bool hasErrors = false) 7553public BoundDynamicIndexerAccess(SyntaxNode syntax, BoundExpression receiver, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, ImmutableArray<PropertySymbol> applicableIndexers, TypeSymbol type, bool hasErrors = false) 7593public BoundLambda(SyntaxNode syntax, UnboundLambda unboundLambda, LambdaSymbol symbol, BoundBlock body, ReadOnlyBindingDiagnostic<AssemblySymbol> diagnostics, Binder binder, TypeSymbol? type, bool hasErrors = false) 7633public UnboundLambda(SyntaxNode syntax, UnboundLambdaState data, FunctionTypeSymbol? functionType, Boolean withDependencies, bool hasErrors) 7644public UnboundLambda(SyntaxNode syntax, UnboundLambdaState data, FunctionTypeSymbol? functionType, Boolean withDependencies) 7677public BoundQueryClause(SyntaxNode syntax, BoundExpression value, RangeVariableSymbol? definedSymbol, BoundExpression? operation, BoundExpression? cast, Binder binder, BoundExpression? unoptimizedForm, TypeSymbol type, bool hasErrors = false) 7718public BoundTypeOrInstanceInitializers(SyntaxNode syntax, ImmutableArray<BoundStatement> statements, bool hasErrors = false) 7744public BoundNameOfOperator(SyntaxNode syntax, BoundExpression argument, ConstantValue constantValueOpt, TypeSymbol type, bool hasErrors = false) 7777protected BoundInterpolatedStringBase(BoundKind kind, SyntaxNode syntax, ImmutableArray<BoundExpression> parts, ConstantValue? constantValueOpt, TypeSymbol? type, bool hasErrors = false) 7793public BoundUnconvertedInterpolatedString(SyntaxNode syntax, ImmutableArray<BoundExpression> parts, ConstantValue? constantValueOpt, TypeSymbol? type, bool hasErrors = false) 7819public BoundInterpolatedString(SyntaxNode syntax, InterpolatedStringHandlerData? interpolationData, ImmutableArray<BoundExpression> parts, ConstantValue? constantValueOpt, TypeSymbol? type, bool hasErrors = false) 7847public BoundInterpolatedStringHandlerPlaceholder(SyntaxNode syntax, TypeSymbol? type, bool hasErrors) 7852public BoundInterpolatedStringHandlerPlaceholder(SyntaxNode syntax, TypeSymbol? type) 7875public BoundInterpolatedStringArgumentPlaceholder(SyntaxNode syntax, int argumentIndex, TypeSymbol type, bool hasErrors) 7884public BoundInterpolatedStringArgumentPlaceholder(SyntaxNode syntax, int argumentIndex, TypeSymbol type) 7913public BoundStringInsert(SyntaxNode syntax, BoundExpression value, BoundExpression? alignment, BoundLiteral? format, bool isInterpolatedStringHandlerAppendCall, bool hasErrors = false) 7948public BoundIsPatternExpression(SyntaxNode syntax, BoundExpression expression, BoundPattern pattern, bool isNegated, BoundDecisionDag reachabilityDecisionDag, LabelSymbol whenTrueLabel, LabelSymbol whenFalseLabel, TypeSymbol? type, bool hasErrors = false) 7990protected BoundPattern(BoundKind kind, SyntaxNode syntax, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors) 8001protected BoundPattern(BoundKind kind, SyntaxNode syntax, TypeSymbol inputType, TypeSymbol narrowedType) 8018public BoundConstantPattern(SyntaxNode syntax, BoundExpression value, ConstantValue constantValue, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false) 8051public BoundDiscardPattern(SyntaxNode syntax, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors) 8060public BoundDiscardPattern(SyntaxNode syntax, TypeSymbol inputType, TypeSymbol narrowedType) 8087protected BoundObjectPattern(BoundKind kind, SyntaxNode syntax, Symbol? variable, BoundExpression? variableAccess, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false) 8104public BoundDeclarationPattern(SyntaxNode syntax, BoundTypeExpression declaredType, bool isVar, Symbol? variable, BoundExpression? variableAccess, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false) 8136public BoundRecursivePattern(SyntaxNode syntax, BoundTypeExpression? declaredType, MethodSymbol? deconstructMethod, ImmutableArray<BoundPositionalSubpattern> deconstruction, ImmutableArray<BoundPropertySubpattern> properties, bool isExplicitNotNullTest, Symbol? variable, BoundExpression? variableAccess, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false) 8173public BoundListPattern(SyntaxNode syntax, ImmutableArray<BoundPattern> subpatterns, bool hasSlice, BoundExpression? lengthAccess, BoundExpression? indexerAccess, BoundListPatternReceiverPlaceholder? receiverPlaceholder, BoundListPatternIndexPlaceholder? argumentPlaceholder, Symbol? variable, BoundExpression? variableAccess, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false) 8217public BoundSlicePattern(SyntaxNode syntax, BoundPattern? pattern, BoundExpression? indexerAccess, BoundSlicePatternReceiverPlaceholder? receiverPlaceholder, BoundSlicePatternRangePlaceholder? argumentPlaceholder, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false) 8256public BoundITuplePattern(SyntaxNode syntax, MethodSymbol getLengthMethod, MethodSymbol getItemMethod, ImmutableArray<BoundPositionalSubpattern> subpatterns, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false) 8292protected BoundSubpattern(BoundKind kind, SyntaxNode syntax, BoundPattern pattern, bool hasErrors = false) 8306public BoundPositionalSubpattern(SyntaxNode syntax, Symbol? symbol, BoundPattern pattern, bool hasErrors = false) 8334public BoundPropertySubpattern(SyntaxNode syntax, BoundPropertySubpatternMember? member, bool isLengthOrCount, BoundPattern pattern, bool hasErrors = false) 8364public BoundPropertySubpatternMember(SyntaxNode syntax, BoundPropertySubpatternMember? receiver, Symbol? symbol, TypeSymbol type, bool hasErrors = false) 8396public BoundTypePattern(SyntaxNode syntax, BoundTypeExpression declaredType, bool isExplicitNotNullTest, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false) 8428public BoundBinaryPattern(SyntaxNode syntax, bool disjunction, BoundPattern left, BoundPattern right, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false) 8463public BoundNegatedPattern(SyntaxNode syntax, BoundPattern negated, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false) 8493public BoundRelationalPattern(SyntaxNode syntax, BinaryOperatorKind relation, BoundExpression value, ConstantValue constantValue, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false) 8528public BoundDiscardExpression(SyntaxNode syntax, NullableAnnotation nullableAnnotation, bool isInferred, TypeSymbol? type, bool hasErrors) 8535public BoundDiscardExpression(SyntaxNode syntax, NullableAnnotation nullableAnnotation, bool isInferred, TypeSymbol? type) 8563public BoundThrowExpression(SyntaxNode syntax, BoundExpression expression, TypeSymbol? type, bool hasErrors = false) 8591protected VariablePendingInference(BoundKind kind, SyntaxNode syntax, Symbol variableSymbol, BoundExpression? receiverOpt, bool hasErrors = false) 8608public OutVariablePendingInference(SyntaxNode syntax, Symbol variableSymbol, BoundExpression? receiverOpt, bool hasErrors = false) 8634public DeconstructionVariablePendingInference(SyntaxNode syntax, Symbol variableSymbol, BoundExpression? receiverOpt, bool hasErrors = false) 8660public OutDeconstructVarPendingInference(SyntaxNode syntax, Symbol? variableSymbol, bool isDiscardExpression, bool hasErrors) 8667public OutDeconstructVarPendingInference(SyntaxNode syntax, Symbol? variableSymbol, bool isDiscardExpression) 8695protected BoundMethodBodyBase(BoundKind kind, SyntaxNode syntax, BoundBlock? blockBody, BoundBlock? expressionBody, bool hasErrors = false) 8708public BoundNonConstructorMethodBody(SyntaxNode syntax, BoundBlock? blockBody, BoundBlock? expressionBody, bool hasErrors = false) 8731public BoundConstructorMethodBody(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, BoundStatement? initializer, BoundBlock? blockBody, BoundBlock? expressionBody, bool hasErrors = false) 8761public BoundExpressionWithNullability(SyntaxNode syntax, BoundExpression expression, NullableAnnotation nullableAnnotation, TypeSymbol? type, bool hasErrors = false) 8792public BoundWithExpression(SyntaxNode syntax, BoundExpression receiver, MethodSymbol? cloneMethod, BoundObjectInitializerExpressionBase initializerExpression, TypeSymbol type, bool hasErrors = false)
Lowering\AsyncRewriter\AsyncExceptionHandlerRewriter.cs (5)
137var tryStatementSyntax = node.Syntax; 142var oldTrySyntax = _F.Syntax; 150BoundNode visitTryStatement(BoundTryStatement node, SyntaxNode tryStatementSyntax) 918private readonly SyntaxNode _syntaxOpt; 937public AwaitFinallyFrame(AwaitFinallyFrame parent, HashSet<LabelSymbol> labelsOpt, SyntaxNode syntax)
Lowering\AsyncRewriter\AsyncMethodToStateMachineRewriter.cs (1)
463var awaitSyntax = awaiterTemp.GetDeclaratorSyntax();
Lowering\ClosureConversion\ClosureConversion.Analysis.cs (1)
527internal DebugId GetClosureId(ClosureEnvironment environment, SyntaxNode syntax, ArrayBuilder<EncClosureInfo> closureDebugInfo, out RuntimeRudeEdit? rudeEdit)
Lowering\ClosureConversion\ClosureConversion.Analysis.Tree.cs (2)
606private void AddIfCaptured(Symbol symbol, SyntaxNode syntax) 680private void AddDiagnosticIfRestrictedType(Symbol capturedVariable, SyntaxNode syntax)
Lowering\ClosureConversion\ClosureConversion.cs (15)
367var syntax = scopeBoundNode.Syntax; 410var syntax = originalMethod.DeclaringSyntaxReferences[0].GetSyntax(); 504private SynthesizedClosureEnvironment GetStaticFrame(BindingDiagnosticBag diagnostics, SyntaxNode syntax) 577private BoundExpression FrameOfType(SyntaxNode syntax, NamedTypeSymbol frameType) 592protected override BoundExpression FramePointer(SyntaxNode syntax, NamedTypeSymbol frameClass) 668SyntaxNode syntax = node.Syntax; 744private void InitVariableProxy(SyntaxNode syntax, Symbol symbol, LocalSymbol framePointer, ArrayBuilder<BoundExpression> prologue) 869SyntaxNode syntax, 1011SyntaxNode syntax, 1439private DebugId GetLambdaId(SyntaxNode syntax, ClosureKind closureKind, int closureOrdinal, ImmutableArray<DebugId> structClosureIds, RuntimeRudeEdit? closureRudeEdit) 1445SyntaxNode? lambdaOrLambdaBodySyntax; 1455lambdaOrLambdaBodySyntax = (SyntaxNode?)localFunction.Body ?? localFunction.ExpressionBody?.Expression; 1765private static bool InLoopOrLambda(SyntaxNode lambdaSyntax, SyntaxNode scopeSyntax) 1767var curSyntax = lambdaSyntax.Parent;
Lowering\ClosureConversion\ExpressionLambdaRewriter.cs (2)
100private ExpressionLambdaRewriter(TypeCompilationState compilationState, TypeMap typeMap, SyntaxNode node, int recursionDepth, BindingDiagnosticBag diagnostics) 172SyntaxNode old = _bound.Syntax;
Lowering\ClosureConversion\SynthesizedClosureEnvironment.cs (4)
25internal readonly SyntaxNode ScopeSyntaxOpt; 49SyntaxNode scopeSyntaxOpt, 77private static string MakeName(SyntaxNode scopeSyntaxOpt, DebugId methodId, DebugId closureId) 91private static void AssertIsClosureScopeSyntax(SyntaxNode syntaxOpt)
Lowering\InitializerRewriter.cs (1)
92SyntaxNode syntax = fieldInit.Syntax;
Lowering\Instrumentation\CodeCoverageInstrumenter.cs (15)
128SyntaxNode syntax = MethodDeclarationIfAvailable(methodBody.Syntax); 167SyntaxNode methodBodySyntax, 476private static Cci.DebugSourceDocument GetSourceDocument(DebugDocumentProvider debugDocumentProvider, SyntaxNode syntax) 481private static Cci.DebugSourceDocument GetSourceDocument(DebugDocumentProvider debugDocumentProvider, SyntaxNode syntax, FileLinePositionSpan span) 493private BoundStatement AddAnalysisPoint(SyntaxNode syntaxForSpan, Text.TextSpan alternateSpan, SyntheticBoundNodeFactory statementFactory) 498private BoundStatement AddAnalysisPoint(SyntaxNode syntaxForSpan, SyntheticBoundNodeFactory statementFactory) 503private BoundStatement AddAnalysisPoint(SyntaxNode syntaxForSpan, FileLinePositionSpan span, SyntheticBoundNodeFactory statementFactory) 523private static SyntaxNode SyntaxForSpan(BoundStatement statement) 525SyntaxNode syntaxForSpan; 564private static MethodSymbol GetCreatePayloadOverload(CSharpCompilation compilation, WellKnownMember overload, SyntaxNode syntax, BindingDiagnosticBag diagnostics) 569private static SyntaxNode MethodDeclarationIfAvailable(SyntaxNode body) 571SyntaxNode? parent = body.Parent; 593private static TextSpan SkipAttributes(SyntaxNode syntax) 623private static TextSpan SkipAttributes(SyntaxNode syntax, SyntaxList<AttributeListSyntax> attributes, SyntaxTokenList modifiers, SyntaxToken keyword, TypeSyntax? type)
Lowering\Instrumentation\DebugInfoInjector.cs (4)
121SyntaxNode syntax = original.Syntax; 132private static BoundStatement InstrumentFieldOrPropertyInitializer(BoundStatement rewritten, SyntaxNode syntax) 142var grandparent = syntax.Parent.Parent; 199SyntaxNode? parent = original.Syntax.Parent;
Lowering\Instrumentation\DebugInfoInjector_SequencePoints.cs (3)
87internal static void GetBreakpointSpan(VariableDeclaratorSyntax declaratorSyntax, out SyntaxNode node, out TextSpan? part) 142internal static void GetFirstLocalOrFieldBreakpointSpan(SyntaxToken? firstToken, VariableDeclaratorSyntax declaratorSyntax, out SyntaxNode node, out TextSpan? part) 171private static BoundExpression AddConditionSequencePoint(BoundExpression condition, SyntaxNode synthesizedVariableSyntax, SyntheticBoundNodeFactory factory)
Lowering\Instrumentation\LocalStateTracingInstrumenter.cs (3)
204private MethodSymbol? GetLocalOrParameterStoreLogger(TypeSymbol variableType, Symbol targetSymbol, bool? refAssignmentSourceIsLocal, SyntaxNode syntax) 268private MethodSymbol? GetWellKnownMethodSymbol(WellKnownMember overload, SyntaxNode syntax) 271private MethodSymbol? GetSpecialMethodSymbol(SpecialMember overload, SyntaxNode syntax)
Lowering\IteratorRewriter\IteratorMethodToStateMachineRewriter.cs (1)
464var syntax = statement.Syntax;
Lowering\LocalRewriter\DelegateCacheRewriter.cs (1)
48var oldSyntax = _factory.Syntax;
Lowering\LocalRewriter\LocalRewriter.cs (11)
581private static BoundExpression BadExpression(SyntaxNode syntax, TypeSymbol resultType, BoundExpression child) 586private static BoundExpression BadExpression(SyntaxNode syntax, TypeSymbol resultType, BoundExpression child1, BoundExpression child2) 591private static BoundExpression BadExpression(SyntaxNode syntax, TypeSymbol resultType, ImmutableArray<BoundExpression> children) 596private bool TryGetWellKnownTypeMember<TSymbol>(SyntaxNode? syntax, WellKnownMember member, [NotNullWhen(true)] out TSymbol? symbol, bool isOptional = false, Location? location = null) where TSymbol : Symbol 606/// Recommendation: Do not use, use <see cref="TryGetSpecialTypeMethod(SyntaxNode, SpecialMember, out MethodSymbol, bool)"/> instead! 609private MethodSymbol UnsafeGetSpecialTypeMethod(SyntaxNode syntax, SpecialMember specialMember) 616/// Recommendation: Do not use, use <see cref="TryGetSpecialTypeMethod(SyntaxNode, SpecialMember, CSharpCompilation, BindingDiagnosticBag, out MethodSymbol, bool)"/> instead! 619private static MethodSymbol UnsafeGetSpecialTypeMethod(SyntaxNode syntax, SpecialMember specialMember, CSharpCompilation compilation, BindingDiagnosticBag diagnostics) 636private bool TryGetSpecialTypeMethod(SyntaxNode syntax, SpecialMember specialMember, out MethodSymbol method, bool isOptional = false) 641private static bool TryGetSpecialTypeMethod(SyntaxNode syntax, SpecialMember specialMember, CSharpCompilation compilation, BindingDiagnosticBag diagnostics, out MethodSymbol method, bool isOptional = false) 863var syntax = initializer.Syntax;
Lowering\LocalRewriter\LocalRewriter.DecisionDagRewriter.cs (5)
32protected abstract ArrayBuilder<BoundStatement> BuilderForSection(SyntaxNode section); 55SyntaxNode node, 618SyntaxNode syntax, 894private void EnsureStringHashFunction(int labelsCount, SyntaxNode syntaxNode, StringPatternInput stringPatternInput) 1123void addConditionalGoto(BoundExpression whenExpression, SyntaxNode whenClauseSyntax, LabelSymbol whenTrueLabel, ArrayBuilder<BoundStatement> sectionBuilder)
Lowering\LocalRewriter\LocalRewriter.DecisionDagRewriter.ValueDispatchNode.cs (7)
28public readonly SyntaxNode Syntax; 30public ValueDispatchNode(SyntaxNode syntax) => Syntax = syntax; 40public SwitchDispatch(SyntaxNode syntax, ImmutableArray<(ConstantValue value, LabelSymbol label)> dispatches, LabelSymbol otherwise) : base(syntax) 54public LeafDispatchNode(SyntaxNode syntax, LabelSymbol Label) : base(syntax) => this.Label = Label; 86private RelationalDispatch(SyntaxNode syntax, ConstantValue value, BinaryOperatorKind op, ValueDispatchNode left, ValueDispatchNode right) : base(syntax) 133public static ValueDispatchNode CreateBalanced(SyntaxNode syntax, ConstantValue value, BinaryOperatorKind op, ValueDispatchNode whenTrue, ValueDispatchNode whenFalse) 140private static ValueDispatchNode CreateBalancedCore(SyntaxNode syntax, ConstantValue value, BinaryOperatorKind op, ValueDispatchNode left, ValueDispatchNode right)
Lowering\LocalRewriter\LocalRewriter.PatternLocalRewriter.cs (6)
30public PatternLocalRewriter(SyntaxNode node, LocalRewriter localRewriter, bool generateInstrumentation) 58private readonly SyntaxNode _node; 62public DagTempAllocator(SyntheticBoundNodeFactory factory, SyntaxNode node, bool generateSequencePoints) 367private BoundExpression MakeNullCheck(SyntaxNode syntax, BoundExpression rewrittenExpr, BinaryOperatorKind operatorKind) 387protected BoundExpression MakeValueTest(SyntaxNode syntax, BoundExpression input, ConstantValue value) 401protected BoundExpression MakeRelationalTest(SyntaxNode syntax, BoundExpression input, BinaryOperatorKind operatorKind, ConstantValue value)
Lowering\LocalRewriter\LocalRewriter_AsOperator.cs (1)
34SyntaxNode syntax,
Lowering\LocalRewriter\LocalRewriter_AssignmentOperator.cs (3)
91private BoundExpression MakeAssignmentOperator(SyntaxNode syntax, BoundExpression rewrittenLeft, BoundExpression rewrittenRight, 167SyntaxNode syntax, 268SyntaxNode syntax,
Lowering\LocalRewriter\LocalRewriter_Await.cs (1)
23private BoundExpression RewriteAwaitExpression(SyntaxNode syntax, BoundExpression rewrittenExpression, BoundAwaitableInfo awaitableInfo, TypeSymbol type, BoundAwaitExpressionDebugInfo debugInfo, bool used)
Lowering\LocalRewriter\LocalRewriter_BasePatternSwitchLocalRewriter.cs (8)
25private readonly PooledDictionary<SyntaxNode, ArrayBuilder<BoundStatement>> _switchArms = PooledDictionary<SyntaxNode, ArrayBuilder<BoundStatement>>.GetInstance(); 27protected override ArrayBuilder<BoundStatement> BuilderForSection(SyntaxNode whenClauseSyntax) 30SyntaxNode? sectionSyntax = whenClauseSyntax is SwitchLabelSyntax l ? l.Parent : whenClauseSyntax; 40SyntaxNode node, 42ImmutableArray<SyntaxNode> arms, 46foreach (var arm in arms) 68protected (ImmutableArray<BoundStatement> loweredDag, ImmutableDictionary<SyntaxNode, ImmutableArray<BoundStatement>> switchSections) LowerDecisionDag(BoundDecisionDag decisionDag)
Lowering\LocalRewriter\LocalRewriter_BinaryOperator.cs (36)
71var syntax = node.Syntax; 175SyntaxNode syntax, 191SyntaxNode syntax, 537private BoundExpression RewriteLiftedBinaryOperator(SyntaxNode syntax, BinaryOperatorKind operatorKind, BoundExpression loweredLeft, BoundExpression loweredRight, TypeSymbol type, MethodSymbol? method, TypeSymbol? constrainedToTypeOpt) 596SyntaxNode syntax, 725private BoundExpression MakeTruthTestForDynamicLogicalOperator(SyntaxNode syntax, BoundExpression loweredLeft, TypeSymbol boolean, MethodSymbol? leftTruthOperator, TypeSymbol? constrainedToTypeOpt, bool negative) 768SyntaxNode syntax, 796SyntaxNode syntax, 888private BoundExpression MakeOptimizedGetValueOrDefault(SyntaxNode syntax, BoundExpression expression) 906private BoundExpression MakeBooleanConstant(SyntaxNode syntax, bool value) 911private BoundExpression MakeOptimizedHasValue(SyntaxNode syntax, BoundExpression expression) 925private BoundExpression MakeNullableHasValue(SyntaxNode syntax, BoundExpression expression) 936SyntaxNode syntax, 1126SyntaxNode syntax, 1294SyntaxNode syntax, 1334SyntaxNode syntax, 1360SyntaxNode syntax, 1403SyntaxNode syntax, 1505SyntaxNode syntax, 1640private BoundExpression MakeNewNullableBoolean(SyntaxNode syntax, bool? value) 1656SyntaxNode syntax, 1741SyntaxNode syntax, 1802SyntaxNode syntax, 1894private MethodSymbol UnsafeGetNullableMethod(SyntaxNode syntax, TypeSymbol nullableType, SpecialMember member) 1904internal static MethodSymbol UnsafeGetNullableMethod(SyntaxNode syntax, TypeSymbol nullableType, SpecialMember member, CSharpCompilation compilation, BindingDiagnosticBag diagnostics) 1911private bool TryGetNullableMethod(SyntaxNode syntax, TypeSymbol nullableType, SpecialMember member, out MethodSymbol result, bool isOptional = false) 1924SyntaxNode syntax, 1995private BoundExpression RewriteStringEquality(BoundBinaryOperator? oldNode, SyntaxNode syntax, BinaryOperatorKind operatorKind, BoundExpression loweredLeft, BoundExpression loweredRight, TypeSymbol type, SpecialMember member) 2008private BoundExpression RewriteDelegateOperation(SyntaxNode syntax, BinaryOperatorKind operatorKind, BoundExpression loweredLeft, BoundExpression loweredRight, TypeSymbol type, SpecialMember member) 2038private BoundExpression RewriteDecimalBinaryOperation(SyntaxNode syntax, BoundExpression loweredLeft, BoundExpression loweredRight, BinaryOperatorKind operatorKind) 2069private BoundExpression MakeNullCheck(SyntaxNode syntax, BoundExpression rewrittenExpr, BinaryOperatorKind operatorKind) 2128SyntaxNode syntax, 2135SyntaxNode rightSyntax = loweredRight.Syntax; 2190SyntaxNode syntax, 2213var oldSyntax = _factory.Syntax; 2250SyntaxNode syntax,
Lowering\LocalRewriter\LocalRewriter_Call.cs (6)
97private void EmbedIfNeedTo(BoundExpression receiver, ImmutableArray<MethodSymbol> methods, SyntaxNode syntaxNode) 116private void EmbedIfNeedTo(BoundExpression receiver, ImmutableArray<PropertySymbol> properties, SyntaxNode syntaxNode) 439SyntaxNode syntax, 522private BoundExpression MakeCall(SyntaxNode syntax, BoundExpression? rewrittenReceiver, MethodSymbol method, ImmutableArray<BoundExpression> rewrittenArguments) 1398private BoundExpression CreateEmptyArray(SyntaxNode syntax, ArrayTypeSymbol arrayType) 1418private BoundExpression? CreateArrayEmptyCallIfAvailable(SyntaxNode syntax, TypeSymbol elementType)
Lowering\LocalRewriter\LocalRewriter_CollectionExpression.cs (8)
38var previousSyntax = _factory.Syntax; 253var syntax = node.Syntax; 360var syntax = iteratorBody.Syntax; 403var syntax = node.Syntax; 541SyntaxNode syntax, 721var syntax = node.Syntax; 792var expressionSyntax = rewrittenValue.Syntax; 1128var expressionSyntax = rewrittenValue.Syntax;
Lowering\LocalRewriter\LocalRewriter_CompoundAssignmentOperator.cs (2)
120SyntaxNode syntax = node.Syntax; 322SyntaxNode syntax = indexerAccess.Syntax;
Lowering\LocalRewriter\LocalRewriter_ConditionalOperator.cs (1)
43SyntaxNode syntax,
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (22)
99var save_Syntax = _factory.Syntax; 142private BoundArrayCreation MakeUnderlyingArrayForUtf8Span(SyntaxNode syntax, ArrayTypeSymbol byteArray, IReadOnlyList<byte> bytes, out int length) 264SyntaxNode syntax, 299SyntaxNode syntax, 568var oldSyntax = _factory.Syntax; 740private void EnsureParamCollectionAttributeExists(SyntaxNode node, TypeSymbol delegateType) 837SyntaxNode syntax, 947SyntaxNode syntax, 1034SyntaxNode syntax, 1090SyntaxNode syntax, 1142SyntaxNode syntax, 1204SyntaxNode syntax, 1236SyntaxNode syntax, 1276SyntaxNode syntax, 1338SyntaxNode syntax, 1392SyntaxNode syntax, 1480SyntaxNode syntax, 1695private BoundExpression RewriteDecimalConversion(SyntaxNode syntax, BoundExpression operand, TypeSymbol fromType, TypeSymbol toType, bool @checked, bool isImplicit, ConstantValue? constantValueOpt) 1726private BoundExpression RewriteDecimalConversionCore(SyntaxNode syntax, BoundExpression operand, TypeSymbol fromType, TypeSymbol toType, bool isImplicit, ConstantValue? constantValueOpt) 1752private Conversion TryMakeConversion(SyntaxNode syntax, Conversion conversion, TypeSymbol fromType, TypeSymbol toType, bool @checked) 1853private Conversion TryMakeConversion(SyntaxNode syntax, TypeSymbol fromType, TypeSymbol toType, bool @checked) 1864private Conversion TryMakeUserDefinedConversion(SyntaxNode syntax, MethodSymbol meth, TypeSymbol fromType, TypeSymbol toType, bool @checked, bool isImplicit)
Lowering\LocalRewriter\LocalRewriter_DelegateCreationExpression.cs (1)
33var oldSyntax = _factory.Syntax;
Lowering\LocalRewriter\LocalRewriter_DoStatement.cs (1)
24var syntax = node.Syntax;
Lowering\LocalRewriter\LocalRewriter_Event.cs (4)
87private BoundExpression RewriteWindowsRuntimeEventAssignmentOperator(SyntaxNode syntax, EventSymbol eventSymbol, EventAssignmentKind kind, BoundExpression? rewrittenReceiverOpt, BoundExpression rewrittenArgument) 191private BoundExpression VisitWindowsRuntimeEventFieldAssignmentOperator(SyntaxNode syntax, BoundEventAccess left, BoundExpression rewrittenRight) 220SyntaxNode syntax, 298SyntaxNode oldSyntax = _factory.Syntax;
Lowering\LocalRewriter\LocalRewriter_Field.cs (3)
18SyntaxNode syntax, 51SyntaxNode syntax, 98private BoundExpression MakeTupleFieldAccessAndReportUseSiteDiagnostics(BoundExpression tuple, SyntaxNode syntax, FieldSymbol field)
Lowering\LocalRewriter\LocalRewriter_FixedStatement.cs (2)
83SyntaxNode? node = boundFixed.Syntax.Parent; 311var initializerSyntax = initializerExpr.Syntax;
Lowering\LocalRewriter\LocalRewriter_ForEachStatement.cs (12)
70private bool CanRewriteForEachAsFor(SyntaxNode forEachSyntax, TypeSymbol nodeExpressionType, [NotNullWhen(true)] out MethodSymbol? indexerGet, [NotNullWhen(true)] out MethodSymbol? lengthGet) 290private bool TryGetDisposeMethod(SyntaxNode forEachSyntax, ForEachEnumeratorInfo enumeratorInfo, out MethodSymbol disposeMethod) 475private BoundStatement WrapWithAwait(SyntaxNode forEachSyntax, BoundExpression disposeCall, BoundAwaitableInfo disposeAwaitableInfoOpt) 707private delegate BoundStatement? GetForEachStatementAsForPreamble(LocalRewriter rewriter, SyntaxNode syntax, ForEachEnumeratorInfo enumeratorInfo, ref BoundExpression rewrittenExpression, out LocalSymbol? preambleLocal, out RefKind collectionTempRefKind); 708private delegate BoundExpression GetForEachStatementAsForItem<TArg>(LocalRewriter rewriter, SyntaxNode syntax, ForEachEnumeratorInfo enumeratorInfo, BoundLocal boundArrayVar, BoundLocal boundPositionVar, TArg arg); 709private delegate BoundExpression GetForEachStatementAsForLength<TArg>(LocalRewriter rewriter, SyntaxNode syntax, BoundLocal boundArrayVar, TArg arg); 715getItem: static (LocalRewriter rewriter, SyntaxNode syntax, ForEachEnumeratorInfo enumeratorInfo, BoundLocal boundArrayVar, BoundLocal boundPositionVar, (MethodSymbol indexerGet, MethodSymbol lengthGet) arg) => 724getLength: static (LocalRewriter rewriter, SyntaxNode syntax, BoundLocal boundArrayVar, (MethodSymbol indexerGet, MethodSymbol lengthGet) arg) => 746return static (LocalRewriter rewriter, SyntaxNode syntax, ForEachEnumeratorInfo enumeratorInfo, ref BoundExpression rewrittenExpression, out LocalSymbol? preambleLocal, out RefKind collectionTempRefKind) => 767return static (LocalRewriter rewriter, SyntaxNode syntax, ForEachEnumeratorInfo enumeratorInfo, BoundLocal boundArrayVar, BoundLocal boundPositionVar, object? _) => 793return static (LocalRewriter rewriter, SyntaxNode syntax, BoundLocal boundArrayVar, object? _) => 841SyntaxNode forEachSyntax)
Lowering\LocalRewriter\LocalRewriter_ForStatement.cs (2)
73SyntaxNode syntax = original.Syntax; 215SyntaxNode syntax = node.Syntax;
Lowering\LocalRewriter\LocalRewriter_HostObjectMemberReference.cs (1)
17var syntax = node.Syntax;
Lowering\LocalRewriter\LocalRewriter_IfStatement.cs (1)
120SyntaxNode syntax,
Lowering\LocalRewriter\LocalRewriter_Index.cs (1)
69private BoundExpression ConvertToNullable(SyntaxNode syntax, TypeSymbol targetNullableType, BoundExpression underlyingValue)
Lowering\LocalRewriter\LocalRewriter_IndexerAccess.cs (1)
102SyntaxNode syntax,
Lowering\LocalRewriter\LocalRewriter_IsOperator.cs (2)
27SyntaxNode syntax, 81SyntaxNode syntax,
Lowering\LocalRewriter\LocalRewriter_IsPatternOperator.cs (2)
96SyntaxNode node, 101protected override ArrayBuilder<BoundStatement> BuilderForSection(SyntaxNode section) => _statements;
Lowering\LocalRewriter\LocalRewriter_Literal.cs (3)
23private BoundExpression MakeLiteral(SyntaxNode syntax, ConstantValue constantValue, TypeSymbol? type, BoundLiteral? oldNodeOpt = null) 51private BoundExpression MakeDecimalLiteral(SyntaxNode syntax, ConstantValue constantValue) 142private BoundExpression MakeDateTimeLiteral(SyntaxNode syntax, ConstantValue constantValue)
Lowering\LocalRewriter\LocalRewriter_LocalDeclaration.cs (1)
19private BoundStatement? RewriteLocalDeclaration(BoundLocalDeclaration? originalOpt, SyntaxNode syntax, LocalSymbol localSymbol, BoundExpression? rewrittenInitializer, bool hasErrors = false)
Lowering\LocalRewriter\LocalRewriter_NullCoalescingAssignmentOperator.cs (1)
17SyntaxNode syntax = node.Syntax;
Lowering\LocalRewriter\LocalRewriter_NullCoalescingOperator.cs (1)
23SyntaxNode syntax,
Lowering\LocalRewriter\LocalRewriter_ObjectCreationExpression.cs (3)
256SyntaxNode syntax, 323private BoundExpression MakeNewT(SyntaxNode syntax, TypeParameterSymbol typeParameter) 376SyntaxNode oldSyntax = _factory.Syntax;
Lowering\LocalRewriter\LocalRewriter_ObjectOrCollectionInitializerExpression.cs (1)
151var syntax = initializer.Syntax;
Lowering\LocalRewriter\LocalRewriter_PatternSwitchStatement.cs (4)
26private readonly Dictionary<SyntaxNode, LabelSymbol> _sectionLabels = PooledDictionary<SyntaxNode, LabelSymbol>.GetInstance(); 45SyntaxNode? section = d.Syntax.Parent; 115(ImmutableArray<BoundStatement> loweredDag, ImmutableDictionary<SyntaxNode, ImmutableArray<BoundStatement>> switchSections) =
Lowering\LocalRewriter\LocalRewriter_PreviousSubmissionReference.cs (1)
21var syntax = node.Syntax;
Lowering\LocalRewriter\LocalRewriter_PropertyAccess.cs (3)
27SyntaxNode syntax, 68private BoundExpression MakePropertyGetAccess(SyntaxNode syntax, BoundExpression? rewrittenReceiver, PropertySymbol property, BoundPropertyAccess? oldNodeOpt) 74SyntaxNode syntax,
Lowering\LocalRewriter\LocalRewriter_StringConcat.cs (11)
37private BoundExpression RewriteStringConcatenation(SyntaxNode syntax, BinaryOperatorKind operatorKind, BoundExpression loweredLeft, BoundExpression loweredRight, TypeSymbol type) 369private BoundExpression RewriteStringConcatenationTwoExprs(SyntaxNode syntax, BoundExpression loweredLeft, BoundExpression loweredRight) 380private BoundExpression RewriteStringConcatenationThreeExprs(SyntaxNode syntax, BoundExpression loweredFirst, BoundExpression loweredSecond, BoundExpression loweredThird) 392private BoundExpression RewriteStringConcatenationFourExprs(SyntaxNode syntax, BoundExpression loweredFirst, BoundExpression loweredSecond, BoundExpression loweredThird, BoundExpression loweredFourth) 405private BoundExpression RewriteStringConcatenationManyExprs(SyntaxNode syntax, ImmutableArray<BoundExpression> loweredArgs) 418private bool TryRewriteStringConcatenationWithSpanBasedConcat(SyntaxNode syntax, ArrayBuilder<BoundExpression> args, [NotNullWhen(true)] out BoundExpression? result) 496SyntaxNode syntax, 525SyntaxNode syntax, 576var oldSyntax = factory.Syntax; 593private BoundExpression RewriteStringConcatInExpressionLambda(SyntaxNode syntax, BinaryOperatorKind operatorKind, BoundExpression loweredLeft, BoundExpression loweredRight, TypeSymbol type) 611var syntax = expr.Syntax;
Lowering\LocalRewriter\LocalRewriter_StringInterpolation.cs (2)
29private InterpolationHandlerResult RewriteToInterpolatedStringHandlerPattern(InterpolatedStringHandlerData data, ImmutableArray<BoundExpression> parts, SyntaxNode syntax) 219private BoundExpression LowerPartsToString(InterpolatedStringHandlerData data, ImmutableArray<BoundExpression> parts, SyntaxNode syntax, TypeSymbol type)
Lowering\LocalRewriter\LocalRewriter_SwitchExpression.cs (1)
63(ImmutableArray<BoundStatement> loweredDag, ImmutableDictionary<SyntaxNode, ImmutableArray<BoundStatement>> switchSections) =
Lowering\LocalRewriter\LocalRewriter_TupleBinaryOperator.cs (1)
106var syntax = boundConversion.Syntax;
Lowering\LocalRewriter\LocalRewriter_TupleCreationExpression.cs (1)
43private BoundExpression MakeTupleCreationExpression(SyntaxNode syntax, NamedTypeSymbol type, ImmutableArray<BoundExpression> rewrittenArguments)
Lowering\LocalRewriter\LocalRewriter_UnaryOperator.cs (11)
64SyntaxNode syntax, 76SyntaxNode syntax, 180SyntaxNode syntax, 244SyntaxNode syntax, 353private BoundExpression GetLiftedUnaryOperatorConsequence(UnaryOperatorKind kind, SyntaxNode syntax, MethodSymbol? method, TypeSymbol? constrainedToTypeOpt, TypeSymbol type, BoundExpression nonNullOperand) 434SyntaxNode syntax = node.Syntax; 507SyntaxNode syntax, 535SyntaxNode syntax, 638SyntaxNode syntax = node.Syntax; 824private BoundExpression MakeDecimalIncDecOperator(SyntaxNode syntax, BinaryOperatorKind oper, BoundExpression operand) 831private BoundExpression MakeLiftedDecimalIncDecOperator(SyntaxNode syntax, BinaryOperatorKind oper, BoundExpression operand)
Lowering\LocalRewriter\LocalRewriter_UsingStatement.cs (9)
62private BoundStatement MakeDeclarationUsingStatement(SyntaxNode syntax, 151SyntaxNode expressionSyntax = rewrittenExpression.Syntax; 207SyntaxNode usingSyntax, 215SyntaxNode declarationSyntax = localDeclaration.Syntax; 280SyntaxNode resourceTypeSyntax, 281SyntaxNode resourceSyntax, 435SyntaxNode resourceTypeSyntax, 436SyntaxNode resourceSyntax, 492private BoundExpression MakeCallWithNoExplicitArgument(MethodArgumentInfo methodArgumentInfo, SyntaxNode syntax, BoundExpression? expression, BoundExpression? firstRewrittenArgument)
Lowering\LocalRewriter\LocalRewriter_WhileStatement.cs (2)
65SyntaxNode syntax = loop.Syntax; 136SyntaxNode syntax = loop.Syntax;
Lowering\LocalRewriter\LoweredDynamicOperationFactory.cs (1)
333SyntaxNode syntax,
Lowering\MethodToClassRewriter.cs (5)
41protected abstract BoundExpression FramePointer(SyntaxNode syntax, NamedTypeSymbol frameClass); 323private MethodSymbol GetMethodWrapperForBaseNonVirtualCall(MethodSymbol methodBeingCalled, SyntaxNode syntax) 345private MethodSymbol GetOrCreateBaseFunctionWrapper(MethodSymbol methodBeingWrapped, SyntaxNode syntax) 372private bool TryReplaceWithProxy(Symbol parameterOrLocal, SyntaxNode syntax, [NotNullWhen(true)] out BoundNode? replacement) 737internal BaseMethodWrapperSymbol(NamedTypeSymbol containingType, MethodSymbol methodBeingWrapped, SyntaxNode syntax, string name)
Lowering\SpillSequenceSpiller.cs (3)
26MethodSymbol method, SyntaxNode syntaxNode, TypeCompilationState compilationState, 44public BoundSpillSequenceBuilder(SyntaxNode syntax, BoundExpression value = null) 1053var save_Syntax = _F.Syntax;
Lowering\StateMachineRewriter\CapturedSymbol.cs (4)
26public abstract BoundExpression Replacement<TArg>(SyntaxNode node, Func<NamedTypeSymbol, TArg, BoundExpression> makeFrame, TArg arg); 39public override BoundExpression Replacement<TArg>(SyntaxNode node, Func<NamedTypeSymbol, TArg, BoundExpression> makeFrame, TArg arg) 57public override BoundExpression Replacement<TArg>(SyntaxNode node, Func<NamedTypeSymbol, TArg, BoundExpression> makeFrame, TArg arg) 77public override BoundExpression Replacement<TArg>(SyntaxNode node, Func<NamedTypeSymbol, TArg, BoundExpression> makeFrame, TArg arg)
Lowering\StateMachineRewriter\IteratorAndAsyncCaptureWalker.cs (6)
34private MultiDictionary<Symbol, SyntaxNode> _lazyDisallowedCaptures; 209private void CaptureVariable(Symbol variable, SyntaxNode syntax) 215(_lazyDisallowedCaptures ??= new MultiDictionary<Symbol, SyntaxNode>()).Add(variable, syntax); 232private void CaptureRefInitializer(BoundExpression variableInitializer, SyntaxNode syntax) 258protected override void ReportUnassigned(Symbol symbol, SyntaxNode node, int slot, bool skipIfUseBeforeDeclaration) 422private void Capture(Symbol s, SyntaxNode syntax)
Lowering\StateMachineRewriter\MethodToStateMachineRewriter.cs (8)
204protected override BoundExpression FramePointer(SyntaxNode syntax, NamedTypeSymbol frameClass) 206var oldSyntax = F.Syntax; 214protected void AddResumableState(SyntaxNode awaitOrYieldReturnSyntax, AwaitDebugId awaitId, out StateMachineState state, out GeneratedLabelSymbol resumeLabel) 217protected void AddResumableState(ResumableStateMachineStateAllocator allocator, SyntaxNode awaitOrYieldReturnSyntax, AwaitDebugId awaitId, out StateMachineState stateNumber, out GeneratedLabelSymbol resumeLabel) 224protected void AddStateDebugInfo(SyntaxNode node, AwaitDebugId awaitId, StateMachineState state) 528SyntaxNode awaitSyntaxOpt; 576SyntaxNode awaitSyntaxOpt, 726var oldSyntax = F.Syntax;
Lowering\StateMachineRewriter\ResumableStateMachineStateAllocator.cs (1)
50public StateMachineState AllocateState(SyntaxNode awaitOrYieldReturnSyntax, AwaitDebugId awaitId)
Lowering\StateMachineRewriter\StateMachineRewriter.cs (1)
196SyntaxNode declaratorSyntax = local.GetDeclaratorSyntax();
Lowering\SyntheticBoundNodeFactory.cs (15)
45public SyntaxNode Syntax { get; set; } 103public SyntheticBoundNodeFactory(MethodSymbol topLevelMethod, SyntaxNode node, TypeCompilationState compilationState, BindingDiagnosticBag diagnostics, InstrumentationState? instrumentationState = null) 114public SyntheticBoundNodeFactory(MethodSymbol? topLevelMethodOpt, NamedTypeSymbol? currentClassOpt, SyntaxNode node, TypeCompilationState compilationState, BindingDiagnosticBag diagnostics, InstrumentationState? instrumentationState = null) 429public BoundExpression AssignmentExpression(SyntaxNode syntax, BoundExpression left, BoundExpression right, bool isRef = false, bool hasErrors = false, bool wasCompilerGenerated = false) 583SyntaxNode? syntax = null, 605SyntaxNode syntax 1192public BoundStatement SequencePoint(SyntaxNode syntax, BoundStatement statement) 1229public static BoundExpression Null(TypeSymbol type, SyntaxNode syntax) 1570internal static BoundExpression Default(TypeSymbol type, SyntaxNode syntax) 1615internal static BoundExpression NullOrDefault(TypeSymbol typeSymbol, SyntaxNode syntax) 1636SyntaxNode? syntaxOpt = null 1675var syntax = argument.Syntax; 1741internal BoundExpression MakeNullCheck(SyntaxNode syntax, BoundExpression rewrittenExpr, BinaryOperatorKind operatorKind) 1793internal BoundExpression MakeNullableHasValue(SyntaxNode syntax, BoundExpression expression) 1804SyntaxNode syntax,
Operations\CSharpOperationFactory.cs (118)
396internal ImmutableArray<IVariableDeclaratorOperation> CreateVariableDeclarator(BoundNode declaration, SyntaxNode declarationSyntax) 422SyntaxNode syntax = boundDeconstructValuePlaceholder.Syntax; 434SyntaxNode syntax = boundDeconstructionAssignmentOperator.Syntax; 443SyntaxNode syntax = boundCall.Syntax; 475SyntaxNode syntax = boundFunctionPointerInvocation.Syntax; 556SyntaxNode syntax = boundLocal.Syntax; 576SyntaxNode syntax = boundFieldAccess.Syntax; 617SyntaxNode syntax = boundPropertyAccess.Syntax; 627SyntaxNode syntax = boundIndexerAccess.Syntax; 647SyntaxNode syntax = boundEventAccess.Syntax; 658SyntaxNode syntax = boundEventAssignmentOperator.Syntax; 668SyntaxNode syntax = boundParameter.Syntax; 676SyntaxNode syntax = boundLiteral.Syntax; 685SyntaxNode syntax = boundNode.Syntax; 693SyntaxNode syntax = boundAnonymousObjectCreationExpression.Syntax; 704SyntaxNode syntax = boundObjectCreationExpression.Syntax; 741SyntaxNode syntax = boundWithExpression.Syntax; 753SyntaxNode syntax = boundDynamicObjectCreationExpression.Syntax; 782SyntaxNode syntax = boundDynamicInvocation.Syntax; 825SyntaxNode syntax = boundDynamicIndexerAccess.Syntax; 834SyntaxNode syntax = boundObjectInitializerExpression.Syntax; 843SyntaxNode syntax = boundCollectionInitializerExpression.Syntax; 852SyntaxNode syntax = boundObjectInitializerMember.Syntax; 916SyntaxNode syntax = boundDynamicObjectInitializerMember.Syntax; 928SyntaxNode syntax = boundCollectionElementInitializer.Syntax; 953SyntaxNode syntaxNode, 978SyntaxNode syntax = boundCollectionElementInitializer.Syntax; 998SyntaxNode syntax = boundLambda.Syntax; 1010SyntaxNode syntax = boundLocalFunctionStatement.Syntax; 1030SyntaxNode syntax = boundConversion.Syntax; 1058SyntaxNode syntax = boundConversion.Syntax; 1142SyntaxNode syntax = boundAsOperator.Syntax; 1154SyntaxNode syntax = boundDelegateCreationExpression.Syntax; 1165SyntaxNode bindingSyntax = boundMethodGroup.Syntax; 1176SyntaxNode syntax = boundIsOperator.Syntax; 1187SyntaxNode syntax = boundSizeOfOperator.Syntax; 1198SyntaxNode syntax = boundTypeOfOperator.Syntax; 1208SyntaxNode syntax = boundArrayCreation.Syntax; 1218SyntaxNode syntax = boundArrayInitialization.Syntax; 1225SyntaxNode syntax = expr.Syntax; 1271SyntaxNode syntax = element.Syntax; 1286SyntaxNode syntax = boundDefaultLiteral.Syntax; 1294SyntaxNode syntax = boundDefaultExpression.Syntax; 1304SyntaxNode syntax = boundBaseReference.Syntax; 1313SyntaxNode syntax = boundThisReference.Syntax; 1337SyntaxNode syntax = boundAssignmentOperator.Syntax; 1349SyntaxNode syntax = boundAssignmentOperator.Syntax; 1366SyntaxNode syntax = boundCompoundAssignmentOperator.Syntax; 1393SyntaxNode syntax = boundIncrementOperator.Syntax; 1403SyntaxNode syntax = boundBadExpression.Syntax; 1416SyntaxNode syntax = boundNewT.Syntax; 1425SyntaxNode syntax = creation.Syntax; 1436SyntaxNode syntax = boundUnaryOperator.Syntax; 1490SyntaxNode syntax = boundBinaryOperator.Syntax; 1522SyntaxNode syntax = boundBinaryOperator.Syntax; 1566SyntaxNode syntax = boundTupleBinaryOperator.Syntax; 1578SyntaxNode syntax = boundConditionalOperator.Syntax; 1589SyntaxNode syntax = boundNullCoalescingOperator.Syntax; 1608SyntaxNode syntax = boundNode.Syntax; 1618SyntaxNode syntax = boundAwaitExpression.Syntax; 1628SyntaxNode syntax = boundArrayAccess.Syntax; 1639SyntaxNode syntax = boundIndexerAccess.Syntax; 1661SyntaxNode syntax = boundInlineArrayAccess.Syntax; 1671SyntaxNode syntax = boundNameOfOperator.Syntax; 1681SyntaxNode syntax = boundThrowExpression.Syntax; 1690SyntaxNode syntax = boundAddressOfOperator.Syntax; 1699SyntaxNode syntax = boundImplicitReceiver.Syntax; 1709SyntaxNode syntax = boundConditionalAccess.Syntax; 1718SyntaxNode syntax = boundConditionalReceiver.Syntax; 1728SyntaxNode syntax = boundFieldEqualsValue.Syntax; 1737SyntaxNode syntax = boundPropertyEqualsValue.Syntax; 1746SyntaxNode syntax = boundParameterEqualsValue.Syntax; 1755SyntaxNode syntax = boundBlock.Syntax; 1764SyntaxNode syntax = boundContinueStatement.Syntax; 1773SyntaxNode syntax = boundBreakStatement.Syntax; 1781SyntaxNode syntax = boundYieldBreakStatement.Syntax; 1790SyntaxNode syntax = boundGotoStatement.Syntax; 1797SyntaxNode syntax = boundNoOpStatement.Syntax; 1831SyntaxNode syntax = boundIfStatement.Syntax; 1853SyntaxNode syntax = boundWhileStatement.Syntax; 1867SyntaxNode syntax = boundDoStatement.Syntax; 1882SyntaxNode syntax = boundForStatement.Syntax; 1968var declaratorSyntax = boundForEachStatement.IterationVariableType.Syntax; 1989SyntaxNode syntax = boundForEachStatement.Syntax; 2000SyntaxNode syntax = boundTryStatement.Syntax; 2014SyntaxNode syntax = boundCatchBlock.Syntax; 2024SyntaxNode syntax = boundFixedStatement.Syntax; 2042SyntaxNode syntax = boundUsingStatement.Syntax; 2050SyntaxNode syntax = boundThrowStatement.Syntax; 2059SyntaxNode syntax = boundReturnStatement.Syntax; 2067SyntaxNode syntax = boundYieldReturnStatement.Syntax; 2083SyntaxNode syntax = boundLockStatement.Syntax; 2091SyntaxNode syntax = boundBadStatement.Syntax; 2101var node = boundLocalDeclaration.Syntax; 2104SyntaxNode varStatement; 2105SyntaxNode varDeclaration; 2155SyntaxNode declarationGroupSyntax = boundMultipleLocalDeclarations.Syntax; 2156SyntaxNode declarationSyntax = declarationGroupSyntax.IsKind(SyntaxKind.LocalDeclarationStatement) ? 2192SyntaxNode syntax = boundLabelStatement.Syntax; 2201SyntaxNode syntax = boundLabeledStatement.Syntax; 2212SyntaxNode syntax = boundExpressionStatement.Syntax; 2228SyntaxNode syntax = boundTupleExpression.Syntax; 2264SyntaxNode syntax = boundInterpolatedString.Syntax; 2404SyntaxNode syntax = boundStringInsert.Syntax; 2412SyntaxNode syntax = boundNode.Syntax; 2483SyntaxNode syntax = placeholder.Syntax; 2518SyntaxNode syntax = boundConstantPattern.Syntax; 2529SyntaxNode syntax = boundRelationalPattern.Syntax; 2548SyntaxNode syntax = boundDeclarationPattern.Syntax; 2690SyntaxNode syntax = boundSwitchStatement.Syntax; 2747SyntaxNode syntax = boundSwitchLabel.Syntax; 2775SyntaxNode syntax = boundIsPatternExpression.Syntax; 2790SyntaxNode syntax = boundQueryClause.Syntax; 2856SyntaxNode subpatternSyntax = subpattern.Syntax; 2869var nameSyntax = member.Syntax; 2892IPropertySubpatternOperation createPropertySubpattern(Symbol? symbol, IPatternOperation pattern, ITypeSymbol receiverType, SyntaxNode nameSyntax, bool isSingle) 2920var syntaxForPropertySubpattern = isSingle ? subpatternSyntax : nameSyntax; 2934SyntaxNode syntax = placeholder.Syntax;
Operations\CSharpOperationFactory_Methods.cs (9)
33private IInstanceReferenceOperation CreateImplicitReceiver(SyntaxNode syntax, TypeSymbol type) => 40(SyntaxNode syntax, bool isImplicit) = expression.Syntax is { Parent: ArgumentSyntax or AttributeArgumentSyntax } ? (expression.Syntax.Parent, expression.WasCompilerGenerated) : (value.Syntax, true); 52internal IVariableInitializerOperation? CreateVariableDeclaratorInitializer(BoundLocalDeclaration boundLocalDeclaration, SyntaxNode syntax) 56SyntaxNode? initializerSyntax = null; 81private IVariableDeclaratorOperation CreateVariableDeclaratorInternal(BoundLocalDeclaration boundLocalDeclaration, SyntaxNode syntax) 126SyntaxNode syntax = boundEventAssignmentOperator.Syntax; 134SyntaxNode eventAccessSyntax = ((AssignmentExpressionSyntax)syntax).Left; 410SyntaxNode syntax, 464var assignmentSyntax = value.Syntax?.Parent ?? syntax;
Parser\Blender.cs (1)
163for (var parent = token.Parent; // for each parent
Parser\Blender.Cursor.cs (3)
84var parent = this.CurrentNodeOrToken.Parent; 109private static int IndexOfNodeInParent(SyntaxNode node) 139var node = CurrentNodeOrToken.AsNode();
SourceGeneration\CSharpSyntaxHelper.cs (12)
25public override bool IsAnyNamespaceBlock(SyntaxNode node) 28public override bool IsAttribute(SyntaxNode node) 31public override SyntaxNode GetNameOfAttribute(SyntaxNode node) 34public override bool IsAttributeList(SyntaxNode node) 37public override void AddAttributeTargets(SyntaxNode node, ArrayBuilder<SyntaxNode> targets) 52public override SeparatedSyntaxList<SyntaxNode> GetAttributesOfAttributeList(SyntaxNode node) 55public override bool IsLambdaExpression(SyntaxNode node) 58public override string GetUnqualifiedIdentifierOfName(SyntaxNode node) 116public override bool ContainsGlobalAliases(SyntaxNode root)
src\Compilers\CSharp\CSharpAnalyzerDriver\CSharpDeclarationComputer.cs (12)
37SyntaxNode node, 59SyntaxNode node, 60Func<SyntaxNode, int?, bool> shouldSkip, 95builder.Add(new DeclarationInfo(name, ImmutableArray<SyntaxNode>.Empty, declaredSymbol)); 262var blocks = ArrayBuilder<SyntaxNode>.GetInstance(); 334private static IEnumerable<SyntaxNode> GetAttributes(SyntaxList<AttributeListSyntax> attributeLists) 345private static IEnumerable<SyntaxNode> GetParameterListInitializersAndAttributes(BaseParameterListSyntax parameterList) => 348SpecializedCollections.EmptyEnumerable<SyntaxNode>(); 350private static IEnumerable<SyntaxNode> GetParameterInitializersAndAttributes(ParameterSyntax parameter) => 353private static IEnumerable<SyntaxNode> GetTypeParameterListAttributes(TypeParameterListSyntax typeParameterList) => 356SpecializedCollections.EmptyEnumerable<SyntaxNode>(); 370executableCodeBlocks: ImmutableArray.Create<SyntaxNode>(expressionBody),
SymbolDisplay\SymbolDisplayVisitor_Minimal.cs (1)
194var startNode = token.Parent!;
Symbols\ConstantValueUtils.cs (1)
82SyntaxNode initValueNode,
Symbols\ConstraintsHelper.cs (2)
601SyntaxNode typeSyntax, 672SyntaxNode typeSyntax,
Symbols\FieldOrPropertyInitializer.cs (1)
29public FieldOrPropertyInitializer(FieldSymbol fieldOpt, SyntaxNode syntax)
Symbols\FunctionTypeSymbol.cs (1)
45internal static FunctionTypeSymbol? CreateIfFeatureEnabled(SyntaxNode syntax, Binder binder, Func<Binder, BoundExpression, NamedTypeSymbol?> calculateDelegate)
Symbols\LocalSymbol.cs (6)
39internal abstract SyntaxNode ScopeDesignatorOpt { get; } 42SynthesizedLocalKind kind, SyntaxNode syntax 286internal abstract SyntaxNode GetDeclaratorSyntax(); 361internal abstract ConstantValue GetConstantValue(SyntaxNode node, LocalSymbol inProgress, BindingDiagnosticBag diagnostics = null); 377internal virtual SyntaxNode ForbiddenZone => null; 408SyntaxNode ILocalSymbolInternal.GetDeclaratorSyntax()
Symbols\MethodSymbol.cs (1)
1036internal bool CheckAndReportValidUnmanagedCallersOnlyTarget(SyntaxNode? node, BindingDiagnosticBag? diagnostics)
Symbols\MethodSymbolExtensions.cs (1)
202SyntaxNode node = reference.GetSyntax();
Symbols\RangeVariableSymbol.cs (1)
64var node = token.Parent;
Symbols\Source\GlobalExpressionVariable.cs (4)
46SyntaxNode syntax, 49SyntaxNode nodeToBind) 175SyntaxNode nodeToBind) 186var nodeToBind = _nodeToBind.GetSyntax();
Symbols\Source\LambdaSymbol.cs (1)
20private readonly SyntaxNode _syntax;
Symbols\Source\ParameterHelpers.cs (5)
986internal static ImmutableArray<CustomModifier> ConditionallyCreateInModifiers(RefKind refKind, bool addRefReadOnlyModifier, Binder binder, BindingDiagnosticBag diagnostics, SyntaxNode syntax) 998internal static ImmutableArray<CustomModifier> CreateInModifiers(Binder binder, BindingDiagnosticBag diagnostics, SyntaxNode syntax) 1004private static ImmutableArray<CustomModifier> CreateRefReadonlyParameterModifiers(Binder binder, BindingDiagnosticBag diagnostics, SyntaxNode syntax) 1010internal static ImmutableArray<CustomModifier> CreateOutModifiers(Binder binder, BindingDiagnosticBag diagnostics, SyntaxNode syntax) 1015private static ImmutableArray<CustomModifier> CreateModifiers(WellKnownType modifier, Binder binder, BindingDiagnosticBag diagnostics, SyntaxNode syntax)
Symbols\Source\SourceComplexParameterSymbol.cs (3)
223internal static SyntaxNode? GetDefaultValueSyntaxForIsNullableAnalysisEnabled(ParameterSyntax? parameterSyntax) => 293private Binder GetDefaultParameterValueBinder(SyntaxNode syntax) 919private void VerifyParamDefaultValueMatchesAttributeIfAny(ConstantValue value, SyntaxNode syntax, BindingDiagnosticBag diagnostics)
Symbols\Source\SourceLabelSymbol.cs (1)
48var node = _identifierNodeOrToken.AsNode();
Symbols\Source\SourceLocalSymbol.cs (19)
84internal override SyntaxNode ScopeDesignatorOpt 142SyntaxNode deconstruction) 162SyntaxNode nodeToBind, 163SyntaxNode forbiddenZone) 233SynthesizedLocalKind kind, SyntaxNode syntax 417internal sealed override SyntaxNode GetDeclaratorSyntax() 428SyntaxNode node = _identifierToken.Parent; 470internal override ConstantValue GetConstantValue(SyntaxNode node, LocalSymbol inProgress, BindingDiagnosticBag diagnostics) 567internal override SyntaxNode ForbiddenZone => _initializer; 593internal override ConstantValue GetConstantValue(SyntaxNode node, LocalSymbol inProgress, BindingDiagnosticBag diagnostics = null) 653internal override SyntaxNode ForbiddenZone => null; 662private readonly SyntaxNode _deconstruction; 672SyntaxNode deconstruction) 704internal override SyntaxNode ForbiddenZone 725private readonly SyntaxNode _forbiddenZone; 727private readonly SyntaxNode _nodeToBind; 736SyntaxNode nodeToBind, 737SyntaxNode forbiddenZone) 756internal override SyntaxNode ForbiddenZone => _forbiddenZone;
Symbols\Source\SourceMemberContainerSymbol.cs (1)
3517var syntax = decl.SyntaxReference.GetSyntax();
Symbols\Source\SourceMemberMethodSymbol.cs (1)
1094protected void CheckFeatureAvailabilityAndRuntimeSupport(SyntaxNode declarationSyntax, Location location, bool hasBody, BindingDiagnosticBag diagnostics)
Symbols\Source\SourceMethodSymbolWithAttributes.cs (3)
1070var root = matchingTree.GetRoot(); 1291var root = matchingTree.GetRoot(); 1399static void checkAndReportManagedTypes(TypeSymbol type, RefKind refKind, SyntaxNode syntax, bool isParam, BindingDiagnosticBag diagnostics)
Symbols\Source\SourceNamespaceSymbol.cs (1)
479var syntax = NamespaceDeclarationSyntaxReference.GetSyntax(declarationSyntaxRef, cancellationToken);
Symbols\Source\SourcePropertySymbol.cs (6)
172private TypeSyntax GetTypeSyntax(SyntaxNode syntax) => ((BasePropertyDeclarationSyntax)syntax).Type; 177private static SyntaxTokenList GetModifierTokensSyntax(SyntaxNode syntax) 180private static ArrowExpressionClauseSyntax? GetArrowExpression(SyntaxNode syntax) 188private static bool HasInitializer(SyntaxNode syntax) 291var body = (SyntaxNode?)accessor.Body ?? accessor.ExpressionBody; 561private TypeWithAnnotations ComputeType(Binder binder, SyntaxNode syntax, BindingDiagnosticBag diagnostics)
Symbols\Source\SourcePropertySymbolBase.cs (1)
1863protected static ExplicitInterfaceSpecifierSyntax? GetExplicitInterfaceSpecifier(SyntaxNode syntax)
Symbols\Symbol.cs (3)
529SyntaxNode parent = location.SourceTree.GetRoot(); 530SyntaxNode found = null; 531foreach (var descendant in parent.DescendantNodesAndSelf(c => c.Location.SourceSpan.Contains(location.SourceSpan)))
Symbols\Synthesized\SynthesizedLocal.cs (7)
24private readonly SyntaxNode _syntaxOpt; 38SyntaxNode syntaxOpt = null, 68public SyntaxNode SyntaxOpt 74SynthesizedLocalKind kind, SyntaxNode syntax 118internal sealed override SyntaxNode ScopeDesignatorOpt 153internal sealed override SyntaxNode GetDeclaratorSyntax() 190internal sealed override ConstantValue GetConstantValue(SyntaxNode node, LocalSymbol inProgress, BindingDiagnosticBag diagnostics)
Symbols\Synthesized\SynthesizedSimpleProgramEntryPointSymbol.cs (1)
281public SyntaxNode ReturnTypeSyntax => CompilationUnit.Members.First(m => m.Kind() == SyntaxKind.GlobalStatement);
Symbols\Synthesized\TypeSubstitutedLocalSymbol.cs (4)
47internal override SyntaxNode ScopeDesignatorOpt 67internal override SyntaxNode GetDeclaratorSyntax() 116internal override ConstantValue GetConstantValue(SyntaxNode node, LocalSymbol inProgress, BindingDiagnosticBag diagnostics) 127SynthesizedLocalKind kind, SyntaxNode syntax
Symbols\Tuples\TupleTypeSymbol.cs (1)
487internal static Symbol? GetWellKnownMemberInType(NamedTypeSymbol type, WellKnownMember relativeMember, BindingDiagnosticBag diagnostics, SyntaxNode? syntax)
Symbols\TypeWithAnnotations.cs (6)
539public void ReportDiagnosticsIfObsolete(Binder binder, SyntaxNode syntax, BindingDiagnosticBag diagnostics) => 547private void ReportDiagnosticsIfObsoleteCore(Binder binder, SyntaxNode syntax, BindingDiagnosticBag diagnostics) 877internal abstract void ReportDiagnosticsIfObsolete(TypeWithAnnotations type, Binder binder, SyntaxNode syntax, BindingDiagnosticBag diagnostics); 940internal override void ReportDiagnosticsIfObsolete(TypeWithAnnotations type, Binder binder, SyntaxNode syntax, BindingDiagnosticBag diagnostics) 1033internal override void ReportDiagnosticsIfObsolete(TypeWithAnnotations type, Binder binder, SyntaxNode syntax, BindingDiagnosticBag diagnostics) 1176internal override void ReportDiagnosticsIfObsolete(TypeWithAnnotations type, Binder binder, SyntaxNode syntax, BindingDiagnosticBag diagnostics)
Symbols\UpdatedContainingSymbolLocal.cs (4)
86internal override SyntaxNode ScopeDesignatorOpt => _underlyingLocal.ScopeDesignatorOpt; 93internal override ConstantValue GetConstantValue(SyntaxNode node, LocalSymbol inProgress, BindingDiagnosticBag? diagnostics = null) => 97internal override SyntaxNode GetDeclaratorSyntax() => 102SynthesizedLocalKind kind, SyntaxNode syntax
Symbols\VarianceSafety.cs (1)
483private static T GetDeclaringSyntax<T>(this Symbol symbol) where T : SyntaxNode
Syntax\CompilationUnitSyntax.cs (1)
52private bool HasFirstTokenDirective(Func<SyntaxNode, bool> predicate)
Syntax\CSharpSyntaxNode.cs (19)
28internal CSharpSyntaxNode(GreenNode green, SyntaxNode? parent, int position) 187public static SyntaxNode DeserializeFrom(Stream stream, CancellationToken cancellationToken = default) 451protected override bool EquivalentToCore(SyntaxNode other) 464protected internal override SyntaxNode ReplaceCore<TNode>( 466Func<TNode, TNode, SyntaxNode>? computeReplacementNode = null, 475protected internal override SyntaxNode ReplaceNodeInListCore(SyntaxNode originalNode, IEnumerable<SyntaxNode> replacementNodes) 480protected internal override SyntaxNode InsertNodesInListCore(SyntaxNode nodeInList, IEnumerable<SyntaxNode> nodesToInsert, bool insertBefore) 485protected internal override SyntaxNode ReplaceTokenInListCore(SyntaxToken originalToken, IEnumerable<SyntaxToken> newTokens) 490protected internal override SyntaxNode InsertTokensInListCore(SyntaxToken originalToken, IEnumerable<SyntaxToken> newTokens, bool insertBefore) 495protected internal override SyntaxNode ReplaceTriviaInListCore(SyntaxTrivia originalTrivia, IEnumerable<SyntaxTrivia> newTrivia) 500protected internal override SyntaxNode InsertTriviaInListCore(SyntaxTrivia originalTrivia, IEnumerable<SyntaxTrivia> newTrivia, bool insertBefore) 505protected internal override SyntaxNode? RemoveNodesCore(IEnumerable<SyntaxNode> nodes, SyntaxRemoveOptions options) 510protected internal override SyntaxNode NormalizeWhitespaceCore(string indentation, string eol, bool elasticTrivia) 515protected override bool IsEquivalentToCore(SyntaxNode node, bool topLevel = false)
Syntax\CSharpSyntaxRewriter.cs (7)
17public abstract partial class CSharpSyntaxRewriter : CSharpSyntaxVisitor<SyntaxNode?> 34public override SyntaxNode? Visit(SyntaxNode? node) 41var result = ((CSharpSyntaxNode)node).Accept(this); 139public virtual SyntaxList<TNode> VisitList<TNode>(SyntaxList<TNode> list) where TNode : SyntaxNode 166public virtual TNode? VisitListElement<TNode>(TNode? node) where TNode : SyntaxNode 171public virtual SeparatedSyntaxList<TNode> VisitList<TNode>(SeparatedSyntaxList<TNode> list) where TNode : SyntaxNode
Syntax\CSharpSyntaxTree.cs (4)
774public override IEnumerable<Diagnostic> GetDiagnostics(SyntaxNode node) 873protected override SyntaxNode GetRootCore(CancellationToken cancellationToken) 878protected override async Task<SyntaxNode> GetRootAsyncCore(CancellationToken cancellationToken) 883protected override bool TryGetRootCore([NotNullWhen(true)] out SyntaxNode? root)
Syntax\CSharpSyntaxTree.Dummy.cs (2)
68public override SyntaxReference GetReference(SyntaxNode node) 94public override SyntaxTree WithRootAndOptions(SyntaxNode root, ParseOptions options)
Syntax\CSharpSyntaxTree.LazySyntaxTree.cs (2)
104public override SyntaxReference GetReference(SyntaxNode node) 109public override SyntaxTree WithRootAndOptions(SyntaxNode root, ParseOptions options)
Syntax\CSharpSyntaxTree.ParsedSyntaxTree.cs (2)
118public override SyntaxReference GetReference(SyntaxNode node) 123public override SyntaxTree WithRootAndOptions(SyntaxNode root, ParseOptions options)
Syntax\CSharpSyntaxVisitor.cs (4)
17public virtual TResult? Visit(SyntaxNode? node) 28public virtual TResult? DefaultVisit(SyntaxNode node) 40public virtual void Visit(SyntaxNode? node) 48public virtual void DefaultVisit(SyntaxNode node)
Syntax\CSharpSyntaxWalker.cs (3)
22public override void Visit(SyntaxNode? node) 35public override void DefaultVisit(SyntaxNode node) 46var asNode = child.AsNode();
Syntax\InternalSyntax\CSharpSyntaxNode.cs (9)
240public sealed override CodeAnalysis.SyntaxToken CreateSeparator(SyntaxNode element) 252private static readonly ConditionalWeakTable<SyntaxNode, Dictionary<CodeAnalysis.SyntaxTrivia, WeakReference<SyntaxNode>>> s_structuresTable 253= new ConditionalWeakTable<SyntaxNode, Dictionary<CodeAnalysis.SyntaxTrivia, WeakReference<SyntaxNode>>>(); 270public override SyntaxNode GetStructure(Microsoft.CodeAnalysis.SyntaxTrivia trivia) 274var parent = trivia.Token.Parent; 277SyntaxNode structure; 284structsInParent.Add(trivia, new WeakReference<SyntaxNode>(structure));
Syntax\InternalSyntax\SyntaxToken.cs (2)
475internal override SyntaxNode CreateRed(SyntaxNode parent, int position)
Syntax\InternalSyntax\SyntaxTrivia.cs (2)
110internal override SyntaxNode CreateRed(SyntaxNode? parent, int position)
Syntax\LambdaUtilities.cs (26)
18public static bool IsLambda(SyntaxNode node) 46public static bool IsNotLambda(SyntaxNode node) => !IsLambda(node); 51public static SyntaxNode GetLambda(SyntaxNode lambdaBody) 54var lambda = lambdaBody.Parent; 71internal static SyntaxNode? TryGetCorrespondingLambdaBody(SyntaxNode oldBody, SyntaxNode newLambda) 123public static SyntaxNode GetNestedFunctionBody(SyntaxNode nestedFunction) 131public static bool IsNotLambdaBody(SyntaxNode node) 139public static bool IsLambdaBody(SyntaxNode node, bool allowReducedLambdas = false) 141var parent = node?.Parent; 269public static bool IsLambdaBodyStatementOrExpression(SyntaxNode node) 274public static bool IsLambdaBodyStatementOrExpression(SyntaxNode node, out SyntaxNode lambdaBody) 283public static bool TryGetLambdaBodies(SyntaxNode node, [NotNullWhen(true)] out SyntaxNode? lambdaBody1, out SyntaxNode? lambdaBody2) 360public static bool AreEquivalentIgnoringLambdaBodies(SyntaxNode oldNode, SyntaxNode newNode) 372internal static bool IsQueryPairLambda(SyntaxNode syntax) 386internal static bool IsClosureScope(SyntaxNode node) 478internal static int GetDeclaratorPosition(SyntaxNode node) 484private static SyntaxNode? GetLocalFunctionBody(LocalFunctionStatementSyntax localFunctionStatementSyntax) 485=> (SyntaxNode?)localFunctionStatementSyntax.Body ?? localFunctionStatementSyntax.ExpressionBody?.Expression;
Syntax\LookupPosition.cs (1)
473internal static bool IsInAnonymousFunctionOrQuery(int position, SyntaxNode lambdaExpressionOrQueryNode)
Syntax\NamespaceDeclarationSyntaxReference.cs (2)
23protected override SyntaxNode Translate(SyntaxReference reference, CancellationToken cancellationToken) 28internal static SyntaxNode GetSyntax(SyntaxReference reference, CancellationToken cancellationToken)
Syntax\SimpleSyntaxReference.cs (3)
15private readonly SyntaxNode _node; 17internal SimpleSyntaxReference(SyntaxNode node) 38public override SyntaxNode GetSyntax(CancellationToken cancellationToken)
Syntax\StructuredTriviaSyntax.cs (2)
16internal StructuredTriviaSyntax(InternalSyntax.CSharpSyntaxNode green, SyntaxNode parent, int position) 25var parent = trivia.Token.Parent;
Syntax\SyntaxBindingUtilities.cs (2)
13public static bool BindsToResumableStateMachineState(SyntaxNode node) 20public static bool BindsToTryStatement(SyntaxNode node)
Syntax\SyntaxEquivalence.cs (2)
34public static bool AreEquivalent(SyntaxNode? before, SyntaxNode? after, Func<SyntaxKind, bool>? ignoreChildNode, bool topLevel)
Syntax\SyntaxExtensions.cs (1)
404var stack = ArrayBuilder<SyntaxNode>.GetInstance();
Syntax\SyntaxFactory.cs (19)
1228public static SyntaxList<TNode> List<TNode>() where TNode : SyntaxNode 1239public static SyntaxList<TNode> SingletonList<TNode>(TNode node) where TNode : SyntaxNode 1249public static SyntaxList<TNode> List<TNode>(IEnumerable<TNode> nodes) where TNode : SyntaxNode 1333public static SeparatedSyntaxList<TNode> SeparatedList<TNode>() where TNode : SyntaxNode 1343public static SeparatedSyntaxList<TNode> SingletonSeparatedList<TNode>(TNode node) where TNode : SyntaxNode 1353public static SeparatedSyntaxList<TNode> SeparatedList<TNode>(IEnumerable<TNode>? nodes) where TNode : SyntaxNode 1405public static SeparatedSyntaxList<TNode> SeparatedList<TNode>(IEnumerable<TNode>? nodes, IEnumerable<SyntaxToken>? separators) where TNode : SyntaxNode 1453public static SeparatedSyntaxList<TNode> SeparatedList<TNode>(IEnumerable<SyntaxNodeOrToken> nodesAndTokens) where TNode : SyntaxNode 1464public static SeparatedSyntaxList<TNode> SeparatedList<TNode>(SyntaxNodeOrTokenList nodesAndTokens) where TNode : SyntaxNode 1547public static SyntaxTree SyntaxTree(SyntaxNode root, ParseOptions? options = null, string path = "", Encoding? encoding = null) 1648/// Since this API does not create a <see cref="SyntaxNode"/> that owns all produced tokens, 1963public static bool AreEquivalent(SyntaxNode? oldNode, SyntaxNode? newNode, bool topLevel) 1977public static bool AreEquivalent(SyntaxNode? oldNode, SyntaxNode? newNode, Func<SyntaxKind, bool>? ignoreChildNode = null) 2028where TNode : SyntaxNode 2044where TNode : SyntaxNode 2059where TNode : SyntaxNode 2348var lastNode = compilation.ChildNodes().LastOrDefault();
Syntax\SyntaxFacts.cs (19)
22public static bool IsAliasQualifier(SyntaxNode node) 28public static bool IsAttributeName(SyntaxNode node) 30var parent = node.Parent; 273public static bool IsNamedArgumentName(SyntaxNode node) 283var parent1 = node.Parent; 289var parent2 = parent1.Parent; 300var parent3 = parent2.Parent; 316var parent4 = parent3.Parent; 343public static bool IsFixedStatementExpression(SyntaxNode node) 345var current = node.Parent; 381internal static bool IsStatementExpression(SyntaxNode syntax) 438public static bool IsLambdaBody(SyntaxNode node) 453internal static bool IsDeclarationExpressionType(SyntaxNode node, [NotNullWhen(true)] out DeclarationExpressionSyntax? parent) 463public static string? TryGetInferredMemberName(this SyntaxNode syntax) 515return (declaration.Body ?? (SyntaxNode?)declaration.ExpressionBody) != null; 543internal static bool HasAwaitOperations(SyntaxNode node) 562private static bool IsNestedFunction(SyntaxNode child) 572internal static bool HasYieldOperations(SyntaxNode? node) 612internal static bool HasReturnWithExpression(SyntaxNode? node)
Syntax\SyntaxNodeExtensions.cs (10)
18public static bool IsAnonymousFunction(this SyntaxNode syntax) 32public static bool IsQuery(this SyntaxNode syntax) 78internal static bool CanHaveAssociatedLocalBinder(this SyntaxNode syntax) 146internal static bool IsLegalCSharp73SpanStackAllocPosition(this SyntaxNode node) 160SyntaxNode? parentNode = node.Parent; 172SyntaxNode? variableDeclarator = parentNode.Parent; 187internal static CSharpSyntaxNode AnonymousFunctionBody(this SyntaxNode lambda) 299internal static SyntaxNode ModifyingScopedOrRefTypeOrSelf(this SyntaxNode syntax) 301SyntaxNode? parentNode = syntax.Parent;
Syntax\SyntaxNodeRemover.cs (18)
18IEnumerable<SyntaxNode> nodes, 20where TRoot : SyntaxNode 35var result = remover.Visit(root); 50private readonly HashSet<SyntaxNode> _nodesToRemove; 54private HashSet<SyntaxNode>? _directivesToKeep; 57SyntaxNode[] nodesToRemove, 61_nodesToRemove = new HashSet<SyntaxNode>(nodesToRemove); 67private static TextSpan ComputeTotalSpan(SyntaxNode[] nodes) 154private bool IsForRemoval(SyntaxNode node) 159private bool ShouldVisit(SyntaxNode node) 165public override SyntaxNode? Visit(SyntaxNode? node) 167SyntaxNode? result = node; 293private void AddTrivia(SyntaxNode node) 324private void AddTrivia(SyntaxToken token, SyntaxNode node) 364private void AddTrivia(SyntaxNode node, SyntaxToken token) 421private void AddDirectives(SyntaxNode node, TextSpan span) 427_directivesToKeep = new HashSet<SyntaxNode>();
Syntax\SyntaxNormalizer.cs (14)
46where TNode : SyntaxNode 309private static bool IsAccessorListWithoutAccessorsWithBlockBody(SyntaxNode? node) 313private static bool IsAccessorListFollowedByInitializer([NotNullWhen(true)] SyntaxNode? node) 319var parent = openBraceToken.Parent; 336var parent = closeBraceToken.Parent; 351var parent = openBraceToken.Parent; 367var currentTokenParent = currentToken.Parent; 1242var node = trivia.GetStructure()!; 1307private static int GetDeclarationDepth(SyntaxNode? node) 1401private static bool IsSingleLineInitializerContext(SyntaxNode? node) 1408var currentParent = node.Parent; 1435private static bool IsInitializerInSingleLineContext(SyntaxNode? node) 1454public override SyntaxNode? VisitInterpolatedStringExpression(InterpolatedStringExpressionSyntax node) 1478public override SyntaxNode? VisitXmlTextAttribute(XmlTextAttributeSyntax node)
Syntax\SyntaxReplacer.cs (44)
17internal static SyntaxNode Replace<TNode>( 18SyntaxNode root, 20Func<TNode, TNode, SyntaxNode>? computeReplacementNode = null, 25where TNode : SyntaxNode 44IEnumerable<SyntaxNode>? nodes = null, 45Func<SyntaxNode, SyntaxNode, SyntaxNode>? computeReplacementNode = null, 51var replacer = new Replacer<SyntaxNode>( 66private class Replacer<TNode> : CSharpSyntaxRewriter where TNode : SyntaxNode 68private readonly Func<TNode, TNode, SyntaxNode>? _computeReplacementNode; 72private readonly HashSet<SyntaxNode> _nodeSet; 83Func<TNode, TNode, SyntaxNode>? computeReplacementNode, 93_nodeSet = nodes != null ? new HashSet<SyntaxNode>(nodes) : s_noNodes; 112private static readonly HashSet<SyntaxNode> s_noNodes = new HashSet<SyntaxNode>(); 180public override SyntaxNode? Visit(SyntaxNode? node) 182SyntaxNode? rewritten = node; 235internal static SyntaxNode ReplaceNodeInList(SyntaxNode root, SyntaxNode originalNode, IEnumerable<SyntaxNode> newNodes) 240internal static SyntaxNode InsertNodeInList(SyntaxNode root, SyntaxNode nodeInList, IEnumerable<SyntaxNode> nodesToInsert, bool insertBefore) 245public static SyntaxNode ReplaceTokenInList(SyntaxNode root, SyntaxToken tokenInList, IEnumerable<SyntaxToken> newTokens) 250public static SyntaxNode InsertTokenInList(SyntaxNode root, SyntaxToken tokenInList, IEnumerable<SyntaxToken> newTokens, bool insertBefore) 255public static SyntaxNode ReplaceTriviaInList(SyntaxNode root, SyntaxTrivia triviaInList, IEnumerable<SyntaxTrivia> newTrivia) 260public static SyntaxNode InsertTriviaInList(SyntaxNode root, SyntaxTrivia triviaInList, IEnumerable<SyntaxTrivia> newTrivia, bool insertBefore) 328public override SyntaxNode? Visit(SyntaxNode? node) 330SyntaxNode? rewritten = node; 370private readonly SyntaxNode _originalNode; 371private readonly IEnumerable<SyntaxNode> _newNodes; 374SyntaxNode originalNode, 375IEnumerable<SyntaxNode> replacementNodes, 384public override SyntaxNode? Visit(SyntaxNode? node)
Syntax\SyntaxTokenParser.cs (1)
47/// Since this API does not create a <see cref="SyntaxNode"/> that owns all produced tokens,
Microsoft.CodeAnalysis.CSharp.CodeStyle (777)
src\Analyzers\CSharp\Analyzers\AddBraces\CSharpAddBracesDiagnosticAnalyzer.cs (6)
49var statement = context.Node; 124private static bool ContainsInterleavedDirective(SyntaxNode statement, StatementSyntax embeddedStatement, CancellationToken cancellationToken) 152private static bool IsConsideredMultiLine(SyntaxNode statement, SyntaxNode embeddedStatement) 237private static bool RequiresBracesToMatchContext(SyntaxNode statement) 265private static IfStatementSyntax GetOutermostIfStatementOfSequence(SyntaxNode ifStatementOrElseClause)
src\Analyzers\CSharp\Analyzers\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionDiagnosticAnalyzer.Analyzer.cs (2)
232where T : SyntaxNode 290public override SyntaxKind DefaultVisit(SyntaxNode node)
src\Analyzers\CSharp\Analyzers\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionDiagnosticAnalyzer.cs (1)
50var switchStatement = context.Node;
src\Analyzers\CSharp\Analyzers\ConvertTypeofToNameof\CSharpConvertTypeOfToNameOfDiagnosticAnalyzer.cs (1)
26var node = context.Operation.Syntax;
src\Analyzers\CSharp\Analyzers\InlineDeclaration\CSharpInlineDeclarationDiagnosticAnalyzer.cs (14)
106var invocationOrCreation = argumentList.Parent; 183var enclosingBlockOfLocalStatement = GetEnclosingPseudoBlock(localStatement.Parent); 196var outArgumentScope = GetOutArgumentScope(argumentExpression); 241var reportNode = localDeclaration.Variables.Count == 1 242? (SyntaxNode)localDeclaration 254public static SyntaxNode? GetEnclosingPseudoBlock(SyntaxNode? parent) 268private static StatementSyntax GetLastStatement(SyntaxNode enclosingBlock) 285SyntaxNode enclosingBlock, 308private static SyntaxNode? GetOutArgumentScope(SyntaxNode argumentExpression) 310for (var current = argumentExpression; current != null; current = current.Parent) 363SyntaxNode enclosingBlockOfLocalStatement, 375foreach (var descendentNode in enclosingBlockOfLocalStatement.DescendantNodes())
src\Analyzers\CSharp\Analyzers\MakeLocalFunctionStatic\MakeLocalFunctionStaticHelper.cs (1)
32var node = calledLocationFunction.DeclaringSyntaxReferences.FirstOrDefault()?.GetSyntax();
src\Analyzers\CSharp\Analyzers\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyAnalyzer.cs (2)
70var declaration = reference.GetSyntax(cancellationToken); 195var declaration = methodReference.GetSyntax(cancellationToken);
src\Analyzers\CSharp\Analyzers\NewLines\ArrowExpressionClausePlacement\ArrowExpressionClausePlacementDiagnosticAnalyzer.cs (1)
44private void Recurse(SyntaxTreeAnalysisContext context, NotificationOption2 notificationOption, SyntaxNode node)
src\Analyzers\CSharp\Analyzers\NewLines\ConsecutiveBracePlacement\ConsecutiveBracePlacementDiagnosticAnalyzer.cs (2)
41using var _ = ArrayBuilder<SyntaxNode>.GetInstance(out var stack); 45private void Recurse(SyntaxTreeAnalysisContext context, NotificationOption2 notificationOption, ArrayBuilder<SyntaxNode> stack)
src\Analyzers\CSharp\Analyzers\NewLines\ConsecutiveStatementPlacement\CSharpConsecutiveStatementPlacementDiagnosticAnalyzer.cs (2)
40protected override bool IsBlockLikeStatement(SyntaxNode node) 43protected override Location GetDiagnosticLocation(SyntaxNode block)
src\Analyzers\CSharp\Analyzers\NewLines\ConstructorInitializerPlacement\ConstructorInitializerPlacementDiagnosticAnalyzer.cs (1)
45private void Recurse(SyntaxTreeAnalysisContext context, NotificationOption2 notificationOption, SyntaxNode node)
src\Analyzers\CSharp\Analyzers\NewLines\EmbeddedStatementPlacement\EmbeddedStatementPlacementDiagnosticAnalyzer.cs (3)
44private void Recurse(SyntaxTreeAnalysisContext context, NotificationOption2 notificationOption, SyntaxNode node) 90var parent = statement.Parent; 113var blockParent = parent.Parent;
src\Analyzers\CSharp\Analyzers\OrderModifiers\CSharpOrderModifiersDiagnosticAnalyzer.cs (2)
33SyntaxNode root) 39var node = child.AsNode();
src\Analyzers\CSharp\Analyzers\QualifyMemberAccess\CSharpQualifyMemberAccessDiagnosticAnalyzer.cs (6)
30protected override bool CanMemberAccessBeQualified(ISymbol containingSymbol, SyntaxNode node) 53private static bool IsInPropertyOrFieldInitialization(ISymbol containingSymbol, SyntaxNode node) 61private static bool IsInPropertyInitialization(SyntaxNode declarationSyntax, SyntaxNode node) 64private static bool IsInFieldInitialization(SyntaxNode declarationSyntax, SyntaxNode node)
src\Analyzers\CSharp\Analyzers\RemoveConfusingSuppression\CSharpRemoveConfusingSuppressionDiagnosticAnalyzer.cs (1)
32var node = context.Node;
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryImports\CSharpRemoveUnnecessaryImportsDiagnosticAnalyzer.cs (6)
37protected override ImmutableArray<SyntaxNode> MergeImports(ImmutableArray<UsingDirectiveSyntax> unnecessaryImports) 38=> ImmutableArray<SyntaxNode>.CastUp(unnecessaryImports); 46protected override SyntaxToken? TryGetLastToken(SyntaxNode node) 51IEnumerable<SyntaxNode> nodes, SyntaxTree tree, CancellationToken cancellationToken) 55var nodesContainingUnnecessaryUsings = new HashSet<SyntaxNode>(); 56foreach (var node in nodes)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (3)
186var outermostBody = invokedExpression.AncestorsAndSelf().LastOrDefault( 242SyntaxNode? node1, 244SyntaxNode? node2,
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveRedundantNullableDirectiveDiagnosticAnalyzer.cs (1)
95var directive = trivia.GetStructure()!;
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveUnnecessaryNullableDirectiveDiagnosticAnalyzer.cs (1)
58private static bool IsIgnoredCodeBlock(SyntaxNode codeBlock)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\NullableImpactingSpanWalker.cs (2)
45private bool IsIgnored(SyntaxNode node) 119public override void DefaultVisit(SyntaxNode node)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessarySuppressions\CSharpRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (1)
25protected override bool ContainsPragmaDirective(SyntaxNode root)
src\Analyzers\CSharp\Analyzers\RemoveUnreachableCode\CSharpRemoveUnreachableCodeDiagnosticAnalyzer.cs (4)
59var root = semanticModel.SyntaxTree.GetRoot(cancellationToken); 72public static StatementSyntax? TryGetContainingStatement(SyntaxNode node) 81SemanticModelAnalysisContext context, SyntaxNode root, TextSpan sourceSpan) 83var node = root.FindNode(sourceSpan);
src\Analyzers\CSharp\Analyzers\RemoveUnusedMembers\CSharpRemoveUnusedMembersDiagnosticAnalyzer.cs (2)
36protected override SyntaxNode GetParentIfSoleDeclarator(SyntaxNode node)
src\Analyzers\CSharp\Analyzers\RemoveUnusedParametersAndValues\CSharpRemoveUnusedParametersAndValuesDiagnosticAnalyzer.cs (3)
35protected override bool IsIfConditionalDirective(SyntaxNode node) 38protected override bool ReturnsThrow(SyntaxNode node) 69var statementAncestor = unusedSymbolWriteOperation.Syntax.FirstAncestorOrSelf<StatementSyntax>()?.Parent;
src\Analyzers\CSharp\Analyzers\SimplifyInterpolation\CSharpSimplifyInterpolationHelpers.cs (1)
18protected override SyntaxNode GetPreservedInterpolationExpressionSyntax(IOperation operation)
src\Analyzers\CSharp\Analyzers\UseAutoProperty\CSharpUseAutoPropertyAnalyzer.cs (9)
56foreach (var node in propertyDeclaration.DescendantNodes()) 67ConcurrentDictionary<IFieldSymbol, ConcurrentSet<SyntaxNode>> ineligibleFieldUsageIfOutsideProperty, 69SyntaxNode codeBlock, 147SyntaxNode location, 157SyntaxNode location, 208var declaration = getMethod.DeclaringSyntaxReferences[0].GetSyntax(cancellationToken); 248protected override SyntaxNode GetFieldNode( 263var syntax = accessor.DeclaringSyntaxReferences[0].GetSyntax(cancellationToken); 264foreach (var descendant in syntax.DescendantNodesAndSelf())
src\Analyzers\CSharp\Analyzers\UseCoalesceExpression\CSharpUseCoalesceExpressionForIfNullStatementCheckDiagnosticAnalyzer.cs (1)
37protected override SyntaxNode GetDeclarationNode(VariableDeclaratorSyntax declarator)
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForBuilderDiagnosticAnalyzer.cs (2)
163using var _ = ArrayBuilder<CollectionMatch<SyntaxNode>>.GetInstance(out var matches); 253ImmutableArray<CollectionMatch<SyntaxNode>> Matches,
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (1)
521bool AddLocalToProcess(SyntaxNode declarator)
src\Analyzers\CSharp\Analyzers\UseCollectionInitializer\CSharpUseCollectionInitializerAnalyzer.cs (3)
34protected override bool IsComplexElementInitializer(SyntaxNode expression) 49ArrayBuilder<CollectionMatch<SyntaxNode>> preMatches, 50ArrayBuilder<CollectionMatch<SyntaxNode>> postMatches,
src\Analyzers\CSharp\Analyzers\UseCollectionInitializer\CSharpUseCollectionInitializerDiagnosticAnalyzer.cs (2)
53ImmutableArray<CollectionMatch<SyntaxNode>> preMatches, 66static IEnumerable<CollectionElementSyntax> GetMatchElements(ImmutableArray<CollectionMatch<SyntaxNode>> preMatches)
src\Analyzers\CSharp\Analyzers\UseDeconstruction\CSharpUseDeconstructionDiagnosticAnalyzer.cs (4)
140SyntaxNode searchScope, 203SyntaxNode container, CancellationToken cancellationToken) 247SemanticModel semanticModel, SyntaxNode searchScope, ILocalSymbol local, 288SemanticModel semanticModel, SyntaxNode container, CancellationToken cancellationToken)
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyHelper.cs (8)
25public abstract BlockSyntax? GetBody(SyntaxNode declaration); 26public abstract ArrowExpressionClauseSyntax? GetExpressionBody(SyntaxNode declaration); 27public abstract bool IsRelevantDeclarationNode(SyntaxNode node); 29public abstract bool CanOfferUseExpressionBody(CodeStyleOption2<ExpressionBodyPreference> preference, SyntaxNode declaration, bool forAnalyzer, CancellationToken cancellationToken); 30public abstract bool CanOfferUseBlockBody(CodeStyleOption2<ExpressionBodyPreference> preference, SyntaxNode declaration, bool forAnalyzer, out bool fixesError, [NotNullWhen(true)] out ArrowExpressionClauseSyntax? expressionBody); 31public abstract SyntaxNode Update(SemanticModel semanticModel, SyntaxNode declaration, bool useExpressionBody, CancellationToken cancellationToken); 33public abstract Location GetDiagnosticLocation(SyntaxNode declaration);
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyHelper`1.cs (10)
28where TDeclaration : SyntaxNode 63public override BlockSyntax? GetBody(SyntaxNode declaration) 66public override ArrowExpressionClauseSyntax? GetExpressionBody(SyntaxNode declaration) 69public override bool IsRelevantDeclarationNode(SyntaxNode node) 72public override bool CanOfferUseExpressionBody(CodeStyleOption2<ExpressionBodyPreference> preference, SyntaxNode declaration, bool forAnalyzer, CancellationToken cancellationToken) 75public override bool CanOfferUseBlockBody(CodeStyleOption2<ExpressionBodyPreference> preference, SyntaxNode declaration, bool forAnalyzer, out bool fixesError, [NotNullWhen(true)] out ArrowExpressionClauseSyntax? expressionBody) 78public sealed override SyntaxNode Update(SemanticModel semanticModel, SyntaxNode declaration, bool useExpressionBody, CancellationToken cancellationToken) 81public override Location GetDiagnosticLocation(SyntaxNode declaration) 131SyntaxNode declaration, ExpressionBodyPreference conversionPreference, CancellationToken cancellationToken,
src\Analyzers\CSharp\Analyzers\UseExpressionBody\UseExpressionBodyDiagnosticAnalyzer.cs (1)
90CSharpCodeGenerationOptions options, SyntaxNode declaration, SyntaxNodeAnalysisContext context, UseExpressionBodyHelper helper, CancellationToken cancellationToken)
src\Analyzers\CSharp\Analyzers\UseImplicitOrExplicitType\CSharpTypeStyleDiagnosticAnalyzerBase.cs (2)
41var declarationStatement = context.Node; 67private static Diagnostic CreateDiagnostic(DiagnosticDescriptor descriptor, SyntaxNode declaration, TextSpan diagnosticSpan, NotificationOption2 notificationOption, AnalyzerOptions analyzerOptions)
src\Analyzers\CSharp\Analyzers\UseIsNullCheck\CSharpUseNullCheckOverTypeCheckDiagnosticAnalyzer.cs (1)
89var syntax = operation.Syntax;
src\Analyzers\CSharp\Analyzers\UseLocalFunction\CSharpUseLocalFunctionDiagnosticAnalyzer.cs (1)
245foreach (var descendentNode in block.DescendantNodes())
src\Analyzers\CSharp\Analyzers\UseNameofInNullableAttribute\CSharpUseNameofInNullableAttributeDiagnosticAnalyzer.cs (1)
120var container = attributeList?.Parent;
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.Analyzer.cs (11)
22private readonly SyntaxNode _localStatement; 23private readonly SyntaxNode _enclosingBlock; 31SyntaxNode localStatement, 32SyntaxNode enclosingBlock, 56SyntaxNode localStatement, 57SyntaxNode enclosingBlock, 98foreach (var current in _comparison.Ancestors()) 240private bool CheckLoop(SyntaxNode statement, StatementSyntax body, bool defAssignedWhenTrue) 307private bool IsAccessedOutOfScope(SyntaxNode scope) 317foreach (var descendentNode in _enclosingBlock.DescendantNodes()) 349private bool LocalFlowsIn(SyntaxNode statementOrExpression)
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.cs (10)
59var node = syntaxContext.Node; 77BinaryExpressionSyntax binaryExpression => (binaryExpression.Left, (SyntaxNode)binaryExpression.Right), 107var localStatement = declarator.Parent?.Parent; 108var enclosingBlock = localStatement?.Parent; 178foreach (var descendentNode in enclosingBlock.DescendantNodes()) 210var comparisonEnclosingBlock = comparison.AncestorsAndSelf().FirstOrDefault(n => n is BlockSyntax); 219foreach (var descendentNode in enclosingBlock.DescendantNodes()) 240foreach (var descendentNode in enclosingBlock.DescendantNodes()) 279SyntaxNode operand, 336private static ExpressionSyntax? GetNullCheckOperand(ExpressionSyntax left, SyntaxKind comparisonKind, SyntaxNode right)
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpIsAndCastCheckDiagnosticAnalyzer.cs (3)
96var ifStatementScope = ifStatement.Parent.IsKind(SyntaxKind.Block) 211SyntaxNode scope, VariableDeclaratorSyntax variable) 215using var _ = ArrayBuilder<SyntaxNode>.GetInstance(out var stack);
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpUseNotPatternDiagnosticAnalyzer.cs (1)
63var node = context.Node;
src\Analyzers\CSharp\Analyzers\UsePrimaryConstructor\CSharpUsePrimaryConstructorDiagnosticAnalyzer.cs (5)
88[NotNullWhen(true)] out SyntaxNode? nodeToRemove, 391var body = primaryConstructorDeclaration.ExpressionBody ?? (SyntaxNode?)primaryConstructorDeclaration.Body; 416using var _2 = ArrayBuilder<(IParameterSymbol parameter, SyntaxNode assignedMemberDeclaration, bool parameterIsWrittenTo)>.GetInstance(out var orderedParameterAssignments); 467ArrayBuilder<(IParameterSymbol parameter, SyntaxNode assignedMemberDeclaration, bool parameterIsWrittenTo)>? orderedParameterAssignments,
src\Analyzers\CSharp\Analyzers\UseSimpleUsingStatement\UseSimpleUsingStatementDiagnosticAnalyzer.cs (4)
87var parentBlockLike = outermostUsing.Parent; 134SyntaxNode parentBlockLike, 143foreach (var statement in CSharpBlockFacts.Instance.GetExecutableBlockStatements(parentBlockLike)) 177SyntaxNode parentBlockLike,
src\Analyzers\CSharp\Analyzers\UseUtf8StringLiteral\UseUtf8StringLiteralDiagnosticAnalyzer.cs (3)
118private void ReportParameterArrayDiagnostic(OperationAnalysisContext context, SyntaxNode syntaxNode, ImmutableArray<IOperation> elements, NotificationOption2 notificationOption, ArrayCreationOperationLocation operationLocation) 130private void ReportArrayCreationDiagnostic(OperationAnalysisContext context, SyntaxNode syntaxNode, NotificationOption2 notificationOption) 138private void ReportDiagnostic(OperationAnalysisContext context, SyntaxNode syntaxNode, NotificationOption2 notificationOption, Location location, ArrayCreationOperationLocation operationLocation)
src\Analyzers\CSharp\Analyzers\ValidateFormatString\CSharpValidateFormatStringDiagnosticAnalyzer.cs (4)
21protected override SyntaxNode? TryGetMatchingNamedArgument( 22SeparatedSyntaxList<SyntaxNode> arguments, 36protected override SyntaxNode GetArgumentExpression(SyntaxNode syntaxNode)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\EmbeddedLanguages\VirtualChars\CSharpVirtualCharService.cs (1)
114private static bool IsInDirective(SyntaxNode? node)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\DirectiveSyntaxExtensions.cs (5)
17private static readonly ConditionalWeakTable<SyntaxNode, DirectiveInfo<DirectiveTriviaSyntax>> s_rootToDirectiveInfo = new(); 19private static SyntaxNode GetAbsoluteRoot(this SyntaxNode node) 29private static DirectiveInfo<DirectiveTriviaSyntax> GetDirectiveInfo(SyntaxNode node, CancellationToken cancellationToken) 34private static DirectiveInfo<DirectiveTriviaSyntax> GetDirectiveInfoForRoot(SyntaxNode root, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (6)
208public static bool IsInRefContext([NotNullWhen(true)] this ExpressionSyntax? expression, [NotNullWhen(true)] out SyntaxNode? refParent) 283var parent = expr.Parent; 333if (expression.IsInRefContext(out var refParent)) 406if (expression?.Parent is SyntaxNode parent) 913var parent = topExpression.Parent; 974for (SyntaxNode? current = returnStatement; current != null; current = current.Parent)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ILocalSymbolExtensions.cs (4)
12public static bool CanSafelyMoveLocalToBlock(this ILocalSymbol localSymbol, SyntaxNode currentBlock, SyntaxNode destinationBlock) 16var localFunctionOrMethodDeclaration = currentBlock.AncestorsAndSelf() 30static bool HasTypeParameterWithName(SyntaxNode? node, string name)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\MemberDeclarationSyntaxExtensions.DeclarationFinder.cs (1)
23public static Dictionary<string, List<SyntaxToken>> GetAllDeclarations(SyntaxNode syntax)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (3)
29var nodeParent = node.Parent; 317private static readonly ObjectPool<Stack<SyntaxNode>> s_nodeStackPool = SharedPools.Default<Stack<SyntaxNode>>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (1)
161public static ISet<INamespaceSymbol> GetUsingNamespacesInScope(this SemanticModel semanticModel, SyntaxNode location)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxListExtensions.cs (2)
15public static SyntaxList<T> RemoveRange<T>(this SyntaxList<T> syntaxList, int index, int count) where T : SyntaxNode 22public static SyntaxList<T> Insert<T>(this SyntaxList<T> list, int index, T item) where T : SyntaxNode
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (74)
23public static LanguageVersion GetLanguageVersion(this SyntaxNode node) 26public static void Deconstruct(this SyntaxNode node, out SyntaxKind kind) 29public static bool IsKind<TNode>([NotNullWhen(true)] this SyntaxNode? node, SyntaxKind kind, [NotNullWhen(true)] out TNode? result) 30where TNode : SyntaxNode 42public static bool IsParentKind([NotNullWhen(true)] this SyntaxNode? node, SyntaxKind kind) 45public static bool IsParentKind<TNode>([NotNullWhen(true)] this SyntaxNode? node, SyntaxKind kind, [NotNullWhen(true)] out TNode? result) 46where TNode : SyntaxNode 59this SyntaxNode node, SourceText? sourceText = null, 88public static bool IsAnyArgumentList([NotNullWhen(true)] this SyntaxNode? node) 97public static (SyntaxToken openBrace, SyntaxToken closeBrace) GetBraces(this SyntaxNode? node) 114public static bool IsEmbeddedStatementOwner([NotNullWhen(true)] this SyntaxNode? node) 128public static StatementSyntax? GetEmbeddedStatement(this SyntaxNode? node) 144public static BaseParameterListSyntax? GetParameterList(this SyntaxNode? declaration) 157public static SyntaxList<AttributeListSyntax> GetAttributeLists(this SyntaxNode? declaration) 170public static ConditionalAccessExpressionSyntax? GetParentConditionalAccessExpression(this SyntaxNode? node) 182var current = node; 249/// <inheritdoc cref="ISyntaxFacts.GetRootConditionalAccessExpression(SyntaxNode)"/> 251public static ConditionalAccessExpressionSyntax? GetRootConditionalAccessExpression(this SyntaxNode? node) 268public static ConditionalAccessExpressionSyntax? GetInnerMostConditionalAccessExpression(this SyntaxNode node) 279public static bool IsAsyncSupportingFunctionSyntax([NotNullWhen(true)] this SyntaxNode? node) 282public static bool IsCompoundAssignExpression([NotNullWhen(true)] this SyntaxNode? node) 285public static bool IsLeftSideOfAssignExpression([NotNullWhen(true)] this SyntaxNode? node) 289public static bool IsLeftSideOfAnyAssignExpression([NotNullWhen(true)] this SyntaxNode? node) 292public static bool IsRightSideOfAnyAssignExpression([NotNullWhen(true)] this SyntaxNode? node) 295public static bool IsLeftSideOfCompoundAssignExpression([NotNullWhen(true)] this SyntaxNode? node) 306public static IEnumerable<UsingDirectiveSyntax> GetEnclosingUsingDirectives(this SyntaxNode node) 314public static IEnumerable<ExternAliasDirectiveSyntax> GetEnclosingExternAliasDirectives(this SyntaxNode node) 322public static bool IsUnsafeContext(this SyntaxNode node) 333public static bool IsInStaticContext(this SyntaxNode node) 335for (var current = node; current != null; current = current.Parent) 370public static BaseNamespaceDeclarationSyntax? GetInnermostNamespaceDeclarationWithUsings(this SyntaxNode contextNode) 393public static bool IsBreakableConstruct(this SyntaxNode node) 409public static bool IsContinuableConstruct(this SyntaxNode node) 424public static bool IsReturnableConstruct(this SyntaxNode node) 448public static bool ContainsYield(this SyntaxNode node) 451public static bool IsReturnableConstructOrTopLevelCompilationUnit(this SyntaxNode node) 454public static bool SpansPreprocessorDirective<TSyntaxNode>(this IEnumerable<TSyntaxNode> list) where TSyntaxNode : SyntaxNode 459where TNode : SyntaxNode 507public static bool ContainsInterleavedDirective(this SyntaxNode syntaxNode, CancellationToken cancellationToken) 511/// Similar to <see cref="ContainsInterleavedDirective(SyntaxNode, CancellationToken)"/> except that the span to check 514public static bool ContainsInterleavedDirective(this SyntaxNode syntaxNode, TextSpan span, CancellationToken cancellationToken) 553var structure = trivia.GetStructure()!; 595where TSyntaxNode : SyntaxNode 655public static ImmutableArray<SyntaxTrivia> GetLeadingBlankLines<TSyntaxNode>(this TSyntaxNode node) where TSyntaxNode : SyntaxNode 658public static TSyntaxNode GetNodeWithoutLeadingBlankLines<TSyntaxNode>(this TSyntaxNode node) where TSyntaxNode : SyntaxNode 661public static TSyntaxNode GetNodeWithoutLeadingBlankLines<TSyntaxNode>(this TSyntaxNode node, out ImmutableArray<SyntaxTrivia> strippedTrivia) where TSyntaxNode : SyntaxNode 664public static ImmutableArray<SyntaxTrivia> GetLeadingBannerAndPreprocessorDirectives<TSyntaxNode>(this TSyntaxNode node) where TSyntaxNode : SyntaxNode 667public static TSyntaxNode GetNodeWithoutLeadingBannerAndPreprocessorDirectives<TSyntaxNode>(this TSyntaxNode node) where TSyntaxNode : SyntaxNode 670public static TSyntaxNode GetNodeWithoutLeadingBannerAndPreprocessorDirectives<TSyntaxNode>(this TSyntaxNode node, out ImmutableArray<SyntaxTrivia> strippedTrivia) where TSyntaxNode : SyntaxNode 673public static bool IsVariableDeclaratorValue([NotNullWhen(true)] this SyntaxNode? node) 677public static BlockSyntax? FindInnermostCommonBlock(this IEnumerable<SyntaxNode> nodes) 680public static IEnumerable<SyntaxNode> GetAncestorsOrThis(this SyntaxNode? node, Func<SyntaxNode, bool> predicate) 682var current = node; 694public static (SyntaxToken openParen, SyntaxToken closeParen) GetParentheses(this SyntaxNode node) 724public static (SyntaxToken openBracket, SyntaxToken closeBracket) GetBrackets(this SyntaxNode? node) 737public static SyntaxTokenList GetModifiers(this SyntaxNode? member) 749public static SyntaxNode? WithModifiers(this SyntaxNode? member, SyntaxTokenList modifiers) 760public static void ForEachMember<TArg>(this SyntaxNode? node, Action<MemberDeclarationSyntax, TArg> callback, TArg arg) 785[NotNullWhen(true)] this SyntaxNode? node, 792for (var current = node; current != null; current = current.Parent) 837[NotNullWhen(true)] this SyntaxNode? node, 838[NotNullWhen(true)] out SyntaxNode? deconstructionLeft) 840SyntaxNode? previous = null; 841for (var current = node; current != null; current = current.Parent) 863where T : SyntaxNode 872where T : SyntaxNode 880where T : SyntaxNode 886public static T KeepCommentsAndAddElasticMarkers<T>(this T node) where T : SyntaxNode 891public static SyntaxNode WithPrependedNonIndentationTriviaFrom( 892this SyntaxNode to, SyntaxNode from)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTokenExtensions.cs (2)
23public static bool IsLastTokenOfNode<T>(this SyntaxToken token) where T : SyntaxNode 26public static bool IsLastTokenOfNode<T>(this SyntaxToken token, [NotNullWhen(true)] out T? node) where T : SyntaxNode
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTriviaExtensions.cs (1)
201public static bool IsPragmaDirective(this SyntaxTrivia trivia, out bool isDisable, out bool isActive, out SeparatedSyntaxList<SyntaxNode> errorCodes)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\CSharpSyntaxFormatting.cs (2)
45protected override IFormattingResult CreateAggregatedFormattingResult(SyntaxNode node, IList<AbstractFormattingResult> results, TextSpanMutableIntervalTree? formattingSpans = null) 48protected override AbstractFormattingResult Format(SyntaxNode node, SyntaxFormattingOptions options, ImmutableArray<AbstractFormattingRule> formattingRules, SyntaxToken startToken, SyntaxToken endToken, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\DefaultOperationProvider.cs (4)
23public override void AddSuppressOperations(ArrayBuilder<SuppressOperation> list, SyntaxNode node, in NextSuppressOperationAction nextOperation) 27public override void AddAnchorIndentationOperations(List<AnchorIndentationOperation> list, SyntaxNode node, in NextAnchorIndentationOperationAction nextOperation) 31public override void AddIndentBlockOperations(List<IndentBlockOperation> list, SyntaxNode node, in NextIndentBlockOperationAction nextOperation) 35public override void AddAlignTokensOperations(List<AlignTokensOperation> list, SyntaxNode node, in NextAlignTokensOperationAction nextOperation)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\AggregatedFormattingResult.cs (2)
16public AggregatedFormattingResult(SyntaxNode node, IList<AbstractFormattingResult> results, TextSpanMutableIntervalTree? formattingSpans) 21protected override SyntaxNode Rewriter(Dictionary<ValueTuple<SyntaxToken, SyntaxToken>, TriviaData> map, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\CSharpFormatEngine.cs (1)
16SyntaxNode node,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\CSharpStructuredTriviaFormatEngine.cs (1)
23var root = trivia.GetStructure() ?? throw new ArgumentException();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\FormattingResult.cs (1)
24protected override SyntaxNode Rewriter(Dictionary<ValueTuple<SyntaxToken, SyntaxToken>, TriviaData> changeMap, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\CSharpTriviaFormatter.cs (1)
184var structuredTrivia = trivia.GetStructure();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\CSharpTriviaFormatter.DocumentationCommentExteriorCommentRewriter.cs (1)
68var currentParent = trivia.Token.Parent;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaRewriter.cs (5)
21private readonly SyntaxNode _node; 29SyntaxNode node, 44public SyntaxNode Transform() 151public override SyntaxNode? Visit(SyntaxNode? node)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\FormattingHelpers.cs (13)
48public static (SyntaxToken openBrace, SyntaxToken closeBrace) GetBracePair(this SyntaxNode? node) 51public static (SyntaxToken openBracket, SyntaxToken closeBracket) GetBracketPair(this SyntaxNode? node) 127public static bool IsLambdaBodyBlock(this SyntaxNode node) 137public static bool IsAnonymousMethodBlock(this SyntaxNode node) 197public static bool IsEmbeddedStatement([NotNullWhen(true)] this SyntaxNode? node) 199SyntaxNode? statementOrElse = node as StatementSyntax; 231var parent = token.Parent ?? throw new ArgumentNullException(nameof(token)); 362public static bool IsEmbeddedStatementOwnerWithCloseParen([NotNullWhen(true)] this SyntaxNode? node) 387public static bool IsInitializerForObjectOrAnonymousObjectCreationExpression([NotNullWhen(true)] this SyntaxNode? node) 391var parent = initializer.Parent; 423public static bool IsInitializerForArrayOrCollectionCreationExpression([NotNullWhen(true)] this SyntaxNode? node) 427var parent = initializer.Parent; 447var parent = anonymousObjectInitializer.Parent;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\AnchorIndentationFormattingRule.cs (2)
15public override void AddAnchorIndentationOperations(List<AnchorIndentationOperation> list, SyntaxNode node, in NextAnchorIndentationOperationAction nextOperation) 89private static void AddAnchorIndentationOperation(List<AnchorIndentationOperation> list, SyntaxNode node)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\BaseFormattingRule.cs (2)
146protected static void AddAlignIndentationOfTokensToBaseTokenOperation(List<AlignTokensOperation> list, SyntaxNode containingNode, SyntaxToken baseNode, IEnumerable<SyntaxToken> tokens, AlignTokensOption option = AlignTokensOption.AlignIndentationOfTokensToBaseToken) 162protected static void AddBraceSuppressOperations(ArrayBuilder<SuppressOperation> list, SyntaxNode node)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\ElasticTriviaFormattingRule.cs (6)
25public override void AddSuppressOperations(ArrayBuilder<SuppressOperation> list, SyntaxNode node, in NextSuppressOperationAction nextOperation) 41private static void AddPropertyDeclarationSuppressOperations(ArrayBuilder<SuppressOperation> list, SyntaxNode node) 53private static void AddInitializerSuppressOperations(ArrayBuilder<SuppressOperation> list, SyntaxNode node) 70private static void AddCollectionExpressionSuppressOperations(ArrayBuilder<SuppressOperation> list, SyntaxNode node) 79private static InitializerExpressionSyntax? GetInitializerNode(SyntaxNode node) 88private static SyntaxToken? GetLastTokenOfType(SyntaxNode node)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\IndentBlockFormattingRule.cs (10)
46public override void AddIndentBlockOperations(List<IndentBlockOperation> list, SyntaxNode node, in NextIndentBlockOperationAction nextOperation) 65private static void AddTypeParameterConstraintClauseOperation(List<IndentBlockOperation> list, SyntaxNode node) 74private void AddSwitchIndentationOperation(List<IndentBlockOperation> list, SyntaxNode node) 134private void AddLabelIndentationOperation(List<IndentBlockOperation> list, SyntaxNode node) 150private static void AddAlignmentBlockOperation(List<IndentBlockOperation> list, SyntaxNode node) 205private static void SetAlignmentBlockOperation(List<IndentBlockOperation> list, SyntaxNode baseNode, SyntaxNode body) 216private void AddBlockIndentationOperation(List<IndentBlockOperation> list, SyntaxNode node) 253private static void AddBracketIndentationOperation(List<IndentBlockOperation> list, SyntaxNode node) 288private static void AddEmbeddedStatementsIndentationOperation(List<IndentBlockOperation> list, SyntaxNode node)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\IndentUserSettingsFormattingRule.cs (1)
40public override void AddIndentBlockOperations(List<IndentBlockOperation> list, SyntaxNode node, in NextIndentBlockOperationAction nextOperation)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\NewLineUserSettingFormattingRule.cs (3)
40private static bool IsControlBlock(SyntaxNode node) 165var currentTokenParentParent = currentToken.Parent.Parent; 366var currentTokenParentParent = currentToken.Parent.Parent;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\QueryExpressionFormattingRule.cs (3)
42public override void AddSuppressOperations(ArrayBuilder<SuppressOperation> list, SyntaxNode node, in NextSuppressOperationAction nextOperation) 82public override void AddIndentBlockOperations(List<IndentBlockOperation> list, SyntaxNode node, in NextIndentBlockOperationAction nextOperation) 110public override void AddAnchorIndentationOperations(List<AnchorIndentationOperation> list, SyntaxNode node, in NextAnchorIndentationOperationAction nextOperation)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SpacingFormattingRule.cs (2)
561public override void AddSuppressOperations(ArrayBuilder<SuppressOperation> list, SyntaxNode node, in NextSuppressOperationAction nextOperation) 574private void SuppressVariableDeclaration(ArrayBuilder<SuppressOperation> list, SyntaxNode node)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SuppressFormattingRule.cs (10)
21public override void AddSuppressOperations(ArrayBuilder<SuppressOperation> list, SyntaxNode node, in NextSuppressOperationAction nextOperation) 36private static void AddSpecificNodesSuppressOperations(ArrayBuilder<SuppressOperation> list, SyntaxNode node) 263private static void AddStatementExceptBlockSuppressOperations(ArrayBuilder<SuppressOperation> list, SyntaxNode node) 276private static void AddFormatSuppressOperations(ArrayBuilder<SuppressOperation> list, SyntaxNode node) 315static void ProcessStructuredTrivia(ArrayBuilder<SuppressOperation> list, SyntaxNode structure) 369private static void AddInitializerSuppressOperations(ArrayBuilder<SuppressOperation> list, SyntaxNode node) 399private static void AddInitializerSuppressOperations(ArrayBuilder<SuppressOperation> list, SyntaxNode parent, IEnumerable<SyntaxNode> items) 405foreach (var item in items) 417private static InitializerExpressionSyntax? GetInitializerNode(SyntaxNode node)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\TokenBasedFormattingRule.cs (2)
203var attributeOwner = previousToken.Parent?.Parent; 248private static SyntaxList<UsingDirectiveSyntax> GetUsings(SyntaxNode node)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\WrappingFormattingRule.cs (7)
46public override void AddSuppressOperations(ArrayBuilder<SuppressOperation> list, SyntaxNode node, in NextSuppressOperationAction nextOperation) 67private static (SyntaxToken firstToken, SyntaxToken lastToken) GetSpecificNodeSuppressionTokenRange(SyntaxNode node) 92private static void AddSpecificNodesSuppressOperations(ArrayBuilder<SuppressOperation> list, SyntaxNode node) 101private static void AddStatementExceptBlockSuppressOperations(ArrayBuilder<SuppressOperation> list, SyntaxNode node) 114private static void RemoveSuppressOperationForStatementMethodDeclaration(ArrayBuilder<SuppressOperation> list, SyntaxNode node) 137private static void RemoveSuppressOperationForBlock(ArrayBuilder<SuppressOperation> list, SyntaxNode node) 158private static (SyntaxToken openBrace, SyntaxToken closeBrace) GetBracePair(SyntaxNode node)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Helpers\RemoveUnnecessaryImports\CSharpUnnecessaryImportsProvider.cs (3)
25Func<SyntaxNode, bool>? predicate, 28var root = model.SyntaxTree.GetRoot(cancellationToken); 29predicate ??= Functions<SyntaxNode>.True;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Indentation\CSharpSmartTokenFormatter.cs (1)
150public override void AddSuppressOperations(ArrayBuilder<SuppressOperation> list, SyntaxNode node, in NextSuppressOperationAction nextOperation)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\Precedence\AbstractCSharpPrecedenceService.cs (1)
13where TSyntax : SyntaxNode
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SelectedMembers\CSharpSelectedMembers.cs (4)
30protected override ImmutableArray<(SyntaxNode declarator, SyntaxToken identifier)> GetDeclaratorsAndIdentifiers(MemberDeclarationSyntax member) 35v => (declaration: (SyntaxNode)v, identifier: v.Identifier)), 37v => (declaration: (SyntaxNode)v, identifier: v.Identifier)), 38_ => [(declaration: (SyntaxNode)member, identifier: member.GetNameToken())],
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (29)
40public bool IsWrittenTo(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken) 43public bool IsOnlyWrittenTo(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken) 46public bool IsInOutContext(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken) 49public bool IsInRefContext(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken) 52public bool IsInInContext(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken) 55public bool CanReplaceWithRValue(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? expression, CancellationToken cancellationToken) 62foreach (var ancestor in token.GetAncestors<SyntaxNode>()) 112SyntaxNode oldNode, 113SyntaxNode newNode, 169public ForEachSymbols GetForEachSymbols(SemanticModel semanticModel, SyntaxNode node) 183public SymbolInfo GetCollectionInitializerSymbolInfo(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken) 186public IMethodSymbol? GetGetAwaiterMethod(SemanticModel semanticModel, SyntaxNode node) 197public ImmutableArray<IMethodSymbol> GetDeconstructionAssignmentMethods(SemanticModel semanticModel, SyntaxNode node) 209public ImmutableArray<IMethodSymbol> GetDeconstructionForEachMethods(SemanticModel semanticModel, SyntaxNode node) 234var node = syntaxRef.GetSyntax(cancellationToken); 245public IEnumerable<ISymbol> GetDeclaredSymbols(SemanticModel semanticModel, SyntaxNode memberDeclaration, CancellationToken cancellationToken) 255public IParameterSymbol? FindParameterForArgument(SemanticModel semanticModel, SyntaxNode argument, bool allowUncertainCandidates, bool allowParams, CancellationToken cancellationToken) 258public IParameterSymbol? FindParameterForAttributeArgument(SemanticModel semanticModel, SyntaxNode argument, bool allowUncertainCandidates, bool allowParams, CancellationToken cancellationToken) 262public ISymbol? FindFieldOrPropertyForArgument(SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken) 265public ISymbol? FindFieldOrPropertyForAttributeArgument(SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken) 270public ImmutableArray<ISymbol> GetBestOrAllSymbols(SemanticModel semanticModel, SyntaxNode? node, SyntaxToken token, CancellationToken cancellationToken) 292/// cref="ModelExtensions.GetSymbolInfo(SemanticModel, SyntaxNode, CancellationToken)"/>, but sometimes employs 296private ImmutableArray<ISymbol> GetSymbolInfo(SemanticModel semanticModel, SyntaxNode node, SyntaxToken token, CancellationToken cancellationToken) 368public bool IsInsideNameOfExpression(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken) 377var node = syntaxReference.GetSyntax(cancellationToken); 392public bool IsInExpressionTree(SemanticModel semanticModel, SyntaxNode node, [NotNullWhen(true)] INamedTypeSymbol? expressionType, CancellationToken cancellationToken) 395public string GenerateNameForExpression(SemanticModel semanticModel, SyntaxNode expression, bool capitalize, CancellationToken cancellationToken) 398public IPreprocessingSymbol? GetPreprocessingSymbol(SemanticModel semanticModel, SyntaxNode node) 410private static bool IsInPreprocessingSymbolContext(SyntaxNode node)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpAccessibilityFacts.cs (7)
26public bool CanHaveAccessibility(SyntaxNode declaration, bool ignoreDeclarationModifiers = false) 93public Accessibility GetAccessibility(SyntaxNode declaration) 153public static DeclarationKind GetDeclarationKind(SyntaxNode declaration) 308public static SyntaxTokenList GetModifierTokens(SyntaxNode declaration) 322public static bool ParentIsFieldDeclaration([NotNullWhen(true)] SyntaxNode? node) 325public static bool ParentIsEventFieldDeclaration([NotNullWhen(true)] SyntaxNode? node) 328public static bool ParentIsLocalDeclarationStatement([NotNullWhen(true)] SyntaxNode? node)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpBlockFacts.cs (10)
22public override bool IsScopeBlock([NotNullWhen(true)] SyntaxNode? node) 25public override bool IsExecutableBlock([NotNullWhen(true)] SyntaxNode? node) 28public override IReadOnlyList<SyntaxNode> GetExecutableBlockStatements(SyntaxNode? node) 39public override SyntaxNode? FindInnermostCommonExecutableBlock(IEnumerable<SyntaxNode> nodes) 42public override bool IsStatementContainer([NotNullWhen(true)] SyntaxNode? node) 45public override IReadOnlyList<SyntaxNode> GetStatementContainerStatements(SyntaxNode? node) 50return ImmutableArray.Create<SyntaxNode>(embeddedStatement);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpDocumentationCommentService.cs (1)
40protected override SyntaxNode GetName(XmlElementSyntax xmlElement)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpHeaderFacts.cs (18)
24public override bool IsOnTypeHeader(SyntaxNode root, int position, bool fullHeader, [NotNullWhen(true)] out SyntaxNode? typeDeclaration) 38public override bool IsOnPropertyDeclarationHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? propertyDeclaration) 51public override bool IsOnParameterHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? parameter) 64public override bool IsOnMethodHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? method) 77public override bool IsOnLocalFunctionHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? localFunction) 90public override bool IsOnLocalDeclarationHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? localDeclaration) 105public override bool IsOnIfStatementHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? ifStatement) 118public override bool IsOnWhileStatementHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? whileStatement) 131public override bool IsOnForeachHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? foreachStatement)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (311)
29private static readonly ObjectPool<List<SyntaxNode>> s_syntaxNodeListPool = new ObjectPool<List<SyntaxNode>>(() => [], trimOnFree: false); 130public bool IsDirective([NotNullWhen(true)] SyntaxNode? node) 133public bool TryGetExternalSourceInfo([NotNullWhen(true)] SyntaxNode? node, out ExternalSourceInfo info) 154public bool IsNameOfSimpleMemberAccessExpression([NotNullWhen(true)] SyntaxNode? node) 160public bool IsNameOfAnyMemberAccessExpression([NotNullWhen(true)] SyntaxNode? node) 163public bool IsNameOfMemberBindingExpression([NotNullWhen(true)] SyntaxNode? node) 170public SyntaxNode? GetStandaloneExpression(SyntaxNode? node) 173public SyntaxNode? GetRootConditionalAccessExpression(SyntaxNode? node) 176public bool IsDeclarationExpression([NotNullWhen(true)] SyntaxNode? node) 179public bool IsNamedArgument([NotNullWhen(true)] SyntaxNode? node) 182public bool IsNameOfNamedArgument([NotNullWhen(true)] SyntaxNode? node) 185public SyntaxNode? GetParameterList(SyntaxNode node) 188public bool IsParameterList([NotNullWhen(true)] SyntaxNode? node) 191public bool IsUsingDirectiveName([NotNullWhen(true)] SyntaxNode? node) 195public bool IsUsingAliasDirective([NotNullWhen(true)] SyntaxNode? node) 198public void GetPartsOfUsingAliasDirective(SyntaxNode node, out SyntaxToken globalKeyword, out SyntaxToken alias, out SyntaxNode name) 206public bool IsDeconstructionForEachStatement([NotNullWhen(true)] SyntaxNode? node) 209public bool IsDeconstructionAssignment([NotNullWhen(true)] SyntaxNode? node) 212public Location GetDeconstructionReferenceLocation(SyntaxNode node) 222public bool IsStatement([NotNullWhen(true)] SyntaxNode? node) 225public bool IsExecutableStatement([NotNullWhen(true)] SyntaxNode? node) 228public bool IsGlobalStatement([NotNullWhen(true)] SyntaxNode? node) 231public SyntaxNode GetStatementOfGlobalStatement(SyntaxNode node) 234public bool AreStatementsInSameContainer(SyntaxNode firstStatement, SyntaxNode secondStatement) 253public bool IsMethodBody([NotNullWhen(true)] SyntaxNode? node) 265public SyntaxNode GetExpressionOfRefExpression(SyntaxNode node) 268public SyntaxNode? GetExpressionOfReturnStatement(SyntaxNode node) 312public bool IsPredefinedType(SyntaxNode? node) 315public bool IsPredefinedType(SyntaxNode? node, PredefinedType type) 535public bool IsPostfixUnaryExpression([NotNullWhen(true)] SyntaxNode? node) 538public bool IsElementBindingExpression([NotNullWhen(true)] SyntaxNode? node) 541public bool IsMemberBindingExpression([NotNullWhen(true)] SyntaxNode? node) 544public bool IsPointerMemberAccessExpression([NotNullWhen(true)] SyntaxNode? node) 547public void GetNameAndArityOfSimpleName(SyntaxNode node, out string name, out int arity) 554public bool LooksGeneric(SyntaxNode simpleName) 558public SeparatedSyntaxList<SyntaxNode> GetTypeArgumentsOfGenericName(SyntaxNode? genericName) 561public SyntaxNode? GetTargetOfMemberBinding(SyntaxNode? node) 564public SyntaxNode GetNameOfMemberBindingExpression(SyntaxNode node) 567public SyntaxNode? GetExpressionOfMemberAccessExpression(SyntaxNode node, bool allowImplicitTarget) 570public void GetPartsOfElementAccessExpression(SyntaxNode node, out SyntaxNode expression, out SyntaxNode argumentList) 577public SyntaxNode GetExpressionOfInterpolation(SyntaxNode node) 580public bool IsInStaticContext(SyntaxNode node) 583public bool IsInNamespaceOrTypeContext([NotNullWhen(true)] SyntaxNode? node) 586public bool IsBaseTypeList([NotNullWhen(true)] SyntaxNode? node) 589public SyntaxNode GetExpressionOfArgument(SyntaxNode node) 592public SyntaxNode GetExpressionOfAttributeArgument(SyntaxNode node) 595public RefKind GetRefKindOfArgument(SyntaxNode node) 598public bool IsArgument([NotNullWhen(true)] SyntaxNode? node) 601public bool IsAttributeArgument([NotNullWhen(true)] SyntaxNode? node) 604public bool IsSimpleArgument([NotNullWhen(true)] SyntaxNode? node) 611public bool IsInConstantContext([NotNullWhen(true)] SyntaxNode? node) 614public bool IsInConstructor(SyntaxNode node) 617public bool IsUnsafeContext(SyntaxNode node) 620public bool IsAttributeNamedArgumentIdentifier([NotNullWhen(true)] SyntaxNode? node) 623public SyntaxNode? GetContainingTypeDeclaration(SyntaxNode root, int position) 627.GetAncestors<SyntaxNode>() 631public SyntaxNode? GetContainingVariableDeclaratorOfFieldDeclaration(SyntaxNode? node) 634public bool IsNameOfSubpattern([NotNullWhen(true)] SyntaxNode? node) 639public bool IsPropertyPatternClause(SyntaxNode node) 643[NotNullWhen(true)] SyntaxNode? node, [NotNullWhen(true)] out SyntaxNode? initializedInstance) 674public bool IsAnyInitializerExpression([NotNullWhen(true)] SyntaxNode? node, [NotNullWhen(true)] out SyntaxNode? creationExpression) 689public bool IsElementAccessExpression(SyntaxNode? node) 693public SyntaxNode? ConvertToSingleLine(SyntaxNode? node, bool useElasticTrivia = false) 696public SyntaxNode? GetContainingMemberDeclaration(SyntaxNode root, int position, bool useFullSpan = true) 699public SyntaxNode? GetContainingMethodDeclaration(SyntaxNode root, int position, bool useFullSpan = true) 702private static SyntaxNode? GetContainingMemberDeclaration<TMemberDeclarationSyntax>(SyntaxNode root, int position, bool useFullSpan = true) 715var node = root.FindToken(position).Parent; 733public bool IsMethodLevelMember([NotNullWhen(true)] SyntaxNode? node) 741public bool IsTopLevelNodeWithMembers([NotNullWhen(true)] SyntaxNode? node) 750public string GetDisplayName(SyntaxNode? node, DisplayNameOptions options, string? rootNamespace = null) 812private static string? GetName(SyntaxNode node, DisplayNameOptions options) 899public PooledObject<List<SyntaxNode>> GetTopLevelAndMethodLevelMembers(SyntaxNode? root) 909public PooledObject<List<SyntaxNode>> GetMethodLevelMembers(SyntaxNode? root) 919public SyntaxList<SyntaxNode> GetMembersOfTypeDeclaration(SyntaxNode typeDeclaration) 922private void AppendMembers(SyntaxNode? node, List<SyntaxNode> list, bool topLevel, bool methodLevel) 946public TextSpan GetMemberBodySpanForSpeculativeBinding(SyntaxNode node) 953var member = GetContainingMemberDeclaration(node, node.SpanStart); 973public bool ContainsInMemberBody([NotNullWhen(true)] SyntaxNode? node, TextSpan span) 996public SyntaxNode? TryGetBindableParent(SyntaxToken token) 998var node = token.Parent; 1001var parent = node.Parent; 1070public IEnumerable<SyntaxNode> GetConstructors(SyntaxNode? root, CancellationToken cancellationToken) 1075var constructors = new List<SyntaxNode>(); 1080private static void AppendConstructors(SyntaxList<MemberDeclarationSyntax> members, List<SyntaxNode> constructors, CancellationToken cancellationToken) 1144public string GetNameForArgument(SyntaxNode? argument) 1147public string GetNameForAttributeArgument(SyntaxNode? argument) 1150public bool IsLeftSideOfDot([NotNullWhen(true)] SyntaxNode? node) 1153public SyntaxNode? GetRightSideOfDot(SyntaxNode? node) 1159public SyntaxNode? GetLeftSideOfDot(SyntaxNode? node, bool allowImplicitTarget) 1165public bool IsLeftSideOfExplicitInterfaceSpecifier([NotNullWhen(true)] SyntaxNode? node) 1168public bool IsLeftSideOfAssignment([NotNullWhen(true)] SyntaxNode? node) 1171public bool IsLeftSideOfAnyAssignment([NotNullWhen(true)] SyntaxNode? node) 1174public bool IsLeftSideOfCompoundAssignment([NotNullWhen(true)] SyntaxNode? node) 1177public SyntaxNode GetRightHandSideOfAssignment(SyntaxNode node) 1180public bool IsInferredAnonymousObjectMemberDeclarator([NotNullWhen(true)] SyntaxNode? node) 1184public bool IsOperandOfIncrementExpression([NotNullWhen(true)] SyntaxNode? node) 1187public static bool IsOperandOfDecrementExpression([NotNullWhen(true)] SyntaxNode? node) 1190public bool IsOperandOfIncrementOrDecrementExpression([NotNullWhen(true)] SyntaxNode? node) 1193public SyntaxList<SyntaxNode> GetContentsOfInterpolatedString(SyntaxNode interpolatedString) 1202public SeparatedSyntaxList<SyntaxNode> GetArgumentsOfObjectCreationExpression(SyntaxNode objectCreationExpression) 1207public SeparatedSyntaxList<SyntaxNode> GetArgumentsOfArgumentList(SyntaxNode argumentList) 1210public SeparatedSyntaxList<SyntaxNode> GetArgumentsOfAttributeArgumentList(SyntaxNode argumentList) 1222public bool IsPragmaDirective(SyntaxTrivia trivia, out bool isDisable, out bool isActive, out SeparatedSyntaxList<SyntaxNode> errorCodes) 1228public bool IsDocumentationComment(SyntaxNode node) 1231public bool IsUsingOrExternOrImport([NotNullWhen(true)] SyntaxNode? node) 1234public bool IsGlobalAssemblyAttribute([NotNullWhen(true)] SyntaxNode? node) 1237public bool IsGlobalModuleAttribute([NotNullWhen(true)] SyntaxNode? node) 1240private static bool IsGlobalAttribute([NotNullWhen(true)] SyntaxNode? node, SyntaxKind attributeTarget) 1245public bool IsDeclaration(SyntaxNode? node) 1294public bool IsTypeDeclaration(SyntaxNode node) 1297public bool IsSimpleAssignmentStatement([NotNullWhen(true)] SyntaxNode? statement) 1302SyntaxNode statement, out SyntaxNode left, out SyntaxToken operatorToken, out SyntaxNode right) 1309SyntaxNode statement, out SyntaxNode left, out SyntaxToken operatorToken, out SyntaxNode right) 1311var expression = statement; 1324public bool IsAnyAssignmentStatement([NotNullWhen(true)] SyntaxNode? node) 1327public SyntaxToken GetIdentifierOfSimpleName(SyntaxNode node) 1330public SyntaxToken GetIdentifierOfVariableDeclarator(SyntaxNode node) 1333public SyntaxToken GetIdentifierOfTypeDeclaration(SyntaxNode node) 1341public bool IsDeclaratorOfLocalDeclarationStatement(SyntaxNode declarator, SyntaxNode localDeclarationStatement) 1348public bool AreEquivalent(SyntaxNode? node1, SyntaxNode? node2) 1351public static SyntaxNode GetExpressionOfInvocationExpression(SyntaxNode node) 1354public bool IsExpressionOfForeach([NotNullWhen(true)] SyntaxNode? node) 1357public SyntaxNode GetExpressionOfExpressionStatement(SyntaxNode node) 1360public void GetPartsOfTupleExpression<TArgumentSyntax>(SyntaxNode node, 1361out SyntaxToken openParen, out SeparatedSyntaxList<TArgumentSyntax> arguments, out SyntaxToken closeParen) where TArgumentSyntax : SyntaxNode 1365arguments = (SeparatedSyntaxList<TArgumentSyntax>)(SeparatedSyntaxList<SyntaxNode>)tupleExpression.Arguments; 1375public SyntaxTokenList GetModifiers(SyntaxNode? node) 1379public SyntaxNode? WithModifiers(SyntaxNode? node, SyntaxTokenList modifiers) 1382public SeparatedSyntaxList<SyntaxNode> GetVariablesOfLocalDeclarationStatement(SyntaxNode node) 1385public SyntaxNode? GetInitializerOfVariableDeclarator(SyntaxNode node) 1388public SyntaxNode? GetInitializerOfPropertyDeclaration(SyntaxNode node) 1391public SyntaxNode GetTypeOfVariableDeclarator(SyntaxNode node) 1394public SyntaxNode GetValueOfEqualsValueClause(SyntaxNode node) 1397public bool IsEqualsValueOfPropertyDeclaration(SyntaxNode? node) 1400public bool IsConversionExpression([NotNullWhen(true)] SyntaxNode? node) 1403public bool IsCastExpression([NotNullWhen(true)] SyntaxNode? node) 1406public void GetPartsOfCastExpression(SyntaxNode node, out SyntaxNode type, out SyntaxNode expression) 1423public SyntaxList<SyntaxNode> GetAttributeLists(SyntaxNode? node) 1426public bool IsParameterNameXmlElementSyntax([NotNullWhen(true)] SyntaxNode? node) 1430public SyntaxList<SyntaxNode> GetContentFromDocumentationCommentTriviaSyntax(SyntaxTrivia trivia) 1440public void GetPartsOfAnyIsTypeExpression(SyntaxNode node, out SyntaxNode expression, out SyntaxNode type) 1447public void GetPartsOfIsPatternExpression(SyntaxNode node, out SyntaxNode left, out SyntaxToken isToken, out SyntaxNode right) 1455public bool IsAnyPattern([NotNullWhen(true)] SyntaxNode? node) 1458public SyntaxNode GetExpressionOfConstantPattern(SyntaxNode node) 1461public void GetPartsOfDeclarationPattern(SyntaxNode node, out SyntaxNode type, out SyntaxNode designation) 1468public void GetPartsOfRecursivePattern(SyntaxNode node, out SyntaxNode? type, out SyntaxNode? positionalPart, out SyntaxNode? propertyPart, out SyntaxNode? designation) 1484public bool IsBinaryPattern([NotNullWhen(true)] SyntaxNode? node) 1487public bool IsUnaryPattern([NotNullWhen(true)] SyntaxNode? node) 1490public void GetPartsOfParenthesizedPattern(SyntaxNode node, out SyntaxToken openParen, out SyntaxNode pattern, out SyntaxToken closeParen) 1498public void GetPartsOfBinaryPattern(SyntaxNode node, out SyntaxNode left, out SyntaxToken operatorToken, out SyntaxNode right) 1506public void GetPartsOfUnaryPattern(SyntaxNode node, out SyntaxToken operatorToken, out SyntaxNode pattern) 1513public void GetPartsOfRelationalPattern(SyntaxNode node, out SyntaxToken operatorToken, out SyntaxNode expression) 1520public SyntaxNode GetTypeOfTypePattern(SyntaxNode node) 1523public bool IsVerbatimInterpolatedStringExpression([NotNullWhen(true)] SyntaxNode? node) 1538public bool IsAnonymousFunctionExpression([NotNullWhen(true)] SyntaxNode? node) 1541public bool IsBaseNamespaceDeclaration([NotNullWhen(true)] SyntaxNode? node) 1544public bool IsBinaryExpression([NotNullWhen(true)] SyntaxNode? node) 1547public bool IsLiteralExpression([NotNullWhen(true)] SyntaxNode? node) 1550public bool IsMemberAccessExpression([NotNullWhen(true)] SyntaxNode? node) 1553public bool IsMethodDeclaration([NotNullWhen(true)] SyntaxNode? node) 1556public bool IsSimpleName([NotNullWhen(true)] SyntaxNode? node) 1559public bool IsAnyName([NotNullWhen(true)] SyntaxNode? node) 1562public bool IsAnyType([NotNullWhen(true)] SyntaxNode? node) 1565public bool IsNamedMemberInitializer([NotNullWhen(true)] SyntaxNode? node) 1568public bool IsElementAccessInitializer([NotNullWhen(true)] SyntaxNode? node) 1571public bool IsObjectMemberInitializer([NotNullWhen(true)] SyntaxNode? node) 1574public bool IsObjectCollectionInitializer([NotNullWhen(true)] SyntaxNode? node) 1581public void GetPartsOfArgumentList(SyntaxNode node, out SyntaxToken openParenToken, out SeparatedSyntaxList<SyntaxNode> arguments, out SyntaxToken closeParenToken) 1589public void GetPartsOfAttribute(SyntaxNode node, out SyntaxNode name, out SyntaxNode? argumentList) 1596public void GetPartsOfBaseObjectCreationExpression(SyntaxNode node, out SyntaxNode? argumentList, out SyntaxNode? initializer) 1603public void GetPartsOfBinaryExpression(SyntaxNode node, out SyntaxNode left, out SyntaxToken operatorToken, out SyntaxNode right) 1611public void GetPartsOfCompilationUnit(SyntaxNode node, out SyntaxList<SyntaxNode> imports, out SyntaxList<SyntaxNode> attributeLists, out SyntaxList<SyntaxNode> members) 1620SyntaxNode node, out SyntaxNode expression, out SyntaxToken operatorToken, out SyntaxNode whenNotNull) 1628public void GetPartsOfConditionalExpression(SyntaxNode node, out SyntaxNode condition, out SyntaxNode whenTrue, out SyntaxNode whenFalse) 1636public SyntaxNode GetExpressionOfForeachStatement(SyntaxNode statement) 1642public void GetPartsOfGenericName(SyntaxNode node, out SyntaxToken identifier, out SeparatedSyntaxList<SyntaxNode> typeArguments) 1649public void GetPartsOfInterpolationExpression(SyntaxNode node, 1650out SyntaxToken stringStartToken, out SyntaxList<SyntaxNode> contents, out SyntaxToken stringEndToken) 1658public void GetPartsOfInvocationExpression(SyntaxNode node, out SyntaxNode expression, out SyntaxNode? argumentList) 1665public void GetPartsOfMemberAccessExpression(SyntaxNode node, out SyntaxNode expression, out SyntaxToken operatorToken, out SyntaxNode name) 1673public void GetPartsOfBaseNamespaceDeclaration(SyntaxNode node, out SyntaxNode name, out SyntaxList<SyntaxNode> imports, out SyntaxList<SyntaxNode> members) 1681public void GetPartsOfNamedMemberInitializer(SyntaxNode node, out SyntaxNode identifier, out SyntaxNode expression) 1688public void GetPartsOfObjectCreationExpression(SyntaxNode node, out SyntaxToken keyword, out SyntaxNode type, out SyntaxNode? argumentList, out SyntaxNode? initializer) 1697public void GetPartsOfImplicitObjectCreationExpression(SyntaxNode node, out SyntaxToken keyword, out SyntaxNode argumentList, out SyntaxNode? initializer) 1705public void GetPartsOfParameter(SyntaxNode node, out SyntaxToken identifier, out SyntaxNode? @default) 1713SyntaxNode node, out SyntaxToken openParen, out SyntaxNode expression, out SyntaxToken closeParen) 1721public void GetPartsOfPrefixUnaryExpression(SyntaxNode node, out SyntaxToken operatorToken, out SyntaxNode operand) 1728public void GetPartsOfQualifiedName(SyntaxNode node, out SyntaxNode left, out SyntaxToken operatorToken, out SyntaxNode right) 1740public SyntaxNode GetArgumentListOfImplicitElementAccess(SyntaxNode node) 1743public SeparatedSyntaxList<SyntaxNode> GetAttributesOfAttributeList(SyntaxNode node) 1746public SyntaxNode GetExpressionOfAwaitExpression(SyntaxNode node) 1749public SyntaxNode GetExpressionOfThrowExpression(SyntaxNode node) 1752public SyntaxNode? GetExpressionOfThrowStatement(SyntaxNode node) 1755public SeparatedSyntaxList<SyntaxNode> GetInitializersOfObjectMemberInitializer(SyntaxNode node) 1758public SeparatedSyntaxList<SyntaxNode> GetExpressionsOfObjectCollectionInitializer(SyntaxNode node) 1761public SyntaxToken GetTokenOfLiteralExpression(SyntaxNode node)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (5)
958private static bool IsExplicitCast(SyntaxNode node) 1097for (SyntaxNode? current = expression; current != null; current = current.Parent) 1112for (SyntaxNode? currentOld = castNode.WalkUpParentheses().Parent, currentNew = rewrittenExpression.WalkUpParentheses().Parent; 1168for (SyntaxNode? currentOld = castNode.WalkUpParentheses().Parent, currentNew = rewrittenExpression.WalkUpParentheses().Parent; 1198for (SyntaxNode? currentOld = castNode.WalkUpParentheses().Parent, currentNew = rewrittenExpression.WalkUpParentheses().Parent;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\FormattingRangeHelper.cs (13)
90var parent = endToken.Parent; 114var parent = endToken.Parent; 150var container = GetTopContainingNode(parent); 171var parent = endToken.Parent; 187var containerOfList = parent.Parent; 203var parentOfParent = parent.Parent; 231var containerOfBlock = GetTopContainingNode(parent); 271var parent = endToken.Parent; 339var labelNode = previousToken.Parent.Parent; 354private static bool IsSpecialContainingNode(SyntaxNode node) 380private static SyntaxNode? GetTopContainingNode([DisallowNull] SyntaxNode? node) 390var lastSpecialContainingNode = node;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (19)
71protected override SyntaxNode GetSemanticRootForSpeculation(ExpressionSyntax expression) 75SyntaxNode previousNode = null; 76SyntaxNode parentNodeToSpeculate = null; 77foreach (var node in expression.AncestorsAndSelf(ascendOutOfTrivia: false)) 95public static bool CanSpeculateOnNode(SyntaxNode node) 104protected override void ValidateSpeculativeSemanticModel(SemanticModel speculativeSemanticModel, SyntaxNode nodeToSpeculate) 113protected override SemanticModel CreateSpeculativeSemanticModel(SyntaxNode originalNode, SyntaxNode nodeToSpeculate, SemanticModel semanticModel) 116public static SemanticModel CreateSpeculativeSemanticModelForNode(SyntaxNode originalNode, SyntaxNode nodeToSpeculate, SemanticModel semanticModel) 123public static SemanticModel CreateSpeculativeSemanticModelForNode(SyntaxNode nodeToSpeculate, SemanticModel semanticModel, int position, bool isInNamespaceOrTypeContext) 196SyntaxNode originalLambdaBody, replacedLambdaBody; 275SyntaxNode originalRoot) 295protected override bool ReplacementChangesSemanticsForNodeLanguageSpecific(SyntaxNode currentOriginalNode, SyntaxNode currentReplacedNode, SyntaxNode previousOriginalNode, SyntaxNode previousReplacedNode) 580protected override bool ExpressionMightReferenceMember(SyntaxNode node) 662protected override bool IsParenthesizedExpression(SyntaxNode node)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpTypeStyleHelper.cs (2)
62if (typeName?.FirstAncestorOrSelf<SyntaxNode>(a => a.Kind() is SyntaxKind.DeclarationExpression or SyntaxKind.VariableDeclaration or SyntaxKind.ForEachStatement) is not { } declaration) 82internal TypeSyntax? FindAnalyzableType(SyntaxNode node, SemanticModel semanticModel, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpTypeStyleHelper.State.cs (4)
31SyntaxNode declaration, SemanticModel semanticModel, 92private static bool IsPredefinedTypeInDeclaration(SyntaxNode declarationStatement, SemanticModel semanticModel) 131private static bool IsInferredPredefinedType(SyntaxNode declarationStatement, SemanticModel semanticModel) 140private static TypeSyntax? GetTypeSyntaxFromDeclaration(SyntaxNode declarationStatement)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (3)
191var root = tree.GetRoot(cancellationToken); 197var newRoot = root.ReplaceNode( 204var newDeclarationTypeNode = newTree.GetRoot(cancellationToken).GetAnnotatedNodes(annotation).Single();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\UsingsAndExternAliasesDirectiveComparer.cs (5)
12internal class UsingsAndExternAliasesDirectiveComparer : IComparer<SyntaxNode?> 14public static readonly IComparer<SyntaxNode> NormalInstance = new UsingsAndExternAliasesDirectiveComparer( 18public static readonly IComparer<SyntaxNode> SystemFirstInstance = new UsingsAndExternAliasesDirectiveComparer( 79public int Compare(SyntaxNode? directive1, SyntaxNode? directive2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\UsingsAndExternAliasesOrganizer.cs (6)
108var initialList = usingList.Cast<SyntaxNode>() 150private static void EnsureNewLines(IList<SyntaxNode> list, SyntaxTrivia newLineTrivia) 156var node = list[i]; 169var node = list[i]; 176private static SyntaxNode TrimLeadingNewLines(SyntaxNode node)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (570)
src\Analyzers\CSharp\CodeFixes\AddAccessibilityModifiers\CSharpAddAccessibilityModifiersCodeFixProvider.cs (2)
18protected override SyntaxNode MapToDeclarator(SyntaxNode node)
src\Analyzers\CSharp\CodeFixes\AddBraces\CSharpAddBracesCodeFixProvider.cs (2)
35var root = editor.OriginalRoot; 38var statement = root.FindNode(diagnostic.Location.SourceSpan, getInnermostNodeForTie: true);
src\Analyzers\CSharp\CodeFixes\AddExplicitCast\ArgumentFixer.cs (2)
15private sealed class ArgumentFixer : Fixer<ArgumentSyntax, ArgumentListSyntax, SyntaxNode> 31var newInvocation = newArgumentList.Parent!;
src\Analyzers\CSharp\CodeFixes\AddExplicitCast\CSharpAddExplicitCastCodeFixProvider.cs (5)
40protected override void GetPartsOfCastOrConversionExpression(ExpressionSyntax expression, out SyntaxNode type, out ExpressionSyntax castedExpression) 53SyntaxNode root, 72&& argumentList.Parent is SyntaxNode invocationNode) 89protected override (SyntaxNode finalTarget, SyntaxNode finalReplacement) Cast(
src\Analyzers\CSharp\CodeFixes\AddInheritdoc\AddInheritdocCodeFixProvider.cs (3)
40var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 49var node = root.FindNode(diagnostic.Location.SourceSpan); 85var node = editor.OriginalRoot.FindNode(diagnostic.Location.SourceSpan);
src\Analyzers\CSharp\CodeFixes\AddParameter\CSharpAddParameterCodeFixProvider.cs (2)
46protected override ITypeSymbol GetArgumentType(SyntaxNode argumentNode, SemanticModel semanticModel, CancellationToken cancellationToken) 51SyntaxNode node,
src\Analyzers\CSharp\CodeFixes\AssignOutParameters\AbstractAssignOutParametersCodeFixProvider.cs (20)
47protected abstract void TryRegisterFix(CodeFixContext context, Document document, SyntaxNode container, SyntaxNode location); 49private static (SyntaxNode container, SyntaxNode exprOrStatement) GetContainer(SyntaxNode root, TextSpan span) 51var location = root.FindNode(span); 54var container = GetContainer(location); 64private static bool IsValidLocation(SyntaxNode location) 81private static SyntaxNode? GetContainer(SyntaxNode node) 83for (var current = node; current != null; current = current.Parent) 95private static async Task<MultiDictionary<SyntaxNode, (SyntaxNode exprOrStatement, ImmutableArray<IParameterSymbol>)>> GetUnassignedParametersAsync( 105var result = new MultiDictionary<SyntaxNode, (SyntaxNode exprOrStatement, ImmutableArray<IParameterSymbol>)>(); 150SyntaxEditor editor, SyntaxNode container, 151MultiDictionary<SyntaxNode, (SyntaxNode exprOrStatement, ImmutableArray<IParameterSymbol> unassignedParameters)>.ValueSet values, 154protected static ImmutableArray<SyntaxNode> GenerateAssignmentStatements( 157var result = ArrayBuilder<SyntaxNode>.GetInstance();
src\Analyzers\CSharp\CodeFixes\AssignOutParameters\AssignOutParametersAboveReturnCodeFixProvider.cs (7)
26protected override void TryRegisterFix(CodeFixContext context, Document document, SyntaxNode container, SyntaxNode location) 32SyntaxEditor editor, SyntaxNode container, 33MultiDictionary<SyntaxNode, (SyntaxNode exprOrStatement, ImmutableArray<IParameterSymbol> unassignedParameters)>.ValueSet values, 44SyntaxEditor editor, SyntaxNode exprOrStatement, ImmutableArray<SyntaxNode> statements)
src\Analyzers\CSharp\CodeFixes\AssignOutParameters\AssignOutParametersAtStartCodeFixProvider.cs (6)
24protected override void TryRegisterFix(CodeFixContext context, Document document, SyntaxNode container, SyntaxNode location) 56SyntaxEditor editor, SyntaxNode container, 57MultiDictionary<SyntaxNode, (SyntaxNode exprOrStatement, ImmutableArray<IParameterSymbol> unassignedParameters)>.ValueSet values, 71var updatedContainer = generator.WithStatements(container, finalStatements);
src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceTransform.cs (6)
81private static (SyntaxNode root, TextSpan semicolonSpan) ReplaceWithFileScopedNamespace( 119(SyntaxNode stringNode, int closeTerminatorIndentationLength) lastRawStringLiteralData = default; 135SyntaxNode stringNode; 214SyntaxTree tree, SyntaxNode root, string indentation, TextLine textLine, CancellationToken cancellationToken) 245var updatedRoot = ReplaceWithBlockScopedNamespace(parsedDocument, fileScopedNamespace, options.NewLine, options.NewLines, annotation); 259private static SyntaxNode ReplaceWithBlockScopedNamespace(
src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs (1)
298public override ExpressionSyntax DefaultVisit(SyntaxNode node)
src\Analyzers\CSharp\CodeFixes\ConvertToAsync\CSharpConvertToAsyncMethodCodeFixProvider.cs (5)
32SyntaxNode node, 43protected override async Task<Tuple<SyntaxTree, SyntaxNode>?> GetRootInOtherSyntaxTreeAsync( 44SyntaxNode node, 61SyntaxNode node, 65var invocationExpression = node.ChildNodes().FirstOrDefault(n => n.IsKind(SyntaxKind.InvocationExpression));
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (1)
693private static SyntaxTriviaList? GetExteriorTrivia(SyntaxNode declaration)
src\Analyzers\CSharp\CodeFixes\ConvertTypeOfToNameOf\CSharpConvertTypeOfToNameOfCodeFixProvider.cs (1)
26protected override SyntaxNode GetSymbolTypeExpression(SemanticModel model, MemberAccessExpressionSyntax node, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\DocumentationComments\CSharpAddDocCommentNodesCodeFixProvider.cs (2)
40protected override SyntaxNode? TryGetDocCommentNode(SyntaxTriviaList leadingTrivia) 46var nodeStructure = node.GetStructure()!;
src\Analyzers\CSharp\CodeFixes\FixIncorrectConstraint\CSharpFixIncorrectConstraintCodeFixProvider.cs (1)
88var newType = generator.TypeExpression(compilation.GetSpecialType(
src\Analyzers\CSharp\CodeFixes\FixReturnType\CSharpFixReturnTypeCodeFixProvider.cs (2)
135private static (TypeSyntax type, bool isAsync) TryGetDeclarationTypeToFix(SyntaxNode node) 139static (TypeSyntax type, bool isAsync) TryGetReturnTypeToFix(SyntaxNode containingMember)
src\Analyzers\CSharp\CodeFixes\GenerateConstructor\CSharpGenerateConstructorService.cs (7)
34protected override bool IsSimpleNameGeneration(SemanticDocument document, SyntaxNode node, CancellationToken cancellationToken) 37protected override bool IsConstructorInitializerGeneration(SemanticDocument document, SyntaxNode node, CancellationToken cancellationToken) 40protected override bool IsImplicitObjectCreation(SemanticDocument document, SyntaxNode node, CancellationToken cancellationToken) 45SyntaxNode node, 83SyntaxNode node, 115SyntaxNode node, 150SyntaxNode node,
src\Analyzers\CSharp\CodeFixes\GenerateConstructor\GenerateConstructorCodeFixProvider.cs (4)
44Document document, SyntaxNode node, CancellationToken cancellationToken) 50protected override bool IsCandidate(SyntaxNode node, SyntaxToken token, Diagnostic diagnostic) 57protected override SyntaxNode GetTargetNode(SyntaxNode node)
src\Analyzers\CSharp\CodeFixes\GenerateDefaultConstructors\CSharpGenerateDefaultConstructorsCodeFixProvider.cs (1)
28protected override SyntaxToken? TryGetTypeName(SyntaxNode typeDeclaration)
src\Analyzers\CSharp\CodeFixes\GenerateEnumMember\CSharpGenerateEnumMemberService.cs (1)
22protected override bool IsIdentifierNameGeneration(SyntaxNode node)
src\Analyzers\CSharp\CodeFixes\GenerateEnumMember\GenerateEnumMemberCodeFixProvider.cs (2)
32protected override Task<ImmutableArray<CodeAction>> GetCodeActionsAsync(Document document, SyntaxNode node, CancellationToken cancellationToken) 38protected override bool IsCandidate(SyntaxNode node, SyntaxToken token, Diagnostic diagnostic)
src\Analyzers\CSharp\CodeFixes\GenerateMethod\GenerateConversionCodeFixProvider.cs (4)
35protected override bool IsCandidate(SyntaxNode node, SyntaxToken token, Diagnostic diagnostic) 47protected override SyntaxNode? GetTargetNode(SyntaxNode node) 59Document document, SyntaxNode node, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\GenerateMethod\GenerateDeconstructMethodCodeFixProvider.cs (3)
51var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 55var deconstruction = token.GetAncestors<SyntaxNode>() 68SyntaxNode target;
src\Analyzers\CSharp\CodeFixes\GenerateMethod\GenerateMethodCodeFixProvider.cs (4)
54protected override bool IsCandidate(SyntaxNode node, SyntaxToken token, Diagnostic diagnostic) 66protected override SyntaxNode? GetTargetNode(SyntaxNode node) 82Document document, SyntaxNode node, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateConversionService.cs (6)
28protected override bool IsImplicitConversionGeneration(SyntaxNode node) 36protected override bool IsExplicitConversionGeneration(SyntaxNode node) 56SyntaxNode expression, 82SyntaxNode expression, 108SyntaxNode expression, 167SyntaxNode expression,
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateDeconstructMethodService.cs (1)
40public override ImmutableArray<IParameterSymbol> TryMakeParameters(SemanticModel semanticModel, SyntaxNode target, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateMethodService.cs (3)
29protected override bool IsExplicitInterfaceGeneration(SyntaxNode node) 32protected override bool IsSimpleNameGeneration(SyntaxNode node) 49SyntaxNode node,
src\Analyzers\CSharp\CodeFixes\GenerateVariable\CSharpGenerateVariableCodeFixProvider.cs (5)
40protected override bool IsCandidate(SyntaxNode node, SyntaxToken token, Diagnostic diagnostic) 43protected override SyntaxNode GetTargetNode(SyntaxNode node) 47var nameNode = node.ChildNodes().FirstOrDefault(n => n.IsKind(SyntaxKind.IdentifierName)); 58Document document, SyntaxNode node, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\HideBase\HideBaseCodeFixProvider.AddNewKeywordAction.cs (5)
23private sealed class AddNewKeywordAction(Document document, SyntaxNode node) : CodeAction 26private readonly SyntaxNode _node = node; 35var newNode = GetNewNode(_node, configOptions.GetOption(CSharpCodeStyleOptions.PreferredModifierOrder).Value); 41private static SyntaxNode GetNewNode(SyntaxNode node, string preferredModifierOrder)
src\Analyzers\CSharp\CodeFixes\HideBase\HideBaseCodeFixProvider.cs (1)
39(SyntaxNode?)token.GetAncestor<FieldDeclarationSyntax>();
src\Analyzers\CSharp\CodeFixes\ImplementInterface\CSharpImplementInterfaceService.cs (5)
42Document document, SemanticModel model, SyntaxNode node, CancellationToken cancellationToken, 43out SyntaxNode classOrStructDecl, out INamedTypeSymbol classOrStructType, out ImmutableArray<INamedTypeSymbol> interfaceTypes) 85protected override SyntaxNode AddCommentInsideIfStatement(SyntaxNode ifStatement, SyntaxTriviaList trivia) 92protected override SyntaxNode CreateFinalizer(
src\Analyzers\CSharp\CodeFixes\InlineDeclaration\CSharpInlineDeclarationCodeFixProvider.cs (12)
62var originalRoot = editor.OriginalRoot; 69static t => (t.invocationOrCreation, ImmutableArray.Create<SyntaxNode>(t.identifier, t.declarator)), 78private static (VariableDeclaratorSyntax declarator, IdentifierNameSyntax identifier, SyntaxNode invocationOrCreation) FindDiagnosticNodes( 94private static SyntaxNode ReplaceIdentifierWithInlineDeclaration( 97SyntaxNode currentRoot, VariableDeclaratorSyntax declarator, 98IdentifierNameSyntax identifier, SyntaxNode currentNode, 118var block = CSharpInlineDeclarationDiagnosticAnalyzer.GetEnclosingPseudoBlock(localDeclarationStatement.Parent); 240private static ImmutableArray<StatementSyntax> GetStatements(SyntaxNode pseudoBlock) 338SyntaxNode nodeToReplace, 387private static SyntaxNode GetTopmostContainer(SyntaxNode expression) 398int position, SyntaxNode topmostContainer,
src\Analyzers\CSharp\CodeFixes\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessCodeFixProvider.cs (3)
76var root = editor.OriginalRoot; 119var root = editor.OriginalRoot; 156private static T AppendTriviaWithoutEndOfLines<T>(T newStatement, IfStatementSyntax ifStatement) where T : SyntaxNode
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpAddYieldCodeFixProvider.cs (6)
44protected override async Task<CodeAction?> GetCodeFixAsync(SyntaxNode root, SyntaxNode node, Document document, Diagnostic diagnostics, CancellationToken cancellationToken) 102SyntaxNode node, SemanticModel model, CancellationToken cancellationToken, 210SyntaxNode root, TextSpan span, [NotNullWhen(true)] out SyntaxNode? node) 213var ancestors = root.FindToken(span.Start).GetAncestors<SyntaxNode>();
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpChangeToIEnumerableCodeFixProvider.cs (2)
35protected override async Task<CodeAction?> GetCodeFixAsync(SyntaxNode root, SyntaxNode node, Document document, Diagnostic diagnostics, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\MakeFieldReadonly\CSharpMakeFieldReadonlyCodeFixProvider.cs (1)
20protected override SyntaxNode? GetInitializerNode(VariableDeclaratorSyntax declaration)
src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeFixHelper.cs (3)
151var localFunctionBodyOperation = semanticModel.GetOperation(localFunction.Body ?? (SyntaxNode)localFunction.ExpressionBody!.Expression, cancellationToken); 200public static SyntaxNode AddStaticModifier(SyntaxNode localFunction, SyntaxGenerator generator)
src\Analyzers\CSharp\CodeFixes\MakeMemberRequired\CSharpMakeMemberRequiredCodeFixProvider.cs (2)
109var root = editor.OriginalRoot; 115var memberDeclarator = root.FindNode(diagnostic.Location.SourceSpan);
src\Analyzers\CSharp\CodeFixes\MakeMemberStatic\CSharpMakeMemberStaticCodeFixProvider.cs (2)
23protected override bool TryGetMemberDeclaration(SyntaxNode node, [NotNullWhen(true)] out SyntaxNode? memberDeclaration)
src\Analyzers\CSharp\CodeFixes\MakeMethodAsynchronous\CSharpMakeMethodAsynchronousCodeFixProvider.cs (4)
47var root = diagnostic.Location.SourceTree.GetRoot(cancellationToken); 62protected override bool IsAsyncSupportingFunctionSyntax(SyntaxNode node) 69protected override SyntaxNode AddAsyncTokenAndFixReturnType( 72SyntaxNode node,
src\Analyzers\CSharp\CodeFixes\MakeMethodSynchronous\CSharpMakeMethodSynchronousCodeFixProvider.cs (5)
29protected override bool IsAsyncSupportingFunctionSyntax(SyntaxNode node) 32protected override SyntaxNode RemoveAsyncTokenAndFixReturnType(IMethodSymbol methodSymbol, SyntaxNode node, KnownTaskTypes knownTypes) 44private static SyntaxNode FixMethod(IMethodSymbol methodSymbol, MethodDeclarationSyntax method, KnownTaskTypes knownTypes) 50private static SyntaxNode FixLocalFunction(IMethodSymbol methodSymbol, LocalFunctionStatementSyntax localFunction, KnownTaskTypes knownTypes)
src\Analyzers\CSharp\CodeFixes\MakeRefStruct\MakeRefStructCodeFixProvider.cs (1)
71var newStruct = generator.WithModifiers(
src\Analyzers\CSharp\CodeFixes\MakeStatementAsynchronous\CSharpMakeStatementAsynchronousCodeFixProvider.cs (4)
64private static void MakeStatementAsynchronous(SyntaxEditor editor, SyntaxNode statementToFix) 66SyntaxNode newStatement; 96private static SyntaxNode? TryGetStatementToFix(SyntaxNode node)
src\Analyzers\CSharp\CodeFixes\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyCodeFixProvider.cs (1)
101TNode UpdateReadOnlyModifier<TNode>(TNode node, bool add) where TNode : SyntaxNode
src\Analyzers\CSharp\CodeFixes\MakeTypeAbstract\CSharpMakeTypeAbstractCodeFixProvider.cs (1)
22protected override bool IsValidRefactoringContext(SyntaxNode? node, [NotNullWhen(true)] out TypeDeclarationSyntax? typeDeclaration)
src\Analyzers\CSharp\CodeFixes\MisplacedUsingDirectives\MisplacedUsingDirectivesCodeFixProvider.cs (5)
173usingDirective => (SyntaxNode)usingDirective, 185private static async Task<SyntaxNode> ExpandUsingDirectiveAsync(Document document, UsingDirectiveSyntax usingDirective, CancellationToken cancellationToken) 306private static SyntaxList<MemberDeclarationSyntax> GetMembers(SyntaxNode node) 314private static TSyntaxNode RemoveLeadingBlankLinesFromFirstMember<TSyntaxNode>(TSyntaxNode node) where TSyntaxNode : SyntaxNode 353private static TSyntaxNode EnsureLeadingBlankLineBeforeFirstMember<TSyntaxNode>(TSyntaxNode node) where TSyntaxNode : SyntaxNode
src\Analyzers\CSharp\CodeFixes\NewLines\ConsecutiveBracePlacement\ConsecutiveBracePlacementCodeFixProvider.cs (1)
62SyntaxNode root, SourceText text,
src\Analyzers\CSharp\CodeFixes\NewLines\EmbeddedStatementPlacement\EmbeddedStatementPlacementCodeFixProvider.cs (4)
69var root = editor.OriginalRoot; 70var node = root.FindNode(diagnostic.AdditionalLocations[0].SourceSpan); 128private static SyntaxNode AddLeadingTrivia(SyntaxNode node, SyntaxTrivia trivia)
src\Analyzers\CSharp\CodeFixes\Nullable\CSharpDeclareAsNullableCodeFixProvider.cs (7)
57private static string GetEquivalenceKey(SyntaxNode node) 100Document document, SemanticModel model, SyntaxEditor editor, SyntaxNode node, HashSet<TypeSyntax> alreadyHandled, CancellationToken cancellationToken) 112Document document, SemanticModel? model, SyntaxNode node, CancellationToken cancellationToken) 176var syntax = local.DeclaringSyntaxReferences[0].GetSyntax(cancellationToken); 187var syntax = field.DeclaringSyntaxReferences[0].GetSyntax(cancellationToken); 204var syntax = property.DeclaringSyntaxReferences[0].GetSyntax(cancellationToken); 315private static bool IsExpressionSupported(SyntaxNode node)
src\Analyzers\CSharp\CodeFixes\RemoveAsyncModifier\CSharpRemoveAsyncModifierCodeFixProvider.cs (7)
30protected override bool IsAsyncSupportingFunctionSyntax(SyntaxNode node) 33protected override SyntaxNode? ConvertToBlockBody(SyntaxNode node, ExpressionSyntax expressionBody) 51protected override SyntaxNode RemoveAsyncModifier(SyntaxGenerator generator, SyntaxNode methodLikeNode) 63private static SyntaxNode AnnotateBlock(SyntaxGenerator generator, SyntaxNode node)
src\Analyzers\CSharp\CodeFixes\RemoveAsyncModifier\RemoveAsyncModifierHelpers.cs (5)
12internal static SyntaxNode WithoutAsyncModifier(MethodDeclarationSyntax method, TypeSyntax returnType) 18internal static SyntaxNode WithoutAsyncModifier(LocalFunctionStatementSyntax localFunction, TypeSyntax returnType) 24internal static SyntaxNode WithoutAsyncModifier(ParenthesizedLambdaExpressionSyntax lambda) 27internal static SyntaxNode WithoutAsyncModifier(SimpleLambdaExpressionSyntax lambda) 30internal static SyntaxNode WithoutAsyncModifier(AnonymousMethodExpressionSyntax method)
src\Analyzers\CSharp\CodeFixes\RemoveUnnecessaryParentheses\CSharpRemoveUnnecessaryParenthesesCodeFixProvider.cs (2)
18: AbstractRemoveUnnecessaryParenthesesCodeFixProvider<SyntaxNode> 20protected override bool CanRemoveParentheses(SyntaxNode current, SemanticModel semanticModel, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\RemoveUnreachableCode\CSharpRemoveUnreachableCodeCodeFixProvider.cs (1)
80static void RemoveStatement(SyntaxEditor editor, SyntaxNode statement)
src\Analyzers\CSharp\CodeFixes\RemoveUnusedLocalFunction\CSharpRemoveUnusedLocalFunctionCodeFixProvider.cs (1)
44var root = editor.OriginalRoot;
src\Analyzers\CSharp\CodeFixes\RemoveUnusedMembers\CSharpRemoveUnusedMembersCodeFixProvider.cs (1)
26protected override void AdjustAndAddAppropriateDeclaratorsToRemove(HashSet<FieldDeclarationSyntax> fieldDeclarators, HashSet<SyntaxNode> declarators)
src\Analyzers\CSharp\CodeFixes\RemoveUnusedParametersAndValues\CSharpRemoveUnusedValuesCodeFixProvider.cs (15)
45protected override SyntaxNode? TryUpdateNameForFlaggedNode(SyntaxNode node, SyntaxToken newName) 92protected override SyntaxNode? TryUpdateParentOfUpdatedNode(SyntaxNode parent, SyntaxNode newNameNode, SyntaxEditor editor, ISyntaxFacts syntaxFacts, SemanticModel semanticModel) 142protected override SyntaxNode ComputeReplacementNode(SyntaxNode originalOldNode, SyntaxNode changedOldNode, SyntaxNode proposedReplacementNode) 184protected override SyntaxNode GetReplacementNodeForCompoundAssignment( 185SyntaxNode originalCompoundAssignment, 186SyntaxNode newAssignmentTarget, 242protected override SyntaxNode GetReplacementNodeForVarPattern(SyntaxNode originalVarPattern, SyntaxNode newNameNode)
src\Analyzers\CSharp\CodeFixes\ReplaceDefaultLiteral\CSharpReplaceDefaultLiteralCodeFixProvider.cs (6)
65Document document, TextSpan span, SyntaxNode newExpression, CancellationToken cancellationToken) 76private static (SyntaxNode newExpression, string displayText) GetReplacementExpressionAndText( 102var newLiteral = generator.LiteralExpression(constant.Value); 107var defaultExpression = generator.DefaultExpression(type); 114(SyntaxNode newExpression, string displayText) GenerateMemberAccess(string memberName) 116var memberAccess = generator.MemberAccessExpression(generator.TypeExpression(type), memberName);
src\Analyzers\CSharp\CodeFixes\UseCoalesceExpression\CSharpUseCoalesceExpressionForIfNullStatementCheckCodeFixProvider.cs (3)
23SemanticModel semanticModel, SyntaxNode expressionToCoalesce, 24SyntaxNode leftAssignmentPart, SyntaxNode rightAssignmentPart,
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (6)
46where TMatchNode : SyntaxNode 569SyntaxNode GetAnchorNode(SyntaxNode node) 591for (var current = node; current != null; current = current.Parent) 760foreach (var component in GetElementComponents(node)) 774static IEnumerable<SyntaxNode> GetElementComponents(TMatchNode node)
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForArrayCodeFixProvider.cs (2)
44var originalRoot = editor.OriginalRoot; 97static bool IsOnSingleLine(SourceText sourceText, SyntaxNode node)
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForBuilderCodeFixProvider.cs (3)
96static AnalysisResult TrackAnalysisResult(SyntaxNode root, AnalysisResult analysisResult) 100analysisResult.Matches.SelectAsArray(m => new CollectionMatch<SyntaxNode>(root.GetCurrentNode(m.Node)!, m.UseSpread)), 111using var _ = ArrayBuilder<SyntaxNode>.GetInstance(out var nodesToTrack);
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForEmptyCodeFixProvider.cs (2)
26: AbstractUseCollectionExpressionCodeFixProvider<SyntaxNode>( 37SyntaxNode diagnosticNode,
src\Analyzers\CSharp\CodeFixes\UseCollectionInitializer\CSharpUseCollectionInitializerCodeFixProvider.cs (4)
36protected override async Task<(SyntaxNode, SyntaxNode)> GetReplacementNodesAsync( 40ImmutableArray<CollectionMatch<SyntaxNode>> preMatches, 41ImmutableArray<CollectionMatch<SyntaxNode>> postMatches,
src\Analyzers\CSharp\CodeFixes\UseCollectionInitializer\CSharpUseCollectionInitializerCodeFixProvider_CollectionExpression.cs (2)
24ImmutableArray<CollectionMatch<SyntaxNode>> preMatches, 25ImmutableArray<CollectionMatch<SyntaxNode>> postMatches,
src\Analyzers\CSharp\CodeFixes\UseCollectionInitializer\CSharpUseCollectionInitializerCodeFixProvider_CollectionInitializer.cs (3)
27ImmutableArray<CollectionMatch<SyntaxNode>> matches) 39UseInitializerHelpers.AddExistingItems<CollectionMatch<SyntaxNode>, ExpressionSyntax>( 73where TNode : SyntaxNode
src\Analyzers\CSharp\CodeFixes\UseConditionalExpression\CSharpUseConditionalExpressionForReturnCodeFixProvider.cs (1)
44protected override SyntaxNode WrapIfStatementIfNecessary(IConditionalOperation operation)
src\Analyzers\CSharp\CodeFixes\UseConditionalExpression\MultiLineConditionalExpressionFormattingRule.cs (1)
49List<IndentBlockOperation> list, SyntaxNode node, in NextIndentBlockOperationAction nextOperation)
src\Analyzers\CSharp\CodeFixes\UseDeconstruction\CSharpUseDeconstructionCodeFixProvider.cs (3)
58private SyntaxNode UpdateRoot( 61SyntaxNode root, 62SyntaxNode node,
src\Analyzers\CSharp\CodeFixes\UseDefaultLiteral\CSharpUseDefaultLiteralCodeFixProvider.cs (1)
49var originalRoot = editor.OriginalRoot;
src\Analyzers\CSharp\CodeFixes\UseImplicitObjectCreation\CSharpUseImplicitObjectCreationCodeFixProvider.cs (2)
68private static SyntaxNode FixOne(SyntaxNode root, ObjectCreationExpressionSyntax objectCreation)
src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseExplicitTypeCodeFixProvider.cs (8)
44var root = editor.OriginalRoot; 48var node = root.FindNode(diagnostic.Location.SourceSpan, getInnermostNodeForTie: true); 55SyntaxNode node, CancellationToken cancellationToken) 57var declarationContext = node.Parent; 128private static async Task UpdateTypeSyntaxAsync(Document document, SyntaxEditor editor, TypeSyntax typeSyntax, SyntaxNode declarationSyntax, CancellationToken cancellationToken) 147SyntaxNode declarationSyntax, 207private static SyntaxNode GenerateTypeDeclaration(TypeSyntax typeSyntax, ITypeSymbol newTypeSymbol) 218private static ITypeSymbol GetConvertedType(SemanticModel semanticModel, SyntaxNode typeSyntax, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseImplicitTypeCodeFixProvider.cs (1)
36var root = editor.OriginalRoot;
src\Analyzers\CSharp\CodeFixes\UseIndexOrRangeOperator\CSharpUseRangeOperatorCodeFixProvider.cs (2)
62private static SyntaxNode UpdateInvocation( 63SemanticModel semanticModel, SyntaxNode currentRoot,
src\Analyzers\CSharp\CodeFixes\UseInferredMemberName\CSharpUseInferredMemberNameCodeFixProvider.cs (1)
18protected override void LanguageSpecificRemoveSuggestedNode(SyntaxEditor editor, SyntaxNode node)
src\Analyzers\CSharp\CodeFixes\UseIsNullCheck\CSharpUseIsNullCheckForReferenceEqualsCodeFixProvider.cs (5)
33private static SyntaxNode CreateEqualsNullCheck(ExpressionSyntax argument) 36private static SyntaxNode CreateIsNullCheck(ExpressionSyntax argument) 39private static SyntaxNode CreateIsNotNullCheck(ExpressionSyntax argument) 58protected override SyntaxNode CreateNullCheck(ExpressionSyntax argument, bool isUnconstrainedGeneric) 63protected override SyntaxNode CreateNotNullCheck(ExpressionSyntax argument)
src\Analyzers\CSharp\CodeFixes\UseIsNullCheck\CSharpUseNullCheckOverTypeCheckCodeFixProvider.cs (1)
45SyntaxNode replacement = node switch
src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (7)
62var nodesToTrack = new HashSet<SyntaxNode>(); 83var root = editor.OriginalRoot; 84var currentRoot = root.TrackNodes(nodesToTrack); 152private static SyntaxNode ReplaceAnonymousWithLocalFunction( 153SolutionServices services, SyntaxNode currentRoot, 175private static SyntaxNode ReplaceReferences( 176Document document, SyntaxNode currentRoot,
src\Analyzers\CSharp\CodeFixes\UseNullPropagation\CSharpUseNullPropagationCodeFixProvider.cs (2)
32protected override bool TryGetBlock(SyntaxNode? statement, [NotNullWhen(true)] out StatementSyntax? block) 47protected override SyntaxNode PostProcessElseIf(IfStatementSyntax ifStatement, StatementSyntax newWhenTrueStatement)
src\Analyzers\CSharp\CodeFixes\UseObjectInitializer\UseInitializerHelpers.cs (1)
41where TElementSyntax : SyntaxNode
src\Analyzers\CSharp\CodeFixes\UsePatternCombinators\CSharpUsePatternCombinatorsCodeFixProvider.cs (1)
80var expression = editor.OriginalRoot.FindNode(location.SourceSpan, getInnermostNodeForTie: true);
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpAsAndNullCheckCodeFixProvider.cs (3)
44using var _2 = PooledHashSet<SyntaxNode>.GetInstance(out var statementParentScopes); 98var rightSideOfComparison = comparison is BinaryExpressionSyntax binaryExpression 99? (SyntaxNode)binaryExpression.Right
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (5)
270SyntaxNode TryQualify( 285SyntaxNode CreateDottedName( 301Func<TListSyntax, IEnumerable<SyntaxNode>> getElements) 302where TListSyntax : SyntaxNode 332static string GetLeadingWhitespace(SyntaxNode node)
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider_DocComments.cs (3)
34private static SyntaxTrivia GetDocComment(SyntaxNode node) 69ImmutableDictionary<ISymbol, (MemberDeclarationSyntax memberNode, SyntaxNode nodeToRemove)> removedMembers) 167ImmutableDictionary<ISymbol, (MemberDeclarationSyntax memberNode, SyntaxNode nodeToRemove)> removedMembers,
src\Analyzers\CSharp\CodeFixes\UseSimpleUsingStatement\UseSimpleUsingStatementCodeFixProvider.cs (6)
55var root = editor.OriginalRoot; 65private static SyntaxNode RewriteBlock( 66SyntaxNode originalBlockLike, 67SyntaxNode currentBlockLike, 101private static SyntaxNode WithStatements( 102SyntaxNode currentBlockLike,
src\Analyzers\CSharp\CodeFixes\UseSystemThreadingLock\CSharpUseSystemThreadingLockCodeFixProvider.cs (1)
98var lockTypeExpression = generator
src\Analyzers\CSharp\CodeFixes\UseThrowExpression\UseThrowExpressionCodeFixProvider.cs (5)
44var root = editor.OriginalRoot; 48var ifStatement = root.FindNode(diagnostic.AdditionalLocations[0].SourceSpan); 49var throwStatementExpression = root.FindNode(diagnostic.AdditionalLocations[1].SourceSpan); 50var assignmentValue = root.FindNode(diagnostic.AdditionalLocations[2].SourceSpan); 51var assignmentExpressionStatement = root.FindNode(diagnostic.AdditionalLocations[3].SourceSpan);
src\Analyzers\CSharp\CodeFixes\UseUtf8StringLiteral\UseUtf8StringLiteralCodeFixProvider.cs (2)
152private static SyntaxNode CreateArgumentListWithUtf8String(BaseArgumentListSyntax argumentList, Location location, string stringValue, bool isConvertedToReadOnlySpan) 183private static ExpressionSyntax CreateUtf8String(SyntaxNode nodeToTakeTriviaFrom, string stringValue, bool isConvertedToReadOnlySpan)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ArgumentGenerator.cs (3)
13public static ArgumentSyntax GenerateArgument(SyntaxNode argument) 23public static ArgumentListSyntax GenerateArgumentList(IList<SyntaxNode> arguments) 26public static BracketedArgumentListSyntax GenerateBracketedArgumentList(IList<SyntaxNode> arguments)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ConstructorGenerator.cs (1)
104private static ArgumentListSyntax GenerateArgumentList(ImmutableArray<SyntaxNode> arguments)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationHelpers.cs (7)
176where TDeclaration : SyntaxNode 194private static bool AreBracesMissing<TDeclaration>(TDeclaration declaration) where TDeclaration : SyntaxNode 197public static SyntaxNode? GetContextNode( 226public static CodeGenerationDestination GetDestination(SyntaxNode destination) 251where TSyntaxNode : SyntaxNode 269public static T? GetReuseableSyntaxNodeForSymbol<T>(ISymbol symbol, CSharpCodeGenerationContextInfo info) where T : SyntaxNode 275var reusableSyntaxNode = symbol.DeclaringSyntaxReferences[0].GetSyntax();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (23)
40public override CodeGenerationDestination GetDestination(SyntaxNode node) 43protected override IComparer<SyntaxNode> GetMemberComparer() 46protected override IList<bool>? GetAvailableInsertionIndices(SyntaxNode destination, CancellationToken cancellationToken) 311var finalMember = editor.GetChangedRoot(); 341protected override TDeclarationNode AddMembers<TDeclarationNode>(TDeclarationNode destination, IEnumerable<SyntaxNode> members) 375var attributeSyntaxToRemove = attributeToRemove.ApplicationSyntaxReference.GetSyntax(cancellationToken); 381SyntaxNode attributeToRemove, 441SyntaxNode attributeToRemove, 477IEnumerable<SyntaxNode> statements, 529IEnumerable<SyntaxNode> statements, 531CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode 568TDeclarationNode destinationMember, IEnumerable<SyntaxNode> statements, BaseMethodDeclarationSyntax baseMethodDeclaration) where TDeclarationNode : SyntaxNode 589TDeclarationNode destinationMember, IEnumerable<SyntaxNode> statements, LocalFunctionStatementSyntax localFunctionStatement) where TDeclarationNode : SyntaxNode 610TDeclarationNode destinationMember, IEnumerable<SyntaxNode> statements, AnonymousFunctionExpressionSyntax anonymousFunctionSyntax) where TDeclarationNode : SyntaxNode 634public override SyntaxNode CreateEventDeclaration( 640public override SyntaxNode CreateFieldDeclaration(IFieldSymbol field, CodeGenerationDestination destination, CSharpCodeGenerationContextInfo info, CancellationToken cancellationToken) 648public override SyntaxNode? CreateMethodDeclaration( 697public override SyntaxNode CreatePropertyDeclaration( 704public override SyntaxNode CreateNamedTypeDeclaration( 710public override SyntaxNode CreateNamespaceDeclaration(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpDeclarationComparer.cs (7)
13internal class CSharpDeclarationComparer : IComparer<SyntaxNode> 71public int Compare(SyntaxNode? x, SyntaxNode? y) 314private static int GetAccessibilityPrecedence(SyntaxTokenList modifiers, SyntaxNode? parent) 345for (var node = parent; node != null; node = node.Parent) 386private static bool EqualAccessibility(SyntaxNode x, SyntaxTokenList xModifiers, SyntaxNode y, SyntaxTokenList yModifiers, out int comparisonResult)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpFlagsEnumGenerator.cs (1)
19protected override SyntaxNode CreateExplicitlyCastedLiteralValue(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\NamespaceGenerator.cs (12)
32var declaration = GenerateNamespaceDeclaration( 52var declaration = GenerateNamespaceDeclaration( 66internal static SyntaxNode GenerateNamespaceDeclaration( 75var declaration = GetDeclarationSyntaxWithoutMembers( 85public static SyntaxNode UpdateCompilationUnitOrNamespaceDeclaration( 87SyntaxNode declaration, 97private static SyntaxNode GenerateNamespaceDeclarationWorker( 118private static SyntaxNode GetDeclarationSyntaxWithoutMembers( 125var reusableSyntax = GetReuseableSyntaxNodeForSymbol<SyntaxNode>(@namespace, info); 131private static SyntaxNode RemoveAllMembers(SyntaxNode declaration)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\StatementGenerator.cs (1)
15internal static SyntaxList<StatementSyntax> GenerateStatements(IEnumerable<SyntaxNode> statements)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeRefactorings\CSharpRefactoringHelpersService.cs (5)
29public override bool IsBetweenTypeMembers(SourceText sourceText, SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? typeDeclaration) 75protected override IEnumerable<SyntaxNode> ExtractNodesSimple(SyntaxNode? node, ISyntaxFactsService syntaxFacts) 97var declaration = declarator.Parent;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Editing\CSharpImportAdder.cs (7)
28protected override INamespaceSymbol? GetExplicitNamespaceSymbol(SyntaxNode node, SemanticModel model) 43SyntaxNode container, 128public async Task AddPotentiallyConflictingImportsAsync(SyntaxNode container, HashSet<INamespaceSymbol> conflicts, CancellationToken cancellationToken) 130using var _ = ArrayBuilder<SyntaxNode>.GetInstance(out var nodes); 158private void CollectInfoFromContainer(SyntaxNode container, ArrayBuilder<SyntaxNode> nodes, out bool containsAnonymousMethods) 162foreach (var node in container.DescendantNodesAndSelf())
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\CompilationUnitSyntaxExtensions.cs (3)
21public static bool CanAddUsingDirectives(this SyntaxNode contextNode, bool allowInHiddenRegions, CancellationToken cancellationToken) 82SyntaxNode contextNode, 92SyntaxNode contextNode,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\CSharpSyntaxContext.cs (1)
493foreach (var node in leftToken.GetAncestors<SyntaxNode>())
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (6)
162var parent = token.Parent; 180var container = token.Parent.Parent; 261var container = token.Parent.Parent; 454var owner = targetToken.Parent.Parent.Parent.Parent; 527where TMemberNode : SyntaxNode 614private static bool IsGenericInterfaceOrDelegateTypeParameterList([NotNullWhen(true)] SyntaxNode? node)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (8)
228var container = token.Parent.Parent?.Parent; 519var container = token.Parent?.Parent?.Parent; 1260SyntaxNode? parent; 1543SyntaxNode? node = leftToken.Parent as ExpressionSyntax; 1563private static SyntaxToken FindTokenOnLeftOfNode(SyntaxNode node) 1651var outer = UnwrapPossibleTuple(leftToken.Parent!); 1669private static SyntaxNode UnwrapPossibleTuple(SyntaxNode node)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.cs (2)
123var root = await semanticModel.SyntaxTree.GetRootAsync(cancellationToken).ConfigureAwait(false); 143private static IEnumerable<UsingDirectiveSyntax> GetApplicableUsings(int position, SyntaxNode root)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\QueryExpressionSyntaxExtensions.cs (6)
13public static IList<SyntaxNode> GetAllClauses(this QueryExpressionSyntax query) 15var result = new List<SyntaxNode> 24public static IList<SyntaxNode> GetAllClauses(this QueryBodySyntax body) 26var result = new List<SyntaxNode>(); 34IList<SyntaxNode> allClauses) 42IEnumerable<SyntaxNode> allClauses)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\SeparatedSyntaxListExtensions.cs (2)
13where T : SyntaxNode 20where T : SyntaxNode
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\TypeDeclarationSyntaxExtensions.cs (1)
55private static SyntaxToken GetEndToken(SyntaxNode node)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Indentation\CSharpIndentationService.cs (3)
117public override void AddIndentBlockOperations(List<IndentBlockOperation> list, SyntaxNode node, in NextIndentBlockOperationAction nextOperation) 173private static void ReplaceCaseIndentationRules(List<IndentBlockOperation> list, SyntaxNode node) 194private static void AddIndentBlockOperations(List<IndentBlockOperation> list, SyntaxNode node)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Indentation\CSharpIndentationService.Indenter.cs (8)
226var embeddedStatementOwner = token.Parent.Parent; 270var nonTerminalNode = token.Parent; 283var nonTerminalNode = token.Parent; 335Indenter indenter, SeparatedSyntaxList<T> list, SyntaxToken token) where T : SyntaxNode 375var queryExpressionClause = GetQueryExpressionClause(token); 431private static SyntaxNode? GetQueryExpressionClause(SyntaxToken token) 433var clause = token.GetAncestors<SyntaxNode>().FirstOrDefault(n => n is QueryClauseSyntax or SelectOrGroupClauseSyntax); 478var nonExpressionNode = token.GetAncestors<SyntaxNode>().FirstOrDefault(n => n is StatementSyntax);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpAddImportsService.cs (27)
40protected override ImmutableArray<SyntaxNode> GetGlobalImports(Compilation compilation, SyntaxGenerator generator) 43protected override SyntaxNode? GetAlias(UsingDirectiveSyntax usingOrAlias) 49protected override SyntaxNode Rewrite( 54SyntaxNode externContainer, 55SyntaxNode usingContainer, 56SyntaxNode staticUsingContainer, 57SyntaxNode aliasContainer, 59SyntaxNode root, 67var newRoot = rewriter.Visit(root); 71protected override SyntaxList<UsingDirectiveSyntax> GetUsingsAndAliases(SyntaxNode node) 79protected override SyntaxList<ExternAliasDirectiveSyntax> GetExterns(SyntaxNode node) 87protected override bool IsEquivalentImport(SyntaxNode a, SyntaxNode b) 94private readonly SyntaxNode _externContainer; 95private readonly SyntaxNode _usingContainer; 96private readonly SyntaxNode _aliasContainer; 97private readonly SyntaxNode _staticUsingContainer; 108SyntaxNode externContainer, 109SyntaxNode usingContainer, 110SyntaxNode aliasContainer, 111SyntaxNode staticUsingContainer, 128public override SyntaxNode? Visit(SyntaxNode? node) 131public override SyntaxNode VisitNamespaceDeclaration(NamespaceDeclarationSyntax node) 134public override SyntaxNode? VisitFileScopedNamespaceDeclaration(FileScopedNamespaceDeclarationSyntax node) 137private SyntaxNode VisitBaseNamespaceDeclaration( 171public override SyntaxNode VisitCompilationUnit(CompilationUnitSyntax node)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpMoveDeclarationNearReferenceService.cs (5)
32protected override bool IsMeaningfulBlock(SyntaxNode node) 43protected override SyntaxNode GetVariableDeclaratorSymbolNode(VariableDeclaratorSyntax variableDeclarator) 55SyntaxNode right, CancellationToken cancellationToken) 69protected override bool CanMoveToBlock(ILocalSymbol localSymbol, SyntaxNode currentBlock, SyntaxNode destinationBlock)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpRemoveUnnecessaryImportsService.cs (3)
42Func<SyntaxNode, bool>? predicate, 45predicate ??= Functions<SyntaxNode>.True; 96private static int GetEndPosition(SyntaxNode container, SyntaxList<MemberDeclarationSyntax> list)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpRemoveUnnecessaryImportsService.Rewriter.cs (12)
37public override SyntaxNode DefaultVisit(SyntaxNode node) 147public override SyntaxNode VisitCompilationUnit(CompilationUnitSyntax node) 195public override SyntaxNode VisitFileScopedNamespaceDeclaration(FileScopedNamespaceDeclarationSyntax node) 198public override SyntaxNode VisitNamespaceDeclaration(NamespaceDeclarationSyntax node) 201private SyntaxNode VisitBaseNamespaceDeclaration( 247public override SyntaxNode VisitClassDeclaration(ClassDeclarationSyntax node) 253public override SyntaxNode VisitDelegateDeclaration(DelegateDeclarationSyntax node) 259public override SyntaxNode VisitEnumDeclaration(EnumDeclarationSyntax node) 265public override SyntaxNode VisitInterfaceDeclaration(InterfaceDeclarationSyntax node) 271public override SyntaxNode VisitRecordDeclaration(RecordDeclarationSyntax node) 277public override SyntaxNode VisitStructDeclaration(StructDeclarationSyntax node)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpReplaceDiscardDeclarationsWithAssignmentsService.cs (3)
38public async Task<SyntaxNode> ReplaceAsync( 40SyntaxNode memberDeclaration, 45foreach (var child in memberDeclaration.DescendantNodes())
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSemanticFactsService.cs (5)
40protected override IEnumerable<ISymbol> GetCollidableSymbols(SemanticModel semanticModel, SyntaxNode location, SyntaxNode container, CancellationToken cancellationToken) 66bool ShouldDescendInto(SyntaxNode node) 117public CommonConversion ClassifyConversion(SemanticModel semanticModel, SyntaxNode expression, ITypeSymbol destination) 122public IMethodSymbol? TryGetDisposeMethod(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSyntaxFactsService.cs (9)
41SyntaxNode root, TContextNode contextNode, 42out SyntaxNode newRoot, out TContextNode newContextNode) where TContextNode : SyntaxNode 50private readonly SyntaxNode _contextNode; 54public AddFirstMissingCloseBraceRewriter(SyntaxNode contextNode) 57public override SyntaxNode Visit(SyntaxNode node) 69var rewritten = base.Visit(node); 116public Task<ImmutableArray<SyntaxNode>> GetSelectedFieldsAndPropertiesAsync(SyntaxTree tree, TextSpan textSpan, bool allowPartialSelection, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSyntaxGeneratorInternal.cs (68)
54public override SyntaxNode LocalDeclarationStatement(SyntaxNode? type, SyntaxToken name, SyntaxNode? initializer, bool isConst) 61public override SyntaxNode WithInitializer(SyntaxNode variableDeclarator, SyntaxNode initializer) 64public override SyntaxNode EqualsValueClause(SyntaxToken operatorToken, SyntaxNode value) 67internal static VariableDeclarationSyntax VariableDeclaration(SyntaxNode? type, SyntaxToken name, SyntaxNode? expression) 79public override SyntaxNode ConditionalAccessExpression(SyntaxNode expression, SyntaxNode whenNotNull) 82public override SyntaxNode MemberBindingExpression(SyntaxNode name) 85public override SyntaxNode RefExpression(SyntaxNode expression) 88public override SyntaxNode AddParentheses(SyntaxNode expressionOrPattern, bool includeElasticTrivia = true, bool addSimplifierAnnotation = true) 91internal static SyntaxNode Parenthesize(SyntaxNode expressionOrPattern, bool includeElasticTrivia = true, bool addSimplifierAnnotation = true) 99public override SyntaxNode YieldReturnStatement(SyntaxNode expression) 108public override SyntaxNode InterpolatedStringExpression(SyntaxToken startToken, IEnumerable<SyntaxNode> content, SyntaxToken endToken) 111public override SyntaxNode InterpolatedStringText(SyntaxToken textToken) 121public override SyntaxNode Interpolation(SyntaxNode syntaxNode) 124public override SyntaxNode InterpolationAlignmentClause(SyntaxNode alignment) 127public override SyntaxNode InterpolationFormatClause(string format) 132public override SyntaxNode TypeParameterList(IEnumerable<string> typeParameterNames) 150public override SyntaxNode Type(ITypeSymbol typeSymbol, bool typeContext) 153public override SyntaxNode NegateEquality(SyntaxGenerator generator, SyntaxNode binaryExpression, SyntaxNode left, BinaryOperatorKind negatedKind, SyntaxNode right) 161public override SyntaxNode IsNotTypeExpression(SyntaxNode expression, SyntaxNode type) 169public override SyntaxNode IsPatternExpression(SyntaxNode expression, SyntaxToken isKeyword, SyntaxNode pattern) 175public override SyntaxNode AndPattern(SyntaxNode left, SyntaxNode right) 178public override SyntaxNode ConstantPattern(SyntaxNode expression) 181public override SyntaxNode DeclarationPattern(INamedTypeSymbol type, string name) 186public override SyntaxNode LessThanRelationalPattern(SyntaxNode expression) 189public override SyntaxNode LessThanEqualsRelationalPattern(SyntaxNode expression) 192public override SyntaxNode GreaterThanRelationalPattern(SyntaxNode expression) 195public override SyntaxNode GreaterThanEqualsRelationalPattern(SyntaxNode expression) 198public override SyntaxNode NotPattern(SyntaxNode pattern) 201public override SyntaxNode OrPattern(SyntaxNode left, SyntaxNode right) 204public override SyntaxNode ParenthesizedPattern(SyntaxNode pattern) 207public override SyntaxNode TypePattern(SyntaxNode type) 210public override SyntaxNode UnaryPattern(SyntaxToken operatorToken, SyntaxNode pattern)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (17)
41protected override IEnumerable<TypeInferenceInfo> GetTypes_DoNotCallDirectly(SyntaxNode node, bool objectAsDefault) 52private static bool DecomposeBinaryOrAssignmentExpression(SyntaxNode node, out SyntaxToken operatorToken, out ExpressionSyntax left, out ExpressionSyntax right) 75private IEnumerable<TypeInferenceInfo> GetTypesComplex(SyntaxNode node) 93private IEnumerable<TypeInferenceInfo> GetTypesSimple(SyntaxNode node) 125SyntaxNode node) 134var parent = node.Parent; 1450SyntaxNode child) 1500SyntaxNode child) 1805SyntaxNode node) 1971var declaration = yieldStatement.FirstAncestorOrSelf<SyntaxNode>(n => n.IsReturnableConstruct()); 2012var ancestor = returnStatement.FirstAncestorOrSelf<SyntaxNode>(n => n.IsReturnableConstruct()); 2022private IEnumerable<TypeInferenceInfo> InferTypeInMethodLikeDeclaration(SyntaxNode declaration) 2035private ISymbol GetDeclaredMemberSymbolFromOriginalSemanticModel(SyntaxNode declarationInCurrentTree) 2191private ImmutableArray<TypeInferenceInfo> InferTypeBasedOnLaterUsage(ISymbol symbol, SyntaxNode afterNode) 2195var container = afterNode.AncestorsAndSelf().FirstOrDefault(a => a is BlockSyntax or SwitchSectionSyntax);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Utilities\CSharpSimplificationHelpers.cs (3)
15public static SyntaxToken TryEscapeIdentifierToken(SyntaxToken syntaxToken, SyntaxNode parentOfToken) 33var parent = parentOfToken.Parent; 57public static T AppendElasticTriviaIfNecessary<T>(T rewrittenNode, T originalNode) where T : SyntaxNode
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Utilities\NullableHelpers\NullableHelpers.cs (2)
22public static bool IsDeclaredSymbolAssignedPossiblyNullValue(SemanticModel semanticModel, SyntaxNode declarationSyntax, CancellationToken cancellationToken) 78var syntax = reference is IVariableDeclaratorOperation variableDeclarator
Microsoft.CodeAnalysis.CSharp.EditorFeatures (111)
AutomaticCompletion\AutomaticLineEnderCommandHandler.cs (24)
98var root = document.Root; 113private static TextSpan? GetFormattedTextSpan(SyntaxNode root, SyntaxToken endToken) 139var root = document.Root; 176private static SyntaxNode? ParseNode(SyntaxTree tree, SyntaxNode owningNode, string textToParse) 196private static bool CheckLocation(SourceText text, int position, SyntaxNode owningNode, SyntaxToken lastToken) 253private static bool TryGetLastToken(SourceText text, int position, SyntaxNode owningNode, out SyntaxToken lastToken) 283private static IEnumerable<SyntaxNode> GetOwningNodes(SyntaxNode root, int position) 292return token.GetAncestors<SyntaxNode>() 298private static bool AllowedConstructs(SyntaxNode n) 304private static SyntaxNode? OwningNode(SyntaxNode n) 314SyntaxNode selectedNode, 394private static (SyntaxNode newRoot, int nextCaretPosition) AddBraceToSelectedNode( 396SyntaxNode root, 397SyntaxNode selectedNode, 485private static (SyntaxNode newRoot, int nextCaretPosition) RemoveBraceFromSelectedNode( 487SyntaxNode root, 488SyntaxNode selectedNode, 584private static int GetOpenBraceSpanEnd(SyntaxNode root) 591private static int GetBraceInsertionPosition(SyntaxNode node) 665protected override (SyntaxNode selectedNode, bool addBrace)? GetValidNodeToModifyBraces(ParsedDocument document, int caretPosition, CancellationToken cancellationToken) 673foreach (var node in token.GetAncestors<SyntaxNode>())
AutomaticCompletion\AutomaticLineEnderCommandHandler_Helpers.cs (49)
27private static (SyntaxNode newRoot, int nextCaretPosition) ReplaceStatementOwnerAndInsertStatement( 29SyntaxNode root, 30SyntaxNode oldNode, 31SyntaxNode newNode, 32SyntaxNode anchorNode, 44var newRoot = rootEditor.GetChangedRoot(); 47var newNodeAfterInsertion = newRoot.GetAnnotatedNodes(s_replacementNodeAnnotation).Single(); 49var formattedNewRoot = Formatter.Format( 61private static SyntaxNode ReplaceNodeAndFormat( 63SyntaxNode root, 64SyntaxNode oldNode, 65SyntaxNode newNode, 70var annotatedNewNode = newNode.WithAdditionalAnnotations(s_replacementNodeAnnotation); 73var newRoot = root.ReplaceNode( 78var newNodeAfterInsertion = newRoot.GetAnnotatedNodes(s_replacementNodeAnnotation).Single(); 81var formattedNewRoot = Formatter.Format( 95private static (SyntaxNode newRoot, int nextCaretPosition) AddBraceToEmbeddedStatementOwner( 97SyntaxNode root, 98SyntaxNode embeddedStatementOwner, 118var newRoot = ReplaceNodeAndFormat( 168private static (SyntaxNode newRoot, int nextCaretPosition) AddBraceToDoStatement( 170SyntaxNode root, 215var newRoot = ReplaceNodeAndFormat( 227private static (SyntaxNode newRoot, int nextCaretPosition) AddBraceToIfStatement( 229SyntaxNode root, 272var newRoot = ReplaceNodeAndFormat( 284private static (SyntaxNode newRoot, int nextCaretPosition) AddBraceToElseClause( 286SyntaxNode root, 346var formattedNewRoot = ReplaceNodeAndFormat( 362private static (SyntaxNode newNode, SyntaxNode oldNode) ModifyObjectCreationExpressionNode( 375var objectCreationNodeWithCorrectInitializer = addOrRemoveInitializer 387var objectCreationNodeContainer = nextToken.Parent; 394var replacementContainerNode = objectCreationNodeContainer.ReplaceSyntax( 461private static bool ShouldAddBraces(SyntaxNode node, int caretPosition) 565var parent = accessorDeclarationNode.Parent; 566var parentOfParent = parent?.Parent; 733private static bool WithinAttributeLists(SyntaxNode node, int caretPosition) 739private static bool WithinBraces(SyntaxNode? node, int caretPosition) 745private static bool WithinMethodBody(SyntaxNode node, int caretPosition) 760private static bool HasNoBrace(SyntaxNode node) 767private static bool WithinEmbeddedStatement(SyntaxNode node, int caretPosition) 774private static bool ShouldRemoveBraces(SyntaxNode node, int caretPosition) 871private static SyntaxNode WithBraces(SyntaxNode node, SyntaxFormattingOptions formattingOptions) 933private static SyntaxNode AddBlockToEmbeddedStatementOwner( 934SyntaxNode embeddedStatementOwner, 968private static SyntaxNode WithoutBraces(SyntaxNode node)
CompleteStatement\CompleteStatementCommandHandler.cs (14)
138SyntaxNode root, 140[NotNullWhen(true)] out SyntaxNode? startingNode, 176SyntaxNode root, 180SyntaxNode? currentNode, 256private static bool CanHaveSemicolon(SyntaxNode currentNode) 290private static bool IsInConditionOfDoStatement(SyntaxNode currentNode, SnapshotPoint caret) 301private static SemicolonBehavior MoveCaretToFinalPositionInStatement(bool speculative, SyntaxNode statementNode, TypeCharCommandArgs args, SnapshotPoint originalCaret, SnapshotPoint caret, bool isInsideDelimiters) 334private static bool AdjustPositionForExistingSemicolon(SyntaxNode statementNode, ref SnapshotPoint targetPosition) 346private static bool TryGetCaretPositionToMove(SyntaxNode statementNode, SnapshotPoint caret, bool isInsideDelimiters, out SnapshotPoint targetPosition) 461private static bool IsInAStringOrCharacter(SyntaxNode currentNode, SnapshotPoint caret) 517private static bool StatementClosingDelimiterIsMissing(SyntaxNode currentNode) 549private static bool RequiredDelimiterIsMissing(SyntaxNode currentNode) 566for (var node = currentNode.Parent; node is not null; node = node.Parent) 576private static bool HasDelimitersButCaretIsOutside(SyntaxNode currentNode, int caretPosition)
EventHookup\EventHookupCommandHandler_TabKeyCommand.cs (4)
228var updatedRoot = AddGeneratedHandlerMethodToSolution( 309private static SyntaxNode? AddGeneratedHandlerMethodToSolution( 315var root = document.Root; 327var container = (SyntaxNode?)typeDecl ?? eventHookupExpression.GetAncestor<CompilationUnitSyntax>()!;
Interactive\CSharpSendToInteractiveSubmissionProvider.cs (14)
36protected override IEnumerable<TextSpan> GetExecutableSyntaxTreeNodeSelection(TextSpan selectionSpan, SyntaxNode root) 38var expandedNode = GetSyntaxNodeForSubmission(selectionSpan, root); 45/// Finds a <see cref="SyntaxNode"/> that should be submitted to REPL. 49private static SyntaxNode? GetSyntaxNodeForSubmission(TextSpan selectionSpan, SyntaxNode root) 63var startNode = GetSyntaxNodeForSubmission(startToken.GetRequiredParent()); 64var endNode = GetSyntaxNodeForSubmission(endToken.GetRequiredParent()); 88/// Finds a <see cref="SyntaxNode"/> that should be submitted to REPL. 91private static SyntaxNode? GetSyntaxNodeForSubmission(SyntaxNode node) 93SyntaxNode? candidate = node.GetAncestorOrThis<StatementSyntax>(); 99candidate = node.GetAncestorsOrThis<SyntaxNode>() 110private static bool IsSubmissionNode(SyntaxNode node) 120SyntaxNode root,
SplitComment\CSharpSplitCommentService.cs (1)
23public bool IsAllowed(SyntaxNode root, SyntaxTrivia trivia)
SplitStringLiteral\SplitStringLiteralCommandHandler.cs (1)
96!splitter.TrySplit(out var newRoot, out var newPosition))
StringCopyPaste\StringCopyPasteHelpers.cs (4)
225SyntaxNode root, NormalizedSnapshotSpanCollection selectionsBeforePaste) 242public static ExpressionSyntax? FindContainingSupportedStringExpression(SyntaxNode root, int position) 244var node = root.FindToken(position).Parent; 245for (var current = node; current != null; current = current.Parent)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (50)
CodeActions\SyncNamespace\CSharpSyncNamespaceTestsBase.cs (1)
170var modifiedOringinalRoot = await modifiedOriginalDocument.GetSyntaxRootAsync();
CodeGeneration\SyntaxGeneratorTests.cs (6)
37var root = await document.GetSyntaxRootAsync(); 42var statement = root.DescendantNodes().Single(n => n is ReturnStatementSyntax); 43var replacement = g.ReturnStatement(g.NameOfExpression(g.IdentifierName("M"))); 45var newRoot = root.ReplaceNode(statement, replacement); 71var root = await document.GetSyntaxRootAsync(); 76var statement = root.DescendantNodes().Single(n => n is ReturnStatementSyntax);
Completion\ArgumentProviders\AbstractCSharpArgumentProviderTests`1.cs (3)
19protected override (SyntaxNode argumentList, ImmutableArray<SyntaxNode> arguments) GetArgumentList(SyntaxToken token) 22return (argumentList, argumentList.Arguments.ToImmutableArray<SyntaxNode>());
Diagnostics\FixAllProvider\BatchFixerTests.cs (2)
73var root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 83var newRoot = root.ReplaceNode(node, newNode);
ExtractMethod\ExtractMethodBase.cs (8)
39var treeAfterExtractMethod = await ExtractMethodAsync(workspace, testDocument, succeed: false); 51var tree = await ExtractMethodAsync(workspace, testDocument, succeed: false); 71var tree = await ExtractMethodAsync(workspace, testDocument); 85var tree = await ExtractMethodAsync( 113protected static async Task<SyntaxNode> ExtractMethodAsync( 194var root = await document.GetSyntaxRootAsync(); 195var iterator = root.DescendantNodesAndSelf().Cast<SyntaxNode>(); 197foreach (var node in iterator)
ExtractMethod\MiscTests.cs (6)
46var rootWithAnnotation = result.Root; 52var newRoot = rootWithAnnotation.ReplaceToken(publicToken, PrivateKeyword); 55var rootWithTriviaRestored = result.RestoreTrivia(newRoot); 91var rootWithAnnotation = result.Root; 97var newRoot = rootWithAnnotation.ReplaceToken(publicToken, PrivateKeyword); 100var rootWithTriviaRestored = result.RestoreTrivia(newRoot);
Formatting\CodeCleanupTests.TestFixers.cs (3)
32var root = await context.Document.GetSyntaxRootAsync(cancellationToken); 36var node = (await sourceTree.GetRootAsync(cancellationToken)).FindNode(diagnostic.Location.SourceSpan); 38var newRoot = root.RemoveNode(node.Parent, SyntaxRemoveOptions.KeepNoTrivia);
Formatting\CSharpFormattingEngineTestBase.cs (1)
22protected override SyntaxNode ParseCompilationUnit(string expected)
Formatting\FormattingEngineTests.cs (5)
443var node = Formatter.Format(syntaxRoot, spans, workspace.Services.SolutionServices, options, rules: default, CancellationToken.None); 2221var root = tree.GetRoot(); 2224var newRoot = root.InsertNodesBefore(root.DescendantNodes().Last(), [entry]); 2539var root = syntaxTree.GetRoot(); 2550var formattedRoot = Formatter.Format(root, workspace.Services.SolutionServices, options, CancellationToken.None);
Semantics\SpeculationAnalyzerTests.cs (3)
524protected override bool IsExpressionNode(SyntaxNode node) 544protected override bool ReplacementChangesSemantics(SyntaxNode initialNode, SyntaxNode replacementNode, SemanticModel initialModel)
Structure\AbstractCSharpSyntaxNodeStructureTests.cs (1)
11where TSyntaxNode : SyntaxNode
SymbolKey\SymbolKeyTestBase.cs (1)
128foreach (var node in symbol.DeclaringSyntaxReferences.Select(d => d.GetSyntax()))
SymbolKey\SymbolKeyTests.cs (1)
295var root = await tree.GetRootAsync();
TypeInferrer\TypeInferrerTests.cs (3)
27var root = await document.GetSyntaxRootAsync(); 72private static ExpressionSyntax FindExpressionSyntaxFromSpan(SyntaxNode root, TextSpan textSpan) 75var currentNode = token.Parent;
Utilities\CSharpServiceTestExtensions.cs (6)
17internal static T FindFirstNodeOfType<T>(this SyntaxNode node) 18where T : SyntaxNode 25foreach (var child in node.ChildNodes()) 37internal static T DigToFirstNodeOfType<T>(this SyntaxNode node) 38where T : SyntaxNode 44where T : SyntaxNode
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (7)
CodeGen\CodeGenDeconstructTests.cs (2)
3582Assert.Same(symbol, model.GetDeclaredSymbol((SyntaxNode)decl)); 3614Assert.Same(field, model.GetDeclaredSymbol((SyntaxNode)decl));
CodeGen\CodeGenTupleTest.cs (4)
8484var node = nodes.OfType<ParenthesizedExpressionSyntax>().Single().Parent; 8518var node = nodes.OfType<ParenthesizedExpressionSyntax>().Single().Parent; 24208Assert.Equal("System.Int32 (System.Int32 elem1, System.Int32 elem2).elem1", model.GetDeclaredSymbol((SyntaxNode)type.Elements.First()).ToTestDisplayString()); 24209Assert.Equal("System.Int32 (System.Int32 elem1, System.Int32 elem2).elem2", model.GetDeclaredSymbol((SyntaxNode)type.Elements.Last()).ToTestDisplayString());
CodeGen\IndexAndRangeTests.cs (1)
31var root = syntaxTree.GetRoot();
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (17)
Emit\EditAndContinue\EditAndContinueTest.cs (2)
39protected override Func<SyntaxNode, SyntaxNode> GetEquivalentNodesMap(ISymbol left, ISymbol right)
Emit\EditAndContinue\EditAndContinueTestBase.cs (13)
54internal static Func<SyntaxNode, SyntaxNode> GetSyntaxMapFromMarkers(SourceWithMarkedNodes source0, SourceWithMarkedNodes source1) 57internal static ImmutableArray<SyntaxNode> GetAllLocals(MethodSymbol method) 62return ImmutableArray<SyntaxNode>.Empty; 68internal static Func<SyntaxNode, SyntaxNode> GetSyntaxMapByKind(MethodSymbol method0, params SyntaxKind[] kinds) 84internal static Func<SyntaxNode, SyntaxNode> GetEquivalentNodesMap(MethodSymbol method1, MethodSymbol method0) 93var s1 = s; 95foreach (var s0 in locals0) 113internal static string GetLocalName(SyntaxNode node) 124internal static StatementSyntax GetNearestStatement(SyntaxNode node) 144Func<SyntaxNode, RuntimeRudeEdit?>? rudeEdits = null)
Emit\NumericIntPtrTests.cs (2)
6621var expr = tree.GetRoot().DescendantNodes().Single(n => n.Kind() == kind); 6853var expr = tree.GetRoot().DescendantNodes().Single(n => n.Kind() == kind);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (120)
Attributes\AttributeTests.cs (11)
706var root = tree.GetRoot(); 747var root = tree.GetRoot(); 751var newRoot = root.ReplaceNode(attrSyntax, attrSyntax.WithArgumentList(SyntaxFactory.ParseAttributeArgumentList("()"))); 811var root = tree.GetRoot(); 816var newRoot = root.ReplaceNode(attrSyntax, attrSyntax.WithArgumentList(SyntaxFactory.ParseAttributeArgumentList("()"))); 853var root = tree.GetRoot(); 857var newRoot = root.ReplaceNode(attrSyntax, attrSyntax.WithArgumentList(SyntaxFactory.ParseAttributeArgumentList("()"))); 894var root = tree.GetRoot(); 898var newRoot = root.ReplaceNode(attrSyntax, attrSyntax.WithArgumentList(SyntaxFactory.ParseAttributeArgumentList("()"))); 933var root = tree.GetRoot(); 937var newRoot = root.ReplaceNode(attrSyntax, attrSyntax.WithArgumentList(SyntaxFactory.ParseAttributeArgumentList("()")));
Diagnostics\DiagnosticAnalyzerTests.cs (4)
2341private void ReportNodeDiagnostics(SyntaxNode node, Action<Diagnostic> addDiagnostic) 4112private readonly SyntaxNode _topmostNode; 4116public PrimaryConstructorBaseTypeAnalyzer(SyntaxNode topmostNode, ImmutableArray<SyntaxKind> syntaxKinds) 4151var root = tree.GetRoot();
Diagnostics\GetDiagnosticsTests.cs (2)
999var uniqueCallbacks = new HashSet<SyntaxNode>(); 1011static void analyzeNode(SyntaxNode node, ISymbol containingSymbol, Action<Diagnostic> reportDiagnostic)
FlowAnalysis\RegionAnalysisTests.cs (4)
5535var root = tree.GetRoot(); 5579var root = tree.GetRoot(); 5622var root = tree.GetRoot(); 6481var root = tree.GetRoot();
Semantics\CollectionExpressionTests.cs (1)
27086SyntaxNode IOperation.Syntax => throw null;
Semantics\InlineArrayTests.cs (7)
2520var access = f.Parent.Parent; 6211var access = f.Parent.Parent; 8835var m3 = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(m => m.Identifier.ValueText == "M3").Single().Parent; 8847var access = m3.Parent; 10559var access = f.Parent.Parent; 11303var access = f.Parent.Parent; 16495var m3 = tree.GetRoot().DescendantNodes().OfType<IdentifierNameSyntax>().Where(m => m.Identifier.ValueText == "M3").First().Parent;
Semantics\OutVarTests.cs (5)
971Assert.Same(symbol, model.GetDeclaredSymbol((SyntaxNode)variableDeclaratorSyntax)); 1144Assert.Same(symbol, model.GetDeclaredSymbol((SyntaxNode)variableDesignationSyntax)); 1183var parent1 = ((VariableDeclarationSyntax)((VariableDeclaratorSyntax)parent).Parent).Parent; 22702Assert.Null(model.GetDeclaredSymbol((SyntaxNode)variableDeclaratorSyntax)); 32736Assert.Same(symbol, model.GetDeclaredSymbol((SyntaxNode)variableDesignationSyntax));
Semantics\PatternMatchingTestBase.cs (5)
85Assert.Same(symbol, model.GetDeclaredSymbol((SyntaxNode)designation)); 146Assert.Same(symbol, model.GetDeclaredSymbol((SyntaxNode)designation)); 172Assert.Same(symbol, model.GetDeclaredSymbol((SyntaxNode)declarator)); 186Assert.Same(symbol, model.GetDeclaredSymbol((SyntaxNode)designation)); 248Assert.Same(symbol, model.GetDeclaredSymbol((SyntaxNode)designation));
Semantics\PatternMatchingTests_ListPatterns.cs (2)
3641void verify(SyntaxNode designation, string syntax, string declaredType, string type) 4411void verify(SyntaxNode designation, string syntax, string declaredType, string type)
Semantics\PatternMatchingTests2.cs (1)
2036public override SyntaxNode VisitAliasQualifiedName(AliasQualifiedNameSyntax node)
Semantics\PrimaryConstructorTests.cs (38)
1089Assert.Equal("Base..ctor(System.Int32 X, System.Int32 Y)", model.GetSymbolInfo((SyntaxNode)baseWithargs).Symbol.ToTestDisplayString()); 1093Assert.Empty(model.GetMemberGroup((SyntaxNode)baseWithargs)); 1097Assert.Equal("Base..ctor(System.Int32 X, System.Int32 Y)", model.GetSymbolInfo((SyntaxNode)baseWithargs).Symbol.ToTestDisplayString()); 1104Assert.Empty(model.GetMemberGroup((SyntaxNode)baseWithargs)); 1196Assert.Equal("C..ctor(System.Int32 X, [System.Int32 Y = 123])", model.GetSymbolInfo((SyntaxNode)baseWithargs).Symbol.ToTestDisplayString()); 1200Assert.Empty(model.GetMemberGroup((SyntaxNode)baseWithargs).Select(m => m.ToTestDisplayString())); 2122symbolInfo = model.GetSymbolInfo((SyntaxNode)baseWithargs); 2136Assert.Empty(model.GetMemberGroup((SyntaxNode)baseWithargs)); 2140symbolInfo = model.GetSymbolInfo((SyntaxNode)baseWithargs); 2156Assert.Empty(model.GetMemberGroup((SyntaxNode)baseWithargs)); 2167symbolInfo = model.GetSpeculativeSymbolInfo(baseWithargs.ArgumentList.OpenParenToken.SpanStart, (SyntaxNode)speculativeBaseInitializer, SpeculativeBindingOption.BindAsExpression); 2180Assert.Equal("Base..ctor(System.Int32 X)", speculativeModel.GetSymbolInfo((SyntaxNode)speculativePrimaryInitializer).Symbol.ToTestDisplayString()); 2191Assert.Equal("Base..ctor(System.Int32 X)", speculativeModel.GetSymbolInfo((SyntaxNode)speculativePrimaryInitializer).Symbol.ToTestDisplayString()); 2198symbolInfo = model.GetSpeculativeSymbolInfo(otherBasePosition, (SyntaxNode)speculativePrimaryInitializer, SpeculativeBindingOption.BindAsExpression); 2204symbolInfo = model.GetSpeculativeSymbolInfo(baseWithargs.SpanStart, (SyntaxNode)speculativePrimaryInitializer, SpeculativeBindingOption.BindAsExpression); 2210symbolInfo = model.GetSpeculativeSymbolInfo(baseWithargs.ArgumentList.OpenParenToken.SpanStart, (SyntaxNode)speculativePrimaryInitializer, SpeculativeBindingOption.BindAsExpression); 2216Assert.Equal(TypeInfo.None, model.GetSpeculativeTypeInfo(baseWithargs.ArgumentList.OpenParenToken.SpanStart, (SyntaxNode)speculativePrimaryInitializer, SpeculativeBindingOption.BindAsExpression)); 2218(SyntaxNode)speculativePrimaryInitializer, SpeculativeBindingOption.BindAsExpression)); 2223symbolInfo = model.GetSymbolInfo((SyntaxNode)baseWithargs); 2237Assert.Empty(model.GetMemberGroup((SyntaxNode)baseWithargs).Select(m => m.ToTestDisplayString())); 2246symbolInfo = model.GetSpeculativeSymbolInfo(baseWithargs.ArgumentList.OpenParenToken.SpanStart, (SyntaxNode)speculativeBaseInitializer, SpeculativeBindingOption.BindAsExpression); 2252Assert.Equal(TypeInfo.None, model.GetSpeculativeTypeInfo(baseWithargs.ArgumentList.OpenParenToken.SpanStart, (SyntaxNode)speculativePrimaryInitializer, SpeculativeBindingOption.BindAsExpression)); 2304symbolInfo = model.GetSymbolInfo((SyntaxNode)baseWithargs); 2311Assert.Empty(model.GetMemberGroup((SyntaxNode)baseWithargs)); 2319symbolInfo = model.GetSpeculativeSymbolInfo(baseWithargs.ArgumentList.OpenParenToken.SpanStart, (SyntaxNode)speculativeBaseInitializer, SpeculativeBindingOption.BindAsExpression); 2337symbolInfo = model.GetSpeculativeSymbolInfo(otherBasePosition, (SyntaxNode)speculativePrimaryInitializer, SpeculativeBindingOption.BindAsExpression); 2343symbolInfo = model.GetSpeculativeSymbolInfo(baseWithargs.SpanStart, (SyntaxNode)speculativePrimaryInitializer, SpeculativeBindingOption.BindAsExpression); 2349symbolInfo = model.GetSpeculativeSymbolInfo(baseWithargs.ArgumentList.OpenParenToken.SpanStart, (SyntaxNode)speculativePrimaryInitializer, SpeculativeBindingOption.BindAsExpression); 2355Assert.Equal(TypeInfo.None, model.GetSpeculativeTypeInfo(baseWithargs.ArgumentList.OpenParenToken.SpanStart, (SyntaxNode)speculativePrimaryInitializer, SpeculativeBindingOption.BindAsExpression)); 2357(SyntaxNode)speculativePrimaryInitializer, SpeculativeBindingOption.BindAsExpression)); 2362symbolInfo = model.GetSymbolInfo((SyntaxNode)baseWithargs); 2376Assert.Empty(model.GetMemberGroup((SyntaxNode)baseWithargs).Select(m => m.ToTestDisplayString())); 2385symbolInfo = model.GetSpeculativeSymbolInfo(baseWithargs.ArgumentList.OpenParenToken.SpanStart, (SyntaxNode)speculativeBaseInitializer, SpeculativeBindingOption.BindAsExpression); 2391Assert.Equal(TypeInfo.None, model.GetSpeculativeTypeInfo(baseWithargs.ArgumentList.OpenParenToken.SpanStart, (SyntaxNode)speculativePrimaryInitializer, SpeculativeBindingOption.BindAsExpression)); 20631var root = tree.GetRoot(); 20675var root = tree.GetRoot(); 20722var root = tree.GetRoot(); 20772var root = tree.GetRoot();
Semantics\RecordTests.cs (40)
1815var root = comp.SyntaxTrees[0].GetRoot(); 8088var root = tree.GetRoot(); 8601var root = tree.GetRoot(); 8610var xId = withExpr.DescendantNodes().Single(id => id.ToString() == "X"); 8716var root = tree.GetRoot(); 8861var root = tree.GetRoot(); 21161Assert.Equal("Base..ctor(System.Int32 X, System.Int32 Y)", model.GetSymbolInfo((SyntaxNode)baseWithargs).Symbol.ToTestDisplayString()); 21165Assert.Empty(model.GetMemberGroup((SyntaxNode)baseWithargs)); 21169Assert.Equal("Base..ctor(System.Int32 X, System.Int32 Y)", model.GetSymbolInfo((SyntaxNode)baseWithargs).Symbol.ToTestDisplayString()); 21176Assert.Empty(model.GetMemberGroup((SyntaxNode)baseWithargs)); 21270Assert.Equal("C..ctor(System.Int32 X, [System.Int32 Y = 123])", model.GetSymbolInfo((SyntaxNode)baseWithargs).Symbol.ToTestDisplayString()); 21274Assert.Empty(model.GetMemberGroup((SyntaxNode)baseWithargs).Select(m => m.ToTestDisplayString())); 22234symbolInfo = model.GetSymbolInfo((SyntaxNode)baseWithargs); 22248Assert.Empty(model.GetMemberGroup((SyntaxNode)baseWithargs)); 22252symbolInfo = model.GetSymbolInfo((SyntaxNode)baseWithargs); 22268Assert.Empty(model.GetMemberGroup((SyntaxNode)baseWithargs)); 22279symbolInfo = model.GetSpeculativeSymbolInfo(baseWithargs.ArgumentList.OpenParenToken.SpanStart, (SyntaxNode)speculativeBaseInitializer, SpeculativeBindingOption.BindAsExpression); 22292Assert.Equal("Base..ctor(System.Int32 X)", speculativeModel!.GetSymbolInfo((SyntaxNode)speculativePrimaryInitializer).Symbol.ToTestDisplayString()); 22303Assert.Equal("Base..ctor(System.Int32 X)", speculativeModel!.GetSymbolInfo((SyntaxNode)speculativePrimaryInitializer).Symbol.ToTestDisplayString()); 22310symbolInfo = model.GetSpeculativeSymbolInfo(otherBasePosition, (SyntaxNode)speculativePrimaryInitializer, SpeculativeBindingOption.BindAsExpression); 22316symbolInfo = model.GetSpeculativeSymbolInfo(baseWithargs.SpanStart, (SyntaxNode)speculativePrimaryInitializer, SpeculativeBindingOption.BindAsExpression); 22322symbolInfo = model.GetSpeculativeSymbolInfo(baseWithargs.ArgumentList.OpenParenToken.SpanStart, (SyntaxNode)speculativePrimaryInitializer, SpeculativeBindingOption.BindAsExpression); 22328Assert.Equal(TypeInfo.None, model.GetSpeculativeTypeInfo(baseWithargs.ArgumentList.OpenParenToken.SpanStart, (SyntaxNode)speculativePrimaryInitializer, SpeculativeBindingOption.BindAsExpression)); 22330(SyntaxNode)speculativePrimaryInitializer, SpeculativeBindingOption.BindAsExpression)); 22335symbolInfo = model.GetSymbolInfo((SyntaxNode)baseWithargs); 22349Assert.Empty(model.GetMemberGroup((SyntaxNode)baseWithargs).Select(m => m.ToTestDisplayString())); 22358symbolInfo = model.GetSpeculativeSymbolInfo(baseWithargs.ArgumentList.OpenParenToken.SpanStart, (SyntaxNode)speculativeBaseInitializer, SpeculativeBindingOption.BindAsExpression); 22364Assert.Equal(TypeInfo.None, model.GetSpeculativeTypeInfo(baseWithargs.ArgumentList.OpenParenToken.SpanStart, (SyntaxNode)speculativePrimaryInitializer, SpeculativeBindingOption.BindAsExpression)); 22416symbolInfo = model.GetSymbolInfo((SyntaxNode)baseWithargs); 22423Assert.Empty(model.GetMemberGroup((SyntaxNode)baseWithargs)); 22431symbolInfo = model.GetSpeculativeSymbolInfo(baseWithargs.ArgumentList.OpenParenToken.SpanStart, (SyntaxNode)speculativeBaseInitializer, SpeculativeBindingOption.BindAsExpression); 22449symbolInfo = model.GetSpeculativeSymbolInfo(otherBasePosition, (SyntaxNode)speculativePrimaryInitializer, SpeculativeBindingOption.BindAsExpression); 22455symbolInfo = model.GetSpeculativeSymbolInfo(baseWithargs.SpanStart, (SyntaxNode)speculativePrimaryInitializer, SpeculativeBindingOption.BindAsExpression); 22461symbolInfo = model.GetSpeculativeSymbolInfo(baseWithargs.ArgumentList.OpenParenToken.SpanStart, (SyntaxNode)speculativePrimaryInitializer, SpeculativeBindingOption.BindAsExpression); 22467Assert.Equal(TypeInfo.None, model.GetSpeculativeTypeInfo(baseWithargs.ArgumentList.OpenParenToken.SpanStart, (SyntaxNode)speculativePrimaryInitializer, SpeculativeBindingOption.BindAsExpression)); 22469(SyntaxNode)speculativePrimaryInitializer, SpeculativeBindingOption.BindAsExpression)); 22474symbolInfo = model.GetSymbolInfo((SyntaxNode)baseWithargs); 22488Assert.Empty(model.GetMemberGroup((SyntaxNode)baseWithargs).Select(m => m.ToTestDisplayString())); 22497symbolInfo = model.GetSpeculativeSymbolInfo(baseWithargs.ArgumentList.OpenParenToken.SpanStart, (SyntaxNode)speculativeBaseInitializer, SpeculativeBindingOption.BindAsExpression); 22503Assert.Equal(TypeInfo.None, model.GetSpeculativeTypeInfo(baseWithargs.ArgumentList.OpenParenToken.SpanStart, (SyntaxNode)speculativePrimaryInitializer, SpeculativeBindingOption.BindAsExpression));
Microsoft.CodeAnalysis.CSharp.Features (1761)
AddImport\CSharpAddImportFeatureService.cs (25)
43protected override bool CanAddImport(SyntaxNode node, bool allowInHiddenRegions, CancellationToken cancellationToken) 50string diagnosticId, ISyntaxFacts syntaxFacts, SyntaxNode node, out SimpleNameSyntax nameNode) 139protected override bool CanAddImportForDeconstruct(string diagnosticId, SyntaxNode node) 142protected override bool CanAddImportForGetAwaiter(string diagnosticId, ISyntaxFacts syntaxFactsService, SyntaxNode node) 148protected override bool CanAddImportForGetEnumerator(string diagnosticId, ISyntaxFacts syntaxFactsService, SyntaxNode node) 151protected override bool CanAddImportForGetAsyncEnumerator(string diagnosticId, ISyntaxFacts syntaxFactsService, SyntaxNode node) 154protected override bool CanAddImportForNamespace(string diagnosticId, SyntaxNode node, out SimpleNameSyntax nameNode) 160protected override bool CanAddImportForQuery(string diagnosticId, SyntaxNode node) 165protected override bool CanAddImportForType(string diagnosticId, SyntaxNode node, out SimpleNameSyntax nameNode) 200private static bool TryFindStandaloneType(SyntaxNode node, out SimpleNameSyntax nameNode) 229SyntaxNode node, 236SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken) 243SyntaxNode node, 290SyntaxNode contextNode, 336SyntaxNode contextNode, 348Document document, CompilationUnitSyntax root, SyntaxNode contextNode, INamespaceOrTypeSymbol namespaceOrTypeSymbol, 359using var _ = ArrayBuilder<SyntaxNode>.GetInstance(out var newImports); 384SyntaxNode contextNode, IReadOnlyList<string> namespaceParts, 418SyntaxNode contextNode) 437SyntaxNode contextNode) 555SyntaxNode contextNode) 581private static bool HasExistingExternAlias(string alias, SyntaxNode contextNode) 596SyntaxNode contextNode, CancellationToken cancellationToken) 601protected override bool IsViableExtensionMethod(IMethodSymbol method, SyntaxNode expression, SemanticModel semanticModel, ISyntaxFacts syntaxFacts, CancellationToken cancellationToken) 624protected override bool IsAddMethodContext(SyntaxNode node, SemanticModel semanticModel)
BraceCompletion\AbstractCurlyBraceOrBracketCompletionService.cs (7)
156static ParsedDocument GetUpdatedDocument(ParsedDocument oldDocument, IEnumerable<TextChange> changes, SyntaxNode newRoot) 224private (SyntaxNode formattedRoot, ImmutableArray<TextChange> textChanges, int finalBraceEnd) FormatTrackingSpan( 257var annotatedRoot = GetSyntaxRootWithAnnotatedClosingBrace(document.Root, closingPoint); 267var newRoot = result.GetFormattedRoot(cancellationToken); 273SyntaxNode GetSyntaxRootWithAnnotatedClosingBrace(SyntaxNode originalRoot, int closingBraceEndPoint) 281private SyntaxToken FindClosingBraceToken(SyntaxNode root, int closingBraceEndPoint)
BraceCompletion\BracketBraceCompletionService.cs (1)
59public override void AddAlignTokensOperations(List<AlignTokensOperation> list, SyntaxNode node, in NextAlignTokensOperationAction nextOperation)
BraceCompletion\CurlyBraceCompletionService.cs (4)
150var currentTokenParentParent = currentToken.Parent?.Parent; 199private static bool IsControlBlock(SyntaxNode? node) 244public override void AddAlignTokensOperations(List<AlignTokensOperation> list, SyntaxNode node, in NextAlignTokensOperationAction nextOperation) 260public override void AddSuppressOperations(ArrayBuilder<SuppressOperation> list, SyntaxNode node, in NextSuppressOperationAction nextOperation)
ChangeSignature\ChangeSignatureFormattingRule.cs (2)
28public override void AddIndentBlockOperations(List<IndentBlockOperation> list, SyntaxNode node, in NextIndentBlockOperationAction nextOperation) 38private static void AddChangeSignatureIndentOperation(List<IndentBlockOperation> list, SyntaxNode node)
ChangeSignature\CSharpChangeSignatureService.cs (30)
135var matchingNode = GetMatchingNode(token.Parent, restrictToDeclarations); 187private static int TryGetSelectedIndexFromDeclaration(int position, SyntaxNode matchingNode) 193private static SyntaxNode? GetMatchingNode(SyntaxNode node, bool restrictToDeclarations) 199for (var current = node; current != null; current = current.Parent) 216private static bool InSymbolHeader(SyntaxNode matchingNode, int position) 219var lastAttributes = matchingNode.ChildNodes().LastOrDefault(n => n is AttributeListSyntax); 229var parameterList = matchingNode.ChildNodes().LastOrDefault(n => n is ParameterListSyntax); 239public override SyntaxNode? FindNodeToUpdate(Document document, SyntaxNode node) 247var matchingNode = node.AncestorsAndSelf().FirstOrDefault(n => _updatableAncestorKinds.Contains(n.Kind())); 253var nodeContainingOriginal = GetNodeContainingTargetNode(matchingNode); 262private static SyntaxNode? GetNodeContainingTargetNode(SyntaxNode matchingNode) 289public override async Task<SyntaxNode> ChangeSignatureAsync( 292SyntaxNode potentiallyUpdatedNode, 293SyntaxNode originalNode, 581private static bool IsParamsArrayExpanded(SemanticModel semanticModel, SyntaxNode node, SymbolInfo symbolInfo, CancellationToken cancellationToken) 668Func<AddedParameter, T> createNewParameterMethod) where T : SyntaxNode 674protected override T TransferLeadingWhitespaceTrivia<T>(T newArgument, SyntaxNode oldArgument) 701where TArgumentSyntax : SyntaxNode 751where T : SyntaxNode 752where U : SyntaxNode 791private ImmutableArray<SyntaxNode> VerifyAndPermuteParamNodes(IEnumerable<XmlElementSyntax> paramNodes, ISymbol declarationSymbol, SignatureChange updatedSignature) 831var permutedParams = ArrayBuilder<SyntaxNode>.GetInstance(); 859using var _ = ArrayBuilder<SyntaxNode>.GetInstance(out var convertedMethodNodes); 897ArgumentSyntax a => (TArgumentSyntax)(SyntaxNode)a.WithNameColon(NameColon(name)), 898AttributeArgumentSyntax a => (TArgumentSyntax)(SyntaxNode)a.WithNameColon(NameColon(name)), 908var listOfArguments = SeparatedList(newArguments.Skip(indexInExistingList).Select(a => ((ArgumentSyntax)(SyntaxNode)a).Expression), newArguments.GetSeparators().Skip(indexInExistingList)); 911return (TArgumentSyntax)(SyntaxNode)Argument(objectCreation);
ChangeSignature\UnifiedArgumentSyntax.cs (6)
15private readonly SyntaxNode _argument; 17private UnifiedArgumentSyntax(SyntaxNode argument) 29public SyntaxNode NameColon 39public IUnifiedArgumentSyntax WithNameColon(SyntaxNode nameColonSyntax) 61public SyntaxNode Expression 87public static explicit operator SyntaxNode(UnifiedArgumentSyntax unified)
CodeFixes\GenerateType\GenerateTypeCodeFixProvider.cs (4)
46protected override bool IsCandidate(SyntaxNode node, SyntaxToken token, Diagnostic diagnostic) 59protected override SyntaxNode? GetTargetNode(SyntaxNode node) 63Document document, SyntaxNode node, CancellationToken cancellationToken)
CodeFixes\Suppression\CSharpSuppressionCodeFixProvider.cs (14)
37protected override SyntaxTriviaList CreatePragmaRestoreDirectiveTrivia(Diagnostic diagnostic, Func<SyntaxNode, CancellationToken, SyntaxNode> formatNode, bool needsLeadingEndOfLine, bool needsTrailingEndOfLine, CancellationToken cancellationToken) 44Diagnostic diagnostic, Func<SyntaxNode, CancellationToken, SyntaxNode> formatNode, bool needsLeadingEndOfLine, bool needsTrailingEndOfLine, CancellationToken cancellationToken) 51SyntaxToken disableOrRestoreKeyword, Diagnostic diagnostic, Func<SyntaxNode, CancellationToken, SyntaxNode> formatNode, bool needsLeadingEndOfLine, bool needsTrailingEndOfLine, CancellationToken cancellationToken) 86protected override bool IsAttributeListWithAssemblyAttributes(SyntaxNode node) 99protected override SyntaxNode AddGlobalSuppressMessageAttribute( 100SyntaxNode newRoot, 129protected override SyntaxNode AddLocalSuppressMessageAttribute( 130SyntaxNode targetNode, ISymbol targetSymbol, INamedTypeSymbol suppressMessageAttribute, Diagnostic diagnostic) 212protected override bool IsSingleAttributeInAttributeList(SyntaxNode attribute) 247protected override SyntaxNode GetContainingStatement(SyntaxToken token) 250=> (SyntaxNode)token.GetAncestor<StatementSyntax>() ?? token.GetAncestor<ArrowExpressionClauseSyntax>();
CodeLens\CSharpCodeLensDisplayInfoService.cs (5)
33public SyntaxNode GetDisplayNode(SyntaxNode node) 83public string GetDisplayName(SemanticModel semanticModel, SyntaxNode node) 181private static string GetEnclosingScopeString(SyntaxNode node, SemanticModel semanticModel, SymbolDisplayFormat symbolDisplayFormat) 183var scopeNode = node;
CodeRefactorings\AddAwait\CSharpAddAwaitCodeRefactoringProvider.cs (2)
30protected override bool IsInAsyncContext(SyntaxNode node) 32foreach (var current in node.Ancestors())
CodeRefactorings\ConvertLocalFunctionToMethod\CSharpConvertLocalFunctionToMethodCodeRefactoringProvider.cs (7)
80localFunction.Body ?? (SyntaxNode)localFunction.ExpressionBody!.Expression); 150foreach (var node in parentBlock.DescendantNodes()) 169var currentNode = node; 238var newNode = generator.ValueReturningLambdaExpression(lambdaParameters, 258private static SyntaxNode GenerateArgument(IParameterSymbol p, string name, bool shouldUseNamedArguments = false) 264private static List<string> GetReservedNames(SyntaxNode node, SemanticModel semanticModel, CancellationToken cancellationToken) 296SyntaxNode localFunction,
CodeRefactorings\EnableNullable\EnableNullableCodeRefactoringProvider.cs (9)
72var updatedDocumentRoots = await ProducerConsumer<(DocumentId documentId, SyntaxNode newRoot)>.RunParallelAsync( 96private static async Task<SyntaxNode> EnableNullableReferenceTypesAsync(Document document, CancellationToken cancellationToken) 117private static (SyntaxNode root, SyntaxToken firstToken) RewriteExistingDirectives(SyntaxNode root, SyntaxToken firstToken) 134var updatedRoot = root.ReplaceNodes( 161private static async Task<SyntaxNode> DisableNullableReferenceTypesInExistingDocumentIfNecessaryAsync(Document document, SyntaxNode root, SyntaxToken firstToken, CancellationToken cancellationToken) 217private static SyntaxToken GetFirstTokenOfInterest(SyntaxNode root) 239private static bool HasLeadingNullableDirective(SyntaxNode root, [NotNullWhen(true)] out NullableDirectiveTriviaSyntax? leadingNullableDirective)
CodeRefactorings\ExtractClass\CSharpExtractClassCodeRefactoringProvider.cs (2)
39protected override async Task<SyntaxNode?> GetSelectedClassDeclarationAsync(CodeRefactoringContext context) 45protected override Task<ImmutableArray<SyntaxNode>> GetSelectedNodesAsync(CodeRefactoringContext context)
CodeRefactorings\InlineMethod\CSharpInlineMethodRefactoringProvider.cs (3)
59protected override SyntaxNode GenerateTypeSyntax(ITypeSymbol symbol, bool allowVar) 65protected override bool IsFieldDeclarationSyntax(SyntaxNode node) 101protected override bool CanBeReplacedByThrowExpression(SyntaxNode syntaxNode)
CodeRefactorings\InlineTemporary\InlineTemporaryCodeRefactoringProvider.cs (14)
182var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 214private static bool MayContainSideEffects(SyntaxNode expression) 251where T : SyntaxNode 253var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 262var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 266private static SyntaxNode GetScope(VariableDeclaratorSyntax variableDeclarator) 270var scope = localDeclaration.Parent; 284private static VariableDeclaratorSyntax FindDeclarator(SyntaxNode node) 292private static SyntaxNode RemoveDeclaratorFromVariableList(VariableDeclaratorSyntax variableDeclarator, VariableDeclarationSyntax variableDeclaration) 309private static SyntaxNode RemoveDeclaratorFromScope(VariableDeclaratorSyntax variableDeclarator, SyntaxNode scope) 340var newScope = scope.ReplaceToken(nextToken, newNextToken); 427private static SyntaxNode GetTopMostParentingExpression(ExpressionSyntax expression) 432var parent = node.Parent;
CodeRefactorings\InlineTemporary\InlineTemporaryCodeRefactoringProvider.ReferenceRewriter.cs (5)
47public override SyntaxNode? VisitIdentifierName(IdentifierNameSyntax node) 55public override SyntaxNode? VisitAnonymousObjectMemberDeclarator(AnonymousObjectMemberDeclaratorSyntax node) 77public override SyntaxNode? VisitArgument(ArgumentSyntax node) 105public static SyntaxNode Visit( 106SyntaxNode scope,
CodeRefactorings\MoveStaticMembers\CSharpMoveStaticMembersRefactoringProvider.cs (1)
24protected override Task<ImmutableArray<SyntaxNode>> GetSelectedNodesAsync(CodeRefactoringContext context)
CodeRefactorings\NodeSelectionHelpers.cs (3)
18internal static async Task<ImmutableArray<SyntaxNode>> GetSelectedDeclarationsOrVariablesAsync(CodeRefactoringContext context) 41FieldDeclarationSyntax fieldDeclaration => fieldDeclaration.Declaration.Variables.AsImmutable<SyntaxNode>(), 42EventFieldDeclarationSyntax eventFieldDeclaration => eventFieldDeclaration.Declaration.Variables.AsImmutable<SyntaxNode>(),
CodeRefactorings\PullMemberUp\CSharpPullMemberUpCodeRefactoringProvider.cs (1)
28protected override Task<ImmutableArray<SyntaxNode>> GetSelectedNodesAsync(CodeRefactoringContext context)
CodeRefactorings\SyncNamespace\CSharpChangeNamespaceService.cs (15)
39protected override async Task<ImmutableArray<(DocumentId, SyntaxNode)>> GetValidContainersFromAllLinkedDocumentsAsync( 41SyntaxNode container, 73protected override string GetDeclaredNamespace(SyntaxNode container) 84protected override SyntaxList<MemberDeclarationSyntax> GetMemberDeclarationsInContainer(SyntaxNode container) 107SyntaxNode reference, 110[NotNullWhen(returnValue: true)] out SyntaxNode? oldNode, 111[NotNullWhen(returnValue: true)] out SyntaxNode? newNode) 208[NotNullWhen(returnValue: true)] out SyntaxNode? newNode) 238var container = root.GetAnnotatedNodes(ContainerAnnotation).Single(); 338protected override async Task<SyntaxNode?> TryGetApplicableContainerFromSpanAsync(Document document, TextSpan span, CancellationToken cancellationToken) 340var syntaxRoot = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 343SyntaxNode? container = null; 362var node = compilationUnit.FindNode(span, getInnermostNodeForTie: true); 389static bool ContainsNamespaceDeclaration(SyntaxNode node) 394private static string? GetAliasQualifier(SyntaxNode? name)
CodeRefactorings\SyncNamespace\CSharpSyncNamespaceCodeRefactoringProvider.cs (1)
29protected override async Task<SyntaxNode?> TryGetApplicableInvocationNodeAsync(Document document, TextSpan span, CancellationToken cancellationToken)
CodeRefactorings\UseExplicitOrImplicitType\AbstractUseTypeCodeRefactoringProvider.cs (5)
24protected abstract TypeSyntax FindAnalyzableType(SyntaxNode node, SemanticModel semanticModel, CancellationToken cancellationToken); 35var declaration = await GetDeclarationAsync(context).ConfigureAwait(false); 71private static async Task<SyntaxNode> GetDeclarationAsync(CodeRefactoringContext context) 120var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 125var newRoot = editor.GetChangedRoot();
CodeRefactorings\UseExplicitOrImplicitType\UseExplicitTypeCodeRefactoringProvider.cs (1)
29protected override TypeSyntax FindAnalyzableType(SyntaxNode node, SemanticModel semanticModel, CancellationToken cancellationToken)
CodeRefactorings\UseExplicitOrImplicitType\UseImplicitTypeCodeRefactoringProvider.cs (1)
29protected override TypeSyntax FindAnalyzableType(SyntaxNode node, SemanticModel semanticModel, CancellationToken cancellationToken)
CodeRefactorings\UseRecursivePatterns\UseRecursivePatternsCodeRefactoringProvider.cs (11)
72private static Func<SyntaxNode, SyntaxNode>? GetReplacementFunc(SyntaxNode? node, SemanticModel model) 83private static bool IsFixableNode(SyntaxNode node) 94private static Func<SyntaxNode, SyntaxNode>? CombineLogicalAndOperands(BinaryExpressionSyntax logicalAnd, SemanticModel model) 151static SyntaxNode AdjustBinaryExpressionOperands(BinaryExpressionSyntax logicalAnd, ExpressionSyntax replacement) 162private static Func<SyntaxNode, SyntaxNode>? CombineWhenClauseCondition(PatternSyntax switchPattern, ExpressionSyntax condition, SemanticModel model) 503static bool IsNullCheck(SyntaxNode? exp) 602foreach (var originalNode in nodes.Reverse())
Completion\CompletionProviders\AwaitCompletionProvider.cs (6)
38protected override int GetSpanStart(SyntaxNode declaration) 48ParenthesizedLambdaExpressionSyntax parenthesizedLambda => (parenthesizedLambda.ReturnType as SyntaxNode ?? parenthesizedLambda.ParameterList).SpanStart, 54protected override SyntaxNode? GetAsyncSupportingDeclaration(SyntaxToken leftToken, int position) 61var parent = leftToken.Parent; 85protected override SyntaxNode? GetExpressionToPlaceAwaitInFrontOf(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) 104protected override ITypeSymbol? GetTypeSymbolOfExpression(SemanticModel semanticModel, SyntaxNode potentialAwaitableExpression, CancellationToken cancellationToken)
Completion\CompletionProviders\CrefCompletionProvider.cs (2)
49private Action<SyntaxNode?>? _testSpeculativeNodeCallback; 392public void SetSpeculativeNodeCallback(Action<SyntaxNode?> value)
Completion\CompletionProviders\DeclarationName\DeclarationNameInfo.cs (9)
221Func<TSyntaxNode, SyntaxNode?> typeSyntaxGetter, 224CancellationToken cancellationToken) where TSyntaxNode : SyntaxNode 242var typeSyntax = typeSyntaxGetter(target); 270Func<TSyntaxNode, SyntaxNode?> typeSyntaxGetter, 273CancellationToken cancellationToken) where TSyntaxNode : SyntaxNode 281Func<TSyntaxNode, SyntaxNode?> typeSyntaxGetter, 285out SyntaxNode? typeSyntax) where TSyntaxNode : SyntaxNode 611private static SyntaxNode? GetNodeDenotingTheTypeOfTupleArgument(ArgumentSyntax argumentSyntax)
Completion\CompletionProviders\ExplicitInterfaceTypeCompletionProvider.cs (2)
77var potentialTypeNode = targetToken.Parent; 150private static bool IsClassOrStructOrInterfaceOrRecord(SyntaxNode node)
Completion\CompletionProviders\ImportCompletion\ExtensionMethodImportCompletionProvider.cs (1)
38protected override bool IsFinalSemicolonOfUsingOrExtern(SyntaxNode directive, SyntaxToken token)
Completion\CompletionProviders\ImportCompletion\TypeImportCompletionProvider.cs (1)
38protected override bool IsFinalSemicolonOfUsingOrExtern(SyntaxNode directive, SyntaxToken token)
Completion\CompletionProviders\InternalsVisibleToCompletionProvider.cs (6)
29protected override IImmutableList<SyntaxNode> GetAssemblyScopedAttributeSyntaxNodesOfDocument(SyntaxNode documentRoot) 31var builder = (ImmutableList<SyntaxNode>.Builder?)null; 38builder ??= ImmutableList.CreateBuilder<SyntaxNode>(); 48protected override SyntaxNode? GetConstructorArgumentOfInternalsVisibleToAttribute(SyntaxNode internalsVisibleToAttribute)
Completion\CompletionProviders\NamedParameterCompletionProvider.cs (2)
153SyntaxNode invocableNode, 234var baseList = baseType.Parent;
Completion\CompletionProviders\ObjectAndWithInitializerCompletionProvider.cs (1)
147var parent = token.Parent?.Parent;
Completion\CompletionProviders\ObjectCreationCompletionProvider.cs (1)
41protected override SyntaxNode? GetObjectCreationNewExpression(SyntaxTree tree, int position, CancellationToken cancellationToken)
Completion\CompletionProviders\OperatorsAndIndexer\UnnamedSymbolCompletionProvider.cs (1)
78private static (SyntaxToken dotLikeToken, int expressionStart) GetDotAndExpressionStart(SyntaxNode root, int position, CancellationToken cancellationToken)
Completion\CompletionProviders\OverrideCompletionProvider.cs (6)
34protected override SyntaxNode GetSyntax(SyntaxToken token) 40?? (SyntaxNode?)token.GetAncestor<MethodDeclarationSyntax>() 85var parentMember = token.Parent; 212protected override int GetTargetCaretPosition(SyntaxNode caretTarget) 230var firstAccessorStatement = (SyntaxNode?)firstAccessor.Body?.Statements.LastOrDefault() ??
Completion\CompletionProviders\PartialMethodCompletionProvider.cs (3)
54protected override SyntaxNode GetSyntax(SyntaxToken token) 60?? (SyntaxNode?)token.GetAncestor<MethodDeclarationSyntax>() 64protected override int GetTargetCaretPosition(SyntaxNode caretTarget)
Completion\CompletionProviders\PartialTypeCompletionProvider.cs (2)
57protected override SyntaxNode? GetPartialTypeSyntaxNode(SyntaxTree tree, int position, CancellationToken cancellationToken) 75private static bool IsPartialTypeDeclaration(SyntaxNode syntax)
Completion\CompletionProviders\XmlDocCommentCompletionProvider.cs (1)
257private static (string? name, SyntaxList<XmlAttributeSyntax> attributes) GetElementNameAndAttributes(SyntaxNode node)
Completion\KeywordRecommenders\BreakKeywordRecommender.cs (1)
37foreach (var v in token.GetAncestors<SyntaxNode>())
Completion\KeywordRecommenders\ContinueKeywordRecommender.cs (1)
30foreach (var v in leaf.GetAncestors<SyntaxNode>())
Completion\KeywordRecommenders\FieldKeywordRecommender.cs (1)
46for (var node = targetToken.Parent; node != null; node = node.Parent)
Completion\KeywordRecommenders\RefKeywordRecommender.cs (1)
207var parent = token.Parent;
Completion\KeywordRecommenders\WhereKeywordRecommender.cs (1)
73var tokenParent = token.Parent;
ConvertAutoPropertyToFullProperty\CSharpConvertAutoPropertyToFullPropertyCodeRefactoringProvider.cs (22)
49protected override (SyntaxNode newGetAccessor, SyntaxNode newSetAccessor) GetNewAccessors( 50CSharpCodeGenerationContextInfo info, SyntaxNode property, 58var getAccessorStatement = generator.ReturnStatement(generator.IdentifierName(fieldName)); 59var newGetter = GetUpdatedAccessor(info, getAccessor, getAccessorStatement, cancellationToken); 61SyntaxNode newSetter = null; 64var setAccessorStatement = generator.ExpressionStatement(generator.AssignmentStatement( 78private static SyntaxNode GetUpdatedAccessor(CSharpCodeGenerationContextInfo info, 79SyntaxNode accessor, SyntaxNode statement, CancellationToken cancellationToken) 81var newAccessor = AddStatement(accessor, statement); 104internal static SyntaxNode AddStatement(SyntaxNode accessor, SyntaxNode statement) 115protected override SyntaxNode ConvertPropertyToExpressionBodyIfDesired( 116CSharpCodeGenerationContextInfo info, SyntaxNode property) 142protected override SyntaxNode GetTypeBlock(SyntaxNode syntaxNode) 145protected override SyntaxNode GetInitializerValue(SyntaxNode property) 148protected override SyntaxNode GetPropertyWithoutInitializer(SyntaxNode property)
ConvertForEachToFor\CSharpConvertForEachToForCodeRefactoringProvider.cs (3)
53protected override (SyntaxNode start, SyntaxNode end) GetForEachBody(ForEachStatementSyntax foreachStatement) 117SyntaxGenerator generator, ForEachInfo foreachInfo, SyntaxNode collectionVariableName, SyntaxToken indexVariable, bool donotCastElement)
ConvertForToForEach\CSharpConvertForToForEachCodeRefactoringProvider.cs (1)
112protected override SyntaxNode ConvertForNode(
ConvertIfToSwitch\CSharpConvertIfToSwitchCodeRefactoringProvider.Analyzer.cs (1)
34public override bool CanImplicitlyConvert(SemanticModel semanticModel, SyntaxNode syntax, ITypeSymbol targetType)
ConvertIfToSwitch\CSharpConvertIfToSwitchCodeRefactoringProvider.cs (1)
41protected override SyntaxTriviaList GetLeadingTriviaToTransfer(SyntaxNode syntaxToRemove)
ConvertIfToSwitch\CSharpConvertIfToSwitchCodeRefactoringProvider.Rewriting.cs (9)
31public override SyntaxNode CreateSwitchExpressionStatement(SyntaxNode target, ImmutableArray<AnalyzedSwitchSection> sections, Feature feature) 69public override SyntaxNode CreateSwitchStatement(IfStatementSyntax ifStatement, SyntaxNode expression, IEnumerable<SyntaxNode> sectionList) 90public override SyntaxNode AsSwitchLabelSyntax(AnalyzedSwitchLabel label, Feature feature) 108public override IEnumerable<SyntaxNode> AsSwitchSectionStatements(IOperation operation) 110var node = operation.Syntax; 115var statements = ArrayBuilder<SyntaxNode>.GetInstance();
ConvertLinq\ConvertForEachToLinqQuery\AbstractToMethodConverter.cs (2)
102void Convert(ExpressionSyntax replacingExpression, SyntaxNode nodeToRemoveIfFollowedByReturn) 144static SyntaxTrivia[] GetTriviaFromNode(SyntaxNode node)
ConvertLinq\ConvertForEachToLinqQuery\CSharpConvertForEachToLinqQueryProvider.cs (3)
285var memberDeclarationSyntax = memberDeclarationSymbol.DeclaringSyntaxReferences.Single().GetSyntax(); 337protected override SyntaxNode AddLinqUsing( 340SyntaxNode root)
ConvertLinq\CSharpConvertLinqQueryToForEachProvider.cs (5)
249SyntaxNode currentNode = _source; 740var memberDeclarationNode = FindParentMemberDeclarationNode(returnStatement, out var declaredSymbol); 778private SyntaxNode FindParentMemberDeclarationNode(SyntaxNode node, out ISymbol declaredSymbol) 926private static bool IsWithinImmediateLambdaOrAnonymousMethod(SyntaxNode node)
ConvertPrimaryToRegularConstructor\ConvertPrimaryToRegularConstructorCodeRefactoringProvider.cs (1)
384var formattedRoot = Formatter.Format(currentRoot, SyntaxAnnotation.ElasticAnnotation, solution.Services, formattingOptions, cancellationToken);
ConvertProgram\ConvertProgramTransform_ProgramMain.cs (1)
152private static TSyntaxNode FixupComments<TSyntaxNode>(TSyntaxNode node) where TSyntaxNode : SyntaxNode
ConvertProgram\ConvertProgramTransform_TopLevelStatements.cs (4)
39var rootWithGlobalStatements = GetRootWithGlobalStatements( 69Document document, SyntaxNode root, BaseNamespaceDeclarationSyntax namespaceDeclaration, CodeCleanupOptions options, CancellationToken cancellationToken) 97private static SyntaxNode GetRootWithGlobalStatements( 100SyntaxNode root,
ConvertToRawString\ConvertInterpolatedStringToRawStringCodeRefactoringProvider.cs (3)
251static SyntaxNode GetAnchorNode(ParsedDocument parsedDocument, SyntaxNode node) 271for (var current = node; current != null; current = current.Parent)
ConvertToRawString\ConvertStringToRawStringCodeRefactoringProvider.cs (1)
151var node = editor.OriginalRoot.FindNode(fixSpan);
ConvertToRawString\ConvertToRawStringHelpers.cs (1)
65public static bool IsInDirective(SyntaxNode? node)
Copilot\CSharpCopilotCodeFixProvider.cs (3)
81var containingMethod = CSharpSyntaxFacts.Instance.GetContainingMethodDeclaration(root, diagnostic.Location.SourceSpan.Start, useFullSpan: false); 93SyntaxNode method, 123async Task<Document> GetFixedDocumentAsync(SyntaxNode method, string fix, CancellationToken cancellationToken)
Copilot\CSharpCopilotCodeFixProvider.DismissChangesCodeAction.cs (2)
21private sealed class CopilotDismissChangesCodeAction(SyntaxNode originalMethodNode, Diagnostic diagnostic) : CodeAction 32private sealed class TriggerDismissalCodeActionOperation(SyntaxNode originalMethodNode, Diagnostic diagnostic) : CodeActionOperation
Debugging\CSharpProximityExpressionsService.cs (1)
56var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
Debugging\DataTipInfoGetter.cs (1)
25var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
Debugging\LocationInfoGetter.cs (1)
25var root = await tree.GetRootAsync(cancellationToken).ConfigureAwait(false);
DecompiledSource\CSharpDecompiledSourceService.cs (2)
100var syntaxRoot = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 102var newSyntaxRoot = DocCommentConverter.ConvertToRegularComments(syntaxRoot, docCommentFormattingService, cancellationToken);
Diagnostics\Analyzers\CSharpSimplifyTypeNamesDiagnosticAnalyzer.cs (6)
35protected override bool IsIgnoredCodeBlock(SyntaxNode codeBlock) 51protected override ImmutableArray<Diagnostic> AnalyzeCodeBlock(CodeBlockAnalysisContext context, SyntaxNode root) 67protected override ImmutableArray<Diagnostic> AnalyzeSemanticModel(SemanticModelAnalysisContext context, SyntaxNode root, TextSpanMutableIntervalTree? codeBlockIntervalTree) 78internal override bool IsCandidate(SyntaxNode node) 82SemanticModel model, SyntaxNode node, CSharpSimplifierOptions options, 102SyntaxNode replacementSyntax;
Diagnostics\Analyzers\CSharpUnboundIdentifiersDiagnosticAnalyzer.cs (1)
28protected override bool IsNameOf(SyntaxNode node)
Diagnostics\Analyzers\TypeSyntaxSimplifierWalker.cs (2)
83var root = semanticModel.SyntaxTree.GetRoot(cancellationToken); 287private bool TrySimplify(SyntaxNode node)
DocumentationComments\CSharpDocumentationCommentSnippetService.cs (3)
147private static IEnumerable<string> GetExceptions(SyntaxNode member) 155foreach (var throwExpressionOrStatement in throwExpressionsAndStatements) 186for (SyntaxNode? current = exceptionType; current != null; current = current?.Parent)
DocumentationComments\DocCommentConverter.cs (4)
21public static SyntaxNode ConvertToRegularComments(SyntaxNode node, IDocumentationCommentFormattingService formattingService, CancellationToken cancellationToken) 35public override SyntaxNode Visit(SyntaxNode node)
EditAndContinue\BreakpointSpans.cs (8)
38var root = tree.GetRoot(cancellationToken); 69public static bool TryGetClosestBreakpointSpan(SyntaxNode root, int position, int minLength, out TextSpan span) 71var node = root.FindToken(position).Parent; 112private static TextSpan CreateSpan(SyntaxNode node) 115private static TextSpan CreateSpan(SyntaxNode node, SyntaxToken token) 164private static TextSpan? TryCreateSpanForNode(SyntaxNode node, int position) 901where TNode : SyntaxNode 946var parent = expression.Parent;
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (183)
29internal sealed class CSharpEditAndContinueAnalyzer(Action<SyntaxNode>? testFaultInjector = null) : AbstractEditAndContinueAnalyzer(testFaultInjector) 77internal override bool TryFindMemberDeclaration(SyntaxNode? root, SyntaxNode node, TextSpan activeSpan, out OneOrMany<SyntaxNode> declarations) 79var current = node; 180internal override MemberBody? TryGetDeclarationBody(SyntaxNode node, ISymbol? symbol) 183internal override bool IsDeclarationWithSharedBody(SyntaxNode declaration, ISymbol member) 189protected override IEnumerable<SyntaxNode> GetVariableUseSites(IEnumerable<SyntaxNode> roots, ISymbol localOrParameter, SemanticModel model, CancellationToken cancellationToken) 205internal static SyntaxNode FindStatementAndPartner( 207SyntaxNode body, 208SyntaxNode? partnerBody, 209out SyntaxNode? partnerStatement, 220SyntaxNode node; 375private static bool AreEquivalentIgnoringLambdaBodies(SyntaxNode left, SyntaxNode right) 386internal override bool IsClosureScope(SyntaxNode node) 389internal override SyntaxNode GetCapturedParameterScope(SyntaxNode methodOrLambda) 397BaseMethodDeclarationSyntax method => method.Body ?? (SyntaxNode?)method.ExpressionBody!, 405protected override LambdaBody? FindEnclosingLambdaBody(SyntaxNode encompassingAncestor, SyntaxNode node) 407var current = node; 421protected override Match<SyntaxNode> ComputeTopLevelMatch(SyntaxNode oldCompilationUnit, SyntaxNode newCompilationUnit) 424protected override BidirectionalMap<SyntaxNode>? ComputeParameterMap(SyntaxNode oldDeclaration, SyntaxNode newDeclaration) 426BidirectionalMap<SyntaxNode>.FromMatch(SyntaxComparer.TopLevel.ComputeMatch(oldParameterList, newParameterList)) : null; 428private static SyntaxNode? GetDeclarationParameterList(SyntaxNode declaration) 437internal static Match<SyntaxNode> ComputeBodyMatch(SyntaxNode oldBody, SyntaxNode newBody, IEnumerable<KeyValuePair<SyntaxNode, SyntaxNode>>? knownMatches) 463static SyntaxNode GetMatchingRoot(SyntaxNode body) 465var parent = body.Parent!; 471var oldRoot = GetMatchingRoot(oldBody); 472var newRoot = GetMatchingRoot(newBody); 481private static IEnumerable<SyntaxNode> GetChildNodes(SyntaxNode root, SyntaxNode body) 519SyntaxNode oldBody, 520SyntaxNode newBody, 521SyntaxNode oldStatement, 522[NotNullWhen(true)] out SyntaxNode? newStatement) 543protected override bool IsNamespaceDeclaration(SyntaxNode node) 546private static bool IsTypeDeclaration(SyntaxNode node) 549protected override bool IsCompilationUnitWithGlobalStatements(SyntaxNode node) 552protected override bool IsGlobalStatement(SyntaxNode node) 555protected override IEnumerable<SyntaxNode> GetTopLevelTypeDeclarations(SyntaxNode compilationUnit) 587protected override IEnumerable<SequenceEdit> GetSyntaxSequenceEdits(ImmutableArray<SyntaxNode> oldNodes, ImmutableArray<SyntaxNode> newNodes) 590internal override SyntaxNode EmptyCompilationUnit 597protected override bool StatementLabelEquals(SyntaxNode node1, SyntaxNode node2) 603protected override bool TryGetActiveSpan(SyntaxNode node, int statementPart, int minLength, out TextSpan span) 687public static (SyntaxNode node, int part) GetFirstBodyActiveStatement(SyntaxNode memberBody) 690protected override IEnumerable<(SyntaxNode statement, int statementPart)> EnumerateNearStatements(SyntaxNode statement) 702var parent = statement.Parent; 747var node = nodeOrToken.AsNode(); 781protected override bool AreEquivalentActiveStatements(SyntaxNode oldStatement, SyntaxNode newStatement, int statementPart) 893(SyntaxNode?)oldNode.Declaration ?? oldNode.Expression!, 894(SyntaxNode?)newNode.Declaration ?? newNode.Expression!); 930internal override bool IsInterfaceDeclaration(SyntaxNode node) 933internal override bool IsRecordDeclaration(SyntaxNode node) 936internal override SyntaxNode? TryGetContainingTypeDeclaration(SyntaxNode node) 939internal override bool IsDeclarationWithInitializer(SyntaxNode declaration) 942internal override bool IsPrimaryConstructorDeclaration(SyntaxNode declaration) 997protected override SyntaxNode? GetSymbolDeclarationSyntax(ISymbol symbol, Func<ImmutableArray<SyntaxReference>, SyntaxReference?> selector, CancellationToken cancellationToken) 1002var syntax = symbol switch 1022protected override ISymbol? GetDeclaredSymbol(SemanticModel model, SyntaxNode declaration, CancellationToken cancellationToken) 1037SyntaxNode? oldNode, 1038SyntaxNode? newNode, 1081SyntaxNode? oldNode, 1083SyntaxNode? newNode, 1087Match<SyntaxNode> topMatch, 1088IReadOnlyDictionary<SyntaxNode, EditKind> editMap, 1315var node = oldNode ?? newNode; 1393SyntaxNode node, 1429private ISymbol? GetParameterContainingMemberOrType(SyntaxNode? node, SyntaxNode? otherNode, SemanticModel? model, IReadOnlyDictionary<SyntaxNode, SyntaxNode> fromOtherMap, CancellationToken cancellationToken) 1434SyntaxNode? declaration; 1456static SyntaxNode GetContainingDeclaration(SyntaxNode node) 1460private static bool SupportsMove(SyntaxNode node) 1465internal override Func<SyntaxNode, bool> IsLambda 1468internal override Func<SyntaxNode, bool> IsNotLambda 1471internal override bool IsLocalFunction(SyntaxNode node) 1474internal override bool IsGenericLocalFunction(SyntaxNode node) 1477internal override bool IsNestedFunction(SyntaxNode node) 1480internal override bool TryGetLambdaBodies(SyntaxNode node, [NotNullWhen(true)] out LambdaBody? body1, out LambdaBody? body2) 1494internal override IMethodSymbol GetLambdaExpressionSymbol(SemanticModel model, SyntaxNode lambdaExpression, CancellationToken cancellationToken) 1500internal override SyntaxNode? GetContainingQueryExpression(SyntaxNode node) 1503internal override bool QueryClauseLambdasTypeEquivalent(SemanticModel oldModel, SyntaxNode oldNode, SemanticModel newModel, SyntaxNode newNode, CancellationToken cancellationToken) 1604protected override TextSpan? TryGetDiagnosticSpan(SyntaxNode node, EditKind editKind) 1607internal static new TextSpan GetDiagnosticSpan(SyntaxNode node, EditKind editKind) 1610private static TextSpan? TryGetDiagnosticSpanImpl(SyntaxNode node, EditKind editKind) 1614internal static TextSpan? TryGetDiagnosticSpanImpl(SyntaxKind kind, SyntaxNode node, EditKind editKind) 1623var globalNode = 1749var startNode = parameter.Type ?? (SyntaxNode)parameter; 1945internal override TextSpan GetLambdaParameterDiagnosticSpan(SyntaxNode lambda, int ordinal) 1995protected override string? TryGetDisplayName(SyntaxNode node, EditKind editKind) 1998internal static new string? GetDisplayName(SyntaxNode node, EditKind editKind) 2001internal static string? TryGetDisplayNameImpl(SyntaxNode node, EditKind editKind) 2265protected override string GetSuspensionPointDisplayName(SyntaxNode node, EditKind editKind) 2290private readonly Match<SyntaxNode>? _match; 2291private readonly SyntaxNode? _oldNode; 2292private readonly SyntaxNode? _newNode; 2299SyntaxNode? oldNode, 2300SyntaxNode? newNode, 2302Match<SyntaxNode>? match = null, 2319private void ReportError(RudeEditKind kind, SyntaxNode? spanNode = null, SyntaxNode? displayNode = null) 2322var node = displayNode ?? _newNode ?? _oldNode; 2372private void ClassifyMove(SyntaxNode newNode) 2382private void ClassifyReorder(SyntaxNode newNode) 2403private void ClassifyInsert(SyntaxNode node) 2427private void ClassifyDelete(SyntaxNode oldNode) 2453private void ClassifyUpdate(SyntaxNode newNode) 2479Match<SyntaxNode> match, 2480Edit<SyntaxNode> edit, 2481Dictionary<SyntaxNode, EditKind> editMap) 2492internal override bool HasUnsupportedOperation(IEnumerable<SyntaxNode> nodes, [NotNullWhen(true)] out SyntaxNode? unsupportedNode, out RudeEditKind rudeEdit) 2497foreach (var node in nodes) 2516internal override void ReportInsertedMemberSymbolRudeEdits(ArrayBuilder<RudeEditDiagnostic> diagnostics, ISymbol newSymbol, SyntaxNode newNode, bool insertingIntoExistingContainingType) 2578protected override List<SyntaxNode> GetExceptionHandlingAncestors(SyntaxNode node, SyntaxNode root, bool isNonLeaf) 2580var result = new List<SyntaxNode>(); 2582var current = node; 2631IEnumerable<Edit<SyntaxNode>> exceptionHandlingEdits, 2632SyntaxNode oldStatement, 2647private static bool AreExceptionClausesEquivalent(SyntaxNode oldNode, SyntaxNode newNode) 2680protected override TextSpan GetExceptionHandlingRegion(SyntaxNode node, out bool coversAllChildren) 2719internal override bool IsStateMachineMethod(SyntaxNode declaration) 2722internal override void ReportStateMachineSuspensionPointRudeEdits(DiagnosticContext diagnosticContext, SyntaxNode oldNode, SyntaxNode newNode) 2726var oldContainingStatementPart = FindContainingStatementPart(oldNode); 2727var newContainingStatementPart = FindContainingStatementPart(newNode); 2738private static SyntaxNode FindContainingStatementPart(SyntaxNode node) 2772private static bool HasNoSpilledState(SyntaxNode awaitExpression, SyntaxNode containingStatementPart) 2813private static ExpressionSyntax GetExpressionFromStatementPart(SyntaxNode statement) 2829private static bool IsSimpleAwaitAssignment(SyntaxNode node, SyntaxNode awaitExpression) 2845IReadOnlyDictionary<SyntaxNode, SyntaxNode> reverseMap, 2846SyntaxNode oldActiveStatement, 2849SyntaxNode newActiveStatement, 2867private void ReportRudeEditsForSwitchWhenClauses(ArrayBuilder<RudeEditDiagnostic> diagnostics, SyntaxNode oldActiveStatement, SyntaxNode newActiveStatement) 2924SyntaxNode oldActiveStatement, 2925SyntaxNode newActiveStatement, 2958private static CheckedStatementSyntax? TryGetCheckedStatementAncestor(SyntaxNode? node) 2979IReadOnlyDictionary<SyntaxNode, SyntaxNode> reverseMap, 2980SyntaxNode oldActiveStatement, 2981SyntaxNode oldEncompassingAncestor, 2983SyntaxNode newActiveStatement, 2984SyntaxNode newEncompassingAncestor, 3007getTypedNodes: static n => OneOrMany.OneOrNone<SyntaxNode>(n.Expression), 3038getTypedNodes: static n => OneOrMany.Create<SyntaxNode>(n.Expression!), 3053getTypedNodes: static n => OneOrMany.OneOrNone<SyntaxNode>(n.Expression), 3058static OneOrMany<SyntaxNode> GetTypedNodes(VariableDeclarationSyntax declaration) 3060? OneOrMany.Create<SyntaxNode>(initializer.Value) 3061: OneOrMany.Create(declaration.Variables.Select(static v => (SyntaxNode?)v.Initializer?.Value).WhereNotNull().ToImmutableArray());
EditAndContinue\DeclarationBody\CopyConstructorDeclarationBody.cs (6)
21public override SyntaxNode? ExplicitBody 24public override SyntaxNode? ParameterClosure 27public override SyntaxNode? MatchRoot 30public override SyntaxNode InitializerActiveStatement 36public override OneOrMany<SyntaxNode> RootNodes 39public override SyntaxNode EncompassingAncestor
EditAndContinue\DeclarationBody\CSharpLambdaBody.cs (14)
15internal sealed class CSharpLambdaBody(SyntaxNode node) : LambdaBody 17public SyntaxNode Node 23public override OneOrMany<SyntaxNode> RootNodes 26public override SyntaxNode EncompassingAncestor 38public override Match<SyntaxNode>? ComputeSingleRootMatch(DeclarationBody newBody, IEnumerable<KeyValuePair<SyntaxNode, SyntaxNode>>? knownMatches) 41public override DeclarationBodyMap ComputeMap(DeclarationBody newBody, IEnumerable<KeyValuePair<SyntaxNode, SyntaxNode>>? knownMatches) 51public override bool TryMatchActiveStatement(DeclarationBody newBody, SyntaxNode oldStatement, ref int statementPart, [NotNullWhen(true)] out SyntaxNode? newStatement) 54public override LambdaBody? TryGetPartnerLambdaBody(SyntaxNode newLambda) 57public override IEnumerable<SyntaxNode> GetExpressionsAndStatements() 60public override SyntaxNode GetLambda()
EditAndContinue\DeclarationBody\ExplicitAutoPropertyAccessorDeclarationBody.cs (3)
19public override SyntaxNode? ExplicitBody 22public override SyntaxNode? HeaderActiveStatement 31public override SyntaxNode? MatchRoot
EditAndContinue\DeclarationBody\FieldWithInitializerDeclarationBody.cs (10)
45public override SyntaxNode EncompassingAncestor 57public override OneOrMany<SyntaxNode> RootNodes 58=> OneOrMany.Create<SyntaxNode>(InitializerExpression); 60public override Match<SyntaxNode>? ComputeSingleRootMatch(DeclarationBody newBody, IEnumerable<KeyValuePair<SyntaxNode, SyntaxNode>>? knownMatches) 63public override bool TryMatchActiveStatement(DeclarationBody newBody, SyntaxNode oldStatement, ref int statementPart, [NotNullWhen(true)] out SyntaxNode? newStatement) 75public override SyntaxNode FindStatementAndPartner(TextSpan span, MemberBody? partnerDeclarationBody, out SyntaxNode? partnerStatement, out int statementPart)
EditAndContinue\DeclarationBody\InstanceConstructorDeclarationBody.cs (13)
18public abstract SyntaxNode InitializerActiveStatement { get; } 19public abstract SyntaxNode? MatchRoot { get; } 24public abstract SyntaxNode? ExplicitBody { get; } 29public abstract SyntaxNode? ParameterClosure { get; } 37public sealed override SyntaxNode FindStatementAndPartner(TextSpan span, MemberBody? partnerDeclarationBody, out SyntaxNode? partnerStatement, out int statementPart) 74public sealed override bool TryMatchActiveStatement(DeclarationBody newBody, SyntaxNode oldStatement, ref int statementPart, [NotNullWhen(true)] out SyntaxNode? newStatement) 102public sealed override Match<SyntaxNode>? ComputeSingleRootMatch(DeclarationBody newBody, IEnumerable<KeyValuePair<SyntaxNode, SyntaxNode>>? knownMatches) 107public override DeclarationBodyMap ComputeMap(DeclarationBody newBody, IEnumerable<KeyValuePair<SyntaxNode, SyntaxNode>>? knownMatches)
EditAndContinue\DeclarationBody\OrdinaryInstanceConstructorDeclarationBody.cs (8)
16public SyntaxNode Body 17=> (SyntaxNode?)constructor.Body ?? constructor.ExpressionBody?.Expression!; 19public sealed override SyntaxNode? ExplicitBody 22public sealed override SyntaxNode EncompassingAncestor 25public sealed override SyntaxNode? MatchRoot 28public sealed override SyntaxNode? ParameterClosure 31public override OneOrMany<SyntaxNode> RootNodes 32=> OneOrMany.Create<SyntaxNode>(constructor);
EditAndContinue\DeclarationBody\OrdinaryInstanceConstructorWithExplicitInitializerDeclarationBody.cs (1)
23public override SyntaxNode InitializerActiveStatement
EditAndContinue\DeclarationBody\OrdinaryInstanceConstructorWithImplicitInitializerDeclarationBody.cs (1)
17public override SyntaxNode InitializerActiveStatement
EditAndContinue\DeclarationBody\PrimaryConstructorDeclarationBody.cs (3)
21public sealed override SyntaxNode? ExplicitBody 24public sealed override OneOrMany<SyntaxNode> RootNodes 27public sealed override SyntaxNode? ParameterClosure
EditAndContinue\DeclarationBody\PrimaryConstructorWithExplicitInitializerDeclarationBody.cs (3)
26public override SyntaxNode InitializerActiveStatement 32public override SyntaxNode? MatchRoot 38public sealed override SyntaxNode EncompassingAncestor
EditAndContinue\DeclarationBody\PrimaryConstructorWithImplicitInitializerDeclarationBody.cs (3)
26public override SyntaxNode InitializerActiveStatement 32public override SyntaxNode? MatchRoot 38public sealed override SyntaxNode EncompassingAncestor
EditAndContinue\DeclarationBody\PropertyOrIndexerAccessorDeclarationBody.cs (13)
47public abstract SyntaxNode? ExplicitBody { get; } 52public abstract SyntaxNode? HeaderActiveStatement { get; } 56public abstract SyntaxNode? MatchRoot { get; } 58public SyntaxNode RootNode 67public sealed override OneOrMany<SyntaxNode> RootNodes 70public sealed override SyntaxNode EncompassingAncestor 79public sealed override SyntaxNode FindStatementAndPartner(TextSpan span, MemberBody? partnerDeclarationBody, out SyntaxNode? partnerStatement, out int statementPart) 101public sealed override bool TryMatchActiveStatement(DeclarationBody newBody, SyntaxNode oldStatement, ref int statementPart, [NotNullWhen(true)] out SyntaxNode? newStatement) 149public sealed override Match<SyntaxNode>? ComputeSingleRootMatch(DeclarationBody newBody, IEnumerable<KeyValuePair<SyntaxNode, SyntaxNode>>? knownMatches)
EditAndContinue\DeclarationBody\PropertyOrIndexerAccessorWithExplicitBodyDeclarationBody.cs (6)
26public SyntaxNode Body 27=> (SyntaxNode?)accessor.Body ?? accessor.ExpressionBody!.Expression; 29public override SyntaxNode? ExplicitBody 32public override SyntaxNode? HeaderActiveStatement 38public override SyntaxNode? MatchRoot 39=> (SyntaxNode?)accessor.Body ?? accessor.ExpressionBody!;
EditAndContinue\DeclarationBody\PropertyOrIndexerWithExplicitBodyDeclarationBody.cs (3)
24public override SyntaxNode? ExplicitBody 27public override SyntaxNode? HeaderActiveStatement 33public override SyntaxNode? MatchRoot
EditAndContinue\DeclarationBody\RecordParameterDeclarationBody.cs (3)
16public override SyntaxNode? ExplicitBody 19public override SyntaxNode? HeaderActiveStatement 25public override SyntaxNode? MatchRoot
EditAndContinue\DeclarationBody\SimpleMemberBody.cs (8)
14internal sealed class SimpleMemberBody(SyntaxNode node) : AbstractSimpleMemberBody(node) 16public override SyntaxNode FindStatementAndPartner(TextSpan span, MemberBody? partnerDeclarationBody, out SyntaxNode? partnerStatement, out int statementPart) 30public override Match<SyntaxNode>? ComputeSingleRootMatch(DeclarationBody newBody, IEnumerable<KeyValuePair<SyntaxNode, SyntaxNode>>? knownMatches) 33public override bool TryMatchActiveStatement(DeclarationBody newBody, SyntaxNode oldStatement, ref int statementPart, [NotNullWhen(true)] out SyntaxNode? newStatement)
EditAndContinue\DeclarationBody\TopLevelCodeDeclarationBody.cs (10)
35public override SyntaxNode EncompassingAncestor 47public override OneOrMany<SyntaxNode> RootNodes 48=> OneOrMany.Create(GlobalStatements.ToImmutableArray<SyntaxNode>()); 50public override Match<SyntaxNode>? ComputeSingleRootMatch(DeclarationBody newBody, IEnumerable<KeyValuePair<SyntaxNode, SyntaxNode>>? knownMatches) 53public override SyntaxNode FindStatementAndPartner(TextSpan span, MemberBody? partnerDeclarationBody, out SyntaxNode? partnerStatement, out int statementPart) 61public override bool TryMatchActiveStatement(DeclarationBody newBody, SyntaxNode oldStatement, ref int statementPart, [NotNullWhen(true)] out SyntaxNode? newStatement)
EditAndContinue\SyntaxComparer.cs (50)
27SyntaxNode? oldRoot, 28SyntaxNode? newRoot, 29IEnumerable<SyntaxNode>? oldRootChildren, 30IEnumerable<SyntaxNode>? newRootChildren, 36protected override bool IsLambdaBodyStatementOrExpression(SyntaxNode node) 234internal override int Classify(int kind, SyntaxNode? node, out bool isLeaf) 237internal Label Classify(SyntaxKind kind, SyntaxNode? node, out bool isLeaf) 293private static Label ClassifyStatementSyntax(SyntaxKind kind, SyntaxNode? node, out bool isLeaf) 560private static Label ClassifyTopSyntax(SyntaxKind kind, SyntaxNode? node, out bool isLeaf) 706public override bool ValuesEqual(SyntaxNode left, SyntaxNode right) 765private static SyntaxNode? GetBody(SyntaxNode node) 769case BaseMethodDeclarationSyntax baseMethodDeclarationSyntax: return baseMethodDeclarationSyntax.Body ?? (SyntaxNode?)baseMethodDeclarationSyntax.ExpressionBody?.Expression; 770case AccessorDeclarationSyntax accessorDeclarationSyntax: return accessorDeclarationSyntax.Body ?? (SyntaxNode?)accessorDeclarationSyntax.ExpressionBody?.Expression; 775protected override bool TryComputeWeightedDistance(SyntaxNode leftNode, SyntaxNode rightNode, out double distance) 817(SyntaxNode?)leftUsing.Expression ?? leftUsing.Declaration!, 819(SyntaxNode?)rightUsing.Expression ?? rightUsing.Declaration!, 938private static double ComputeWeightedDistanceOfNestedFunctions(SyntaxNode leftNode, SyntaxNode rightNode) 965SyntaxNode nestedFunction, 968out SyntaxNode body, 1021body = (SyntaxNode?)localFunction.Body ?? localFunction.ExpressionBody!; 1203SyntaxNode? leftHeader, 1205SyntaxNode? rightHeader, 1281foreach (var child in block.ChildNodes()) 1376SyntaxNode? left1, 1377SyntaxNode? right1, 1378SyntaxNode? left2, 1379SyntaxNode? right2, 1411private static SyntaxNodeOrToken? TryGetName(SyntaxNode node) 1506public sealed override double GetDistance(SyntaxNode oldNode, SyntaxNode newNode) 1528internal static double ComputeValueDistance(SyntaxNode? oldNode, SyntaxNode? newNode) 1557var leftNode = oldNodeOrToken.AsNode(); 1558var rightNode = newNodeOrToken.AsNode(); 1571where TSyntaxNode : SyntaxNode 1588public static double ComputeDistance(SyntaxNode? oldNode, SyntaxNode? newNode) 1627public static double ComputeDistance(IEnumerable<SyntaxNode>? oldNodes, IEnumerable<SyntaxNode>? newNodes) 1633public static IEnumerable<SequenceEdit> GetSequenceEdits(IEnumerable<SyntaxNode>? oldNodes, IEnumerable<SyntaxNode>? newNodes) 1639public static IEnumerable<SequenceEdit> GetSequenceEdits(ImmutableArray<SyntaxNode> oldNodes, ImmutableArray<SyntaxNode> newNodes) 1662private sealed class LcsNodes : LongestCommonImmutableArraySubsequence<SyntaxNode> 1666protected override bool Equals(SyntaxNode oldElement, SyntaxNode newElement)
EditAndContinue\SyntaxUtilities.cs (16)
18public static LambdaBody CreateLambdaBody(SyntaxNode node) 21public static MemberBody? TryGetDeclarationBody(SyntaxNode node, ISymbol? symbol) 75internal static MemberBody? CreateSimpleBody(SyntaxNode? body) 86public static SyntaxNode? BlockOrExpression(BlockSyntax? blockBody, ArrowExpressionClauseSyntax? expressionBody) 87=> (SyntaxNode?)blockBody ?? expressionBody?.Expression; 90public static void AssertIsBody(SyntaxNode syntax, bool allowLambda) 139public static SyntaxNode? TryGetEffectiveGetterBody(SyntaxNode declaration) 154public static SyntaxNode? TryGetEffectiveGetterBody(ArrowExpressionClauseSyntax? propertyBody, AccessorListSyntax? accessorList) 167return (SyntaxNode?)firstGetter.Body ?? firstGetter.ExpressionBody?.Expression; 170public static SyntaxTokenList? TryGetFieldOrPropertyModifiers(SyntaxNode node) 181public static bool IsParameterlessConstructor(SyntaxNode declaration) 206public static bool IsAsyncDeclaration(SyntaxNode declaration) 240public static IEnumerable<SyntaxNode> GetSuspensionPoints(SyntaxNode body) 244public static bool IsIterator(SyntaxNode body)
EncapsulateField\CSharpEncapsulateFieldService.cs (5)
36protected override async Task<SyntaxNode> RewriteFieldNameAndAccessibilityAsync(string originalFieldName, bool makePrivate, Document document, SyntaxAnnotation declarationAnnotation, CancellationToken cancellationToken) 38var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 40var declarator = root.GetAnnotatedNodes<VariableDeclaratorSyntax>(declarationAnnotation).FirstOrDefault(); 65var declaration = root.GetAnnotatedNodes<SyntaxNode>(tempAnnotation).First().Parent as VariableDeclarationSyntax; 126var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
ExtractInterface\CSharpExtractInterfaceService.cs (3)
32protected override async Task<SyntaxNode> GetTypeDeclarationAsync(Document document, int position, TypeDiscoveryRule typeDiscoveryRule, CancellationToken cancellationToken) 42var relevantNode = await document.TryGetRelevantNodeAsync<SyntaxNode>(span, cancellationToken).ConfigureAwait(false); 60internal override bool ShouldIncludeAccessibilityModifier(SyntaxNode typeNode)
ExtractMethod\CSharpMethodExtractor.Analyzer.cs (1)
52protected override bool ContainsReturnStatementInSelectedCode(IEnumerable<SyntaxNode> jumpOutOfRegionStatements)
ExtractMethod\CSharpMethodExtractor.cs (8)
31protected override SyntaxNode GetInsertionPointNode( 128SyntaxNode GetInsertionPointForGlobalStatement(GlobalStatementSyntax globalStatement, MemberDeclarationSyntax memberNode) 145private bool OriginalSelectionWithin(SyntaxNode node) 167protected override SyntaxNode ParseTypeName(string name) 173SyntaxNode methodDefinition, 180var originalMethodDefinition = methodDefinition; 191var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 194var newRoot = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.CallSiteContainerRewriter.cs (35)
24private readonly SyntaxNode _outmostCallSiteContainer; 26private readonly SyntaxNode _firstStatementOrFieldToReplace; 27private readonly SyntaxNode _lastStatementOrFieldToReplace; 28private readonly ImmutableArray<SyntaxNode> _statementsOrMemberOrAccessorToInsert; 31SyntaxNode outmostCallSiteContainer, 33SyntaxNode firstStatementOrFieldToReplace, 34SyntaxNode lastStatementOrFieldToReplace, 35ImmutableArray<SyntaxNode> statementsOrFieldToInsert) 54public SyntaxNode Generate() 57private SyntaxNode ContainerOfStatementsOrFieldToReplace => _firstStatementOrFieldToReplace.Parent; 59public override SyntaxNode VisitLocalDeclarationStatement(LocalDeclarationStatementSyntax node) 126public override SyntaxNode VisitBlock(BlockSyntax node) 137public override SyntaxNode VisitSwitchSection(SwitchSectionSyntax node) 149public override SyntaxNode VisitLabeledStatement(LabeledStatementSyntax node) 159public override SyntaxNode VisitElseClause(ElseClauseSyntax node) 169public override SyntaxNode VisitIfStatement(IfStatementSyntax node) 181public override SyntaxNode VisitLockStatement(LockStatementSyntax node) 192public override SyntaxNode VisitFixedStatement(FixedStatementSyntax node) 203public override SyntaxNode VisitUsingStatement(UsingStatementSyntax node) 215public override SyntaxNode VisitForEachStatement(ForEachStatementSyntax node) 226public override SyntaxNode VisitForEachVariableStatement(ForEachVariableStatementSyntax node) 237public override SyntaxNode VisitForStatement(ForStatementSyntax node) 251public override SyntaxNode VisitDoStatement(DoStatementSyntax node) 262public override SyntaxNode VisitWhileStatement(WhileStatementSyntax node) 273private TNode VisitNode<TNode>(TNode node) where TNode : SyntaxNode 294where TSyntax : SyntaxNode 345public override SyntaxNode VisitGlobalStatement(GlobalStatementSyntax node) 355public override SyntaxNode VisitInterfaceDeclaration(InterfaceDeclarationSyntax node) 365public override SyntaxNode VisitConstructorDeclaration(ConstructorDeclarationSyntax node) 376public override SyntaxNode VisitClassDeclaration(ClassDeclarationSyntax node) 386public override SyntaxNode VisitRecordDeclaration(RecordDeclarationSyntax node) 396public override SyntaxNode VisitStructDeclaration(StructDeclarationSyntax node) 406public override SyntaxNode VisitAccessorList(AccessorListSyntax node) 417public override SyntaxNode VisitCompilationUnit(CompilationUnitSyntax node) 429private SyntaxNode GetUpdatedTypeDeclaration(TypeDeclarationSyntax node)
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.cs (37)
37private abstract partial class CSharpCodeGenerator : CodeGenerator<StatementSyntax, SyntaxNode, CSharpCodeGenerationOptions> 87public override OperationStatus<ImmutableArray<SyntaxNode>> GetNewMethodStatements(SyntaxNode insertionPointNode, CancellationToken cancellationToken) 91return status.With(statements.CastArray<SyntaxNode>()); 95SyntaxNode insertionPointNode, CancellationToken cancellationToken) 110statements: statements.CastArray<SyntaxNode>(), 117protected override async Task<SyntaxNode> GenerateBodyForCallSiteContainerAsync( 118SyntaxNode insertionPointNode, 119SyntaxNode container, 124var firstStatementToRemove = GetFirstStatementOrInitializerSelectedAtCallSite(); 125var lastStatementToRemove = GetLastStatementOrInitializerSelectedAtCallSite(); 143private async Task<ImmutableArray<SyntaxNode>> CreateStatementsOrInitializerToInsertAtCallSiteAsync( 144SyntaxNode insertionPointNode, CancellationToken cancellationToken) 146var selectedNode = GetFirstStatementOrInitializerSelectedAtCallSite(); 167return statements.CastArray<SyntaxNode>(); 170protected override bool ShouldLocalFunctionCaptureParameter(SyntaxNode node) 173private static bool IsExpressionBodiedMember(SyntaxNode node) 176private static bool IsExpressionBodiedAccessor(SyntaxNode node) 194protected override SyntaxNode GetCallSiteContainerFromOutermostMoveInVariable(CancellationToken cancellationToken) 263SyntaxNode insertionPoint, CancellationToken cancellationToken) 425var replacements = new Dictionary<SyntaxNode, SyntaxNode>(); 430foreach (var node in declarations) 509SyntaxNode insertionPointNode, 532var lastStatement = GetLastStatementOrInitializerSelectedAtCallSite(); 533var container = lastStatement.GetAncestorsOrThis<SyntaxNode>().FirstOrDefault(n => n.IsReturnableConstruct()); 648var root = newDocument.Root; 649var methodDefinition = root.GetAnnotatedNodes<SyntaxNode>(MethodDefinitionAnnotation).First(); 651SyntaxNode newMethodDefinition = methodDefinition switch 670private static TDeclarationNode TweakNewLinesInMethod<TDeclarationNode>(TDeclarationNode method, BlockSyntax body, ArrowExpressionClauseSyntax expressionBody) where TDeclarationNode : SyntaxNode 728static bool ReturnOperationBelongsToMethod(SyntaxNode returnOperationSyntax, SyntaxNode methodSyntax) 730var enclosingMethod = returnOperationSyntax.FirstAncestorOrSelf<SyntaxNode>(n => n switch 742SyntaxNode node, 758var syntax = returnOperation.ReturnedValue?.Syntax ?? returnOperation.Syntax;
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.ExpressionCodeGenerator.cs (9)
43private static string GetMethodNameBasedOnExpression(string methodName, SyntaxNode expression) 130protected override SyntaxNode GetFirstStatementOrInitializerSelectedAtCallSite() 132var scope = (SyntaxNode)this.SelectionResult.GetContainingScopeOf<StatementSyntax>(); 144protected override SyntaxNode GetLastStatementOrInitializerSelectedAtCallSite() 147protected override async Task<SyntaxNode> GetStatementOrInitializerContainingInvocationToExtractedMethodAsync(CancellationToken cancellationToken) 149var enclosingStatement = GetFirstStatementOrInitializerSelectedAtCallSite(); 165var newEnclosingStatement = enclosingStatement 171var updatedRoot = await updatedDocument.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.MultipleStatementsCodeGenerator.cs (5)
65private static IEnumerable<StatementSyntax> GetStatementsFromContainer(SyntaxNode node) 79protected override SyntaxNode GetFirstStatementOrInitializerSelectedAtCallSite() 82protected override SyntaxNode GetLastStatementOrInitializerSelectedAtCallSite() 85protected override Task<SyntaxNode> GetStatementOrInitializerContainingInvocationToExtractedMethodAsync(CancellationToken cancellationToken) 88return Task.FromResult<SyntaxNode>(statement.WithAdditionalAnnotations(CallSiteAnnotation));
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.SingleStatementCodeGenerator.cs (4)
35protected override SyntaxNode GetFirstStatementOrInitializerSelectedAtCallSite() 38protected override SyntaxNode GetLastStatementOrInitializerSelectedAtCallSite() 45protected override Task<SyntaxNode> GetStatementOrInitializerContainingInvocationToExtractedMethodAsync(CancellationToken cancellationToken) 48return Task.FromResult<SyntaxNode>(statement.WithAdditionalAnnotations(CallSiteAnnotation));
ExtractMethod\CSharpMethodExtractor.FormattingProvider.cs (1)
58public override void AddAnchorIndentationOperations(List<AnchorIndentationOperation> list, SyntaxNode node, in NextAnchorIndentationOperationAction nextOperation)
ExtractMethod\CSharpMethodExtractor.TriviaResult.cs (8)
37protected override AnnotationResolver GetAnnotationResolver(SyntaxNode callsite, SyntaxNode method) 48protected override TriviaResolver GetTriviaResolver(SyntaxNode method) 60SyntaxNode node, 63SyntaxNode callsite, 64SyntaxNode method) 91SyntaxNode method) 135private static (BlockSyntax body, ArrowExpressionClauseSyntax expressionBody, SyntaxToken semicolonToken) GetResolverElements(SyntaxNode method)
ExtractMethod\CSharpSelectionResult.cs (10)
77public override SyntaxNode GetNodeForDataFlowAnalysis() 79var node = base.GetNodeForDataFlowAnalysis(); 89for (var current = token.Parent; current != null; current = current.Parent) 109public override SyntaxNode GetOutermostCallSiteContainerToProcess(CancellationToken cancellationToken) 113var container = this.GetInnermostStatementContainer(); 133var container = firstStatement.Parent; 168public SyntaxNode GetInnermostStatementContainer() 171var containingScope = GetContainingScope(); 216var ancestors = token.GetAncestors<SyntaxNode>(); 235private SyntaxKind UnderCheckedContext<T>() where T : SyntaxNode
ExtractMethod\CSharpSelectionResult.ExpressionResult.cs (1)
31public override SyntaxNode? GetContainingScope()
ExtractMethod\CSharpSelectionResult.StatementResult.cs (4)
30var node = GetContainingScope(); 43public override SyntaxNode GetContainingScope() 50return firstToken.GetAncestors<SyntaxNode>().FirstOrDefault(n => 67var node = GetContainingScope();
ExtractMethod\CSharpSelectionValidator.cs (16)
36var root = SemanticDocument.Root; 169var firstValidNode = node.GetAncestors<SyntaxNode>().FirstOrDefault(n => Check(semanticModel, n, cancellationToken)); 186private SelectionInfo GetInitialSelectionInfo(SyntaxNode root, SourceText text) 268=> token.GetAncestors<SyntaxNode>().Any(n => CheckTopLevel(n, token.Span)); 270private static bool CheckTopLevel(SyntaxNode node, TextSpan span) 324SyntaxNode root) 381private static SelectionInfo AssignInitialFinalTokens(SelectionInfo selectionInfo, SyntaxNode root, CancellationToken cancellationToken) 445public override bool ContainsNonReturnExitPointsStatements(IEnumerable<SyntaxNode> jumpsOutOfRegion) 448public override IEnumerable<SyntaxNode> GetOuterReturnStatements(SyntaxNode commonRoot, IEnumerable<SyntaxNode> jumpsOutOfRegion) 452var container = commonRoot.GetAncestorsOrThis<SyntaxNode>().Where(a => a.IsReturnableConstruct()).FirstOrDefault(); 456var returnableConstructPairs = returnStatements.Select(r => (r, r.GetAncestors<SyntaxNode>().Where(a => a.IsReturnableConstruct()).FirstOrDefault())) 464SyntaxNode root, TextSpan textSpan, 465IEnumerable<SyntaxNode> returnStatements, CancellationToken cancellationToken) 479var container = lastToken.GetAncestors<SyntaxNode>().FirstOrDefault(n => n.IsReturnableConstruct());
ExtractMethod\CSharpSelectionValidator.Validator.cs (1)
15public static bool Check(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken)
ExtractMethod\Extensions.cs (16)
19public static StatementSyntax? GetStatementUnderContainer(this SyntaxNode node) 23for (var current = node; current is object; current = current.Parent) 35public static StatementSyntax GetParentLabeledStatementIfPossible(this SyntaxNode node) 38public static bool IsStatementContainerNode([NotNullWhen(returnValue: true)] this SyntaxNode? node) 41public static BlockSyntax? GetBlockBody(this SyntaxNode? node) 54public static bool UnderValidContext(this SyntaxNode node) 58if (!node.GetAncestorsOrThis<SyntaxNode>().Any(predicate)) 65bool predicate(SyntaxNode n) 95public static bool ContainedInValidType(this SyntaxNode node) 98foreach (var ancestor in node.AncestorsAndSelf()) 114public static bool PartOfConstantInitializerExpression(this SyntaxNode node) 120private static bool PartOfConstantInitializerExpression<T>(this SyntaxNode node, Func<T, SyntaxTokenList> modifiersGetter) where T : SyntaxNode 233public static bool HasSyntaxAnnotation(this HashSet<SyntaxAnnotation> set, SyntaxNode node) 251public static bool IsArrayInitializer([NotNullWhen(returnValue: true)] this SyntaxNode? node) 254public static bool IsExpressionInCast([NotNullWhen(returnValue: true)] this SyntaxNode? node)
FullyQualify\CSharpFullyQualifyService.cs (3)
28protected override bool CanFullyQualify(SyntaxNode node, [NotNullWhen(true)] out SimpleNameSyntax? simpleName) 43protected override async Task<SyntaxNode> ReplaceNodeAsync(SimpleNameSyntax simpleName, string containerName, bool resultingSymbolIsType, CancellationToken cancellationToken) 52var root = await syntaxTree.GetRootAsync(cancellationToken).ConfigureAwait(false);
GenerateConstructorFromMembers\CSharpGenerateConstructorFromMembersCodeRefactoringProvider.cs (3)
66var body = propertyDeclaration.ExpressionBody ?? getAccessor?.ExpressionBody ?? (SyntaxNode?)getAccessor?.Body; 75private static string? GetAccessedMemberName(SyntaxNode? body)
GenerateEqualsAndGetHashCodeFromMembers\CSharpGenerateEqualsAndGetHashCodeService.cs (2)
25protected override bool TryWrapWithUnchecked(ImmutableArray<SyntaxNode> statements, out ImmutableArray<SyntaxNode> wrappedStatements)
GenerateMember\GenerateVariable\CSharpGenerateVariableService.cs (4)
33protected override bool IsExplicitInterfaceGeneration(SyntaxNode node) 36protected override bool IsIdentifierNameGeneration(SyntaxNode node) 64SemanticDocument document, SyntaxNode node, CancellationToken cancellationToken, 198protected override bool TryConvertToLocalDeclaration(ITypeSymbol type, SyntaxToken identifierToken, SemanticModel semanticModel, CancellationToken cancellationToken, out SyntaxNode newRoot)
GenerateType\CSharpGenerateTypeService.cs (9)
501? genericName.TypeArgumentList.Arguments.OfType<SyntaxNode>().ToList() 502: Enumerable.Repeat<SyntaxNode>(null, state.SimpleName.Arity); 568INamedTypeSymbol namedTypeSymbol, string[] containers, Document selectedDocument, SyntaxNode selectedDocumentRoot, CancellationToken cancellationToken) 687var node = expression as SyntaxNode; 688SyntaxNode previousNode = null; 724private static bool IsAllContainingTypeDeclsPublic(SyntaxNode node) 739Solution updatedSolution, SyntaxNode modifiedRoot, Document document, SimpleNameSyntax simpleName, string includeUsingsOrImports, CancellationToken cancellationToken) 747SyntaxNode root = null;
GoToDefinition\CSharpGoToDefinitionSymbolService.cs (9)
35var foundContinuedLoop = TryFindContinuableConstruct(node); 47var foundBrokenLoop = TryFindBreakableConstruct(node); 56var foundReturnableConstruct = TryFindContainingReturnableConstruct(node); 90static SyntaxNode? TryFindContinuableConstruct(SyntaxNode? node) 108static SyntaxNode? TryFindBreakableConstruct(SyntaxNode? node) 124static SyntaxNode? TryFindContainingReturnableConstruct(SyntaxNode? node)
Highlighting\KeywordHighlighters\AsyncAwaitHighlighter.cs (7)
26private static readonly ObjectPool<Stack<SyntaxNode>> s_stackPool 27= SharedPools.Default<Stack<SyntaxNode>>(); 32protected override bool IsHighlightableNode(SyntaxNode node) 35protected override void AddHighlightsForNode(SyntaxNode node, List<TextSpan> highlights, CancellationToken cancellationToken) 44private static IEnumerable<SyntaxNode> WalkChildren(SyntaxNode node) 69private static bool HighlightRelatedKeywords(SyntaxNode node, List<TextSpan> spans)
Highlighting\KeywordHighlighters\LoopHighlighter.cs (4)
34protected override bool IsHighlightableNode(SyntaxNode node) 38SyntaxNode node, List<TextSpan> spans, CancellationToken cancellationToken) 78private static void HighlightRelatedKeywords(SyntaxNode node, List<TextSpan> spans, 95foreach (var child in node.ChildNodes())
Highlighting\KeywordHighlighters\ReturnStatementHighlighter.cs (2)
34.GetAncestorsOrThis<SyntaxNode>() 48private static void HighlightRelatedKeywords(SyntaxNode node, List<TextSpan> spans)
Highlighting\KeywordHighlighters\SwitchStatementHighlighter.cs (1)
56private static void HighlightRelatedKeywords(SyntaxNode node, List<TextSpan> spans,
Highlighting\KeywordHighlighters\YieldStatementHighlighter.cs (2)
34.GetAncestorsOrThis<SyntaxNode>() 48private static void HighlightRelatedKeywords(SyntaxNode node, List<TextSpan> spans)
ImplementInterface\AbstractChangeImplementationCodeRefactoringProvider.cs (8)
44protected abstract SyntaxNode ChangeImplementation(SyntaxGenerator generator, SyntaxNode currentDecl, ISymbol implMember, ISymbol interfaceMember); 128private static async Task<(SyntaxNode?, ExplicitInterfaceSpecifierSyntax?, SyntaxToken)> GetContainerAsync(CodeRefactoringContext context) 155private static (SyntaxNode? declaration, ExplicitInterfaceSpecifierSyntax?, SyntaxToken) GetContainer(SyntaxToken token) 157for (var node = token.Parent; node != null; node = node.Parent) 164_ => default((SyntaxNode member, ExplicitInterfaceSpecifierSyntax?, SyntaxToken)), 230var documentToImplDeclarations = new OrderedMultiDictionary<Document, (SyntaxNode, ISymbol impl, SetWithInsertionOrder<ISymbol> interfaceMembers)>(); 240var decl = GetContainer(declToken).declaration;
ImplementInterface\CSharpImplementExplicitlyCodeRefactoringProvider.cs (2)
143protected override SyntaxNode ChangeImplementation(SyntaxGenerator generator, SyntaxNode decl, ISymbol implMember, ISymbol interfaceMember)
ImplementInterface\CSharpImplementImplicitlyCodeRefactoringProvider.cs (4)
52protected override SyntaxNode ChangeImplementation(SyntaxGenerator generator, SyntaxNode decl, ISymbol _1, ISymbol _2) 55private static SyntaxNode WithoutExplicitImpl(SyntaxNode decl)
InheritanceMargin\CSharpInheritanceMarginService.cs (4)
28protected override ImmutableArray<SyntaxNode> GetMembers(IEnumerable<SyntaxNode> nodesToSearch) 32using var _ = PooledObjects.ArrayBuilder<SyntaxNode>.GetInstance(out var builder); 65protected override SyntaxToken GetDeclarationToken(SyntaxNode declarationNode)
InitializeParameter\CSharpAddParameterCheckCodeRefactoringProvider.cs (6)
36protected override bool IsFunctionDeclaration(SyntaxNode node) 39protected override SyntaxNode GetBody(SyntaxNode functionDeclaration) 42protected override void InsertStatement(SyntaxEditor editor, SyntaxNode functionDeclaration, bool returnsVoid, SyntaxNode? statementToAddAfter, StatementSyntax statement) 48protected override bool CanOffer(SyntaxNode body)
InitializeParameter\CSharpInitializeMemberFromParameterCodeRefactoringProvider.cs (9)
35protected override bool IsFunctionDeclaration(SyntaxNode node) 38protected override SyntaxNode? TryGetLastStatement(IBlockOperation? blockStatement) 41protected override void InsertStatement(SyntaxEditor editor, SyntaxNode functionDeclaration, bool returnsVoid, SyntaxNode? statementToAddAfter, StatementSyntax statement) 55protected override SyntaxNode GetBody(SyntaxNode functionDeclaration) 58protected override SyntaxNode? GetAccessorBody(IMethodSymbol accessor, CancellationToken cancellationToken) 61protected override SyntaxNode RemoveThrowNotImplemented(SyntaxNode node)
InitializeParameter\CSharpInitializeMemberFromPrimaryConstructorParameterCodeRefactoringProvider_Update.cs (2)
140static (ISymbol? symbol, SyntaxNode? syntax, CodeGenerationContext context) GetAddContext<TSymbol>( 151var syntax = syntaxReference.GetSyntax(cancellationToken);
InitializeParameter\InitializeParameterHelpers.cs (18)
26public static bool IsFunctionDeclaration(SyntaxNode node) 31public static SyntaxNode GetBody(SyntaxNode functionDeclaration) 34BaseMethodDeclarationSyntax methodDeclaration => (SyntaxNode?)methodDeclaration.Body ?? methodDeclaration.ExpressionBody!, 35LocalFunctionStatementSyntax localFunction => (SyntaxNode?)localFunction.Body ?? localFunction.ExpressionBody!, 40private static SyntaxToken? TryGetSemicolonToken(SyntaxNode functionDeclaration) 52public static SyntaxNode? TryGetLastStatement(IBlockOperation? blockStatement) 59SyntaxNode functionDeclaration, 61SyntaxNode? statementToAddAfterOpt, 64var body = GetBody(functionDeclaration); 126public static bool IsExpressionBody(SyntaxNode body) 130SyntaxNode body, 147public static SyntaxNode? GetAccessorBody(IMethodSymbol accessor, CancellationToken cancellationToken) 149var node = accessor.DeclaringSyntaxReferences[0].GetSyntax(cancellationToken); 151return accessorDeclaration.ExpressionBody ?? (SyntaxNode?)accessorDeclaration.Body; 160public static SyntaxNode RemoveThrowNotImplemented(SyntaxNode node) 200using var _ = ArrayBuilder<SyntaxNode>.GetInstance(out var accessors);
InlineHints\CSharpInlineParameterNameHintsService.cs (2)
33SyntaxNode node, 95protected override bool IsIndexer(SyntaxNode node, IParameterSymbol parameter)
InlineHints\CSharpInlineTypeHintsService.cs (1)
28SyntaxNode node,
IntroduceParameter\CSharpIntroduceParameterCodeRefactoringProvider.cs (5)
28protected override SyntaxNode GenerateExpressionFromOptionalParameter(IParameterSymbol parameterSymbol) 33protected override SyntaxNode? GetLocalDeclarationFromDeclarator(SyntaxNode variableDecl) 43protected override SyntaxNode UpdateArgumentListSyntax(SyntaxNode argumentList, SeparatedSyntaxList<ArgumentSyntax> arguments)
IntroduceUsingStatement\CSharpIntroduceUsingStatementCodeRefactoringProvider.cs (4)
38protected override bool CanRefactorToContainBlockStatements(SyntaxNode parent) 49protected override SyntaxNode WithStatements(SyntaxNode parentOfStatementsToSurround, SyntaxList<StatementSyntax> statements) 52parentOfStatementsToSurround is BlockSyntax block ? block.WithStatements(statements) as SyntaxNode :
IntroduceVariable\CSharpIntroduceVariableService.cs (3)
65for (SyntaxNode node = expression; node != null; node = node.Parent) 134protected override IEnumerable<SyntaxNode> GetContainingExecutableBlocks(ExpressionSyntax expression) 151SyntaxNode replacementNode,
IntroduceVariable\CSharpIntroduceVariableService.Rewriter.cs (10)
18private readonly SyntaxNode _replacementNode; 21private Rewriter(SyntaxNode replacementNode, ISet<ExpressionSyntax> matches) 27public override SyntaxNode Visit(SyntaxNode node) 41public override SyntaxNode VisitParenthesizedExpression(ParenthesizedExpressionSyntax node) 43var newNode = base.VisitParenthesizedExpression(node); 47var innerExpression = parenthesizedExpression.OpenParenToken.GetNextToken().Parent; 57public static SyntaxNode Visit(SyntaxNode node, SyntaxNode replacementNode, ISet<ExpressionSyntax> matches)
IntroduceVariable\CSharpIntroduceVariableService_IntroduceLocal.cs (15)
35var containerToGenerateInto = expression.Ancestors().FirstOrDefault(s => 229var oldParentingNode = oldBody.Parent; 251private static SyntaxNode WithBlockBody(SyntaxNode node, BlockSyntax body) 297SyntaxNode scope = block; 315var root = document.Root; 318SyntaxNode innermostCommonBlock; 330root = root.TrackNodes(allAffectedStatements.Concat(new SyntaxNode[] { expression, statement })); 353var finalInnerMostBlock = WithStatements(newInnerMostBlock, statements); 355var newRoot = root.ReplaceNode(innermostCommonBlock, finalInnerMostBlock); 376private static int GetFirstStatementAffectedIndex(SyntaxNode innermostCommonBlock, ISet<ExpressionSyntax> matches, int firstStatementAffectedIndex) 445private static bool IsBlockLike(SyntaxNode node) => node is BlockSyntax or SwitchSectionSyntax; 447private static SyntaxList<StatementSyntax> GetStatements(SyntaxNode blockLike) 455private static SyntaxNode WithStatements(SyntaxNode blockLike, SyntaxList<StatementSyntax> statements)
IntroduceVariable\CSharpIntroduceVariableService_IntroduceQueryLocal.cs (8)
23private static bool IsAnyQueryClause(SyntaxNode node) 41var innermostClauses = new HashSet<SyntaxNode>( 42matches.Select(expr => expr.GetAncestorsOrThis<SyntaxNode>().First(IsAnyQueryClause))); 58var allAffectedClauses = new HashSet<SyntaxNode>(matches.SelectMany(expr => expr.GetAncestorsOrThis<SyntaxNode>().Where(IsAnyQueryClause))); 84var oldClause = expression.GetAncestors<SyntaxNode>().First(IsAnyQueryClause); 97SyntaxNode oldClause, 98SyntaxNode newClause,
InvertIf\CSharpInvertIfCodeRefactoringProvider.cs (10)
39protected override SyntaxNode GetCondition(IfStatementSyntax ifNode) 45protected override bool IsStatementContainer(SyntaxNode node) 48protected override bool IsNoOpSyntaxNode(SyntaxNode node) 51protected override bool IsExecutableStatement(SyntaxNode node) 66protected override bool CanControlFlowOut(SyntaxNode node) 85protected override SyntaxList<StatementSyntax> GetStatements(SyntaxNode node) 93protected override SyntaxKind? GetJumpStatementKind(SyntaxNode node) 135SyntaxNode condition, 223protected override SyntaxNode WithStatements(SyntaxNode node, IEnumerable<StatementSyntax> statements)
LanguageServices\CSharpSymbolDisplayService.SymbolDescriptionBuilder.cs (2)
221private async Task<T?> GetFirstDeclarationAsync<T>(ISymbol symbol) where T : SyntaxNode 256var syntax = method.DeclaringSyntaxReferences.FirstOrDefault()?.GetSyntax();
LineSeparators\CSharpLineSeparatorService.cs (17)
43var blocks = node.Traverse<SyntaxNode>(textSpan, IsSeparableContainer); 70private static bool IsSeparableBlock(SyntaxNode node) 96private static bool IsSeparableContainer(SyntaxNode node) 99private static bool IsBadType(SyntaxNode node) 113private static bool IsBadEnum(SyntaxNode node) 127private static bool IsBadMethod(SyntaxNode node) 142private static bool IsBadProperty(SyntaxNode node) 145private static bool IsBadEvent(SyntaxNode node) 148private static bool IsBadIndexer(SyntaxNode node) 160private static bool IsBadConstructor(SyntaxNode node) 175private static bool IsBadDestructor(SyntaxNode node) 190private static bool IsBadOperator(SyntaxNode node) 205private static bool IsBadConversionOperator(SyntaxNode node) 220private static bool IsBadNode(SyntaxNode node) 259private static void ProcessNodeList<T>(SyntaxList<T> children, ArrayBuilder<TextSpan> spans, CancellationToken cancellationToken) where T : SyntaxNode 312private static void AddLineSeparatorSpanForNode(SyntaxNode node, ArrayBuilder<TextSpan> spans, CancellationToken cancellationToken) 346private static TextSpan GetLineSeparatorSpanForNode(SyntaxNode node)
MetadataAsSource\CSharpMetadataAsSourceService.cs (8)
45var oldRoot = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 63var syntaxRoot = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 65var newSyntaxRoot = DocCommentConverter.ConvertToRegularComments(syntaxRoot, docCommentFormattingService, cancellationToken); 110var root = await tree.GetRootAsync(cancellationToken).ConfigureAwait(false); 118var newRoot = AddNullableRegions(root, cancellationToken); 124private static (bool oblivious, bool annotatedOrNotAnnotated) GetNullableAnnotations(SyntaxNode node) 130private static bool HasAnnotation(SyntaxNode node, SyntaxAnnotation annotation) 150where TSyntax : SyntaxNode
MetadataAsSource\FormattingRule.cs (3)
33SyntaxNode previousMember = FormattingRangeHelper.GetEnclosingMember(previousToken); 34SyntaxNode nextMember = FormattingRangeHelper.GetEnclosingMember(currentToken); 60public override void AddAnchorIndentationOperations(List<AnchorIndentationOperation> list, SyntaxNode node, in NextAnchorIndentationOperationAction nextOperation)
MoveToNamespace\CSharpMoveToNamespaceService.cs (1)
21protected override string GetNamespaceName(SyntaxNode container)
NavigationBar\CSharpNavigationBarItemService.cs (4)
135using var _ = ArrayBuilder<SyntaxNode>.GetInstance(out var nodesToVisit); 171private static ISymbol? GetType(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken) 225var declaringNode = reference.GetSyntax(); 247var declaringNode = reference.GetSyntax();
Organizing\CSharpOrganizingService.cs (1)
27var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
Organizing\CSharpOrganizingService.Rewriter.cs (5)
19private readonly Func<SyntaxNode, IEnumerable<ISyntaxOrganizer>> _nodeToOrganizersGetter = treeOrganizer.GetNodeToOrganizers(organizers.ToList()); 23public override SyntaxNode DefaultVisit(SyntaxNode node) 29public override SyntaxNode Visit(SyntaxNode node)
Organizing\Organizers\MemberDeclarationsOrganizer.cs (3)
42IList<TSyntaxNode> finalList) where TSyntaxNode : SyntaxNode 73private static void FixupOriginalFirstNode<TSyntaxNode>(IList<TSyntaxNode> originalList, IList<TSyntaxNode> finalList) where TSyntaxNode : SyntaxNode 94IList<TSyntaxNode> finalList) where TSyntaxNode : SyntaxNode
QuickInfo\CSharpDiagnosticAnalyzerQuickInfoProvider.cs (1)
52var errorCodeNode = token.Parent switch
QuickInfo\CSharpSemanticQuickInfoProvider.cs (3)
37protected override bool GetBindableNodeForTokenIndicatingLambda(SyntaxToken token, [NotNullWhen(returnValue: true)] out SyntaxNode? found) 57protected override bool GetBindableNodeForTokenIndicatingPossibleIndexerAccess(SyntaxToken token, [NotNullWhen(returnValue: true)] out SyntaxNode? found) 86protected override NullableFlowState GetNullabilityAnalysis(SemanticModel semanticModel, ISymbol symbol, SyntaxNode node, CancellationToken cancellationToken)
QuickInfo\CSharpSyntacticQuickInfoProvider.cs (3)
67var parent = token.Parent!; 96private static bool IsScopeBlock(SyntaxNode node) 100private static void MarkInterestedSpanNearbyScopeBlock(SyntaxNode block, SyntaxToken openBrace, ref int spanStart, ref int spanEnd)
RelatedDocuments\CSharpRelatedDocumentsService.cs (2)
24protected override IEnumerable<(ExpressionSyntax expression, SyntaxToken nameToken)> IteratePotentialTypeNodes(SyntaxNode root) 26using var _ = ArrayBuilder<SyntaxNode>.GetInstance(out var stack);
RemoveUnusedVariable\CSharpRemoveUnusedVariableCodeFixProvider.cs (6)
38protected override SyntaxNode GetNodeToRemoveOrReplace(SyntaxNode node) 43var parent = node.Parent; 57protected override void RemoveOrReplaceNode(SyntaxEditor editor, SyntaxNode node, IBlockFactsService blockFacts) 70protected override SeparatedSyntaxList<SyntaxNode> GetVariables(LocalDeclarationStatementSyntax localDeclarationStatement) 73protected override bool ShouldOfferFixForLocalDeclaration(IBlockFactsService blockFacts, SyntaxNode node)
Rename\CSharpRenameIssuesService.cs (1)
58var parent = token.Parent;
ReplaceDocCommentTextWithTag\CSharpReplaceDocCommentTextWithTagCodeRefactoringProvider.cs (1)
32protected override SyntaxNode ParseExpression(string text)
ReplaceMethodWithProperty\CSharpReplaceMethodWithPropertyService.cs (5)
36public void RemoveSetMethod(SyntaxEditor editor, SyntaxNode setMethodDeclaration) 54var newProperty = ConvertMethodsToProperty( 62public static SyntaxNode ConvertMethodsToProperty( 284where TNode : SyntaxNode 295public override SyntaxNode VisitIdentifierName(IdentifierNameSyntax node)
ReplacePropertyWithMethods\CSharpReplacePropertyWithMethodsService.ConvertValueToParamRewriter.cs (2)
24public override SyntaxNode VisitXmlElementStartTag(XmlElementStartTagSyntax node) 33public override SyntaxNode VisitXmlElementEndTag(XmlElementEndTagSyntax node)
ReplacePropertyWithMethods\CSharpReplacePropertyWithMethodsService.ConvertValueToReturnsRewriter.cs (2)
24public override SyntaxNode VisitXmlElementStartTag(XmlElementStartTagSyntax node) 29public override SyntaxNode VisitXmlElementEndTag(XmlElementEndTagSyntax node)
ReplacePropertyWithMethods\CSharpReplacePropertyWithMethodsService.cs (13)
39public override async Task<ImmutableArray<SyntaxNode>> GetReplacementMembersAsync( 42SyntaxNode propertyDeclarationNode, 63private static ImmutableArray<SyntaxNode> ConvertPropertyToMembers( 74using var result = TemporaryArray<SyntaxNode>.Empty; 105private static SyntaxNode GetSetMethod( 163private static SyntaxNode GetGetMethod( 250var structure = trivia.GetStructure(); 251var rewritten = rewriter.Visit(structure); 256private static SyntaxNode UseExpressionOrBlockBodyIfDesired( 297public override SyntaxNode GetPropertyNodeToReplace(SyntaxNode propertyDeclaration) 306protected override NameMemberCrefSyntax CreateCrefSyntax(NameMemberCrefSyntax originalCref, SyntaxToken identifierToken, SyntaxNode? parameterType) 326SyntaxNode compoundAssignment, ExpressionSyntax readExpression)
SignatureHelp\AttributeSignatureHelpProvider.cs (2)
42SyntaxNode root, 117private SignatureHelpState? GetCurrentArgumentState(SyntaxNode root, int position, ISyntaxFactsService syntaxFacts, TextSpan currentSpan, CancellationToken cancellationToken)
SignatureHelp\ElementAccessExpressionSignatureHelpProvider.cs (6)
46private static bool TryGetElementAccessExpression(SyntaxNode root, int position, ISyntaxFactsService syntaxFacts, SignatureHelpTriggerReason triggerReason, CancellationToken cancellationToken, [NotNullWhen(true)] out ExpressionSyntax? identifier, out SyntaxToken openBrace) 136private static SignatureHelpState? GetCurrentArgumentState(SyntaxNode root, int position, ISyntaxFactsService syntaxFacts, TextSpan currentSpan, CancellationToken cancellationToken) 306internal static bool TryGetSyntax(SyntaxNode root, int position, ISyntaxFactsService syntaxFacts, SignatureHelpTriggerReason triggerReason, CancellationToken cancellationToken, [NotNullWhen(true)] out ExpressionSyntax? identifier, out SyntaxToken openBrace) 341internal static TextSpan GetTextSpan(SyntaxNode expression, SyntaxToken openBracket) 347internal static bool TryGetSyntax(SyntaxNode root, int position, ISyntaxFactsService syntaxFacts, SignatureHelpTriggerReason triggerReason, CancellationToken cancellationToken, [NotNullWhen(true)] out ExpressionSyntax? identifier, out SyntaxToken openBrace) 384internal static bool TryGetSyntax(SyntaxNode root, int position, ISyntaxFactsService syntaxFacts, SignatureHelpTriggerReason triggerReason, CancellationToken cancellationToken, [NotNullWhen(true)] out ExpressionSyntax? identifier, out SyntaxToken openBrace)
SignatureHelp\GenericNamePartiallyWrittenSignatureHelpProvider.cs (1)
26protected override bool TryGetGenericIdentifier(SyntaxNode root, int position, ISyntaxFactsService syntaxFacts, SignatureHelpTriggerReason triggerReason, CancellationToken cancellationToken, out SyntaxToken genericIdentifier, out SyntaxToken lessThanToken)
SignatureHelp\GenericNameSignatureHelpProvider.cs (2)
41SyntaxNode root, int position, 141private SignatureHelpState? GetCurrentArgumentState(SyntaxNode root, int position, ISyntaxFactsService syntaxFacts, CancellationToken cancellationToken)
SignatureHelp\InitializerExpressionSignatureHelpProvider.cs (2)
36SyntaxNode root, 78private SignatureHelpState? GetCurrentArgumentState(SyntaxNode root, int position, ISyntaxFactsService syntaxFacts, TextSpan currentSpan, CancellationToken cancellationToken)
SignatureHelp\PrimaryConstructorBaseTypeSignatureHelpProvider.cs (2)
45SyntaxNode root, 109private SignatureHelpState? GetCurrentArgumentState(SyntaxNode root, int position, ISyntaxFactsService syntaxFacts, TextSpan currentSpan, CancellationToken cancellationToken)
SignatureHelp\SignatureHelpUtilities.cs (1)
99internal static bool IsTriggerParenOrComma<TSyntaxNode>(SyntaxToken token, Func<char, bool> isTriggerCharacter) where TSyntaxNode : SyntaxNode
SignatureHelp\TupleConstructionSignatureHelpProvider.cs (8)
37private SignatureHelpState? GetCurrentArgumentState(SyntaxNode root, int position, ISyntaxFactsService syntaxFacts, TextSpan currentSpan, CancellationToken cancellationToken) 63private bool GetOuterMostTupleExpressionInSpan(SyntaxNode root, int position, 82private bool GetOuterMostParenthesizedExpressionInSpan(SyntaxNode root, int position, 125private IEnumerable<INamedTypeSymbol>? FindNearestTupleConstructionWithInferrableType(SyntaxNode root, SemanticModel semanticModel, int position, SignatureHelpTriggerInfo triggerInfo, 150private SignatureHelpItems? CreateItems(int position, SyntaxNode root, ISyntaxFactsService syntaxFacts, 151SyntaxNode targetExpression, SemanticModel semanticModel, IEnumerable<INamedTypeSymbol> tupleTypes, CancellationToken cancellationToken) 202private bool TryGetTupleExpression(SignatureHelpTriggerReason triggerReason, SyntaxNode root, int position, 219private bool TryGetParenthesizedExpression(SignatureHelpTriggerReason triggerReason, SyntaxNode root, int position,
SimplifyThisOrMe\CSharpSimplifyThisOrMeCodeFixProvider.cs (3)
29protected override SyntaxNode Rewrite(SyntaxNode root, ISet<MemberAccessExpressionSyntax> memberAccessNodes) 36public override SyntaxNode? VisitMemberAccessExpression(MemberAccessExpressionSyntax node)
SimplifyTypeNames\SimplifyTypeNamesCodeFixProvider.cs (3)
48protected override SyntaxNode AddSimplificationAnnotationTo(SyntaxNode expressionSyntax) 54var annotatedexpressionSyntax = expressionSyntax.WithAdditionalAnnotations(
Snippets\AbstractCSharpAutoPropertySnippetProvider.cs (2)
90protected override PropertyDeclarationSyntax? FindAddedSnippetSyntaxNode(SyntaxNode root, int position) 92var node = root.FindNode(TextSpan.FromBounds(position, position));
Snippets\AbstractCSharpForLoopSnippetProvider.cs (3)
36protected abstract ExpressionSyntax GenerateInitializerValue(SyntaxGenerator generator, SyntaxNode? inlineExpression); 38protected abstract ExpressionSyntax GenerateRightSideOfCondition(SyntaxGenerator generator, SyntaxNode? inlineExpression); 69static (TypeSyntax iteratorTypeSyntax, SyntaxNode? inlineExpression) GetLoopHeaderParts(SyntaxGenerator generator, InlineExpressionInfo? inlineExpressionInfo, Compilation compilation)
Snippets\AbstractCSharpTypeSnippetProvider.cs (2)
90protected override TTypeDeclarationSyntax? FindAddedSnippetSyntaxNode(SyntaxNode root, int position) 92var node = root.FindNode(TextSpan.FromBounds(position, position));
Snippets\CSharpConstructorSnippetProvider.cs (1)
71var constructorDeclaration = generator.ConstructorDeclaration(
Snippets\CSharpForLoopSnippetProvider.cs (2)
29protected override ExpressionSyntax GenerateInitializerValue(SyntaxGenerator generator, SyntaxNode? inlineExpression) 32protected override ExpressionSyntax GenerateRightSideOfCondition(SyntaxGenerator generator, SyntaxNode? inlineExpression)
Snippets\CSharpReversedForLoopSnippetProvider.cs (3)
29protected override ExpressionSyntax GenerateInitializerValue(SyntaxGenerator generator, SyntaxNode? inlineExpression) 31var subtractFrom = inlineExpression?.WithoutLeadingTrivia() ?? generator.IdentifierName("length"); 35protected override ExpressionSyntax GenerateRightSideOfCondition(SyntaxGenerator generator, SyntaxNode? inlineExpression)
Snippets\CSharpSnippetHelpers.cs (2)
19where TTargetNode : SyntaxNode 47where TTargetNode : SyntaxNode
SpellCheck\CSharpSpellcheckCodeFixProvider.cs (1)
40protected override bool DescendIntoChildren(SyntaxNode arg)
SplitOrMergeIfStatements\CSharpIfLikeStatementGenerator.cs (33)
29public bool IsIfOrElseIf(SyntaxNode node) => node is IfStatementSyntax; 31public bool IsCondition(SyntaxNode expression, out SyntaxNode ifOrElseIf) 43public bool IsElseIfClause(SyntaxNode node, out SyntaxNode parentIfOrElseIf) 55public bool HasElseIfClause(SyntaxNode ifOrElseIf, out SyntaxNode elseIfClause) 68public SyntaxNode GetCondition(SyntaxNode ifOrElseIf) 74public SyntaxNode GetRootIfStatement(SyntaxNode ifOrElseIf) 86public ImmutableArray<SyntaxNode> GetElseIfAndElseClauses(SyntaxNode ifOrElseIf) 90var builder = ImmutableArray.CreateBuilder<SyntaxNode>(); 106public SyntaxNode WithCondition(SyntaxNode ifOrElseIf, SyntaxNode condition) 112public SyntaxNode WithStatementInBlock(SyntaxNode ifOrElseIf, SyntaxNode statement) 118public SyntaxNode WithStatementsOf(SyntaxNode ifOrElseIf, SyntaxNode otherIfOrElseIf) 125public SyntaxNode WithElseIfAndElseClausesOf(SyntaxNode ifStatement, SyntaxNode otherIfStatement) 128public SyntaxNode ToIfStatement(SyntaxNode ifOrElseIf) 131public SyntaxNode ToElseIfClause(SyntaxNode ifOrElseIf) 134public void InsertElseIfClause(SyntaxEditor editor, SyntaxNode afterIfOrElseIf, SyntaxNode elseIfClause) 156public void RemoveElseIfClause(SyntaxEditor editor, SyntaxNode elseIfClause)
SplitOrMergeIfStatements\CSharpMergeConsecutiveIfStatementsCodeRefactoringProvider.cs (2)
27protected override bool IsApplicableSpan(SyntaxNode node, TextSpan span, out SyntaxNode ifOrElseIf)
SplitOrMergeIfStatements\CSharpMergeNestedIfStatementsCodeRefactoringProvider.cs (2)
27protected override bool IsApplicableSpan(SyntaxNode node, TextSpan span, out SyntaxNode ifOrElseIf)
SplitStringLiteral\InterpolatedStringSplitter.cs (1)
30protected override SyntaxNode GetNodeToReplace() => _interpolatedStringExpression;
SplitStringLiteral\SimpleStringSplitter.cs (1)
36protected override SyntaxNode GetNodeToReplace() => _token.Parent;
SplitStringLiteral\StringSplitter.cs (4)
81protected abstract SyntaxNode GetNodeToReplace(); 85public bool TrySplit([NotNullWhen(true)] out SyntaxNode? newRoot, out int newPosition) 107private (SyntaxNode root, int caretPosition) SplitString() 122private string GetIndentString(SyntaxNode newRoot)
src\Analyzers\CSharp\Analyzers\AddBraces\CSharpAddBracesDiagnosticAnalyzer.cs (6)
49var statement = context.Node; 124private static bool ContainsInterleavedDirective(SyntaxNode statement, StatementSyntax embeddedStatement, CancellationToken cancellationToken) 152private static bool IsConsideredMultiLine(SyntaxNode statement, SyntaxNode embeddedStatement) 237private static bool RequiresBracesToMatchContext(SyntaxNode statement) 265private static IfStatementSyntax GetOutermostIfStatementOfSequence(SyntaxNode ifStatementOrElseClause)
src\Analyzers\CSharp\Analyzers\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionDiagnosticAnalyzer.Analyzer.cs (2)
232where T : SyntaxNode 290public override SyntaxKind DefaultVisit(SyntaxNode node)
src\Analyzers\CSharp\Analyzers\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionDiagnosticAnalyzer.cs (1)
50var switchStatement = context.Node;
src\Analyzers\CSharp\Analyzers\ConvertTypeofToNameof\CSharpConvertTypeOfToNameOfDiagnosticAnalyzer.cs (1)
26var node = context.Operation.Syntax;
src\Analyzers\CSharp\Analyzers\InlineDeclaration\CSharpInlineDeclarationDiagnosticAnalyzer.cs (14)
106var invocationOrCreation = argumentList.Parent; 183var enclosingBlockOfLocalStatement = GetEnclosingPseudoBlock(localStatement.Parent); 196var outArgumentScope = GetOutArgumentScope(argumentExpression); 241var reportNode = localDeclaration.Variables.Count == 1 242? (SyntaxNode)localDeclaration 254public static SyntaxNode? GetEnclosingPseudoBlock(SyntaxNode? parent) 268private static StatementSyntax GetLastStatement(SyntaxNode enclosingBlock) 285SyntaxNode enclosingBlock, 308private static SyntaxNode? GetOutArgumentScope(SyntaxNode argumentExpression) 310for (var current = argumentExpression; current != null; current = current.Parent) 363SyntaxNode enclosingBlockOfLocalStatement, 375foreach (var descendentNode in enclosingBlockOfLocalStatement.DescendantNodes())
src\Analyzers\CSharp\Analyzers\MakeLocalFunctionStatic\MakeLocalFunctionStaticHelper.cs (1)
32var node = calledLocationFunction.DeclaringSyntaxReferences.FirstOrDefault()?.GetSyntax();
src\Analyzers\CSharp\Analyzers\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyAnalyzer.cs (2)
70var declaration = reference.GetSyntax(cancellationToken); 195var declaration = methodReference.GetSyntax(cancellationToken);
src\Analyzers\CSharp\Analyzers\NewLines\ArrowExpressionClausePlacement\ArrowExpressionClausePlacementDiagnosticAnalyzer.cs (1)
44private void Recurse(SyntaxTreeAnalysisContext context, NotificationOption2 notificationOption, SyntaxNode node)
src\Analyzers\CSharp\Analyzers\NewLines\ConsecutiveBracePlacement\ConsecutiveBracePlacementDiagnosticAnalyzer.cs (2)
41using var _ = ArrayBuilder<SyntaxNode>.GetInstance(out var stack); 45private void Recurse(SyntaxTreeAnalysisContext context, NotificationOption2 notificationOption, ArrayBuilder<SyntaxNode> stack)
src\Analyzers\CSharp\Analyzers\NewLines\ConsecutiveStatementPlacement\CSharpConsecutiveStatementPlacementDiagnosticAnalyzer.cs (2)
40protected override bool IsBlockLikeStatement(SyntaxNode node) 43protected override Location GetDiagnosticLocation(SyntaxNode block)
src\Analyzers\CSharp\Analyzers\NewLines\ConstructorInitializerPlacement\ConstructorInitializerPlacementDiagnosticAnalyzer.cs (1)
45private void Recurse(SyntaxTreeAnalysisContext context, NotificationOption2 notificationOption, SyntaxNode node)
src\Analyzers\CSharp\Analyzers\NewLines\EmbeddedStatementPlacement\EmbeddedStatementPlacementDiagnosticAnalyzer.cs (3)
44private void Recurse(SyntaxTreeAnalysisContext context, NotificationOption2 notificationOption, SyntaxNode node) 90var parent = statement.Parent; 113var blockParent = parent.Parent;
src\Analyzers\CSharp\Analyzers\OrderModifiers\CSharpOrderModifiersDiagnosticAnalyzer.cs (2)
33SyntaxNode root) 39var node = child.AsNode();
src\Analyzers\CSharp\Analyzers\QualifyMemberAccess\CSharpQualifyMemberAccessDiagnosticAnalyzer.cs (6)
30protected override bool CanMemberAccessBeQualified(ISymbol containingSymbol, SyntaxNode node) 53private static bool IsInPropertyOrFieldInitialization(ISymbol containingSymbol, SyntaxNode node) 61private static bool IsInPropertyInitialization(SyntaxNode declarationSyntax, SyntaxNode node) 64private static bool IsInFieldInitialization(SyntaxNode declarationSyntax, SyntaxNode node)
src\Analyzers\CSharp\Analyzers\RemoveConfusingSuppression\CSharpRemoveConfusingSuppressionDiagnosticAnalyzer.cs (1)
32var node = context.Node;
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryImports\CSharpRemoveUnnecessaryImportsDiagnosticAnalyzer.cs (6)
37protected override ImmutableArray<SyntaxNode> MergeImports(ImmutableArray<UsingDirectiveSyntax> unnecessaryImports) 38=> ImmutableArray<SyntaxNode>.CastUp(unnecessaryImports); 46protected override SyntaxToken? TryGetLastToken(SyntaxNode node) 51IEnumerable<SyntaxNode> nodes, SyntaxTree tree, CancellationToken cancellationToken) 55var nodesContainingUnnecessaryUsings = new HashSet<SyntaxNode>(); 56foreach (var node in nodes)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (3)
186var outermostBody = invokedExpression.AncestorsAndSelf().LastOrDefault( 242SyntaxNode? node1, 244SyntaxNode? node2,
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveRedundantNullableDirectiveDiagnosticAnalyzer.cs (1)
95var directive = trivia.GetStructure()!;
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveUnnecessaryNullableDirectiveDiagnosticAnalyzer.cs (1)
58private static bool IsIgnoredCodeBlock(SyntaxNode codeBlock)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\NullableImpactingSpanWalker.cs (2)
45private bool IsIgnored(SyntaxNode node) 119public override void DefaultVisit(SyntaxNode node)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessarySuppressions\CSharpRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (1)
25protected override bool ContainsPragmaDirective(SyntaxNode root)
src\Analyzers\CSharp\Analyzers\RemoveUnreachableCode\CSharpRemoveUnreachableCodeDiagnosticAnalyzer.cs (4)
59var root = semanticModel.SyntaxTree.GetRoot(cancellationToken); 72public static StatementSyntax? TryGetContainingStatement(SyntaxNode node) 81SemanticModelAnalysisContext context, SyntaxNode root, TextSpan sourceSpan) 83var node = root.FindNode(sourceSpan);
src\Analyzers\CSharp\Analyzers\RemoveUnusedMembers\CSharpRemoveUnusedMembersDiagnosticAnalyzer.cs (2)
36protected override SyntaxNode GetParentIfSoleDeclarator(SyntaxNode node)
src\Analyzers\CSharp\Analyzers\RemoveUnusedParametersAndValues\CSharpRemoveUnusedParametersAndValuesDiagnosticAnalyzer.cs (3)
35protected override bool IsIfConditionalDirective(SyntaxNode node) 38protected override bool ReturnsThrow(SyntaxNode node) 69var statementAncestor = unusedSymbolWriteOperation.Syntax.FirstAncestorOrSelf<StatementSyntax>()?.Parent;
src\Analyzers\CSharp\Analyzers\SimplifyInterpolation\CSharpSimplifyInterpolationHelpers.cs (1)
18protected override SyntaxNode GetPreservedInterpolationExpressionSyntax(IOperation operation)
src\Analyzers\CSharp\Analyzers\UseAutoProperty\CSharpUseAutoPropertyAnalyzer.cs (9)
56foreach (var node in propertyDeclaration.DescendantNodes()) 67ConcurrentDictionary<IFieldSymbol, ConcurrentSet<SyntaxNode>> ineligibleFieldUsageIfOutsideProperty, 69SyntaxNode codeBlock, 147SyntaxNode location, 157SyntaxNode location, 208var declaration = getMethod.DeclaringSyntaxReferences[0].GetSyntax(cancellationToken); 248protected override SyntaxNode GetFieldNode( 263var syntax = accessor.DeclaringSyntaxReferences[0].GetSyntax(cancellationToken); 264foreach (var descendant in syntax.DescendantNodesAndSelf())
src\Analyzers\CSharp\Analyzers\UseCoalesceExpression\CSharpUseCoalesceExpressionForIfNullStatementCheckDiagnosticAnalyzer.cs (1)
37protected override SyntaxNode GetDeclarationNode(VariableDeclaratorSyntax declarator)
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForBuilderDiagnosticAnalyzer.cs (2)
163using var _ = ArrayBuilder<CollectionMatch<SyntaxNode>>.GetInstance(out var matches); 253ImmutableArray<CollectionMatch<SyntaxNode>> Matches,
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (1)
521bool AddLocalToProcess(SyntaxNode declarator)
src\Analyzers\CSharp\Analyzers\UseCollectionInitializer\CSharpUseCollectionInitializerAnalyzer.cs (3)
34protected override bool IsComplexElementInitializer(SyntaxNode expression) 49ArrayBuilder<CollectionMatch<SyntaxNode>> preMatches, 50ArrayBuilder<CollectionMatch<SyntaxNode>> postMatches,
src\Analyzers\CSharp\Analyzers\UseCollectionInitializer\CSharpUseCollectionInitializerDiagnosticAnalyzer.cs (2)
53ImmutableArray<CollectionMatch<SyntaxNode>> preMatches, 66static IEnumerable<CollectionElementSyntax> GetMatchElements(ImmutableArray<CollectionMatch<SyntaxNode>> preMatches)
src\Analyzers\CSharp\Analyzers\UseDeconstruction\CSharpUseDeconstructionDiagnosticAnalyzer.cs (4)
140SyntaxNode searchScope, 203SyntaxNode container, CancellationToken cancellationToken) 247SemanticModel semanticModel, SyntaxNode searchScope, ILocalSymbol local, 288SemanticModel semanticModel, SyntaxNode container, CancellationToken cancellationToken)
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyHelper.cs (8)
25public abstract BlockSyntax? GetBody(SyntaxNode declaration); 26public abstract ArrowExpressionClauseSyntax? GetExpressionBody(SyntaxNode declaration); 27public abstract bool IsRelevantDeclarationNode(SyntaxNode node); 29public abstract bool CanOfferUseExpressionBody(CodeStyleOption2<ExpressionBodyPreference> preference, SyntaxNode declaration, bool forAnalyzer, CancellationToken cancellationToken); 30public abstract bool CanOfferUseBlockBody(CodeStyleOption2<ExpressionBodyPreference> preference, SyntaxNode declaration, bool forAnalyzer, out bool fixesError, [NotNullWhen(true)] out ArrowExpressionClauseSyntax? expressionBody); 31public abstract SyntaxNode Update(SemanticModel semanticModel, SyntaxNode declaration, bool useExpressionBody, CancellationToken cancellationToken); 33public abstract Location GetDiagnosticLocation(SyntaxNode declaration);
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyHelper`1.cs (10)
28where TDeclaration : SyntaxNode 63public override BlockSyntax? GetBody(SyntaxNode declaration) 66public override ArrowExpressionClauseSyntax? GetExpressionBody(SyntaxNode declaration) 69public override bool IsRelevantDeclarationNode(SyntaxNode node) 72public override bool CanOfferUseExpressionBody(CodeStyleOption2<ExpressionBodyPreference> preference, SyntaxNode declaration, bool forAnalyzer, CancellationToken cancellationToken) 75public override bool CanOfferUseBlockBody(CodeStyleOption2<ExpressionBodyPreference> preference, SyntaxNode declaration, bool forAnalyzer, out bool fixesError, [NotNullWhen(true)] out ArrowExpressionClauseSyntax? expressionBody) 78public sealed override SyntaxNode Update(SemanticModel semanticModel, SyntaxNode declaration, bool useExpressionBody, CancellationToken cancellationToken) 81public override Location GetDiagnosticLocation(SyntaxNode declaration) 131SyntaxNode declaration, ExpressionBodyPreference conversionPreference, CancellationToken cancellationToken,
src\Analyzers\CSharp\Analyzers\UseExpressionBody\UseExpressionBodyDiagnosticAnalyzer.cs (1)
90CSharpCodeGenerationOptions options, SyntaxNode declaration, SyntaxNodeAnalysisContext context, UseExpressionBodyHelper helper, CancellationToken cancellationToken)
src\Analyzers\CSharp\Analyzers\UseImplicitOrExplicitType\CSharpTypeStyleDiagnosticAnalyzerBase.cs (2)
41var declarationStatement = context.Node; 67private static Diagnostic CreateDiagnostic(DiagnosticDescriptor descriptor, SyntaxNode declaration, TextSpan diagnosticSpan, NotificationOption2 notificationOption, AnalyzerOptions analyzerOptions)
src\Analyzers\CSharp\Analyzers\UseIsNullCheck\CSharpUseNullCheckOverTypeCheckDiagnosticAnalyzer.cs (1)
89var syntax = operation.Syntax;
src\Analyzers\CSharp\Analyzers\UseLocalFunction\CSharpUseLocalFunctionDiagnosticAnalyzer.cs (1)
245foreach (var descendentNode in block.DescendantNodes())
src\Analyzers\CSharp\Analyzers\UseNameofInNullableAttribute\CSharpUseNameofInNullableAttributeDiagnosticAnalyzer.cs (1)
120var container = attributeList?.Parent;
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.Analyzer.cs (11)
22private readonly SyntaxNode _localStatement; 23private readonly SyntaxNode _enclosingBlock; 31SyntaxNode localStatement, 32SyntaxNode enclosingBlock, 56SyntaxNode localStatement, 57SyntaxNode enclosingBlock, 98foreach (var current in _comparison.Ancestors()) 240private bool CheckLoop(SyntaxNode statement, StatementSyntax body, bool defAssignedWhenTrue) 307private bool IsAccessedOutOfScope(SyntaxNode scope) 317foreach (var descendentNode in _enclosingBlock.DescendantNodes()) 349private bool LocalFlowsIn(SyntaxNode statementOrExpression)
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.cs (10)
59var node = syntaxContext.Node; 77BinaryExpressionSyntax binaryExpression => (binaryExpression.Left, (SyntaxNode)binaryExpression.Right), 107var localStatement = declarator.Parent?.Parent; 108var enclosingBlock = localStatement?.Parent; 178foreach (var descendentNode in enclosingBlock.DescendantNodes()) 210var comparisonEnclosingBlock = comparison.AncestorsAndSelf().FirstOrDefault(n => n is BlockSyntax); 219foreach (var descendentNode in enclosingBlock.DescendantNodes()) 240foreach (var descendentNode in enclosingBlock.DescendantNodes()) 279SyntaxNode operand, 336private static ExpressionSyntax? GetNullCheckOperand(ExpressionSyntax left, SyntaxKind comparisonKind, SyntaxNode right)
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpIsAndCastCheckDiagnosticAnalyzer.cs (3)
96var ifStatementScope = ifStatement.Parent.IsKind(SyntaxKind.Block) 211SyntaxNode scope, VariableDeclaratorSyntax variable) 215using var _ = ArrayBuilder<SyntaxNode>.GetInstance(out var stack);
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpUseNotPatternDiagnosticAnalyzer.cs (1)
63var node = context.Node;
src\Analyzers\CSharp\Analyzers\UsePrimaryConstructor\CSharpUsePrimaryConstructorDiagnosticAnalyzer.cs (5)
88[NotNullWhen(true)] out SyntaxNode? nodeToRemove, 391var body = primaryConstructorDeclaration.ExpressionBody ?? (SyntaxNode?)primaryConstructorDeclaration.Body; 416using var _2 = ArrayBuilder<(IParameterSymbol parameter, SyntaxNode assignedMemberDeclaration, bool parameterIsWrittenTo)>.GetInstance(out var orderedParameterAssignments); 467ArrayBuilder<(IParameterSymbol parameter, SyntaxNode assignedMemberDeclaration, bool parameterIsWrittenTo)>? orderedParameterAssignments,
src\Analyzers\CSharp\Analyzers\UseSimpleUsingStatement\UseSimpleUsingStatementDiagnosticAnalyzer.cs (4)
87var parentBlockLike = outermostUsing.Parent; 134SyntaxNode parentBlockLike, 143foreach (var statement in CSharpBlockFacts.Instance.GetExecutableBlockStatements(parentBlockLike)) 177SyntaxNode parentBlockLike,
src\Analyzers\CSharp\Analyzers\UseUtf8StringLiteral\UseUtf8StringLiteralDiagnosticAnalyzer.cs (3)
118private void ReportParameterArrayDiagnostic(OperationAnalysisContext context, SyntaxNode syntaxNode, ImmutableArray<IOperation> elements, NotificationOption2 notificationOption, ArrayCreationOperationLocation operationLocation) 130private void ReportArrayCreationDiagnostic(OperationAnalysisContext context, SyntaxNode syntaxNode, NotificationOption2 notificationOption) 138private void ReportDiagnostic(OperationAnalysisContext context, SyntaxNode syntaxNode, NotificationOption2 notificationOption, Location location, ArrayCreationOperationLocation operationLocation)
src\Analyzers\CSharp\Analyzers\ValidateFormatString\CSharpValidateFormatStringDiagnosticAnalyzer.cs (4)
21protected override SyntaxNode? TryGetMatchingNamedArgument( 22SeparatedSyntaxList<SyntaxNode> arguments, 36protected override SyntaxNode GetArgumentExpression(SyntaxNode syntaxNode)
src\Analyzers\CSharp\CodeFixes\AddAccessibilityModifiers\CSharpAddAccessibilityModifiersCodeFixProvider.cs (2)
18protected override SyntaxNode MapToDeclarator(SyntaxNode node)
src\Analyzers\CSharp\CodeFixes\AddBraces\CSharpAddBracesCodeFixProvider.cs (2)
35var root = editor.OriginalRoot; 38var statement = root.FindNode(diagnostic.Location.SourceSpan, getInnermostNodeForTie: true);
src\Analyzers\CSharp\CodeFixes\AddExplicitCast\ArgumentFixer.cs (2)
15private sealed class ArgumentFixer : Fixer<ArgumentSyntax, ArgumentListSyntax, SyntaxNode> 31var newInvocation = newArgumentList.Parent!;
src\Analyzers\CSharp\CodeFixes\AddExplicitCast\CSharpAddExplicitCastCodeFixProvider.cs (5)
40protected override void GetPartsOfCastOrConversionExpression(ExpressionSyntax expression, out SyntaxNode type, out ExpressionSyntax castedExpression) 53SyntaxNode root, 72&& argumentList.Parent is SyntaxNode invocationNode) 89protected override (SyntaxNode finalTarget, SyntaxNode finalReplacement) Cast(
src\Analyzers\CSharp\CodeFixes\AddInheritdoc\AddInheritdocCodeFixProvider.cs (3)
40var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 49var node = root.FindNode(diagnostic.Location.SourceSpan); 85var node = editor.OriginalRoot.FindNode(diagnostic.Location.SourceSpan);
src\Analyzers\CSharp\CodeFixes\AddParameter\CSharpAddParameterCodeFixProvider.cs (2)
46protected override ITypeSymbol GetArgumentType(SyntaxNode argumentNode, SemanticModel semanticModel, CancellationToken cancellationToken) 51SyntaxNode node,
src\Analyzers\CSharp\CodeFixes\AssignOutParameters\AbstractAssignOutParametersCodeFixProvider.cs (20)
47protected abstract void TryRegisterFix(CodeFixContext context, Document document, SyntaxNode container, SyntaxNode location); 49private static (SyntaxNode container, SyntaxNode exprOrStatement) GetContainer(SyntaxNode root, TextSpan span) 51var location = root.FindNode(span); 54var container = GetContainer(location); 64private static bool IsValidLocation(SyntaxNode location) 81private static SyntaxNode? GetContainer(SyntaxNode node) 83for (var current = node; current != null; current = current.Parent) 95private static async Task<MultiDictionary<SyntaxNode, (SyntaxNode exprOrStatement, ImmutableArray<IParameterSymbol>)>> GetUnassignedParametersAsync( 105var result = new MultiDictionary<SyntaxNode, (SyntaxNode exprOrStatement, ImmutableArray<IParameterSymbol>)>(); 150SyntaxEditor editor, SyntaxNode container, 151MultiDictionary<SyntaxNode, (SyntaxNode exprOrStatement, ImmutableArray<IParameterSymbol> unassignedParameters)>.ValueSet values, 154protected static ImmutableArray<SyntaxNode> GenerateAssignmentStatements( 157var result = ArrayBuilder<SyntaxNode>.GetInstance();
src\Analyzers\CSharp\CodeFixes\AssignOutParameters\AssignOutParametersAboveReturnCodeFixProvider.cs (7)
26protected override void TryRegisterFix(CodeFixContext context, Document document, SyntaxNode container, SyntaxNode location) 32SyntaxEditor editor, SyntaxNode container, 33MultiDictionary<SyntaxNode, (SyntaxNode exprOrStatement, ImmutableArray<IParameterSymbol> unassignedParameters)>.ValueSet values, 44SyntaxEditor editor, SyntaxNode exprOrStatement, ImmutableArray<SyntaxNode> statements)
src\Analyzers\CSharp\CodeFixes\AssignOutParameters\AssignOutParametersAtStartCodeFixProvider.cs (6)
24protected override void TryRegisterFix(CodeFixContext context, Document document, SyntaxNode container, SyntaxNode location) 56SyntaxEditor editor, SyntaxNode container, 57MultiDictionary<SyntaxNode, (SyntaxNode exprOrStatement, ImmutableArray<IParameterSymbol> unassignedParameters)>.ValueSet values, 71var updatedContainer = generator.WithStatements(container, finalStatements);
src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceTransform.cs (8)
81private static (SyntaxNode root, TextSpan semicolonSpan) ReplaceWithFileScopedNamespace( 113var root = document.Root; 119(SyntaxNode stringNode, int closeTerminatorIndentationLength) lastRawStringLiteralData = default; 135SyntaxNode stringNode; 199var root = document.Root; 214SyntaxTree tree, SyntaxNode root, string indentation, TextLine textLine, CancellationToken cancellationToken) 245var updatedRoot = ReplaceWithBlockScopedNamespace(parsedDocument, fileScopedNamespace, options.NewLine, options.NewLines, annotation); 259private static SyntaxNode ReplaceWithBlockScopedNamespace(
src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs (1)
298public override ExpressionSyntax DefaultVisit(SyntaxNode node)
src\Analyzers\CSharp\CodeFixes\ConvertToAsync\CSharpConvertToAsyncMethodCodeFixProvider.cs (5)
32SyntaxNode node, 43protected override async Task<Tuple<SyntaxTree, SyntaxNode>?> GetRootInOtherSyntaxTreeAsync( 44SyntaxNode node, 61SyntaxNode node, 65var invocationExpression = node.ChildNodes().FirstOrDefault(n => n.IsKind(SyntaxKind.InvocationExpression));
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (1)
693private static SyntaxTriviaList? GetExteriorTrivia(SyntaxNode declaration)
src\Analyzers\CSharp\CodeFixes\ConvertTypeOfToNameOf\CSharpConvertTypeOfToNameOfCodeFixProvider.cs (1)
26protected override SyntaxNode GetSymbolTypeExpression(SemanticModel model, MemberAccessExpressionSyntax node, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\DocumentationComments\CSharpAddDocCommentNodesCodeFixProvider.cs (2)
40protected override SyntaxNode? TryGetDocCommentNode(SyntaxTriviaList leadingTrivia) 46var nodeStructure = node.GetStructure()!;
src\Analyzers\CSharp\CodeFixes\FixIncorrectConstraint\CSharpFixIncorrectConstraintCodeFixProvider.cs (1)
88var newType = generator.TypeExpression(compilation.GetSpecialType(
src\Analyzers\CSharp\CodeFixes\FixReturnType\CSharpFixReturnTypeCodeFixProvider.cs (2)
135private static (TypeSyntax type, bool isAsync) TryGetDeclarationTypeToFix(SyntaxNode node) 139static (TypeSyntax type, bool isAsync) TryGetReturnTypeToFix(SyntaxNode containingMember)
src\Analyzers\CSharp\CodeFixes\GenerateConstructor\CSharpGenerateConstructorService.cs (7)
34protected override bool IsSimpleNameGeneration(SemanticDocument document, SyntaxNode node, CancellationToken cancellationToken) 37protected override bool IsConstructorInitializerGeneration(SemanticDocument document, SyntaxNode node, CancellationToken cancellationToken) 40protected override bool IsImplicitObjectCreation(SemanticDocument document, SyntaxNode node, CancellationToken cancellationToken) 45SyntaxNode node, 83SyntaxNode node, 115SyntaxNode node, 150SyntaxNode node,
src\Analyzers\CSharp\CodeFixes\GenerateConstructor\GenerateConstructorCodeFixProvider.cs (4)
44Document document, SyntaxNode node, CancellationToken cancellationToken) 50protected override bool IsCandidate(SyntaxNode node, SyntaxToken token, Diagnostic diagnostic) 57protected override SyntaxNode GetTargetNode(SyntaxNode node)
src\Analyzers\CSharp\CodeFixes\GenerateDefaultConstructors\CSharpGenerateDefaultConstructorsCodeFixProvider.cs (1)
28protected override SyntaxToken? TryGetTypeName(SyntaxNode typeDeclaration)
src\Analyzers\CSharp\CodeFixes\GenerateEnumMember\CSharpGenerateEnumMemberService.cs (1)
22protected override bool IsIdentifierNameGeneration(SyntaxNode node)
src\Analyzers\CSharp\CodeFixes\GenerateEnumMember\GenerateEnumMemberCodeFixProvider.cs (2)
32protected override Task<ImmutableArray<CodeAction>> GetCodeActionsAsync(Document document, SyntaxNode node, CancellationToken cancellationToken) 38protected override bool IsCandidate(SyntaxNode node, SyntaxToken token, Diagnostic diagnostic)
src\Analyzers\CSharp\CodeFixes\GenerateMethod\GenerateConversionCodeFixProvider.cs (4)
35protected override bool IsCandidate(SyntaxNode node, SyntaxToken token, Diagnostic diagnostic) 47protected override SyntaxNode? GetTargetNode(SyntaxNode node) 59Document document, SyntaxNode node, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\GenerateMethod\GenerateDeconstructMethodCodeFixProvider.cs (3)
51var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 55var deconstruction = token.GetAncestors<SyntaxNode>() 68SyntaxNode target;
src\Analyzers\CSharp\CodeFixes\GenerateMethod\GenerateMethodCodeFixProvider.cs (4)
54protected override bool IsCandidate(SyntaxNode node, SyntaxToken token, Diagnostic diagnostic) 66protected override SyntaxNode? GetTargetNode(SyntaxNode node) 82Document document, SyntaxNode node, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateConversionService.cs (6)
28protected override bool IsImplicitConversionGeneration(SyntaxNode node) 36protected override bool IsExplicitConversionGeneration(SyntaxNode node) 56SyntaxNode expression, 82SyntaxNode expression, 108SyntaxNode expression, 167SyntaxNode expression,
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateDeconstructMethodService.cs (1)
40public override ImmutableArray<IParameterSymbol> TryMakeParameters(SemanticModel semanticModel, SyntaxNode target, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateMethodService.cs (3)
29protected override bool IsExplicitInterfaceGeneration(SyntaxNode node) 32protected override bool IsSimpleNameGeneration(SyntaxNode node) 49SyntaxNode node,
src\Analyzers\CSharp\CodeFixes\GenerateVariable\CSharpGenerateVariableCodeFixProvider.cs (5)
40protected override bool IsCandidate(SyntaxNode node, SyntaxToken token, Diagnostic diagnostic) 43protected override SyntaxNode GetTargetNode(SyntaxNode node) 47var nameNode = node.ChildNodes().FirstOrDefault(n => n.IsKind(SyntaxKind.IdentifierName)); 58Document document, SyntaxNode node, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\HideBase\HideBaseCodeFixProvider.AddNewKeywordAction.cs (5)
23private sealed class AddNewKeywordAction(Document document, SyntaxNode node) : CodeAction 26private readonly SyntaxNode _node = node; 35var newNode = GetNewNode(_node, configOptions.GetOption(CSharpCodeStyleOptions.PreferredModifierOrder).Value); 41private static SyntaxNode GetNewNode(SyntaxNode node, string preferredModifierOrder)
src\Analyzers\CSharp\CodeFixes\HideBase\HideBaseCodeFixProvider.cs (1)
39(SyntaxNode?)token.GetAncestor<FieldDeclarationSyntax>();
src\Analyzers\CSharp\CodeFixes\ImplementInterface\CSharpImplementInterfaceService.cs (5)
42Document document, SemanticModel model, SyntaxNode node, CancellationToken cancellationToken, 43out SyntaxNode classOrStructDecl, out INamedTypeSymbol classOrStructType, out ImmutableArray<INamedTypeSymbol> interfaceTypes) 85protected override SyntaxNode AddCommentInsideIfStatement(SyntaxNode ifStatement, SyntaxTriviaList trivia) 92protected override SyntaxNode CreateFinalizer(
src\Analyzers\CSharp\CodeFixes\InlineDeclaration\CSharpInlineDeclarationCodeFixProvider.cs (12)
62var originalRoot = editor.OriginalRoot; 69static t => (t.invocationOrCreation, ImmutableArray.Create<SyntaxNode>(t.identifier, t.declarator)), 78private static (VariableDeclaratorSyntax declarator, IdentifierNameSyntax identifier, SyntaxNode invocationOrCreation) FindDiagnosticNodes( 94private static SyntaxNode ReplaceIdentifierWithInlineDeclaration( 97SyntaxNode currentRoot, VariableDeclaratorSyntax declarator, 98IdentifierNameSyntax identifier, SyntaxNode currentNode, 118var block = CSharpInlineDeclarationDiagnosticAnalyzer.GetEnclosingPseudoBlock(localDeclarationStatement.Parent); 240private static ImmutableArray<StatementSyntax> GetStatements(SyntaxNode pseudoBlock) 338SyntaxNode nodeToReplace, 387private static SyntaxNode GetTopmostContainer(SyntaxNode expression) 398int position, SyntaxNode topmostContainer,
src\Analyzers\CSharp\CodeFixes\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessCodeFixProvider.cs (3)
76var root = editor.OriginalRoot; 119var root = editor.OriginalRoot; 156private static T AppendTriviaWithoutEndOfLines<T>(T newStatement, IfStatementSyntax ifStatement) where T : SyntaxNode
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpAddYieldCodeFixProvider.cs (6)
44protected override async Task<CodeAction?> GetCodeFixAsync(SyntaxNode root, SyntaxNode node, Document document, Diagnostic diagnostics, CancellationToken cancellationToken) 102SyntaxNode node, SemanticModel model, CancellationToken cancellationToken, 210SyntaxNode root, TextSpan span, [NotNullWhen(true)] out SyntaxNode? node) 213var ancestors = root.FindToken(span.Start).GetAncestors<SyntaxNode>();
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpChangeToIEnumerableCodeFixProvider.cs (2)
35protected override async Task<CodeAction?> GetCodeFixAsync(SyntaxNode root, SyntaxNode node, Document document, Diagnostic diagnostics, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\MakeFieldReadonly\CSharpMakeFieldReadonlyCodeFixProvider.cs (1)
20protected override SyntaxNode? GetInitializerNode(VariableDeclaratorSyntax declaration)
src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeFixHelper.cs (3)
151var localFunctionBodyOperation = semanticModel.GetOperation(localFunction.Body ?? (SyntaxNode)localFunction.ExpressionBody!.Expression, cancellationToken); 200public static SyntaxNode AddStaticModifier(SyntaxNode localFunction, SyntaxGenerator generator)
src\Analyzers\CSharp\CodeFixes\MakeMemberRequired\CSharpMakeMemberRequiredCodeFixProvider.cs (2)
109var root = editor.OriginalRoot; 115var memberDeclarator = root.FindNode(diagnostic.Location.SourceSpan);
src\Analyzers\CSharp\CodeFixes\MakeMemberStatic\CSharpMakeMemberStaticCodeFixProvider.cs (2)
23protected override bool TryGetMemberDeclaration(SyntaxNode node, [NotNullWhen(true)] out SyntaxNode? memberDeclaration)
src\Analyzers\CSharp\CodeFixes\MakeMethodAsynchronous\CSharpMakeMethodAsynchronousCodeFixProvider.cs (4)
47var root = diagnostic.Location.SourceTree.GetRoot(cancellationToken); 62protected override bool IsAsyncSupportingFunctionSyntax(SyntaxNode node) 69protected override SyntaxNode AddAsyncTokenAndFixReturnType( 72SyntaxNode node,
src\Analyzers\CSharp\CodeFixes\MakeMethodSynchronous\CSharpMakeMethodSynchronousCodeFixProvider.cs (5)
29protected override bool IsAsyncSupportingFunctionSyntax(SyntaxNode node) 32protected override SyntaxNode RemoveAsyncTokenAndFixReturnType(IMethodSymbol methodSymbol, SyntaxNode node, KnownTaskTypes knownTypes) 44private static SyntaxNode FixMethod(IMethodSymbol methodSymbol, MethodDeclarationSyntax method, KnownTaskTypes knownTypes) 50private static SyntaxNode FixLocalFunction(IMethodSymbol methodSymbol, LocalFunctionStatementSyntax localFunction, KnownTaskTypes knownTypes)
src\Analyzers\CSharp\CodeFixes\MakeRefStruct\MakeRefStructCodeFixProvider.cs (1)
71var newStruct = generator.WithModifiers(
src\Analyzers\CSharp\CodeFixes\MakeStatementAsynchronous\CSharpMakeStatementAsynchronousCodeFixProvider.cs (4)
64private static void MakeStatementAsynchronous(SyntaxEditor editor, SyntaxNode statementToFix) 66SyntaxNode newStatement; 96private static SyntaxNode? TryGetStatementToFix(SyntaxNode node)
src\Analyzers\CSharp\CodeFixes\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyCodeFixProvider.cs (1)
101TNode UpdateReadOnlyModifier<TNode>(TNode node, bool add) where TNode : SyntaxNode
src\Analyzers\CSharp\CodeFixes\MakeTypeAbstract\CSharpMakeTypeAbstractCodeFixProvider.cs (1)
22protected override bool IsValidRefactoringContext(SyntaxNode? node, [NotNullWhen(true)] out TypeDeclarationSyntax? typeDeclaration)
src\Analyzers\CSharp\CodeFixes\MisplacedUsingDirectives\MisplacedUsingDirectivesCodeFixProvider.cs (5)
173usingDirective => (SyntaxNode)usingDirective, 185private static async Task<SyntaxNode> ExpandUsingDirectiveAsync(Document document, UsingDirectiveSyntax usingDirective, CancellationToken cancellationToken) 306private static SyntaxList<MemberDeclarationSyntax> GetMembers(SyntaxNode node) 314private static TSyntaxNode RemoveLeadingBlankLinesFromFirstMember<TSyntaxNode>(TSyntaxNode node) where TSyntaxNode : SyntaxNode 353private static TSyntaxNode EnsureLeadingBlankLineBeforeFirstMember<TSyntaxNode>(TSyntaxNode node) where TSyntaxNode : SyntaxNode
src\Analyzers\CSharp\CodeFixes\NewLines\ConsecutiveBracePlacement\ConsecutiveBracePlacementCodeFixProvider.cs (1)
62SyntaxNode root, SourceText text,
src\Analyzers\CSharp\CodeFixes\NewLines\EmbeddedStatementPlacement\EmbeddedStatementPlacementCodeFixProvider.cs (4)
69var root = editor.OriginalRoot; 70var node = root.FindNode(diagnostic.AdditionalLocations[0].SourceSpan); 128private static SyntaxNode AddLeadingTrivia(SyntaxNode node, SyntaxTrivia trivia)
src\Analyzers\CSharp\CodeFixes\Nullable\CSharpDeclareAsNullableCodeFixProvider.cs (7)
57private static string GetEquivalenceKey(SyntaxNode node) 100Document document, SemanticModel model, SyntaxEditor editor, SyntaxNode node, HashSet<TypeSyntax> alreadyHandled, CancellationToken cancellationToken) 112Document document, SemanticModel? model, SyntaxNode node, CancellationToken cancellationToken) 176var syntax = local.DeclaringSyntaxReferences[0].GetSyntax(cancellationToken); 187var syntax = field.DeclaringSyntaxReferences[0].GetSyntax(cancellationToken); 204var syntax = property.DeclaringSyntaxReferences[0].GetSyntax(cancellationToken); 315private static bool IsExpressionSupported(SyntaxNode node)
src\Analyzers\CSharp\CodeFixes\RemoveAsyncModifier\CSharpRemoveAsyncModifierCodeFixProvider.cs (7)
30protected override bool IsAsyncSupportingFunctionSyntax(SyntaxNode node) 33protected override SyntaxNode? ConvertToBlockBody(SyntaxNode node, ExpressionSyntax expressionBody) 51protected override SyntaxNode RemoveAsyncModifier(SyntaxGenerator generator, SyntaxNode methodLikeNode) 63private static SyntaxNode AnnotateBlock(SyntaxGenerator generator, SyntaxNode node)
src\Analyzers\CSharp\CodeFixes\RemoveAsyncModifier\RemoveAsyncModifierHelpers.cs (5)
12internal static SyntaxNode WithoutAsyncModifier(MethodDeclarationSyntax method, TypeSyntax returnType) 18internal static SyntaxNode WithoutAsyncModifier(LocalFunctionStatementSyntax localFunction, TypeSyntax returnType) 24internal static SyntaxNode WithoutAsyncModifier(ParenthesizedLambdaExpressionSyntax lambda) 27internal static SyntaxNode WithoutAsyncModifier(SimpleLambdaExpressionSyntax lambda) 30internal static SyntaxNode WithoutAsyncModifier(AnonymousMethodExpressionSyntax method)
src\Analyzers\CSharp\CodeFixes\RemoveUnnecessaryParentheses\CSharpRemoveUnnecessaryParenthesesCodeFixProvider.cs (2)
18: AbstractRemoveUnnecessaryParenthesesCodeFixProvider<SyntaxNode> 20protected override bool CanRemoveParentheses(SyntaxNode current, SemanticModel semanticModel, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\RemoveUnreachableCode\CSharpRemoveUnreachableCodeCodeFixProvider.cs (1)
80static void RemoveStatement(SyntaxEditor editor, SyntaxNode statement)
src\Analyzers\CSharp\CodeFixes\RemoveUnusedLocalFunction\CSharpRemoveUnusedLocalFunctionCodeFixProvider.cs (1)
44var root = editor.OriginalRoot;
src\Analyzers\CSharp\CodeFixes\RemoveUnusedMembers\CSharpRemoveUnusedMembersCodeFixProvider.cs (1)
26protected override void AdjustAndAddAppropriateDeclaratorsToRemove(HashSet<FieldDeclarationSyntax> fieldDeclarators, HashSet<SyntaxNode> declarators)
src\Analyzers\CSharp\CodeFixes\RemoveUnusedParametersAndValues\CSharpRemoveUnusedValuesCodeFixProvider.cs (15)
45protected override SyntaxNode? TryUpdateNameForFlaggedNode(SyntaxNode node, SyntaxToken newName) 92protected override SyntaxNode? TryUpdateParentOfUpdatedNode(SyntaxNode parent, SyntaxNode newNameNode, SyntaxEditor editor, ISyntaxFacts syntaxFacts, SemanticModel semanticModel) 142protected override SyntaxNode ComputeReplacementNode(SyntaxNode originalOldNode, SyntaxNode changedOldNode, SyntaxNode proposedReplacementNode) 184protected override SyntaxNode GetReplacementNodeForCompoundAssignment( 185SyntaxNode originalCompoundAssignment, 186SyntaxNode newAssignmentTarget, 242protected override SyntaxNode GetReplacementNodeForVarPattern(SyntaxNode originalVarPattern, SyntaxNode newNameNode)
src\Analyzers\CSharp\CodeFixes\ReplaceDefaultLiteral\CSharpReplaceDefaultLiteralCodeFixProvider.cs (6)
65Document document, TextSpan span, SyntaxNode newExpression, CancellationToken cancellationToken) 76private static (SyntaxNode newExpression, string displayText) GetReplacementExpressionAndText( 102var newLiteral = generator.LiteralExpression(constant.Value); 107var defaultExpression = generator.DefaultExpression(type); 114(SyntaxNode newExpression, string displayText) GenerateMemberAccess(string memberName) 116var memberAccess = generator.MemberAccessExpression(generator.TypeExpression(type), memberName);
src\Analyzers\CSharp\CodeFixes\UseCoalesceExpression\CSharpUseCoalesceExpressionForIfNullStatementCheckCodeFixProvider.cs (3)
23SemanticModel semanticModel, SyntaxNode expressionToCoalesce, 24SyntaxNode leftAssignmentPart, SyntaxNode rightAssignmentPart,
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (6)
46where TMatchNode : SyntaxNode 569SyntaxNode GetAnchorNode(SyntaxNode node) 591for (var current = node; current != null; current = current.Parent) 760foreach (var component in GetElementComponents(node)) 774static IEnumerable<SyntaxNode> GetElementComponents(TMatchNode node)
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForArrayCodeFixProvider.cs (2)
44var originalRoot = editor.OriginalRoot; 97static bool IsOnSingleLine(SourceText sourceText, SyntaxNode node)
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForBuilderCodeFixProvider.cs (3)
96static AnalysisResult TrackAnalysisResult(SyntaxNode root, AnalysisResult analysisResult) 100analysisResult.Matches.SelectAsArray(m => new CollectionMatch<SyntaxNode>(root.GetCurrentNode(m.Node)!, m.UseSpread)), 111using var _ = ArrayBuilder<SyntaxNode>.GetInstance(out var nodesToTrack);
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForEmptyCodeFixProvider.cs (2)
26: AbstractUseCollectionExpressionCodeFixProvider<SyntaxNode>( 37SyntaxNode diagnosticNode,
src\Analyzers\CSharp\CodeFixes\UseCollectionInitializer\CSharpUseCollectionInitializerCodeFixProvider.cs (4)
36protected override async Task<(SyntaxNode, SyntaxNode)> GetReplacementNodesAsync( 40ImmutableArray<CollectionMatch<SyntaxNode>> preMatches, 41ImmutableArray<CollectionMatch<SyntaxNode>> postMatches,
src\Analyzers\CSharp\CodeFixes\UseCollectionInitializer\CSharpUseCollectionInitializerCodeFixProvider_CollectionExpression.cs (2)
24ImmutableArray<CollectionMatch<SyntaxNode>> preMatches, 25ImmutableArray<CollectionMatch<SyntaxNode>> postMatches,
src\Analyzers\CSharp\CodeFixes\UseCollectionInitializer\CSharpUseCollectionInitializerCodeFixProvider_CollectionInitializer.cs (3)
27ImmutableArray<CollectionMatch<SyntaxNode>> matches) 39UseInitializerHelpers.AddExistingItems<CollectionMatch<SyntaxNode>, ExpressionSyntax>( 73where TNode : SyntaxNode
src\Analyzers\CSharp\CodeFixes\UseConditionalExpression\CSharpUseConditionalExpressionForReturnCodeFixProvider.cs (1)
44protected override SyntaxNode WrapIfStatementIfNecessary(IConditionalOperation operation)
src\Analyzers\CSharp\CodeFixes\UseConditionalExpression\MultiLineConditionalExpressionFormattingRule.cs (1)
49List<IndentBlockOperation> list, SyntaxNode node, in NextIndentBlockOperationAction nextOperation)
src\Analyzers\CSharp\CodeFixes\UseDeconstruction\CSharpUseDeconstructionCodeFixProvider.cs (3)
58private SyntaxNode UpdateRoot( 61SyntaxNode root, 62SyntaxNode node,
src\Analyzers\CSharp\CodeFixes\UseDefaultLiteral\CSharpUseDefaultLiteralCodeFixProvider.cs (1)
49var originalRoot = editor.OriginalRoot;
src\Analyzers\CSharp\CodeFixes\UseExpressionBody\UseExpressionBodyCodeFixProvider.cs (1)
85var updatedDeclaration = helper.Update(semanticModel, declaration, useExpressionBody, cancellationToken)
src\Analyzers\CSharp\CodeFixes\UseImplicitObjectCreation\CSharpUseImplicitObjectCreationCodeFixProvider.cs (2)
68private static SyntaxNode FixOne(SyntaxNode root, ObjectCreationExpressionSyntax objectCreation)
src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseExplicitTypeCodeFixProvider.cs (8)
44var root = editor.OriginalRoot; 48var node = root.FindNode(diagnostic.Location.SourceSpan, getInnermostNodeForTie: true); 55SyntaxNode node, CancellationToken cancellationToken) 57var declarationContext = node.Parent; 128private static async Task UpdateTypeSyntaxAsync(Document document, SyntaxEditor editor, TypeSyntax typeSyntax, SyntaxNode declarationSyntax, CancellationToken cancellationToken) 147SyntaxNode declarationSyntax, 207private static SyntaxNode GenerateTypeDeclaration(TypeSyntax typeSyntax, ITypeSymbol newTypeSymbol) 218private static ITypeSymbol GetConvertedType(SemanticModel semanticModel, SyntaxNode typeSyntax, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseImplicitTypeCodeFixProvider.cs (1)
36var root = editor.OriginalRoot;
src\Analyzers\CSharp\CodeFixes\UseIndexOrRangeOperator\CSharpUseRangeOperatorCodeFixProvider.cs (2)
62private static SyntaxNode UpdateInvocation( 63SemanticModel semanticModel, SyntaxNode currentRoot,
src\Analyzers\CSharp\CodeFixes\UseInferredMemberName\CSharpUseInferredMemberNameCodeFixProvider.cs (1)
18protected override void LanguageSpecificRemoveSuggestedNode(SyntaxEditor editor, SyntaxNode node)
src\Analyzers\CSharp\CodeFixes\UseIsNullCheck\CSharpUseIsNullCheckForReferenceEqualsCodeFixProvider.cs (5)
33private static SyntaxNode CreateEqualsNullCheck(ExpressionSyntax argument) 36private static SyntaxNode CreateIsNullCheck(ExpressionSyntax argument) 39private static SyntaxNode CreateIsNotNullCheck(ExpressionSyntax argument) 58protected override SyntaxNode CreateNullCheck(ExpressionSyntax argument, bool isUnconstrainedGeneric) 63protected override SyntaxNode CreateNotNullCheck(ExpressionSyntax argument)
src\Analyzers\CSharp\CodeFixes\UseIsNullCheck\CSharpUseNullCheckOverTypeCheckCodeFixProvider.cs (1)
45SyntaxNode replacement = node switch
src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (7)
62var nodesToTrack = new HashSet<SyntaxNode>(); 83var root = editor.OriginalRoot; 84var currentRoot = root.TrackNodes(nodesToTrack); 152private static SyntaxNode ReplaceAnonymousWithLocalFunction( 153SolutionServices services, SyntaxNode currentRoot, 175private static SyntaxNode ReplaceReferences( 176Document document, SyntaxNode currentRoot,
src\Analyzers\CSharp\CodeFixes\UseNullPropagation\CSharpUseNullPropagationCodeFixProvider.cs (2)
32protected override bool TryGetBlock(SyntaxNode? statement, [NotNullWhen(true)] out StatementSyntax? block) 47protected override SyntaxNode PostProcessElseIf(IfStatementSyntax ifStatement, StatementSyntax newWhenTrueStatement)
src\Analyzers\CSharp\CodeFixes\UseObjectInitializer\UseInitializerHelpers.cs (1)
41where TElementSyntax : SyntaxNode
src\Analyzers\CSharp\CodeFixes\UsePatternCombinators\CSharpUsePatternCombinatorsCodeFixProvider.cs (1)
80var expression = editor.OriginalRoot.FindNode(location.SourceSpan, getInnermostNodeForTie: true);
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpAsAndNullCheckCodeFixProvider.cs (3)
44using var _2 = PooledHashSet<SyntaxNode>.GetInstance(out var statementParentScopes); 98var rightSideOfComparison = comparison is BinaryExpressionSyntax binaryExpression 99? (SyntaxNode)binaryExpression.Right
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (5)
270SyntaxNode TryQualify( 285SyntaxNode CreateDottedName( 301Func<TListSyntax, IEnumerable<SyntaxNode>> getElements) 302where TListSyntax : SyntaxNode 332static string GetLeadingWhitespace(SyntaxNode node)
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider_DocComments.cs (3)
34private static SyntaxTrivia GetDocComment(SyntaxNode node) 69ImmutableDictionary<ISymbol, (MemberDeclarationSyntax memberNode, SyntaxNode nodeToRemove)> removedMembers) 167ImmutableDictionary<ISymbol, (MemberDeclarationSyntax memberNode, SyntaxNode nodeToRemove)> removedMembers,
src\Analyzers\CSharp\CodeFixes\UseSimpleUsingStatement\UseSimpleUsingStatementCodeFixProvider.cs (6)
55var root = editor.OriginalRoot; 65private static SyntaxNode RewriteBlock( 66SyntaxNode originalBlockLike, 67SyntaxNode currentBlockLike, 101private static SyntaxNode WithStatements( 102SyntaxNode currentBlockLike,
src\Analyzers\CSharp\CodeFixes\UseSystemThreadingLock\CSharpUseSystemThreadingLockCodeFixProvider.cs (1)
98var lockTypeExpression = generator
src\Analyzers\CSharp\CodeFixes\UseThrowExpression\UseThrowExpressionCodeFixProvider.cs (5)
44var root = editor.OriginalRoot; 48var ifStatement = root.FindNode(diagnostic.AdditionalLocations[0].SourceSpan); 49var throwStatementExpression = root.FindNode(diagnostic.AdditionalLocations[1].SourceSpan); 50var assignmentValue = root.FindNode(diagnostic.AdditionalLocations[2].SourceSpan); 51var assignmentExpressionStatement = root.FindNode(diagnostic.AdditionalLocations[3].SourceSpan);
src\Analyzers\CSharp\CodeFixes\UseUtf8StringLiteral\UseUtf8StringLiteralCodeFixProvider.cs (2)
152private static SyntaxNode CreateArgumentListWithUtf8String(BaseArgumentListSyntax argumentList, Location location, string stringValue, bool isConvertedToReadOnlySpan) 183private static ExpressionSyntax CreateUtf8String(SyntaxNode nodeToTakeTriviaFrom, string stringValue, bool isConvertedToReadOnlySpan)
src\Compilers\CSharp\CSharpAnalyzerDriver\CSharpDeclarationComputer.cs (12)
37SyntaxNode node, 59SyntaxNode node, 60Func<SyntaxNode, int?, bool> shouldSkip, 95builder.Add(new DeclarationInfo(name, ImmutableArray<SyntaxNode>.Empty, declaredSymbol)); 262var blocks = ArrayBuilder<SyntaxNode>.GetInstance(); 334private static IEnumerable<SyntaxNode> GetAttributes(SyntaxList<AttributeListSyntax> attributeLists) 345private static IEnumerable<SyntaxNode> GetParameterListInitializersAndAttributes(BaseParameterListSyntax parameterList) => 348SpecializedCollections.EmptyEnumerable<SyntaxNode>(); 350private static IEnumerable<SyntaxNode> GetParameterInitializersAndAttributes(ParameterSyntax parameter) => 353private static IEnumerable<SyntaxNode> GetTypeParameterListAttributes(TypeParameterListSyntax typeParameterList) => 356SpecializedCollections.EmptyEnumerable<SyntaxNode>(); 370executableCodeBlocks: ImmutableArray.Create<SyntaxNode>(expressionBody),
src\Compilers\CSharp\Portable\Syntax\LambdaUtilities.cs (27)
18public static bool IsLambda(SyntaxNode node) 46public static bool IsNotLambda(SyntaxNode node) => !IsLambda(node); 51public static SyntaxNode GetLambda(SyntaxNode lambdaBody) 54var lambda = lambdaBody.Parent; 71internal static SyntaxNode? TryGetCorrespondingLambdaBody(SyntaxNode oldBody, SyntaxNode newLambda) 123public static SyntaxNode GetNestedFunctionBody(SyntaxNode nestedFunction) 131public static bool IsNotLambdaBody(SyntaxNode node) 139public static bool IsLambdaBody(SyntaxNode node, bool allowReducedLambdas = false) 141var parent = node?.Parent; 229var containingQueryOrContinuation = selectOrGroupClause.Parent.Parent; 269public static bool IsLambdaBodyStatementOrExpression(SyntaxNode node) 274public static bool IsLambdaBodyStatementOrExpression(SyntaxNode node, out SyntaxNode lambdaBody) 283public static bool TryGetLambdaBodies(SyntaxNode node, [NotNullWhen(true)] out SyntaxNode? lambdaBody1, out SyntaxNode? lambdaBody2) 360public static bool AreEquivalentIgnoringLambdaBodies(SyntaxNode oldNode, SyntaxNode newNode) 372internal static bool IsQueryPairLambda(SyntaxNode syntax) 386internal static bool IsClosureScope(SyntaxNode node) 478internal static int GetDeclaratorPosition(SyntaxNode node) 484private static SyntaxNode? GetLocalFunctionBody(LocalFunctionStatementSyntax localFunctionStatementSyntax) 485=> (SyntaxNode?)localFunctionStatementSyntax.Body ?? localFunctionStatementSyntax.ExpressionBody?.Expression;
src\Compilers\CSharp\Portable\Syntax\SyntaxBindingUtilities.cs (2)
13public static bool BindsToResumableStateMachineState(SyntaxNode node) 20public static bool BindsToTryStatement(SyntaxNode node)
StringIndentation\CSharpStringIndentationService.cs (1)
35using var _ = ArrayBuilder<SyntaxNode>.GetInstance(out var nodeStack);
Structure\CSharpStructureHelpers.cs (14)
84public static SyntaxToken GetLastInlineMethodBlockToken(SyntaxNode node) 211SyntaxNode node, 233static bool TryGetLeadingCollapsibleSpan(SyntaxNode node, out BlockSpan span) 267static SyntaxToken GetEndToken(SyntaxNode node) 287static SyntaxToken GetHintTextEndToken(SyntaxNode node) 320SyntaxNode node, string bannerText, bool autoCollapse, 332SyntaxNode node, SyntaxToken syntaxToken, bool compressEmptyLines, 342SyntaxNode node, SyntaxToken startToken, 369private static TextSpan GetHintSpan(SyntaxNode node, int endPos) 387SyntaxNode node, SyntaxToken startToken, 398SyntaxNode node, bool autoCollapse, string type, bool isCollapsible) 411SyntaxNode node, SyntaxToken syntaxToken, bool compressEmptyLines, 425SyntaxNode node, SyntaxToken startToken, SyntaxToken endToken, bool compressEmptyLines, 440IEnumerable<SyntaxNode> syntaxList, bool compressEmptyLines, bool autoCollapse,
Structure\Providers\BlockSyntaxStructureProvider.cs (2)
147private static bool IsNonBlockStatement(SyntaxNode node) 199private static string? GetType(SyntaxNode? parent)
Structure\Providers\CompilationUnitStructureProvider.cs (1)
27var externsAndUsings = new List<SyntaxNode>();
Structure\Providers\FileScopedNamespaceDeclarationStructureProvider.cs (1)
28var externsAndUsings = Enumerable.Union<SyntaxNode>(fileScopedNamespaceDeclaration.Externs, fileScopedNamespaceDeclaration.Usings).ToImmutableArray();
Structure\Providers\NamespaceDeclarationStructureProvider.cs (1)
38var externsAndUsings = Enumerable.Union<SyntaxNode>(namespaceDeclaration.Externs, namespaceDeclaration.Usings)
Testing\CSharpTestMethodFinder.cs (1)
21protected override bool DescendIntoChildren(SyntaxNode node)
UseAutoProperty\CSharpUseAutoPropertyCodeFixProvider.cs (5)
42protected override PropertyDeclarationSyntax GetPropertyDeclaration(SyntaxNode node) 54protected override SyntaxNode GetNodeToRemove(VariableDeclaratorSyntax declarator) 79protected override Task<SyntaxNode> UpdatePropertyAsync( 107return Task.FromResult<SyntaxNode>(propertyDeclaration); 142return Task.FromResult<SyntaxNode>(finalProperty);
UseAutoProperty\UseAutoPropertyRewriter.cs (2)
21public override SyntaxNode? VisitMemberAccessExpression(MemberAccessExpressionSyntax node) 41public override SyntaxNode? VisitIdentifierName(IdentifierNameSyntax node)
UseExpressionBody\UseExpressionBodyCodeRefactoringProvider.cs (24)
93private static SyntaxNode? TryGetDeclaration( 94UseExpressionBodyHelper helper, SourceText text, SyntaxNode node, int position) 114CodeRefactoringContext context, SyntaxNode root, SyntaxNode declaration, 150private static SyntaxNode? GetDeclaration(SyntaxNode node, UseExpressionBodyHelper helper) 152for (var current = node; current != null; current = current.Parent) 162Document document, SyntaxNode root, SyntaxNode declaration, 171private static SyntaxNode GetUpdatedRoot( 172SemanticModel semanticModel, SyntaxNode root, SyntaxNode declaration, 175var updatedDeclaration = helper.Update(semanticModel, declaration, useExpressionBody, cancellationToken); 177var parent = declaration is AccessorDeclarationSyntax 181var updatedParent = parent.ReplaceNode(declaration, updatedDeclaration) 204static IEnumerable<SyntaxNode> GetDeclarationsToFix( 206SyntaxNode root, 215var spanNode = root.FindNode(span); 217foreach (var node in spanNode.DescendantNodesAndSelf()) 237SyntaxNode root, 238ImmutableArray<SyntaxNode> declarationsToFix, 244var currentRoot = root.TrackNodes(declarationsToFix); 247foreach (var declaration in declarationsToFix.Reverse()) 253var currentDeclaration = currentRoot.GetCurrentNodes(declaration).Single();
UseExpressionBodyForLambda\UseExpressionBodyForLambdaCodeRefactoringProvider.cs (2)
195Document document, SyntaxNode root, LambdaExpressionSyntax declaration, CancellationToken cancellationToken) 203var newRoot = root.ReplaceNode(declaration, updatedDeclaration);
UseNamedArguments\CSharpUseNamedArgumentsCodeRefactoringProvider.cs (4)
24where TSyntax : SyntaxNode 25where TSyntaxList : SyntaxNode 29protected sealed override SyntaxNode? GetReceiver(SyntaxNode argument)
UsePatternMatching\CSharpIsAndCastCheckWithoutNameCodeFixProvider.cs (1)
65var updatedRoot = updatedSemanticModel.SyntaxTree.GetRoot(cancellationToken);
UsePatternMatching\CSharpIsAndCastCheckWithoutNameDiagnosticAnalyzer.cs (8)
114var container = GetContainer(isExpression); 177var root = updatedSemanticModel.SyntaxTree.GetRoot(cancellationToken); 179var currentNode = root.GetAnnotatedNodes(s_referenceAnnotation).Single(); 190var root = semanticModel.SyntaxTree.GetRoot(cancellationToken); 216var changedRoot = editor.GetChangedRoot(); 227private static SyntaxNode? GetContainer(BinaryExpressionSyntax isExpression) 229for (SyntaxNode? current = isExpression; current != null; current = current.Parent) 248SyntaxNode node, ExpressionSyntax expr, TypeSyntax type, HashSet<CastExpressionSyntax> matches)
Wrapping\SeparatedSyntaxList\AbstractCSharpSeparatedSyntaxListWrapper.cs (2)
12where TListSyntax : SyntaxNode 13where TListItemSyntax : SyntaxNode
Wrapping\SeparatedSyntaxList\CSharpArgumentWrapper.cs (4)
47protected override BaseArgumentListSyntax? TryGetApplicableList(SyntaxNode node) 58SyntaxNode root, 60SyntaxNode declaration, 100for (var current = token.Parent; current != listSyntax; current = current?.Parent)
Wrapping\SeparatedSyntaxList\CSharpCollectionExpressionWrapper.cs (3)
45protected override CollectionExpressionSyntax? TryGetApplicableList(SyntaxNode node) 48protected override bool PositionIsApplicable(SyntaxNode root, int position, SyntaxNode declaration, bool containsSyntaxError, CollectionExpressionSyntax listSyntax)
Wrapping\SeparatedSyntaxList\CSharpInitializerExpressionWrapper.cs (3)
45protected override InitializerExpressionSyntax? TryGetApplicableList(SyntaxNode node) 48protected override bool PositionIsApplicable(SyntaxNode root, int position, SyntaxNode declaration, bool containsSyntaxError, InitializerExpressionSyntax listSyntax)
Wrapping\SeparatedSyntaxList\CSharpParameterWrapper.cs (3)
47protected override BaseParameterListSyntax? TryGetApplicableList(SyntaxNode node) 51SyntaxNode root, int position, SyntaxNode declaration, bool containsSyntaxError, BaseParameterListSyntax listSyntax)
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (42)
EditAndContinue\BreakpointSpansTests.cs (3)
71where TDeclaration : SyntaxNode 76var root = tree.GetRoot(); 92public static IEnumerable<TextSpan> GetBreakpointSequence(SyntaxNode root, int position)
EditAndContinue\CSharpEditAndContinueAnalyzerTests.cs (6)
48private static void TestSpans(string source, Func<SyntaxNode, bool> hasLabel) 56var node = token.Parent; 305var oldSyntaxRoot = await oldDocument.GetSyntaxRootAsync(); 310var newSyntaxRoot = await newDocument.GetSyntaxRootAsync(); 316var oldStatementSyntax = oldSyntaxRoot.FindNode(oldStatementTextSpan); 339var newStatementSyntax = newSyntaxRoot.FindNode(newStatementTextSpan);
EditAndContinue\Helpers\CSharpEditAndContinueTestVerifier.cs (3)
15internal sealed class CSharpEditAndContinueTestVerifier(Action<SyntaxNode>? faultInjector = null) : EditAndContinueTestVerifier 22public override TreeComparer<SyntaxNode> TopSyntaxComparer => SyntaxComparer.TopLevel; 25public override ImmutableArray<SyntaxNode> GetDeclarators(ISymbol method)
EditAndContinue\Helpers\EditingTestBase.cs (7)
167internal static Match<SyntaxNode> GetMethodMatch(string src1, string src2, MethodKind kind = MethodKind.Regular) 184internal static IEnumerable<KeyValuePair<SyntaxNode, SyntaxNode>> GetMethodMatches(string src1, string src2, MethodKind kind = MethodKind.Regular) 190public static MatchingPairs ToMatchingPairs(Match<SyntaxNode> match) 193public static MatchingPairs ToMatchingPairs(IEnumerable<KeyValuePair<SyntaxNode, SyntaxNode>> matches) 203var root = tree.GetRoot();
EditAndContinue\StatementMatchingTests.cs (6)
35var knownMatches = new KeyValuePair<SyntaxNode, SyntaxNode>[] 37new KeyValuePair<SyntaxNode, SyntaxNode>(((BlockSyntax)m1.RootNodes.First()).Statements[1], ((BlockSyntax)m2.RootNodes.First()).Statements[0]) 83var knownMatches = new[] { new KeyValuePair<SyntaxNode, SyntaxNode>(m1.RootNodes.First(), m2.RootNodes.First()) };
EditAndContinue\SyntaxComparerTests.cs (3)
22private static SyntaxNode MakeLiteral(int n) 128Array.Empty<SyntaxNode>()); 133Array.Empty<SyntaxNode>(),
EditAndContinue\SyntaxUtilitiesTests.cs (12)
21var oldRoot = SyntaxFactory.ParseSyntaxTree(oldSource).GetRoot(); 22var newRoot = SyntaxFactory.ParseSyntaxTree(newSource).GetRoot(); 24foreach (var oldNode in oldRoot.DescendantNodes().Where(n => n.FullSpan.Length > 0)) 26var newNode = AbstractEditAndContinueAnalyzer.FindPartner(newRoot, oldRoot, oldNode); 73var leftRoot = SyntaxFactory.ParseSyntaxTree(@" 88var rightRoot = SyntaxFactory.ParseSyntaxTree(@" 106AbstractEditAndContinueAnalyzer.FindLeafNodeAndPartner(leftRoot, leftPosition, rightRoot, out var leftNode, out var rightNodeOpt); 116var leftRoot = SyntaxFactory.ParseSyntaxTree(@" 135var rightRoot = SyntaxFactory.ParseSyntaxTree(@" 156AbstractEditAndContinueAnalyzer.FindLeafNodeAndPartner(leftRoot, leftPosition, rightRoot, out var leftNode, out var rightNodeOpt);
InlineTemporary\InlineTemporaryTests.cs (2)
37private static SyntaxNode GetNodeToFix(dynamic initialRoot, int declaratorIndex) 40private static SyntaxNode GetFixedNode(dynamic fixedRoot)
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (21)
IOperation\IOperationTests.cs (1)
679SyntaxNode expectedRootSyntax)
IOperation\IOperationTests_IArgument.cs (1)
4143public static void Verify(IOperation operation, Compilation compilation, SyntaxNode syntaxNode)
IOperation\IOperationTests_IBranchOperation.Extensions.cs (4)
358where TOuterSyntax : SyntaxNode 359where TInnerSyntax : SyntaxNode 374where TOuterSyntax : SyntaxNode 375where TInnerSyntax : SyntaxNode
IOperation\IOperationTests_ICompoundAssignmentOperation.cs (1)
81(IOperation operation, SyntaxNode node) = GetOperationAndSyntaxForTest<AssignmentExpressionSyntax>(compilation);
IOperation\IOperationTests_IConversionExpression.cs (12)
5327public static SyntaxNode VariableDeclaratorSelector(SyntaxNode syntaxNode) => 5330public static SyntaxNode IdentitySelector(SyntaxNode syntaxNode) => syntaxNode; 5332public static SyntaxNode ReturnStatementSelector(SyntaxNode syntaxNode) => ((ReturnStatementSyntax)syntaxNode).Expression; 5365public Func<SyntaxNode, SyntaxNode> SyntaxSelector { get; set; } 5377public void Verify(IOperation variableDeclaration, Compilation compilation, SyntaxNode syntaxNode) 5379var finalSyntax = GetAndInvokeSyntaxSelector(syntaxNode); 5390private SyntaxNode GetAndInvokeSyntaxSelector(SyntaxNode syntax)
IOperation\IOperationTests_IFieldReferenceExpression.cs (1)
706var root = syntaxTree.GetRoot();
IOperation\IOperationTests_ISymbolInitializer.cs (1)
37foreach (var node in nodes)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (79)
Semantics\AnonymousFunctionTests.cs (2)
981var root = syntaxTree.GetRoot(); 1015var root = syntaxTree.GetRoot();
Semantics\BindingTests.cs (18)
2888var node = tree.GetRoot().DescendantNodes().Where(n => n.IsKind(SyntaxKind.SimpleLambdaExpression)).Single(); 2889var param = node.ChildNodes().Where(n => n.IsKind(SyntaxKind.Parameter)).Single(); 2925var lambda = tree.GetRoot().DescendantNodes().Where(n => n.IsKind(SyntaxKind.SimpleLambdaExpression)).Single(); 2927var param = lambda.ChildNodes().Where(n => n.IsKind(SyntaxKind.Parameter)).Single(); 2931var id = lambda.DescendantNodes().First(n => n.IsKind(SyntaxKind.IdentifierName)); 2967var lambda = tree.GetRoot().DescendantNodes().Where(n => n.IsKind(SyntaxKind.SimpleLambdaExpression)).Single(); 2969var param = lambda.ChildNodes().Where(n => n.IsKind(SyntaxKind.Parameter)).Single(); 2973var id = lambda.DescendantNodes().First(n => n.IsKind(SyntaxKind.IdentifierName)); 3037var node1 = tree.GetRoot().DescendantNodes().Where(n => n.IsKind(SyntaxKind.IdentifierName) && ((IdentifierNameSyntax)n).Identifier.ValueText == "Use").Single().Parent; 3051var node = tree.GetRoot().DescendantNodes().Where(n => n.IsKind(SyntaxKind.IdentifierName) && ((IdentifierNameSyntax)n).Identifier.ValueText == "AuthenticateAsync").Single().Parent; 3117var node1 = tree.GetRoot().DescendantNodes().Where(n => n.IsKind(SyntaxKind.IdentifierName) && ((IdentifierNameSyntax)n).Identifier.ValueText == "Use").Single().Parent; 3131var node = tree.GetRoot().DescendantNodes().Where(n => n.IsKind(SyntaxKind.IdentifierName) && ((IdentifierNameSyntax)n).Identifier.ValueText == "AuthenticateAsync").Single().Parent; 3190var node1 = tree.GetRoot().DescendantNodes().Where(n => n.IsKind(SyntaxKind.IdentifierName) && ((IdentifierNameSyntax)n).Identifier.ValueText == "Use").Single().Parent; 3205var node = tree.GetRoot().DescendantNodes().Where(n => n.IsKind(SyntaxKind.IdentifierName) && ((IdentifierNameSyntax)n).Identifier.ValueText == "AuthenticateAsync").Single().Parent; 3275var node1 = tree.GetRoot().DescendantNodes().Where(n => n.IsKind(SyntaxKind.IdentifierName) && ((IdentifierNameSyntax)n).Identifier.ValueText == "Use").Single().Parent; 3290var node = tree.GetRoot().DescendantNodes().Where(n => n.IsKind(SyntaxKind.IdentifierName) && ((IdentifierNameSyntax)n).Identifier.ValueText == "AuthenticateAsync").Single().Parent; 3380var node1 = tree.GetRoot().DescendantNodes().Where(n => n.IsKind(SyntaxKind.IdentifierName) && ((IdentifierNameSyntax)n).Identifier.ValueText == "MathMin").Single().Parent; 3732var node1 = tree.GetRoot().DescendantNodes().Where(n => n.IsKind(SyntaxKind.IdentifierName) && ((IdentifierNameSyntax)n).Identifier.ValueText == "E").Single().Parent;
Semantics\ColorColorTests.cs (1)
1813var syntaxRoot = syntaxTree.GetRoot();
Semantics\DeconstructionTests.cs (1)
3944foreach (var node in nodes)
Semantics\FuzzTests.cs (1)
53foreach (var node in tree.GetRoot().DescendantNodes())
Semantics\InteractiveSemanticModelTests.cs (1)
278private List<ExpressionSyntax> GetExprSyntaxList(SyntaxNode node, List<ExpressionSyntax> exprSynList)
Semantics\InterceptorsTests.cs (4)
1974var root = source.GetRoot(); 1976var node1 = root.DescendantNodes().First(node => node is IdentifierNameSyntax name && name.Identifier.Text == "Prop"); 1979var node2 = root.DescendantNodes().Single(node => node is ObjectCreationExpressionSyntax); 1982var node3 = root.DescendantNodes().Last(node => node is IdentifierNameSyntax name && name.Identifier.Text == "Program");
Semantics\InterpolationTests.cs (1)
4825SyntaxNode syntax = tree.GetRoot().DescendantNodes().OfType<CastExpressionSyntax>().Single();
Semantics\LambdaTests.cs (2)
1979var node1 = tree.GetRoot().DescendantNodes().Where(n => n.IsKind(SyntaxKind.AnonymousMethodExpression)).Single(); 7105var root = syntaxTree.GetRoot();
Semantics\LocalFunctionTests.cs (2)
1763var root = tree.GetRoot(); 1838var root = tree.GetRoot();
Semantics\LookupTests.cs (3)
681var baseExprNode = GetSyntaxNodeForBinding(GetSyntaxNodeList(tree)); 1643var node = tree.GetRoot().DescendantNodes().Where(n => n.ToString() == "returne<double>").First(); 1670var node = tree.GetRoot().DescendantNodes().Where(n => n.ToString() == "System.Object").First();
Semantics\NameOfTests.cs (1)
3041var root = tree.GetRoot();
Semantics\NativeIntegerTests.cs (2)
10107var expr = tree.GetRoot().DescendantNodes().Single(n => n.Kind() == kind); 10332var expr = tree.GetRoot().DescendantNodes().Single(n => n.Kind() == kind);
Semantics\NullableContextTests.cs (1)
2255key is Symbol symbol ? symbol.MetadataName : ((SyntaxNode)key).ToString();
Semantics\NullableReferenceTypesTests.cs (4)
3693var lambda = tree.GetRoot().DescendantNodes().Where(n => n.IsKind(SyntaxKind.SimpleLambdaExpression)).Single(); 3695var param = lambda.ChildNodes().Where(n => n.IsKind(SyntaxKind.Parameter)).Single(); 3699var id = lambda.DescendantNodes().First(n => n.IsKind(SyntaxKind.IdentifierName)); 146453var root = tree.GetRoot();
Semantics\NullCoalesceAssignmentTests.cs (8)
36var syntaxRoot = syntaxTree.GetRoot(); 44void assertTypeInfo(SyntaxNode syntax) 74var syntaxRoot = syntaxTree.GetRoot(); 86void assertTypeInfo(SyntaxNode syntax) 117var syntaxRoot = syntaxTree.GetRoot(); 129void assertTypeInfo(SyntaxNode syntax) 156var syntaxRoot = syntaxTree.GetRoot(); 182var syntaxRoot = syntaxTree.GetRoot();
Semantics\ObjectAndCollectionInitializerTests.cs (3)
3690var root = tree.GetRoot(); 3740var root = tree.GetRoot(); 3784var root = tree.GetRoot();
Semantics\OperatorTests.cs (1)
7329var syntax = tree.GetRoot();
Semantics\QueryTests.cs (2)
2272var queryContinuation = tree.GetRoot().FindToken(sourceCode.IndexOf("into w", StringComparison.Ordinal)).Parent; 2325var joinInto = tree.GetRoot().FindToken(sourceCode.IndexOf("into x8", StringComparison.Ordinal)).Parent;
Semantics\RawInterpolationTests_Handler.cs (1)
3126SyntaxNode syntax = tree.GetRoot().DescendantNodes().OfType<CastExpressionSyntax>().Single();
Semantics\RefEscapingTests.cs (1)
50var root = tree.GetRoot();
Semantics\RefFieldTests.cs (1)
16772var root = syntaxTree.GetRoot();
Semantics\SwitchTests.cs (1)
1154var node = syntaxTree.GetRoot().DescendantNodes().First(x => x.IsKind(SyntaxKind.SimpleMemberAccessExpression));
Semantics\SyntaxTreeRootTests.cs (2)
51SyntaxNode root; 116Assert.Throws<ArgumentNullException>(() => { tree.GetDiagnostics((SyntaxNode)null); });
Semantics\TopLevelStatementsTests.cs (2)
238Assert.Same(declSymbol.ContainingSymbol, model1.GetDeclaredSymbol((SyntaxNode)unit1)); 9702var root = tree.GetRoot();
Semantics\UnsafeTests.cs (4)
6302var root = tree.GetRoot(); 6379var root = tree.GetRoot(); 7850var callSyntax = syntax.Parent; 7917var callSyntax = syntax.Parent;
SourceGeneration\GeneratorDriverTests.cs (4)
1145var rootFromGetRoot = tree.GetRoot(); 1147Assert.True(tree.TryGetRoot(out var rootFromTryGetRoot)); 2592static bool isSyntaxTargetForGeneration(SyntaxNode node) 4194private static bool IsInterceptableCall(SyntaxNode node, CancellationToken token) => node is InvocationExpressionSyntax;
SourceGeneration\GeneratorDriverTests_Attributes_FullyQualifiedName.cs (2)
23where T : SyntaxNode 32where T : SyntaxNode
SourceGeneration\GeneratorDriverTests_Attributes_SimpleName.cs (1)
153var input = ctx.ForAttributeWithSimpleName<SyntaxNode>("XAttribute");
SourceGeneration\SyntaxAwareGeneratorTests.cs (2)
2146private class TestSyntaxReceiver : TestReceiverBase<SyntaxNode>, ISyntaxReceiver 2148public TestSyntaxReceiver(int tag = 0, Action<SyntaxNode>? callback = null)
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (160)
Compilation\GetSemanticInfoBrokenCodeTests.cs (3)
371private void VisitAllExpressions(SemanticModel model, SyntaxNode node) 382private static IEnumerable<ExpressionSyntax> GetAllExpressions(SyntaxNode node) 387private static IEnumerable<StatementSyntax> GetAllStatements(SyntaxNode node)
Compilation\GetSemanticInfoTests.cs (3)
4911var equalsNode = equalsToken.Parent; 5914var expr = tokens.Single(t => t.Kind() == SyntaxKind.TrueKeyword).Parent; 5987var root = tree.GetRoot();
Compilation\SemanticModelAPITests.cs (7)
42var root = tree.GetRoot(); 109SyntaxNode root = tree.GetRoot(); 3751var expr = identifier.FirstAncestorOrSelf<ArgumentSyntax>().Parent.Parent; 4059var x = tree.GetRoot().FindToken(match.Index + 4).Parent; 4424var root = syntaxTree.GetRoot(); 4457var root = tree.GetRoot(); 4785private static void GetExpressionSyntax(SyntaxNode node, List<ExpressionSyntax> exprSynList)
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (18)
688private void TestAnonymousTypePropertySymbol(SemanticModel model, SyntaxNode node, string name) 3314var paramNode = tree.GetCompilationUnitRoot().FindToken(tree.GetCompilationUnitRoot().ToFullString().IndexOf("param1", StringComparison.Ordinal)).Parent; 3341var paramNode = root.FindToken(root.ToFullString().IndexOf('x')).Parent; 3367var paramNode = root.FindToken(root.ToFullString().IndexOf('x')).Parent; 3384var node = root.ChildNodes().First(); 3408var foreachNode = tree.GetCompilationUnitRoot().FindToken(tree.GetCompilationUnitRoot().ToFullString().IndexOf("foreach", StringComparison.Ordinal)).Parent; 3429var delegateNode = tree.GetCompilationUnitRoot().FindToken(tree.GetCompilationUnitRoot().ToFullString().IndexOf("delegate", StringComparison.Ordinal)).Parent; 3448var usingNode = tree.GetCompilationUnitRoot().FindToken(tree.GetCompilationUnitRoot().ToFullString().IndexOf("using", StringComparison.Ordinal)).Parent; 3477var foreachNode = tree.GetCompilationUnitRoot().FindToken(tree.GetCompilationUnitRoot().ToFullString().IndexOf("aaa", StringComparison.Ordinal)).Parent; 3501var foreachNode = tree.GetCompilationUnitRoot().FindToken(tree.GetCompilationUnitRoot().ToFullString().IndexOf("aaa", StringComparison.Ordinal)).Parent; 3528var foreachNode1 = tree.GetCompilationUnitRoot().FindToken(tree.GetCompilationUnitRoot().ToFullString().IndexOf("aaa", StringComparison.Ordinal)).Parent; 3534var foreachNode2 = tree.GetCompilationUnitRoot().FindToken(tree.GetCompilationUnitRoot().ToFullString().IndexOf("bbb", StringComparison.Ordinal)).Parent; 3565var catchDeclaration = tree.GetCompilationUnitRoot().FindToken(tree.GetCompilationUnitRoot().ToFullString().IndexOf("aaa", StringComparison.Ordinal)).Parent; 3586var methodDecl = tree.GetCompilationUnitRoot().FindToken(tree.GetCompilationUnitRoot().ToFullString().IndexOf("Goo", StringComparison.Ordinal)).Parent; 3611var methodDecl = tree.GetCompilationUnitRoot().FindToken(tree.GetCompilationUnitRoot().ToFullString().IndexOf("Goo", StringComparison.Ordinal)).Parent; 3686var globalStmt = tree.GetCompilationUnitRoot().FindToken(tree.GetCompilationUnitRoot().ToFullString().IndexOf('/')).Parent.AncestorsAndSelf().Single(x => x.IsKind(SyntaxKind.GlobalStatement)); 5127var node = root.ChildNodes().First(); 5206var node = tree.GetRoot().DescendantNodes().Single(node => node is IdentifierNameSyntax { Identifier: { ValueText: "b" } });
Compilation\SemanticModelGetSemanticInfoTests.cs (1)
15434var syntax = tree.GetCompilationUnitRoot().DescendantNodes().Single(n => n.Kind() == SyntaxKind.ThisExpression);
DeclarationTests.cs (5)
911public override SyntaxNode GetSyntax(CancellationToken cancellationToken) 915var nodeInUnderlying = _underlyingSyntaxReference.GetSyntax(cancellationToken); 919for (var node = token.Parent; node != null; node = node.Parent) 996public override SyntaxReference GetReference(SyntaxNode node) 1006public override SyntaxTree WithRootAndOptions(SyntaxNode root, ParseOptions options)
SymbolDisplay\SymbolDisplayTests.cs (13)
6433var root = srcTree.GetRoot(); 6437var local = root.DescendantNodes() 6476var root = srcTree.GetRoot(); 6480var local = root.DescendantNodes() 6510var root = srcTree.GetRoot(); 6514var local = root.DescendantNodes() 6572var root = srcTree.GetRoot(); 6605var root = srcTree.GetRoot(); 6609var local = root.DescendantNodes() 6666var root = srcTree.GetRoot(); 6699var root = srcTree.GetRoot(); 6744var root = srcTree.GetRoot(); 7516var structure = semanticModel.SyntaxTree.GetRoot().DescendantNodes().Single(n => n.RawKind == (int)VisualBasic.SyntaxKind.StructureStatement);
Symbols\AnonymousTypesSemanticsTests.cs (7)
2005private void CheckFieldNameAndLocation(TestData data, ITypeSymbol type, SyntaxNode identifier) 2009var current = identifier; 2035public List<SyntaxNode> Nodes; 2049var nodes = new List<SyntaxNode>(); 2053var stack = new Stack<SyntaxNode>(); 2058var node = stack.Pop(); 2065foreach (var child in node.ChildNodes())
Symbols\EnumTests.cs (1)
353var expr = tree.GetRoot().DescendantNodes().Single(n => n.Kind() == SyntaxKind.BitwiseNotExpression);
Symbols\ExtensionMethodTests.cs (1)
2727var node = tree.GetCompilationUnitRoot().FindToken(code.IndexOf("GetHashCode", StringComparison.Ordinal)).Parent;
Symbols\IndexerTests.cs (1)
2535private static IEnumerable<ElementAccessExpressionSyntax> GetElementAccessExpressions(SyntaxNode node)
Symbols\Source\DeclaringSyntaxNodeTests.cs (3)
39foreach (var node in declaringReferences.Select(d => d.GetSyntax())) 102foreach (var node in declaringReferences.Select(d => d.GetSyntax())) 112private void AssertDeclaringSyntaxNodes(Symbol symbol, CSharpCompilation compilation, params SyntaxNode[] expectedSyntaxNodes)
Symbols\Source\DelegateTests.cs (2)
735var root = syntaxTree.GetRoot(); 762var root = syntaxTree.GetRoot();
Symbols\Source\ExternAliasTests.cs (1)
478var root = tree.GetRoot();
Symbols\Source\MethodTests.cs (2)
288var tree = comp.SyntaxTrees.Single().GetRoot(); 309var tree = comp.SyntaxTrees.Single().GetRoot();
Symbols\Source\NullablePublicAPITests.cs (73)
52var root = syntaxTree.GetRoot(); 86var root = syntaxTree.GetRoot(); 1093var root = syntaxTree.GetRoot(); 1120var root = syntaxTree.GetRoot(); 1208var root = syntaxTree.GetRoot(); 1260var root = syntaxTree.GetRoot(); 1358var root = syntaxTree.GetRoot(); 1438var root = syntaxTree.GetRoot(); 1510var root = syntaxTree.GetRoot(); 1566var root = syntaxTree.GetRoot(); 1623var root = syntaxTree.GetRoot(); 1666var root = syntaxTree.GetRoot(); 1709var root = syntaxTree.GetRoot(); 1848var root = syntaxTree.GetRoot(); 1891var root = syntaxTree.GetRoot(); 1936var root = syntaxTree.GetRoot(); 1983var root = syntaxTree.GetRoot(); 2044var root = syntaxTree.GetRoot(); 2087var root = syntaxTree.GetRoot(); 2130var root = syntaxTree.GetRoot(); 2173var root = syntaxTree.GetRoot(); 2215var root = syntaxTree.GetRoot(); 2245var root = syntaxTree.GetRoot(); 2280var root = syntaxTree.GetRoot(); 2324var root = syntaxTree.GetRoot(); 2365var root = syntaxTree.GetRoot(); 2410var root = syntaxTree.GetRoot(); 2450var root = syntaxTree.GetRoot(); 2498var root = syntaxTree.GetRoot(); 2543var root = syntaxTree.GetRoot(); 2592var root = syntaxTree.GetRoot(); 2626var root = syntaxTree.GetRoot(); 2660var root = syntaxTree.GetRoot(); 2698var root = syntaxTree.GetRoot(); 2734var root = syntaxTree.GetRoot(); 2780var root = syntaxTree.GetRoot(); 2823var root = syntaxTree.GetRoot(); 2872var root = syntaxTree.GetRoot(); 2913var root = syntaxTree.GetRoot(); 2954var root = syntaxTree.GetRoot(); 2996var root = syntaxTree.GetRoot(); 3038var root = syntaxTree.GetRoot(); 3098var root = syntaxTree.GetRoot(); 3145var root = syntaxTree.GetRoot(); 3190var root = syntaxTree.GetRoot(); 3255var root = syntaxTree.GetRoot(); 3307var root = syntaxTree.GetRoot(); 3356var root = syntaxTree.GetRoot(); 3403var root = syntaxTree.GetRoot(); 3448var root = syntaxTree.GetRoot(); 3485var root = syntaxTree.GetRoot(); 3534var root = syntaxTree.GetRoot(); 3595var root = syntaxTree.GetRoot(); 3658var root = syntaxTree.GetRoot(); 3766var root = syntaxTree.GetRoot(); 3805var root = syntaxTree.GetRoot(); 3851var root = syntaxTree.GetRoot(); 3882void assertParent(SyntaxNode node) 3910var root = syntaxTree.GetRoot(); 3975var root = syntaxTree.GetRoot(); 4044var root = syntaxTree.GetRoot(); 4111var root = syntaxTree.GetRoot(); 4174var root = syntaxTree.GetRoot(); 4208var root = syntaxTree.GetRoot(); 4269var root = syntaxTree.GetRoot(); 4303var root = syntaxTree.GetRoot(); 5254var root = tree.GetRoot(); 5277var root = tree.GetRoot(); 5309var root = tree.GetRoot(); 5332var root = tree.GetRoot(); 5354var root = tree.GetRoot(); 5399var root = tree.GetRoot(); 5456var root = tree.GetRoot();
Symbols\Source\UpdatedContainingSymbolAndNullableAnntotationTests.cs (1)
34var root = syntaxTree.GetRoot();
Symbols\SymbolEqualityTests.cs (17)
40var root = tree.GetRoot(); 83var root = tree.GetRoot(); 123var root = tree.GetRoot(); 164var root = tree.GetRoot(); 410var root = syntaxTree.GetRoot(); 448var root = syntaxTree.GetRoot(); 479var root = syntaxTree.GetRoot(); 522var root = syntaxTree.GetRoot(); 553var root = syntaxTree.GetRoot(); 589var root = syntaxTree.GetRoot(); 623var root = syntaxTree.GetRoot(); 672var root = syntaxTree.GetRoot(); 724var root = syntaxTree.GetRoot(); 774var root = syntaxTree.GetRoot(); 825var root = syntaxTree.GetRoot(); 886var root = syntaxTree.GetRoot(); 933var root = syntaxTree.GetRoot();
Symbols\TypeTests.cs (1)
1772var nodes = GetBindingNodes<SyntaxNode>(comp).ToList();
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (673)
Diagnostics\LineSpanDirectiveTests.cs (6)
440private static ImmutableArray<SyntaxNode> GetStatementsAndExpressionBodies(SyntaxTree tree) 442var builder = ArrayBuilder<SyntaxNode>.GetInstance(); 443foreach (var syntax in tree.GetRoot().DescendantNodesAndSelf()) 471private static (string, string) GetTextMapping(SourceText mappedText, SyntaxTree unmappedText, SyntaxNode syntax) 475static string getDescription(SyntaxNode syntax) 484static string getMapping(SourceText mappedText, SyntaxTree unmappedText, SyntaxNode syntax)
Generated\Syntax.Test.xml.Generated.cs (488)
14101var newNode = rewriter.Visit(oldNode); 14117var newNode = rewriter.Visit(oldNode); 14127var newNode = rewriter.Visit(oldNode); 14143var newNode = rewriter.Visit(oldNode); 14153var newNode = rewriter.Visit(oldNode); 14169var newNode = rewriter.Visit(oldNode); 14179var newNode = rewriter.Visit(oldNode); 14195var newNode = rewriter.Visit(oldNode); 14205var newNode = rewriter.Visit(oldNode); 14221var newNode = rewriter.Visit(oldNode); 14231var newNode = rewriter.Visit(oldNode); 14247var newNode = rewriter.Visit(oldNode); 14257var newNode = rewriter.Visit(oldNode); 14273var newNode = rewriter.Visit(oldNode); 14283var newNode = rewriter.Visit(oldNode); 14299var newNode = rewriter.Visit(oldNode); 14309var newNode = rewriter.Visit(oldNode); 14325var newNode = rewriter.Visit(oldNode); 14335var newNode = rewriter.Visit(oldNode); 14351var newNode = rewriter.Visit(oldNode); 14361var newNode = rewriter.Visit(oldNode); 14377var newNode = rewriter.Visit(oldNode); 14387var newNode = rewriter.Visit(oldNode); 14403var newNode = rewriter.Visit(oldNode); 14413var newNode = rewriter.Visit(oldNode); 14429var newNode = rewriter.Visit(oldNode); 14439var newNode = rewriter.Visit(oldNode); 14455var newNode = rewriter.Visit(oldNode); 14465var newNode = rewriter.Visit(oldNode); 14481var newNode = rewriter.Visit(oldNode); 14491var newNode = rewriter.Visit(oldNode); 14507var newNode = rewriter.Visit(oldNode); 14517var newNode = rewriter.Visit(oldNode); 14533var newNode = rewriter.Visit(oldNode); 14543var newNode = rewriter.Visit(oldNode); 14559var newNode = rewriter.Visit(oldNode); 14569var newNode = rewriter.Visit(oldNode); 14585var newNode = rewriter.Visit(oldNode); 14595var newNode = rewriter.Visit(oldNode); 14611var newNode = rewriter.Visit(oldNode); 14621var newNode = rewriter.Visit(oldNode); 14637var newNode = rewriter.Visit(oldNode); 14647var newNode = rewriter.Visit(oldNode); 14663var newNode = rewriter.Visit(oldNode); 14673var newNode = rewriter.Visit(oldNode); 14689var newNode = rewriter.Visit(oldNode); 14699var newNode = rewriter.Visit(oldNode); 14715var newNode = rewriter.Visit(oldNode); 14725var newNode = rewriter.Visit(oldNode); 14741var newNode = rewriter.Visit(oldNode); 14751var newNode = rewriter.Visit(oldNode); 14767var newNode = rewriter.Visit(oldNode); 14777var newNode = rewriter.Visit(oldNode); 14793var newNode = rewriter.Visit(oldNode); 14803var newNode = rewriter.Visit(oldNode); 14819var newNode = rewriter.Visit(oldNode); 14829var newNode = rewriter.Visit(oldNode); 14845var newNode = rewriter.Visit(oldNode); 14855var newNode = rewriter.Visit(oldNode); 14871var newNode = rewriter.Visit(oldNode); 14881var newNode = rewriter.Visit(oldNode); 14897var newNode = rewriter.Visit(oldNode); 14907var newNode = rewriter.Visit(oldNode); 14923var newNode = rewriter.Visit(oldNode); 14933var newNode = rewriter.Visit(oldNode); 14949var newNode = rewriter.Visit(oldNode); 14959var newNode = rewriter.Visit(oldNode); 14975var newNode = rewriter.Visit(oldNode); 14985var newNode = rewriter.Visit(oldNode); 15001var newNode = rewriter.Visit(oldNode); 15011var newNode = rewriter.Visit(oldNode); 15027var newNode = rewriter.Visit(oldNode); 15037var newNode = rewriter.Visit(oldNode); 15053var newNode = rewriter.Visit(oldNode); 15063var newNode = rewriter.Visit(oldNode); 15079var newNode = rewriter.Visit(oldNode); 15089var newNode = rewriter.Visit(oldNode); 15105var newNode = rewriter.Visit(oldNode); 15115var newNode = rewriter.Visit(oldNode); 15131var newNode = rewriter.Visit(oldNode); 15141var newNode = rewriter.Visit(oldNode); 15157var newNode = rewriter.Visit(oldNode); 15167var newNode = rewriter.Visit(oldNode); 15183var newNode = rewriter.Visit(oldNode); 15193var newNode = rewriter.Visit(oldNode); 15209var newNode = rewriter.Visit(oldNode); 15219var newNode = rewriter.Visit(oldNode); 15235var newNode = rewriter.Visit(oldNode); 15245var newNode = rewriter.Visit(oldNode); 15261var newNode = rewriter.Visit(oldNode); 15271var newNode = rewriter.Visit(oldNode); 15287var newNode = rewriter.Visit(oldNode); 15297var newNode = rewriter.Visit(oldNode); 15313var newNode = rewriter.Visit(oldNode); 15323var newNode = rewriter.Visit(oldNode); 15339var newNode = rewriter.Visit(oldNode); 15349var newNode = rewriter.Visit(oldNode); 15365var newNode = rewriter.Visit(oldNode); 15375var newNode = rewriter.Visit(oldNode); 15391var newNode = rewriter.Visit(oldNode); 15401var newNode = rewriter.Visit(oldNode); 15417var newNode = rewriter.Visit(oldNode); 15427var newNode = rewriter.Visit(oldNode); 15443var newNode = rewriter.Visit(oldNode); 15453var newNode = rewriter.Visit(oldNode); 15469var newNode = rewriter.Visit(oldNode); 15479var newNode = rewriter.Visit(oldNode); 15495var newNode = rewriter.Visit(oldNode); 15505var newNode = rewriter.Visit(oldNode); 15521var newNode = rewriter.Visit(oldNode); 15531var newNode = rewriter.Visit(oldNode); 15547var newNode = rewriter.Visit(oldNode); 15557var newNode = rewriter.Visit(oldNode); 15573var newNode = rewriter.Visit(oldNode); 15583var newNode = rewriter.Visit(oldNode); 15599var newNode = rewriter.Visit(oldNode); 15609var newNode = rewriter.Visit(oldNode); 15625var newNode = rewriter.Visit(oldNode); 15635var newNode = rewriter.Visit(oldNode); 15651var newNode = rewriter.Visit(oldNode); 15661var newNode = rewriter.Visit(oldNode); 15677var newNode = rewriter.Visit(oldNode); 15687var newNode = rewriter.Visit(oldNode); 15703var newNode = rewriter.Visit(oldNode); 15713var newNode = rewriter.Visit(oldNode); 15729var newNode = rewriter.Visit(oldNode); 15739var newNode = rewriter.Visit(oldNode); 15755var newNode = rewriter.Visit(oldNode); 15765var newNode = rewriter.Visit(oldNode); 15781var newNode = rewriter.Visit(oldNode); 15791var newNode = rewriter.Visit(oldNode); 15807var newNode = rewriter.Visit(oldNode); 15817var newNode = rewriter.Visit(oldNode); 15833var newNode = rewriter.Visit(oldNode); 15843var newNode = rewriter.Visit(oldNode); 15859var newNode = rewriter.Visit(oldNode); 15869var newNode = rewriter.Visit(oldNode); 15885var newNode = rewriter.Visit(oldNode); 15895var newNode = rewriter.Visit(oldNode); 15911var newNode = rewriter.Visit(oldNode); 15921var newNode = rewriter.Visit(oldNode); 15937var newNode = rewriter.Visit(oldNode); 15947var newNode = rewriter.Visit(oldNode); 15963var newNode = rewriter.Visit(oldNode); 15973var newNode = rewriter.Visit(oldNode); 15989var newNode = rewriter.Visit(oldNode); 15999var newNode = rewriter.Visit(oldNode); 16015var newNode = rewriter.Visit(oldNode); 16025var newNode = rewriter.Visit(oldNode); 16041var newNode = rewriter.Visit(oldNode); 16051var newNode = rewriter.Visit(oldNode); 16067var newNode = rewriter.Visit(oldNode); 16077var newNode = rewriter.Visit(oldNode); 16093var newNode = rewriter.Visit(oldNode); 16103var newNode = rewriter.Visit(oldNode); 16119var newNode = rewriter.Visit(oldNode); 16129var newNode = rewriter.Visit(oldNode); 16145var newNode = rewriter.Visit(oldNode); 16155var newNode = rewriter.Visit(oldNode); 16171var newNode = rewriter.Visit(oldNode); 16181var newNode = rewriter.Visit(oldNode); 16197var newNode = rewriter.Visit(oldNode); 16207var newNode = rewriter.Visit(oldNode); 16223var newNode = rewriter.Visit(oldNode); 16233var newNode = rewriter.Visit(oldNode); 16249var newNode = rewriter.Visit(oldNode); 16259var newNode = rewriter.Visit(oldNode); 16275var newNode = rewriter.Visit(oldNode); 16285var newNode = rewriter.Visit(oldNode); 16301var newNode = rewriter.Visit(oldNode); 16311var newNode = rewriter.Visit(oldNode); 16327var newNode = rewriter.Visit(oldNode); 16337var newNode = rewriter.Visit(oldNode); 16353var newNode = rewriter.Visit(oldNode); 16363var newNode = rewriter.Visit(oldNode); 16379var newNode = rewriter.Visit(oldNode); 16389var newNode = rewriter.Visit(oldNode); 16405var newNode = rewriter.Visit(oldNode); 16415var newNode = rewriter.Visit(oldNode); 16431var newNode = rewriter.Visit(oldNode); 16441var newNode = rewriter.Visit(oldNode); 16457var newNode = rewriter.Visit(oldNode); 16467var newNode = rewriter.Visit(oldNode); 16483var newNode = rewriter.Visit(oldNode); 16493var newNode = rewriter.Visit(oldNode); 16509var newNode = rewriter.Visit(oldNode); 16519var newNode = rewriter.Visit(oldNode); 16535var newNode = rewriter.Visit(oldNode); 16545var newNode = rewriter.Visit(oldNode); 16561var newNode = rewriter.Visit(oldNode); 16571var newNode = rewriter.Visit(oldNode); 16587var newNode = rewriter.Visit(oldNode); 16597var newNode = rewriter.Visit(oldNode); 16613var newNode = rewriter.Visit(oldNode); 16623var newNode = rewriter.Visit(oldNode); 16639var newNode = rewriter.Visit(oldNode); 16649var newNode = rewriter.Visit(oldNode); 16665var newNode = rewriter.Visit(oldNode); 16675var newNode = rewriter.Visit(oldNode); 16691var newNode = rewriter.Visit(oldNode); 16701var newNode = rewriter.Visit(oldNode); 16717var newNode = rewriter.Visit(oldNode); 16727var newNode = rewriter.Visit(oldNode); 16743var newNode = rewriter.Visit(oldNode); 16753var newNode = rewriter.Visit(oldNode); 16769var newNode = rewriter.Visit(oldNode); 16779var newNode = rewriter.Visit(oldNode); 16795var newNode = rewriter.Visit(oldNode); 16805var newNode = rewriter.Visit(oldNode); 16821var newNode = rewriter.Visit(oldNode); 16831var newNode = rewriter.Visit(oldNode); 16847var newNode = rewriter.Visit(oldNode); 16857var newNode = rewriter.Visit(oldNode); 16873var newNode = rewriter.Visit(oldNode); 16883var newNode = rewriter.Visit(oldNode); 16899var newNode = rewriter.Visit(oldNode); 16909var newNode = rewriter.Visit(oldNode); 16925var newNode = rewriter.Visit(oldNode); 16935var newNode = rewriter.Visit(oldNode); 16951var newNode = rewriter.Visit(oldNode); 16961var newNode = rewriter.Visit(oldNode); 16977var newNode = rewriter.Visit(oldNode); 16987var newNode = rewriter.Visit(oldNode); 17003var newNode = rewriter.Visit(oldNode); 17013var newNode = rewriter.Visit(oldNode); 17029var newNode = rewriter.Visit(oldNode); 17039var newNode = rewriter.Visit(oldNode); 17055var newNode = rewriter.Visit(oldNode); 17065var newNode = rewriter.Visit(oldNode); 17081var newNode = rewriter.Visit(oldNode); 17091var newNode = rewriter.Visit(oldNode); 17107var newNode = rewriter.Visit(oldNode); 17117var newNode = rewriter.Visit(oldNode); 17133var newNode = rewriter.Visit(oldNode); 17143var newNode = rewriter.Visit(oldNode); 17159var newNode = rewriter.Visit(oldNode); 17169var newNode = rewriter.Visit(oldNode); 17185var newNode = rewriter.Visit(oldNode); 17195var newNode = rewriter.Visit(oldNode); 17211var newNode = rewriter.Visit(oldNode); 17221var newNode = rewriter.Visit(oldNode); 17237var newNode = rewriter.Visit(oldNode); 17247var newNode = rewriter.Visit(oldNode); 17263var newNode = rewriter.Visit(oldNode); 17273var newNode = rewriter.Visit(oldNode); 17289var newNode = rewriter.Visit(oldNode); 17299var newNode = rewriter.Visit(oldNode); 17315var newNode = rewriter.Visit(oldNode); 17325var newNode = rewriter.Visit(oldNode); 17341var newNode = rewriter.Visit(oldNode); 17351var newNode = rewriter.Visit(oldNode); 17367var newNode = rewriter.Visit(oldNode); 17377var newNode = rewriter.Visit(oldNode); 17393var newNode = rewriter.Visit(oldNode); 17403var newNode = rewriter.Visit(oldNode); 17419var newNode = rewriter.Visit(oldNode); 17429var newNode = rewriter.Visit(oldNode); 17445var newNode = rewriter.Visit(oldNode); 17455var newNode = rewriter.Visit(oldNode); 17471var newNode = rewriter.Visit(oldNode); 17481var newNode = rewriter.Visit(oldNode); 17497var newNode = rewriter.Visit(oldNode); 17507var newNode = rewriter.Visit(oldNode); 17523var newNode = rewriter.Visit(oldNode); 17533var newNode = rewriter.Visit(oldNode); 17549var newNode = rewriter.Visit(oldNode); 17559var newNode = rewriter.Visit(oldNode); 17575var newNode = rewriter.Visit(oldNode); 17585var newNode = rewriter.Visit(oldNode); 17601var newNode = rewriter.Visit(oldNode); 17611var newNode = rewriter.Visit(oldNode); 17627var newNode = rewriter.Visit(oldNode); 17637var newNode = rewriter.Visit(oldNode); 17653var newNode = rewriter.Visit(oldNode); 17663var newNode = rewriter.Visit(oldNode); 17679var newNode = rewriter.Visit(oldNode); 17689var newNode = rewriter.Visit(oldNode); 17705var newNode = rewriter.Visit(oldNode); 17715var newNode = rewriter.Visit(oldNode); 17731var newNode = rewriter.Visit(oldNode); 17741var newNode = rewriter.Visit(oldNode); 17757var newNode = rewriter.Visit(oldNode); 17767var newNode = rewriter.Visit(oldNode); 17783var newNode = rewriter.Visit(oldNode); 17793var newNode = rewriter.Visit(oldNode); 17809var newNode = rewriter.Visit(oldNode); 17819var newNode = rewriter.Visit(oldNode); 17835var newNode = rewriter.Visit(oldNode); 17845var newNode = rewriter.Visit(oldNode); 17861var newNode = rewriter.Visit(oldNode); 17871var newNode = rewriter.Visit(oldNode); 17887var newNode = rewriter.Visit(oldNode); 17897var newNode = rewriter.Visit(oldNode); 17913var newNode = rewriter.Visit(oldNode); 17923var newNode = rewriter.Visit(oldNode); 17939var newNode = rewriter.Visit(oldNode); 17949var newNode = rewriter.Visit(oldNode); 17965var newNode = rewriter.Visit(oldNode); 17975var newNode = rewriter.Visit(oldNode); 17991var newNode = rewriter.Visit(oldNode); 18001var newNode = rewriter.Visit(oldNode); 18017var newNode = rewriter.Visit(oldNode); 18027var newNode = rewriter.Visit(oldNode); 18043var newNode = rewriter.Visit(oldNode); 18053var newNode = rewriter.Visit(oldNode); 18069var newNode = rewriter.Visit(oldNode); 18079var newNode = rewriter.Visit(oldNode); 18095var newNode = rewriter.Visit(oldNode); 18105var newNode = rewriter.Visit(oldNode); 18121var newNode = rewriter.Visit(oldNode); 18131var newNode = rewriter.Visit(oldNode); 18147var newNode = rewriter.Visit(oldNode); 18157var newNode = rewriter.Visit(oldNode); 18173var newNode = rewriter.Visit(oldNode); 18183var newNode = rewriter.Visit(oldNode); 18199var newNode = rewriter.Visit(oldNode); 18209var newNode = rewriter.Visit(oldNode); 18225var newNode = rewriter.Visit(oldNode); 18235var newNode = rewriter.Visit(oldNode); 18251var newNode = rewriter.Visit(oldNode); 18261var newNode = rewriter.Visit(oldNode); 18277var newNode = rewriter.Visit(oldNode); 18287var newNode = rewriter.Visit(oldNode); 18303var newNode = rewriter.Visit(oldNode); 18313var newNode = rewriter.Visit(oldNode); 18329var newNode = rewriter.Visit(oldNode); 18339var newNode = rewriter.Visit(oldNode); 18355var newNode = rewriter.Visit(oldNode); 18365var newNode = rewriter.Visit(oldNode); 18381var newNode = rewriter.Visit(oldNode); 18391var newNode = rewriter.Visit(oldNode); 18407var newNode = rewriter.Visit(oldNode); 18417var newNode = rewriter.Visit(oldNode); 18433var newNode = rewriter.Visit(oldNode); 18443var newNode = rewriter.Visit(oldNode); 18459var newNode = rewriter.Visit(oldNode); 18469var newNode = rewriter.Visit(oldNode); 18485var newNode = rewriter.Visit(oldNode); 18495var newNode = rewriter.Visit(oldNode); 18511var newNode = rewriter.Visit(oldNode); 18521var newNode = rewriter.Visit(oldNode); 18537var newNode = rewriter.Visit(oldNode); 18547var newNode = rewriter.Visit(oldNode); 18563var newNode = rewriter.Visit(oldNode); 18573var newNode = rewriter.Visit(oldNode); 18589var newNode = rewriter.Visit(oldNode); 18599var newNode = rewriter.Visit(oldNode); 18615var newNode = rewriter.Visit(oldNode); 18625var newNode = rewriter.Visit(oldNode); 18641var newNode = rewriter.Visit(oldNode); 18651var newNode = rewriter.Visit(oldNode); 18667var newNode = rewriter.Visit(oldNode); 18677var newNode = rewriter.Visit(oldNode); 18693var newNode = rewriter.Visit(oldNode); 18703var newNode = rewriter.Visit(oldNode); 18719var newNode = rewriter.Visit(oldNode); 18729var newNode = rewriter.Visit(oldNode); 18745var newNode = rewriter.Visit(oldNode); 18755var newNode = rewriter.Visit(oldNode); 18771var newNode = rewriter.Visit(oldNode); 18781var newNode = rewriter.Visit(oldNode); 18797var newNode = rewriter.Visit(oldNode); 18807var newNode = rewriter.Visit(oldNode); 18823var newNode = rewriter.Visit(oldNode); 18833var newNode = rewriter.Visit(oldNode); 18849var newNode = rewriter.Visit(oldNode); 18859var newNode = rewriter.Visit(oldNode); 18875var newNode = rewriter.Visit(oldNode); 18885var newNode = rewriter.Visit(oldNode); 18901var newNode = rewriter.Visit(oldNode); 18911var newNode = rewriter.Visit(oldNode); 18927var newNode = rewriter.Visit(oldNode); 18937var newNode = rewriter.Visit(oldNode); 18953var newNode = rewriter.Visit(oldNode); 18963var newNode = rewriter.Visit(oldNode); 18979var newNode = rewriter.Visit(oldNode); 18989var newNode = rewriter.Visit(oldNode); 19005var newNode = rewriter.Visit(oldNode); 19015var newNode = rewriter.Visit(oldNode); 19031var newNode = rewriter.Visit(oldNode); 19041var newNode = rewriter.Visit(oldNode); 19057var newNode = rewriter.Visit(oldNode); 19067var newNode = rewriter.Visit(oldNode); 19083var newNode = rewriter.Visit(oldNode); 19093var newNode = rewriter.Visit(oldNode); 19109var newNode = rewriter.Visit(oldNode); 19119var newNode = rewriter.Visit(oldNode); 19135var newNode = rewriter.Visit(oldNode); 19145var newNode = rewriter.Visit(oldNode); 19161var newNode = rewriter.Visit(oldNode); 19171var newNode = rewriter.Visit(oldNode); 19187var newNode = rewriter.Visit(oldNode); 19197var newNode = rewriter.Visit(oldNode); 19213var newNode = rewriter.Visit(oldNode); 19223var newNode = rewriter.Visit(oldNode); 19239var newNode = rewriter.Visit(oldNode); 19249var newNode = rewriter.Visit(oldNode); 19265var newNode = rewriter.Visit(oldNode); 19275var newNode = rewriter.Visit(oldNode); 19291var newNode = rewriter.Visit(oldNode); 19301var newNode = rewriter.Visit(oldNode); 19317var newNode = rewriter.Visit(oldNode); 19327var newNode = rewriter.Visit(oldNode); 19343var newNode = rewriter.Visit(oldNode); 19353var newNode = rewriter.Visit(oldNode); 19369var newNode = rewriter.Visit(oldNode); 19379var newNode = rewriter.Visit(oldNode); 19395var newNode = rewriter.Visit(oldNode); 19405var newNode = rewriter.Visit(oldNode); 19421var newNode = rewriter.Visit(oldNode); 19431var newNode = rewriter.Visit(oldNode); 19447var newNode = rewriter.Visit(oldNode); 19457var newNode = rewriter.Visit(oldNode); 19473var newNode = rewriter.Visit(oldNode); 19483var newNode = rewriter.Visit(oldNode); 19499var newNode = rewriter.Visit(oldNode); 19509var newNode = rewriter.Visit(oldNode); 19525var newNode = rewriter.Visit(oldNode); 19535var newNode = rewriter.Visit(oldNode); 19551var newNode = rewriter.Visit(oldNode); 19561var newNode = rewriter.Visit(oldNode); 19577var newNode = rewriter.Visit(oldNode); 19587var newNode = rewriter.Visit(oldNode); 19603var newNode = rewriter.Visit(oldNode); 19613var newNode = rewriter.Visit(oldNode); 19629var newNode = rewriter.Visit(oldNode); 19639var newNode = rewriter.Visit(oldNode); 19655var newNode = rewriter.Visit(oldNode); 19665var newNode = rewriter.Visit(oldNode); 19681var newNode = rewriter.Visit(oldNode); 19691var newNode = rewriter.Visit(oldNode); 19707var newNode = rewriter.Visit(oldNode); 19717var newNode = rewriter.Visit(oldNode); 19733var newNode = rewriter.Visit(oldNode); 19743var newNode = rewriter.Visit(oldNode); 19759var newNode = rewriter.Visit(oldNode); 19769var newNode = rewriter.Visit(oldNode); 19785var newNode = rewriter.Visit(oldNode); 19795var newNode = rewriter.Visit(oldNode); 19811var newNode = rewriter.Visit(oldNode); 19821var newNode = rewriter.Visit(oldNode); 19837var newNode = rewriter.Visit(oldNode); 19847var newNode = rewriter.Visit(oldNode); 19863var newNode = rewriter.Visit(oldNode); 19873var newNode = rewriter.Visit(oldNode); 19889var newNode = rewriter.Visit(oldNode); 19899var newNode = rewriter.Visit(oldNode); 19915var newNode = rewriter.Visit(oldNode); 19925var newNode = rewriter.Visit(oldNode); 19941var newNode = rewriter.Visit(oldNode); 19951var newNode = rewriter.Visit(oldNode); 19967var newNode = rewriter.Visit(oldNode); 19977var newNode = rewriter.Visit(oldNode); 19993var newNode = rewriter.Visit(oldNode); 20003var newNode = rewriter.Visit(oldNode); 20019var newNode = rewriter.Visit(oldNode); 20029var newNode = rewriter.Visit(oldNode); 20045var newNode = rewriter.Visit(oldNode); 20055var newNode = rewriter.Visit(oldNode); 20071var newNode = rewriter.Visit(oldNode); 20081var newNode = rewriter.Visit(oldNode); 20097var newNode = rewriter.Visit(oldNode); 20107var newNode = rewriter.Visit(oldNode); 20123var newNode = rewriter.Visit(oldNode); 20133var newNode = rewriter.Visit(oldNode); 20149var newNode = rewriter.Visit(oldNode); 20159var newNode = rewriter.Visit(oldNode); 20175var newNode = rewriter.Visit(oldNode); 20185var newNode = rewriter.Visit(oldNode); 20201var newNode = rewriter.Visit(oldNode); 20211var newNode = rewriter.Visit(oldNode); 20227var newNode = rewriter.Visit(oldNode); 20237var newNode = rewriter.Visit(oldNode); 20253var newNode = rewriter.Visit(oldNode); 20263var newNode = rewriter.Visit(oldNode); 20279var newNode = rewriter.Visit(oldNode); 20289var newNode = rewriter.Visit(oldNode); 20305var newNode = rewriter.Visit(oldNode); 20315var newNode = rewriter.Visit(oldNode); 20331var newNode = rewriter.Visit(oldNode); 20341var newNode = rewriter.Visit(oldNode); 20357var newNode = rewriter.Visit(oldNode); 20367var newNode = rewriter.Visit(oldNode); 20383var newNode = rewriter.Visit(oldNode); 20393var newNode = rewriter.Visit(oldNode); 20409var newNode = rewriter.Visit(oldNode); 20419var newNode = rewriter.Visit(oldNode); 20435var newNode = rewriter.Visit(oldNode);
IncrementalParsing\IncrementalParsingTests.cs (6)
565var localFunc1 = tree.GetRoot().DescendantNodesAndSelf().Single(n => n is LocalFunctionStatementSyntax); 566var innerConditionalExpr1 = localFunc1.DescendantNodesAndSelf().Single(n => n is ConditionalExpressionSyntax); 582var localFunc2 = tree.GetRoot().DescendantNodesAndSelf().Single(n => n is LocalFunctionStatementSyntax); 583var innerConditionalExpr2 = localFunc2.DescendantNodesAndSelf().Single(n => n is ConditionalExpressionSyntax); 3054var tempRoot = tempTree.GetRoot(); 3056var oldRoot = tempRoot.ReplaceToken(tempToken, tempToken.WithAdditionalAnnotations(new SyntaxAnnotation()));
LexicalAndXml\PreprocessorTests.cs (1)
2382var classDeclaration = node.ChildNodes().Single(n => n is ClassDeclarationSyntax);
ParentChecker.cs (4)
32var parentTrivia = trivia.GetStructure().Parent; 45var parentTrivia = trivia.GetStructure().Parent; 53var node = nodeOrToken.AsNode(); 56var parent = child.Parent;
Parsing\ExpressionParsingTests.cs (1)
3135var root = SyntaxFactory.ParseSyntaxTree(text).GetRoot();
Parsing\ParsingErrorRecoveryTests.cs (6)
7380var foreachNode = srcTree.GetLastToken().Parent; 7933var root = SyntaxFactory.ParseSyntaxTree(source).GetRoot(); 7954var root = SyntaxFactory.ParseSyntaxTree(source).GetRoot(); 7975var root = SyntaxFactory.ParseSyntaxTree(source).GetRoot(); 7998var root = SyntaxFactory.ParseSyntaxTree(source).GetRoot(); 8022var root = SyntaxFactory.ParseSyntaxTree(source).GetRoot();
Parsing\ScriptParsingTests.cs (1)
9663var statement = root.ChildNodes().Single();
Parsing\StatementParsingTests.cs (3)
3411var root = tree.GetRoot(); 3438var root = tree.GetRoot(); 3461var root = tree.GetRoot();
Parsing\SyntaxExtensions.cs (5)
17public static SyntaxTriviaList GetLeadingTrivia(this SyntaxNode node) 22public static SyntaxTriviaList GetTrailingTrivia(this SyntaxNode node) 27internal static ImmutableArray<DiagnosticInfo> Errors(this SyntaxNode node) 32internal static ImmutableArray<DiagnosticInfo> Warnings(this SyntaxNode node) 37internal static ImmutableArray<DiagnosticInfo> ErrorsAndWarnings(this SyntaxNode node)
Syntax\LambdaUtilitiesTests.cs (2)
48var enclosingSyntax = enclosingMethod.DeclaringSyntaxReferences.Single().GetSyntax(); 51var node = tree.GetRoot().FindNode(span.Value);
Syntax\Mocks\MockCSharpSyntaxTree.cs (2)
58public override SyntaxTree WithRootAndOptions(SyntaxNode root, ParseOptions options) 67public override SyntaxReference GetReference(SyntaxNode node)
Syntax\RedNodeTests.cs (2)
25public override SyntaxNode DefaultVisit(SyntaxNode node)
Syntax\SeparatedSyntaxListTests.cs (18)
95: SyntaxFactory.SeparatedList<SyntaxNode>( 115SyntaxNode nodeD = SyntaxFactory.ParseExpression("D"); 116SyntaxNode nodeE = SyntaxFactory.ParseExpression("E"); 206newList = list.ReplaceRange(elementA, new SyntaxNode[] { }); 210newList = list.ReplaceRange(elementB, new SyntaxNode[] { }); 214newList = list.ReplaceRange(elementC, new SyntaxNode[] { }); 227Assert.Throws<ArgumentNullException>(() => list.AddRange((IEnumerable<SyntaxNode>)null)); 228Assert.Throws<ArgumentNullException>(() => list.InsertRange(0, (IEnumerable<SyntaxNode>)null)); 229Assert.Throws<ArgumentNullException>(() => list.ReplaceRange(elementA, (IEnumerable<SyntaxNode>)null)); 235DoTestAddInsertRemoveOnEmptyList(SyntaxFactory.SeparatedList<SyntaxNode>()); 237DoTestAddInsertRemoveOnEmptyList(default(SeparatedSyntaxList<SyntaxNode>)); 240private void DoTestAddInsertRemoveOnEmptyList(SeparatedSyntaxList<SyntaxNode> list) 244SyntaxNode nodeD = SyntaxFactory.ParseExpression("D"); 245SyntaxNode nodeE = SyntaxFactory.ParseExpression("E"); 273Assert.Throws<ArgumentNullException>(() => list.AddRange((IEnumerable<SyntaxNode>)null)); 275Assert.Throws<ArgumentNullException>(() => list.InsertRange(0, (IEnumerable<SyntaxNode>)null)); 281var list = SyntaxFactory.SeparatedList<SyntaxNode>( 305: SyntaxFactory.SeparatedList<SyntaxNode>(
Syntax\StructuredTriviaTests.cs (1)
85var foundDocComment = result.Parent.Parent.Parent.Parent;
Syntax\SyntaxAnnotationTests.cs (41)
54var toNode = (SyntaxNode)null; 55var annotatedNode = fromNode.CopyAnnotationsTo(toNode); 161var node = GetAllNodesAndTokens(tree.GetCompilationUnitRoot()).First(t => t.IsNode).AsNode(); 164var annotatedNode = node.WithAdditionalAnnotations(annotation1); 171var node2 = newRoot.GetAnnotatedNodesAndTokens(annotation1).Single().AsNode(); 174var twiceAnnotatedNode = node2.WithAdditionalAnnotations(annotation2); 253SyntaxNode newRoot = tree.GetCompilationUnitRoot(); 284var firstNode = GetAllNodesAndTokens(tree.GetCompilationUnitRoot()).First(t => t.IsNode).AsNode(); 287var lastChildOfFirstNode = children.Last(t => t.IsNode).AsNode(); 288var annotatedNode = lastChildOfFirstNode.WithAdditionalAnnotations(annotation1); 295var firstNodeInNewTree = GetAllNodesAndTokens(newRoot).First(t => t.IsNode).AsNode(); 299var rightNode = firstNodeInNewTree.ChildNodesAndTokens().Last(t => t.IsNode).AsNode(); 346private void TestMultipleAnnotationsInTree(SyntaxNode oldRoot, SyntaxNode newRoot, List<SyntaxAnnotation> annotations) 389var sourceTreeRoot = rewriter.Visit(tree1.GetCompilationUnitRoot()); 391var destTreeRoot = CopyAnnotationsTo(sourceTreeRoot, tree2.GetCompilationUnitRoot()); 427private SyntaxNode CopyAnnotationsTo(SyntaxNode sourceTreeRoot, SyntaxNode destTreeRoot) 440var oldNode = destTreeNodeOrTokenEnumerator.Current.AsNode(); 441var newNode = sourceTreeNodeOrTokenEnumerator.Current.AsNode().CopyAnnotationsTo(oldNode); 535public TRoot Replace<TRoot>(TRoot root, SyntaxNodeOrToken oldNodeOrToken, SyntaxNodeOrToken newNodeOrToken) where TRoot : SyntaxNode 550private void TestAnnotations(List<Tuple<SyntaxAnnotation, SyntaxNodeOrToken>> annotations, SyntaxNode currentRoot) 584SyntaxNode newRoot; 594var newNode = nodeOrToken.AsNode().WithAdditionalAnnotations(annotation); 602private void TestAnnotation(SyntaxAnnotation annotation, SyntaxNode root, SyntaxNodeOrToken oldNodeOrToken) 614private void TestAnnotation(SyntaxAnnotation annotation, SyntaxNode root, SyntaxNode oldNode) 620var annotatedNode = results.Single().AsNode(); 628private void TestAnnotation(SyntaxAnnotation annotation, SyntaxNode root, SyntaxToken oldToken) 642private void TestAnnotation(SyntaxAnnotation annotation, SyntaxNode root, SyntaxTrivia oldTrivia) 656private List<SyntaxTrivia> GetAllTrivia(SyntaxNode root) 664private List<SyntaxNodeOrToken> GetAllNodesAndTokens(SyntaxNode root) 681public override void Visit(SyntaxNode node) 722public override SyntaxNode Visit(SyntaxNode node) 770public override SyntaxNode Visit(SyntaxNode node) 822public override SyntaxNode Visit(SyntaxNode node)
Syntax\SyntaxDiffingTests.cs (6)
284var root = oldTree.GetRoot(); 303private void TestQualifyWithThisCore(SyntaxNode root, int index) 319var newRoot = root.ReplaceNode(node, newNode); 344var root = oldTree.GetRoot(); 368private void TestReplaceWithBuiltInTypeCore(SyntaxNode root, int index) 381var newRoot = root.ReplaceNode(node, newNode);
Syntax\SyntaxEquivalenceTests.cs (2)
34private void VerifyEquivalent(SyntaxNode node1, SyntaxNode node2, Func<SyntaxKind, bool> ignoreChildNode)
Syntax\SyntaxListTests.cs (17)
51: SyntaxFactory.List<SyntaxNode>( 71SyntaxNode nodeD = SyntaxFactory.ParseExpression("D "); 72SyntaxNode nodeE = SyntaxFactory.ParseExpression("E "); 158newList = list.ReplaceRange(elementA, new SyntaxNode[] { }); 162newList = list.ReplaceRange(elementB, new SyntaxNode[] { }); 166newList = list.ReplaceRange(elementC, new SyntaxNode[] { }); 179Assert.Throws<ArgumentNullException>(() => list.AddRange((IEnumerable<SyntaxNode>)null)); 180Assert.Throws<ArgumentNullException>(() => list.InsertRange(0, (IEnumerable<SyntaxNode>)null)); 181Assert.Throws<ArgumentNullException>(() => list.ReplaceRange(elementA, (IEnumerable<SyntaxNode>)null)); 187DoTestAddInsertRemoveReplaceOnEmptyList(SyntaxFactory.List<SyntaxNode>()); 189DoTestAddInsertRemoveReplaceOnEmptyList(default(SyntaxList<SyntaxNode>)); 192private void DoTestAddInsertRemoveReplaceOnEmptyList(SyntaxList<SyntaxNode> list) 196SyntaxNode nodeD = SyntaxFactory.ParseExpression("D "); 197SyntaxNode nodeE = SyntaxFactory.ParseExpression("E "); 227Assert.Throws<ArgumentNullException>(() => list.AddRange((IEnumerable<SyntaxNode>)null)); 229Assert.Throws<ArgumentNullException>(() => list.InsertRange(0, (IEnumerable<SyntaxNode>)null)); 268var list = SyntaxFactory.List<SyntaxNode>(
Syntax\SyntaxNodeTests.cs (23)
712private void CheckFindToken(SyntaxNode node) 728var root = tree.GetRoot(); 735var identifier = root.DescendantNodes(descendIntoTrivia: true).Single(n => n is IdentifierNameSyntax); 1383var structure = trivia.GetStructure(); 1391var tokenStructuredTrivia = tokenTrivia.GetStructure(); 1808var namespaceNode = rootNode.ChildNodesAndTokens()[1].AsNode(); 1962var str0 = tt0.GetStructure(); 1963var str1 = tt1.GetStructure(); 1999var str0 = tt0.GetStructure(); 2000var str1 = tt1.GetStructure(); 2130var newNode = invocation.ReplaceNode(invocation.ArgumentList.Arguments[0], new SyntaxNode[] { argC, argD }); 2134newNode = invocation.ReplaceNode(invocation.ArgumentList.Arguments[1], new SyntaxNode[] { argC, argD }); 2138newNode = invocation.ReplaceNode(invocation.ArgumentList.Arguments[0], new SyntaxNode[] { }); 2142newNode = invocation.ReplaceNode(invocation.ArgumentList.Arguments[1], new SyntaxNode[] { }); 2170var newNode = invocation.InsertNodesBefore(invocation.ArgumentList.Arguments[0], new SyntaxNode[] { argC, argD }); 2174newNode = invocation.InsertNodesAfter(invocation.ArgumentList.Arguments[0], new SyntaxNode[] { argC, argD }); 2178newNode = invocation.InsertNodesBefore(invocation.ArgumentList.Arguments[1], new SyntaxNode[] { argC, argD }); 2182newNode = invocation.InsertNodesAfter(invocation.ArgumentList.Arguments[1], new SyntaxNode[] { argC, argD }); 2218newBlock = block.ReplaceNode(block.Statements[0], new SyntaxNode[] { }); 2222newBlock = block.ReplaceNode(block.Statements[1], new SyntaxNode[] { }); 3522var node = (SyntaxNode)children.First(n => n.IsNode); 3738SyntaxNode namedNode = SyntaxFactory.IdentifierName("goo");
Syntax\SyntaxRewriterTests.cs (37)
349var typeName = tree.GetCompilationUnitRoot().DescendantNodes().Where(n => n.IsKind(SyntaxKind.GenericName)).Single(); 362var root = tree.GetRoot(); 366var newRoot = root.ReplaceNode(before, after); 381var root = tree.GetRoot(); 383var newRoot = root.ReplaceNode(invocation.ArgumentList.Arguments[0], new SyntaxNode[] { argC, argD }); 400var root = tree.GetRoot(); 404var newNode = invocation.InsertNodesBefore(invocation.ArgumentList.Arguments[0], new SyntaxNode[] { argC, argD }); 411var newNode2 = invocation.InsertNodesAfter(invocation.ArgumentList.Arguments[0], new SyntaxNode[] { argC, argD }); 425var root = tree.GetRoot(); 430var newRoot = root.ReplaceToken(privateToken, new[] { publicToken, partialToken }); 443var root = tree.GetRoot(); 448var newRoot = root.InsertTokensBefore(publicToken, new[] { staticToken }); 454var newRoot2 = root.InsertTokensAfter(publicToken, new[] { staticToken }); 466var root = tree.GetRoot(); 475var newRoot = root.ReplaceTrivia(comment1, new[] { newComment1, newComment2 }); 481var newRoot2 = root.ReplaceTrivia(comment1, new SyntaxTrivia[] { }); 493var root = tree.GetRoot(); 502var newRoot = root.InsertTriviaAfter(comment1, new[] { newComment1, newComment2 }); 515var root = tree.GetRoot(); 516var newRoot = root.RemoveNode(root.DescendantNodes().First(), SyntaxRemoveOptions.KeepDirectives); 528var root = tree.GetRoot(); 529var newRoot = root.NormalizeWhitespace(" "); 542var rewrittenRoot = rewriter.Visit(tree.GetCompilationUnitRoot()); 650var oldRoot = oldTree.GetRoot(); 652var newRoot = oldRoot.RemoveNode(xmlNode, SyntaxRemoveOptions.KeepDirectives); 671var newRoot = new RemoveRegionRewriter().Visit(root); 683public override SyntaxNode VisitRegionDirectiveTrivia(RegionDirectiveTriviaSyntax node) 712var result = rewriter.Visit(red); 756private readonly Func<SyntaxNode, SyntaxNode> _rewriteNode; 761Func<SyntaxNode, SyntaxNode> rewriteNode = null, 770public override SyntaxNode Visit(SyntaxNode node) 772var visited = base.Visit(node); 791public override SyntaxNode VisitClassDeclaration(ClassDeclarationSyntax node)
Syntax\SyntaxTreeTests.cs (1)
88SyntaxTreeFactoryKind.SynthesizedSyntaxTree => SyntaxNode.CloneNodeAsRoot(root, syntaxTree: null).SyntaxTree,
Microsoft.CodeAnalysis.CSharp.Test.Utilities (67)
CompilationTestUtils.cs (8)
226public static SemanticInfoSummary GetSemanticInfoSummary(this SemanticModel semanticModel, SyntaxNode node) 299public static SemanticInfoSummary GetSpeculativeSemanticInfoSummary(this SemanticModel semanticModel, int position, SyntaxNode node, SpeculativeBindingOption bindingOption) 353internal static TypeInfo GetTypeInfoAndVerifyIOperation(this SemanticModel model, SyntaxNode expression) 369static bool isValidDeclaration(SyntaxNode expression) 392static IOperation getOperation(SemanticModel model, SyntaxNode expression) 456var root = tree.GetRoot(); 516var node = token.Parent; 533ExpressionSyntax asExpression(SyntaxNode node)
CSharpTestBase.cs (44)
1107var parsedText = tree.GetRoot(); 1560protected static List<SyntaxNode> GetSyntaxNodeList(SyntaxTree syntaxTree) 1565protected static List<SyntaxNode> GetSyntaxNodeList(SyntaxNode node, List<SyntaxNode> synList) 1568synList = new List<SyntaxNode>(); 1581protected static SyntaxNode GetSyntaxNodeForBinding(List<SyntaxNode> synList) 1583return GetSyntaxNodeOfTypeForBinding<SyntaxNode>(synList); 1589protected static TNode GetSyntaxNodeOfTypeForBinding<TNode>(List<SyntaxNode> synList) where TNode : SyntaxNode 1648public Tuple<TNode, SemanticModel> GetBindingNodeAndModel<TNode>(CSharpCompilation compilation, int treeIndex = 0) where TNode : SyntaxNode 1654public Tuple<TNode, SemanticModel> GetBindingNodeAndModel<TNode>(Compilation compilation, int treeIndex = 0) where TNode : SyntaxNode 1659public Tuple<IList<TNode>, SemanticModel> GetBindingNodesAndModel<TNode>(CSharpCompilation compilation, int treeIndex = 0, int which = -1) where TNode : SyntaxNode 1668public TNode GetBindingNode<TNode>(CSharpCompilation compilation, int treeIndex = 0) where TNode : SyntaxNode 1689public IList<TNode> GetBindingNodes<TNode>(CSharpCompilation compilation, int treeIndex = 0, int which = -1) where TNode : SyntaxNode 1730public IList<TNode> GetBindingNodes<TNode>(Compilation compilation, int treeIndex = 0, int which = -1) where TNode : SyntaxNode 1735private static TNode FindBindingNode<TNode>(SyntaxTree tree, string startTag, string endTag) where TNode : SyntaxNode 1754var node = tree.GetRoot().FindToken(start).Parent; 2023protected static (IOperation operation, SyntaxNode node) GetOperationAndSyntaxForTest<TSyntaxNode>(CSharpCompilation compilation) 2024where TSyntaxNode : SyntaxNode 2028SyntaxNode syntaxNode = GetSyntaxNodeOfTypeForBinding<TSyntaxNode>(GetSyntaxNodeList(tree)); 2043where TSyntaxNode : SyntaxNode 2059where TSyntaxNode : SyntaxNode 2066protected static IOperation VerifyOperationTreeForTest<TSyntaxNode>(CSharpCompilation compilation, string expectedOperationTree, Action<IOperation, Compilation, SyntaxNode> additionalOperationTreeVerifier = null) 2067where TSyntaxNode : SyntaxNode 2077protected static void VerifyOperationTreeForNode(CSharpCompilation compilation, SemanticModel model, SyntaxNode syntaxNode, string expectedOperationTree) 2090where TSyntaxNode : SyntaxNode 2093SyntaxNode syntaxNode = GetSyntaxNodeOfTypeForBinding<TSyntaxNode>(GetSyntaxNodeList(tree)); 2098protected static void VerifyFlowGraph(CSharpCompilation compilation, SyntaxNode syntaxNode, string expectedFlowGraph) 2111where TSyntaxNode : SyntaxNode 2121Action<IOperation, Compilation, SyntaxNode> additionalOperationTreeVerifier = null) 2122where TSyntaxNode : SyntaxNode 2133where TSyntaxNode : SyntaxNode 2147Action<IOperation, Compilation, SyntaxNode> additionalOperationTreeVerifier = null, 2149where TSyntaxNode : SyntaxNode => 2168Action<IOperation, Compilation, SyntaxNode> additionalOperationTreeVerifier = null) 2169where TSyntaxNode : SyntaxNode 2186Action<IOperation, Compilation, SyntaxNode> additionalOperationTreeVerifier = null, 2188where TSyntaxNode : SyntaxNode 2206where TSyntaxNode : SyntaxNode 2226where TSyntaxNode : SyntaxNode 2244Action<IOperation, Compilation, SyntaxNode> additionalOperationTreeVerifier = null, 2246where TSyntaxNode : SyntaxNode
Extensions.cs (3)
37public static TypeDeclarationSyntax AsTypeDeclarationSyntax(this SyntaxNode node) 42public static MethodDeclarationSyntax AsMethodDeclarationSyntax(this SyntaxNode node) 640internal static Symbol GetDeclaredSymbolFromSyntaxNode(this CSharpSemanticModel model, Microsoft.CodeAnalysis.SyntaxNode declaration, CancellationToken cancellationToken = default(CancellationToken))
FunctionPointerUtilities.cs (1)
137SyntaxNode syntax,
LocalVariableDeclaratorsCollector.cs (5)
16private readonly ArrayBuilder<SyntaxNode> _builder; 18private LocalVariableDeclaratorsCollector(ArrayBuilder<SyntaxNode> builder) 23internal static ImmutableArray<SyntaxNode> GetDeclarators(SourceMemberMethodSymbol method) 25var builder = ArrayBuilder<SyntaxNode>.GetInstance(); 28visitor.Visit(bodies.Item1 ?? (SyntaxNode)bodies.Item2);
SemanticModelTestBase.cs (6)
38private List<ExpressionSyntax> GetExprSyntaxList(SyntaxNode node, List<ExpressionSyntax> exprSynList) 106private static ConstructorInitializerSyntax GetFirstConstructorInitializer(SyntaxNode node) 108Func<SyntaxNode, bool> isConstructorInitializer = n => 114protected CompilationUtils.SemanticInfoSummary GetSemanticInfoForTest<TNode>(string testSrc, CSharpParseOptions parseOptions = null) where TNode : SyntaxNode 120internal CompilationUtils.SemanticInfoSummary GetSemanticInfoForTestExperimental<TNode>(string testSrc, MessageID feature, CSharpParseOptions parseOptions = null) where TNode : SyntaxNode 126protected CompilationUtils.SemanticInfoSummary GetSemanticInfoForTest<TNode>(CSharpCompilation compilation) where TNode : SyntaxNode
Microsoft.CodeAnalysis.CSharp.WinRT.UnitTests (1)
CodeGen\WinRTCollectionTests.cs (1)
7424var add = tree.GetRoot().DescendantNodes().Where(n => n.IsKind(SyntaxKind.IdentifierName) && ((IdentifierNameSyntax)n).Identifier.ValueText == "Add").Single();
Microsoft.CodeAnalysis.CSharp.Workspaces (1752)
CaseCorrection\CSharpCaseCorrectionService.cs (1)
28SyntaxNode root,
Classification\ClassificationHelpers.cs (3)
283private static string? GetClassificationTypeForConstructorOrDestructorParent(SyntaxNode parentNode) 296var parent = identifierSyntax.Parent; 306var parentNode = token.Parent;
Classification\SyntaxClassification\CSharpSyntaxClassificationService.cs (1)
39public override void AddSyntacticClassifications(SyntaxNode root, ImmutableArray<TextSpan> textSpans, SegmentedList<ClassifiedSpan> result, CancellationToken cancellationToken)
Classification\SyntaxClassification\DiscardSyntaxClassifier.cs (1)
21SyntaxNode syntax,
Classification\SyntaxClassification\FunctionPointerUnmanagedCallingConventionClassifier.cs (1)
22SyntaxNode syntax,
Classification\SyntaxClassification\NameSyntaxClassifier.cs (2)
25SyntaxNode syntax, 42protected override bool IsParentAnAttribute(SyntaxNode node)
Classification\SyntaxClassification\OperatorOverloadSyntaxClassifier.cs (2)
27SyntaxNode syntax, 54private static TextSpan GetOperatorTokenSpan(SyntaxNode syntax)
Classification\SyntaxClassification\UsingDirectiveSyntaxClassifier.cs (1)
19SyntaxNode syntax,
Classification\Worker.cs (3)
46SyntaxNode node, TextSpan textSpan, SegmentedList<ClassifiedSpan> result, CancellationToken cancellationToken) 82private void ClassifyNode(SyntaxNode node) 84using var _ = ArrayBuilder<SyntaxNode>.GetInstance(out var stack);
CodeCleanup\CSharpCodeCleanerService.cs (1)
19protected override ImmutableArray<TextSpan> GetSpansToAvoid(SyntaxNode root)
CodeGeneration\CSharpSyntaxGenerator.cs (632)
68internal override SyntaxTrivia Trivia(SyntaxNode node) 78internal override SyntaxNode DocumentationCommentTrivia(IEnumerable<SyntaxNode> nodes, SyntaxTriviaList trailingTrivia, string endOfLineString) 91internal override SyntaxNode? DocumentationCommentTriviaWithUpdatedContent(SyntaxTrivia trivia, IEnumerable<SyntaxNode> content) 104public override SyntaxNode CompilationUnit(IEnumerable<SyntaxNode> declarations) 111private SyntaxList<UsingDirectiveSyntax> AsUsingDirectives(IEnumerable<SyntaxNode> declarations) 118private SyntaxNode? AsUsingDirective(SyntaxNode node) 128private static SyntaxList<MemberDeclarationSyntax> AsNamespaceMembers(IEnumerable<SyntaxNode> declarations) 135private static SyntaxNode? AsNamespaceMember(SyntaxNode declaration) 154public override SyntaxNode NamespaceImportDeclaration(SyntaxNode name) 157public override SyntaxNode AliasImportDeclaration(string aliasIdentifierName, SyntaxNode name) 160public override SyntaxNode NamespaceDeclaration(SyntaxNode name, IEnumerable<SyntaxNode> declarations) 169public override SyntaxNode FieldDeclaration( 171SyntaxNode type, 174SyntaxNode? initializer) 190private protected override SyntaxNode ParameterDeclaration( 191string name, SyntaxNode? type, SyntaxNode? initializer, RefKind refKind, bool isExtension, bool isParams, bool isScoped) 229private protected override SyntaxNode MethodDeclaration( 231IEnumerable<SyntaxNode>? parameters, 232IEnumerable<SyntaxNode>? typeParameters, 233SyntaxNode? returnType, 236IEnumerable<SyntaxNode>? statements) 266public override SyntaxNode OperatorDeclaration(OperatorKind kind, IEnumerable<SyntaxNode>? parameters = null, SyntaxNode? returnType = null, Accessibility accessibility = Accessibility.NotApplicable, DeclarationModifiers modifiers = default, IEnumerable<SyntaxNode>? statements = null) 272private protected override SyntaxNode OperatorDeclaration(string operatorName, bool isImplicitConversion, IEnumerable<SyntaxNode>? parameters = null, SyntaxNode? returnType = null, Accessibility accessibility = Accessibility.NotApplicable, DeclarationModifiers modifiers = default, IEnumerable<SyntaxNode>? statements = null) 349private static ParameterListSyntax AsParameterList(IEnumerable<SyntaxNode>? parameters) 356public override SyntaxNode ConstructorDeclaration( 358IEnumerable<SyntaxNode>? parameters, 361IEnumerable<SyntaxNode>? baseConstructorArguments, 362IEnumerable<SyntaxNode>? statements) 373private protected override SyntaxNode DestructorDeclaration(IMethodSymbol destructorMethod) 376public override SyntaxNode PropertyDeclaration( 378SyntaxNode type, 381IEnumerable<SyntaxNode>? getAccessorStatements, 382IEnumerable<SyntaxNode>? setAccessorStatements) 384SyntaxNode? getAccessor = null; 385SyntaxNode? setAccessor = null; 396private protected override SyntaxNode PropertyDeclaration( 398SyntaxNode type, 399SyntaxNode? getAccessor, 400SyntaxNode? setAccessor, 422public override SyntaxNode GetAccessorDeclaration(Accessibility accessibility, IEnumerable<SyntaxNode>? statements) 425private protected override SyntaxNode SetAccessorDeclaration(Accessibility accessibility, bool isInitOnly, IEnumerable<SyntaxNode>? statements) 428private static SyntaxNode AccessorDeclaration( 429SyntaxKind kind, Accessibility accessibility, IEnumerable<SyntaxNode>? statements) 442public override SyntaxNode WithAccessorDeclarations(SyntaxNode declaration, IEnumerable<SyntaxNode> accessorDeclarations) 456private static AccessorListSyntax CreateAccessorList(AccessorListSyntax? accessorList, IEnumerable<SyntaxNode> accessorDeclarations) 464public override SyntaxNode IndexerDeclaration( 465IEnumerable<SyntaxNode> parameters, 466SyntaxNode type, 469IEnumerable<SyntaxNode>? getAccessorStatements, 470IEnumerable<SyntaxNode>? setAccessorStatements) 511private static BracketedParameterListSyntax AsBracketedParameterList(IEnumerable<SyntaxNode> parameters) 518private static AccessorDeclarationSyntax AccessorDeclaration(SyntaxKind kind, IEnumerable<SyntaxNode>? statements) 532public override SyntaxNode EventDeclaration( 534SyntaxNode type, 546public override SyntaxNode CustomEventDeclaration( 548SyntaxNode type, 551IEnumerable<SyntaxNode>? parameters, 552IEnumerable<SyntaxNode>? addAccessorStatements, 553IEnumerable<SyntaxNode>? removeAccessorStatements) 579public override SyntaxNode? AsPublicInterfaceImplementation(SyntaxNode declaration, SyntaxNode interfaceTypeName, string? interfaceMemberName) 596public override SyntaxNode? AsPrivateInterfaceImplementation(SyntaxNode declaration, SyntaxNode interfaceTypeName, string? interfaceMemberName) 612private SyntaxNode WithoutConstraints(SyntaxNode declaration) 625private static SyntaxNode WithInterfaceSpecifier(SyntaxNode declaration, ExplicitInterfaceSpecifierSyntax? specifier) 637private SyntaxNode AsImplementation(SyntaxNode declaration, Accessibility requiredAccess) 645private static SyntaxNode WithBodies(SyntaxNode declaration) 694private protected override SyntaxNode ClassDeclaration( 697IEnumerable<SyntaxNode>? typeParameters, 700SyntaxNode? baseType, 701IEnumerable<SyntaxNode>? interfaceTypes, 702IEnumerable<SyntaxNode>? members) 726private SyntaxList<MemberDeclarationSyntax> AsClassMembers(string className, IEnumerable<SyntaxNode>? members) 733private MemberDeclarationSyntax? AsClassMember(SyntaxNode node, string className) 750private protected override SyntaxNode StructDeclaration( 753IEnumerable<SyntaxNode>? typeParameters, 756IEnumerable<SyntaxNode>? interfaceTypes, 757IEnumerable<SyntaxNode>? members) 773private protected override SyntaxNode InterfaceDeclaration( 775IEnumerable<SyntaxNode>? typeParameters, 777IEnumerable<SyntaxNode>? interfaceTypes = null, 778IEnumerable<SyntaxNode>? members = null) 796private SyntaxList<MemberDeclarationSyntax> AsInterfaceMembers(IEnumerable<SyntaxNode>? members) 803internal override SyntaxNode AsInterfaceMember(SyntaxNode m) 866var type = GetType(f); 878public override SyntaxNode EnumDeclaration( 882IEnumerable<SyntaxNode>? members) 887internal override SyntaxNode EnumDeclaration(string name, SyntaxNode? underlyingType, Accessibility accessibility = Accessibility.NotApplicable, DeclarationModifiers modifiers = default, IEnumerable<SyntaxNode>? members = null) 897public override SyntaxNode EnumMember(string name, SyntaxNode? expression) 905private EnumMemberDeclarationSyntax AsEnumMember(SyntaxNode node) 927private SeparatedSyntaxList<EnumMemberDeclarationSyntax> AsEnumMembers(IEnumerable<SyntaxNode>? members) 930private protected override SyntaxNode DelegateDeclaration( 932IEnumerable<SyntaxNode>? parameters, 933IEnumerable<SyntaxNode>? typeParameters, 934SyntaxNode? returnType, 948public override SyntaxNode Attribute(SyntaxNode name, IEnumerable<SyntaxNode>? attributeArguments) 951public override SyntaxNode AttributeArgument(string? name, SyntaxNode expression) 958private static AttributeArgumentListSyntax? AsAttributeArgumentList(IEnumerable<SyntaxNode>? arguments) 961private static AttributeArgumentSyntax AsAttributeArgument(SyntaxNode node) 990private static SyntaxList<AttributeListSyntax> AsAttributeLists(IEnumerable<SyntaxNode> attributes) 995private static AttributeListSyntax AsAttributeList(SyntaxNode node) 1000private static readonly ConditionalWeakTable<SyntaxNode, IReadOnlyList<SyntaxNode>> s_declAttributes = new(); 1002public override IReadOnlyList<SyntaxNode> GetAttributes(SyntaxNode declaration) 1013private static readonly ConditionalWeakTable<SyntaxNode, IReadOnlyList<SyntaxNode>> s_declReturnAttributes = new(); 1015public override IReadOnlyList<SyntaxNode> GetReturnAttributes(SyntaxNode declaration) 1029public override SyntaxNode InsertAttributes(SyntaxNode declaration, int index, IEnumerable<SyntaxNode> attributes) 1032private SyntaxNode InsertAttributesInternal(SyntaxNode declaration, int index, IEnumerable<SyntaxNode> attributes) 1053public override SyntaxNode InsertReturnAttributes(SyntaxNode declaration, int index, IEnumerable<SyntaxNode> attributes) 1067private SyntaxNode InsertReturnAttributesInternal(SyntaxNode d, int index, IEnumerable<SyntaxNode> attributes) 1088private static IEnumerable<AttributeListSyntax> AsReturnAttributes(IEnumerable<SyntaxNode> attributes) 1099private static SyntaxList<AttributeListSyntax> WithRequiredTargetSpecifier(SyntaxList<AttributeListSyntax> attributes, SyntaxNode declaration) 1109public override IReadOnlyList<SyntaxNode> GetAttributeArguments(SyntaxNode attributeDeclaration) 1134public override SyntaxNode InsertAttributeArguments(SyntaxNode declaration, int index, IEnumerable<SyntaxNode> attributeArguments) 1137private static SyntaxNode InsertAttributeArgumentsInternal(SyntaxNode declaration, int index, IEnumerable<SyntaxNode> attributeArguments) 1157private static AttributeArgumentListSyntax? GetAttributeArgumentList(SyntaxNode declaration) 1177private static SyntaxNode WithAttributeArgumentList(SyntaxNode declaration, AttributeArgumentListSyntax? argList) 1197internal static SyntaxList<AttributeListSyntax> GetAttributeLists(SyntaxNode declaration) 1208private static SyntaxNode WithAttributeLists(SyntaxNode declaration, SyntaxList<AttributeListSyntax> attributeLists) 1221internal override SyntaxNode? GetPrimaryConstructorParameterList(SyntaxNode declaration) 1224internal override ImmutableArray<SyntaxNode> GetTypeInheritance(SyntaxNode declaration) 1227: ImmutableArray<SyntaxNode>.Empty; 1229public override IReadOnlyList<SyntaxNode> GetNamespaceImports(SyntaxNode declaration) 1237public override SyntaxNode InsertNamespaceImports(SyntaxNode declaration, int index, IEnumerable<SyntaxNode> imports) 1239var result = PreserveTrivia(declaration, d => InsertNamespaceImportsInternal(d, index, imports)); 1244private SyntaxNode InsertNamespaceImportsInternal(SyntaxNode declaration, int index, IEnumerable<SyntaxNode> imports) 1256public override IReadOnlyList<SyntaxNode> GetMembers(SyntaxNode declaration) 1266private static ImmutableArray<SyntaxNode> Flatten(IEnumerable<SyntaxNode> declarations) 1268var builder = ArrayBuilder<SyntaxNode>.GetInstance(); 1270foreach (var declaration in declarations) 1311static void FlattenDeclaration(ArrayBuilder<SyntaxNode> builder, SyntaxNode declaration, VariableDeclarationSyntax variableDeclaration) 1324private static int GetDeclarationCount(SyntaxNode declaration) 1335private static SyntaxNode EnsureTypeDeclarationHasBody(SyntaxNode declaration) 1348public override SyntaxNode InsertMembers(SyntaxNode declaration, int index, IEnumerable<SyntaxNode> members) 1376private IEnumerable<MemberDeclarationSyntax>? AsMembersOf(SyntaxNode declaration, IEnumerable<SyntaxNode>? members) 1379private SyntaxNode? AsMemberOf(SyntaxNode declaration, SyntaxNode member) 1390private static bool CanHaveAccessibility(SyntaxNode declaration) 1398public override Accessibility GetAccessibility(SyntaxNode declaration) 1404public override SyntaxNode WithAccessibility(SyntaxNode declaration, Accessibility accessibility) 1606public override DeclarationModifiers GetModifiers(SyntaxNode declaration) 1613private static SyntaxTokenList GetModifierTokens(SyntaxNode declaration) 1616public override SyntaxNode WithModifiers(SyntaxNode declaration, DeclarationModifiers modifiers) 1619private SyntaxNode WithModifiersInternal(SyntaxNode declaration, DeclarationModifiers modifiers) 1651private static SyntaxNode SetModifierTokens(SyntaxNode declaration, SyntaxTokenList modifiers) 1748private protected override SyntaxNode TypeParameter(string name) 1751private protected override SyntaxNode TypeParameter(ITypeParameterSymbol typeParameter) 1764private static TypeParameterListSyntax? AsTypeParameterList(IEnumerable<SyntaxNode>? typeParameterNodes) 1773private protected override SyntaxNode WithTypeParameters(SyntaxNode declaration, IEnumerable<SyntaxNode> typeParameters) 1786internal override SyntaxNode WithExplicitInterfaceImplementations( 1787SyntaxNode declaration, 1811private static SyntaxNode RemoveDefaultValue(ParameterSyntax parameter, bool removeDefaults) 1829private protected override SyntaxNode WithTypeConstraint( 1830SyntaxNode declaration, string typeParameterName, SpecialTypeConstraintKind kinds, bool isUnmanagedType, IEnumerable<SyntaxNode>? types) 1839private protected override SyntaxNode WithDefaultConstraint(SyntaxNode declaration, string typeParameterName) 1851IEnumerable<SyntaxNode>? types) 1897public override DeclarationKind GetDeclarationKind(SyntaxNode declaration) 1900public override string GetName(SyntaxNode declaration) 1922public override SyntaxNode WithName(SyntaxNode declaration, string name) 1925private SyntaxNode WithNameInternal(SyntaxNode declaration, string name) 1962public override SyntaxNode? GetType(SyntaxNode declaration) 2001public override SyntaxNode WithType(SyntaxNode declaration, SyntaxNode type) 2004private static SyntaxNode WithTypeInternal(SyntaxNode declaration, SyntaxNode type) 2020private SyntaxNode Isolate(SyntaxNode declaration, Func<SyntaxNode, SyntaxNode> editor) 2023private SyntaxNode AsIsolatedDeclaration(SyntaxNode declaration) 2059private static SyntaxNode WithVariable(SyntaxNode declaration, VariableDeclaratorSyntax variable) 2070private static VariableDeclarationSyntax? GetVariableDeclaration(SyntaxNode declaration) 2079private static SyntaxNode WithVariableDeclaration(SyntaxNode declaration, VariableDeclarationSyntax variables) 2088private static SyntaxNode GetFullDeclaration(SyntaxNode declaration) 2119private SyntaxNode? AsNodeLike(SyntaxNode existingNode, SyntaxNode newNode) 2129var container = GetDeclaration(existingNode.Parent); 2144public override IReadOnlyList<SyntaxNode> GetParameters(SyntaxNode declaration) 2154public override SyntaxNode InsertParameters(SyntaxNode declaration, int index, IEnumerable<SyntaxNode> parameters) 2167public override IReadOnlyList<SyntaxNode> GetSwitchSections(SyntaxNode switchStatement) 2173public override SyntaxNode InsertSwitchSections(SyntaxNode switchStatement, int index, IEnumerable<SyntaxNode> switchSections) 2200public override SyntaxNode? Visit(SyntaxNode? node) 2223internal override SyntaxNode? GetParameterListNode(SyntaxNode declaration) 2226private static SyntaxNode WithParameterList(SyntaxNode declaration, BaseParameterListSyntax list) 2272public override SyntaxNode? GetExpression(SyntaxNode declaration) 2322public override SyntaxNode WithExpression(SyntaxNode declaration, SyntaxNode expression) 2325private static SyntaxNode WithExpressionInternal(SyntaxNode declaration, SyntaxNode expression) 2398private static EqualsValueClauseSyntax? GetEqualsValue(SyntaxNode declaration) 2438private static SyntaxNode WithEqualsValue(SyntaxNode declaration, EqualsValueClauseSyntax? initializer) 2478public override IReadOnlyList<SyntaxNode> GetStatements(SyntaxNode declaration) 2500public override SyntaxNode WithStatements(SyntaxNode declaration, IEnumerable<SyntaxNode> statements) 2536public override IReadOnlyList<SyntaxNode> GetAccessors(SyntaxNode declaration) 2542public override SyntaxNode InsertAccessors(SyntaxNode declaration, int index, IEnumerable<SyntaxNode> accessors) 2563internal static AccessorListSyntax? GetAccessorList(SyntaxNode declaration) 2566private static bool CanHaveAccessors(SyntaxNode declaration) 2575private static SyntaxNode WithAccessorList(SyntaxNode declaration, AccessorListSyntax accessorList) 2582private static AccessorListSyntax AsAccessorList(IEnumerable<SyntaxNode> nodes, SyntaxKind parentKind) 2585private static AccessorDeclarationSyntax? AsAccessor(SyntaxNode node, SyntaxKind parentKind) 2613private static AccessorDeclarationSyntax? GetAccessor(SyntaxNode declaration, SyntaxKind kind) 2619private SyntaxNode WithAccessor(SyntaxNode declaration, SyntaxKind kind, AccessorDeclarationSyntax accessor) 2622private SyntaxNode WithAccessor(SyntaxNode declaration, AccessorListSyntax? accessorList, SyntaxKind kind, AccessorDeclarationSyntax? accessor) 2640public override IReadOnlyList<SyntaxNode> GetGetAccessorStatements(SyntaxNode declaration) 2646public override IReadOnlyList<SyntaxNode> GetSetAccessorStatements(SyntaxNode declaration) 2652public override SyntaxNode WithGetAccessorStatements(SyntaxNode declaration, IEnumerable<SyntaxNode> statements) 2655public override SyntaxNode WithSetAccessorStatements(SyntaxNode declaration, IEnumerable<SyntaxNode> statements) 2658private SyntaxNode WithAccessorStatements(SyntaxNode declaration, SyntaxKind kind, IEnumerable<SyntaxNode> statements) 2672public override IReadOnlyList<SyntaxNode> GetBaseAndInterfaceTypes(SyntaxNode declaration) 2685public override SyntaxNode AddBaseType(SyntaxNode declaration, SyntaxNode baseType) 2699public override SyntaxNode AddInterfaceType(SyntaxNode declaration, SyntaxNode interfaceType) 2713private static SyntaxNode AddBaseList(SyntaxNode declaration, BaseListSyntax baseList) 2715var newDecl = WithBaseList(declaration, baseList); 2721private static BaseListSyntax? GetBaseList(SyntaxNode declaration) 2726private static SyntaxNode WithBaseList(SyntaxNode declaration, BaseListSyntax baseList) 2735public override SyntaxNode ReplaceNode(SyntaxNode root, SyntaxNode declaration, SyntaxNode? newDeclaration) 2750var newFullDecl = AsIsolatedDeclaration(newDeclaration); 2751var fullDecl = GetFullDeclaration(declaration); 2759var newSubDecl = GetSubDeclarations(newFullDecl)[0]; 2783private static bool AreInlineReplaceableSubDeclarations(SyntaxNode decl1, SyntaxNode decl2) 2799private static bool AreSimilarExceptForSubDeclarations(SyntaxNode? decl1, SyntaxNode? decl2) 2848private IEnumerable<SyntaxNode> SplitAndReplace(SyntaxNode multiPartDeclaration, int index, IEnumerable<SyntaxNode> newDeclarations) 2854var newNodes = new List<SyntaxNode>(); 2878public override SyntaxNode InsertNodesBefore(SyntaxNode root, SyntaxNode declaration, IEnumerable<SyntaxNode> newDeclarations) 2897private SyntaxNode InsertNodesBeforeInternal(SyntaxNode root, SyntaxNode declaration, IEnumerable<SyntaxNode> newDeclarations) 2899var fullDecl = GetFullDeclaration(declaration); 2917public override SyntaxNode InsertNodesAfter(SyntaxNode root, SyntaxNode declaration, IEnumerable<SyntaxNode> newDeclarations) 2936private SyntaxNode InsertNodesAfterInternal(SyntaxNode root, SyntaxNode declaration, IEnumerable<SyntaxNode> newDeclarations) 2938var fullDecl = GetFullDeclaration(declaration); 2957private IEnumerable<SyntaxNode> SplitAndInsert(SyntaxNode multiPartDeclaration, int index, IEnumerable<SyntaxNode> newDeclarations) 2960var newNodes = new List<SyntaxNode> 2969private SyntaxNode WithSubDeclarationsRemoved(SyntaxNode declaration, int index, int count) 2972private static IReadOnlyList<SyntaxNode> GetSubDeclarations(SyntaxNode declaration) 2983public override SyntaxNode RemoveNode(SyntaxNode root, SyntaxNode node) 2986public override SyntaxNode RemoveNode(SyntaxNode root, SyntaxNode node, SyntaxRemoveOptions options) 3007private SyntaxNode RemoveNodeInternal(SyntaxNode root, SyntaxNode declaration, SyntaxRemoveOptions options) 3033var full = GetFullDeclaration(declaration); 3052var parent = declaration.Parent; 3071private static SyntaxNode ShiftTrivia(SyntaxNode root, SyntaxNode node) 3077var newNode = node.WithTrailingTrivia(node.GetTrailingTrivia().AddRange(previousToken.TrailingTrivia)); 3095public override SyntaxNode AddEventHandler(SyntaxNode @event, SyntaxNode handler) 3098public override SyntaxNode RemoveEventHandler(SyntaxNode @event, SyntaxNode handler) 3101public override SyntaxNode AwaitExpression(SyntaxNode expression) 3104public override SyntaxNode NameOfExpression(SyntaxNode expression) 3107public override SyntaxNode ReturnStatement(SyntaxNode? expression = null) 3110public override SyntaxNode ThrowStatement(SyntaxNode? expression = null) 3113public override SyntaxNode ThrowExpression(SyntaxNode expression) 3116public override SyntaxNode IfStatement(SyntaxNode condition, IEnumerable<SyntaxNode> trueStatements, IEnumerable<SyntaxNode>? falseStatements = null) 3137private static BlockSyntax CreateBlock(IEnumerable<SyntaxNode>? statements = null) 3140private static SyntaxList<StatementSyntax> AsStatementList(IEnumerable<SyntaxNode>? nodes) 3143private static StatementSyntax AsStatement(SyntaxNode node) 3153public override SyntaxNode ExpressionStatement(SyntaxNode expression) 3156internal override SyntaxNode MemberAccessExpressionWorker(SyntaxNode? expression, SyntaxNode simpleName) 3167public override SyntaxNode ConditionalAccessExpression(SyntaxNode expression, SyntaxNode whenNotNull) 3170public override SyntaxNode MemberBindingExpression(SyntaxNode name) 3173public override SyntaxNode ElementBindingExpression(IEnumerable<SyntaxNode> arguments) 3198private static SeparatedSyntaxList<ExpressionSyntax> AsExpressionList(IEnumerable<SyntaxNode> expressions) 3201public override SyntaxNode ArrayCreationExpression(SyntaxNode elementType, SyntaxNode size) 3207public override SyntaxNode ArrayCreationExpression(SyntaxNode elementType, IEnumerable<SyntaxNode> elements) 3215public override SyntaxNode ObjectCreationExpression(SyntaxNode type, IEnumerable<SyntaxNode> arguments) 3218internal override SyntaxNode ObjectCreationExpression(SyntaxNode type, SyntaxToken openParen, SeparatedSyntaxList<SyntaxNode> arguments, SyntaxToken closeParen) 3224private static ArgumentListSyntax CreateArgumentList(IEnumerable<SyntaxNode> arguments) 3227private static SeparatedSyntaxList<ArgumentSyntax> CreateArguments(IEnumerable<SyntaxNode> arguments) 3230private static ArgumentSyntax AsArgument(SyntaxNode argOrExpression) 3233public override SyntaxNode InvocationExpression(SyntaxNode expression, IEnumerable<SyntaxNode> arguments) 3236public override SyntaxNode ElementAccessExpression(SyntaxNode expression, IEnumerable<SyntaxNode> arguments) 3242public override SyntaxNode DefaultExpression(SyntaxNode type) 3245public override SyntaxNode DefaultExpression(ITypeSymbol type) 3280private static SyntaxNode Parenthesize(SyntaxNode expression, bool includeElasticTrivia = true, bool addSimplifierAnnotation = true) 3283public override SyntaxNode IsTypeExpression(SyntaxNode expression, SyntaxNode type) 3286public override SyntaxNode TypeOfExpression(SyntaxNode type) 3289public override SyntaxNode TryCastExpression(SyntaxNode expression, SyntaxNode type) 3292public override SyntaxNode CastExpression(SyntaxNode type, SyntaxNode expression) 3295public override SyntaxNode ConvertExpression(SyntaxNode type, SyntaxNode expression) 3298public override SyntaxNode AssignmentStatement(SyntaxNode left, SyntaxNode right) 3301private static SyntaxNode CreateBinaryExpression(SyntaxKind syntaxKind, SyntaxNode left, SyntaxNode right) 3304public override SyntaxNode ValueEqualsExpression(SyntaxNode left, SyntaxNode right) 3307public override SyntaxNode ReferenceEqualsExpression(SyntaxNode left, SyntaxNode right) 3310public override SyntaxNode ValueNotEqualsExpression(SyntaxNode left, SyntaxNode right) 3313public override SyntaxNode ReferenceNotEqualsExpression(SyntaxNode left, SyntaxNode right) 3316public override SyntaxNode LessThanExpression(SyntaxNode left, SyntaxNode right) 3319public override SyntaxNode LessThanOrEqualExpression(SyntaxNode left, SyntaxNode right) 3322public override SyntaxNode GreaterThanExpression(SyntaxNode left, SyntaxNode right) 3325public override SyntaxNode GreaterThanOrEqualExpression(SyntaxNode left, SyntaxNode right) 3328public override SyntaxNode NegateExpression(SyntaxNode expression) 3331public override SyntaxNode AddExpression(SyntaxNode left, SyntaxNode right) 3334public override SyntaxNode SubtractExpression(SyntaxNode left, SyntaxNode right) 3337public override SyntaxNode MultiplyExpression(SyntaxNode left, SyntaxNode right) 3340public override SyntaxNode DivideExpression(SyntaxNode left, SyntaxNode right) 3343public override SyntaxNode ModuloExpression(SyntaxNode left, SyntaxNode right) 3346public override SyntaxNode BitwiseAndExpression(SyntaxNode left, SyntaxNode right) 3349public override SyntaxNode BitwiseOrExpression(SyntaxNode left, SyntaxNode right) 3352public override SyntaxNode BitwiseNotExpression(SyntaxNode operand) 3355public override SyntaxNode LogicalAndExpression(SyntaxNode left, SyntaxNode right) 3358public override SyntaxNode LogicalOrExpression(SyntaxNode left, SyntaxNode right) 3361public override SyntaxNode LogicalNotExpression(SyntaxNode expression) 3364public override SyntaxNode ConditionalExpression(SyntaxNode condition, SyntaxNode whenTrue, SyntaxNode whenFalse) 3367public override SyntaxNode CoalesceExpression(SyntaxNode left, SyntaxNode right) 3370public override SyntaxNode ThisExpression() 3373public override SyntaxNode BaseExpression() 3376public override SyntaxNode TypedConstantExpression(TypedConstant value) 3379private protected override SyntaxNode GenerateExpression(ITypeSymbol? type, object? value, bool canUseFieldReference) 3382public override SyntaxNode IdentifierName(string identifier) 3385public override SyntaxNode GenericName(string identifier, IEnumerable<SyntaxNode> typeArguments) 3388internal override SyntaxNode GenericName(SyntaxToken identifier, IEnumerable<SyntaxNode> typeArguments) 3392public override SyntaxNode WithTypeArguments(SyntaxNode expression, IEnumerable<SyntaxNode> typeArguments) 3422public override SyntaxNode QualifiedName(SyntaxNode left, SyntaxNode right) 3425internal override SyntaxNode GlobalAliasedName(SyntaxNode name) 3430public override SyntaxNode NameExpression(INamespaceOrTypeSymbol namespaceOrTypeSymbol) 3433private protected override SyntaxNode TypeExpression(ITypeSymbol typeSymbol, RefKind refKind) 3444public override SyntaxNode TypeExpression(SpecialType specialType) 3465public override SyntaxNode ArrayTypeExpression(SyntaxNode type) 3468public override SyntaxNode NullableTypeExpression(SyntaxNode type) 3480internal override SyntaxNode CreateTupleType(IEnumerable<SyntaxNode> elements) 3483public override SyntaxNode TupleElementExpression(SyntaxNode type, string? name = null) 3486public override SyntaxNode Argument(string? name, RefKind refKind, SyntaxNode expression) 3494public override SyntaxNode LocalDeclarationStatement(SyntaxNode? type, string name, SyntaxNode? initializer, bool isConst) 3497public override SyntaxNode UsingStatement(SyntaxNode? type, string name, SyntaxNode expression, IEnumerable<SyntaxNode> statements) 3505public override SyntaxNode UsingStatement(SyntaxNode expression, IEnumerable<SyntaxNode> statements) 3513public override SyntaxNode LockStatement(SyntaxNode expression, IEnumerable<SyntaxNode> statements) 3520public override SyntaxNode TryCatchStatement(IEnumerable<SyntaxNode>? tryStatements, IEnumerable<SyntaxNode>? catchClauses, IEnumerable<SyntaxNode>? finallyStatements = null) 3528public override SyntaxNode CatchClause(SyntaxNode type, string name, IEnumerable<SyntaxNode> statements) 3536public override SyntaxNode WhileStatement(SyntaxNode condition, IEnumerable<SyntaxNode> statements) 3539public override SyntaxNode SwitchStatement(SyntaxNode expression, IEnumerable<SyntaxNode> caseClauses) 3560public override SyntaxNode SwitchSection(IEnumerable<SyntaxNode> expressions, IEnumerable<SyntaxNode> statements) 3563internal override SyntaxNode SwitchSectionFromLabels(IEnumerable<SyntaxNode> labels, IEnumerable<SyntaxNode> statements) 3570public override SyntaxNode DefaultSwitchSection(IEnumerable<SyntaxNode> statements) 3573private static SyntaxList<SwitchLabelSyntax> AsSwitchLabels(IEnumerable<SyntaxNode> expressions) 3585public override SyntaxNode ExitSwitchStatement() 3588internal override SyntaxNode ScopeBlock(IEnumerable<SyntaxNode> statements) 3591internal override SyntaxNode GlobalStatement(SyntaxNode statement) 3594public override SyntaxNode ValueReturningLambdaExpression(IEnumerable<SyntaxNode>? parameterDeclarations, SyntaxNode expression) 3603private static bool IsSimpleLambdaParameter(SyntaxNode node) 3606public override SyntaxNode VoidReturningLambdaExpression(IEnumerable<SyntaxNode>? lambdaParameters, SyntaxNode expression) 3609public override SyntaxNode ValueReturningLambdaExpression(IEnumerable<SyntaxNode>? parameterDeclarations, IEnumerable<SyntaxNode> statements) 3612public override SyntaxNode VoidReturningLambdaExpression(IEnumerable<SyntaxNode>? lambdaParameters, IEnumerable<SyntaxNode> statements) 3615public override SyntaxNode LambdaParameter(string identifier, SyntaxNode? type = null) 3618internal override SyntaxNode IdentifierName(SyntaxToken identifier) 3621internal override SyntaxNode NamedAnonymousObjectMemberDeclarator(SyntaxNode identifier, SyntaxNode expression) 3628public override SyntaxNode TupleExpression(IEnumerable<SyntaxNode> arguments) 3631internal override SyntaxNode RemoveAllComments(SyntaxNode node) 3671internal override SyntaxNode ParseExpression(string stringToParse)
ExternalAccess\Pythia\Api\PythiaSyntaxExtensions.cs (4)
22public static bool IsFoundUnder<TParent>(this SyntaxNode node, Func<TParent, SyntaxNode> childGetter) where TParent : SyntaxNode 28public static bool IsInStaticContext(this SyntaxNode node)
FindSymbols\CSharpDeclaredSymbolInfoFactoryService.cs (8)
92private static void AddAliasMaps(SyntaxNode node, List<Dictionary<string, string>> aliasMaps) 94for (var current = node; current != null; current = current.Parent) 204SyntaxNode container, 246SyntaxNode container, 267SyntaxNode container, 410SyntaxNode container, 597private static Accessibility GetAccessibility(SyntaxNode container, SyntaxTokenList modifiers) 695private static bool TryGetSimpleTypeName(SyntaxNode node, ImmutableArray<string>? typeParameterNames, out string simpleTypeName, out bool isArray)
Formatting\TypingFormattingRule.cs (3)
16public override void AddSuppressOperations(ArrayBuilder<SuppressOperation> list, SyntaxNode node, in NextSuppressOperationAction nextOperation) 26private static bool TryAddSuppressionOnMissingCloseBraceCase(ArrayBuilder<SuppressOperation> list, SyntaxNode node) 102private static bool SomeParentHasMissingCloseBrace(SyntaxNode? node)
OrganizeImports\CSharpOrganizeImportsService.cs (2)
27var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 30var newRoot = rewriter.Visit(root);
OrganizeImports\CSharpOrganizeImportsService.Rewriter.cs (6)
33public override SyntaxNode VisitCompilationUnit(CompilationUnitSyntax node) 52public override SyntaxNode VisitFileScopedNamespaceDeclaration(FileScopedNamespaceDeclarationSyntax node) 55public override SyntaxNode VisitNamespaceDeclaration(NamespaceDeclarationSyntax node) 78where TSyntax : SyntaxNode 84private static string GetNewText<TSyntax>(SyntaxList<TSyntax> organizedList) where TSyntax : SyntaxNode 87private static TextSpan GetTextSpan<TSyntax>(SyntaxList<TSyntax> list) where TSyntax : SyntaxNode
ReassignedVariable\CSharpReassignedVariableService.cs (6)
34protected override bool HasInitializer(SyntaxNode variable) 37protected override SyntaxNode GetMemberBlock(SyntaxNode methodOrPropertyDeclaration) 40protected override SyntaxNode GetParentScope(SyntaxNode localDeclaration) 42var current = localDeclaration;
Recommendations\CSharpRecommendationServiceRunner.cs (1)
57public override bool TryGetExplicitTypeOfLambdaParameter(SyntaxNode lambdaSyntax, int ordinalInLambda, [NotNullWhen(true)] out ITypeSymbol? explicitLambdaParameterType)
Rename\CSharpRenameRewriterLanguageService.cs (20)
42public override SyntaxNode AnnotateAndRename(RenameRewriterParameters parameters) 153public override SyntaxNode? Visit(SyntaxNode? node) 162foreach (var lambda in lambdas) 173SyntaxNode result; 192private bool ShouldComplexifyNode(SyntaxNode node, bool isInConflictLambdaBody) 284private SyntaxNode Complexify(SyntaxNode originalNode, SyntaxNode newNode) 291var speculativeTree = originalNode.SyntaxTree.GetRoot(_cancellationToken).ReplaceNode(originalNode, newNode); 292newNode = speculativeTree.GetAnnotatedNodes<SyntaxNode>(annotation).First(); 307newNode = speculativeTree.GetAnnotatedNodes<SyntaxNode>(annotation).First(); 505public override SyntaxNode? VisitInvocationExpression(InvocationExpressionSyntax node) 507var result = base.VisitInvocationExpression(node); 571var parent = oldToken.Parent!; 1017if (token.Parent.IsInDeconstructionLeft(out var deconstructionLeft)) 1151public override SyntaxNode? GetExpansionTargetForLocation(SyntaxToken token) 1154private static SyntaxNode? GetExpansionTarget(SyntaxToken token) 1246public static SemanticModel? GetSemanticModelForNode(SyntaxNode node, SemanticModel originalSemanticModel) 1254var nodeToSpeculate = node.GetAncestorsOrThis(n => SpeculationAnalyzer.CanSpeculateOnNode(n)).LastOrDefault();
Rename\LabelConflictVisitor.cs (2)
21public override void DefaultVisit(SyntaxNode node) 23foreach (var child in node.ChildNodes())
Rename\LocalConflictVisitor.cs (6)
22public override void DefaultVisit(SyntaxNode node) 24foreach (var child in node.ChildNodes()) 41private void VisitBlockStatements(SyntaxNode node, IEnumerable<SyntaxNode> statements) 47foreach (var statement in statements) 166foreach (var child in body.ChildNodes().Where(c => c.Kind() != SyntaxKind.QueryContinuation))
SemanticModelReuse\CSharpSemanticModelReuseLanguageService.cs (5)
40public override SyntaxNode? TryGetContainingMethodBodyForSpeculation(SyntaxNode node) 42for (SyntaxNode? previous = null, current = node; current != null; previous = current, current = current.Parent) 55protected override SemanticModel? TryGetSpeculativeSemanticModelWorker(SemanticModel previousSemanticModel, SyntaxNode previousBodyNode, SyntaxNode currentBodyNode)
Simplification\CSharpSimplificationService.cs (20)
53public override SyntaxNode Expand(SyntaxNode node, SemanticModel semanticModel, SyntaxAnnotation? annotationForReplacedAliasIdentifier, Func<SyntaxNode, bool>? expandInsideNode, bool expandParameter, CancellationToken cancellationToken) 78public override SyntaxToken Expand(SyntaxToken token, SemanticModel semanticModel, Func<SyntaxNode, bool>? expandInsideNode, CancellationToken cancellationToken) 96public static SyntaxToken TryEscapeIdentifierToken(SyntaxToken syntaxToken, SyntaxNode parentOfToken) 114var parent = parentOfToken.Parent; 138public static T AppendElasticTriviaIfNecessary<T>(T rewrittenNode, T originalNode) where T : SyntaxNode 170protected override SemanticModel GetSpeculativeSemanticModel(ref SyntaxNode nodeToSpeculate, SemanticModel originalSemanticModel, SyntaxNode originalNode) 172var syntaxNodeToSpeculate = nodeToSpeculate; 178protected override ImmutableArray<NodeOrTokenToReduce> GetNodesAndTokensToReduce(SyntaxNode root, Func<SyntaxNodeOrToken, bool> isNodeOrTokenOutsideSimplifySpans) 181protected override bool NodeRequiresNonSpeculativeSemanticModel(SyntaxNode node) 186protected override void GetUnusedNamespaceImports(SemanticModel model, HashSet<SyntaxNode> namespaceImports, CancellationToken cancellationToken) 188var root = model.SyntaxTree.GetRoot(cancellationToken); 204private static bool IsTupleInDeconstruction(SyntaxNode tuple) 207var currentTuple = tuple; 210var parent = currentTuple.Parent; 221var grandParent = parent.Parent; 232protected override void AddImportDeclarations(CompilationUnitSyntax root, ArrayBuilder<SyntaxNode> importDeclarations) 242static void AddImportDeclarations(BaseNamespaceDeclarationSyntax baseNamespace, ArrayBuilder<SyntaxNode> importDeclarations)
Simplification\CSharpSimplificationService.Expander.cs (24)
47private readonly Func<SyntaxNode, bool> _expandInsideNode; 54Func<SyntaxNode, bool> expandInsideNode, 66public override SyntaxNode Visit(SyntaxNode node) 131public override SyntaxNode VisitReturnStatement(ReturnStatementSyntax node) 133var newNode = base.VisitReturnStatement(node); 157public override SyntaxNode VisitParenthesizedLambdaExpression(ParenthesizedLambdaExpressionSyntax node) 159var newNode = base.VisitParenthesizedLambdaExpression(node); 208public override SyntaxNode VisitSimpleLambdaExpression(SimpleLambdaExpressionSyntax node) 210var newNode = base.VisitSimpleLambdaExpression(node); 247public override SyntaxNode VisitArgument(ArgumentSyntax node) 321public override SyntaxNode VisitAnonymousObjectMemberDeclarator(AnonymousObjectMemberDeclaratorSyntax node) 344public override SyntaxNode VisitBinaryExpression(BinaryExpressionSyntax node) 370public override SyntaxNode VisitInterpolation(InterpolationSyntax node) 382public override SyntaxNode VisitXmlNameAttribute(XmlNameAttributeSyntax node) 391public override SyntaxNode VisitNameMemberCref(NameMemberCrefSyntax node) 419public override SyntaxNode VisitGenericName(GenericNameSyntax node) 428public override SyntaxNode VisitIdentifierName(IdentifierNameSyntax node) 624var parent = originalSimpleName.Parent; 771foreach (var typeArgumentList in typeArgumentListSyntax) 868SyntaxNode currentNode = identifierName; 869SyntaxNode parent = identifierName; 950var parent = originalNode.Parent; 1043public override SyntaxNode VisitInvocationExpression(InvocationExpressionSyntax originalNode)
Simplification\CSharpSimplificationService.NodesAndTokensToReduceComputer.cs (4)
29public static ImmutableArray<NodeOrTokenToReduce> Compute(SyntaxNode root, Func<SyntaxNodeOrToken, bool> isNodeOrTokenOutsideSimplifySpans) 44public override SyntaxNode Visit(SyntaxNode node) 73var rewrittenNode = base.Visit(node);
Simplification\Reducers\AbstractCSharpReducer.AbstractReductionRewriter.cs (18)
35private readonly HashSet<SyntaxNode> _processedParentNodes = []; 70private static SyntaxNode GetParentNode(SyntaxNode node) 79private static SyntaxNode GetParentNode(ExpressionSyntax expression) 85SyntaxNode parent = expression; 86for (var current = (SyntaxNode)expression; current != null; current = current.Parent) 97private static SyntaxNode GetParentNode(PatternSyntax pattern) 100for (SyntaxNode? current = pattern; current != null; current = current.Parent) 112private static SyntaxNode GetParentNode(CrefSyntax cref) 123protected SyntaxNode? SimplifyNode<TNode>( 125SyntaxNode? newNode, 126Func<TNode, SemanticModel, CSharpSimplifierOptions, CancellationToken, SyntaxNode> simplifier) 127where TNode : SyntaxNode 129var parentNode = GetParentNode(node); 147var simplifiedNode = simplifier(node, this.SemanticModel, this.Options, this.CancellationToken); 170public override SyntaxNode VisitElementAccessExpression(ElementAccessExpressionSyntax node) 179public override SyntaxNode VisitInvocationExpression(InvocationExpressionSyntax node)
Simplification\Reducers\CSharpCastReducer.Rewriter.cs (3)
23public override SyntaxNode VisitCastExpression(CastExpressionSyntax node) 31public override SyntaxNode VisitBinaryExpression(BinaryExpressionSyntax node) 33var result = base.VisitBinaryExpression(node);
Simplification\Reducers\CSharpDefaultExpressionReducer.Rewriter.cs (3)
25private readonly Func<DefaultExpressionSyntax, SemanticModel, CSharpSimplifierOptions, CancellationToken, SyntaxNode> _simplifyDefaultExpression; 27private SyntaxNode SimplifyDefaultExpression( 44public override SyntaxNode VisitDefaultExpression(DefaultExpressionSyntax node)
Simplification\Reducers\CSharpEscapingReducer.cs (3)
51var parent = token.Parent; 55var enclosingLambdaExpression = parent.GetAncestorsOrThis(n => (n is SimpleLambdaExpressionSyntax or ParenthesizedLambdaExpressionSyntax)).FirstOrDefault(); 75var enclosingMethodBlock = parent.GetAncestorsOrThis(n => n is MethodDeclarationSyntax).FirstOrDefault();
Simplification\Reducers\CSharpExtensionMethodReducer.cs (2)
23private static readonly Func<InvocationExpressionSyntax, SemanticModel, CSharpSimplifierOptions, CancellationToken, SyntaxNode> s_simplifyExtensionMethod = SimplifyExtensionMethod; 32private static SyntaxNode SimplifyExtensionMethod(
Simplification\Reducers\CSharpExtensionMethodReducer.Rewriter.cs (1)
21public override SyntaxNode VisitInvocationExpression(InvocationExpressionSyntax node)
Simplification\Reducers\CSharpInferredMemberNameReducer.Rewriter.cs (5)
39private static readonly Func<AnonymousObjectMemberDeclaratorSyntax, SemanticModel, SimplifierOptions, CancellationToken, SyntaxNode> s_simplifyAnonymousTypeMemberName = SimplifyAnonymousTypeMemberName; 41private static SyntaxNode SimplifyAnonymousTypeMemberName(AnonymousObjectMemberDeclaratorSyntax node, SemanticModel semanticModel, SimplifierOptions options, CancellationToken canellationToken) 52public override SyntaxNode VisitArgument(ArgumentSyntax node) 54var newNode = base.VisitArgument(node); 67public override SyntaxNode VisitAnonymousObjectMemberDeclarator(AnonymousObjectMemberDeclaratorSyntax node)
Simplification\Reducers\CSharpMiscellaneousReducer.cs (7)
25private static readonly Func<ParameterSyntax, SemanticModel, SimplifierOptions, CancellationToken, SyntaxNode> s_simplifyParameter = SimplifyParameter; 67private static SyntaxNode SimplifyParameter( 83private static readonly Func<ParenthesizedLambdaExpressionSyntax, SemanticModel, SimplifierOptions, CancellationToken, SyntaxNode> s_simplifyParenthesizedLambdaExpression = SimplifyParenthesizedLambdaExpression; 85private static SyntaxNode SimplifyParenthesizedLambdaExpression( 111private static readonly Func<BlockSyntax, SemanticModel, CSharpSimplifierOptions, CancellationToken, SyntaxNode> s_simplifyBlock = SimplifyBlock; 113private static SyntaxNode SimplifyBlock( 176private static bool CanHaveEmbeddedStatement(SyntaxNode node)
Simplification\Reducers\CSharpMiscellaneousReducer.Rewriter.cs (3)
19public override SyntaxNode? VisitParameter(ParameterSyntax node) 25public override SyntaxNode? VisitParenthesizedLambdaExpression(ParenthesizedLambdaExpressionSyntax node) 31public override SyntaxNode? VisitBlock(BlockSyntax node)
Simplification\Reducers\CSharpNameReducer.cs (5)
22private static readonly Func<SyntaxNode, SemanticModel, CSharpSimplifierOptions, CancellationToken, SyntaxNode> s_simplifyName = SimplifyName; 31private static SyntaxNode SimplifyName( 32SyntaxNode node, 37SyntaxNode replacementNode;
Simplification\Reducers\CSharpNameReducer.Rewriter.cs (21)
24public override SyntaxNode VisitPredefinedType(PredefinedTypeSyntax node) 32var result = SimplifyNode( 42public override SyntaxNode VisitAliasQualifiedName(AliasQualifiedNameSyntax node) 50var result = SimplifyNode( 60public override SyntaxNode VisitQualifiedName(QualifiedNameSyntax node) 68var result = SimplifyNode( 78public override SyntaxNode VisitMemberAccessExpression(MemberAccessExpressionSyntax node) 86var result = SimplifyNode( 96public override SyntaxNode VisitIdentifierName(IdentifierNameSyntax node) 104var result = SimplifyNode( 114public override SyntaxNode VisitGenericName(GenericNameSyntax node) 122var result = SimplifyNode( 132public override SyntaxNode VisitQualifiedCref(QualifiedCrefSyntax node) 140var result = SimplifyNode( 150public override SyntaxNode VisitArrayType(ArrayTypeSyntax node) 158var result = SimplifyNode( 168public override SyntaxNode VisitNullableType(NullableTypeSyntax node) 176var result = SimplifyNode( 186public override SyntaxNode VisitTupleType(TupleTypeSyntax node) 194var result = SimplifyNode( 204public override SyntaxNode VisitBinaryExpression(BinaryExpressionSyntax node)
Simplification\Reducers\CSharpNullableAnnotationReducer.cs (2)
21private static readonly Func<NullableTypeSyntax, SemanticModel, SimplifierOptions, CancellationToken, SyntaxNode> s_simplifyNullableType = SimplifyNullableType; 30private static SyntaxNode SimplifyNullableType(
Simplification\Reducers\CSharpNullableAnnotationReducer.Rewriter.cs (1)
20public override SyntaxNode VisitNullableType(NullableTypeSyntax node)
Simplification\Reducers\CSharpParenthesizedExpressionReducer.cs (2)
21private static readonly Func<ParenthesizedExpressionSyntax, SemanticModel, SimplifierOptions, CancellationToken, SyntaxNode> s_simplifyParentheses = SimplifyParentheses; 30private static SyntaxNode SimplifyParentheses(
Simplification\Reducers\CSharpParenthesizedExpressionReducer.Rewriter.cs (1)
21public override SyntaxNode VisitParenthesizedExpression(ParenthesizedExpressionSyntax node)
Simplification\Reducers\CSharpParenthesizedPatternReducer.cs (2)
23private static readonly Func<ParenthesizedPatternSyntax, SemanticModel, SimplifierOptions, CancellationToken, SyntaxNode> s_simplifyParentheses = SimplifyParentheses; 32private static SyntaxNode SimplifyParentheses(
Simplification\Reducers\CSharpParenthesizedPatternReducer.Rewriter.cs (1)
21public override SyntaxNode VisitParenthesizedPattern(ParenthesizedPatternSyntax node)
Simplification\Reducers\CSharpVarReducer.Rewriter.cs (10)
23private SyntaxNode ProcessTypeSyntax(TypeSyntax typeSyntax) 52public override SyntaxNode VisitAliasQualifiedName(AliasQualifiedNameSyntax node) => ProcessTypeSyntax(node); 53public override SyntaxNode VisitArrayType(ArrayTypeSyntax node) => ProcessTypeSyntax(node); 54public override SyntaxNode VisitGenericName(GenericNameSyntax node) => ProcessTypeSyntax(node); 55public override SyntaxNode VisitIdentifierName(IdentifierNameSyntax node) => ProcessTypeSyntax(node); 56public override SyntaxNode VisitNullableType(NullableTypeSyntax node) => ProcessTypeSyntax(node); 57public override SyntaxNode VisitPointerType(PointerTypeSyntax node) => ProcessTypeSyntax(node); 58public override SyntaxNode VisitPredefinedType(PredefinedTypeSyntax node) => ProcessTypeSyntax(node); 59public override SyntaxNode VisitQualifiedName(QualifiedNameSyntax node) => ProcessTypeSyntax(node); 60public override SyntaxNode VisitTupleType(TupleTypeSyntax node) => ProcessTypeSyntax(node);
Simplification\Simplifiers\AbstractCSharpSimplifier.cs (8)
27where TSyntax : SyntaxNode 28where TSimplifiedSyntax : SyntaxNode 224var firstMember = 226root.AttributeLists.Count > 0 ? root.AttributeLists[0] : (SyntaxNode)null; 233static bool HasUsingAliasDirective(SyntaxNode syntax) 339var startNode = GetStartNodeForNamespaceId(semanticModel, token, cancellationToken); 364private static SyntaxNode GetStartNodeForNamespaceId(SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken) 375protected static TypeSyntax CreatePredefinedTypeSyntax(SyntaxNode nodeToReplace, SyntaxToken token)
Simplification\Simplifiers\MemberAccessExpressionSimplifier.cs (2)
42SyntaxNode parent = memberAccessExpression; 87private static bool IsEntirelySimpleNames(SyntaxNode node)
Simplification\Simplifiers\NameSimplifier.cs (2)
552private static bool IsPartOfNamespaceDeclarationName(SyntaxNode node) 554var parent = node;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\EmbeddedLanguages\VirtualChars\CSharpVirtualCharService.cs (1)
114private static bool IsInDirective(SyntaxNode? node)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\DirectiveSyntaxExtensions.cs (5)
17private static readonly ConditionalWeakTable<SyntaxNode, DirectiveInfo<DirectiveTriviaSyntax>> s_rootToDirectiveInfo = new(); 19private static SyntaxNode GetAbsoluteRoot(this SyntaxNode node) 29private static DirectiveInfo<DirectiveTriviaSyntax> GetDirectiveInfo(SyntaxNode node, CancellationToken cancellationToken) 34private static DirectiveInfo<DirectiveTriviaSyntax> GetDirectiveInfoForRoot(SyntaxNode root, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (6)
208public static bool IsInRefContext([NotNullWhen(true)] this ExpressionSyntax? expression, [NotNullWhen(true)] out SyntaxNode? refParent) 283var parent = expr.Parent; 333if (expression.IsInRefContext(out var refParent)) 406if (expression?.Parent is SyntaxNode parent) 913var parent = topExpression.Parent; 974for (SyntaxNode? current = returnStatement; current != null; current = current.Parent)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ILocalSymbolExtensions.cs (4)
12public static bool CanSafelyMoveLocalToBlock(this ILocalSymbol localSymbol, SyntaxNode currentBlock, SyntaxNode destinationBlock) 16var localFunctionOrMethodDeclaration = currentBlock.AncestorsAndSelf() 30static bool HasTypeParameterWithName(SyntaxNode? node, string name)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\MemberDeclarationSyntaxExtensions.DeclarationFinder.cs (1)
23public static Dictionary<string, List<SyntaxToken>> GetAllDeclarations(SyntaxNode syntax)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (3)
29var nodeParent = node.Parent; 317private static readonly ObjectPool<Stack<SyntaxNode>> s_nodeStackPool = SharedPools.Default<Stack<SyntaxNode>>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (1)
161public static ISet<INamespaceSymbol> GetUsingNamespacesInScope(this SemanticModel semanticModel, SyntaxNode location)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxListExtensions.cs (2)
15public static SyntaxList<T> RemoveRange<T>(this SyntaxList<T> syntaxList, int index, int count) where T : SyntaxNode 22public static SyntaxList<T> Insert<T>(this SyntaxList<T> list, int index, T item) where T : SyntaxNode
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (74)
23public static LanguageVersion GetLanguageVersion(this SyntaxNode node) 26public static void Deconstruct(this SyntaxNode node, out SyntaxKind kind) 29public static bool IsKind<TNode>([NotNullWhen(true)] this SyntaxNode? node, SyntaxKind kind, [NotNullWhen(true)] out TNode? result) 30where TNode : SyntaxNode 42public static bool IsParentKind([NotNullWhen(true)] this SyntaxNode? node, SyntaxKind kind) 45public static bool IsParentKind<TNode>([NotNullWhen(true)] this SyntaxNode? node, SyntaxKind kind, [NotNullWhen(true)] out TNode? result) 46where TNode : SyntaxNode 59this SyntaxNode node, SourceText? sourceText = null, 88public static bool IsAnyArgumentList([NotNullWhen(true)] this SyntaxNode? node) 97public static (SyntaxToken openBrace, SyntaxToken closeBrace) GetBraces(this SyntaxNode? node) 114public static bool IsEmbeddedStatementOwner([NotNullWhen(true)] this SyntaxNode? node) 128public static StatementSyntax? GetEmbeddedStatement(this SyntaxNode? node) 144public static BaseParameterListSyntax? GetParameterList(this SyntaxNode? declaration) 157public static SyntaxList<AttributeListSyntax> GetAttributeLists(this SyntaxNode? declaration) 170public static ConditionalAccessExpressionSyntax? GetParentConditionalAccessExpression(this SyntaxNode? node) 182var current = node; 249/// <inheritdoc cref="ISyntaxFacts.GetRootConditionalAccessExpression(SyntaxNode)"/> 251public static ConditionalAccessExpressionSyntax? GetRootConditionalAccessExpression(this SyntaxNode? node) 268public static ConditionalAccessExpressionSyntax? GetInnerMostConditionalAccessExpression(this SyntaxNode node) 279public static bool IsAsyncSupportingFunctionSyntax([NotNullWhen(true)] this SyntaxNode? node) 282public static bool IsCompoundAssignExpression([NotNullWhen(true)] this SyntaxNode? node) 285public static bool IsLeftSideOfAssignExpression([NotNullWhen(true)] this SyntaxNode? node) 289public static bool IsLeftSideOfAnyAssignExpression([NotNullWhen(true)] this SyntaxNode? node) 292public static bool IsRightSideOfAnyAssignExpression([NotNullWhen(true)] this SyntaxNode? node) 295public static bool IsLeftSideOfCompoundAssignExpression([NotNullWhen(true)] this SyntaxNode? node) 306public static IEnumerable<UsingDirectiveSyntax> GetEnclosingUsingDirectives(this SyntaxNode node) 314public static IEnumerable<ExternAliasDirectiveSyntax> GetEnclosingExternAliasDirectives(this SyntaxNode node) 322public static bool IsUnsafeContext(this SyntaxNode node) 333public static bool IsInStaticContext(this SyntaxNode node) 335for (var current = node; current != null; current = current.Parent) 370public static BaseNamespaceDeclarationSyntax? GetInnermostNamespaceDeclarationWithUsings(this SyntaxNode contextNode) 393public static bool IsBreakableConstruct(this SyntaxNode node) 409public static bool IsContinuableConstruct(this SyntaxNode node) 424public static bool IsReturnableConstruct(this SyntaxNode node) 448public static bool ContainsYield(this SyntaxNode node) 451public static bool IsReturnableConstructOrTopLevelCompilationUnit(this SyntaxNode node) 454public static bool SpansPreprocessorDirective<TSyntaxNode>(this IEnumerable<TSyntaxNode> list) where TSyntaxNode : SyntaxNode 459where TNode : SyntaxNode 507public static bool ContainsInterleavedDirective(this SyntaxNode syntaxNode, CancellationToken cancellationToken) 511/// Similar to <see cref="ContainsInterleavedDirective(SyntaxNode, CancellationToken)"/> except that the span to check 514public static bool ContainsInterleavedDirective(this SyntaxNode syntaxNode, TextSpan span, CancellationToken cancellationToken) 553var structure = trivia.GetStructure()!; 595where TSyntaxNode : SyntaxNode 655public static ImmutableArray<SyntaxTrivia> GetLeadingBlankLines<TSyntaxNode>(this TSyntaxNode node) where TSyntaxNode : SyntaxNode 658public static TSyntaxNode GetNodeWithoutLeadingBlankLines<TSyntaxNode>(this TSyntaxNode node) where TSyntaxNode : SyntaxNode 661public static TSyntaxNode GetNodeWithoutLeadingBlankLines<TSyntaxNode>(this TSyntaxNode node, out ImmutableArray<SyntaxTrivia> strippedTrivia) where TSyntaxNode : SyntaxNode 664public static ImmutableArray<SyntaxTrivia> GetLeadingBannerAndPreprocessorDirectives<TSyntaxNode>(this TSyntaxNode node) where TSyntaxNode : SyntaxNode 667public static TSyntaxNode GetNodeWithoutLeadingBannerAndPreprocessorDirectives<TSyntaxNode>(this TSyntaxNode node) where TSyntaxNode : SyntaxNode 670public static TSyntaxNode GetNodeWithoutLeadingBannerAndPreprocessorDirectives<TSyntaxNode>(this TSyntaxNode node, out ImmutableArray<SyntaxTrivia> strippedTrivia) where TSyntaxNode : SyntaxNode 673public static bool IsVariableDeclaratorValue([NotNullWhen(true)] this SyntaxNode? node) 677public static BlockSyntax? FindInnermostCommonBlock(this IEnumerable<SyntaxNode> nodes) 680public static IEnumerable<SyntaxNode> GetAncestorsOrThis(this SyntaxNode? node, Func<SyntaxNode, bool> predicate) 682var current = node; 694public static (SyntaxToken openParen, SyntaxToken closeParen) GetParentheses(this SyntaxNode node) 724public static (SyntaxToken openBracket, SyntaxToken closeBracket) GetBrackets(this SyntaxNode? node) 737public static SyntaxTokenList GetModifiers(this SyntaxNode? member) 749public static SyntaxNode? WithModifiers(this SyntaxNode? member, SyntaxTokenList modifiers) 760public static void ForEachMember<TArg>(this SyntaxNode? node, Action<MemberDeclarationSyntax, TArg> callback, TArg arg) 785[NotNullWhen(true)] this SyntaxNode? node, 792for (var current = node; current != null; current = current.Parent) 837[NotNullWhen(true)] this SyntaxNode? node, 838[NotNullWhen(true)] out SyntaxNode? deconstructionLeft) 840SyntaxNode? previous = null; 841for (var current = node; current != null; current = current.Parent) 863where T : SyntaxNode 872where T : SyntaxNode 880where T : SyntaxNode 886public static T KeepCommentsAndAddElasticMarkers<T>(this T node) where T : SyntaxNode 891public static SyntaxNode WithPrependedNonIndentationTriviaFrom( 892this SyntaxNode to, SyntaxNode from)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTokenExtensions.cs (2)
23public static bool IsLastTokenOfNode<T>(this SyntaxToken token) where T : SyntaxNode 26public static bool IsLastTokenOfNode<T>(this SyntaxToken token, [NotNullWhen(true)] out T? node) where T : SyntaxNode
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTriviaExtensions.cs (1)
201public static bool IsPragmaDirective(this SyntaxTrivia trivia, out bool isDisable, out bool isActive, out SeparatedSyntaxList<SyntaxNode> errorCodes)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\CSharpSyntaxFormatting.cs (2)
45protected override IFormattingResult CreateAggregatedFormattingResult(SyntaxNode node, IList<AbstractFormattingResult> results, TextSpanMutableIntervalTree? formattingSpans = null) 48protected override AbstractFormattingResult Format(SyntaxNode node, SyntaxFormattingOptions options, ImmutableArray<AbstractFormattingRule> formattingRules, SyntaxToken startToken, SyntaxToken endToken, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\DefaultOperationProvider.cs (4)
23public override void AddSuppressOperations(ArrayBuilder<SuppressOperation> list, SyntaxNode node, in NextSuppressOperationAction nextOperation) 27public override void AddAnchorIndentationOperations(List<AnchorIndentationOperation> list, SyntaxNode node, in NextAnchorIndentationOperationAction nextOperation) 31public override void AddIndentBlockOperations(List<IndentBlockOperation> list, SyntaxNode node, in NextIndentBlockOperationAction nextOperation) 35public override void AddAlignTokensOperations(List<AlignTokensOperation> list, SyntaxNode node, in NextAlignTokensOperationAction nextOperation)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\AggregatedFormattingResult.cs (2)
16public AggregatedFormattingResult(SyntaxNode node, IList<AbstractFormattingResult> results, TextSpanMutableIntervalTree? formattingSpans) 21protected override SyntaxNode Rewriter(Dictionary<ValueTuple<SyntaxToken, SyntaxToken>, TriviaData> map, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\CSharpFormatEngine.cs (1)
16SyntaxNode node,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\CSharpStructuredTriviaFormatEngine.cs (1)
23var root = trivia.GetStructure() ?? throw new ArgumentException();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\FormattingResult.cs (1)
24protected override SyntaxNode Rewriter(Dictionary<ValueTuple<SyntaxToken, SyntaxToken>, TriviaData> changeMap, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\CSharpTriviaFormatter.cs (1)
184var structuredTrivia = trivia.GetStructure();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\CSharpTriviaFormatter.DocumentationCommentExteriorCommentRewriter.cs (1)
68var currentParent = trivia.Token.Parent;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaRewriter.cs (5)
21private readonly SyntaxNode _node; 29SyntaxNode node, 44public SyntaxNode Transform() 151public override SyntaxNode? Visit(SyntaxNode? node)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\FormattingHelpers.cs (13)
48public static (SyntaxToken openBrace, SyntaxToken closeBrace) GetBracePair(this SyntaxNode? node) 51public static (SyntaxToken openBracket, SyntaxToken closeBracket) GetBracketPair(this SyntaxNode? node) 127public static bool IsLambdaBodyBlock(this SyntaxNode node) 137public static bool IsAnonymousMethodBlock(this SyntaxNode node) 197public static bool IsEmbeddedStatement([NotNullWhen(true)] this SyntaxNode? node) 199SyntaxNode? statementOrElse = node as StatementSyntax; 231var parent = token.Parent ?? throw new ArgumentNullException(nameof(token)); 362public static bool IsEmbeddedStatementOwnerWithCloseParen([NotNullWhen(true)] this SyntaxNode? node) 387public static bool IsInitializerForObjectOrAnonymousObjectCreationExpression([NotNullWhen(true)] this SyntaxNode? node) 391var parent = initializer.Parent; 423public static bool IsInitializerForArrayOrCollectionCreationExpression([NotNullWhen(true)] this SyntaxNode? node) 427var parent = initializer.Parent; 447var parent = anonymousObjectInitializer.Parent;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\AnchorIndentationFormattingRule.cs (2)
15public override void AddAnchorIndentationOperations(List<AnchorIndentationOperation> list, SyntaxNode node, in NextAnchorIndentationOperationAction nextOperation) 89private static void AddAnchorIndentationOperation(List<AnchorIndentationOperation> list, SyntaxNode node)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\BaseFormattingRule.cs (2)
146protected static void AddAlignIndentationOfTokensToBaseTokenOperation(List<AlignTokensOperation> list, SyntaxNode containingNode, SyntaxToken baseNode, IEnumerable<SyntaxToken> tokens, AlignTokensOption option = AlignTokensOption.AlignIndentationOfTokensToBaseToken) 162protected static void AddBraceSuppressOperations(ArrayBuilder<SuppressOperation> list, SyntaxNode node)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\ElasticTriviaFormattingRule.cs (6)
25public override void AddSuppressOperations(ArrayBuilder<SuppressOperation> list, SyntaxNode node, in NextSuppressOperationAction nextOperation) 41private static void AddPropertyDeclarationSuppressOperations(ArrayBuilder<SuppressOperation> list, SyntaxNode node) 53private static void AddInitializerSuppressOperations(ArrayBuilder<SuppressOperation> list, SyntaxNode node) 70private static void AddCollectionExpressionSuppressOperations(ArrayBuilder<SuppressOperation> list, SyntaxNode node) 79private static InitializerExpressionSyntax? GetInitializerNode(SyntaxNode node) 88private static SyntaxToken? GetLastTokenOfType(SyntaxNode node)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\IndentBlockFormattingRule.cs (10)
46public override void AddIndentBlockOperations(List<IndentBlockOperation> list, SyntaxNode node, in NextIndentBlockOperationAction nextOperation) 65private static void AddTypeParameterConstraintClauseOperation(List<IndentBlockOperation> list, SyntaxNode node) 74private void AddSwitchIndentationOperation(List<IndentBlockOperation> list, SyntaxNode node) 134private void AddLabelIndentationOperation(List<IndentBlockOperation> list, SyntaxNode node) 150private static void AddAlignmentBlockOperation(List<IndentBlockOperation> list, SyntaxNode node) 205private static void SetAlignmentBlockOperation(List<IndentBlockOperation> list, SyntaxNode baseNode, SyntaxNode body) 216private void AddBlockIndentationOperation(List<IndentBlockOperation> list, SyntaxNode node) 253private static void AddBracketIndentationOperation(List<IndentBlockOperation> list, SyntaxNode node) 288private static void AddEmbeddedStatementsIndentationOperation(List<IndentBlockOperation> list, SyntaxNode node)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\IndentUserSettingsFormattingRule.cs (1)
40public override void AddIndentBlockOperations(List<IndentBlockOperation> list, SyntaxNode node, in NextIndentBlockOperationAction nextOperation)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\NewLineUserSettingFormattingRule.cs (3)
40private static bool IsControlBlock(SyntaxNode node) 165var currentTokenParentParent = currentToken.Parent.Parent; 366var currentTokenParentParent = currentToken.Parent.Parent;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\QueryExpressionFormattingRule.cs (3)
42public override void AddSuppressOperations(ArrayBuilder<SuppressOperation> list, SyntaxNode node, in NextSuppressOperationAction nextOperation) 82public override void AddIndentBlockOperations(List<IndentBlockOperation> list, SyntaxNode node, in NextIndentBlockOperationAction nextOperation) 110public override void AddAnchorIndentationOperations(List<AnchorIndentationOperation> list, SyntaxNode node, in NextAnchorIndentationOperationAction nextOperation)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SpacingFormattingRule.cs (2)
561public override void AddSuppressOperations(ArrayBuilder<SuppressOperation> list, SyntaxNode node, in NextSuppressOperationAction nextOperation) 574private void SuppressVariableDeclaration(ArrayBuilder<SuppressOperation> list, SyntaxNode node)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SuppressFormattingRule.cs (10)
21public override void AddSuppressOperations(ArrayBuilder<SuppressOperation> list, SyntaxNode node, in NextSuppressOperationAction nextOperation) 36private static void AddSpecificNodesSuppressOperations(ArrayBuilder<SuppressOperation> list, SyntaxNode node) 263private static void AddStatementExceptBlockSuppressOperations(ArrayBuilder<SuppressOperation> list, SyntaxNode node) 276private static void AddFormatSuppressOperations(ArrayBuilder<SuppressOperation> list, SyntaxNode node) 315static void ProcessStructuredTrivia(ArrayBuilder<SuppressOperation> list, SyntaxNode structure) 369private static void AddInitializerSuppressOperations(ArrayBuilder<SuppressOperation> list, SyntaxNode node) 399private static void AddInitializerSuppressOperations(ArrayBuilder<SuppressOperation> list, SyntaxNode parent, IEnumerable<SyntaxNode> items) 405foreach (var item in items) 417private static InitializerExpressionSyntax? GetInitializerNode(SyntaxNode node)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\TokenBasedFormattingRule.cs (2)
203var attributeOwner = previousToken.Parent?.Parent; 248private static SyntaxList<UsingDirectiveSyntax> GetUsings(SyntaxNode node)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\WrappingFormattingRule.cs (7)
46public override void AddSuppressOperations(ArrayBuilder<SuppressOperation> list, SyntaxNode node, in NextSuppressOperationAction nextOperation) 67private static (SyntaxToken firstToken, SyntaxToken lastToken) GetSpecificNodeSuppressionTokenRange(SyntaxNode node) 92private static void AddSpecificNodesSuppressOperations(ArrayBuilder<SuppressOperation> list, SyntaxNode node) 101private static void AddStatementExceptBlockSuppressOperations(ArrayBuilder<SuppressOperation> list, SyntaxNode node) 114private static void RemoveSuppressOperationForStatementMethodDeclaration(ArrayBuilder<SuppressOperation> list, SyntaxNode node) 137private static void RemoveSuppressOperationForBlock(ArrayBuilder<SuppressOperation> list, SyntaxNode node) 158private static (SyntaxToken openBrace, SyntaxToken closeBrace) GetBracePair(SyntaxNode node)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Helpers\RemoveUnnecessaryImports\CSharpUnnecessaryImportsProvider.cs (3)
25Func<SyntaxNode, bool>? predicate, 28var root = model.SyntaxTree.GetRoot(cancellationToken); 29predicate ??= Functions<SyntaxNode>.True;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Indentation\CSharpSmartTokenFormatter.cs (1)
150public override void AddSuppressOperations(ArrayBuilder<SuppressOperation> list, SyntaxNode node, in NextSuppressOperationAction nextOperation)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\Precedence\AbstractCSharpPrecedenceService.cs (1)
13where TSyntax : SyntaxNode
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SelectedMembers\CSharpSelectedMembers.cs (4)
30protected override ImmutableArray<(SyntaxNode declarator, SyntaxToken identifier)> GetDeclaratorsAndIdentifiers(MemberDeclarationSyntax member) 35v => (declaration: (SyntaxNode)v, identifier: v.Identifier)), 37v => (declaration: (SyntaxNode)v, identifier: v.Identifier)), 38_ => [(declaration: (SyntaxNode)member, identifier: member.GetNameToken())],
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (29)
40public bool IsWrittenTo(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken) 43public bool IsOnlyWrittenTo(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken) 46public bool IsInOutContext(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken) 49public bool IsInRefContext(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken) 52public bool IsInInContext(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken) 55public bool CanReplaceWithRValue(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? expression, CancellationToken cancellationToken) 62foreach (var ancestor in token.GetAncestors<SyntaxNode>()) 112SyntaxNode oldNode, 113SyntaxNode newNode, 169public ForEachSymbols GetForEachSymbols(SemanticModel semanticModel, SyntaxNode node) 183public SymbolInfo GetCollectionInitializerSymbolInfo(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken) 186public IMethodSymbol? GetGetAwaiterMethod(SemanticModel semanticModel, SyntaxNode node) 197public ImmutableArray<IMethodSymbol> GetDeconstructionAssignmentMethods(SemanticModel semanticModel, SyntaxNode node) 209public ImmutableArray<IMethodSymbol> GetDeconstructionForEachMethods(SemanticModel semanticModel, SyntaxNode node) 234var node = syntaxRef.GetSyntax(cancellationToken); 245public IEnumerable<ISymbol> GetDeclaredSymbols(SemanticModel semanticModel, SyntaxNode memberDeclaration, CancellationToken cancellationToken) 255public IParameterSymbol? FindParameterForArgument(SemanticModel semanticModel, SyntaxNode argument, bool allowUncertainCandidates, bool allowParams, CancellationToken cancellationToken) 258public IParameterSymbol? FindParameterForAttributeArgument(SemanticModel semanticModel, SyntaxNode argument, bool allowUncertainCandidates, bool allowParams, CancellationToken cancellationToken) 262public ISymbol? FindFieldOrPropertyForArgument(SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken) 265public ISymbol? FindFieldOrPropertyForAttributeArgument(SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken) 270public ImmutableArray<ISymbol> GetBestOrAllSymbols(SemanticModel semanticModel, SyntaxNode? node, SyntaxToken token, CancellationToken cancellationToken) 292/// cref="ModelExtensions.GetSymbolInfo(SemanticModel, SyntaxNode, CancellationToken)"/>, but sometimes employs 296private ImmutableArray<ISymbol> GetSymbolInfo(SemanticModel semanticModel, SyntaxNode node, SyntaxToken token, CancellationToken cancellationToken) 368public bool IsInsideNameOfExpression(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken) 377var node = syntaxReference.GetSyntax(cancellationToken); 392public bool IsInExpressionTree(SemanticModel semanticModel, SyntaxNode node, [NotNullWhen(true)] INamedTypeSymbol? expressionType, CancellationToken cancellationToken) 395public string GenerateNameForExpression(SemanticModel semanticModel, SyntaxNode expression, bool capitalize, CancellationToken cancellationToken) 398public IPreprocessingSymbol? GetPreprocessingSymbol(SemanticModel semanticModel, SyntaxNode node) 410private static bool IsInPreprocessingSymbolContext(SyntaxNode node)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpAccessibilityFacts.cs (7)
26public bool CanHaveAccessibility(SyntaxNode declaration, bool ignoreDeclarationModifiers = false) 93public Accessibility GetAccessibility(SyntaxNode declaration) 153public static DeclarationKind GetDeclarationKind(SyntaxNode declaration) 308public static SyntaxTokenList GetModifierTokens(SyntaxNode declaration) 322public static bool ParentIsFieldDeclaration([NotNullWhen(true)] SyntaxNode? node) 325public static bool ParentIsEventFieldDeclaration([NotNullWhen(true)] SyntaxNode? node) 328public static bool ParentIsLocalDeclarationStatement([NotNullWhen(true)] SyntaxNode? node)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpBlockFacts.cs (10)
22public override bool IsScopeBlock([NotNullWhen(true)] SyntaxNode? node) 25public override bool IsExecutableBlock([NotNullWhen(true)] SyntaxNode? node) 28public override IReadOnlyList<SyntaxNode> GetExecutableBlockStatements(SyntaxNode? node) 39public override SyntaxNode? FindInnermostCommonExecutableBlock(IEnumerable<SyntaxNode> nodes) 42public override bool IsStatementContainer([NotNullWhen(true)] SyntaxNode? node) 45public override IReadOnlyList<SyntaxNode> GetStatementContainerStatements(SyntaxNode? node) 50return ImmutableArray.Create<SyntaxNode>(embeddedStatement);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpDocumentationCommentService.cs (1)
40protected override SyntaxNode GetName(XmlElementSyntax xmlElement)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpHeaderFacts.cs (18)
24public override bool IsOnTypeHeader(SyntaxNode root, int position, bool fullHeader, [NotNullWhen(true)] out SyntaxNode? typeDeclaration) 38public override bool IsOnPropertyDeclarationHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? propertyDeclaration) 51public override bool IsOnParameterHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? parameter) 64public override bool IsOnMethodHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? method) 77public override bool IsOnLocalFunctionHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? localFunction) 90public override bool IsOnLocalDeclarationHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? localDeclaration) 105public override bool IsOnIfStatementHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? ifStatement) 118public override bool IsOnWhileStatementHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? whileStatement) 131public override bool IsOnForeachHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? foreachStatement)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (311)
29private static readonly ObjectPool<List<SyntaxNode>> s_syntaxNodeListPool = new ObjectPool<List<SyntaxNode>>(() => [], trimOnFree: false); 130public bool IsDirective([NotNullWhen(true)] SyntaxNode? node) 133public bool TryGetExternalSourceInfo([NotNullWhen(true)] SyntaxNode? node, out ExternalSourceInfo info) 154public bool IsNameOfSimpleMemberAccessExpression([NotNullWhen(true)] SyntaxNode? node) 160public bool IsNameOfAnyMemberAccessExpression([NotNullWhen(true)] SyntaxNode? node) 163public bool IsNameOfMemberBindingExpression([NotNullWhen(true)] SyntaxNode? node) 170public SyntaxNode? GetStandaloneExpression(SyntaxNode? node) 173public SyntaxNode? GetRootConditionalAccessExpression(SyntaxNode? node) 176public bool IsDeclarationExpression([NotNullWhen(true)] SyntaxNode? node) 179public bool IsNamedArgument([NotNullWhen(true)] SyntaxNode? node) 182public bool IsNameOfNamedArgument([NotNullWhen(true)] SyntaxNode? node) 185public SyntaxNode? GetParameterList(SyntaxNode node) 188public bool IsParameterList([NotNullWhen(true)] SyntaxNode? node) 191public bool IsUsingDirectiveName([NotNullWhen(true)] SyntaxNode? node) 195public bool IsUsingAliasDirective([NotNullWhen(true)] SyntaxNode? node) 198public void GetPartsOfUsingAliasDirective(SyntaxNode node, out SyntaxToken globalKeyword, out SyntaxToken alias, out SyntaxNode name) 206public bool IsDeconstructionForEachStatement([NotNullWhen(true)] SyntaxNode? node) 209public bool IsDeconstructionAssignment([NotNullWhen(true)] SyntaxNode? node) 212public Location GetDeconstructionReferenceLocation(SyntaxNode node) 222public bool IsStatement([NotNullWhen(true)] SyntaxNode? node) 225public bool IsExecutableStatement([NotNullWhen(true)] SyntaxNode? node) 228public bool IsGlobalStatement([NotNullWhen(true)] SyntaxNode? node) 231public SyntaxNode GetStatementOfGlobalStatement(SyntaxNode node) 234public bool AreStatementsInSameContainer(SyntaxNode firstStatement, SyntaxNode secondStatement) 253public bool IsMethodBody([NotNullWhen(true)] SyntaxNode? node) 265public SyntaxNode GetExpressionOfRefExpression(SyntaxNode node) 268public SyntaxNode? GetExpressionOfReturnStatement(SyntaxNode node) 312public bool IsPredefinedType(SyntaxNode? node) 315public bool IsPredefinedType(SyntaxNode? node, PredefinedType type) 535public bool IsPostfixUnaryExpression([NotNullWhen(true)] SyntaxNode? node) 538public bool IsElementBindingExpression([NotNullWhen(true)] SyntaxNode? node) 541public bool IsMemberBindingExpression([NotNullWhen(true)] SyntaxNode? node) 544public bool IsPointerMemberAccessExpression([NotNullWhen(true)] SyntaxNode? node) 547public void GetNameAndArityOfSimpleName(SyntaxNode node, out string name, out int arity) 554public bool LooksGeneric(SyntaxNode simpleName) 558public SeparatedSyntaxList<SyntaxNode> GetTypeArgumentsOfGenericName(SyntaxNode? genericName) 561public SyntaxNode? GetTargetOfMemberBinding(SyntaxNode? node) 564public SyntaxNode GetNameOfMemberBindingExpression(SyntaxNode node) 567public SyntaxNode? GetExpressionOfMemberAccessExpression(SyntaxNode node, bool allowImplicitTarget) 570public void GetPartsOfElementAccessExpression(SyntaxNode node, out SyntaxNode expression, out SyntaxNode argumentList) 577public SyntaxNode GetExpressionOfInterpolation(SyntaxNode node) 580public bool IsInStaticContext(SyntaxNode node) 583public bool IsInNamespaceOrTypeContext([NotNullWhen(true)] SyntaxNode? node) 586public bool IsBaseTypeList([NotNullWhen(true)] SyntaxNode? node) 589public SyntaxNode GetExpressionOfArgument(SyntaxNode node) 592public SyntaxNode GetExpressionOfAttributeArgument(SyntaxNode node) 595public RefKind GetRefKindOfArgument(SyntaxNode node) 598public bool IsArgument([NotNullWhen(true)] SyntaxNode? node) 601public bool IsAttributeArgument([NotNullWhen(true)] SyntaxNode? node) 604public bool IsSimpleArgument([NotNullWhen(true)] SyntaxNode? node) 611public bool IsInConstantContext([NotNullWhen(true)] SyntaxNode? node) 614public bool IsInConstructor(SyntaxNode node) 617public bool IsUnsafeContext(SyntaxNode node) 620public bool IsAttributeNamedArgumentIdentifier([NotNullWhen(true)] SyntaxNode? node) 623public SyntaxNode? GetContainingTypeDeclaration(SyntaxNode root, int position) 627.GetAncestors<SyntaxNode>() 631public SyntaxNode? GetContainingVariableDeclaratorOfFieldDeclaration(SyntaxNode? node) 634public bool IsNameOfSubpattern([NotNullWhen(true)] SyntaxNode? node) 639public bool IsPropertyPatternClause(SyntaxNode node) 643[NotNullWhen(true)] SyntaxNode? node, [NotNullWhen(true)] out SyntaxNode? initializedInstance) 674public bool IsAnyInitializerExpression([NotNullWhen(true)] SyntaxNode? node, [NotNullWhen(true)] out SyntaxNode? creationExpression) 689public bool IsElementAccessExpression(SyntaxNode? node) 693public SyntaxNode? ConvertToSingleLine(SyntaxNode? node, bool useElasticTrivia = false) 696public SyntaxNode? GetContainingMemberDeclaration(SyntaxNode root, int position, bool useFullSpan = true) 699public SyntaxNode? GetContainingMethodDeclaration(SyntaxNode root, int position, bool useFullSpan = true) 702private static SyntaxNode? GetContainingMemberDeclaration<TMemberDeclarationSyntax>(SyntaxNode root, int position, bool useFullSpan = true) 715var node = root.FindToken(position).Parent; 733public bool IsMethodLevelMember([NotNullWhen(true)] SyntaxNode? node) 741public bool IsTopLevelNodeWithMembers([NotNullWhen(true)] SyntaxNode? node) 750public string GetDisplayName(SyntaxNode? node, DisplayNameOptions options, string? rootNamespace = null) 812private static string? GetName(SyntaxNode node, DisplayNameOptions options) 899public PooledObject<List<SyntaxNode>> GetTopLevelAndMethodLevelMembers(SyntaxNode? root) 909public PooledObject<List<SyntaxNode>> GetMethodLevelMembers(SyntaxNode? root) 919public SyntaxList<SyntaxNode> GetMembersOfTypeDeclaration(SyntaxNode typeDeclaration) 922private void AppendMembers(SyntaxNode? node, List<SyntaxNode> list, bool topLevel, bool methodLevel) 946public TextSpan GetMemberBodySpanForSpeculativeBinding(SyntaxNode node) 953var member = GetContainingMemberDeclaration(node, node.SpanStart); 973public bool ContainsInMemberBody([NotNullWhen(true)] SyntaxNode? node, TextSpan span) 996public SyntaxNode? TryGetBindableParent(SyntaxToken token) 998var node = token.Parent; 1001var parent = node.Parent; 1070public IEnumerable<SyntaxNode> GetConstructors(SyntaxNode? root, CancellationToken cancellationToken) 1075var constructors = new List<SyntaxNode>(); 1080private static void AppendConstructors(SyntaxList<MemberDeclarationSyntax> members, List<SyntaxNode> constructors, CancellationToken cancellationToken) 1144public string GetNameForArgument(SyntaxNode? argument) 1147public string GetNameForAttributeArgument(SyntaxNode? argument) 1150public bool IsLeftSideOfDot([NotNullWhen(true)] SyntaxNode? node) 1153public SyntaxNode? GetRightSideOfDot(SyntaxNode? node) 1159public SyntaxNode? GetLeftSideOfDot(SyntaxNode? node, bool allowImplicitTarget) 1165public bool IsLeftSideOfExplicitInterfaceSpecifier([NotNullWhen(true)] SyntaxNode? node) 1168public bool IsLeftSideOfAssignment([NotNullWhen(true)] SyntaxNode? node) 1171public bool IsLeftSideOfAnyAssignment([NotNullWhen(true)] SyntaxNode? node) 1174public bool IsLeftSideOfCompoundAssignment([NotNullWhen(true)] SyntaxNode? node) 1177public SyntaxNode GetRightHandSideOfAssignment(SyntaxNode node) 1180public bool IsInferredAnonymousObjectMemberDeclarator([NotNullWhen(true)] SyntaxNode? node) 1184public bool IsOperandOfIncrementExpression([NotNullWhen(true)] SyntaxNode? node) 1187public static bool IsOperandOfDecrementExpression([NotNullWhen(true)] SyntaxNode? node) 1190public bool IsOperandOfIncrementOrDecrementExpression([NotNullWhen(true)] SyntaxNode? node) 1193public SyntaxList<SyntaxNode> GetContentsOfInterpolatedString(SyntaxNode interpolatedString) 1202public SeparatedSyntaxList<SyntaxNode> GetArgumentsOfObjectCreationExpression(SyntaxNode objectCreationExpression) 1207public SeparatedSyntaxList<SyntaxNode> GetArgumentsOfArgumentList(SyntaxNode argumentList) 1210public SeparatedSyntaxList<SyntaxNode> GetArgumentsOfAttributeArgumentList(SyntaxNode argumentList) 1222public bool IsPragmaDirective(SyntaxTrivia trivia, out bool isDisable, out bool isActive, out SeparatedSyntaxList<SyntaxNode> errorCodes) 1228public bool IsDocumentationComment(SyntaxNode node) 1231public bool IsUsingOrExternOrImport([NotNullWhen(true)] SyntaxNode? node) 1234public bool IsGlobalAssemblyAttribute([NotNullWhen(true)] SyntaxNode? node) 1237public bool IsGlobalModuleAttribute([NotNullWhen(true)] SyntaxNode? node) 1240private static bool IsGlobalAttribute([NotNullWhen(true)] SyntaxNode? node, SyntaxKind attributeTarget) 1245public bool IsDeclaration(SyntaxNode? node) 1294public bool IsTypeDeclaration(SyntaxNode node) 1297public bool IsSimpleAssignmentStatement([NotNullWhen(true)] SyntaxNode? statement) 1302SyntaxNode statement, out SyntaxNode left, out SyntaxToken operatorToken, out SyntaxNode right) 1309SyntaxNode statement, out SyntaxNode left, out SyntaxToken operatorToken, out SyntaxNode right) 1311var expression = statement; 1324public bool IsAnyAssignmentStatement([NotNullWhen(true)] SyntaxNode? node) 1327public SyntaxToken GetIdentifierOfSimpleName(SyntaxNode node) 1330public SyntaxToken GetIdentifierOfVariableDeclarator(SyntaxNode node) 1333public SyntaxToken GetIdentifierOfTypeDeclaration(SyntaxNode node) 1341public bool IsDeclaratorOfLocalDeclarationStatement(SyntaxNode declarator, SyntaxNode localDeclarationStatement) 1348public bool AreEquivalent(SyntaxNode? node1, SyntaxNode? node2) 1351public static SyntaxNode GetExpressionOfInvocationExpression(SyntaxNode node) 1354public bool IsExpressionOfForeach([NotNullWhen(true)] SyntaxNode? node) 1357public SyntaxNode GetExpressionOfExpressionStatement(SyntaxNode node) 1360public void GetPartsOfTupleExpression<TArgumentSyntax>(SyntaxNode node, 1361out SyntaxToken openParen, out SeparatedSyntaxList<TArgumentSyntax> arguments, out SyntaxToken closeParen) where TArgumentSyntax : SyntaxNode 1365arguments = (SeparatedSyntaxList<TArgumentSyntax>)(SeparatedSyntaxList<SyntaxNode>)tupleExpression.Arguments; 1375public SyntaxTokenList GetModifiers(SyntaxNode? node) 1379public SyntaxNode? WithModifiers(SyntaxNode? node, SyntaxTokenList modifiers) 1382public SeparatedSyntaxList<SyntaxNode> GetVariablesOfLocalDeclarationStatement(SyntaxNode node) 1385public SyntaxNode? GetInitializerOfVariableDeclarator(SyntaxNode node) 1388public SyntaxNode? GetInitializerOfPropertyDeclaration(SyntaxNode node) 1391public SyntaxNode GetTypeOfVariableDeclarator(SyntaxNode node) 1394public SyntaxNode GetValueOfEqualsValueClause(SyntaxNode node) 1397public bool IsEqualsValueOfPropertyDeclaration(SyntaxNode? node) 1400public bool IsConversionExpression([NotNullWhen(true)] SyntaxNode? node) 1403public bool IsCastExpression([NotNullWhen(true)] SyntaxNode? node) 1406public void GetPartsOfCastExpression(SyntaxNode node, out SyntaxNode type, out SyntaxNode expression) 1423public SyntaxList<SyntaxNode> GetAttributeLists(SyntaxNode? node) 1426public bool IsParameterNameXmlElementSyntax([NotNullWhen(true)] SyntaxNode? node) 1430public SyntaxList<SyntaxNode> GetContentFromDocumentationCommentTriviaSyntax(SyntaxTrivia trivia) 1440public void GetPartsOfAnyIsTypeExpression(SyntaxNode node, out SyntaxNode expression, out SyntaxNode type) 1447public void GetPartsOfIsPatternExpression(SyntaxNode node, out SyntaxNode left, out SyntaxToken isToken, out SyntaxNode right) 1455public bool IsAnyPattern([NotNullWhen(true)] SyntaxNode? node) 1458public SyntaxNode GetExpressionOfConstantPattern(SyntaxNode node) 1461public void GetPartsOfDeclarationPattern(SyntaxNode node, out SyntaxNode type, out SyntaxNode designation) 1468public void GetPartsOfRecursivePattern(SyntaxNode node, out SyntaxNode? type, out SyntaxNode? positionalPart, out SyntaxNode? propertyPart, out SyntaxNode? designation) 1484public bool IsBinaryPattern([NotNullWhen(true)] SyntaxNode? node) 1487public bool IsUnaryPattern([NotNullWhen(true)] SyntaxNode? node) 1490public void GetPartsOfParenthesizedPattern(SyntaxNode node, out SyntaxToken openParen, out SyntaxNode pattern, out SyntaxToken closeParen) 1498public void GetPartsOfBinaryPattern(SyntaxNode node, out SyntaxNode left, out SyntaxToken operatorToken, out SyntaxNode right) 1506public void GetPartsOfUnaryPattern(SyntaxNode node, out SyntaxToken operatorToken, out SyntaxNode pattern) 1513public void GetPartsOfRelationalPattern(SyntaxNode node, out SyntaxToken operatorToken, out SyntaxNode expression) 1520public SyntaxNode GetTypeOfTypePattern(SyntaxNode node) 1523public bool IsVerbatimInterpolatedStringExpression([NotNullWhen(true)] SyntaxNode? node) 1538public bool IsAnonymousFunctionExpression([NotNullWhen(true)] SyntaxNode? node) 1541public bool IsBaseNamespaceDeclaration([NotNullWhen(true)] SyntaxNode? node) 1544public bool IsBinaryExpression([NotNullWhen(true)] SyntaxNode? node) 1547public bool IsLiteralExpression([NotNullWhen(true)] SyntaxNode? node) 1550public bool IsMemberAccessExpression([NotNullWhen(true)] SyntaxNode? node) 1553public bool IsMethodDeclaration([NotNullWhen(true)] SyntaxNode? node) 1556public bool IsSimpleName([NotNullWhen(true)] SyntaxNode? node) 1559public bool IsAnyName([NotNullWhen(true)] SyntaxNode? node) 1562public bool IsAnyType([NotNullWhen(true)] SyntaxNode? node) 1565public bool IsNamedMemberInitializer([NotNullWhen(true)] SyntaxNode? node) 1568public bool IsElementAccessInitializer([NotNullWhen(true)] SyntaxNode? node) 1571public bool IsObjectMemberInitializer([NotNullWhen(true)] SyntaxNode? node) 1574public bool IsObjectCollectionInitializer([NotNullWhen(true)] SyntaxNode? node) 1581public void GetPartsOfArgumentList(SyntaxNode node, out SyntaxToken openParenToken, out SeparatedSyntaxList<SyntaxNode> arguments, out SyntaxToken closeParenToken) 1589public void GetPartsOfAttribute(SyntaxNode node, out SyntaxNode name, out SyntaxNode? argumentList) 1596public void GetPartsOfBaseObjectCreationExpression(SyntaxNode node, out SyntaxNode? argumentList, out SyntaxNode? initializer) 1603public void GetPartsOfBinaryExpression(SyntaxNode node, out SyntaxNode left, out SyntaxToken operatorToken, out SyntaxNode right) 1611public void GetPartsOfCompilationUnit(SyntaxNode node, out SyntaxList<SyntaxNode> imports, out SyntaxList<SyntaxNode> attributeLists, out SyntaxList<SyntaxNode> members) 1620SyntaxNode node, out SyntaxNode expression, out SyntaxToken operatorToken, out SyntaxNode whenNotNull) 1628public void GetPartsOfConditionalExpression(SyntaxNode node, out SyntaxNode condition, out SyntaxNode whenTrue, out SyntaxNode whenFalse) 1636public SyntaxNode GetExpressionOfForeachStatement(SyntaxNode statement) 1642public void GetPartsOfGenericName(SyntaxNode node, out SyntaxToken identifier, out SeparatedSyntaxList<SyntaxNode> typeArguments) 1649public void GetPartsOfInterpolationExpression(SyntaxNode node, 1650out SyntaxToken stringStartToken, out SyntaxList<SyntaxNode> contents, out SyntaxToken stringEndToken) 1658public void GetPartsOfInvocationExpression(SyntaxNode node, out SyntaxNode expression, out SyntaxNode? argumentList) 1665public void GetPartsOfMemberAccessExpression(SyntaxNode node, out SyntaxNode expression, out SyntaxToken operatorToken, out SyntaxNode name) 1673public void GetPartsOfBaseNamespaceDeclaration(SyntaxNode node, out SyntaxNode name, out SyntaxList<SyntaxNode> imports, out SyntaxList<SyntaxNode> members) 1681public void GetPartsOfNamedMemberInitializer(SyntaxNode node, out SyntaxNode identifier, out SyntaxNode expression) 1688public void GetPartsOfObjectCreationExpression(SyntaxNode node, out SyntaxToken keyword, out SyntaxNode type, out SyntaxNode? argumentList, out SyntaxNode? initializer) 1697public void GetPartsOfImplicitObjectCreationExpression(SyntaxNode node, out SyntaxToken keyword, out SyntaxNode argumentList, out SyntaxNode? initializer) 1705public void GetPartsOfParameter(SyntaxNode node, out SyntaxToken identifier, out SyntaxNode? @default) 1713SyntaxNode node, out SyntaxToken openParen, out SyntaxNode expression, out SyntaxToken closeParen) 1721public void GetPartsOfPrefixUnaryExpression(SyntaxNode node, out SyntaxToken operatorToken, out SyntaxNode operand) 1728public void GetPartsOfQualifiedName(SyntaxNode node, out SyntaxNode left, out SyntaxToken operatorToken, out SyntaxNode right) 1740public SyntaxNode GetArgumentListOfImplicitElementAccess(SyntaxNode node) 1743public SeparatedSyntaxList<SyntaxNode> GetAttributesOfAttributeList(SyntaxNode node) 1746public SyntaxNode GetExpressionOfAwaitExpression(SyntaxNode node) 1749public SyntaxNode GetExpressionOfThrowExpression(SyntaxNode node) 1752public SyntaxNode? GetExpressionOfThrowStatement(SyntaxNode node) 1755public SeparatedSyntaxList<SyntaxNode> GetInitializersOfObjectMemberInitializer(SyntaxNode node) 1758public SeparatedSyntaxList<SyntaxNode> GetExpressionsOfObjectCollectionInitializer(SyntaxNode node) 1761public SyntaxToken GetTokenOfLiteralExpression(SyntaxNode node)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (5)
958private static bool IsExplicitCast(SyntaxNode node) 1097for (SyntaxNode? current = expression; current != null; current = current.Parent) 1112for (SyntaxNode? currentOld = castNode.WalkUpParentheses().Parent, currentNew = rewrittenExpression.WalkUpParentheses().Parent; 1168for (SyntaxNode? currentOld = castNode.WalkUpParentheses().Parent, currentNew = rewrittenExpression.WalkUpParentheses().Parent; 1198for (SyntaxNode? currentOld = castNode.WalkUpParentheses().Parent, currentNew = rewrittenExpression.WalkUpParentheses().Parent;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\FormattingRangeHelper.cs (13)
90var parent = endToken.Parent; 114var parent = endToken.Parent; 150var container = GetTopContainingNode(parent); 171var parent = endToken.Parent; 187var containerOfList = parent.Parent; 203var parentOfParent = parent.Parent; 231var containerOfBlock = GetTopContainingNode(parent); 271var parent = endToken.Parent; 339var labelNode = previousToken.Parent.Parent; 354private static bool IsSpecialContainingNode(SyntaxNode node) 380private static SyntaxNode? GetTopContainingNode([DisallowNull] SyntaxNode? node) 390var lastSpecialContainingNode = node;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (19)
71protected override SyntaxNode GetSemanticRootForSpeculation(ExpressionSyntax expression) 75SyntaxNode previousNode = null; 76SyntaxNode parentNodeToSpeculate = null; 77foreach (var node in expression.AncestorsAndSelf(ascendOutOfTrivia: false)) 95public static bool CanSpeculateOnNode(SyntaxNode node) 104protected override void ValidateSpeculativeSemanticModel(SemanticModel speculativeSemanticModel, SyntaxNode nodeToSpeculate) 113protected override SemanticModel CreateSpeculativeSemanticModel(SyntaxNode originalNode, SyntaxNode nodeToSpeculate, SemanticModel semanticModel) 116public static SemanticModel CreateSpeculativeSemanticModelForNode(SyntaxNode originalNode, SyntaxNode nodeToSpeculate, SemanticModel semanticModel) 123public static SemanticModel CreateSpeculativeSemanticModelForNode(SyntaxNode nodeToSpeculate, SemanticModel semanticModel, int position, bool isInNamespaceOrTypeContext) 196SyntaxNode originalLambdaBody, replacedLambdaBody; 275SyntaxNode originalRoot) 295protected override bool ReplacementChangesSemanticsForNodeLanguageSpecific(SyntaxNode currentOriginalNode, SyntaxNode currentReplacedNode, SyntaxNode previousOriginalNode, SyntaxNode previousReplacedNode) 580protected override bool ExpressionMightReferenceMember(SyntaxNode node) 662protected override bool IsParenthesizedExpression(SyntaxNode node)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpTypeStyleHelper.cs (2)
62if (typeName?.FirstAncestorOrSelf<SyntaxNode>(a => a.Kind() is SyntaxKind.DeclarationExpression or SyntaxKind.VariableDeclaration or SyntaxKind.ForEachStatement) is not { } declaration) 82internal TypeSyntax? FindAnalyzableType(SyntaxNode node, SemanticModel semanticModel, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpTypeStyleHelper.State.cs (4)
31SyntaxNode declaration, SemanticModel semanticModel, 92private static bool IsPredefinedTypeInDeclaration(SyntaxNode declarationStatement, SemanticModel semanticModel) 131private static bool IsInferredPredefinedType(SyntaxNode declarationStatement, SemanticModel semanticModel) 140private static TypeSyntax? GetTypeSyntaxFromDeclaration(SyntaxNode declarationStatement)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (3)
191var root = tree.GetRoot(cancellationToken); 197var newRoot = root.ReplaceNode( 204var newDeclarationTypeNode = newTree.GetRoot(cancellationToken).GetAnnotatedNodes(annotation).Single();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\UsingsAndExternAliasesDirectiveComparer.cs (5)
12internal class UsingsAndExternAliasesDirectiveComparer : IComparer<SyntaxNode?> 14public static readonly IComparer<SyntaxNode> NormalInstance = new UsingsAndExternAliasesDirectiveComparer( 18public static readonly IComparer<SyntaxNode> SystemFirstInstance = new UsingsAndExternAliasesDirectiveComparer( 79public int Compare(SyntaxNode? directive1, SyntaxNode? directive2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\UsingsAndExternAliasesOrganizer.cs (6)
108var initialList = usingList.Cast<SyntaxNode>() 150private static void EnsureNewLines(IList<SyntaxNode> list, SyntaxTrivia newLineTrivia) 156var node = list[i]; 169var node = list[i]; 176private static SyntaxNode TrimLeadingNewLines(SyntaxNode node)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ArgumentGenerator.cs (3)
13public static ArgumentSyntax GenerateArgument(SyntaxNode argument) 23public static ArgumentListSyntax GenerateArgumentList(IList<SyntaxNode> arguments) 26public static BracketedArgumentListSyntax GenerateBracketedArgumentList(IList<SyntaxNode> arguments)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ConstructorGenerator.cs (1)
104private static ArgumentListSyntax GenerateArgumentList(ImmutableArray<SyntaxNode> arguments)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationHelpers.cs (7)
176where TDeclaration : SyntaxNode 194private static bool AreBracesMissing<TDeclaration>(TDeclaration declaration) where TDeclaration : SyntaxNode 197public static SyntaxNode? GetContextNode( 226public static CodeGenerationDestination GetDestination(SyntaxNode destination) 251where TSyntaxNode : SyntaxNode 269public static T? GetReuseableSyntaxNodeForSymbol<T>(ISymbol symbol, CSharpCodeGenerationContextInfo info) where T : SyntaxNode 275var reusableSyntaxNode = symbol.DeclaringSyntaxReferences[0].GetSyntax();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (23)
40public override CodeGenerationDestination GetDestination(SyntaxNode node) 43protected override IComparer<SyntaxNode> GetMemberComparer() 46protected override IList<bool>? GetAvailableInsertionIndices(SyntaxNode destination, CancellationToken cancellationToken) 311var finalMember = editor.GetChangedRoot(); 341protected override TDeclarationNode AddMembers<TDeclarationNode>(TDeclarationNode destination, IEnumerable<SyntaxNode> members) 375var attributeSyntaxToRemove = attributeToRemove.ApplicationSyntaxReference.GetSyntax(cancellationToken); 381SyntaxNode attributeToRemove, 441SyntaxNode attributeToRemove, 477IEnumerable<SyntaxNode> statements, 529IEnumerable<SyntaxNode> statements, 531CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode 568TDeclarationNode destinationMember, IEnumerable<SyntaxNode> statements, BaseMethodDeclarationSyntax baseMethodDeclaration) where TDeclarationNode : SyntaxNode 589TDeclarationNode destinationMember, IEnumerable<SyntaxNode> statements, LocalFunctionStatementSyntax localFunctionStatement) where TDeclarationNode : SyntaxNode 610TDeclarationNode destinationMember, IEnumerable<SyntaxNode> statements, AnonymousFunctionExpressionSyntax anonymousFunctionSyntax) where TDeclarationNode : SyntaxNode 634public override SyntaxNode CreateEventDeclaration( 640public override SyntaxNode CreateFieldDeclaration(IFieldSymbol field, CodeGenerationDestination destination, CSharpCodeGenerationContextInfo info, CancellationToken cancellationToken) 648public override SyntaxNode? CreateMethodDeclaration( 697public override SyntaxNode CreatePropertyDeclaration( 704public override SyntaxNode CreateNamedTypeDeclaration( 710public override SyntaxNode CreateNamespaceDeclaration(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpDeclarationComparer.cs (7)
13internal class CSharpDeclarationComparer : IComparer<SyntaxNode> 71public int Compare(SyntaxNode? x, SyntaxNode? y) 314private static int GetAccessibilityPrecedence(SyntaxTokenList modifiers, SyntaxNode? parent) 345for (var node = parent; node != null; node = node.Parent) 386private static bool EqualAccessibility(SyntaxNode x, SyntaxTokenList xModifiers, SyntaxNode y, SyntaxTokenList yModifiers, out int comparisonResult)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpFlagsEnumGenerator.cs (1)
19protected override SyntaxNode CreateExplicitlyCastedLiteralValue(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\NamespaceGenerator.cs (12)
32var declaration = GenerateNamespaceDeclaration( 52var declaration = GenerateNamespaceDeclaration( 66internal static SyntaxNode GenerateNamespaceDeclaration( 75var declaration = GetDeclarationSyntaxWithoutMembers( 85public static SyntaxNode UpdateCompilationUnitOrNamespaceDeclaration( 87SyntaxNode declaration, 97private static SyntaxNode GenerateNamespaceDeclarationWorker( 118private static SyntaxNode GetDeclarationSyntaxWithoutMembers( 125var reusableSyntax = GetReuseableSyntaxNodeForSymbol<SyntaxNode>(@namespace, info); 131private static SyntaxNode RemoveAllMembers(SyntaxNode declaration)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\StatementGenerator.cs (1)
15internal static SyntaxList<StatementSyntax> GenerateStatements(IEnumerable<SyntaxNode> statements)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeRefactorings\CSharpRefactoringHelpersService.cs (5)
29public override bool IsBetweenTypeMembers(SourceText sourceText, SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? typeDeclaration) 75protected override IEnumerable<SyntaxNode> ExtractNodesSimple(SyntaxNode? node, ISyntaxFactsService syntaxFacts) 97var declaration = declarator.Parent;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Editing\CSharpImportAdder.cs (7)
28protected override INamespaceSymbol? GetExplicitNamespaceSymbol(SyntaxNode node, SemanticModel model) 43SyntaxNode container, 128public async Task AddPotentiallyConflictingImportsAsync(SyntaxNode container, HashSet<INamespaceSymbol> conflicts, CancellationToken cancellationToken) 130using var _ = ArrayBuilder<SyntaxNode>.GetInstance(out var nodes); 158private void CollectInfoFromContainer(SyntaxNode container, ArrayBuilder<SyntaxNode> nodes, out bool containsAnonymousMethods) 162foreach (var node in container.DescendantNodesAndSelf())
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\CompilationUnitSyntaxExtensions.cs (3)
21public static bool CanAddUsingDirectives(this SyntaxNode contextNode, bool allowInHiddenRegions, CancellationToken cancellationToken) 82SyntaxNode contextNode, 92SyntaxNode contextNode,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\CSharpSyntaxContext.cs (1)
493foreach (var node in leftToken.GetAncestors<SyntaxNode>())
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (6)
162var parent = token.Parent; 180var container = token.Parent.Parent; 261var container = token.Parent.Parent; 454var owner = targetToken.Parent.Parent.Parent.Parent; 527where TMemberNode : SyntaxNode 614private static bool IsGenericInterfaceOrDelegateTypeParameterList([NotNullWhen(true)] SyntaxNode? node)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (10)
89var parent = token.Parent; 228var container = token.Parent.Parent?.Parent; 519var container = token.Parent?.Parent?.Parent; 1260SyntaxNode? parent; 1543SyntaxNode? node = leftToken.Parent as ExpressionSyntax; 1563private static SyntaxToken FindTokenOnLeftOfNode(SyntaxNode node) 1651var outer = UnwrapPossibleTuple(leftToken.Parent!); 1669private static SyntaxNode UnwrapPossibleTuple(SyntaxNode node) 1797var parent = token.Parent;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.cs (2)
123var root = await semanticModel.SyntaxTree.GetRootAsync(cancellationToken).ConfigureAwait(false); 143private static IEnumerable<UsingDirectiveSyntax> GetApplicableUsings(int position, SyntaxNode root)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\QueryExpressionSyntaxExtensions.cs (6)
13public static IList<SyntaxNode> GetAllClauses(this QueryExpressionSyntax query) 15var result = new List<SyntaxNode> 24public static IList<SyntaxNode> GetAllClauses(this QueryBodySyntax body) 26var result = new List<SyntaxNode>(); 34IList<SyntaxNode> allClauses) 42IEnumerable<SyntaxNode> allClauses)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\SeparatedSyntaxListExtensions.cs (2)
13where T : SyntaxNode 20where T : SyntaxNode
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\TypeDeclarationSyntaxExtensions.cs (1)
55private static SyntaxToken GetEndToken(SyntaxNode node)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Indentation\CSharpIndentationService.cs (3)
117public override void AddIndentBlockOperations(List<IndentBlockOperation> list, SyntaxNode node, in NextIndentBlockOperationAction nextOperation) 173private static void ReplaceCaseIndentationRules(List<IndentBlockOperation> list, SyntaxNode node) 194private static void AddIndentBlockOperations(List<IndentBlockOperation> list, SyntaxNode node)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Indentation\CSharpIndentationService.Indenter.cs (8)
226var embeddedStatementOwner = token.Parent.Parent; 270var nonTerminalNode = token.Parent; 283var nonTerminalNode = token.Parent; 335Indenter indenter, SeparatedSyntaxList<T> list, SyntaxToken token) where T : SyntaxNode 375var queryExpressionClause = GetQueryExpressionClause(token); 431private static SyntaxNode? GetQueryExpressionClause(SyntaxToken token) 433var clause = token.GetAncestors<SyntaxNode>().FirstOrDefault(n => n is QueryClauseSyntax or SelectOrGroupClauseSyntax); 478var nonExpressionNode = token.GetAncestors<SyntaxNode>().FirstOrDefault(n => n is StatementSyntax);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpAddImportsService.cs (27)
40protected override ImmutableArray<SyntaxNode> GetGlobalImports(Compilation compilation, SyntaxGenerator generator) 43protected override SyntaxNode? GetAlias(UsingDirectiveSyntax usingOrAlias) 49protected override SyntaxNode Rewrite( 54SyntaxNode externContainer, 55SyntaxNode usingContainer, 56SyntaxNode staticUsingContainer, 57SyntaxNode aliasContainer, 59SyntaxNode root, 67var newRoot = rewriter.Visit(root); 71protected override SyntaxList<UsingDirectiveSyntax> GetUsingsAndAliases(SyntaxNode node) 79protected override SyntaxList<ExternAliasDirectiveSyntax> GetExterns(SyntaxNode node) 87protected override bool IsEquivalentImport(SyntaxNode a, SyntaxNode b) 94private readonly SyntaxNode _externContainer; 95private readonly SyntaxNode _usingContainer; 96private readonly SyntaxNode _aliasContainer; 97private readonly SyntaxNode _staticUsingContainer; 108SyntaxNode externContainer, 109SyntaxNode usingContainer, 110SyntaxNode aliasContainer, 111SyntaxNode staticUsingContainer, 128public override SyntaxNode? Visit(SyntaxNode? node) 131public override SyntaxNode VisitNamespaceDeclaration(NamespaceDeclarationSyntax node) 134public override SyntaxNode? VisitFileScopedNamespaceDeclaration(FileScopedNamespaceDeclarationSyntax node) 137private SyntaxNode VisitBaseNamespaceDeclaration( 171public override SyntaxNode VisitCompilationUnit(CompilationUnitSyntax node)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpMoveDeclarationNearReferenceService.cs (5)
32protected override bool IsMeaningfulBlock(SyntaxNode node) 43protected override SyntaxNode GetVariableDeclaratorSymbolNode(VariableDeclaratorSyntax variableDeclarator) 55SyntaxNode right, CancellationToken cancellationToken) 69protected override bool CanMoveToBlock(ILocalSymbol localSymbol, SyntaxNode currentBlock, SyntaxNode destinationBlock)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpRemoveUnnecessaryImportsService.cs (4)
42Func<SyntaxNode, bool>? predicate, 45predicate ??= Functions<SyntaxNode>.True; 66var formattedRoot = SyntaxFormatting.GetFormattingResult(newRoot, spansToFormat, formattingOptions, rules: default, cancellationToken).GetFormattedRoot(cancellationToken); 96private static int GetEndPosition(SyntaxNode container, SyntaxList<MemberDeclarationSyntax> list)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpRemoveUnnecessaryImportsService.Rewriter.cs (12)
37public override SyntaxNode DefaultVisit(SyntaxNode node) 147public override SyntaxNode VisitCompilationUnit(CompilationUnitSyntax node) 195public override SyntaxNode VisitFileScopedNamespaceDeclaration(FileScopedNamespaceDeclarationSyntax node) 198public override SyntaxNode VisitNamespaceDeclaration(NamespaceDeclarationSyntax node) 201private SyntaxNode VisitBaseNamespaceDeclaration( 247public override SyntaxNode VisitClassDeclaration(ClassDeclarationSyntax node) 253public override SyntaxNode VisitDelegateDeclaration(DelegateDeclarationSyntax node) 259public override SyntaxNode VisitEnumDeclaration(EnumDeclarationSyntax node) 265public override SyntaxNode VisitInterfaceDeclaration(InterfaceDeclarationSyntax node) 271public override SyntaxNode VisitRecordDeclaration(RecordDeclarationSyntax node) 277public override SyntaxNode VisitStructDeclaration(StructDeclarationSyntax node)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpReplaceDiscardDeclarationsWithAssignmentsService.cs (3)
38public async Task<SyntaxNode> ReplaceAsync( 40SyntaxNode memberDeclaration, 45foreach (var child in memberDeclaration.DescendantNodes())
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSemanticFactsService.cs (5)
40protected override IEnumerable<ISymbol> GetCollidableSymbols(SemanticModel semanticModel, SyntaxNode location, SyntaxNode container, CancellationToken cancellationToken) 66bool ShouldDescendInto(SyntaxNode node) 117public CommonConversion ClassifyConversion(SemanticModel semanticModel, SyntaxNode expression, ITypeSymbol destination) 122public IMethodSymbol? TryGetDisposeMethod(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSyntaxFactsService.cs (9)
41SyntaxNode root, TContextNode contextNode, 42out SyntaxNode newRoot, out TContextNode newContextNode) where TContextNode : SyntaxNode 50private readonly SyntaxNode _contextNode; 54public AddFirstMissingCloseBraceRewriter(SyntaxNode contextNode) 57public override SyntaxNode Visit(SyntaxNode node) 69var rewritten = base.Visit(node); 116public Task<ImmutableArray<SyntaxNode>> GetSelectedFieldsAndPropertiesAsync(SyntaxTree tree, TextSpan textSpan, bool allowPartialSelection, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSyntaxGeneratorInternal.cs (68)
54public override SyntaxNode LocalDeclarationStatement(SyntaxNode? type, SyntaxToken name, SyntaxNode? initializer, bool isConst) 61public override SyntaxNode WithInitializer(SyntaxNode variableDeclarator, SyntaxNode initializer) 64public override SyntaxNode EqualsValueClause(SyntaxToken operatorToken, SyntaxNode value) 67internal static VariableDeclarationSyntax VariableDeclaration(SyntaxNode? type, SyntaxToken name, SyntaxNode? expression) 79public override SyntaxNode ConditionalAccessExpression(SyntaxNode expression, SyntaxNode whenNotNull) 82public override SyntaxNode MemberBindingExpression(SyntaxNode name) 85public override SyntaxNode RefExpression(SyntaxNode expression) 88public override SyntaxNode AddParentheses(SyntaxNode expressionOrPattern, bool includeElasticTrivia = true, bool addSimplifierAnnotation = true) 91internal static SyntaxNode Parenthesize(SyntaxNode expressionOrPattern, bool includeElasticTrivia = true, bool addSimplifierAnnotation = true) 99public override SyntaxNode YieldReturnStatement(SyntaxNode expression) 108public override SyntaxNode InterpolatedStringExpression(SyntaxToken startToken, IEnumerable<SyntaxNode> content, SyntaxToken endToken) 111public override SyntaxNode InterpolatedStringText(SyntaxToken textToken) 121public override SyntaxNode Interpolation(SyntaxNode syntaxNode) 124public override SyntaxNode InterpolationAlignmentClause(SyntaxNode alignment) 127public override SyntaxNode InterpolationFormatClause(string format) 132public override SyntaxNode TypeParameterList(IEnumerable<string> typeParameterNames) 150public override SyntaxNode Type(ITypeSymbol typeSymbol, bool typeContext) 153public override SyntaxNode NegateEquality(SyntaxGenerator generator, SyntaxNode binaryExpression, SyntaxNode left, BinaryOperatorKind negatedKind, SyntaxNode right) 161public override SyntaxNode IsNotTypeExpression(SyntaxNode expression, SyntaxNode type) 169public override SyntaxNode IsPatternExpression(SyntaxNode expression, SyntaxToken isKeyword, SyntaxNode pattern) 175public override SyntaxNode AndPattern(SyntaxNode left, SyntaxNode right) 178public override SyntaxNode ConstantPattern(SyntaxNode expression) 181public override SyntaxNode DeclarationPattern(INamedTypeSymbol type, string name) 186public override SyntaxNode LessThanRelationalPattern(SyntaxNode expression) 189public override SyntaxNode LessThanEqualsRelationalPattern(SyntaxNode expression) 192public override SyntaxNode GreaterThanRelationalPattern(SyntaxNode expression) 195public override SyntaxNode GreaterThanEqualsRelationalPattern(SyntaxNode expression) 198public override SyntaxNode NotPattern(SyntaxNode pattern) 201public override SyntaxNode OrPattern(SyntaxNode left, SyntaxNode right) 204public override SyntaxNode ParenthesizedPattern(SyntaxNode pattern) 207public override SyntaxNode TypePattern(SyntaxNode type) 210public override SyntaxNode UnaryPattern(SyntaxToken operatorToken, SyntaxNode pattern)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (17)
41protected override IEnumerable<TypeInferenceInfo> GetTypes_DoNotCallDirectly(SyntaxNode node, bool objectAsDefault) 52private static bool DecomposeBinaryOrAssignmentExpression(SyntaxNode node, out SyntaxToken operatorToken, out ExpressionSyntax left, out ExpressionSyntax right) 75private IEnumerable<TypeInferenceInfo> GetTypesComplex(SyntaxNode node) 93private IEnumerable<TypeInferenceInfo> GetTypesSimple(SyntaxNode node) 125SyntaxNode node) 134var parent = node.Parent; 1450SyntaxNode child) 1500SyntaxNode child) 1805SyntaxNode node) 1971var declaration = yieldStatement.FirstAncestorOrSelf<SyntaxNode>(n => n.IsReturnableConstruct()); 2012var ancestor = returnStatement.FirstAncestorOrSelf<SyntaxNode>(n => n.IsReturnableConstruct()); 2022private IEnumerable<TypeInferenceInfo> InferTypeInMethodLikeDeclaration(SyntaxNode declaration) 2035private ISymbol GetDeclaredMemberSymbolFromOriginalSemanticModel(SyntaxNode declarationInCurrentTree) 2191private ImmutableArray<TypeInferenceInfo> InferTypeBasedOnLaterUsage(ISymbol symbol, SyntaxNode afterNode) 2195var container = afterNode.AncestorsAndSelf().FirstOrDefault(a => a is BlockSyntax or SwitchSectionSyntax);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Utilities\CSharpSimplificationHelpers.cs (3)
15public static SyntaxToken TryEscapeIdentifierToken(SyntaxToken syntaxToken, SyntaxNode parentOfToken) 33var parent = parentOfToken.Parent; 57public static T AppendElasticTriviaIfNecessary<T>(T rewrittenNode, T originalNode) where T : SyntaxNode
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Utilities\NullableHelpers\NullableHelpers.cs (2)
22public static bool IsDeclaredSymbolAssignedPossiblyNullValue(SemanticModel semanticModel, SyntaxNode declarationSyntax, CancellationToken cancellationToken) 78var syntax = reference is IVariableDeclaratorOperation variableDeclarator
Workspace\LanguageServices\CSharpSyntaxTreeFactoryService.cs (1)
58public override SyntaxTree CreateSyntaxTree(string filePath, ParseOptions options, SourceText text, Encoding encoding, SourceHashAlgorithm checksumAlgorithm, SyntaxNode root)
Workspace\LanguageServices\CSharpSyntaxTreeFactoryService.NodeSyntaxReference.cs (3)
16private readonly SyntaxNode _node; 18internal NodeSyntaxReference(SyntaxNode node) 27public override SyntaxNode GetSyntax(CancellationToken cancellationToken)
Workspace\LanguageServices\CSharpSyntaxTreeFactoryService.ParsedSyntaxTree.cs (2)
76public override SyntaxTree WithRootAndOptions(SyntaxNode root, ParseOptions options) 92public override SyntaxReference GetReference(SyntaxNode node)
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (144)
CodeGeneration\AddAttributesTests.cs (1)
51var syntaxRoot = await doc.GetSyntaxRootAsync();
CodeGeneration\AddImportsTests.cs (2)
44var root = await doc.GetSyntaxRootAsync(); 800SyntaxNode p1SyntaxNode = syntaxRoot.DescendantNodes().OfType<ParameterSyntax>().FirstOrDefault();
CodeGeneration\SyntaxGeneratorTests.cs (125)
48private static void VerifySyntax<TSyntax>(SyntaxNode node, string expectedText) where TSyntax : SyntaxNode 55private static void VerifySyntaxRaw<TSyntax>(SyntaxNode node, string expectedText) where TSyntax : SyntaxNode 257var gname = Generator.WithTypeArguments(Generator.IdentifierName("x"), Generator.IdentifierName("y")); 384Generator.ArrayCreationExpression(Generator.IdentifierName("x"), new SyntaxNode[] { Generator.IdentifierName("y"), Generator.IdentifierName("z") }), 560Generator.IfStatement(Generator.IdentifierName("x"), new SyntaxNode[] { }), 564Generator.IfStatement(Generator.IdentifierName("x"), new SyntaxNode[] { }, new SyntaxNode[] { }), 569new SyntaxNode[] { Generator.IdentifierName("y") }), 574new SyntaxNode[] { Generator.IdentifierName("y") }, 575new SyntaxNode[] { Generator.IdentifierName("z") }), 580new SyntaxNode[] { Generator.IdentifierName("y") }, 581Generator.IfStatement(Generator.IdentifierName("p"), new SyntaxNode[] { Generator.IdentifierName("q") })), 586new SyntaxNode[] { Generator.IdentifierName("y") }, 587Generator.IfStatement(Generator.IdentifierName("p"), new SyntaxNode[] { Generator.IdentifierName("q") }, Generator.IdentifierName("z"))), 719Generator.ValueReturningLambdaExpression(new SyntaxNode[] { }, Generator.IdentifierName("y")), 731Generator.VoidReturningLambdaExpression(new SyntaxNode[] { }, Generator.IdentifierName("y")), 743Generator.ValueReturningLambdaExpression(new SyntaxNode[] { }, [Generator.ReturnStatement(Generator.IdentifierName("y"))]), 755Generator.VoidReturningLambdaExpression(new SyntaxNode[] { }, [Generator.IdentifierName("y")]), 858var returnType = Generator.TypeExpression(SpecialType.System_Boolean); 1188var pim = Generator.AsPrivateInterfaceImplementation( 1497var pim = Generator.AsPublicInterfaceImplementation( 1521var method = Generator.GetMembers(iface)[0]; 1523var privateMethod = Generator.AsPrivateInterfaceImplementation(method, Generator.IdentifierName("IFace")); 1554Generator.ClassDeclaration("c", interfaceTypes: new SyntaxNode[] { }), 1590Generator.StructDeclaration("s", interfaceTypes: new SyntaxNode[] { }), 1626Generator.InterfaceDeclaration("i", interfaceTypes: new SyntaxNode[] { }), 1958var prop = Generator.PropertyDeclaration("P", Generator.IdentifierName("T")); 1959var evnt = Generator.CustomEventDeclaration("E", Generator.IdentifierName("T")); 1966private void CheckAddRemoveAttribute(SyntaxNode declaration) 1971var withAttribute = Generator.AddAttributes(declaration, Generator.Attribute("a")); 1975var withoutAttribute = Generator.RemoveNode(withAttribute, attrsAdded[0]); 1986var added = Generator.AddAttributes(cls, Generator.Attribute("a")); 1989var removed = Generator.RemoveAllAttributes(added); 1992var attrWithComment = Generator.GetAttributes(added).First(); 2605private void AssertNamesEqual(string[] expectedNames, IEnumerable<SyntaxNode> actualNodes) 2613private void AssertNamesEqual(string name, IEnumerable<SyntaxNode> actualNodes) 2616private void AssertMemberNamesEqual(string[] expectedNames, SyntaxNode declaration) 2619private void AssertMemberNamesEqual(string expectedName, SyntaxNode declaration) 2642private void TestRemoveAllNamespaceImports(SyntaxNode declaration) 2645private void TestRemoveNamespaceImport(SyntaxNode declaration, string name, string[] remainingNames) 2647var newDecl = Generator.RemoveNode(declaration, Generator.GetNamespaceImports(declaration).First(m => Generator.GetName(m) == name)); 2664var newCu = Generator.RemoveNode(cu, summary); 2690var newCu = Generator.ReplaceNode(cu, summary, summary2); 2713var newCu = Generator.InsertNodesAfter(cu, text, [text]); 2736var newCu = Generator.InsertNodesBefore(cu, text, [text]); 2850private void TestRemoveAllMembers(SyntaxNode declaration) 2853private void TestRemoveMember(SyntaxNode declaration, string name, string[] remainingNames) 2855var newDecl = Generator.RemoveNode(declaration, Generator.GetMembers(declaration).First(m => Generator.GetName(m) == name)); 3100var ctor = Generator.ConstructorDeclaration("C", modifiers: DeclarationModifiers.Static); 3105var publicCtor = Generator.WithAccessibility(ctor, Accessibility.Public); 3114var ctor = Generator.ConstructorDeclaration("C", accessibility: Accessibility.Public); 3119var staticCtor = Generator.WithModifiers(ctor, DeclarationModifiers.Static); 3129var fileAbstractClass = Generator.WithModifiers(fileClass, Generator.GetModifiers(fileClass).WithIsAbstract(true)); 3139var filePublicClass = Generator.WithAccessibility(fileClass, Accessibility.Public); 3149var fileAbstractClass = Generator.WithModifiers(abstractClass, Generator.GetModifiers(abstractClass).WithIsFile(true)); 3159var filePublicClass = Generator.WithModifiers(publicClass, Generator.GetModifiers(publicClass).WithIsFile(true)); 3169var updatedProperty = Generator.WithModifiers(property, Generator.GetModifiers(property).WithIsRequired(true)); 3177var updatedProperty = Generator.WithModifiers(property, Generator.GetModifiers(property).WithIsVirtual(true)); 3187var updatedProperty = Generator.WithModifiers(property, Generator.GetModifiers(property).WithIsRequired(true)); 3351var prop = Generator.PropertyDeclaration("p", Generator.IdentifierName("T")); 3356var getAccessor = Generator.GetAccessor(prop, DeclarationKind.GetAccessor); 3365var setAccessor = Generator.GetAccessor(prop, DeclarationKind.SetAccessor); 3381var newGetAccessor = Generator.WithStatements(getAccessor, null); 3385var newNewGetAccessor = Generator.WithStatements(newGetAccessor, []); 3392var newProp = Generator.ReplaceNode(prop, getAccessor, Generator.WithAccessibility(getAccessor, Accessibility.Public)); 3449var x = Generator.GetMembers(root.Members[0])[0]; 3450var y = Generator.GetMembers(root.Members[0])[1]; 3456var y2 = Generator.AddAccessors(y, [Generator.GetAccessor(x, DeclarationKind.GetAccessor)]); 3470var x = Generator.GetMembers(root.Members[0])[0]; 3471var y = Generator.GetMembers(root.Members[0])[1]; 3477var y2 = Generator.AddAccessors(y, [Generator.GetAccessor(x, DeclarationKind.GetAccessor)]); 3493var x = Generator.GetMembers(root.Members[0])[0]; 3494var y = Generator.GetMembers(root.Members[0])[1]; 3495var z = Generator.GetMembers(root.Members[0])[2]; 3518var x = Generator.GetMembers(root.Members[0])[0]; 3519var y = Generator.GetMembers(root.Members[0])[1]; 3588var p = Generator.ParameterDeclaration("p", Generator.IdentifierName("t")); 3621var p = Generator.ParameterDeclaration("p", Generator.IdentifierName("t")); 3787var declC = Generator.GetDeclaration(symbolC.DeclaringSyntaxReferences.Select(x => x.GetSyntax()).First()); 3788var declX = Generator.GetDeclaration(symbolX.DeclaringSyntaxReferences.Select(x => x.GetSyntax()).First()); 3789var declY = Generator.GetDeclaration(symbolY.DeclaringSyntaxReferences.Select(x => x.GetSyntax()).First()); 3790var declZ = Generator.GetDeclaration(symbolZ.DeclaringSyntaxReferences.Select(x => x.GetSyntax()).First()); 3814var xTypedT = Generator.WithType(declX, Generator.IdentifierName("T")); 3819var xNamedQ = Generator.WithName(declX, "Q"); 3824var xInitialized = Generator.WithExpression(declX, Generator.IdentifierName("e")); 3829var xPrivate = Generator.WithAccessibility(declX, Accessibility.Private); 3834var xReadOnly = Generator.WithModifiers(declX, DeclarationModifiers.ReadOnly); 3839var xAttributed = Generator.AddAttributes(declX, Generator.Attribute("A")); 3964var declC = Generator.GetDeclaration(symbolC.DeclaringSyntaxReferences.Select(x => x.GetSyntax()).First()); 3982var declC = Generator.GetDeclaration(symbolC.DeclaringSyntaxReferences.Select(x => x.GetSyntax()).First()); 4003var declC = Generator.GetDeclaration(symbolC.DeclaringSyntaxReferences.Select(x => x.GetSyntax()).First()); 4021var declC = Generator.GetDeclaration(symbolC.DeclaringSyntaxReferences.Select(x => x.GetSyntax()).First()); 4039var declC = Generator.GetDeclaration(symbolC.DeclaringSyntaxReferences.Select(x => x.GetSyntax()).First()); 4057var declC = Generator.GetDeclaration(symbolC.DeclaringSyntaxReferences.Select(x => x.GetSyntax()).First()); 4075var declC = Generator.GetDeclaration(symbolC.DeclaringSyntaxReferences.Select(x => x.GetSyntax()).First()); 4093var declC = Generator.GetDeclaration(symbolC.DeclaringSyntaxReferences.Select(x => x.GetSyntax()).First()); 4111var declC = Generator.GetDeclaration(symbolC.DeclaringSyntaxReferences.Select(x => x.GetSyntax()).First()); 4130var declC = symbolC.DeclaringSyntaxReferences.First().GetSyntax(); 4133var attrX = attrs[0]; 4134var attrY = attrs[1]; 4135var attrZ = attrs[2]; 4142var xNamedQ = Generator.WithName(attrX, "Q"); 4147var xWithArg = Generator.AddAttributeArguments(attrX, [Generator.AttributeArgument(Generator.IdentifierName("e"))]); 4307var declC = symbolC.DeclaringSyntaxReferences.First().GetSyntax(); 4308var declM = Generator.GetMembers(declC).First(); 4314var attrX = attrs[0]; 4315var attrY = attrs[1]; 4316var attrZ = attrs[2]; 4322var xNamedQ = Generator.WithName(attrX, "Q"); 4327var xWithArg = Generator.AddAttributeArguments(attrX, [Generator.AttributeArgument(Generator.IdentifierName("e"))]); 4399var declC = symbolC.DeclaringSyntaxReferences.First().GetSyntax(); 4400var declM = Generator.GetMembers(declC).First(); 4405var attrX = attrs[0]; 4409var attrY = attrs[1]; 4413var attrZ = attrs[2]; 4417var attrP = attrs[3]; 4424var attrA = rattrs[0]; 4428var attrB = rattrs[1]; 4432var attrC = rattrs[2]; 4436var attrD = rattrs[3]; 4582var newDecl = Generator.AddInterfaceType(decl, Generator.IdentifierName("IDisposable")); 4993var root = tree.GetRoot(); 4994var node = root.FindNode(span, getInnermostNodeForTie: true);
Formatting\CSharpFormattingTestBase.cs (1)
22protected override SyntaxNode ParseCompilation(string text, ParseOptions parseOptions)
Formatting\FormattingElasticTriviaTests.cs (4)
89var newCompilation = Formatter.Format(compilation, workspace.Services.SolutionServices, CSharpSyntaxFormattingOptions.Default, CancellationToken.None); 111var decl = generator.GetDeclaration(root.DescendantNodes().OfType<VariableDeclaratorSyntax>().First(vd => vd.Identifier.Text == "f2")); 112var newDecl = generator.AddAttributes(decl, generator.Attribute("Some")).WithAdditionalAnnotations(Formatter.Annotation); 185var newCompilation = Formatter.Format(compilation, workspace.Services.SolutionServices, CSharpSyntaxFormattingOptions.Default, CancellationToken.None);
Formatting\FormattingMultipleSpanTests.cs (2)
168var root = await syntaxTree.GetRootAsync(); 169var result = Formatter.Format(root, TextSpan.FromBounds(0, 0), workspace.Services.SolutionServices, CSharpSyntaxFormattingOptions.Default, CancellationToken.None);
Formatting\FormattingTests.cs (1)
4655var newProperty = Formatter.Format(property, workspace.Services.SolutionServices, CSharpSyntaxFormattingOptions.Default, CancellationToken.None);
Formatting\FormattingTreeEditTests.cs (6)
39var root = await document.GetSyntaxRootAsync(); 40var attr = g.Attribute("MyAttr"); 44var root1 = root.ReplaceNode(param, g.AddAttributes(param, g.Attribute("MyAttr"))); 46var result1 = Formatter.Format(root1, document.Project.Solution.Services, options, CancellationToken.None); 58var root2 = root.ReplaceNode(method, g.AddAttributes(method, g.Attribute("MyAttr"))); 59var result2 = Formatter.Format(root2, document.Project.Solution.Services, options, CancellationToken.None);
Formatting\FormattingTriviaTests.cs (2)
1752var formatted = Formatter.Format(tree, workspace.Services.SolutionServices, options, CancellationToken.None); 1798var formatted = Formatter.Format(tree, workspace.Services.SolutionServices, options, CancellationToken.None);
Microsoft.CodeAnalysis.EditorFeatures (30)
AutomaticCompletion\AbstractAutomaticLineEnderCommandHandler.cs (2)
65protected abstract void ModifySelectedNode(AutomaticLineEnderCommandArgs args, ParsedDocument document, SyntaxNode selectedNode, bool addBrace, int caretPosition, StructuredAnalyzerConfigOptions fallbackOptions, CancellationToken cancellationToken); 70protected abstract (SyntaxNode selectedNode, bool addBrace)? GetValidNodeToModifyBraces(ParsedDocument document, int caretPosition, CancellationToken cancellationToken);
Classification\Syntactic\SyntacticClassificationTaggerProvider.TagComputer.cs (7)
83private (ITextSnapshot lastSnapshot, Document document, SyntaxNode? root)? _lastProcessedData; 333var currentRoot = await currentDocument.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 373SyntaxNode? currentRoot, 375SyntaxNode? lastProcessedRoot, 396private (ITextSnapshot lastSnapshot, Document document, SyntaxNode? root)? GetLastProcessedData() 473SyntaxNode? lastProcessedRoot, 513SyntaxNode? lastProcessedRoot,
CommentSelection\AbstractCommentSelectionBase.cs (1)
150var newRoot = oldSyntaxTree.WithChangedText(newText).GetRoot(cancellationToken);
DocumentationComments\AbstractXmlTagCompletionCommandHandler.cs (6)
28where TXmlNameSyntax : SyntaxNode 29where TXmlTextSyntax : SyntaxNode 30where TXmlElementSyntax : SyntaxNode 31where TXmlElementStartTagSyntax : SyntaxNode 32where TXmlElementEndTagSyntax : SyntaxNode 33where TDocumentationCommentTriviaSyntax : SyntaxNode
Editor\GoToAdjacentMemberCommandHandler.cs (3)
89var root = document.GetSyntaxRootSynchronously(context.OperationContext.UserCancellationToken); 104internal static int? GetTargetPosition(ISyntaxFactsService service, SyntaxNode root, int caretPosition, bool next) 140private static int MemberStart(SyntaxNode node)
InlineRename\AbstractEditorInlineRenameService.cs (5)
41/// Returns the <see cref="TextSpan"/> of the nearest encompassing <see cref="SyntaxNode"/> of type 49where T : SyntaxNode 51var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 57var containingNode = root.FindNode(textSpan); 58var targetNode = containingNode.FirstAncestorOrSelf<T>() ?? containingNode;
Interactive\SendToInteractiveSubmissionProvider.cs (2)
30protected abstract IEnumerable<TextSpan> GetExecutableSyntaxTreeNodeSelection(TextSpan selectedSpan, SyntaxNode node); 69var root = document.GetSyntaxRootSynchronously(cancellationToken);
Shared\Utilities\CommonFormattingHelpers.cs (1)
15public static TextSpan GetFormattingSpan(SyntaxNode root, TextSpan span)
SplitComment\ISplitCommentService.cs (1)
13bool IsAllowed(SyntaxNode root, SyntaxTrivia trivia);
TextStructureNavigation\AbstractTextStructureNavigatorProvider.TextStructureNavigator.cs (2)
89var root = document.GetSyntaxRootSynchronously(cancellationToken); 359var parent = SkipSameSpanParents(node).Parent;
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (41)
CodeLens\AbstractCodeLensTest.cs (8)
26var syntaxNode = await document.GetSyntaxRootAsync(); 34var declarationSyntaxNode = syntaxNode.FindNode(span); 54var syntaxNode = await document.GetSyntaxRootAsync(); 61var declarationSyntaxNode = syntaxNode.FindNode(span); 80var syntaxNode = await document.GetSyntaxRootAsync(); 87var declarationSyntaxNode = syntaxNode.FindNode(span); 106var syntaxNode = await document.GetSyntaxRootAsync(); 113var declarationSyntaxNode = syntaxNode.FindNode(span);
Completion\AbstractArgumentProviderTests`1.cs (3)
43protected abstract (SyntaxNode argumentList, ImmutableArray<SyntaxNode> arguments) GetArgumentList(SyntaxToken token); 75private IParameterSymbol GetParameterSymbolInfo(Workspace workspace, SemanticModel semanticModel, SyntaxNode root, int position, CancellationToken cancellationToken)
Completion\AbstractCompletionProviderTests.cs (1)
97var node = (await document.GetSyntaxRootAsync()).FindToken(position).Parent;
Formatting\CoreFormatterTestsBase.cs (9)
50protected abstract SyntaxNode ParseCompilationUnit(string expected); 213internal void AssertFormatWithTransformation(Workspace workspace, string expected, SyntaxFormattingOptions options, ImmutableArray<AbstractFormattingRule> rules, SyntaxNode root, IEnumerable<TextSpan> spans) 215var newRootNode = Formatter.Format(root, spans, workspace.Services.SolutionServices, options, rules, CancellationToken.None); 220var newRootNodeFromString = ParseCompilationUnit(expected); 226internal void AssertFormat(Workspace workspace, string expected, SyntaxFormattingOptions options, ImmutableArray<AbstractFormattingRule> rules, ITextBuffer clonedBuffer, SyntaxNode root, IEnumerable<TextSpan> spans) 281/// Asserts formatting on an arbitrary <see cref="SyntaxNode"/> that is not part of a <see cref="SyntaxTree"/> 283/// <param name="node">the <see cref="SyntaxNode"/> to format.</param> 285protected static void AssertFormatOnArbitraryNode(SyntaxNode node, string expected) 290var result = Formatter.Format(node, workspace.Services.SolutionServices, options, CancellationToken.None);
KeywordHighlighting\AbstractKeywordHighlighterTests.cs (1)
54var root = await document.GetSyntaxRootAsync();
QuickInfo\AbstractSemanticQuickInfoSourceTests.cs (1)
156var node = (await document.GetSyntaxRootAsync()).FindToken(position).Parent;
RefactoringHelpers\RefactoringHelpersTestBase.cs (7)
29protected Task TestAsync<TNode>(string text, bool allowEmptyNodes = false) where TNode : SyntaxNode 32protected async Task TestAsync<TNode>(string text, Func<TNode, bool> predicate, bool allowEmptyNodes = false) where TNode : SyntaxNode 41protected async Task TestUnderselectedAsync<TNode>(string text) where TNode : SyntaxNode 50protected async Task TestNotUnderselectedAsync<TNode>(string text) where TNode : SyntaxNode 60protected Task TestMissingAsync<TNode>(string text, bool allowEmptyNodes = false) where TNode : SyntaxNode 63protected async Task TestMissingAsync<TNode>(string text, Func<TNode, bool> predicate, bool allowEmptyNodes = false) where TNode : SyntaxNode 102private async Task<TNode?> GetNodeForSelectionAsync<TNode>(string text, TextSpan selection, Func<TNode, bool> predicate, bool allowEmptyNodes = false) where TNode : SyntaxNode
Semantics\SpeculationAnalyzerTestsBase.cs (5)
36var initialNode = initialTree.GetRoot().DescendantNodes().First(n => IsExpressionNode(n) && n.ToString() == (expressionToAnalyze ?? initialExpression)); 39var replacementNode = replacementTree.GetRoot().DescendantNodes().First(n => IsExpressionNode(n) && n.ToString() == (expressionToAnalyze ?? replacementExpression)); 61protected abstract bool IsExpressionNode(SyntaxNode node); 67protected abstract bool ReplacementChangesSemantics(SyntaxNode initialNode, SyntaxNode replacementNode, SemanticModel initialModel);
SignatureHelp\AbstractSignatureHelpProviderTests.cs (1)
121var node = (await document.GetSyntaxRootAsync()).FindToken(position).Parent;
Structure\AbstractSyntaxNodeStructureProviderTests.cs (2)
19where TSyntaxNode : SyntaxNode 25var root = await document.GetSyntaxRootAsync(CancellationToken.None);
Structure\AbstractSyntaxTriviaStructureProviderTests.cs (1)
22var root = await document.GetSyntaxRootAsync();
TypeInferrer\TypeInferrerTestBase.cs (2)
29var node = (await document.GetSyntaxRootAsync()).FindToken(position).Parent; 40/// Specifies the test is going to call into <see cref="ITypeInferenceService.InferTypes(SemanticModel, SyntaxNode, string, System.Threading.CancellationToken)"/>.
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (75)
CodeFixes\CodeFixServiceTests.cs (2)
1188var variableDeclarations = new HashSet<SyntaxNode>(); 1193foreach (var decl in variableDeclarations)
CodeFixes\ErrorCases\CodeFixExceptionInRegisterMethodAsync.cs (1)
23var root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);
CodeGeneration\AbstractCodeGenerationTests.cs (9)
24private static SyntaxNode Simplify( 26SyntaxNode syntaxNode, 50private static SyntaxNode WrapExpressionInBoilerplate(SyntaxNode expression, SyntaxGenerator codeDefFactory) 70Func<SyntaxGenerator, SyntaxNode> nodeCreator, 83var node = nodeCreator(codeDefFactory); 93var simplifiedRootNode = Simplify(workspace, WrapExpressionInBoilerplate(node, codeDefFactory), LanguageNames.CSharp); 104var node = nodeCreator(codeDefFactory); 114var simplifiedRootNode = Simplify(workspace, WrapExpressionInBoilerplate(node, codeDefFactory), LanguageNames.VisualBasic);
CodeGeneration\CodeGenerationTests.cs (17)
91var root = await testContext.Document.GetSyntaxRootAsync(); 106ImmutableArray<SyntaxNode> statements = default, 107ImmutableArray<SyntaxNode> baseArguments = default, 108ImmutableArray<SyntaxNode> thisArguments = default, 143ImmutableArray<SyntaxNode> handlesExpressions = default, 312var oldSyntax = testContext.GetSelectedSyntax<SyntaxNode>(true); 327var oldMemberSyntax = testContext.GetSelectedSyntax<SyntaxNode>(true); 537var oldNode = testContext.GetDestinationNode(); 549Type attributeClass) where T : SyntaxNode 553var taggedNode = testContext.GetDestinationNode(); 573string retainedMembersKey = "RetainedMember") where T : SyntaxNode 883public SyntaxNode GetDestinationNode() 916public T GetSelectedSyntax<T>(bool fullSpanCoverage = false) where T : SyntaxNode 923public ImmutableArray<SyntaxNode> ParseStatements(string statements) 932var list = new FixedSizeArrayBuilder<SyntaxNode>(parts.Length);
CodeGeneration\CodeGenerationTests.CSharp.cs (18)
153thisArguments: ImmutableArray.Create<SyntaxNode>(CS.SyntaxFactory.ParseExpression("42"))); 493addMethod: CodeGenerationSymbolFactory.CreateAccessorSymbol(ImmutableArray<AttributeData>.Empty, Accessibility.NotApplicable, ImmutableArray<SyntaxNode>.Empty), 494removeMethod: CodeGenerationSymbolFactory.CreateAccessorSymbol(ImmutableArray<AttributeData>.Empty, Accessibility.NotApplicable, ImmutableArray<SyntaxNode>.Empty), 1136await TestRemoveAttributeAsync<SyntaxNode>(input, expected, typeof(SerializableAttribute)); 1152await TestRemoveAttributeAsync<SyntaxNode>(input, expected, typeof(SerializableAttribute)); 1184await TestRemoveAttributeAsync<SyntaxNode>(input, expected, typeof(SerializableAttribute)); 1200await TestRemoveAttributeAsync<SyntaxNode>(input, expected, typeof(SerializableAttribute)); 1217await TestRemoveAttributeAsync<SyntaxNode>(input, expected, typeof(SerializableAttribute)); 1233await TestRemoveAttributeAsync<SyntaxNode>(input, expected, typeof(SerializableAttribute)); 1249await TestRemoveAttributeAsync<SyntaxNode>(input, expected, typeof(SerializableAttribute)); 1265await TestRemoveAttributeAsync<SyntaxNode>(input, expected, typeof(SerializableAttribute)); 1282await TestRemoveAttributeAsync<SyntaxNode>(input, expected, typeof(SerializableAttribute)); 1298await TestRemoveAttributeAsync<SyntaxNode>(input, expected, typeof(SerializableAttribute)); 1314await TestRemoveAttributeAsync<SyntaxNode>(input, expected, typeof(SerializableAttribute)); 1346await TestRemoveAttributeAsync<SyntaxNode>(input, expected, typeof(SerializableAttribute)); 1358await TestRemoveAttributeAsync<SyntaxNode>(input, expected, typeof(SerializableAttribute)); 1373await TestRemoveAttributeAsync<SyntaxNode>(input, expected, typeof(SerializableAttribute)); 1390await TestRemoveAttributeAsync<SyntaxNode>(input, expected, typeof(SerializableAttribute));
CodeGeneration\CodeGenerationTests.VisualBasic.cs (20)
162thisArguments: ImmutableArray.Create<SyntaxNode>(VB.SyntaxFactory.ParseExpression("42"))); 424ImmutableArray<AttributeData>.Empty, Accessibility.NotApplicable, ImmutableArray<SyntaxNode>.Empty), 448addMethod: CodeGenerationSymbolFactory.CreateAccessorSymbol(ImmutableArray<AttributeData>.Empty, Accessibility.NotApplicable, ImmutableArray<SyntaxNode>.Empty), 472var addStatements = ImmutableArray.Create<SyntaxNode>(VB.SyntaxFactory.ParseExecutableStatement("Console.WriteLine(0)")); 473var removeStatements = ImmutableArray.Create<SyntaxNode>(VB.SyntaxFactory.ParseExecutableStatement("Console.WriteLine(1)")); 474var raiseStatements = ImmutableArray.Create<SyntaxNode>(VB.SyntaxFactory.ParseExecutableStatement("Console.WriteLine(2)")); 1091await TestRemoveAttributeAsync<SyntaxNode>(input, expected, typeof(SerializableAttribute)); 1120await TestRemoveAttributeAsync<SyntaxNode>(input, expected, typeof(SerializableAttribute)); 1172await TestRemoveAttributeAsync<SyntaxNode>(input, expected, typeof(SerializableAttribute)); 1208await TestRemoveAttributeAsync<SyntaxNode>(input, expected, typeof(SerializableAttribute)); 1243await TestRemoveAttributeAsync<SyntaxNode>(input, expected, typeof(SerializableAttribute)); 1278await TestRemoveAttributeAsync<SyntaxNode>(input, expected, typeof(SerializableAttribute)); 1301await TestRemoveAttributeAsync<SyntaxNode>(input, expected, typeof(SerializableAttribute)); 1337await TestRemoveAttributeAsync<SyntaxNode>(input, expected, typeof(SerializableAttribute)); 1360await TestRemoveAttributeAsync<SyntaxNode>(input, expected, typeof(SerializableAttribute)); 1384await TestRemoveAttributeAsync<SyntaxNode>(input, expected, typeof(SerializableAttribute)); 1415await TestRemoveAttributeAsync<SyntaxNode>(input, expected, typeof(SerializableAttribute)); 1429await TestRemoveAttributeAsync<SyntaxNode>(input, expected, typeof(SerializableAttribute)); 1444await TestRemoveAttributeAsync<SyntaxNode>(input, expected, typeof(SerializableAttribute)); 1462await TestRemoveAttributeAsync<SyntaxNode>(input, expected, typeof(SerializableAttribute));
Completion\CompletionServiceTests.cs (1)
133var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
Diagnostics\DiagnosticAnalyzerServiceTests.cs (2)
670var root = await document.GetSyntaxRootAsync(); 1015var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
SymbolFinder\DependentTypeFinderTests.cs (2)
645var csRoot = await csDoc.GetSyntaxRootAsync(); 647var firstDecl = csRoot.DescendantNodes().First(d => d is CSharp.Syntax.TypeDeclarationSyntax);
Utilities\SymbolEquivalenceComparerTests.cs (3)
1865where TInvocation : SyntaxNode 1885where TInvocation : SyntaxNode 1889var method_root = method.DeclaringSyntaxReferences[0].GetSyntax();
Microsoft.CodeAnalysis.EditorFeatures.Wpf (4)
Peek\PeekHelpers.cs (4)
50var root = identifierLocation.SourceTree.GetRoot(cancellationToken); 51var node = root.FindToken(identifierLocation.SourceSpan.Start).Parent; 61node = node.FirstAncestorOrSelf<SyntaxNode, ISyntaxFactsService>((node, syntaxFactsService) => syntaxFactsService.IsMethodLevelMember(node), syntaxFactsService) ?? node; 66node = node.FirstAncestorOrSelf<SyntaxNode, ISyntaxFactsService>((node, syntaxFactsService) => syntaxFactsService.IsTopLevelNodeWithMembers(node), syntaxFactsService) ?? node;
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (14)
Classification\ClassificationTests.vb (3)
345Public Sub AddSyntacticClassifications(services As SolutionServices, root As SyntaxNode, textSpans As ImmutableArray(Of TextSpan), result As SegmentedList(Of ClassifiedSpan), cancellationToken As CancellationToken) Implements IClassificationService.AddSyntacticClassifications 363Public Function ComputeSyntacticChangeRange(services As SolutionServices, oldRoot As SyntaxNode, newRoot As SyntaxNode, timeout As TimeSpan, cancellationToken As CancellationToken) As TextChangeRange? Implements IClassificationService.ComputeSyntacticChangeRange
Diagnostics\AbstractCrossLanguageUserDiagnosticTest.vb (1)
237Protected Overridable Function GetNode(doc As Document, position As Integer) As SyntaxNode
Diagnostics\DiagnosticServiceTests.vb (4)
2504Public AnalyzedSyntaxNodes As List(Of SyntaxNode) = New List(Of SyntaxNode)() 2506Public AnalyzedSyntaxNodesInsideCodeBlock As List(Of SyntaxNode) = New List(Of SyntaxNode)()
Expansion\AbstractExpansionTest.vb (2)
58Private Shared Function GetExpressionSyntaxWithSameSpan(node As SyntaxNode, spanEnd As Integer) As SyntaxNode
GoToDefinition\CSharpGoToDefinitionTests.vb (2)
3995Private Async Function TestInterceptorFromInterceptorDeclaration(code As String, getInvocations As Func(Of SyntaxNode, IEnumerable(Of InvocationExpressionSyntax))) As Task 4111Private Async Function TestInterceptorFromCallSite(code As String, methodName As String, getInvocations As Func(Of SyntaxNode, IEnumerable(Of InvocationExpressionSyntax))) As Task
Simplification\AbstractSimplificationTests.vb (2)
133Private Shared Function GetExpressionSyntaxWithSameSpan(node As SyntaxNode, spanEnd As Integer) As SyntaxNode
Microsoft.CodeAnalysis.ExternalAccess.Copilot (1)
Analyzer\CopilotUtilities.cs (1)
30public static async Task<SyntaxNode?> GetContainingMethodDeclarationAsync(Document document, int position, bool useFullSpan, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.ExternalAccess.FSharp (3)
Internal\Classification\FSharpClassificationService.cs (3)
67public void AddSyntacticClassifications(SolutionServices services, SyntaxNode? root, ImmutableArray<TextSpan> textSpans, SegmentedList<ClassifiedSpan> result, CancellationToken cancellationToken) 72public TextChangeRange? ComputeSyntacticChangeRange(SolutionServices services, SyntaxNode oldRoot, SyntaxNode newRoot, TimeSpan timeout, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.ExternalAccess.OmniSharp.CSharp (2)
DocumentationComments\OmniSharpDocCommentConverter.cs (2)
14public static SyntaxNode ConvertToRegularComments(SyntaxNode node, Project project, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.ExternalAccess.Razor (3)
RazorCSharpFormattingInteractionService.cs (3)
62SyntaxNode root, 71public static SyntaxNode Format( 73SyntaxNode root,
Microsoft.CodeAnalysis.Features (2463)
AddConstructorParametersFromMembers\AddConstructorParametersFromMembersCodeRefactoringProvider.AddConstructorParametersCodeAction.cs (1)
69private IEnumerable<SyntaxNode> CreateAssignStatements(ConstructorCandidate constructorCandidate)
AddDebuggerDisplay\AbstractAddDebuggerDisplayCodeRefactoringProvider.cs (4)
20where TTypeDeclarationSyntax : SyntaxNode 21where TMethodDeclarationSyntax : SyntaxNode 121SyntaxNode attributeArgument; 150var newAttribute = generator
AddFileBanner\AbstractAddFileBannerCodeRefactoringProvider.cs (3)
97private static bool HasExistingBanner(Document document, SyntaxNode root) 129Document document, SyntaxNode root, 161Document document, SyntaxNode? root, CancellationToken cancellationToken)
AddImport\AbstractAddImportFeatureService.cs (31)
32where TSimpleNameSyntax : SyntaxNode 40protected abstract bool CanAddImport(SyntaxNode node, bool allowInHiddenRegions, CancellationToken cancellationToken); 41protected abstract bool CanAddImportForMethod(string diagnosticId, ISyntaxFacts syntaxFacts, SyntaxNode node, out TSimpleNameSyntax nameNode); 42protected abstract bool CanAddImportForNamespace(string diagnosticId, SyntaxNode node, out TSimpleNameSyntax nameNode); 43protected abstract bool CanAddImportForDeconstruct(string diagnosticId, SyntaxNode node); 44protected abstract bool CanAddImportForGetAwaiter(string diagnosticId, ISyntaxFacts syntaxFactsService, SyntaxNode node); 45protected abstract bool CanAddImportForGetEnumerator(string diagnosticId, ISyntaxFacts syntaxFactsService, SyntaxNode node); 46protected abstract bool CanAddImportForGetAsyncEnumerator(string diagnosticId, ISyntaxFacts syntaxFactsService, SyntaxNode node); 47protected abstract bool CanAddImportForQuery(string diagnosticId, SyntaxNode node); 48protected abstract bool CanAddImportForType(string diagnosticId, SyntaxNode node, out TSimpleNameSyntax nameNode); 50protected abstract ISet<INamespaceSymbol> GetImportNamespacesInScope(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken); 51protected abstract ITypeSymbol GetDeconstructInfo(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken); 52protected abstract ITypeSymbol GetQueryClauseInfo(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken); 53protected abstract bool IsViableExtensionMethod(IMethodSymbol method, SyntaxNode expression, SemanticModel semanticModel, ISyntaxFacts syntaxFacts, CancellationToken cancellationToken); 55protected abstract Task<Document> AddImportAsync(SyntaxNode contextNode, INamespaceOrTypeSymbol symbol, Document document, AddImportPlacementOptions options, CancellationToken cancellationToken); 56protected abstract Task<Document> AddImportAsync(SyntaxNode contextNode, IReadOnlyList<string> nameSpaceParts, Document document, AddImportPlacementOptions options, CancellationToken cancellationToken); 58protected abstract bool IsAddMethodContext(SyntaxNode node, SemanticModel semanticModel); 61protected abstract (string description, bool hasExistingImport) GetDescription(Document document, AddImportPlacementOptions options, INamespaceOrTypeSymbol symbol, SemanticModel semanticModel, SyntaxNode root, CancellationToken cancellationToken); 129Document document, SemanticModel semanticModel, string diagnosticId, SyntaxNode node, int maxResults, ISymbolSearchService symbolSearchService, 623private static ITypeSymbol? GetAwaitInfo(SemanticModel semanticModel, ISyntaxFacts syntaxFactsService, SyntaxNode node) 625var awaitExpression = FirstAwaitExpressionAncestor(syntaxFactsService, node); 630var innerExpression = syntaxFactsService.GetExpressionOfAwaitExpression(awaitExpression); 635private static ITypeSymbol? GetCollectionExpressionType(SemanticModel semanticModel, ISyntaxFacts syntaxFactsService, SyntaxNode node) 637var collectionExpression = FirstForeachCollectionExpressionAncestor(syntaxFactsService, node); 647protected static bool AncestorOrSelfIsAwaitExpression(ISyntaxFacts syntaxFactsService, SyntaxNode node) 650private static SyntaxNode? FirstAwaitExpressionAncestor(ISyntaxFacts syntaxFactsService, SyntaxNode node) 651=> node.FirstAncestorOrSelf<SyntaxNode, ISyntaxFacts>((n, syntaxFactsService) => syntaxFactsService.IsAwaitExpression(n), syntaxFactsService); 653private static SyntaxNode? FirstForeachCollectionExpressionAncestor(ISyntaxFacts syntaxFactsService, SyntaxNode node) 654=> node.FirstAncestorOrSelf<SyntaxNode, ISyntaxFacts>((n, syntaxFactsService) => syntaxFactsService.IsExpressionOfForeach(n), syntaxFactsService);
AddImport\CodeActions\InstallPackageAndAddImportCodeAction.cs (2)
67var newRoot = await newDocument.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 72var updatedRoot = newRoot.WithAdditionalAnnotations(SuppressDiagnosticsAnnotation.Create());
AddImport\References\AssemblyReference.cs (1)
25Document document, SyntaxNode node, CodeCleanupOptions options, CancellationToken cancellationToken)
AddImport\References\MetadataSymbolReference.cs (1)
37Document document, CodeCleanupOptions options, SyntaxNode node,
AddImport\References\PackageReference.cs (1)
28Document document, SyntaxNode node, CodeCleanupOptions options, CancellationToken cancellationToken)
AddImport\References\ProjectSymbolReference.cs (1)
83Document document, CodeCleanupOptions options, SyntaxNode node,
AddImport\References\Reference.cs (7)
80protected async Task<(SyntaxNode, Document)> ReplaceNameNodeAsync( 81SyntaxNode contextNode, Document document, CancellationToken cancellationToken) 93var root = contextNode.SyntaxTree.GetRoot(cancellationToken); 97var newRoot = await newDocument.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 98var newContextNode = newRoot.GetAnnotatedTokens(annotation).First().Parent; 104Document document, SyntaxNode node, CodeCleanupOptions options, CancellationToken cancellationToken); 107Document document, SyntaxNode node, CodeCleanupOptions options, CancellationToken cancellationToken)
AddImport\References\SymbolReference.cs (3)
48Document document, SyntaxNode contextNode, 75Document document, SyntaxNode node, 124Document document, CodeCleanupOptions options, SyntaxNode node,
AddImport\SymbolReferenceFinder.cs (3)
39private readonly SyntaxNode _node; 49SyntaxNode node, 373SyntaxNode expression, CancellationToken cancellationToken)
BraceMatching\AbstractBraceMatcher.cs (2)
29var parent = token.Parent; 64var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
BraceMatching\AbstractDirectiveTriviaBraceMatcher.cs (1)
17where TDirectiveTriviaSyntax : SyntaxNode
BracePairs\IBracePairsService.cs (1)
49var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
ChangeSignature\AbstractChangeSignatureService.cs (40)
47public abstract SyntaxNode? FindNodeToUpdate(Document document, SyntaxNode node); 52public abstract Task<SyntaxNode> ChangeSignatureAsync( 55SyntaxNode potentiallyUpdatedNode, 56SyntaxNode originalNode, 62protected abstract T TransferLeadingWhitespaceTrivia<T>(T newArgument, SyntaxNode oldArgument) where T : SyntaxNode; 71where TArgumentSyntax : SyntaxNode; 74where TArgumentSyntax : SyntaxNode; 172var syntax = await reference.GetSyntaxAsync(cancellationToken).ConfigureAwait(false); 255var nodesToUpdate = new Dictionary<DocumentId, List<SyntaxNode>>(); 256var definitionToUse = new Dictionary<SyntaxNode, ISymbol>(); 337if (!TryGetNodeWithEditableSignatureOrAttributes(def, currentSolution, out var nodeToUpdate, out var documentId)) 361if (!TryGetNodeWithEditableSignatureOrAttributes(location.Location, currentSolution, out var nodeToUpdate2, out var documentId2)) 377var updatedRoots = new Dictionary<DocumentId, SyntaxNode>(); 401var annotatedNodes = newRoot.GetAnnotatedNodes<SyntaxNode>(syntaxAnnotation: changeSignatureFormattingAnnotation); 404var formattedRoot = Formatter.Format( 416var changedDocuments = await ProducerConsumer<(DocumentId documentId, SyntaxNode newRoot)>.RunParallelAsync( 443private static void AddUpdatableNodeToDictionaries(Dictionary<DocumentId, List<SyntaxNode>> nodesToUpdate, DocumentId documentId, SyntaxNode nodeToUpdate, Dictionary<SyntaxNode, ISymbol> definitionToUse, ISymbol symbolWithSemanticParameters) 454private static bool TryGetNodeWithEditableSignatureOrAttributes(Location location, Solution solution, out SyntaxNode nodeToUpdate, out DocumentId documentId) 460var root = tree.GetRoot(); 461var node = root.FindNode(location.SourceSpan, findInsideTrivia: true, getInnermostNodeForTie: true); 648where TNode : SyntaxNode 681Func<AddedParameter, T> createNewParameterMethod) where T : SyntaxNode 744protected ImmutableArray<SyntaxToken> GetSeparators<T>(SeparatedSyntaxList<T> arguments, int numSeparatorsToSkip) where T : SyntaxNode 772where TArgumentSyntax : SyntaxNode 811var expression = await GenerateInferredCallsiteExpressionAsync( 916private async Task<SyntaxNode> GenerateInferredCallsiteExpressionAsync( 971protected ImmutableArray<SyntaxTrivia> GetPermutedDocCommentTrivia(SyntaxNode node, ImmutableArray<SyntaxNode> permutedParamNodes, LanguageServices services, LineFormattingOptions options) 986var structuredTrivia = trivia.GetStructure(); 993var updatedNodeList = ArrayBuilder<SyntaxNode>.GetInstance(); 997var content = structuredContent[i]; 1016var newDocComments = Generator.DocumentationCommentTriviaWithUpdatedContent(trivia, updatedNodeList.ToImmutableAndFree()); 1022using var _ = ArrayBuilder<SyntaxNode>.GetInstance(out var extraNodeList); 1031var extraDocComments = Generator.DocumentationCommentTrivia( 1043protected static bool IsParamsArrayExpandedHelper(ISymbol symbol, int argumentCount, bool lastArgumentIsNamed, SemanticModel semanticModel, SyntaxNode lastArgumentExpression, CancellationToken cancellationToken) 1071protected static int GetParameterIndexFromInvocationArgument(SyntaxNode argument, Document document, SemanticModel semanticModel, CancellationToken cancellationToken)
ChangeSignature\DelegateInvokeMethodReferenceFinder.cs (3)
95var root = state.Root; 104foreach (var node in nodes) 124static FinderLocation CreateFinderLocation(SyntaxNode node, FindReferencesDocumentState state, CancellationToken cancellationToken)
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.AbstractGlobalSuppressMessageCodeAction.cs (1)
85var r = await t.GetRootAsync(c).ConfigureAwait(false);
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.cs (21)
47protected abstract SyntaxTriviaList CreatePragmaDisableDirectiveTrivia(Diagnostic diagnostic, Func<SyntaxNode, CancellationToken, SyntaxNode> formatNode, bool needsLeadingEndOfLine, bool needsTrailingEndOfLine, CancellationToken cancellationToken); 48protected abstract SyntaxTriviaList CreatePragmaRestoreDirectiveTrivia(Diagnostic diagnostic, Func<SyntaxNode, CancellationToken, SyntaxNode> formatNode, bool needsLeadingEndOfLine, bool needsTrailingEndOfLine, CancellationToken cancellationToken); 50protected abstract SyntaxNode AddGlobalSuppressMessageAttribute( 51SyntaxNode newRoot, 60protected abstract SyntaxNode AddLocalSuppressMessageAttribute( 61SyntaxNode targetNode, ISymbol targetSymbol, INamedTypeSymbol suppressMessageAttribute, Diagnostic diagnostic); 65protected abstract bool IsAttributeListWithAssemblyAttributes(SyntaxNode node); 68protected abstract bool IsSingleAttributeInAttributeList(SyntaxNode attribute); 92protected abstract SyntaxNode GetContainingStatement(SyntaxToken token); 95protected SyntaxToken GetAdjustedTokenForPragmaDisable(SyntaxToken token, SyntaxNode root, TextLineCollection lines) 97var containingStatement = GetContainingStatement(token); 117private SyntaxToken GetAdjustedTokenForPragmaRestore(SyntaxToken token, SyntaxNode root, TextLineCollection lines, int indexOfLine) 119var containingStatement = GetContainingStatement(token); 261public SyntaxNode NodeWithTokens { get; set; } 262public SyntaxNode TargetMemberNode { get; set; } 274var root = await syntaxTree.GetRootAsync(cancellationToken).ConfigureAwait(false); 288var nodeWithTokens = GetNodeWithTokens(startToken, endToken, root); 344internal SyntaxNode GetNodeWithTokens(SyntaxToken startToken, SyntaxToken endToken, SyntaxNode root)
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.LocalSuppressMessageCodeAction.cs (6)
18SyntaxNode targetNode, 30var newTargetNode = _fixer.AddLocalSuppressMessageAttribute( 32var root = await _document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 33var newRoot = root.ReplaceNode<SyntaxNode>(TargetNode_TestOnly, newTargetNode); 39internal SyntaxNode TargetNode_TestOnly { get; } = targetNode;
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.PragmaHelpers.cs (11)
34var nodeWithTokens = suppressionTargetInfo.NodeWithTokens; 35var root = await nodeWithTokens.SyntaxTree.GetRootAsync(cancellationToken).ConfigureAwait(false); 51SyntaxNode newNode; 61var newRoot = root.ReplaceNode(nodeWithTokens, newNode); 107Func<SyntaxNode, CancellationToken, SyntaxNode> formatNode, 159Func<SyntaxNode, CancellationToken, SyntaxNode> formatNode, 211var nodeWithTokens = suppressionTargetInfo.NodeWithTokens; 222var root = nodeWithTokens.SyntaxTree.GetRoot(); 224var subtreeRoot = root.FindNode(new TextSpan(previousOfStart.FullSpan.Start, spanEnd - previousOfStart.FullSpan.Start));
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.PragmaWarningCodeAction.cs (2)
86private SyntaxNode FormatNode(SyntaxNode node, CancellationToken cancellationToken)
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction.BatchFixer.cs (3)
159private static async Task<ImmutableArray<SyntaxNode>> GetAttributeNodesToFixAsync(ImmutableArray<AttributeRemoveAction> attributeRemoveFixes, CancellationToken cancellationToken) 161var builder = new FixedSizeArrayBuilder<SyntaxNode>(attributeRemoveFixes.Length); 164var attributeToRemove = await attributeRemoveFix.GetAttributeToRemoveAsync(cancellationToken).ConfigureAwait(false);
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction_Attribute.cs (3)
52public async Task<SyntaxNode> GetAttributeToRemoveAsync(CancellationToken cancellationToken) 54var attributeNode = await _attribute.ApplicationSyntaxReference.GetSyntaxAsync(cancellationToken).ConfigureAwait(false); 63var attributeNode = await GetAttributeToRemoveAsync(cancellationToken).ConfigureAwait(false);
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction_Pragma.cs (2)
220private SyntaxNode FormatNode(SyntaxNode node, CancellationToken cancellationToken)
CodeLens\CodeLensFindReferenceProgress.cs (2)
28SyntaxNode queriedNode, 33private readonly SyntaxNode _queriedNode = queriedNode;
CodeLens\CodeLensReferencesService.cs (8)
42private static async Task<T?> FindAsync<T>(Solution solution, DocumentId documentId, SyntaxNode syntaxNode, 89public async Task<ReferenceCount?> GetReferenceCountAsync(Solution solution, DocumentId documentId, SyntaxNode syntaxNode, int maxSearchResults, CancellationToken cancellationToken) 120var node = GetEnclosingCodeElementNode(document, token, langServices, cancellationToken); 170private static SyntaxNode GetEnclosingCodeElementNode(Document document, SyntaxToken token, ICodeLensDisplayInfoService langServices, CancellationToken cancellationToken) 174var node = token.Parent; 202public async Task<ImmutableArray<ReferenceLocationDescriptor>?> FindReferenceLocationsAsync(Solution solution, DocumentId documentId, SyntaxNode syntaxNode, CancellationToken cancellationToken) 259public Task<ImmutableArray<ReferenceMethodDescriptor>?> FindReferenceMethodsAsync(Solution solution, DocumentId documentId, SyntaxNode syntaxNode, CancellationToken cancellationToken) 275public async Task<string> GetFullyQualifiedNameAsync(Solution solution, DocumentId documentId, SyntaxNode syntaxNode,
CodeLens\ICodeLensDisplayInfoService.cs (3)
16SyntaxNode GetDisplayNode(SyntaxNode node); 21string GetDisplayName(SemanticModel semanticModel, SyntaxNode node);
CodeLens\ICodeLensMemberFinder.cs (1)
24internal record struct CodeLensMember(SyntaxNode Node, TextSpan Span);
CodeLens\ICodeLensReferencesService.cs (4)
23Task<ReferenceCount?> GetReferenceCountAsync(Solution solution, DocumentId documentId, SyntaxNode? syntaxNode, int maxSearchResults, CancellationToken cancellationToken); 28Task<ImmutableArray<ReferenceLocationDescriptor>?> FindReferenceLocationsAsync(Solution solution, DocumentId documentId, SyntaxNode? syntaxNode, CancellationToken cancellationToken); 33Task<ImmutableArray<ReferenceMethodDescriptor>?> FindReferenceMethodsAsync(Solution solution, DocumentId documentId, SyntaxNode? syntaxNode, CancellationToken cancellationToken); 38Task<string?> GetFullyQualifiedNameAsync(Solution solution, DocumentId documentId, SyntaxNode? syntaxNode, CancellationToken cancellationToken);
CodeRefactorings\AddAwait\AbstractAddAwaitCodeRefactoringProvider.cs (5)
26where TExpressionSyntax : SyntaxNode 31protected abstract bool IsInAsyncContext(SyntaxNode node); 71SemanticModel model, ISyntaxFactsService syntaxFacts, SyntaxNode node, CancellationToken cancellationToken) 84for (var current = node; current != null;) 124var awaitExpression = generator
CodeRefactorings\CodeRefactoringContextExtensions.cs (12)
40public static Task<TSyntaxNode?> TryGetRelevantNodeAsync<TSyntaxNode>(this CodeRefactoringContext context) where TSyntaxNode : SyntaxNode 43public static async Task<TSyntaxNode?> TryGetRelevantNodeAsync<TSyntaxNode>(this CodeRefactoringContext context, bool allowEmptyNode) where TSyntaxNode : SyntaxNode 49public static Task<ImmutableArray<TSyntaxNode>> GetRelevantNodesAsync<TSyntaxNode>(this CodeRefactoringContext context) where TSyntaxNode : SyntaxNode 52public static async Task<ImmutableArray<TSyntaxNode>> GetRelevantNodesAsync<TSyntaxNode>(this CodeRefactoringContext context, bool allowEmptyNodes) where TSyntaxNode : SyntaxNode 58public static async Task<TSyntaxNode?> TryGetRelevantNodeAsync<TSyntaxNode>(this Document document, TextSpan span, CancellationToken cancellationToken) where TSyntaxNode : SyntaxNode 64public static TSyntaxNode? TryGetRelevantNode<TSyntaxNode>(this ParsedDocument document, TextSpan span, CancellationToken cancellationToken) where TSyntaxNode : SyntaxNode 67public static TSyntaxNode? TryGetRelevantNode<TSyntaxNode>(this ParsedDocument document, TextSpan span, bool allowEmptyNode, CancellationToken cancellationToken) where TSyntaxNode : SyntaxNode 75this Document document, TextSpan span, CancellationToken cancellationToken) where TSyntaxNode : SyntaxNode 81this Document document, TextSpan span, bool allowEmptyNodes, CancellationToken cancellationToken) where TSyntaxNode : SyntaxNode 88this ParsedDocument document, TextSpan span, CancellationToken cancellationToken) where TSyntaxNode : SyntaxNode 92this ParsedDocument document, TextSpan span, bool allowEmptyNodes, CancellationToken cancellationToken) where TSyntaxNode : SyntaxNode 101this ParsedDocument document, TextSpan span, bool allowEmptyNodes, int maxCount, ref TemporaryArray<TSyntaxNode> result, CancellationToken cancellationToken) where TSyntaxNode : SyntaxNode
CodeRefactorings\ExtractMethod\AbstractExtractMethodCodeRefactoringProvider.cs (2)
134var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 136var finalRoot = root.ReplaceToken(
CodeRefactorings\MoveType\AbstractMoveTypeService.cs (8)
39where TTypeDeclarationSyntax : SyntaxNode 40where TNamespaceDeclarationSyntax : SyntaxNode 41where TMemberDeclarationSyntax : SyntaxNode 42where TCompilationUnitSyntax : SyntaxNode 165private static bool ClassNextToGlobalStatements(SyntaxNode root, ISyntaxFactsService syntaxFacts) 180private static bool MultipleTopLevelTypeDeclarationInSourceDocument(SyntaxNode root) 183private static IEnumerable<TTypeDeclarationSyntax> TopLevelTypeDeclarations(SyntaxNode root) 189var root = state.SemanticDocument.Root;
CodeRefactorings\MoveType\AbstractMoveTypeService.MoveTypeEditor.cs (10)
117var root = SemanticDocument.Root; 129foreach (var member in membersToRemove) 136var modifiedRoot = documentEditor.GetChangedRoot(); 156private async Task<SyntaxNode> AddFinalNewLineIfDesiredAsync(Document document, SyntaxNode modifiedRoot) 208private ISet<SyntaxNode> GetMembersToRemove(SyntaxNode root) 210var spine = new HashSet<SyntaxNode>(); 239private static bool FilterToTopLevelMembers(SyntaxNode node, SyntaxNode typeNode)
CodeRefactorings\MoveType\AbstractMoveTypeService.MoveTypeNamespaceScopeEditor.cs (9)
62var newNamespaceDeclaration = syntaxGenerator.NamespaceDeclaration(name, WithElasticTrivia(typeToMove)).WithAdditionalAnnotations(NamespaceScopeMovedAnnotation); 66var itemsAfterNamespaceDeclaration = syntaxGenerator.NamespaceDeclaration(name, WithElasticTrivia(itemsAfter)); 94private static SyntaxNode WithElasticTrivia(SyntaxNode syntaxNode, bool leading = true, bool trailing = true) 109private static IEnumerable<SyntaxNode> WithElasticTrivia(IEnumerable<SyntaxNode> syntaxNodes) 113var firstNode = syntaxNodes.First(); 114var lastNode = syntaxNodes.Last(); 124foreach (var node in syntaxNodes.Skip(1))
CodeRefactorings\MoveType\AbstractMoveTypeService.State.cs (1)
54var root = SemanticDocument.Root;
CodeRefactorings\SyncNamespace\AbstractChangeNamespaceService.cs (45)
39public abstract Task<bool> CanChangeNamespaceAsync(Document document, SyntaxNode container, CancellationToken cancellationToken); 41public abstract Task<Solution> ChangeNamespaceAsync(Document document, SyntaxNode container, string targetNamespace, CancellationToken cancellationToken); 57public abstract bool TryGetReplacementReferenceSyntax(SyntaxNode reference, ImmutableArray<string> newNamespaceParts, ISyntaxFactsService syntaxFacts, [NotNullWhen(returnValue: true)] out SyntaxNode? old, [NotNullWhen(returnValue: true)] out SyntaxNode? @new); 62where TNamespaceDeclarationSyntax : SyntaxNode 63where TCompilationUnitSyntax : SyntaxNode 64where TMemberDeclarationSyntax : SyntaxNode 80protected abstract SyntaxList<TMemberDeclarationSyntax> GetMemberDeclarationsInContainer(SyntaxNode compilationUnitOrNamespaceDecl); 82protected abstract Task<SyntaxNode?> TryGetApplicableContainerFromSpanAsync(Document document, TextSpan span, CancellationToken cancellationToken); 84protected abstract string GetDeclaredNamespace(SyntaxNode container); 88/// <see cref="IChangeNamespaceService.CanChangeNamespaceAsync(Document, SyntaxNode, CancellationToken)"/> 95protected abstract Task<ImmutableArray<(DocumentId id, SyntaxNode container)>> GetValidContainersFromAllLinkedDocumentsAsync(Document document, SyntaxNode container, CancellationToken cancellationToken); 97private static bool IsValidContainer(SyntaxNode container) 103public override async Task<bool> CanChangeNamespaceAsync(Document document, SyntaxNode container, CancellationToken cancellationToken) 157var namespaceToRename = namespaces[i]; 163static async Task<ImmutableArray<SyntaxNode>> GetTopLevelNamespacesAsync(Document document, CancellationToken cancellationToken) 177SyntaxNode container, 267protected async Task<ImmutableArray<(DocumentId, SyntaxNode)>> TryGetApplicableContainersFromAllDocumentsAsync( 279using var _1 = ArrayBuilder<(DocumentId, SyntaxNode)>.GetInstance(ids.Length, out var containers); 310protected static async Task<Solution> AnnotateContainersAsync(Solution solution, ImmutableArray<(DocumentId, SyntaxNode)> containers, CancellationToken cancellationToken) 323Document document, SyntaxNode container, CancellationToken cancellationToken) 367SyntaxNode container, 400private static ImmutableArray<SyntaxNode> CreateImports(Document document, ImmutableArray<string> names, bool withFormatterAnnotation) 403var builder = new FixedSizeArrayBuilder<SyntaxNode>(names.Length); 410private static SyntaxNode CreateImport(SyntaxGenerator syntaxGenerator, string name, bool withFormatterAnnotation) 412var import = syntaxGenerator.NamespaceImportDeclaration(name); 486var fixedDocuments = await ProducerConsumer<(DocumentId documentId, SyntaxNode newRoot)>.RunParallelAsync( 587ImmutableArray<SyntaxNode> containersToAddImports; 680private static async Task<(Document, ImmutableArray<SyntaxNode>)> FixReferencesAsync( 689var root = editor.OriginalRoot; 690using var _ = PooledHashSet<SyntaxNode>.GetInstance(out var containers); 723var refNode = root.FindNode(refLoc.ReferenceLocation.Location.SourceSpan, findInsideTrivia: true, getInnermostNodeForTie: true); 729refNode, newNamespaceParts, syntaxFacts, out var oldNode, out var newNode)) 738var container = addImportService.GetImportContainer(root, refNode, dummyImport, addImportsOptions); 774var changedDocuments = await ProducerConsumer<(DocumentId documentId, SyntaxNode newRoot)>.RunParallelAsync( 791IEnumerable<SyntaxNode> importsToRemove, 812ImmutableArray<SyntaxNode> containers, 827foreach (var container in containers) 832var contextLocation = container is TNamespaceDeclarationSyntax 852private sealed class SyntaxNodeSpanStartComparer : IComparer<SyntaxNode> 860public int Compare(SyntaxNode? x, SyntaxNode? y)
CodeRefactorings\SyncNamespace\AbstractSyncNamespaceCodeRefactoringProvider.cs (4)
16where TNamespaceDeclarationSyntax : SyntaxNode 17where TCompilationUnitSyntax : SyntaxNode 18where TMemberDeclarationSyntax : SyntaxNode 93protected abstract Task<SyntaxNode?> TryGetApplicableInvocationNodeAsync(Document document, TextSpan span, CancellationToken cancellationToken);
CodeRefactorings\SyncNamespace\AbstractSyncNamespaceCodeRefactoringProvider.MoveFileCodeAction.cs (3)
22where TNamespaceDeclarationSyntax : SyntaxNode 23where TCompilationUnitSyntax : SyntaxNode 24where TMemberDeclarationSyntax : SyntaxNode
CodeRefactorings\SyncNamespace\AbstractSyncNamespaceCodeRefactoringProvider.State.cs (6)
23where TNamespaceDeclarationSyntax : SyntaxNode 24where TCompilationUnitSyntax : SyntaxNode 25where TMemberDeclarationSyntax : SyntaxNode 38public SyntaxNode Container { get; } 56SyntaxNode container, 88var applicableNode = await provider.TryGetApplicableInvocationNodeAsync(document, textSpan, cancellationToken).ConfigureAwait(false);
Completion\Providers\AbstractAwaitCompletionProvider.cs (5)
61protected abstract int GetSpanStart(SyntaxNode declaration); 63protected abstract SyntaxNode? GetAsyncSupportingDeclaration(SyntaxToken leftToken, int position); 65protected abstract ITypeSymbol? GetTypeSymbolOfExpression(SemanticModel semanticModel, SyntaxNode potentialAwaitableExpression, CancellationToken cancellationToken); 66protected abstract SyntaxNode? GetExpressionToPlaceAwaitInFrontOf(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken); 100var declaration = GetAsyncSupportingDeclaration(leftToken, position);
Completion\Providers\AbstractDocCommentCompletionProvider.cs (1)
21where TSyntax : SyntaxNode
Completion\Providers\AbstractInternalsVisibleToCompletionProvider.cs (12)
23protected abstract IImmutableList<SyntaxNode> GetAssemblyScopedAttributeSyntaxNodesOfDocument(SyntaxNode documentRoot); 24protected abstract SyntaxNode? GetConstructorArgumentOfInternalsVisibleToAttribute(SyntaxNode internalsVisibleToAttribute); 65var attributeSyntaxNode = GetAttributeSyntaxNodeOfToken(syntaxFactsService, token); 83private static SyntaxNode? GetAttributeSyntaxNodeOfToken(ISyntaxFactsService syntaxFactsService, SyntaxToken token) 91var node = token.Parent; 109var attributeSyntaxNodeCandidate = node.Parent?.Parent?.Parent; 119private static async Task<bool> CheckTypeInfoOfAttributeAsync(Document document, SyntaxNode attributeNode, CancellationToken cancellationToken) 185foreach (var attribute in assemblyScopedAttributes) 227private async Task<string> GetAssemblyNameFromInternalsVisibleToAttributeAsync(Document document, SyntaxNode node, CancellationToken cancellationToken) 229var constructorArgument = GetConstructorArgumentOfInternalsVisibleToAttribute(node);
Completion\Providers\AbstractMemberInsertingCompletionProvider.cs (7)
30protected abstract int GetTargetCaretPosition(SyntaxNode caretTarget); 31protected abstract SyntaxNode GetSyntax(SyntaxToken commonSyntaxToken); 41var newRoot = await newDocument.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 48var caretTarget = newRoot.GetAnnotatedNodes(_annotation).FirstOrDefault(); 109var declaration = GetSyntax(newRoot.FindToken(destinationSpan.End)); 165private TextSpan ComputeDestinationSpan(SyntaxNode insertionRoot) 203private async Task<SyntaxNode> GetTreeWithAddedSyntaxNodeRemovedAsync(
Completion\Providers\AbstractObjectCreationCompletionProvider.cs (2)
23protected abstract SyntaxNode? GetObjectCreationNewExpression(SyntaxTree tree, int position, CancellationToken cancellationToken); 50var newExpression = GetObjectCreationNewExpression(context.SyntaxTree, position, cancellationToken);
Completion\Providers\AbstractOverrideCompletionProvider.ItemGetter.cs (1)
151var root = _syntaxTree.GetRoot(_cancellationToken);
Completion\Providers\AbstractPartialTypeCompletionProvider.cs (2)
36var node = GetPartialTypeSyntaxNode(tree, position, cancellationToken); 77protected abstract SyntaxNode? GetPartialTypeSyntaxNode(SyntaxTree tree, int position, CancellationToken cancellationToken);
Completion\Providers\AbstractSymbolCompletionProvider.cs (1)
75var declarationSyntax = symbol.DeclaringSyntaxReferences.Select(r => r.GetSyntax()).SingleOrDefault();
Completion\Providers\ImportCompletionProvider\AbstractExtensionMethodImportCompletionProvider.cs (1)
80var expressionNode = syntaxFacts.GetLeftSideOfDot(parentNode, allowImplicitTarget: false);
Completion\Providers\ImportCompletionProvider\AbstractImportCompletionProvider.cs (3)
29protected abstract bool IsFinalSemicolonOfUsingOrExtern(SyntaxNode directive, SyntaxToken token); 155var importNode = CreateImport(document, containingNamespace); 240private static SyntaxNode CreateImport(Document document, string namespaceName)
Completion\Providers\ImportCompletionProvider\AbstractTypeImportCompletionProvider.cs (1)
19where AliasDeclarationTypeNode : SyntaxNode
ConvertAnonymousType\AbstractConvertAnonymousTypeCodeRefactoringProvider.cs (1)
15where TAnonymousObjectCreationExpressionSyntax : SyntaxNode
ConvertAnonymousType\AbstractConvertAnonymousTypeToClassCodeRefactoringProvider.cs (5)
34where TExpressionSyntax : SyntaxNode 39where TNamespaceDeclarationSyntax : SyntaxNode 111var containingMember = anonymousObject.FirstAncestorOrSelf<SyntaxNode, ISyntaxFactsService>((node, syntaxFacts) => syntaxFacts.IsMethodLevelMember(node), syntaxFacts) ?? anonymousObject; 150Document document, SyntaxEditor editor, SyntaxNode containingMember, 179SyntaxNode containingMember, TAnonymousObjectCreationExpressionSyntax creationNode,
ConvertAnonymousType\AbstractConvertAnonymousTypeToTupleCodeRefactoringProvider.cs (2)
23where TExpressionSyntax : SyntaxNode 84var containingMember = anonymousNode.FirstAncestorOrSelf<SyntaxNode, ISyntaxFactsService>((node, syntaxFacts) => syntaxFacts.IsMethodLevelMember(node), syntaxFacts) ?? anonymousNode;
ConvertAutoPropertyToFullProperty\AbstractConvertAutoPropertyToFullPropertyCodeRefactoringProvider.cs (20)
21where TPropertyDeclarationNode : SyntaxNode 22where TTypeDeclarationNode : SyntaxNode 26protected abstract (SyntaxNode newGetAccessor, SyntaxNode newSetAccessor) GetNewAccessors( 27TCodeGenerationContextInfo info, SyntaxNode property, string fieldName, SyntaxGenerator generator, CancellationToken cancellationToken); 28protected abstract SyntaxNode GetPropertyWithoutInitializer(SyntaxNode property); 29protected abstract SyntaxNode GetInitializerValue(SyntaxNode property); 30protected abstract SyntaxNode ConvertPropertyToExpressionBodyIfDesired(TCodeGenerationContextInfo info, SyntaxNode fullProperty); 31protected abstract SyntaxNode GetTypeBlock(SyntaxNode syntaxNode); 38var property = await GetPropertyAsync(context).ConfigureAwait(false); 64private static async Task<SyntaxNode?> GetPropertyAsync(CodeRefactoringContext context) 75SyntaxNode property, 77SyntaxNode root, 90var fullProperty = generator 111var typeBlock = GetTypeBlock(await td.GetSyntaxAsync(cancellationToken).ConfigureAwait(false)); 120var newRoot = editor.GetChangedRoot();
ConvertCast\AbstractConvertCastCodeRefactoringProvider.cs (3)
25where TTypeNode : SyntaxNode 26where TFromExpression : SyntaxNode 27where TToExpression : SyntaxNode
ConvertForEachToFor\AbstractConvertForEachToForCodeRefactoringProvider.cs (16)
28where TStatementSyntax : SyntaxNode 43protected abstract (SyntaxNode start, SyntaxNode end) GetForEachBody(TForEachStatement foreachStatement); 86ISemanticFactsService semanticFacts, SemanticModel model, SyntaxNode location, string baseName, CancellationToken cancellationToken) 89protected static SyntaxNode GetCollectionVariableName( 91ForEachInfo foreachInfo, SyntaxNode foreachCollectionExpression, CancellationToken cancellationToken) 105SyntaxNode type, SyntaxNode foreachCollectionExpression, SyntaxNode collectionVariable) 119var expression = foreachCollectionExpression.WithoutAnnotations(SimplificationHelpers.DoNotSimplifyAnnotation); 120var collectionStatement = generator.LocalDeclarationStatement( 132SyntaxGenerator generator, SyntaxNode type, SyntaxToken foreachVariable, 133ITypeSymbol castType, SyntaxNode collectionVariable, SyntaxToken indexVariable) 135var memberAccess = generator.ElementAccessExpression( 143var localDecl = generator.LocalDeclarationStatement( 424var newRoot = editor.GetChangedRoot();
ConvertForToForEach\AbstractConvertForToForEachCodeRefactoringProvider.cs (17)
29where TStatementSyntax : SyntaxNode 31where TExpressionSyntax : SyntaxNode 32where TMemberAccessExpressionSyntax : SyntaxNode 33where TTypeNode : SyntaxNode 34where TVariableDeclaratorSyntax : SyntaxNode 49protected abstract SyntaxNode ConvertForNode( 146bool IterationVariableIsUsedForMoreThanCollectionIndex(SyntaxNode current) 156var argument = current.Parent; 161var argumentList = argument?.Parent; 194bool IsGoodElementAccessExpression(SyntaxNode argumentList) 208bool IsGoodInvocationExpression(SyntaxNode argumentList) 329var indexExpression = generator.ElementAccessExpression(collectionExpression, generator.IdentifierName(iterationVariable)); 330var elementAtExpression = generator.InvocationExpression( 420void FindAndReplaceMatches(SyntaxNode current) 466bool CrossesFunctionBoundary(SyntaxNode node) 468var containingFunction = node.AncestorsAndSelf().FirstOrDefault( 477void Replace(SyntaxNode indexMatch)
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.AnalyzedNodes.cs (6)
15where TIfStatementSyntax : SyntaxNode 16where TExpressionSyntax : SyntaxNode 17where TIsExpressionSyntax : SyntaxNode 18where TPatternSyntax : SyntaxNode 24internal sealed class AnalyzedSwitchSection(ImmutableArray<AnalyzedSwitchLabel> labels, IOperation body, SyntaxNode syntaxToRemove) 28public readonly SyntaxNode SyntaxToRemove = syntaxToRemove;
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.Analyzer.cs (6)
51public abstract bool CanImplicitlyConvert(SemanticModel semanticModel, SyntaxNode syntax, ITypeSymbol targetType); 59private SyntaxNode _switchTargetExpression = null!; 77public (ImmutableArray<AnalyzedSwitchSection>, SyntaxNode TargetExpression) AnalyzeIfStatementSequence(ReadOnlySpan<IOperation> operations) 366private (SyntaxNode Lower, SyntaxNode Higher) GetRangeBounds(IBinaryOperation op) 445var expression = operation.Syntax;
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.cs (3)
45if (!ShouldOfferRefactoring(ifStatement, semanticModel, syntaxFactsService, out var analyzer, out var sections, out var target)) 75[NotNullWhen(true)] out SyntaxNode? target) 248if (!ShouldOfferRefactoring(ifStatement, semanticModel, syntaxFactsService, out var analyzer, out var sections, out var target))
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.Rewriting.cs (11)
22public abstract SyntaxNode CreateSwitchExpressionStatement(SyntaxNode target, ImmutableArray<AnalyzedSwitchSection> sections, Feature feature); 23public abstract SyntaxNode CreateSwitchStatement(TIfStatementSyntax ifStatement, SyntaxNode target, IEnumerable<SyntaxNode> sectionList); 24public abstract IEnumerable<SyntaxNode> AsSwitchSectionStatements(IOperation operation); 25public abstract SyntaxNode AsSwitchLabelSyntax(AnalyzedSwitchLabel label, Feature feature); 26protected abstract SyntaxTriviaList GetLeadingTriviaToTransfer(SyntaxNode syntaxToRemove); 30SyntaxNode target, 42var @switch = convertToSwitchExpression 60private SyntaxNode AsSwitchSectionSyntax(AnalyzedSwitchSection section, SyntaxGenerator generator, Feature feature)
ConvertLinq\AbstractConvertLinqQueryToForEachProvider.cs (4)
17where TQueryExpression : SyntaxNode 18where TStatement : SyntaxNode 70public SyntaxNode UpdateRoot(SyntaxNode root)
ConvertLinq\ConvertForEachToLinqQuery\AbstractConvertForEachToLinqQueryProvider.cs (5)
18where TStatement : SyntaxNode 62protected abstract SyntaxNode AddLinqUsing( 63IConverter<TForEachStatement, TStatement> converter, SemanticModel semanticModel, SyntaxNode root); 153var newRoot = editor.GetChangedRoot(); 154var rootWithLinqUsing = AddLinqUsing(converter, converter.ForEachInfo.SemanticModel, newRoot);
ConvertLinq\ConvertForEachToLinqQuery\ExtendedSyntaxNode.cs (3)
12SyntaxNode node, 16public SyntaxNode Node { get; } = node; 23SyntaxNode node,
ConvertNumericLiteral\AbstractConvertNumericLiteralCodeRefactoringProvider.cs (3)
20where TNumericLiteralExpression : SyntaxNode 121static Task<Document> ReplaceTokenAsync(Document document, SyntaxNode root, SyntaxToken numericToken, long value, string text, string suffix) 126var updatedRoot = root.ReplaceToken(numericToken, updatedToken);
ConvertToInterpolatedString\AbstractConvertConcatenationToInterpolatedStringRefactoringProvider.cs (22)
25where TExpressionSyntax : SyntaxNode 51var declarator = top.FirstAncestorOrSelf<SyntaxNode>(syntaxFacts.IsVariableDeclarator); 69using var _ = ArrayBuilder<SyntaxNode>.GetInstance(out var pieces); 110Document document, SyntaxNode top, bool isVerbatimStringLiteral, ImmutableArray<SyntaxNode> pieces, CancellationToken cancellationToken) 113var interpolatedString = await CreateInterpolatedStringAsync( 119protected async Task<SyntaxNode> CreateInterpolatedStringAsync( 120Document document, bool isVerbatimStringLiteral, ImmutableArray<SyntaxNode> pieces, CancellationToken cancellationToken) 134using var _ = ArrayBuilder<SyntaxNode>.GetInstance(pieces.Length, out var content); 136foreach (var piece in pieces) 157var newText = ConcatenateTextToTextNode(generator, existingInterpolatedStringTextNode, textWithoutQuotes, valueTextWithEscapedBraces); 183var newText = ConcatenateTextToTextNode(generator, content.Last(), contentPart.GetFirstToken().Text, contentPart.GetFirstToken().ValueText); 198var converted = TryRemoveToString(piece); 214SyntaxNode TryRemoveToString(SyntaxNode piece) 244private static SyntaxNode ConcatenateTextToTextNode(SyntaxGenerator generator, SyntaxNode interpolatedStringTextNode, string textWithoutQuotes, string value) 255ArrayBuilder<SyntaxNode> pieces, 256SyntaxNode node, 266syntaxFacts.GetPartsOfBinaryExpression(node, out var left, out var right); 273ISyntaxFactsService syntaxFacts, SyntaxNode? expression,
ConvertToInterpolatedString\AbstractConvertPlaceholderToInterpolatedStringRefactoringProvider.cs (4)
30where TExpressionSyntax : SyntaxNode 34where TArgumentSyntax : SyntaxNode 35where TArgumentListExpressionSyntax : SyntaxNode 36where TInterpolationSyntax : SyntaxNode
ConvertToInterpolatedString\ConvertRegularStringToInterpolatedStringRefactoringProvider.cs (6)
60var declarator = literalExpression.FirstAncestorOrSelf<SyntaxNode>(syntaxFacts.IsVariableDeclarator); 69var attribute = literalExpression.FirstAncestorOrSelf<SyntaxNode>(syntaxFacts.IsAttribute); 90private static SyntaxNode CreateInterpolatedString(Document document, SyntaxNode literalExpression, bool isVerbatim) 95var newNode = generator.InterpolatedStringText( 106private static Task<Document> UpdateDocumentAsync(Document document, SyntaxNode root, SyntaxToken token)
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (32)
48where TExpressionSyntax : SyntaxNode 54where TArgumentSyntax : SyntaxNode 55where TTupleTypeSyntax : SyntaxNode 56where TTypeBlockSyntax : SyntaxNode 57where TNamespaceDeclarationSyntax : SyntaxNode 121SyntaxNode tupleExprOrTypeNode, 127var containingMember = GetContainingMember(context.Document, tupleExprOrTypeNode); 164private static SyntaxNode? GetContainingMember(Document document, SyntaxNode tupleExprOrTypeNode) 167return tupleExprOrTypeNode.FirstAncestorOrSelf<SyntaxNode, ISyntaxFactsService>((node, syntaxFacts) => syntaxFacts.IsMethodLevelMember(node), syntaxFacts); 183private static async Task<(SyntaxNode, INamedTypeSymbol)> TryGetTupleInfoAsync( 198var expressionOrType = 199parsedDocument.TryGetRelevantNode<TTupleTypeSyntax>(span, cancellationToken) as SyntaxNode ?? 327SyntaxNode tupleExprOrTypeNode, INamedTypeSymbol tupleType, 419Document document, SyntaxNode tupleExprOrTypeNode, 518Document startingDocument, SyntaxNode tupleExprOrTypeNode, CancellationToken cancellationToken) 543Document document, SyntaxNode tupleExprOrTypeNode) 545var containingMember = GetContainingMember(document, tupleExprOrTypeNode); 553Document document, SyntaxNode tupleExprOrTypeNode, INamedTypeSymbol namedTypeSymbol, 591var newRoot = editor.GetChangedRoot(); 615SyntaxNode startingNode, INamedTypeSymbol tupleType, TNameSyntax fullyQualifiedStructName, 617SyntaxNode containerToUpdate, CancellationToken cancellationToken) 635SyntaxNode startingNode, INamedTypeSymbol tupleType, TNameSyntax qualifiedTypeName, 637SyntaxNode containingMember, CancellationToken cancellationToken) 691TNameSyntax qualifiedTypeName, SyntaxNode startingCreationNode, TTupleExpressionSyntax childCreation, 748Document document, SyntaxEditor editor, SyntaxNode startingNode, 751SyntaxNode containingMember, CancellationToken cancellationToken) 781TNameSyntax qualifiedTypeName, SyntaxNode startingNode, TTupleTypeSyntax childTupleType) 885var valueNode = generator.IdentifierName(ValueName); 886var arguments = tupleType.TupleElements.SelectAsArray<IFieldSymbol, SyntaxNode>( 890var convertToTupleStatement = generator.ReturnStatement( 893var convertToStructStatement = generator.ReturnStatement(
ConvertTupleToStruct\DocumentToUpdate.cs (2)
9internal readonly struct DocumentToUpdate(Document document, ImmutableArray<SyntaxNode> nodesToUpdate) 20public readonly ImmutableArray<SyntaxNode> NodesToUpdate = nodesToUpdate;
DesignerAttribute\DesignerAttributeDiscoveryService.cs (5)
300var firstClass = FindFirstNonNestedClass(syntaxFacts.GetMembersOfCompilationUnit(root)); 363SyntaxNode? FindFirstNonNestedClass(SyntaxList<SyntaxNode> members) 365foreach (var member in members) 370var firstClass = FindFirstNonNestedClass(syntaxFacts.GetMembersOfBaseNamespaceDeclaration(member));
Diagnostics\Analyzers\UnboundIdentifiersDiagnosticAnalyzerBase.cs (7)
25where TSimpleNameSyntax : SyntaxNode 26where TQualifiedNameSyntax : SyntaxNode 27where TIncompleteMemberSyntax : SyntaxNode 31protected abstract bool IsNameOf(SyntaxNode node); 67private void ReportUnboundIdentifierNames(SyntaxNodeAnalysisContext context, SyntaxNode member) 70foreach (var typeName in typeNames) 86private static bool IsQualifiedOrSimpleName(SyntaxNode n)
DocumentationComments\AbstractDocumentationCommentSnippetService.cs (2)
18where TDocumentationComment : SyntaxNode, IStructuredTriviaSyntax 19where TMemberNode : SyntaxNode
DocumentHighlighting\AbstractDocumentHighlightsService.cs (2)
97var root = semanticModel.SyntaxTree.GetRoot(cancellationToken); 314var root = await tree.GetRootAsync(cancellationToken).ConfigureAwait(false);
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (205)
72private readonly Action<SyntaxNode>? _testFaultInjector; 74protected AbstractEditAndContinueAnalyzer(Action<SyntaxNode>? testFaultInjector) 95internal abstract bool TryFindMemberDeclaration(SyntaxNode? root, SyntaxNode node, TextSpan activeSpan, out OneOrMany<SyntaxNode> declarations); 110internal abstract MemberBody? TryGetDeclarationBody(SyntaxNode node, ISymbol? symbol); 115internal abstract bool IsDeclarationWithSharedBody(SyntaxNode declaration, ISymbol member); 122protected abstract LambdaBody? FindEnclosingLambdaBody(SyntaxNode encompassingAncestor, SyntaxNode node); 124protected abstract Match<SyntaxNode> ComputeTopLevelMatch(SyntaxNode oldCompilationUnit, SyntaxNode newCompilationUnit); 125protected abstract BidirectionalMap<SyntaxNode>? ComputeParameterMap(SyntaxNode oldDeclaration, SyntaxNode newDeclaration); 126protected abstract IEnumerable<SequenceEdit> GetSyntaxSequenceEdits(ImmutableArray<SyntaxNode> oldNodes, ImmutableArray<SyntaxNode> newNodes); 134/// In case there are multiple breakpoint spans starting at the <see cref="SyntaxNode.SpanStart"/> of the <paramref name="node"/>, 145protected abstract bool TryGetActiveSpan(SyntaxNode node, int statementPart, int minLength, out TextSpan span); 155protected abstract IEnumerable<(SyntaxNode statement, int statementPart)> EnumerateNearStatements(SyntaxNode statement); 157protected abstract bool StatementLabelEquals(SyntaxNode node1, SyntaxNode node2); 166protected abstract bool AreEquivalentActiveStatements(SyntaxNode oldStatement, SyntaxNode newStatement, int statementPart); 176protected abstract bool IsNamespaceDeclaration(SyntaxNode node); 177protected abstract bool IsCompilationUnitWithGlobalStatements(SyntaxNode node); 178protected abstract bool IsGlobalStatement(SyntaxNode node); 183protected abstract IEnumerable<SyntaxNode> GetTopLevelTypeDeclarations(SyntaxNode compilationUnit); 193SyntaxNode? oldNode, 195SyntaxNode? newNode, 199Match<SyntaxNode> topMatch, 200IReadOnlyDictionary<SyntaxNode, EditKind> editMap, 209SyntaxNode? oldNode, 210SyntaxNode? newNode, 217SyntaxNode? oldNode, 218SyntaxNode? newNode, 221Match<SyntaxNode> topMatch, 222IReadOnlyDictionary<SyntaxNode, EditKind> editMap, 264protected abstract IEnumerable<SyntaxNode> GetVariableUseSites(IEnumerable<SyntaxNode> roots, ISymbol localOrParameter, SemanticModel model, CancellationToken cancellationToken); 269protected abstract TextSpan? TryGetDiagnosticSpan(SyntaxNode node, EditKind editKind); 271internal TextSpan GetDiagnosticSpan(SyntaxNode node, EditKind editKind) 274protected virtual TextSpan GetBodyDiagnosticSpan(SyntaxNode node, EditKind editKind) 276var current = node.Parent; 294internal abstract TextSpan GetLambdaParameterDiagnosticSpan(SyntaxNode lambda, int ordinal); 316internal string GetDisplayName(SyntaxNode node, EditKind editKind = EditKind.Update) 367protected virtual string GetBodyDisplayName(SyntaxNode node, EditKind editKind = EditKind.Update) 369var current = node.Parent; 397protected abstract string? TryGetDisplayName(SyntaxNode node, EditKind editKind); 399protected virtual string GetSuspensionPointDisplayName(SyntaxNode node, EditKind editKind) 405protected abstract List<SyntaxNode> GetExceptionHandlingAncestors(SyntaxNode node, SyntaxNode root, bool isNonLeaf); 406protected abstract TextSpan GetExceptionHandlingRegion(SyntaxNode node, out bool coversAllChildren); 408internal abstract void ReportTopLevelSyntacticRudeEdits(ArrayBuilder<RudeEditDiagnostic> diagnostics, Match<SyntaxNode> match, Edit<SyntaxNode> edit, Dictionary<SyntaxNode, EditKind> editMap); 409internal abstract void ReportEnclosingExceptionHandlingRudeEdits(ArrayBuilder<RudeEditDiagnostic> diagnostics, IEnumerable<Edit<SyntaxNode>> exceptionHandlingEdits, SyntaxNode oldStatement, TextSpan newStatementSpan); 411internal abstract bool HasUnsupportedOperation(IEnumerable<SyntaxNode> newNodes, [NotNullWhen(true)] out SyntaxNode? unsupportedNode, out RudeEditKind rudeEdit); 415if (HasUnsupportedOperation(body.GetDescendantNodes(IsNotLambda), out var unsupportedNode, out var rudeEdit)) 426IReadOnlyDictionary<SyntaxNode, SyntaxNode> forwardMap, 427SyntaxNode oldActiveStatement, 430SyntaxNode newActiveStatement, 436internal abstract void ReportInsertedMemberSymbolRudeEdits(ArrayBuilder<RudeEditDiagnostic> diagnostics, ISymbol newSymbol, SyntaxNode newNode, bool insertingIntoExistingContainingType); 437internal abstract void ReportStateMachineSuspensionPointRudeEdits(DiagnosticContext diagnosticContext, SyntaxNode oldNode, SyntaxNode newNode); 439internal abstract Func<SyntaxNode, bool> IsLambda { get; } 440internal abstract Func<SyntaxNode, bool> IsNotLambda { get; } 442internal abstract bool IsInterfaceDeclaration(SyntaxNode node); 443internal abstract bool IsRecordDeclaration(SyntaxNode node); 448internal abstract bool IsNestedFunction(SyntaxNode node); 450internal abstract bool IsLocalFunction(SyntaxNode node); 451internal abstract bool IsGenericLocalFunction(SyntaxNode node); 452internal abstract bool IsClosureScope(SyntaxNode node); 453internal abstract SyntaxNode GetCapturedParameterScope(SyntaxNode declaringMethodOrLambda); 454internal abstract IMethodSymbol GetLambdaExpressionSymbol(SemanticModel model, SyntaxNode lambdaExpression, CancellationToken cancellationToken); 455internal abstract SyntaxNode? GetContainingQueryExpression(SyntaxNode node); 456internal abstract bool QueryClauseLambdasTypeEquivalent(SemanticModel oldModel, SyntaxNode oldNode, SemanticModel newModel, SyntaxNode newNode, CancellationToken cancellationToken); 474internal abstract bool TryGetLambdaBodies(SyntaxNode node, [NotNullWhen(true)] out LambdaBody? body1, out LambdaBody? body2); 476internal abstract bool IsStateMachineMethod(SyntaxNode declaration); 482internal abstract SyntaxNode? TryGetContainingTypeDeclaration(SyntaxNode node); 488internal abstract bool IsDeclarationWithInitializer(SyntaxNode declaration); 498internal abstract bool IsPrimaryConstructorDeclaration(SyntaxNode declaration); 507internal abstract SyntaxNode EmptyCompilationUnit { get; } 538SyntaxNode oldRoot; 562var newRoot = await newTree.GetRootAsync(cancellationToken).ConfigureAwait(false); 630using var _3 = ArrayBuilder<(SyntaxNode OldNode, SyntaxNode NewNode, TextSpan DiagnosticSpan)>.GetInstance(out var triviaEdits); 736private void ReportTopLevelSyntacticRudeEdits(ArrayBuilder<RudeEditDiagnostic> diagnostics, EditScript<SyntaxNode> syntacticEdits, Dictionary<SyntaxNode, EditKind> editMap) 744internal Dictionary<SyntaxNode, EditKind> BuildEditMap(EditScript<SyntaxNode> editScript) 746var map = new Dictionary<SyntaxNode, EditKind>(editScript.Edits.Length); 783Match<SyntaxNode> topMatch, 813var hasPartner = topMatch.TryGetNewNode(oldMember, out var newMember); 827SyntaxNode? newStatement = null; 888internal readonly struct ActiveNode(int activeStatementIndex, SyntaxNode oldNode, LambdaBody? enclosingLambdaBody, int statementPart, SyntaxNode? newTrackedNode) 891public readonly SyntaxNode OldNode = oldNode; 892public readonly SyntaxNode? NewTrackedNode = newTrackedNode; 929SyntaxNode? oldDeclaration, 930SyntaxNode? newDeclaration, 940Match<SyntaxNode> topMatch, 1016var oldStatementSyntax = oldMemberBody.FindStatement(oldStatementSpan, out var statementPart); 1033SyntaxNode? trackedNode = null; 1168SyntaxNode? newStatementSyntax; 1307private static bool TryGetTrackedStatement(ImmutableArray<ActiveStatementLineSpan> activeStatementSpans, ActiveStatementId id, SourceText text, MemberBody body, [NotNullWhen(true)] out SyntaxNode? trackedStatement, out int trackedStatementPart) 1352IReadOnlyDictionary<SyntaxNode, SyntaxNode> forwardMap, 1353SyntaxNode oldStatementSyntax, 1354SyntaxNode oldEncompassingAncestor, 1355SyntaxNode? newStatementSyntax, 1356SyntaxNode newEncompassingAncestor, 1381var edits = new MapBasedLongestCommonSubsequence<SyntaxNode>(forwardMap).GetEdits(oldAncestors, newAncestors); 1401ArrayBuilder<(DeclarationBodyMap map, SyntaxNode? oldLambda)>? lambdaBodyMaps = null; 1402SyntaxNode? currentOldLambda = null; 1418lambdaBodyMaps ??= ArrayBuilder<(DeclarationBodyMap, SyntaxNode?)>.GetInstance(); 1452var map = new Dictionary<SyntaxNode, SyntaxNode>(); 1453var additionalReverseMap = ImmutableDictionary.CreateBuilder<SyntaxNode, SyntaxNode>(); 1558private static List<KeyValuePair<SyntaxNode, SyntaxNode>>? GetMatchingActiveNodes(IEnumerable<ActiveNode> activeNodes) 1561List<KeyValuePair<SyntaxNode, SyntaxNode>>? lazyKnownMatches = null; 1575public ActiveStatementExceptionRegions GetExceptionRegions(SyntaxNode root, TextSpan unmappedActiveStatementSpan, bool isNonLeaf, CancellationToken cancellationToken) 1577var node = root.FindToken(unmappedActiveStatementSpan.Start).Parent; 1584private ActiveStatementExceptionRegions GetExceptionRegions(List<SyntaxNode> exceptionHandlingAncestors, SyntaxTree tree, CancellationToken cancellationToken) 1617SyntaxNode oldEncompassingAncestor, 1618IReadOnlyDictionary<SyntaxNode, SyntaxNode> forwardMap, 1624var oldLambda = oldLambdaBody.GetLambda(); 1640private TextSpan FindClosestActiveSpan(SyntaxNode statement, int statementPart) 1667internal TextSpan GetDeletedNodeActiveSpan(IReadOnlyDictionary<SyntaxNode, SyntaxNode> forwardMap, SyntaxNode deletedNode) 1676if (forwardMap.TryGetValue(oldNode, out var newNode)) 1685internal TextSpan GetDeletedDeclarationActiveSpan(IReadOnlyDictionary<SyntaxNode, SyntaxNode> forwardMap, SyntaxNode deletedDeclaration) 1707internal TextSpan GetDeletedNodeDiagnosticSpan(IReadOnlyDictionary<SyntaxNode, SyntaxNode> forwardMap, SyntaxNode deletedNode) 1717private static bool TryGetMatchingAncestor(IReadOnlyDictionary<SyntaxNode, SyntaxNode> forwardMap, SyntaxNode? oldNode, [NotNullWhen(true)] out SyntaxNode? newAncestor) 1735protected static bool HasParentEdit(IReadOnlyDictionary<SyntaxNode, EditKind> editMap, Edit<SyntaxNode> edit) 1737SyntaxNode node; 1755protected static bool HasEdit(IReadOnlyDictionary<SyntaxNode, EditKind> editMap, SyntaxNode? node, EditKind editKind) 1767protected void AddAroundActiveStatementRudeDiagnostic(ArrayBuilder<RudeEditDiagnostic> diagnostics, SyntaxNode? oldNode, SyntaxNode? newNode, TextSpan newActiveStatementSpan) 1785protected void AddRudeTypeUpdateAroundActiveStatement(ArrayBuilder<RudeEditDiagnostic> diagnostics, SyntaxNode newNode, ITypeSymbol oldType, ITypeSymbol newType) 1794protected void AddRudeUpdateAroundActiveStatement(ArrayBuilder<RudeEditDiagnostic> diagnostics, SyntaxNode newNode) 1803protected void AddRudeInsertAroundActiveStatement(ArrayBuilder<RudeEditDiagnostic> diagnostics, SyntaxNode newNode) 1812protected void AddRudeDeleteAroundActiveStatement(ArrayBuilder<RudeEditDiagnostic> diagnostics, SyntaxNode oldNode, TextSpan newActiveStatementSpan) 1823IReadOnlyDictionary<SyntaxNode, SyntaxNode> reverseMap, 1824SyntaxNode oldActiveStatement, 1825SyntaxNode oldEncompassingAncestor, 1827SyntaxNode newActiveStatement, 1828SyntaxNode newEncompassingAncestor, 1830Func<SyntaxNode, bool> nodeSelector, 1831Func<TSyntaxNode, OneOrMany<SyntaxNode>> getTypedNodes, 1835where TSyntaxNode : SyntaxNode 1867private void ReportRudeEditsAndInserts(List<SyntaxNode?>? oldNodes, List<SyntaxNode?> newNodes, ArrayBuilder<RudeEditDiagnostic> diagnostics) 1873var newNode = newNodes[i]; 1893List<SyntaxNode?> oldNodes, 1895List<SyntaxNode?> newNodes, 1898IReadOnlyDictionary<SyntaxNode, SyntaxNode>? reverseMap, 1899Func<TSyntaxNode, OneOrMany<SyntaxNode>> getTypedNodes, 1903where TSyntaxNode : SyntaxNode 1909var newNode = newNodes[newIndex]; 1915SyntaxNode? oldNode; 1939else if (reverseMap.TryGetValue(newNode, out var oldPartner) && comparer((TSyntaxNode)oldPartner, (TSyntaxNode)newNode)) 1990private static int IndexOfEquivalent<TSyntaxNode>(SyntaxNode newNode, List<SyntaxNode?> oldNodes, int startIndex, Func<TSyntaxNode, TSyntaxNode, bool> comparer) 1991where TSyntaxNode : SyntaxNode 1995var oldNode = oldNodes[i]; 2005private static List<SyntaxNode?>? GetAncestors(SyntaxNode? root, SyntaxNode node, Func<SyntaxNode, bool> nodeSelector) 2007List<SyntaxNode?>? list = null; 2008var current = node; 2039Match<SyntaxNode> topMatch, 2040IReadOnlyDictionary<SyntaxNode, EditKind> editMap, 2041[Out] ArrayBuilder<(SyntaxNode OldNode, SyntaxNode NewNode, TextSpan DiagnosticSpan)> triviaEdits, 2056using var _ = ArrayBuilder<(string filePath, int oldStartLine, int oldEndLine, int delta, SyntaxNode oldNode, SyntaxNode newNode)>.GetInstance(out var segments); 2480public readonly Dictionary<SyntaxNode, SyntaxMaps> ChangedDeclarations = [];
EditAndContinue\AbstractSimpleMemberBody.cs (4)
12internal abstract class AbstractSimpleMemberBody(SyntaxNode node) : MemberBody 14public SyntaxNode Node 20public sealed override OneOrMany<SyntaxNode> RootNodes 26public sealed override SyntaxNode EncompassingAncestor
EditAndContinue\ActiveStatementsMap.cs (2)
180internal ImmutableArray<UnmappedActiveStatement> GetOldActiveStatements(IEditAndContinueAnalyzer analyzer, SyntaxTree oldSyntaxTree, SourceText oldText, SyntaxNode oldRoot, CancellationToken cancellationToken) 190private ImmutableArray<UnmappedActiveStatement> CalculateOldActiveStatementsAndExceptionRegions(IEditAndContinueAnalyzer analyzer, SyntaxTree oldTree, SourceText oldText, SyntaxNode oldRoot, CancellationToken cancellationToken)
EditAndContinue\DeclarationBody.cs (15)
22public abstract OneOrMany<SyntaxNode> RootNodes { get; } 31public virtual IEnumerable<SyntaxNode> GetExpressionsAndStatements() 39public IEnumerable<SyntaxNode> GetDescendantNodes(Func<SyntaxNode, bool> descendIntoChildren) 41foreach (var root in GetExpressionsAndStatements()) 43foreach (var node in root.DescendantNodesAndSelf(descendIntoChildren)) 51/// <see cref="SyntaxNode"/> that includes all active tokens (<see cref="MemberBody.GetActiveTokens"/>) 55public abstract SyntaxNode EncompassingAncestor { get; } 68public virtual DeclarationBodyMap ComputeMap(DeclarationBody newBody, IEnumerable<KeyValuePair<SyntaxNode, SyntaxNode>>? knownMatches) 78public abstract Match<SyntaxNode>? ComputeSingleRootMatch(DeclarationBody newBody, IEnumerable<KeyValuePair<SyntaxNode, SyntaxNode>>? knownMatches); 84public abstract bool TryMatchActiveStatement(DeclarationBody newBody, SyntaxNode oldStatement, ref int statementPart, [NotNullWhen(true)] out SyntaxNode? newStatement);
EditAndContinue\DeclarationBodyMap.cs (23)
15SpecializedCollections.EmptyReadOnlyDictionary<SyntaxNode, SyntaxNode>(), 16SpecializedCollections.EmptyReadOnlyDictionary<SyntaxNode, SyntaxNode>(), 17ImmutableDictionary<SyntaxNode, SyntaxNode>.Empty); 19public IReadOnlyDictionary<SyntaxNode, SyntaxNode> Forward { get; } 20public IReadOnlyDictionary<SyntaxNode, SyntaxNode> Reverse { get; } 22public ImmutableDictionary<SyntaxNode, SyntaxNode> AdditionalReverseMapping { get; } 25IReadOnlyDictionary<SyntaxNode, SyntaxNode> forwardMatch, 26IReadOnlyDictionary<SyntaxNode, SyntaxNode> reverseMatch, 27ImmutableDictionary<SyntaxNode, SyntaxNode> additionalReverseMapping) 36public static DeclarationBodyMap FromMatch(Match<SyntaxNode> match) 37=> new(match.Matches, match.ReverseMatches, ImmutableDictionary<SyntaxNode, SyntaxNode>.Empty); 39public DeclarationBodyMap WithAdditionalMapping(SyntaxNode oldNode, SyntaxNode newNode)
EditAndContinue\EditSession.cs (6)
749var mergedUpdateEditSyntaxMaps = new Dictionary<SymbolKey, (Func<SyntaxNode, SyntaxNode?>? matchingNodes, Func<SyntaxNode, RuntimeRudeEdit?>? runtimeRudeEdits)>(symbolKeyComparer); 757Func<SyntaxNode, SyntaxNode?>? mergedMatchingNodes; 758Func<SyntaxNode, RuntimeRudeEdit?>? mergedRuntimeRudeEdits;
EditAndContinue\IEditAndContinueAnalyzer.cs (1)
24ActiveStatementExceptionRegions GetExceptionRegions(SyntaxNode syntaxRoot, TextSpan unmappedActiveStatementSpan, bool isNonLeaf, CancellationToken cancellationToken);
EditAndContinue\LambdaBody.cs (2)
9public abstract SyntaxNode GetLambda(); 16public abstract LambdaBody? TryGetPartnerLambdaBody(SyntaxNode newLambda);
EditAndContinue\MemberBody.cs (3)
40public abstract SyntaxNode FindStatementAndPartner(TextSpan span, MemberBody? partnerDeclarationBody, out SyntaxNode? partnerStatement, out int statementPart); 42public SyntaxNode FindStatement(TextSpan span, out int statementPart)
EditAndContinue\RudeEditDiagnostic.cs (1)
36internal RudeEditDiagnostic(RudeEditKind kind, TextSpan span, SyntaxNode? node = null, string?[]? arguments = null)
EditAndContinue\SemanticEditInfo.cs (6)
20public readonly Func<SyntaxNode, SyntaxNode?>? MatchingNodes; 21public readonly Func<SyntaxNode, RuntimeRudeEdit?>? RuntimeRudeEdits; 25Func<SyntaxNode, SyntaxNode?>? matchingNodes = null, 26Func<SyntaxNode, RuntimeRudeEdit?>? runtimeRudeEdits = null)
EmbeddedLanguages\AbstractLanguageDetector.cs (5)
30protected abstract bool IsArgumentToWellKnownAPI(SyntaxToken token, SyntaxNode argumentNode, SemanticModel semanticModel, CancellationToken cancellationToken, out TOptions options); 37protected abstract bool TryGetOptions(SemanticModel semanticModel, ITypeSymbol exprType, SyntaxNode expr, CancellationToken cancellationToken, out TOptions options); 108SyntaxNode argument, 139protected static string? GetNameOfType(SyntaxNode? typeNode, ISyntaxFacts syntaxFacts) 153protected string? GetNameOfInvokedExpression(SyntaxNode invokedExpression)
EmbeddedLanguages\Classification\AbstractEmbeddedLanguageClassificationService.cs (2)
57var root = semanticModel.SyntaxTree.GetRoot(cancellationToken); 84public void VisitTokens(SyntaxNode node)
EmbeddedLanguages\DateAndTime\LanguageServices\DateAndTimeEmbeddedLanguage.cs (1)
40private static SyntaxToken GetToken(ISyntaxFactsService syntaxFacts, SyntaxNode root, int position)
EmbeddedLanguages\DateAndTime\LanguageServices\DateAndTimeLanguageDetector.cs (8)
44protected override bool TryGetOptions(SemanticModel semanticModel, ITypeSymbol exprType, SyntaxNode expr, CancellationToken cancellationToken, out DateAndTimeOptions options) 61var interpolationFormatClause = token.Parent; 62var interpolation = interpolationFormatClause?.Parent; 73SyntaxNode argumentNode, 80var argumentList = argumentNode.Parent; 81var invocationOrCreation = argumentList?.Parent; 119private static string? GetNameOfInvokedExpression(ISyntaxFacts syntaxFacts, SyntaxNode invokedExpression) 137private (string? name, int? index) GetArgumentNameOrIndex(SyntaxNode argument)
EmbeddedLanguages\EmbeddedLanguageDetector.cs (12)
103for (var node = token.Parent; node != null; node = node.Parent) 166var interpolationFormatClause = token.Parent; 167var interpolation = interpolationFormatClause?.Parent; 239var statement = container.FirstAncestorOrSelf<SyntaxNode>(syntaxFacts.IsStatement); 308var statement = container.FirstAncestorOrSelf<SyntaxNode>(syntaxFacts.IsStatement); 333SyntaxNode tokenParent, 382private SyntaxNode? TryFindContainer(SyntaxToken token) 396SyntaxNode argument, 412SyntaxNode argument, 426SyntaxNode left, 496private static string? GetNameOfType(SyntaxNode? typeNode, ISyntaxFacts syntaxFacts) 510private string? GetNameOfInvokedExpression(SyntaxNode invokedExpression)
EmbeddedLanguages\Json\LanguageServices\AbstractJsonDetectionAnalyzer.cs (1)
61SyntaxNode node,
EmbeddedLanguages\Json\LanguageServices\AbstractJsonDiagnosticAnalyzer.cs (1)
54SyntaxNode node,
EmbeddedLanguages\Json\LanguageServices\JsonLanguageDetector.cs (3)
127SyntaxNode argumentNode, 160SemanticModel semanticModel, ITypeSymbol exprType, SyntaxNode expr, CancellationToken cancellationToken, out JsonOptions options) 205SemanticModel semanticModel, SyntaxNode argumentNode, CancellationToken cancellationToken)
EmbeddedLanguages\RegularExpressions\LanguageServices\AbstractRegexDiagnosticAnalyzer.cs (1)
53using var _ = ArrayBuilder<SyntaxNode>.GetInstance(out var stack);
EmbeddedLanguages\RegularExpressions\LanguageServices\RegexLanguageDetector.cs (4)
74SyntaxNode argumentNode, 144SyntaxNode argumentNode, 166SyntaxNode argumentNode, 184SemanticModel semanticModel, ITypeSymbol exprType, SyntaxNode expr, CancellationToken cancellationToken, out RegexOptions options)
EncapsulateField\AbstractEncapsulateFieldService.cs (8)
31where TConstructorDeclarationSyntax : SyntaxNode 40protected abstract Task<SyntaxNode> RewriteFieldNameAndAccessibilityAsync(string originalFieldName, bool makePrivate, Document document, SyntaxAnnotation declarationAnnotation, CancellationToken cancellationToken); 197var rewrittenFieldDeclaration = await RewriteFieldNameAndAccessibilityAsync(finalFieldName, markFieldPrivate, document, declarationAnnotation, cancellationToken).ConfigureAwait(false); 206var newDeclaration = newRoot.GetAnnotatedNodes<SyntaxNode>(declarationAnnotation).First(); 379var assigned = !field.IsStatic 385var body = factory.ExpressionStatement( 398var value = !field.IsStatic 404var body = factory.ReturnStatement(
ExternalAccess\UnitTesting\SolutionCrawler\IUnitTestingDocumentDifferenceService.cs (2)
11internal sealed class UnitTestingDocumentDifferenceResult(UnitTestingInvocationReasons changeType, SyntaxNode? changedMember = null) 14public SyntaxNode? ChangedMember { get; } = changedMember;
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.cs (2)
325private async Task EnqueueDocumentWorkItemAsync(Project project, DocumentId documentId, TextDocument? document, UnitTestingInvocationReasons invocationReasons, SyntaxNode? changedMember = null) 353private static SyntaxPath? GetSyntaxPath(SyntaxNode? changedMember)
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingIncrementalAnalyzerProcessor.cs (1)
185var root = await GetOrDefaultAsync(document, (d, c) => d.GetSyntaxRootAsync(c), cancellationToken).ConfigureAwait(false);
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingSemanticChangeProcessor.cs (1)
106!changedMember.TryResolve(await document.GetSyntaxRootAsync(CancellationToken).ConfigureAwait(false), out SyntaxNode? declarationNode))
ExtractClass\AbstractExtractClassRefactoringProvider.cs (4)
21protected abstract Task<ImmutableArray<SyntaxNode>> GetSelectedNodesAsync(CodeRefactoringContext context); 22protected abstract Task<SyntaxNode?> GetSelectedClassDeclarationAsync(CodeRefactoringContext context); 96var containingTypeDeclarationNode = selectedMemberNodes.First().FirstAncestorOrSelf<SyntaxNode>(syntaxFacts.IsTypeDeclaration); 104if (selectedMemberNodes.Any(m => m.FirstAncestorOrSelf<SyntaxNode>(syntaxFacts.IsTypeDeclaration) != containingTypeDeclarationNode))
ExtractClass\ExtractClassWithDialogCodeAction.cs (3)
30SyntaxNode selectedTypeDeclarationNode, 36private readonly SyntaxNode _selectedTypeDeclarationNode = selectedTypeDeclarationNode; 246var typeReference = syntaxGenerator.TypeExpression(newType);
ExtractInterface\AbstractExtractInterfaceService.cs (7)
32protected abstract Task<SyntaxNode> GetTypeDeclarationAsync( 49internal abstract bool ShouldIncludeAccessibilityModifier(SyntaxNode typeNode); 87var typeNode = await GetTypeDeclarationAsync(document, position, typeDiscoveryRule, cancellationToken).ConfigureAwait(false); 335var currentRoot = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 339var typeReference = syntaxGenerator.TypeExpression(extractedInterfaceSymbol); 341var typeDeclaration = currentRoot.GetAnnotatedNodes(typeNodeAnnotation).SingleOrDefault(); 348var unformattedTypeDeclaration = syntaxGenerator.AddInterfaceType(typeDeclaration, typeReference).WithAdditionalAnnotations(Formatter.Annotation);
ExtractInterface\ExtractInterfaceTypeAnalysisResult.cs (2)
15public readonly SyntaxNode TypeNode; 22SyntaxNode typeNode,
ExtractMethod\AbstractExtractMethodService.cs (2)
20where TStatementSyntax : SyntaxNode 21where TExpressionSyntax : SyntaxNode
ExtractMethod\AbstractSyntaxTriviaService.cs (6)
27public ITriviaSavedResult SaveTriviaAroundSelection(SyntaxNode root, TextSpan textSpan) 45var rootWithAnnotation = ReplaceTokens(root, map.Keys, (o, n) => map[o]); 50private static SyntaxNode ReplaceTokens( 51SyntaxNode root, 63SyntaxNode root, 109private static Dictionary<TriviaLocation, SyntaxToken> GetTokensAtEdges(SyntaxNode root, TextSpan textSpan)
ExtractMethod\AbstractSyntaxTriviaService.Result.cs (6)
26SyntaxNode root, 42public SyntaxNode Root { get; } 44public SyntaxNode RestoreTrivia( 45SyntaxNode root, 101SyntaxNode root, 260SyntaxNode root,
ExtractMethod\Extensions.cs (4)
13public static ITypeSymbol? GetLambdaOrAnonymousMethodReturnType(this SemanticModel binding, SyntaxNode node) 50public static bool HasDiagnostics(this SyntaxNode node) 54foreach (var child in node.ChildNodes()) 62public static bool FromScript(this SyntaxNode node)
ExtractMethod\InsertionPoint.cs (6)
14private readonly Lazy<SyntaxNode?> _context; 28public SyntaxNode GetRoot() 31public SyntaxNode? GetContext() 37private Lazy<SyntaxNode?> CreateLazyContextNode() 40private SyntaxNode? ComputeContextNode() 42var root = SemanticDocument.Root;
ExtractMethod\ISyntaxTriviaService.cs (5)
33internal delegate SyntaxToken AnnotationResolver(SyntaxNode root, TriviaLocation location, SyntaxAnnotation annotation); 44SyntaxNode Root { get; } 53SyntaxNode RestoreTrivia(SyntaxNode root, AnnotationResolver annotationResolver = null, TriviaResolver triviaResolver = null); 67ITriviaSavedResult SaveTriviaAroundSelection(SyntaxNode root, TextSpan textSpan);
ExtractMethod\MethodExtractor.Analyzer.cs (2)
61protected abstract bool ContainsReturnStatementInSelectedCode(IEnumerable<SyntaxNode> jumpOutOfRegionStatements); 943HashSet<int> nonNoisySyntaxKindSet) where T : SyntaxNode
ExtractMethod\MethodExtractor.Analyzer.SymbolMapBuilder.cs (2)
31SyntaxNode root, 57private void Visit(SyntaxNode node)
ExtractMethod\MethodExtractor.CodeGenerator.cs (20)
28public abstract OperationStatus<ImmutableArray<SyntaxNode>> GetNewMethodStatements( 29SyntaxNode insertionPointNode, CancellationToken cancellationToken); 35where TStatementSyntax : SyntaxNode 36where TNodeUnderContainer : SyntaxNode 66protected abstract SyntaxNode GetCallSiteContainerFromOutermostMoveInVariable(CancellationToken cancellationToken); 68protected abstract Task<SyntaxNode> GenerateBodyForCallSiteContainerAsync(SyntaxNode insertionPointNode, SyntaxNode outermostCallSiteContainer, CancellationToken cancellationToken); 69protected abstract IMethodSymbol GenerateMethodDefinition(SyntaxNode insertionPointNode, CancellationToken cancellationToken); 70protected abstract bool ShouldLocalFunctionCaptureParameter(SyntaxNode node); 118var outermostCallSiteContainer = GetOutermostCallSiteContainerToProcess(cancellationToken); 127var finalRoot = LocalFunction 133SyntaxNode InsertLocalFunction() 144var destination = insertionPoint.With(documentWithUpdatedCallSite).GetContext(); 151SyntaxNode InsertNormalMethod() 156var mappedMember = insertionPoint.With(documentWithUpdatedCallSite).GetContext(); 162var destination = mappedMember.Parent ?? mappedMember; 178private SyntaxNode GetOutermostCallSiteContainerToProcess(CancellationToken cancellationToken) 180var callSiteContainer = GetCallSiteContainerFromOutermostMoveInVariable(cancellationToken); 239(TStatementSyntax)(SyntaxNode)await GetStatementOrInitializerContainingInvocationToExtractedMethodAsync(cancellationToken).ConfigureAwait(false));
ExtractMethod\MethodExtractor.cs (11)
30where TStatementSyntax : SyntaxNode 31where TExpressionSyntax : SyntaxNode 37protected abstract SyntaxNode ParseTypeName(string name); 39protected abstract SyntaxNode GetInsertionPointNode(AnalyzerResult analyzerResult, CancellationToken cancellationToken); 50Document document, SyntaxToken? invocationNameToken, SyntaxNode methodDefinition, CancellationToken cancellationToken); 115bool CanAddTo(Document document, SyntaxNode insertionPointNode, out OperationStatus status) 127var destination = insertionPointNode; 130var mappedPoint = insertionPointNode.RawKind == syntaxKinds.GlobalStatement 189SyntaxNode insertionPointNode, 244SyntaxNode contextNode, 263SemanticModel semanticModel, SyntaxNode contextNode, ITypeSymbol type)
ExtractMethod\MethodExtractor.TriviaResult.cs (6)
25protected abstract AnnotationResolver GetAnnotationResolver(SyntaxNode callsite, SyntaxNode methodDefinition); 26protected abstract TriviaResolver GetTriviaResolver(SyntaxNode methodDefinition); 33var root = document.Root; 38var callsite = root.GetAnnotatedNodesAndTokens(callsiteAnnotation).SingleOrDefault().AsNode(); 39var method = root.GetAnnotatedNodesAndTokens(methodDefinitionAnnotation).SingleOrDefault().AsNode();
ExtractMethod\MethodExtractor.VariableInfo.cs (1)
123public SyntaxToken GetIdentifierTokenAtDeclaration(SyntaxNode node)
ExtractMethod\MethodExtractor.VariableSymbol.cs (1)
191protected class LocalVariableSymbol<T> : VariableSymbol, IComparable<LocalVariableSymbol<T>> where T : SyntaxNode
ExtractMethod\SelectionResult.cs (12)
22where TStatementSyntax : SyntaxNode 53public abstract SyntaxNode GetContainingScope(); 54public abstract SyntaxNode GetOutermostCallSiteContainerToProcess(CancellationToken cancellationToken); 64public virtual SyntaxNode GetNodeForDataFlowAnalysis() => GetContainingScope(); 93public TNode GetContainingScopeOf<TNode>() where TNode : SyntaxNode 95var containingScope = GetContainingScope(); 185bool IsConfigureAwaitFalse(SyntaxNode node) 213protected static SyntaxNode AddAnnotations(SyntaxNode root, IEnumerable<(SyntaxToken, SyntaxAnnotation)> pairs) 226protected static SyntaxNode AddAnnotations(SyntaxNode root, IEnumerable<(SyntaxNode, SyntaxAnnotation)> pairs)
ExtractMethod\SelectionValidator.cs (14)
26where TStatementSyntax : SyntaxNode 34public abstract IEnumerable<SyntaxNode> GetOuterReturnStatements(SyntaxNode commonRoot, IEnumerable<SyntaxNode> jumpsOutOfRegion); 35public abstract bool IsFinalSpanSemanticallyValidSpan(SyntaxNode node, TextSpan textSpan, IEnumerable<SyntaxNode> returnStatements, CancellationToken cancellationToken); 36public abstract bool ContainsNonReturnExitPointsStatements(IEnumerable<SyntaxNode> jumpsOutOfRegion); 39SemanticModel semanticModel, TextSpan textSpan, (SyntaxNode, SyntaxNode) range, CancellationToken cancellationToken) 85SyntaxNode root, TextSpan textSpan, CancellationToken cancellationToken) where T : SyntaxNode 145SyntaxNode root, TextSpan textSpan, CancellationToken cancellationToken) where T : SyntaxNode 187public SyntaxNode CommonRootFromOriginalSpan { get; set; }
ExtractMethod\UniqueNameGenerator.cs (1)
22public string CreateUniqueMethodName(SyntaxNode contextNode, string baseName)
FullyQualify\AbstractFullyQualifyService.cs (5)
29where TSimpleNameSyntax : SyntaxNode 37protected abstract bool CanFullyQualify(SyntaxNode node, [NotNullWhen(true)] out TSimpleNameSyntax? simpleName); 38protected abstract Task<SyntaxNode> ReplaceNodeAsync(TSimpleNameSyntax simpleName, string containerName, bool resultingSymbolIsType, CancellationToken cancellationToken); 69var node = root.FindToken(span.Start).GetAncestors<SyntaxNode>().First(n => n.Span.Contains(span)); 222var newRoot = await ReplaceNodeAsync(simpleName, containerName, originalSymbol.IsType, cancellationToken).ConfigureAwait(false);
FullyQualify\AbstractFullyQualifyService.SymbolResult.cs (1)
12internal abstract partial class AbstractFullyQualifyService<TSimpleNameSyntax> where TSimpleNameSyntax : SyntaxNode
GenerateComparisonOperators\GenerateComparisonOperatorsCodeRefactoringProvider.cs (8)
135SyntaxNode typeDeclaration, 158private static SyntaxNode GenerateLeftExpression( 163var thisExpression = generator.IdentifierName(LeftName); 179SyntaxNode thisExpression) 208private static SyntaxNode GenerateStatement( 209SyntaxGenerator generator, CodeGenerationOperatorKind kind, SyntaxNode leftExpression) 211var zero = generator.LiteralExpression(0); 213var compareToCall = generator.InvocationExpression(
GenerateConstructorFromMembers\AbstractGenerateConstructorFromMembersCodeRefactoringProvider.ConstructorDelegatingCodeAction.cs (2)
50using var _1 = ArrayBuilder<SyntaxNode>.GetInstance(out var nullCheckStatements); 51using var _2 = ArrayBuilder<SyntaxNode>.GetInstance(out var assignStatements);
GenerateEqualsAndGetHashCodeFromMembers\AbstractGenerateEqualsAndGetHashCodeService.cs (4)
25ImmutableArray<SyntaxNode> statements, out ImmutableArray<SyntaxNode> wrappedStatements); 68using var _ = ArrayBuilder<SyntaxNode>.GetInstance(out var expressions); 147private ImmutableArray<SyntaxNode> CreateGetHashCodeStatements(
GenerateEqualsAndGetHashCodeFromMembers\FormatLargeBinaryExpressionRule.cs (2)
44List<IndentBlockOperation> list, SyntaxNode node, in NextIndentBlockOperationAction nextOperation) 48var expr = _syntaxFacts.GetExpressionOfReturnStatement(node);
GenerateEqualsAndGetHashCodeFromMembers\GenerateEqualsAndGetHashCodeAction.cs (5)
23SyntaxNode typeDeclaration, 41private readonly SyntaxNode _typeDeclaration = typeDeclaration; 115private async Task<Document> UpdateDocumentAndAddImportsAsync(SyntaxNode oldType, SyntaxNode newType, CancellationToken cancellationToken) 172var expression = generator.LogicalNotExpression(
GenerateEqualsAndGetHashCodeFromMembers\GenerateEqualsAndGetHashCodeFromMembersCodeRefactoringProvider.cs (4)
199Document document, SyntaxNode typeDeclaration, INamedTypeSymbol containingType, ImmutableArray<ISymbol> selectedMembers, 239Document document, SyntaxNode typeDeclaration, INamedTypeSymbol containingType, ImmutableArray<ISymbol> members, 256Document document, SyntaxNode typeDeclaration, INamedTypeSymbol containingType, ImmutableArray<ISymbol> members, 293Document document, SyntaxNode typeDeclaration, INamedTypeSymbol containingType, ImmutableArray<ISymbol> members,
GenerateEqualsAndGetHashCodeFromMembers\GenerateEqualsAndHashWithDialogCodeAction.cs (2)
24SyntaxNode typeDeclaration, 36private readonly SyntaxNode _typeDeclaration = typeDeclaration;
GenerateFromMembers\AbstractGenerateFromMembersCodeRefactoringProvider.SelectedMemberInfo.cs (2)
14ImmutableArray<SyntaxNode> selectedDeclarations, 18public readonly ImmutableArray<SyntaxNode> SelectedDeclarations = selectedDeclarations;
GenerateType\AbstractGenerateTypeService.cs (12)
32where TExpressionSyntax : SyntaxNode 33where TTypeDeclarationSyntax : SyntaxNode 34where TArgumentSyntax : SyntaxNode 63Solution updatedSolution, SyntaxNode modifiedRoot, Document document, TSimpleNameSyntax simpleName, string includeUsingsOrImports, CancellationToken cancellationToken); 69public abstract Task<(INamespaceSymbol, INamespaceOrTypeSymbol, Location)> GetOrGenerateEnclosingNamespaceSymbolAsync(INamedTypeSymbol namedTypeSymbol, string[] containers, Document selectedDocument, SyntaxNode selectedDocumentRoot, CancellationToken cancellationToken); 73SyntaxNode node, 105SyntaxNode node, 143private static bool CanGenerateIntoContainingNamespace(SemanticDocument semanticDocument, SyntaxNode node, CancellationToken cancellationToken) 153.FirstOrDefault(node.GetAncestorsOrThis<SyntaxNode>().Contains); 162SyntaxNode node, 188IEnumerable<SyntaxNode> typeArguments, 201var argument = i < arguments.Count ? arguments[i] : null;
GenerateType\AbstractGenerateTypeService.Editor.cs (2)
341SyntaxNode root, 409var root = await generateTypeOptionsResult.ExistingDocument.GetSyntaxRootAsync(_cancellationToken).ConfigureAwait(false);
GenerateType\AbstractGenerateTypeService.State.cs (2)
71SyntaxNode node, 86SyntaxNode node,
GenerateType\IGenerateTypeService.cs (2)
16Task<ImmutableArray<CodeAction>> GenerateTypeAsync(Document document, SyntaxNode node, CancellationToken cancellationToken); 17Task<(INamespaceSymbol, INamespaceOrTypeSymbol, Location)> GetOrGenerateEnclosingNamespaceSymbolAsync(INamedTypeSymbol namedTypeSymbol, string[] containers, Document selectedDocument, SyntaxNode selectedDocumentRoot, CancellationToken cancellationToken);
Highlighting\HighlightingService.cs (1)
28SyntaxNode root, int position, List<TextSpan> highlights, CancellationToken cancellationToken)
Highlighting\IHighlighter.cs (1)
15void AddHighlights(SyntaxNode root, int position, List<TextSpan> highlights, CancellationToken cancellationToken);
Highlighting\IHighlightingService.cs (1)
21void AddHighlights(SyntaxNode root, int position, List<TextSpan> highlights, CancellationToken cancellationToken);
Highlighting\Keywords\AbstractKeywordHighlighter.cs (3)
15where TNode : SyntaxNode 17protected sealed override bool IsHighlightableNode(SyntaxNode node) 20protected sealed override void AddHighlightsForNode(SyntaxNode node, List<TextSpan> highlights, CancellationToken cancellationToken)
InheritanceMargin\AbstractInheritanceMarginService.cs (3)
19protected abstract ImmutableArray<SyntaxNode> GetMembers(IEnumerable<SyntaxNode> nodesToSearch); 25protected abstract SyntaxToken GetDeclarationToken(SyntaxNode declarationNode);
InheritanceMargin\AbstractInheritanceMarginService_Helpers.cs (1)
93foreach (var memberDeclarationNode in allDeclarationNodes)
InitializeParameter\AbstractAddParameterCheckCodeRefactoringProvider.cs (25)
39where TTypeDeclarationSyntax : SyntaxNode 40where TParameterSyntax : SyntaxNode 41where TStatementSyntax : SyntaxNode 42where TExpressionSyntax : SyntaxNode 46protected abstract bool CanOffer(SyntaxNode body); 53SyntaxNode functionDeclaration, 56ImmutableArray<SyntaxNode> listOfParameterNodes, 64foreach (var parameterNode in listOfParameterNodes) 86SyntaxNode functionDeclaration, 139var functionDeclaration = firstParameterNode.FirstAncestorOrSelf<SyntaxNode>(IsFunctionDeclaration); 194var syntax = statement.Syntax; 314SyntaxNode functionDeclaration, 337SyntaxNode functionDeclaration, 353SyntaxNode functionDeclaration, 375var statementToAddAfter = GetStatementToAddNullCheckAfter( 379var newRoot = editor.GetChangedRoot(); 405private static SyntaxNode? GetStatementToAddNullCheckAfter( 520var coalesce = generator.CoalesceExpression( 538private static SyntaxNode GetTypeNode( 552private static SyntaxNode CreateArgumentNullException( 560private SyntaxNode CreateArgumentException( 574using var _ = ArrayBuilder<SyntaxNode>.GetInstance(out var content); 576var nameofExpression = generator.NameOfExpression(generator.IdentifierName(parameter.Name)); 612private static SyntaxNode InterpolatedStringText(SyntaxGenerator generator, string content, string value)
InitializeParameter\AbstractInitializeMemberFromParameterCodeRefactoringProviderMemberCreation.cs (26)
40where TTypeDeclarationSyntax : SyntaxNode 41where TParameterSyntax : SyntaxNode 42where TStatementSyntax : SyntaxNode 43where TExpressionSyntax : SyntaxNode 45protected abstract SyntaxNode? TryGetLastStatement(IBlockOperation? blockStatement); 48protected abstract SyntaxNode? GetAccessorBody(IMethodSymbol accessor, CancellationToken cancellationToken); 49protected abstract SyntaxNode RemoveThrowNotImplemented(SyntaxNode propertySyntax); 53Document document, SyntaxNode functionDeclaration, IMethodSymbol method, IBlockOperation? blockStatementOpt, 54ImmutableArray<SyntaxNode> listOfParameterNodes, TextSpan parameterSpan, 64SyntaxNode constructorDeclaration, 109SyntaxNode constructorDeclaration, 160SyntaxNode constructorDeclaration, 194SyntaxNode constructorDeclaration, 243SyntaxNode functionDeclaration, 362SyntaxNode constructorDeclaration, 376var nodesToTrack = new List<SyntaxNode> { constructorDeclaration }; 393var currentConstructorDeclaration = currentRoot.GetCurrentNode(constructorDeclaration); 426SyntaxNode constructorDeclaration, 489var withoutThrowNotImplemented = RemoveThrowNotImplemented(propertySyntax); 513SyntaxNode constructorDeclaration, 537var statementToAddAfter = TryGetStatementToAddInitializationAfter(parameter, blockStatement); 544SyntaxNode typeDeclaration, CancellationToken cancellationToken) 555var symbolSyntax = symbol.DeclaringSyntaxReferences[0].GetSyntax(cancellationToken); 577private SyntaxNode? TryGetStatementToAddInitializationAfter( 750using var _ = ArrayBuilder<SyntaxNode>.GetInstance(out var accessors);
InitializeParameter\AbstractInitializeParameterCodeRefactoringProvider.cs (19)
28where TTypeDeclarationSyntax : SyntaxNode 29where TParameterSyntax : SyntaxNode 30where TStatementSyntax : SyntaxNode 31where TExpressionSyntax : SyntaxNode 33protected abstract bool IsFunctionDeclaration(SyntaxNode node); 36protected abstract SyntaxNode GetBody(SyntaxNode functionDeclaration); 40SyntaxNode functionDeclaration, 43ImmutableArray<SyntaxNode> listOfParameterNodes, 51SyntaxNode functionDeclaration, 57SyntaxEditor editor, SyntaxNode functionDeclaration, bool returnsVoid, 58SyntaxNode? statementToAddAfter, TStatementSyntax statement); 71var functionDeclaration = selectedParameter.FirstAncestorOrSelf<SyntaxNode>(IsFunctionDeclaration); 110using var _ = ArrayBuilder<SyntaxNode>.GetInstance(out var listOfPotentiallyValidParametersNodes); 111foreach (var parameterNode in parameterNodes) 133SyntaxNode parameterNode, 145SyntaxNode functionDeclaration, SemanticModel semanticModel, ISyntaxFactsService syntaxFacts, 150var functionBody = GetBody(functionDeclaration);
InlineHints\AbstractInlineParameterNameHintsService.cs (4)
29SyntaxNode node, 33protected abstract bool IsIndexer(SyntaxNode node, IParameterSymbol parameter); 80void AddHintsIfAppropriate(SyntaxNode node) 279protected static string GetIdentifierNameFromArgument(SyntaxNode argument, ISyntaxFactsService syntaxFacts)
InlineHints\AbstractInlineTypeHintsService.cs (1)
23SemanticModel semanticModel, SyntaxNode node,
InlineMethod\AbstractInlineMethodRefactoringProvider.cs (14)
25where TMethodDeclarationSyntax : SyntaxNode 26where TStatementSyntax : SyntaxNode 27where TExpressionSyntax : SyntaxNode 59protected abstract SyntaxNode GenerateTypeSyntax(ITypeSymbol symbol, bool allowVar); 61protected abstract bool IsFieldDeclarationSyntax(SyntaxNode node); 72protected abstract bool CanBeReplacedByThrowExpression(SyntaxNode syntaxNode); 251SyntaxNode callerMethodNode, 294SyntaxNode callerNode, 364private async Task<SyntaxNode> GetChangedCallerAsync(Document document, 368SyntaxNode callerDeclarationNode, 418private (SyntaxNode nodeToReplace, SyntaxNode inlineNode) GetInlineNode( 433var rightHandSideValue = _syntaxFacts.GetRightHandSideOfAssignment(inlineMethodContext.InlineExpression); 574for (SyntaxNode? node = calleeMethodInvocationNode; node != null; node = node.Parent)
InlineMethod\AbstractInlineMethodRefactoringProvider.InlineContext.cs (5)
289ImmutableDictionary<ISymbol, SyntaxNode> replacementTable, 309var replacementNodeWithTrivia = syntaxNode.WithTriviaFrom(nodeToReplace); 322private ImmutableDictionary<ISymbol, SyntaxNode> ComputeReplacementTable( 335syntaxNode: (SyntaxNode)parameterAndExpressionPair.Value)); 355SyntaxNode calleeInvocationNode,
InlineTemporary\AbstractInlineTemporaryCodeRefactoringProvider.cs (2)
19where TIdentifierNameSyntax : SyntaxNode 20where TVariableDeclaratorSyntax : SyntaxNode
IntroduceParameter\AbstractIntroduceParameterCodeRefactoringProvider.cs (15)
31where TExpressionSyntax : SyntaxNode 35where TArgumentSyntax : SyntaxNode 44protected abstract SyntaxNode GenerateExpressionFromOptionalParameter(IParameterSymbol parameterSymbol); 45protected abstract SyntaxNode UpdateArgumentListSyntax(SyntaxNode argumentList, SeparatedSyntaxList<TArgumentSyntax> arguments); 46protected abstract SyntaxNode? GetLocalDeclarationFromDeclarator(SyntaxNode variableDecl); 64var containingMethod = expression.FirstAncestorOrSelf<SyntaxNode>(node => generator.GetParameterListNode(node) is not null); 116private static bool IsValidExpression(SyntaxNode expression, ISyntaxFactsService syntaxFacts) 131var invalidNode = expression.FirstAncestorOrSelf<SyntaxNode>(node => syntaxFacts.IsAttributeArgument(node) || syntaxFacts.IsParameter(node)); 141TExpressionSyntax expression, IMethodSymbol methodSymbol, SyntaxNode containingMethod, 202foreach (var variable in variablesInExpression) 238IMethodSymbol methodSymbol, SyntaxNode containingMethod, Dictionary<Document, List<TExpressionSyntax>> methodCallSites, bool allOccurrences, IntroduceParameterCodeActionKind selectedCodeAction, 245var changedRoots = await ProducerConsumer<(DocumentId documentId, SyntaxNode newRoot)>.RunParallelAsync(
IntroduceParameter\IntroduceParameterDocumentRewriter.cs (44)
28SyntaxNode containingMethod, 39private readonly SyntaxNode _containerMethod = containingMethod; 43public async Task<SyntaxNode> RewriteDocumentAsync(Compilation compilation, Document document, List<TExpressionSyntax> invocations, CancellationToken cancellationToken) 100private bool ShouldRemoveVariableDeclaratorContainingExpression([NotNullWhen(true)] out string? varDeclName, [NotNullWhen(true)] out SyntaxNode? localDeclaration) 102var declarator = _expression?.Parent?.Parent; 137var parameterList = _syntaxFacts.GetParameterList(_containerMethod); 219private async Task<SyntaxNode> ModifyDocumentInvocationsTrampolineOverloadAndIntroduceParameterAsync(Compilation compilation, Document currentDocument, 267var parameter = _generator.ParameterDeclaration(parameterName, _generator.TypeExpression(parameterType)); 304SyntaxNode GenerateNewArgumentListSyntaxForTrampoline(Compilation compilation, SemanticModel invocationSemanticModel, 305Dictionary<IParameterSymbol, int> parameterToArgumentMap, SyntaxNode currentArgumentListSyntax, 306SyntaxNode argumentListSyntax, SyntaxNode invocation, ImmutableArray<IParameterSymbol> validParameters, 313var requiredArguments = new List<SyntaxNode>(); 323var conditionalRoot = _syntaxFacts.GetRootConditionalAccessExpression(invocation); 325var newMethodInvocation = GenerateNewMethodInvocation(invocation, requiredArguments, newMethodIdentifier); 336var expressionsWithConditionalAccessors = conditionalRoot.ReplaceNode(invocation, newMethodInvocation); 351private SyntaxNode GenerateNewMethodInvocation(SyntaxNode invocation, List<SyntaxNode> arguments, string newMethodIdentifier) 353var methodName = _generator.IdentifierName(newMethodIdentifier); 357var receiverExpression = _syntaxFacts.GetExpressionOfMemberAccessExpression(fullExpression); 388private async Task<SyntaxNode> ExtractMethodAsync(ImmutableArray<IParameterSymbol> validParameters, string newMethodIdentifier, SyntaxGenerator generator, CancellationToken cancellationToken) 391var returnStatement = generator.ReturnStatement(_expression.WithoutTrivia()); 393var newMethodDeclaration = await CreateMethodDeclarationAsync(returnStatement, 420private async Task<SyntaxNode> GenerateNewMethodOverloadAsync(int insertionIndex, SyntaxGenerator generator, CancellationToken cancellationToken) 427var memberName = _methodSymbol.IsGenericMethod 430var invocation = generator.InvocationExpression(memberName, arguments); 432var newStatement = _methodSymbol.ReturnsVoid 436var newMethodDeclaration = await CreateMethodDeclarationAsync(newStatement, 441private async Task<SyntaxNode> CreateMethodDeclarationAsync(SyntaxNode newStatement, ImmutableArray<IParameterSymbol>? validParameters, 481private async Task<SyntaxNode> ModifyDocumentInvocationsAndIntroduceParameterAsync(Compilation compilation, Document document, int insertionIndex, 528var parameter = _generator.ParameterDeclaration(name: parameterName, type: 544SeparatedSyntaxList<SyntaxNode> updatedInvocationArguments) 551var updatedInvocationArgument = updatedInvocationArguments[index]; 552var argumentExpression = _syntaxFacts.GetExpressionOfArgument(updatedInvocationArgument); 553var parenthesizedArgumentExpression = editor.Generator.AddParentheses(argumentExpression, includeElasticTrivia: false); 558var generatedExpression = _service.GenerateExpressionFromOptionalParameter(mappedParameter); 559var parenthesizedGeneratedExpression = editor.Generator.AddParentheses(generatedExpression, includeElasticTrivia: false); 572SeparatedSyntaxList<TArgumentSyntax> invocationArguments, SyntaxNode newArgumentExpression, 582SeparatedSyntaxList<SyntaxNode> invocationArguments, int methodInsertionIndex, 586foreach (var invocationArgument in invocationArguments) 608Dictionary<IParameterSymbol, int> mapping, SeparatedSyntaxList<SyntaxNode> arguments, 646if (ShouldRemoveVariableDeclaratorContainingExpression(out _, out var localDeclaration))
IntroduceUsingStatement\AbstractIntroduceUsingStatementCodeRefactoringProvider.cs (10)
29where TStatementSyntax : SyntaxNode 35protected abstract bool CanRefactorToContainBlockStatements(SyntaxNode parent); 37protected abstract SyntaxNode WithStatements(SyntaxNode parentOfStatementsToSurround, SyntaxList<TStatementSyntax> statements); 136var newParent = WithStatements( 165var newParent = WithStatements( 208var expression = syntaxFacts.GetExpressionOfExpressionStatement(finallyStatement); 216syntaxFacts.GetPartsOfMemberAccessExpression(invokedExpression, out var accessedExpression, out var name); 346SyntaxNode node, 377var childNode = nodeOrToken.AsNode();
IntroduceVariable\AbstractIntroduceLocalForExpressionCodeRefactoringProvider.cs (2)
22where TExpressionSyntax : SyntaxNode 23where TStatementSyntax : SyntaxNode
IntroduceVariable\AbstractIntroduceVariableService.cs (11)
30where TExpressionSyntax : SyntaxNode 32where TTypeDeclarationSyntax : SyntaxNode 44protected abstract IEnumerable<SyntaxNode> GetContainingExecutableBlocks(TExpressionSyntax expression); 59protected virtual bool BlockOverlapsHiddenPosition(SyntaxNode block, CancellationToken cancellationToken) 149var block = blocks.FirstOrDefault(); 280SyntaxNode containerOpt, 297SyntaxNode withinNodeInCurrent, 383where TNode : SyntaxNode 391var replacement = generator.AddParentheses(variableName, includeElasticTrivia: false) 399SyntaxNode replacementNode, 401where TNode : SyntaxNode;
IntroduceVariable\AbstractIntroduceVariableService.State.cs (3)
203var equalsValue = current.Parent; 207var declaration = equalsValue.AncestorsAndSelf().FirstOrDefault(n => syntaxFacts.IsLocalDeclarationStatement(n) || syntaxFacts.IsFieldDeclaration(n)); 279where TSyntax : SyntaxNode
InvertConditional\AbstractInvertConditionalCodeRefactoringProvider.cs (1)
17where TConditionalExpressionSyntax : SyntaxNode
InvertIf\AbstractInvertIfCodeRefactoringProvider.cs (29)
27where TStatementSyntax : SyntaxNode 44protected abstract SyntaxList<TStatementSyntax> GetStatements(SyntaxNode node); 48protected abstract TSyntaxKind? GetJumpStatementKind(SyntaxNode node); 50protected abstract bool IsNoOpSyntaxNode(SyntaxNode node); 51protected abstract bool IsExecutableStatement(SyntaxNode node); 52protected abstract bool IsStatementContainer(SyntaxNode node); 55protected abstract bool CanControlFlowOut(SyntaxNode node); 61protected abstract SyntaxNode GetCondition(TIfStatementSyntax ifNode); 75SyntaxNode condition, 79protected abstract SyntaxNode WithStatements( 80SyntaxNode node, 107out SyntaxNode? subsequentSingleExitPoint) 156out var ifBodySingleExitPointOpt); 298var invertIfStyle = GetInvertIfStyle(syntaxKinds, ifNode, semanticModel, out var subsequentSingleExitPoint); 319out SyntaxNode? subsequentSingleExitPoint) 343out SyntaxNode? singleExitPoint) 361private TSyntaxKind GetNearestParentJumpStatementKind(SyntaxNode ifNode) 363foreach (var node in ifNode.Ancestors()) 377var parent = statementRange.Parent; 404foreach (var node in ifNode.Ancestors()) 424private SyntaxNode GetRootWithInvertIfStatement( 426SyntaxNode root, 429SyntaxNode? subsequentSingleExitPoint, 430SyntaxNode negatedExpression, 506var updatedParent = WithStatements( 530var updatedParent = WithStatements( 556var updatedParent = WithStatements( 579var updatedParent = WithStatements( 604var updatedParent = WithStatements(
InvertIf\AbstractInvertIfCodeRefactoringProvider.StatementRange.cs (1)
30public SyntaxNode Parent => FirstStatement.GetRequiredParent();
InvertLogical\AbstractInvertLogicalCodeRefactoringProvider.cs (5)
25where TExpressionSyntax : SyntaxNode 39var expression = (SyntaxNode?)await context.TryGetRelevantNodeAsync<TBinaryExpressionSyntax>().ConfigureAwait(false); 83Document document1, SyntaxNode binaryExpression, CancellationToken cancellationToken) 100Document document, SyntaxNode binaryExpression, CancellationToken cancellationToken)
LanguageServices\SymbolDisplayService\AbstractSymbolDisplayService.AbstractSymbolDescriptionBuilder.cs (1)
238protected void AddCaptures(SyntaxNode syntax)
MetadataAsSource\AbstractMetadataAsSourceService+CompatAbstractMetadataFormattingRule.cs (8)
22public sealed override void AddSuppressOperations(ArrayBuilder<SuppressOperation> list, SyntaxNode node, in NextSuppressOperationAction nextOperation) 30public sealed override void AddAnchorIndentationOperations(List<AnchorIndentationOperation> list, SyntaxNode node, in NextAnchorIndentationOperationAction nextOperation) 38public sealed override void AddIndentBlockOperations(List<IndentBlockOperation> list, SyntaxNode node, in NextIndentBlockOperationAction nextOperation) 46public sealed override void AddAlignTokensOperations(List<AlignTokensOperation> list, SyntaxNode node, in NextAlignTokensOperationAction nextOperation) 77public virtual void AddSuppressOperationsSlow(ArrayBuilder<SuppressOperation> list, SyntaxNode node, ref NextSuppressOperationAction nextOperation) 83public virtual void AddAnchorIndentationOperationsSlow(List<AnchorIndentationOperation> list, SyntaxNode node, ref NextAnchorIndentationOperationAction nextOperation) 89public virtual void AddIndentBlockOperationsSlow(List<IndentBlockOperation> list, SyntaxNode node, ref NextIndentBlockOperationAction nextOperation) 95public virtual void AddAlignTokensOperationsSlow(List<AlignTokensOperation> list, SyntaxNode node, ref NextAlignTokensOperationAction nextOperation)
MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceCodeRefactoringProvider.cs (2)
15internal abstract class AbstractMoveDeclarationNearReferenceCodeRefactoringProvider<TLocalDeclaration> : CodeRefactoringProvider where TLocalDeclaration : SyntaxNode 54Document document, SyntaxNode statement, CancellationToken cancellationToken)
MoveStaticMembers\AbstractMoveStaticMembersRefactoringProvider.cs (1)
18protected abstract Task<ImmutableArray<SyntaxNode>> GetSelectedNodesAsync(CodeRefactoringContext context);
MoveStaticMembers\MoveStaticMembersWithDialogCodeAction.cs (3)
161ImmutableArray<SyntaxNode> oldMemberNodes, 251private static async Task<SyntaxNode> FixReferencesSingleDocumentAsync( 309SyntaxNode replacement;
MoveToNamespace\AbstractMoveToNamespaceService.cs (14)
37where TCompilationUnitSyntax : SyntaxNode 38where TNamespaceDeclarationSyntax : SyntaxNode 39where TNamedTypeDeclarationSyntax : SyntaxNode 42protected abstract string GetNamespaceName(SyntaxNode namespaceSyntax); 75var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 78var node = token.Parent; 92Document document, SyntaxNode node, int position, CancellationToken cancellationToken) 117Document document, SyntaxNode node, CancellationToken cancellationToken) 127SyntaxNode container = null; 161private static int GetNamespaceInSpineCount(SyntaxNode node) 164private static bool ContainsMultipleTypesInSpine(SyntaxNode node) 185private static async Task<ImmutableArray<ISymbol>> GetMemberSymbolsAsync(Document document, SyntaxNode container, CancellationToken cancellationToken) 209SyntaxNode container, 236SyntaxNode container,
MoveToNamespace\MoveToNamespaceAnalysisResult.cs (2)
17public SyntaxNode SyntaxNode { get; } 24SyntaxNode syntaxNode,
NameTupleElement\AbstractNameTupleElementCodeRefactoringProvider.cs (4)
17where TArgumentSyntax : SyntaxNode 18where TTupleExpressionSyntax : SyntaxNode 40private static async Task<(SyntaxNode root, TArgumentSyntax argument, string argumentName)> TryGetArgumentInfoAsync( 87var newRoot = root.ReplaceNode(argument, newArgument);
Organizing\AbstractOrganizingService.cs (1)
33protected Func<SyntaxNode, IEnumerable<ISyntaxOrganizer>> GetNodeToOrganizers(IEnumerable<ISyntaxOrganizer> organizers)
Organizing\Organizers\AbstractSyntaxNodeOrganizer.cs (3)
14where TSyntaxNode : SyntaxNode 18public SyntaxNode OrganizeNode(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken)
Organizing\Organizers\ISyntaxOrganizer.cs (2)
23SyntaxNode OrganizeNode(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken = default);
PreferFrameworkType\PreferFrameworkTypeDiagnosticAnalyzerBase.cs (1)
21where TExpressionSyntax : SyntaxNode
PullMemberUp\AbstractPullMemberUpRefactoringProvider.cs (1)
22protected abstract Task<ImmutableArray<SyntaxNode>> GetSelectedNodesAsync(CodeRefactoringContext context);
PullMemberUp\MembersPuller.cs (18)
120foreach (var declaration in symbolToDeclarationsMap[analysisResult.Member]) 197SyntaxNode memberDeclaration, 226SyntaxNode eventDeclaration, 231var declaration = editor.Generator.GetDeclaration(eventDeclaration); 252var publicAndNonStaticSyntax = codeGenerationService.CreateEventDeclaration(publicAndNonStaticSymbol, CodeGenerationDestination.ClassType, eventGenerationInfo, cancellationToken); 308using var _ = PooledHashSet<SyntaxNode>.GetInstance(out var sourceImports); 327foreach (var syntax in symbolToDeclarations[analysisResult.Member]) 345var declarationSyntax = originalMemberEditor.Generator.GetDeclaration(syntax); 388var destinationRoot = AddLeadingTriviaBeforeFirstMember( 403private static SyntaxTriviaList GetLeadingTriviaBeforeFirstMember(SyntaxNode root, ISyntaxFactsService syntaxFacts) 411private static SyntaxNode RemoveLeadingTriviaBeforeFirstMember(SyntaxNode root, ISyntaxFactsService syntaxFacts) 419private static SyntaxNode AddLeadingTriviaBeforeFirstMember(SyntaxNode root, ISyntaxFactsService syntaxFacts, SyntaxTriviaList trivia) 432private static ImmutableArray<SyntaxNode> GetImports(SyntaxNode start, ISyntaxFactsService syntaxFacts) 467private static async Task<ImmutableDictionary<ISymbol, ImmutableArray<SyntaxNode>>> InitializeSymbolToDeclarationsMapAsync( 473var symbolToDeclarationsBuilder = ImmutableDictionary.CreateBuilder<ISymbol, ImmutableArray<SyntaxNode>>();
QuickInfo\CommonSemanticQuickInfoProvider.cs (7)
142var root = linkedModel.SyntaxTree.GetRoot(cancellationToken); 181protected abstract bool GetBindableNodeForTokenIndicatingLambda(SyntaxToken token, [NotNullWhen(returnValue: true)] out SyntaxNode? found); 182protected abstract bool GetBindableNodeForTokenIndicatingPossibleIndexerAccess(SyntaxToken token, [NotNullWhen(returnValue: true)] out SyntaxNode? found); 188protected virtual NullableFlowState GetNullabilityAnalysis(SemanticModel semanticModel, ISymbol symbol, SyntaxNode node, CancellationToken cancellationToken) => NullableFlowState.None; 199var bindableParent = syntaxFacts.TryGetBindableParent(token); 239if (GetBindableNodeForTokenIndicatingLambda(token, out var lambdaSyntax)) 245if (GetBindableNodeForTokenIndicatingPossibleIndexerAccess(token, out var elementAccessExpression))
RelatedDocuments\AbstractRelatedDocumentsService.cs (2)
24where TExpressionSyntax : SyntaxNode 34protected abstract IEnumerable<(TExpressionSyntax expression, SyntaxToken nameToken)> IteratePotentialTypeNodes(SyntaxNode root);
RemoveUnusedVariable\AbstractRemoveUnusedVariableCodeFixProvider.cs (21)
25where TLocalDeclarationStatement : SyntaxNode 26where TVariableDeclarator : SyntaxNode 27where TVariableDeclaration : SyntaxNode 31protected abstract SyntaxNode GetNodeToRemoveOrReplace(SyntaxNode node); 33protected abstract void RemoveOrReplaceNode(SyntaxEditor editor, SyntaxNode node, IBlockFactsService blockFacts); 35protected abstract SeparatedSyntaxList<SyntaxNode> GetVariables(TLocalDeclarationStatement localDeclarationStatement); 37protected abstract bool ShouldOfferFixForLocalDeclaration(IBlockFactsService blockFacts, SyntaxNode node); 44var root = await document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 45var node = root.FindNode(diagnostic.Location.SourceSpan); 62var nodesToRemove = new HashSet<SyntaxNode>(); 67var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 74var node = root.FindNode(diagnostic.Location.SourceSpan); 97var referencedSymbolNode = root.FindNode(location.Location.SourceSpan); 100var nodeToRemoveOrReplace = GetNodeToRemoveOrReplace(referencedSymbolNode); 113foreach (var node in nodesToRemove) 122protected static void RemoveNode(SyntaxEditor editor, SyntaxNode node, IBlockFactsService blockFacts) 143var statementParent = localDeclaration.Parent; 168private void MergeNodesToRemove(HashSet<SyntaxNode> nodesToRemove) 185foreach (var variable in GetVariables(candidate)) 197foreach (var variable in GetVariables(candidate))
ReplaceConditionalWithStatements\AbstractReplaceConditionalWithStatementsCodeRefactoringProvider.cs (22)
30where TExpressionSyntax : SyntaxNode 32where TStatementSyntax : SyntaxNode 34where TArgumentSyntax : SyntaxNode 35where TArgumentListSyntax : SyntaxNode 36where TVariableSyntax : SyntaxNode 37where TVariableDeclaratorSyntax : SyntaxNode 38where TEqualsValueClauseSyntax : SyntaxNode 86private static TConditionalExpressionSyntax? TryFindConditional(SyntaxNode? top, CancellationToken cancellationToken) 91foreach (var node in top.DescendantNodesAndSelf(DescendIntoChildren)) 100bool DescendIntoChildren(SyntaxNode node) 239var identifier = generator.IdentifierName(symbol.Name); 260SyntaxNode WrapGlobal(TStatementSyntax statement) 267SyntaxNode container, 269Func<SyntaxNode, SyntaxNode> wrapConvertedSyntax, 288syntaxFacts.GetPartsOfConditionalExpression(conditionalExpression, out var condition, out var whenTrue, out var whenFalse); 295SyntaxNode Rewrite(TExpressionSyntax expression) 300var containerWithConditionalReplaced = container.ReplaceNode(conditionalExpression, TryConvert(expression, conditionalType).WithTriviaFrom(conditionalExpression)); 305SyntaxNode TryConvert(SyntaxNode expression, ITypeSymbol? conditionalType)
ReplaceDocCommentTextWithTag\AbstractReplaceDocCommentTextWithTagCodeRefactoringProvider.cs (4)
22protected abstract SyntaxNode ParseExpression(string text); 115var parsed = ParseExpression(text); 128var root = semanticModel.SyntaxTree.GetRoot(cancellationToken); 131for (var node = token.Parent; node != null; node = node.Parent)
ReplaceMethodWithProperty\AbstractReplaceMethodWithPropertyService.cs (5)
13internal abstract class AbstractReplaceMethodWithPropertyService<TMethodDeclarationSyntax> where TMethodDeclarationSyntax : SyntaxNode 16public async Task<SyntaxNode?> GetMethodDeclarationAsync(CodeRefactoringContext context) 45ISyntaxFacts syntaxFacts, GetAndSetMethods getAndSetMethods, TPropertyDeclaration property) where TPropertyDeclaration : SyntaxNode 75private static void AddParamListTriviaIfNeeded(ISyntaxFacts syntaxFacts, SyntaxNode methodDeclaration, List<SyntaxTrivia> finalLeadingTrivia) 77var paramList = syntaxFacts.GetParameterList(methodDeclaration);
ReplaceMethodWithProperty\IReplaceMethodWithPropertyService.cs (6)
18Task<SyntaxNode> GetMethodDeclarationAsync(CodeRefactoringContext context); 28void RemoveSetMethod(SyntaxEditor editor, SyntaxNode setMethodDeclaration); 33SyntaxNode getMethodDeclaration, SyntaxNode setMethodDeclaration) 37public readonly SyntaxNode GetMethodDeclaration = getMethodDeclaration; 38public readonly SyntaxNode SetMethodDeclaration = setMethodDeclaration;
ReplaceMethodWithProperty\ReplaceMethodWithPropertyCodeRefactoringProvider.cs (4)
234SyntaxNode root, SyntaxEditor editor, 274SyntaxNode root, SyntaxEditor editor, 433private static async Task<SyntaxNode?> GetMethodDeclarationAsync(IMethodSymbol? method, CancellationToken cancellationToken) 458var syntax = await definition.DeclaringSyntaxReferences[0].GetSyntaxAsync(cancellationToken).ConfigureAwait(false);
ReplacePropertyWithMethods\AbstractReplacePropertyWithMethodsService.cs (32)
23where TExpressionSyntax : SyntaxNode 24where TCrefSyntax : SyntaxNode 25where TStatementSyntax : SyntaxNode 26where TPropertySyntax : SyntaxNode 28public abstract SyntaxNode GetPropertyNodeToReplace(SyntaxNode propertyDeclaration); 29public abstract Task<ImmutableArray<SyntaxNode>> GetReplacementMembersAsync( 30Document document, IPropertySymbol property, SyntaxNode propertyDeclaration, IFieldSymbol propertyBackingField, string desiredGetMethodName, string desiredSetMethodName, CancellationToken cancellationToken); 33protected abstract TCrefSyntax CreateCrefSyntax(TCrefSyntax originalCref, SyntaxToken identifierToken, SyntaxNode? parameterType); 35protected abstract TExpressionSyntax UnwrapCompoundAssignment(SyntaxNode compoundAssignment, TExpressionSyntax readExpression); 36public async Task<SyntaxNode?> GetPropertyDeclarationAsync(CodeRefactoringContext context) 39protected static SyntaxNode GetFieldReference(SyntaxGenerator generator, IFieldSymbol propertyBackingField) 41var memberName = generator.IdentifierName(propertyBackingField.Name); 56SyntaxEditor editor, SyntaxNode identifierName, 72private delegate TExpressionSyntax GetWriteValue(ReferenceReplacer replacer, SyntaxNode parent); 163var literalOne = replacer.Generator.LiteralExpression(1); 165var writeValue = replacer._syntaxFacts.IsOperandOfIncrementExpression(replacer._expression) 185private static readonly Func<SyntaxNode, SyntaxGenerator, ReplaceParentArgs, SyntaxNode> replaceParentCallback = 255var declarator = _expression.Parent; 258var newDeclarator = Generator.NamedAnonymousObjectMemberDeclarator( 304SyntaxNode? parameterType; 319private SyntaxNode QualifyIfAppropriate(SyntaxNode newIdentifierName) 324var container = _propertyBackingField.IsStatic 341var newIdentifierName = QualifyIfAppropriate(Generator.IdentifierName(newIdentifierToken)); 356private SyntaxNode GetWriteExpression( 364var newIdentifierName = QualifyIfAppropriate(Generator.IdentifierName(newIdentifierToken)); 388string desiredName, SyntaxNode? argument, bool keepTrivia, string? conflictMessage) 393var newIdentifierName = Generator.IdentifierName(newIdentifier); 405var invocation = Generator.InvocationExpression(updatedExpression, arguments); 417private SyntaxNode GetSetInvocationExpression(
ReplacePropertyWithMethods\IReplacePropertyWithMethodsService.cs (6)
19Task<SyntaxNode> GetPropertyDeclarationAsync(CodeRefactoringContext context); 23SyntaxEditor editor, SyntaxNode identifierName, 28Task<ImmutableArray<SyntaxNode>> GetReplacementMembersAsync( 30IPropertySymbol property, SyntaxNode propertyDeclaration, 36SyntaxNode GetPropertyNodeToReplace(SyntaxNode propertyDeclaration);
ReplacePropertyWithMethods\ReplacePropertyWithMethodsCodeRefactoringProvider.cs (6)
243SyntaxNode root, SyntaxEditor editor, 264var parent = nameToken.Parent; 331var syntax = await definition.DeclaringSyntaxReferences[0].GetSyntaxAsync(cancellationToken).ConfigureAwait(false); 397private static async Task<ImmutableArray<(IPropertySymbol property, SyntaxNode declaration)>> GetCurrentPropertiesAsync( 404using var _ = ArrayBuilder<(IPropertySymbol property, SyntaxNode declaration)>.GetInstance(out var result); 419private static async Task<SyntaxNode?> GetPropertyDeclarationAsync(
Shared\Extensions\DocumentExtensions.cs (9)
23where TNode : SyntaxNode 30where TNode : SyntaxNode 36public static Document ReplaceNode<TNode>(this Document document, SyntaxNode root, TNode oldNode, TNode newNode) 37where TNode : SyntaxNode 40var newRoot = root.ReplaceNode(oldNode, newNode); 45IEnumerable<SyntaxNode> nodes, 46Func<SyntaxNode, SyntaxNode, SyntaxNode> computeReplacementNode,
Shared\Utilities\AnnotatedSymbolMapping.cs (3)
50SyntaxNode typeNode, 54using var _1 = PooledDictionary<SyntaxTree, SyntaxNode>.GetInstance(out var currentRoots); 57var typeNodeRoot = await typeNode.SyntaxTree.GetRootAsync(cancellationToken).ConfigureAwait(false);
SignatureHelp\CommonSignatureHelpUtilities.cs (7)
30where TArgumentList : SyntaxNode 53out int index) where TArgumentList : SyntaxNode 75where TArgumentList : SyntaxNode 84where TArgumentList : SyntaxNode 104SyntaxNode root, 112where TSyntax : SyntaxNode 148Document document, SyntaxNode initializer, MemberDisplayOptions options, CancellationToken cancellationToken)
SimplifyThisOrMe\AbstractSimplifyThisOrMeCodeFixProvider.cs (4)
22where TMemberAccessExpressionSyntax : SyntaxNode 25protected abstract SyntaxNode Rewrite(SyntaxNode root, ISet<TMemberAccessExpressionSyntax> memberAccessNodes); 52var newRoot = Rewrite(root, memberAccessNodes);
SimplifyThisOrMe\AbstractSimplifyThisOrMeDiagnosticAnalyzer.cs (2)
21where TExpressionSyntax : SyntaxNode 54var node = context.Node;
SimplifyTypeNames\AbstractSimplifyTypeNamesCodeFixProvider.cs (9)
35protected abstract SyntaxNode AddSimplificationAnnotationTo(SyntaxNode node); 44private (SyntaxNode, string diagnosticId) GetNodeToSimplify( 45SyntaxNode root, SemanticModel model, TextSpan span, 54SyntaxNode topmostSimplifiableNode = null; 56foreach (var node in token.GetAncestors<SyntaxNode>()) 81var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 105var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 124private bool CanSimplifyTypeNameExpression(SemanticModel model, SyntaxNode node, TSimplifierOptions options, TextSpan span, out string diagnosticId, CancellationToken cancellationToken)
Snippets\InlineExpressionInfo.cs (2)
10internal sealed class InlineExpressionInfo(SyntaxNode node, TypeInfo typeInfo) 18public SyntaxNode Node { get; } = node;
Snippets\SnippetProviders\AbstractConditionalBlockSnippetProvider.cs (2)
15where TStatementSyntax : SyntaxNode 16where TExpressionSyntax : SyntaxNode
Snippets\SnippetProviders\AbstractConsoleSnippetProvider.cs (7)
26where TExpressionStatementSyntax : SyntaxNode 27where TExpressionSyntax : SyntaxNode 28where TArgumentListSyntax : SyntaxNode 44var resultingNode = generator.InvocationExpression(generator.MemberAccessExpression(generator.IdentifierName(nameof(Console)), nameof(Console.WriteLine))); 74protected sealed override async Task<SyntaxNode> AnnotateNodesToReformatAsync( 93protected sealed override TExpressionSyntax? FindAddedSnippetSyntaxNode(SyntaxNode root, int position) 95var closestNode = root.FindNode(TextSpan.FromBounds(position, position));
Snippets\SnippetProviders\AbstractConstructorSnippetProvider.cs (1)
12where TConstructorDeclarationSyntax : SyntaxNode
Snippets\SnippetProviders\AbstractElseSnippetProvider.cs (1)
12where TElseClauseSyntax : SyntaxNode
Snippets\SnippetProviders\AbstractForEachLoopSnippetProvider.cs (1)
11where TStatementSyntax : SyntaxNode
Snippets\SnippetProviders\AbstractForLoopSnippetProvider.cs (1)
11where TStatementSyntax : SyntaxNode
Snippets\SnippetProviders\AbstractIfSnippetProvider.cs (2)
13where TIfStatementSyntax : SyntaxNode 14where TExpressionSyntax : SyntaxNode
Snippets\SnippetProviders\AbstractInlineStatementSnippetProvider.cs (8)
21where TStatementSyntax : SyntaxNode 74protected sealed override TStatementSyntax? FindAddedSnippetSyntaxNode(SyntaxNode root, int position) 76var closestNode = root.FindNode(TextSpan.FromBounds(position, position), getInnermostNodeForTie: true); 99var parentNode = targetToken.Parent; 104syntaxFacts.GetPartsOfMemberAccessExpression(parentNode, out var expression, out var dotToken, out var name); 137syntaxFacts.GetPartsOfQualifiedName(parentNode, out var expression, out var dotToken, out var right);
Snippets\SnippetProviders\AbstractLockSnippetProvider.cs (2)
13where TLockStatementSyntax : SyntaxNode 18var statement = generator.LockStatement(generator.ThisExpression(), statements: []);
Snippets\SnippetProviders\AbstractMainMethodSnippetProvider.cs (4)
16where TMethodDeclarationSyntax : SyntaxNode 17where TStatementSyntax : SyntaxNode 18where TTypeSyntax : SyntaxNode 27var method = generator.MethodDeclaration(
Snippets\SnippetProviders\AbstractPropertySnippetProvider.cs (1)
12where TPropertyDeclarationSyntax : SyntaxNode
Snippets\SnippetProviders\AbstractSingleChangeSnippetProvider.cs (1)
13where TSnippetSyntax : SyntaxNode
Snippets\SnippetProviders\AbstractSnippetProvider.cs (8)
23where TSnippetSyntax : SyntaxNode 120private static SyntaxNode? GenerateElasticTriviaForSyntax(ISyntaxFacts syntaxFacts, SyntaxNode? node) 131var nodeWithTrivia = node.ReplaceTokens(allTokens.Skip(1).Take(allTokens.Count - 2), 177var nearestStatementWithTrivia = GenerateElasticTriviaForSyntax(syntaxFacts, nearestStatement); 200var annotatedSnippetRoot = await AnnotateNodesToReformatAsync(document, position, cancellationToken).ConfigureAwait(false); 208protected virtual async Task<SyntaxNode> AnnotateNodesToReformatAsync( 219protected virtual TSnippetSyntax? FindAddedSnippetSyntaxNode(SyntaxNode root, int position)
Snippets\SnippetProviders\AbstractStatementSnippetProvider.cs (1)
10where TStatementSyntax : SyntaxNode
Snippets\SnippetProviders\AbstractTypeSnippetProvider.cs (1)
15where TTypeDeclarationSyntax : SyntaxNode
Snippets\SnippetProviders\AbstractWhileLoopSnippetProvider.cs (2)
12where TWhileStatementSyntax : SyntaxNode 13where TExpressionSyntax : SyntaxNode
SolutionCrawler\AbstractDocumentDifferenceService.cs (13)
18public async Task<SyntaxNode?> GetChangedMemberAsync(Document oldDocument, Document newDocument, CancellationToken cancellationToken) 55if (!oldDocument.TryGetSyntaxRoot(out var oldRoot) || 56!newDocument.TryGetSyntaxRoot(out var newRoot)) 103private static SyntaxNode? GetChangedMember( 104ISyntaxFactsService syntaxFactsService, SyntaxNode oldRoot, SyntaxNode newRoot, TextChangeRange range) 112var oldMember = syntaxFactsService.GetContainingMemberDeclaration(oldRoot, range.Span.Start); 113var newMember = syntaxFactsService.GetContainingMemberDeclaration(newRoot, range.Span.Start); 137private static SyntaxNode? GetBestGuessChangedMember( 138ISyntaxFactsService syntaxFactsService, SyntaxNode oldRoot, SyntaxNode newRoot, TextChangeRange range) 153var oldMember = syntaxFactsService.GetContainingMemberDeclaration(oldRoot, range.Span.Start); 154var newMember = syntaxFactsService.GetContainingMemberDeclaration(newRoot, range.Span.Start);
SolutionCrawler\IDocumentDifferenceService.cs (1)
13Task<SyntaxNode?> GetChangedMemberAsync(Document oldDocument, Document newDocument, CancellationToken cancellationToken);
SpellCheck\AbstractSpellCheckCodeFixProvider.cs (7)
21where TSimpleName : SyntaxNode 46var syntaxRoot = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 47var node = syntaxRoot.FindNode(span); 63private async Task CheckNodeAsync(CodeFixContext context, Document document, SyntaxNode node, CancellationToken cancellationToken) 105protected abstract bool DescendIntoChildren(SyntaxNode arg); 222var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 223var newRoot = root.ReplaceToken(nameToken, CreateIdentifier(nameToken, newName));
SpellCheck\AbstractSpellCheckSpanService.cs (2)
64public void Recurse(SyntaxNode root, CancellationToken cancellationToken) 259private void ProcessDocComment(SyntaxNode node, CancellationToken cancellationToken)
SplitOrMergeIfStatements\AbstractMergeIfStatementsCodeRefactoringProvider.cs (25)
23protected abstract bool IsApplicableSpan(SyntaxNode node, TextSpan span, out SyntaxNode ifOrElseIf); 29Document document, SyntaxNode ifOrElseIf, CancellationToken cancellationToken, out SyntaxNode upperIfOrElseIf); 32Document document, SyntaxNode ifOrElseIf, CancellationToken cancellationToken, out SyntaxNode lowerIfOrElseIf); 34protected abstract SyntaxNode GetChangedRoot(Document document, SyntaxNode root, SyntaxNode upperIfOrElseIf, SyntaxNode lowerIfOrElseIf); 42if (IsApplicableSpan(node, textSpan, out var ifOrElseIf)) 47if (await CanBeMergedUpAsync(document, ifOrElseIf, cancellationToken, out var upperIfOrElseIf).ConfigureAwait(false)) 50if (await CanBeMergedDownAsync(document, ifOrElseIf, cancellationToken, out var lowerIfOrElseIf).ConfigureAwait(false)) 69var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 71var upperIfOrElseIf = FindIfOrElseIf(upperIfOrElseIfSpan, ifGenerator, root); 72var lowerIfOrElseIf = FindIfOrElseIf(lowerIfOrElseIfSpan, ifGenerator, root); 77var newRoot = GetChangedRoot(document, root, upperIfOrElseIf, lowerIfOrElseIf); 80static SyntaxNode FindIfOrElseIf(TextSpan span, IIfLikeStatementGenerator ifGenerator, SyntaxNode root) 82var innerMatch = root.FindNode(span, getInnermostNodeForTie: true); 83return innerMatch?.FirstAncestorOrSelf<SyntaxNode>( 88protected static IReadOnlyList<SyntaxNode> WalkDownScopeBlocks( 90IReadOnlyList<SyntaxNode> statements) 101protected static IReadOnlyList<SyntaxNode> WalkUpScopeBlocks( 103IReadOnlyList<SyntaxNode> statements)
SplitOrMergeIfStatements\AbstractSplitIfStatementCodeRefactoringProvider.cs (17)
25protected abstract Task<SyntaxNode> GetChangedRootAsync( 27SyntaxNode root, 28SyntaxNode ifOrElseIf, 29SyntaxNode leftCondition, 30SyntaxNode rightCondition, 49if (IsPartOfBinaryExpressionChain(token, GetLogicalExpressionKind(syntaxKinds), out var rootExpression) && 65var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 68var ifOrElseIf = root.FindNode(ifOrElseIfSpan); 74var newRoot = await GetChangedRootAsync(document, root, ifOrElseIf, left, right, cancellationToken).ConfigureAwait(false); 78private static bool IsPartOfBinaryExpressionChain(SyntaxToken token, int syntaxKind, out SyntaxNode rootExpression) 94private static (SyntaxNode left, SyntaxNode right) SplitBinaryExpressionChain( 95SyntaxToken token, SyntaxNode rootExpression, ISyntaxFactsService syntaxFacts) 104syntaxFacts.GetPartsOfBinaryExpression(token.Parent, out var parentLeft, out _, out var parentRight); 106var left = parentLeft; 107var right = rootExpression.ReplaceNode(token.Parent, parentRight);
SplitOrMergeIfStatements\Consecutive\AbstractMergeConsecutiveIfStatementsCodeRefactoringProvider.cs (23)
56Document document, SyntaxNode ifOrElseIf, CancellationToken cancellationToken, out SyntaxNode firstIfOrElseIf) 69Document document, SyntaxNode ifOrElseIf, CancellationToken cancellationToken, out SyntaxNode secondIfOrElseIf) 81protected sealed override SyntaxNode GetChangedRoot(Document document, SyntaxNode root, SyntaxNode firstIfOrElseIf, SyntaxNode secondIfOrElseIf) 140SyntaxNode ifOrElseIf, 141out SyntaxNode parentIfOrElseIf) 151SyntaxNode ifOrElseIf, 152out SyntaxNode elseIfClause) 163SyntaxNode ifOrElseIf, 165out SyntaxNode previousStatement) 177SyntaxNode ifOrElseIf, 179out SyntaxNode nextStatement) 191SyntaxNode firstStatement, 192SyntaxNode secondStatement, 229SyntaxNode ifOrElseIf, 231out SyntaxNode statement) 249SyntaxNode ifStatement1, 250SyntaxNode ifStatement2, 251out IReadOnlyList<SyntaxNode> statements)
SplitOrMergeIfStatements\Consecutive\AbstractSplitIntoConsecutiveIfStatementsCodeRefactoringProvider.cs (6)
54protected sealed override async Task<SyntaxNode> GetChangedRootAsync( 56SyntaxNode root, 57SyntaxNode ifOrElseIf, 58SyntaxNode leftCondition, 59SyntaxNode rightCondition, 120SyntaxNode ifOrElseIf,
SplitOrMergeIfStatements\IIfLikeStatementGenerator.cs (32)
20bool IsIfOrElseIf(SyntaxNode node); 22bool IsCondition(SyntaxNode expression, out SyntaxNode ifOrElseIf); 24bool IsElseIfClause(SyntaxNode node, out SyntaxNode parentIfOrElseIf); 26bool HasElseIfClause(SyntaxNode ifOrElseIf, out SyntaxNode elseIfClause); 28SyntaxNode GetCondition(SyntaxNode ifOrElseIf); 33SyntaxNode GetRootIfStatement(SyntaxNode ifOrElseIf); 38ImmutableArray<SyntaxNode> GetElseIfAndElseClauses(SyntaxNode ifOrElseIf); 40SyntaxNode WithCondition(SyntaxNode ifOrElseIf, SyntaxNode condition); 42SyntaxNode WithStatementInBlock(SyntaxNode ifOrElseIf, SyntaxNode statement); 44SyntaxNode WithStatementsOf(SyntaxNode ifOrElseIf, SyntaxNode otherIfOrElseIf); 46SyntaxNode WithElseIfAndElseClausesOf(SyntaxNode ifStatement, SyntaxNode otherIfStatement); 51SyntaxNode ToIfStatement(SyntaxNode ifOrElseIf); 56SyntaxNode ToElseIfClause(SyntaxNode ifOrElseIf); 62void InsertElseIfClause(SyntaxEditor editor, SyntaxNode afterIfOrElseIf, SyntaxNode elseIfClause); 67void RemoveElseIfClause(SyntaxEditor editor, SyntaxNode elseIfClause);
SplitOrMergeIfStatements\Nested\AbstractMergeNestedIfStatementsCodeRefactoringProvider.cs (19)
44Document document, SyntaxNode ifOrElseIf, CancellationToken cancellationToken, out SyntaxNode outerIfOrElseIf) 57Document document, SyntaxNode ifOrElseIf, CancellationToken cancellationToken, out SyntaxNode innerIfStatement) 69protected sealed override SyntaxNode GetChangedRoot(Document document, SyntaxNode root, SyntaxNode outerIfOrElseIf, SyntaxNode innerIfStatement) 91SyntaxNode statement, 92out SyntaxNode ifOrElseIf) 120SyntaxNode ifOrElseIf, 121out SyntaxNode ifStatement) 149SyntaxNode outerIfOrElseIf, 150SyntaxNode innerIfStatement, 200var outerIfStatement = ifGenerator.GetRootIfStatement(outerIfOrElseIf); 232SyntaxNode elseIfOrElseClause1, 233SyntaxNode elseIfOrElseClause2) 247var condition1 = ifGenerator.GetCondition(elseIfOrElseClause1); 248var condition2 = ifGenerator.GetCondition(elseIfOrElseClause2);
SplitOrMergeIfStatements\Nested\AbstractSplitIntoNestedIfStatementsCodeRefactoringProvider.cs (5)
40protected sealed override Task<SyntaxNode> GetChangedRootAsync( 42SyntaxNode root, 43SyntaxNode ifOrElseIf, 44SyntaxNode leftCondition, 45SyntaxNode rightCondition,
src\Analyzers\Core\Analyzers\AddAccessibilityModifiers\AbstractAddAccessibilityModifiers.cs (2)
11where TMemberDeclarationSyntax : SyntaxNode 15SyntaxNode member,
src\Analyzers\Core\Analyzers\AddAccessibilityModifiers\AbstractAddAccessibilityModifiersDiagnosticAnalyzer.cs (1)
13where TCompilationUnitSyntax : SyntaxNode
src\Analyzers\Core\Analyzers\AddAccessibilityModifiers\IAddAccessibilityModifiersService.cs (1)
19SyntaxNode member,
src\Analyzers\Core\Analyzers\AddRequiredParentheses\AbstractAddRequiredParenthesesDiagnosticAnalyzer.cs (1)
20where TExpressionSyntax : SyntaxNode
src\Analyzers\Core\Analyzers\ConvertTypeofToNameof\AbstractConvertTypeOfToNameOfDiagnosticAnalyzer.cs (2)
41var node = context.Operation.Syntax; 42var parent = node.Parent;
src\Analyzers\Core\Analyzers\FileHeaders\AbstractFileHeaderDiagnosticAnalyzer.cs (1)
48var root = tree.GetRoot(context.CancellationToken);
src\Analyzers\Core\Analyzers\FileHeaders\AbstractFileHeaderHelper.cs (1)
41public FileHeader ParseFileHeader(SyntaxNode root)
src\Analyzers\Core\Analyzers\ForEachCast\AbstractForEachCastDiagnosticAnalyzer.cs (1)
24where TForEachStatementSyntax : SyntaxNode
src\Analyzers\Core\Analyzers\Formatting\AbstractFormattingAnalyzer.cs (1)
50var root = tree.GetRoot(cancellationToken);
src\Analyzers\Core\Analyzers\MakeFieldReadonly\AbstractMakeFieldReadonlyDiagnosticAnalyzer.cs (1)
21where TThisExpression : SyntaxNode
src\Analyzers\Core\Analyzers\MatchFolderAndNamespace\AbstractMatchFolderAndNamespaceDiagnosticAnalyzer.cs (2)
22where TNamespaceSyntax : SyntaxNode 95var root = namespaceDeclaration.SyntaxTree.GetRoot(cancellationToken);
src\Analyzers\Core\Analyzers\NewLines\ConsecutiveStatementPlacement\AbstractConsecutiveStatementPlacementDiagnosticAnalyzer.cs (5)
17where TExecutableStatementSyntax : SyntaxNode 31protected abstract bool IsBlockLikeStatement(SyntaxNode node); 32protected abstract Location GetDiagnosticLocation(SyntaxNode block); 50private void Recurse(SyntaxTreeAnalysisContext context, NotificationOption2 notificationOption, SyntaxNode node, CancellationToken cancellationToken) 68private void ProcessBlockLikeStatement(SyntaxTreeAnalysisContext context, NotificationOption2 notificationOption, SyntaxNode block)
src\Analyzers\Core\Analyzers\NewLines\MultipleBlankLines\AbstractMultipleBlankLinesDiagnosticAnalyzer.cs (1)
48SyntaxNode node,
src\Analyzers\Core\Analyzers\OrderModifiers\AbstractOrderModifiersDiagnosticAnalyzer.cs (2)
64SyntaxNode root); 70SyntaxNode memberDeclaration)
src\Analyzers\Core\Analyzers\PopulateSwitch\AbstractPopulateSwitchDiagnosticAnalyzer.cs (1)
18where TSwitchSyntax : SyntaxNode
src\Analyzers\Core\Analyzers\PopulateSwitch\AbstractPopulateSwitchExpressionDiagnosticAnalyzer.cs (1)
13where TSwitchSyntax : SyntaxNode
src\Analyzers\Core\Analyzers\PopulateSwitch\AbstractPopulateSwitchStatementDiagnosticAnalyzer.cs (1)
13where TSwitchSyntax : SyntaxNode
src\Analyzers\Core\Analyzers\QualifyMemberAccess\AbstractQualifyMemberAccessDiagnosticAnalyzer.cs (2)
21where TExpressionSyntax : SyntaxNode 45protected abstract bool CanMemberAccessBeQualified(ISymbol containingSymbol, SyntaxNode node);
src\Analyzers\Core\Analyzers\RemoveRedundantEquality\AbstractRemoveRedundantEqualityDiagnosticAnalyzer.cs (2)
34var syntax = context.Operation.Syntax; 56var syntax = context.Operation.Syntax;
src\Analyzers\Core\Analyzers\RemoveUnnecessaryCast\AbstractRemoveUnnecessaryCastDiagnosticAnalyzer.cs (1)
18where TCastExpression : SyntaxNode
src\Analyzers\Core\Analyzers\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsDiagnosticAnalyzer.cs (9)
20where TSyntaxNode : SyntaxNode 70protected abstract ImmutableArray<SyntaxNode> MergeImports(ImmutableArray<TSyntaxNode> unnecessaryImports); 74protected abstract SyntaxToken? TryGetLastToken(SyntaxNode node); 141private IEnumerable<TextSpan> GetContiguousSpans(ImmutableArray<SyntaxNode> nodes) 144(SyntaxNode node, TextSpan textSpan)? previous = null; 147foreach (var node in nodes.OrderBy(n => n.SpanStart)) 179int GetEnd(SyntaxNode node) 209IEnumerable<SyntaxNode> nodes, SyntaxTree tree, CancellationToken cancellationToken); 212IEnumerable<SyntaxNode> nodes, SyntaxTree tree, CancellationToken cancellationToken)
src\Analyzers\Core\Analyzers\RemoveUnnecessaryParentheses\AbstractRemoveUnnecessaryParenthesesDiagnosticAnalyzer.cs (1)
22where TParenthesizedExpressionSyntax : SyntaxNode
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryAttributeSuppressionsDiagnosticAnalyzer.cs (1)
74public void AnalyzeAssemblyOrModuleAttribute(SyntaxNode attributeSyntax, SemanticModel model, Action<Diagnostic> reportDiagnostic, CancellationToken cancellationToken)
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (17)
49protected abstract bool ContainsPragmaDirective(SyntaxNode root); 127var root = tree.GetRoot(cancellationToken); 166using var _5 = PooledDictionary<string, List<SyntaxNode>>.GetInstance(out var idToSuppressMessageAttributesMap); 167using var _6 = PooledDictionary<SyntaxNode, bool>.GetInstance(out var suppressMessageAttributesToIsUsedMap); 226SyntaxNode root, 297SyntaxNode idNode, 391SyntaxNode root, 512PooledDictionary<string, List<SyntaxNode>> idToSuppressMessageAttributesMap, 513PooledDictionary<SyntaxNode, bool> suppressMessageAttributesToIsUsedMap, 586PooledDictionary<string, List<SyntaxNode>> idToSuppressMessageAttributesMap, 587PooledDictionary<SyntaxNode, bool> suppressMessageAttributesToIsUsedMap, 596var attributeNode = await attribute.ApplicationSyntaxReference.GetSyntaxAsync(cancellationToken).ConfigureAwait(false); 611PooledDictionary<SyntaxNode, bool> suppressMessageAttributesToIsUsedMap, 663PooledDictionary<SyntaxNode, bool> suppressMessageAttributesToIsUsedMap, 733SyntaxNode root, 736PooledDictionary<string, List<SyntaxNode>> idToSuppressMessageAttributesMap, 737PooledDictionary<SyntaxNode, bool> suppressMessageAttributesToIsUsedMap,
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\SuppressMessageAttributeState.cs (1)
46SyntaxNode attributeSyntax,
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (6)
34where TDocumentationCommentTriviaSyntax : SyntaxNode 35where TIdentifierNameSyntax : SyntaxNode 37where TMemberDeclarationSyntax : SyntaxNode 67protected abstract SyntaxNode GetParentIfSoleDeclarator(SyntaxNode declaration); 673SyntaxNode memberDeclaration, ArrayBuilder<TDocumentationCommentTriviaSyntax> documentationComments)
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.cs (2)
113protected abstract bool IsIfConditionalDirective(SyntaxNode node); 114protected abstract bool ReturnsThrow(SyntaxNode node);
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (1)
126var root = firstBlock.Syntax.SyntaxTree.GetRoot(context.CancellationToken);
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.cs (2)
80var syntax = syntaxRef.GetSyntax(cancellationToken); 263var methodSyntax = method.DeclaringSyntaxReferences.FirstOrDefault()?.GetSyntax(cancellationToken);
src\Analyzers\Core\Analyzers\SimplifyBooleanExpression\AbstractSimplifyConditionalDiagnosticAnalyzer.cs (4)
23where TExpressionSyntax : SyntaxNode 77conditionalExpression, out var conditionNode, out var whenTrueNode, out var whenFalseNode);
src\Analyzers\Core\Analyzers\SimplifyInterpolation\AbstractSimplifyInterpolationDiagnosticAnalyzer.cs (2)
17where TInterpolationSyntax : SyntaxNode 18where TExpressionSyntax : SyntaxNode
src\Analyzers\Core\Analyzers\SimplifyInterpolation\AbstractSimplifyInterpolationHelpers.cs (5)
24protected abstract SyntaxNode GetPreservedInterpolationExpressionSyntax(IOperation operation); 30where TInterpolationSyntax : SyntaxNode 31where TExpressionSyntax : SyntaxNode 194where TExpressionSyntax : SyntaxNode 214var alignmentSyntax = alignmentOp.Syntax;
src\Analyzers\Core\Analyzers\SimplifyLinqExpression\AbstractSimplifyLinqExpressionDiagnosticAnalyzer.cs (3)
17where TInvocationExpressionSyntax : SyntaxNode 18where TMemberAccessExpressionSyntax : SyntaxNode 166SyntaxFacts.GetExpressionOfMemberAccessExpression(memberAccess) is SyntaxNode expression)
src\Analyzers\Core\Analyzers\SimplifyTypeNames\SimplifyTypeNamesDiagnosticAnalyzerBase.cs (6)
78internal abstract bool IsCandidate(SyntaxNode node); 80SemanticModel model, SyntaxNode node, TSimplifierOptions options, 110protected abstract bool IsIgnoredCodeBlock(SyntaxNode codeBlock); 111protected abstract ImmutableArray<Diagnostic> AnalyzeCodeBlock(CodeBlockAnalysisContext context, SyntaxNode root); 112protected abstract ImmutableArray<Diagnostic> AnalyzeSemanticModel(SemanticModelAnalysisContext context, SyntaxNode root, TextSpanMutableIntervalTree? codeBlockIntervalTree); 114public bool TrySimplify(SemanticModel model, SyntaxNode node, [NotNullWhen(true)] out Diagnostic? diagnostic, TSimplifierOptions options, AnalyzerOptions analyzerOptions, CancellationToken cancellationToken)
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (25)
33where TPropertyDeclaration : SyntaxNode 34where TConstructorDeclaration : SyntaxNode 35where TFieldDeclaration : SyntaxNode 36where TVariableDeclarator : SyntaxNode 37where TExpression : SyntaxNode 44private static readonly ObjectPool<ConcurrentSet<SyntaxNode>> s_nodeSetPool = new(() => []); 46private static readonly ObjectPool<ConcurrentDictionary<IFieldSymbol, ConcurrentSet<SyntaxNode>>> s_fieldToUsageLocationPool = new(() => []); 63protected static void AddFieldUsage(ConcurrentDictionary<IFieldSymbol, ConcurrentSet<SyntaxNode>> fieldWrites, IFieldSymbol field, SyntaxNode location) 66private static void ClearAndFree(ConcurrentDictionary<IFieldSymbol, ConcurrentSet<SyntaxNode>> multiMap) 98protected abstract SyntaxNode GetFieldNode(TFieldDeclaration fieldDeclaration, TVariableDeclarator variableDeclarator); 103HashSet<string> fieldNames, ConcurrentDictionary<IFieldSymbol, ConcurrentSet<SyntaxNode>> ineligibleFieldUsageIfOutsideProperty, SemanticModel semanticModel, SyntaxNode codeBlock, CancellationToken cancellationToken); 219if (!shouldAnalyze && analysisRoot.FirstAncestorOrSelf<SyntaxNode>(node => node is TPropertyDeclaration or TFieldDeclaration) == null) 229ConcurrentDictionary<IFieldSymbol, ConcurrentSet<SyntaxNode>> fieldReads, 230ConcurrentDictionary<IFieldSymbol, ConcurrentSet<SyntaxNode>> fieldWrites, 232SyntaxNode codeBlock, 539ConcurrentDictionary<IFieldSymbol, ConcurrentSet<SyntaxNode>> ineligibleFieldUsageIfOutsideProperty, 540ConcurrentDictionary<IFieldSymbol, ConcurrentSet<SyntaxNode>> fieldReads, 541ConcurrentDictionary<IFieldSymbol, ConcurrentSet<SyntaxNode>> fieldWrites, 626static bool NotWithinProperty(IEnumerable<SyntaxNode> nodes, TPropertyDeclaration propertyDeclaration) 628foreach (var node in nodes) 637static IEnumerable<SyntaxNode> NonConstructorLocations(IEnumerable<SyntaxNode> nodes) 644var fieldNode = GetFieldNode(result.FieldDeclaration, variableDeclarator);
src\Analyzers\Core\Analyzers\UseCoalesceExpression\AbstractUseCoalesceExpressionForIfNullCheckDiagnosticAnalyzer.cs (12)
25where TExpressionSyntax : SyntaxNode 26where TStatementSyntax : SyntaxNode 27where TVariableDeclarator : SyntaxNode 46protected abstract SyntaxNode GetDeclarationNode(TVariableDeclarator declarator); 89var thrownExpression = syntaxFacts.GetExpressionOfThrowStatement(whenTrueStatement); 152var equalsValue = syntaxFacts.GetInitializerOfVariableDeclarator(declarator); 170if (!IsLegalWhenTrueStatementForAssignment(out var whenPartToAnalyze)) 176foreach (var identifier in whenPartToAnalyze.DescendantNodesAndSelf()) 189bool IsLegalWhenTrueStatementForAssignment([NotNullWhen(true)] out SyntaxNode? whenPartToAnalyze) 208syntaxFacts.GetPartsOfAssignmentStatement(whenTrueStatement, out var left, out var right); 231syntaxFacts.GetPartsOfAssignmentStatement(assignmentStatement, out var topAssignmentLeft, out var topAssignmentRight); 254syntaxFacts.GetPartsOfAssignmentStatement(whenTrueStatement, out var innerAssignmentLeft, out _);
src\Analyzers\Core\Analyzers\UseCoalesceExpression\AbstractUseCoalesceExpressionForNullableTernaryConditionalCheckDiagnosticAnalyzer.cs (7)
24where TExpressionSyntax : SyntaxNode 64conditionalExpression, out var conditionNode, out var whenTrueNodeHigh, out var whenFalseNodeHigh); 80syntaxFacts.GetPartsOfMemberAccessExpression(conditionMemberAccess, out var conditionExpression, out var conditionSimpleName); 90syntaxFacts.GetPartsOfMemberAccessExpression(whenPartMemberAccess, out var whenPartExpression, out var whenPartSimpleName); 118var whenPartToKeep = notHasValueExpression ? whenTrueNodeHigh : whenFalseNodeHigh;
src\Analyzers\Core\Analyzers\UseCoalesceExpression\AbstractUseCoalesceExpressionForTernaryConditionalCheckDiagnosticAnalyzer.cs (6)
21where TExpressionSyntax : SyntaxNode 58conditionalExpression, out var conditionNode, out var whenTrueNodeHigh, out var whenFalseNodeHigh); 73syntaxFacts.GetPartsOfBinaryExpression(condition, out var conditionLeftHigh, out var conditionRightHigh); 122var whenPartToCheck = isEquals ? whenTrueNodeHigh : whenFalseNodeHigh;
src\Analyzers\Core\Analyzers\UseCollectionExpression\CollectionExpressionMatch.cs (1)
19bool UseSpread) where TMatchNode : SyntaxNode;
src\Analyzers\Core\Analyzers\UseCollectionInitializer\AbstractObjectCreationExpressionAnalyzer.cs (4)
24where TExpressionSyntax : SyntaxNode 25where TStatementSyntax : SyntaxNode 28where TVariableDeclaratorSyntax : SyntaxNode 164out var left, out var right);
src\Analyzers\Core\Analyzers\UseCollectionInitializer\AbstractUseCollectionInitializerAnalyzer.cs (16)
30CollectionMatch<SyntaxNode>, TAnalyzer> 31where TExpressionSyntax : SyntaxNode 32where TStatementSyntax : SyntaxNode 38where TVariableDeclaratorSyntax : SyntaxNode 50protected abstract bool IsComplexElementInitializer(SyntaxNode expression); 53ArrayBuilder<CollectionMatch<SyntaxNode>> preMatches, ArrayBuilder<CollectionMatch<SyntaxNode>> postMatches, CancellationToken cancellationToken); 91ArrayBuilder<CollectionMatch<SyntaxNode>> preMatches, ArrayBuilder<CollectionMatch<SyntaxNode>> postMatches, CancellationToken cancellationToken) 135private CollectionMatch<SyntaxNode>? TryAnalyzeStatement( 143private CollectionMatch<SyntaxNode>? TryAnalyzeStatementForCollectionInitializer( 212this.SyntaxFacts.GetPartsOfAssignmentStatement(statement, out var left, out var right); 224this.SyntaxFacts.GetPartsOfElementAccessExpression(left, out var elementInstance, out var argumentList); 226foreach (var argument in elementAccessArguments) 233var argExpression = this.SyntaxFacts.GetExpressionOfArgument(argument);
src\Analyzers\Core\Analyzers\UseCollectionInitializer\AbstractUseCollectionInitializerDiagnosticAnalyzer.cs (8)
31where TExpressionSyntax : SyntaxNode 32where TStatementSyntax : SyntaxNode 38where TVariableDeclaratorSyntax : SyntaxNode 86ImmutableArray<CollectionMatch<SyntaxNode>> preMatches, 176? ImmutableArray<SyntaxNode>.Empty 201(ImmutableArray<CollectionMatch<SyntaxNode>> matches, bool shouldUseCollectionExpression, bool changesSemantics)? GetCollectionInitializerMatches() 218(ImmutableArray<CollectionMatch<SyntaxNode>> matches, bool shouldUseCollectionExpression, bool changesSemantics)? GetCollectionExpressionMatches() 244ImmutableArray<CollectionMatch<SyntaxNode>> matches,
src\Analyzers\Core\Analyzers\UseCollectionInitializer\IUpdateExpressionSyntaxHelper.cs (2)
12where TExpressionSyntax : SyntaxNode 13where TStatementSyntax : SyntaxNode
src\Analyzers\Core\Analyzers\UseCollectionInitializer\UpdateExpressionState.cs (11)
24where TExpressionSyntax : SyntaxNode 25where TStatementSyntax : SyntaxNode 107SyntaxNode expression, 275out SeparatedSyntaxList<SyntaxNode> arguments) 294this.SyntaxFacts.GetPartsOfMemberAccessExpression(memberAccess, out var localInstance, out var memberName); 300foreach (var argument in arguments) 305var argumentExpression = this.SyntaxFacts.GetExpressionOfArgument(argument); 341public CollectionMatch<SyntaxNode>? TryAnalyzeStatementForCollectionExpression( 359CollectionMatch<SyntaxNode>? TryAnalyzeExpressionStatement(TStatementSyntax expressionStatement) 373CollectionMatch<SyntaxNode>? TryAnalyzeForeachStatement(TStatementSyntax foreachStatement) 403CollectionMatch<SyntaxNode>? TryAnalyzeIfStatement(TStatementSyntax ifStatement)
src\Analyzers\Core\Analyzers\UseCollectionInitializer\UseCollectionInitializerHelpers.cs (5)
24CollectionMatch<SyntaxNode> matchInfo) 26var match = matchInfo.Node; 30var expression = syntaxFacts.GetExpressionOfExpressionStatement(match); 46var expression = syntaxFacts.GetExpressionOfForeachStatement(match); 59TStatementSyntax initialStatement) where TStatementSyntax : SyntaxNode
src\Analyzers\Core\Analyzers\UseCompoundAssignment\AbstractUseCompoundAssignmentDiagnosticAnalyzer.cs (5)
20where TAssignmentSyntax : SyntaxNode 21where TBinaryExpressionSyntax : SyntaxNode 88out var assignmentLeft, out var assignmentToken, out var assignmentRight); 112out var binaryLeft, out var binaryRight);
src\Analyzers\Core\Analyzers\UseCompoundAssignment\UseCompoundAssignmentUtilities.cs (6)
41ISyntaxFacts syntaxFacts, SyntaxNode expr, SemanticModel semanticModel, CancellationToken cancellationToken) 47ISyntaxFacts syntaxFacts, SyntaxNode expr, SemanticModel semanticModel, 74out _, out var expression, out _); 82out var subExpr, out _); 90out var expression, out var whenNotNull); 100SyntaxNode expr, SemanticModel semanticModel, bool isTopLevel, CancellationToken cancellationToken)
src\Analyzers\Core\Analyzers\UseConditionalExpression\AbstractUseConditionalExpressionDiagnosticAnalyzer.cs (1)
16where TIfStatementSyntax : SyntaxNode
src\Analyzers\Core\Analyzers\UseConditionalExpression\ForAssignment\AbstractUseConditionalExpressionForAssignmentDiagnosticAnalyzer.cs (1)
14where TIfStatementSyntax : SyntaxNode
src\Analyzers\Core\Analyzers\UseConditionalExpression\ForReturn\AbstractUseConditionalExpressionForReturnDiagnosticAnalyzer.cs (1)
14where TIfStatementSyntax : SyntaxNode
src\Analyzers\Core\Analyzers\UseConditionalExpression\UseConditionalExpressionHelpers.cs (1)
64public static bool HasRegularComments(ISyntaxFacts syntaxFacts, SyntaxNode syntax)
src\Analyzers\Core\Analyzers\UseExplicitTupleName\UseExplicitTupleNameDiagnosticAnalyzer.cs (2)
57var memberAccessSyntax = fieldReferenceOperation.Syntax; 58var nameNode = memberAccessSyntax.ChildNodesAndTokens().Reverse().FirstOrDefault().AsNode();
src\Analyzers\Core\Analyzers\UseIsNullCheck\AbstractUseIsNullForReferenceEqualsDiagnosticAnalyzer.cs (7)
68var invocation = context.Node; 148private static ITypeParameterSymbol? GetGenericParameterSymbol(ISyntaxFacts syntaxFacts, SemanticModel semanticModel, SyntaxNode node1, SyntaxNode node2, CancellationToken cancellationToken) 150var valueNode = syntaxFacts.IsNullLiteralExpression(syntaxFacts.GetExpressionOfArgument(node1)) ? node2 : node1; 151var argumentExpression = syntaxFacts.GetExpressionOfArgument(valueNode); 161private static bool MatchesPattern(ISyntaxFacts syntaxFacts, SyntaxNode node1, SyntaxNode node2)
src\Analyzers\Core\Analyzers\UseNullPropagation\AbstractUseNullPropagationDiagnosticAnalyzer.cs (8)
41where TExpressionSyntax : SyntaxNode 42where TStatementSyntax : SyntaxNode 116conditionalExpression, out var condition, out var whenTrue, out var whenFalse); 245syntaxFacts.GetPartsOfBinaryExpression(condition, out var conditionLeft, out var conditionRight); 358syntaxFacts.GetPartsOfCastExpression(node, out var type, out var expression);
src\Analyzers\Core\Analyzers\UseObjectInitializer\AbstractUseObjectInitializerDiagnosticAnalyzer.cs (4)
27where TExpressionSyntax : SyntaxNode 28where TStatementSyntax : SyntaxNode 33where TVariableDeclaratorSyntax : SyntaxNode 119var nodes = ImmutableArray.Create<SyntaxNode>(containingStatement).AddRange(matches.Select(m => m.Statement));
src\Analyzers\Core\Analyzers\UseObjectInitializer\UseNamedMemberInitializerAnalyzer.cs (10)
32where TExpressionSyntax : SyntaxNode 33where TStatementSyntax : SyntaxNode 38where TVariableDeclaratorSyntax : SyntaxNode 79foreach (var init in this.SyntaxFacts.GetInitializersOfObjectMemberInitializer(initializer)) 83this.SyntaxFacts.GetPartsOfNamedMemberInitializer(init, out var name, out _); 100statement, out var left, out var right); 193private bool ImplicitMemberAccessWouldBeAffected(SyntaxNode node) 208var expression = this.SyntaxFacts.GetExpressionOfMemberAccessExpression( 233where TExpressionSyntax : SyntaxNode 234where TStatementSyntax : SyntaxNode
src\Analyzers\Core\Analyzers\UseThrowExpression\AbstractUseThrowExpressionDiagnosticAnalyzer.cs (2)
78var throwStatementSyntax = throwOperation.Syntax; 273var throwStatement = throwOperation.Syntax;
src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (16)
63protected abstract SyntaxNode GetArgumentExpression(SyntaxNode syntaxNode); 64protected abstract SyntaxNode? TryGetMatchingNamedArgument(SeparatedSyntaxList<SyntaxNode> arguments, string searchArgumentName); 125var formatStringLiteralExpressionSyntax = TryGetFormatStringLiteralExpressionSyntax( 158private static bool IsValidFormatMethod(ISyntaxFacts syntaxFacts, SyntaxNode expression) 182SeparatedSyntaxList<SyntaxNode> arguments, 192SeparatedSyntaxList<SyntaxNode> arguments, 196var argsArgument = TryGetArgument(NameOfArgsParameter, arguments, parameters); 203var expression = syntaxFacts.GetExpressionOfArgument(argsArgument)!; 207protected SyntaxNode? TryGetArgument( 209SeparatedSyntaxList<SyntaxNode> arguments, 213var matchingNamedArgument = TryGetMatchingNamedArgument(arguments, searchArgumentName); 257protected SyntaxNode? TryGetFormatStringLiteralExpressionSyntax( 258SeparatedSyntaxList<SyntaxNode> arguments, 262var formatArgumentSyntax = TryGetArgument(
src\Analyzers\Core\CodeFixes\AddAccessibilityModifiers\AbstractAddAccessibilityModifiersCodeFixProvider.cs (3)
21protected abstract SyntaxNode MapToDeclarator(SyntaxNode declaration); 52var declarator = MapToDeclarator(declaration);
src\Analyzers\Core\CodeFixes\AddAccessibilityModifiers\AddAccessibilityModifiersHelpers.cs (3)
15SyntaxEditor editor, ISymbol symbol, SyntaxNode declaration) 29SyntaxNode UpdateAccessibility(SyntaxNode declaration, Accessibility preferredAccessibility)
src\Analyzers\Core\CodeFixes\AddAnonymousTypeMemberName\AbstractAddAnonymousTypeMemberNameCodeFixProvider.cs (4)
24where TExpressionSyntax : SyntaxNode 25where TAnonymousObjectInitializer : SyntaxNode 26where TAnonymousObjectMemberDeclaratorSyntax : SyntaxNode 126var anonymousType = current.Parent;
src\Analyzers\Core\CodeFixes\AddExplicitCast\AbstractAddExplicitCastCodeFixProvider.cs (11)
22where TExpressionSyntax : SyntaxNode 31protected abstract void GetPartsOfCastOrConversionExpression(TExpressionSyntax expression, out SyntaxNode type, out TExpressionSyntax castedExpression); 49Document document, SemanticModel semanticModel, SyntaxNode root, 61Document document, SemanticModel semanticModel, SyntaxNode root, 116private (SyntaxNode finalTarget, SyntaxNode finalReplacement) ApplyFix( 136(SyntaxNode finalTarget, SyntaxNode finalReplacement) ApplyFixWorker() 141GetPartsOfCastOrConversionExpression(targetNode, out var castTypeNode, out var castedExpression); 161protected virtual (SyntaxNode finalTarget, SyntaxNode finalReplacement) Cast(SemanticModel semanticModel, TExpressionSyntax targetNode, ITypeSymbol conversionType)
src\Analyzers\Core\CodeFixes\AddExplicitCast\Fixer.cs (8)
19where TArgumentSyntax : SyntaxNode 20where TArgumentListSyntax : SyntaxNode 21where TInvocationSyntax : SyntaxNode 41SyntaxNode root, 111SyntaxNode root, 205SyntaxNode root, 208SyntaxNode targetNode) 210var newRoot = root.ReplaceNode(oldArgumentList, GenerateNewArgumentList(oldArgumentList, newArguments));
src\Analyzers\Core\CodeFixes\AddExplicitCast\InheritanceDistanceComparer.cs (1)
35where TExpressionSyntax : SyntaxNode
src\Analyzers\Core\CodeFixes\AddObsoleteAttribute\AbstractAddObsoleteAttributeCodeFixProvider.cs (4)
48var container = GetContainer(root, node); 65private SyntaxNode? GetContainer(SyntaxNode root, SyntaxNode node)
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (12)
29where TArgumentSyntax : SyntaxNode 30where TArgumentListSyntax : SyntaxNode 31where TAttributeArgumentListSyntax : SyntaxNode 32where TInvocationExpressionSyntax : SyntaxNode 33where TObjectCreationExpressionSyntax : SyntaxNode 38protected abstract ITypeSymbol GetArgumentType(SyntaxNode argumentNode, SemanticModel semanticModel, CancellationToken cancellationToken); 48SyntaxNode node, 99SyntaxNode initialNode, SyntaxNode node, Diagnostic diagnostic) 118SyntaxNode node, 139SyntaxNode node, 472var expressionOfArgument = syntaxFacts.GetExpressionOfArgument(argument);
src\Analyzers\Core\CodeFixes\AddParameter\AddParameterService.cs (3)
123var argumentInitializer = parameterMustBeOptional ? generator.DefaultExpression(newParameterType) : null; 124var parameterDeclaration = generator.ParameterDeclaration(parameterSymbol, argumentInitializer) 140var newRoot = editor.GetChangedRoot();
src\Analyzers\Core\CodeFixes\AddParameter\ArgumentInsertPositionData.cs (1)
7internal readonly struct ArgumentInsertPositionData<TArgumentSyntax>(IMethodSymbol methodToUpdate, TArgumentSyntax argumentToInsert, int argumentInsertionIndex) where TArgumentSyntax : SyntaxNode
src\Analyzers\Core\CodeFixes\AddParameter\RegisterFixData.cs (1)
10where TArgumentSyntax : SyntaxNode
src\Analyzers\Core\CodeFixes\ConflictMarkerResolution\AbstractConflictMarkerCodeFixProvider.cs (1)
84SyntaxNode root, SourceText text, int position,
src\Analyzers\Core\CodeFixes\ConvertToAsync\AbstractConvertToAsyncCodeFixProvider.cs (10)
20protected abstract Task<string> GetDescriptionAsync(Diagnostic diagnostic, SyntaxNode node, SemanticModel semanticModel, CancellationToken cancellationToken); 21protected abstract Task<Tuple<SyntaxTree, SyntaxNode>> GetRootInOtherSyntaxTreeAsync(SyntaxNode node, SemanticModel semanticModel, Diagnostic diagnostic, CancellationToken cancellationToken); 32var root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 33if (!TryGetNode(root, context.Span, out var node)) 48private static bool TryGetNode(SyntaxNode root, TextSpan span, out SyntaxNode node) 51var ancestors = root.FindToken(span.Start).GetAncestors<SyntaxNode>(); 62SyntaxNode node, Document document, Diagnostic diagnostic, CancellationToken cancellationToken) 71var newRoot = result.Item2;
src\Analyzers\Core\CodeFixes\ConvertTypeOfToNameOf\AbstractConvertTypeOfToNameOfCodeFixProvider.cs (4)
18where TMemberAccessExpressionSyntax : SyntaxNode 22protected abstract SyntaxNode GetSymbolTypeExpression(SemanticModel model, TMemberAccessExpressionSyntax node, CancellationToken cancellationToken); 53var typeExpression = GetSymbolTypeExpression(semanticModel, nodeToReplace, cancellationToken); 54var nameOfSyntax = editor.Generator.NameOfExpression(typeExpression);
src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractAddDocCommentNodesCodeFixProvider.cs (10)
22where TXmlElementSyntax : SyntaxNode 23where TXmlNameAttributeSyntax : SyntaxNode 24where TXmlTextSyntax : SyntaxNode 25where TMemberDeclarationSyntax : SyntaxNode 37var docCommentNode = TryGetDocCommentNode(parentMethod.GetLeadingTrivia()); 53protected abstract SyntaxNode? TryGetDocCommentNode(SyntaxTriviaList parameter); 59Document document, TMemberDeclarationSyntax parentMethod, SyntaxNode docCommentNode, CancellationToken cancellationToken) 63var newDocComment = docCommentNode; 103var nodeAfterNewParamNode = paramNodes.FirstOrDefault() ?? newDocComment.ChildNodes().First(); 125private List<TXmlElementSyntax> GetElementNodes(SyntaxNode docComment, string nodeName)
src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractRemoveDocCommentNodeCodeFixProvider.cs (7)
19where TXmlElementSyntax : SyntaxNode 20where TXmlTextSyntax : SyntaxNode 49private static TXmlElementSyntax? GetParamNode(SyntaxNode root, TextSpan span) 55var paramNode = root.FindNode(span, findInsideTrivia: true); 64var removedNodes = new List<SyntaxNode> { paramNode }; 86private bool ShouldRemovePreviousSibling(List<SyntaxNode> paramNodeSiblings, int paramNodeIndex) 98var nextSibling = paramNodeSiblings[paramNodeIndex + 1];
src\Analyzers\Core\CodeFixes\FileHeaders\AbstractFileHeaderCodeFixProvider.cs (7)
49private async Task<SyntaxNode> GetTransformedSyntaxRootAsync(Document document, CancellationToken cancellationToken) 58internal static async Task<SyntaxNode> GetTransformedSyntaxRootAsync(ISyntaxFacts syntaxFacts, AbstractFileHeaderHelper fileHeaderHelper, SyntaxTrivia newLineTrivia, Document document, string? fileHeaderTemplate, CancellationToken cancellationToken) 81SyntaxNode newSyntaxRoot; 94private static SyntaxNode ReplaceHeader(ISyntaxFacts syntaxFacts, AbstractFileHeaderHelper fileHeaderHelper, SyntaxTrivia newLineTrivia, SyntaxNode root, string expectedFileHeader) 176private static SyntaxNode AddHeader(ISyntaxFacts syntaxFacts, AbstractFileHeaderHelper fileHeaderHelper, SyntaxTrivia newLineTrivia, SyntaxNode root, string expectedFileHeader)
src\Analyzers\Core\CodeFixes\ForEachCast\AbstractForEachCastCodeFixProvider.cs (7)
23where TForEachStatementSyntax : SyntaxNode 34RegisterCodeFix(context, AnalyzersResources.Add_explicit_cast, nameof(AbstractForEachCastCodeFixProvider<SyntaxNode>)); 51var node = editor.OriginalRoot.FindNode(diagnostic.Location.SourceSpan, getInnermostNodeForTie: true); 64var expression = syntaxFacts.GetExpressionOfForeachStatement(forEachStatement); 76var rewritten = GetRewrittenCollection(editor.Generator, expression, variableDeclarator.Symbol.Type, conversion); 85private SyntaxNode GetRewrittenCollection( 87SyntaxNode collection,
src\Analyzers\Core\CodeFixes\Formatting\FormattingCodeFixProvider.cs (2)
75var formattedRoot = SyntaxFormatting.GetFormattingResult(root, [spanToFormat], formattingOptions, rules: default, cancellationToken: cancellationToken).GetFormattedRoot(cancellationToken); 83var updatedRoot = SyntaxFormatting.GetFormattingResult(editor.OriginalRoot, [editor.OriginalRoot.FullSpan], formattingOptions, rules: default, cancellationToken).GetFormattedRoot(cancellationToken);
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.cs (9)
26where TExpressionSyntax : SyntaxNode 29protected abstract bool IsSimpleNameGeneration(SemanticDocument document, SyntaxNode node, CancellationToken cancellationToken); 30protected abstract bool IsConstructorInitializerGeneration(SemanticDocument document, SyntaxNode node, CancellationToken cancellationToken); 31protected abstract bool IsImplicitObjectCreation(SemanticDocument document, SyntaxNode node, CancellationToken cancellationToken); 33protected abstract bool TryInitializeImplicitObjectCreation(SemanticDocument document, SyntaxNode node, CancellationToken cancellationToken, out SyntaxToken token, out ImmutableArray<Argument> arguments, out INamedTypeSymbol typeToGenerateIn); 34protected abstract bool TryInitializeSimpleNameGenerationState(SemanticDocument document, SyntaxNode simpleName, CancellationToken cancellationToken, out SyntaxToken token, out ImmutableArray<Argument> arguments, out INamedTypeSymbol typeToGenerateIn); 35protected abstract bool TryInitializeConstructorInitializerGeneration(SemanticDocument document, SyntaxNode constructorInitializer, CancellationToken cancellationToken, out SyntaxToken token, out ImmutableArray<Argument> arguments, out INamedTypeSymbol typeToGenerateIn); 36protected abstract bool TryInitializeSimpleAttributeNameGenerationState(SemanticDocument document, SyntaxNode simpleName, CancellationToken cancellationToken, out SyntaxToken token, out ImmutableArray<Argument> arguments, out INamedTypeSymbol typeToGenerateIn); 78public async Task<ImmutableArray<CodeAction>> GenerateConstructorAsync(Document document, SyntaxNode node, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.State.cs (6)
78SyntaxNode node, 95SyntaxNode node, CancellationToken cancellationToken) 298SyntaxNode constructorInitializer, CancellationToken cancellationToken) 316private async Task<bool> TryInitializeImplicitObjectCreationAsync(SyntaxNode implicitObjectCreation, CancellationToken cancellationToken) 334SyntaxNode simpleName, 615private async Task<(ImmutableArray<ISymbol>, ImmutableArray<SyntaxNode>)> GenerateMembersAndAssignmentsAsync(
src\Analyzers\Core\CodeFixes\GenerateConstructor\GenerateConstructorHelpers.cs (2)
22where TExpressionSyntax : SyntaxNode 76where TExpressionSyntax : SyntaxNode
src\Analyzers\Core\CodeFixes\GenerateConstructor\IGenerateConstructorService.cs (1)
16Task<ImmutableArray<CodeAction>> GenerateConstructorAsync(Document document, SyntaxNode node, CancellationToken cancellationToken);
src\Analyzers\Core\CodeFixes\GenerateDefaultConstructors\AbstractGenerateDefaultConstructorCodeFixProvider.cs (1)
18protected abstract SyntaxToken? TryGetTypeName(SyntaxNode typeDeclaration);
src\Analyzers\Core\CodeFixes\GenerateEnumMember\AbstractGenerateEnumMemberService.cs (3)
20where TExpressionSyntax : SyntaxNode 26protected abstract bool IsIdentifierNameGeneration(SyntaxNode node); 29public async Task<ImmutableArray<CodeAction>> GenerateEnumMemberAsync(Document document, SyntaxNode node, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\GenerateEnumMember\AbstractGenerateEnumMemberService.State.cs (2)
30SyntaxNode node, 43SyntaxNode node,
src\Analyzers\Core\CodeFixes\GenerateEnumMember\IGenerateEnumMemberService.cs (1)
15Task<ImmutableArray<CodeAction>> GenerateEnumMemberAsync(Document document, SyntaxNode node, CancellationToken cancellationToken);
src\Analyzers\Core\CodeFixes\GenerateMember\AbstractGenerateMemberCodeFixProvider.cs (9)
27protected abstract Task<ImmutableArray<CodeAction>> GetCodeActionsAsync(Document document, SyntaxNode node, CancellationToken cancellationToken); 28protected abstract bool IsCandidate(SyntaxNode node, SyntaxToken token, Diagnostic diagnostic); 45foreach (var name in names) 58protected virtual SyntaxNode? GetTargetNode(SyntaxNode node) 61private IEnumerable<SyntaxNode> GetTargetNodes( 62ISyntaxFactsService syntaxFacts, SyntaxNode root, 69foreach (var ancestor in token.GetAncestors<SyntaxNode>()) 88var name = GetTargetNode(ancestor);
src\Analyzers\Core\CodeFixes\GenerateMember\AbstractGenerateMemberService.cs (2)
17where TExpressionSyntax : SyntaxNode 180SyntaxNode expression,
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateConversionService.cs (6)
21where TExpressionSyntax : SyntaxNode 24protected abstract bool IsImplicitConversionGeneration(SyntaxNode node); 25protected abstract bool IsExplicitConversionGeneration(SyntaxNode node); 26protected abstract bool TryInitializeImplicitConversionState(SemanticDocument document, SyntaxNode expression, ISet<TypeKind> classInterfaceModuleStructTypes, CancellationToken cancellationToken, out SyntaxToken identifierToken, out IMethodSymbol methodSymbol, out INamedTypeSymbol typeToGenerateIn); 27protected abstract bool TryInitializeExplicitConversionState(SemanticDocument document, SyntaxNode expression, ISet<TypeKind> classInterfaceModuleStructTypes, CancellationToken cancellationToken, out SyntaxToken identifierToken, out IMethodSymbol methodSymbol, out INamedTypeSymbol typeToGenerateIn); 31SyntaxNode node,
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateConversionService.State.cs (4)
21SyntaxNode interfaceNode, 36SyntaxNode node, 57private bool TryInitializeExplicitConversion(TService service, SemanticDocument document, SyntaxNode node, CancellationToken cancellationToken) 81private bool TryInitializeImplicitConversion(TService service, SemanticDocument document, SyntaxNode node, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateDeconstructMethodService.cs (3)
19where TExpressionSyntax : SyntaxNode 22public abstract ImmutableArray<IParameterSymbol> TryMakeParameters(SemanticModel semanticModel, SyntaxNode target, CancellationToken cancellationToken); 26SyntaxNode leftSide,
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateDeconstructMethodService.State.cs (2)
28SyntaxNode targetVariables, 44SyntaxNode targetVariables,
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateMethodService.cs (5)
21where TExpressionSyntax : SyntaxNode 24protected abstract bool IsSimpleNameGeneration(SyntaxNode node); 25protected abstract bool IsExplicitInterfaceGeneration(SyntaxNode node); 26protected abstract bool TryInitializeExplicitInterfaceState(SemanticDocument document, SyntaxNode node, CancellationToken cancellationToken, out SyntaxToken identifierToken, out IMethodSymbol methodSymbol, out INamedTypeSymbol typeToGenerateIn); 32SyntaxNode node,
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateMethodService.State.cs (3)
29SyntaxNode interfaceNode, 44SyntaxNode node, 83SyntaxNode methodDeclaration,
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.cs (1)
21where TExpressionSyntax : SyntaxNode
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.SignatureInfo.cs (2)
196private ImmutableArray<SyntaxNode> GenerateStatements( 200var throwStatement = CodeGenerationHelpers.GenerateThrowStatement(factory, Document, "System.NotImplementedException");
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\IGenerateConversionService.cs (1)
15Task<ImmutableArray<CodeAction>> GenerateConversionAsync(Document document, SyntaxNode node, CancellationToken cancellationToken);
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\IGenerateDeconstructMemberService.cs (1)
17Document document, SyntaxNode targetVariables, INamedTypeSymbol typeToGenerateIn, CancellationToken cancellationToken);
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\IGenerateParameterizedMemberService.cs (1)
16Task<ImmutableArray<CodeAction>> GenerateMethodAsync(Document document, SyntaxNode node, CancellationToken cancellationToken);
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.CodeAction.cs (2)
114private ImmutableArray<SyntaxNode> GenerateStatements() 118var throwStatement = CodeGenerationHelpers.GenerateThrowStatement(
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.cs (6)
25where TExpressionSyntax : SyntaxNode 31protected abstract bool IsExplicitInterfaceGeneration(SyntaxNode node); 32protected abstract bool IsIdentifierNameGeneration(SyntaxNode node); 34protected abstract bool TryInitializeExplicitInterfaceState(SemanticDocument document, SyntaxNode node, CancellationToken cancellationToken, out SyntaxToken identifierToken, out IPropertySymbol propertySymbol, out INamedTypeSymbol typeToGenerateIn); 37protected abstract bool TryConvertToLocalDeclaration(ITypeSymbol type, SyntaxToken identifierToken, SemanticModel semanticModel, CancellationToken cancellationToken, out SyntaxNode newRoot); 41SyntaxNode node,
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.GenerateLocalCodeAction.cs (4)
41var newRoot = await GetNewRootAsync(cancellationToken).ConfigureAwait(false); 47private async Task<SyntaxNode> GetNewRootAsync(CancellationToken cancellationToken) 51if (_service.TryConvertToLocalDeclaration(_state.LocalType, _state.IdentifierToken, semanticModel, cancellationToken, out var newRoot)) 65var root = _state.IdentifierToken.GetAncestors<SyntaxNode>().Last();
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.State.cs (6)
76SyntaxNode interfaceNode, 112SyntaxNode node, 192SyntaxNode propertyDeclaration, 378var siblingNode = sibling.AsNode(); 416private static int GetStatementIndex(ChildSyntaxList children, SyntaxNode statement) 496private bool DetermineIsInConstructor(SyntaxNode simpleName)
src\Analyzers\Core\CodeFixes\GenerateVariable\IGenerateVariableService.cs (1)
17Task<ImmutableArray<CodeAction>> GenerateVariableAsync(Document document, SyntaxNode node, CancellationToken cancellationToken);
src\Analyzers\Core\CodeFixes\ImplementAbstractClass\AbstractImplementAbstractClassCodeFixProvider.cs (1)
15where TClassNode : SyntaxNode
src\Analyzers\Core\CodeFixes\ImplementAbstractClass\ImplementAbstractClassData.cs (7)
33Document document, ImplementTypeOptions options, SyntaxNode classNode, SyntaxToken classIdentifier, 39private readonly SyntaxNode _classNode = classNode; 47Document document, SyntaxNode classNode, SyntaxToken classIdentifier, CancellationToken cancellationToken) 79Document document, SyntaxNode classNode, SyntaxToken classIdentifier, CancellationToken cancellationToken) 250Func<SyntaxNode, SyntaxNode, SyntaxNode> createAddOrRemoveHandler)
src\Analyzers\Core\CodeFixes\ImplementInterface\AbstractImplementInterfaceCodeFixProvider.cs (1)
22where TTypeSyntax : SyntaxNode
src\Analyzers\Core\CodeFixes\ImplementInterface\AbstractImplementInterfaceService.cs (10)
30protected abstract bool TryInitializeState(Document document, SemanticModel model, SyntaxNode interfaceNode, CancellationToken cancellationToken, out SyntaxNode classOrStructDecl, out INamedTypeSymbol classOrStructType, out ImmutableArray<INamedTypeSymbol> interfaceTypes); 33protected abstract SyntaxNode AddCommentInsideIfStatement(SyntaxNode ifDisposingStatement, SyntaxTriviaList trivia); 34protected abstract SyntaxNode CreateFinalizer(SyntaxGenerator generator, INamedTypeSymbol classType, string disposeMethodDisplayString); 37Document document, ImplementTypeOptions options, SyntaxNode node, CancellationToken cancellationToken) 57public async Task<IImplementInterfaceInfo?> AnalyzeAsync(Document document, SyntaxNode interfaceType, CancellationToken cancellationToken) 63protected TNode AddComment<TNode>(string comment, TNode node) where TNode : SyntaxNode 66protected TNode AddComments<TNode>(string comment1, string comment2, TNode node) where TNode : SyntaxNode 69protected TNode AddComments<TNode>(string[] comments, TNode node) where TNode : SyntaxNode
src\Analyzers\Core\CodeFixes\ImplementInterface\AbstractImplementInterfaceService.State.cs (5)
16SyntaxNode interfaceNode, 17SyntaxNode classOrStructDecl, 22public SyntaxNode InterfaceNode { get; } = interfaceNode; 23public SyntaxNode ClassOrStructDecl { get; } = classOrStructDecl; 41SyntaxNode interfaceNode,
src\Analyzers\Core\CodeFixes\ImplementInterface\IImplementInterfaceInfo.cs (2)
20SyntaxNode ClassOrStructDecl { get; } 22SyntaxNode InterfaceNode { get; }
src\Analyzers\Core\CodeFixes\ImplementInterface\IImplementInterfaceService.cs (2)
24Task<Document> ImplementInterfaceAsync(Document document, ImplementTypeOptions options, SyntaxNode node, CancellationToken cancellationToken); 26Task<IImplementInterfaceInfo?> AnalyzeAsync(Document document, SyntaxNode interfaceType, CancellationToken cancellationToken);
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementHelpers.cs (3)
72var declarator = syntaxRef.GetSyntax(cancellationToken); 88var declarator = syntaxRef.GetSyntax(cancellationToken); 100bool InitializerReferencesParameter(SyntaxNode? initializer, IParameterSymbol parameter)
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator.cs (3)
329Func<SyntaxNode, SyntaxNode, SyntaxNode> createAddOrRemoveHandler)
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator_DisposePattern.cs (3)
95Document document, SyntaxNode finalizer, CancellationToken cancellationToken) 117private (ImmutableArray<ISymbol>, SyntaxNode) CreateDisposableMethods( 191using var _ = ArrayBuilder<SyntaxNode>.GetInstance(out var statements);
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator_Method.cs (1)
50private SyntaxNode CreateStatement(Compilation compilation, IMethodSymbol method)
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator_Property.cs (2)
150private ImmutableArray<SyntaxNode> GetSetAccessorStatements( 164private ImmutableArray<SyntaxNode> GetGetAccessorStatements(
src\Analyzers\Core\CodeFixes\Iterator\AbstractIteratorCodeFixProvider.cs (7)
24protected abstract Task<CodeAction> GetCodeFixAsync(SyntaxNode root, SyntaxNode node, Document document, Diagnostic diagnostics, CancellationToken cancellationToken); 28var root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 29if (!TryGetNode(root, context.Span, out var node)) 44protected virtual bool TryGetNode(SyntaxNode root, TextSpan span, out SyntaxNode node) 47var ancestors = root.FindToken(span.Start).GetAncestors<SyntaxNode>();
src\Analyzers\Core\CodeFixes\MakeFieldReadonly\AbstractMakeFieldReadonlyCodeFixProvider.cs (4)
23where TSymbolSyntax : SyntaxNode 24where TFieldDeclarationSyntax : SyntaxNode 29protected abstract SyntaxNode? GetInitializerNode(TSymbolSyntax declaration); 84var newDeclaration = generator
src\Analyzers\Core\CodeFixes\MakeMemberStatic\AbstractMakeMemberStaticCodeFixProvider.cs (4)
19protected abstract bool TryGetMemberDeclaration(SyntaxNode node, [NotNullWhen(true)] out SyntaxNode? memberDeclaration); 39if (TryGetMemberDeclaration(declaration, out var memberDeclaration)) 42var newNode = generator.WithModifiers(memberDeclaration, generator.GetModifiers(declaration).WithIsStatic(true));
src\Analyzers\Core\CodeFixes\MakeMethodAsynchronous\AbstractMakeMethodAsynchronousCodeFixProvider.cs (11)
21protected abstract bool IsAsyncSupportingFunctionSyntax(SyntaxNode node); 28protected abstract SyntaxNode AddAsyncTokenAndFixReturnType( 29bool keepVoid, IMethodSymbol methodSymbol, SyntaxNode node, KnownTaskTypes knownTypes, CancellationToken cancellationToken); 42var node = GetContainingFunction(diagnostic, cancellationToken); 87private static IMethodSymbol? GetMethodSymbol(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken) 109var node = GetContainingFunction(diagnostic, cancellationToken); 147private SyntaxNode? GetContainingFunction(Diagnostic diagnostic, CancellationToken cancellationToken) 157SyntaxNode node, 174if (syntaxPath.TryResolve(newRoot, out SyntaxNode? newNode)) 189SyntaxNode node, 192var newNode = AddAsyncTokenAndFixReturnType(keepVoid, methodSymbol, node, knownTypes, cancellationToken);
src\Analyzers\Core\CodeFixes\MakeMethodSynchronous\AbstractMakeMethodSynchronousCodeFixProvider.cs (11)
24protected abstract bool IsAsyncSupportingFunctionSyntax(SyntaxNode node); 25protected abstract SyntaxNode RemoveAsyncTokenAndFixReturnType(IMethodSymbol methodSymbol, SyntaxNode node, KnownTaskTypes knownTypes); 52Document document, SyntaxNode node, CancellationToken cancellationToken) 73private async Task<Solution> RenameThenRemoveAsyncTokenAsync(Document document, SyntaxNode node, IMethodSymbol methodSymbol, CancellationToken cancellationToken) 86if (syntaxPath.TryResolve(newRoot, out SyntaxNode? newNode)) 97Document document, IMethodSymbol methodSymbol, SyntaxNode node, CancellationToken cancellationToken) 103var newNode = RemoveAsyncTokenAndFixReturnType(methodSymbol, node, knownTypes) 182var newRoot = editor.GetChangedRoot(); 249var currentConfigureAwaitInvocation = syntaxFacts.GetExpressionOfAwaitExpression(currentAwaitExpression); 251var currentInvocationExpression = syntaxFacts.GetExpressionOfMemberAccessExpression(currentMemberAccess);
src\Analyzers\Core\CodeFixes\MakeTypeAbstract\AbstractMakeTypeAbstractCodeFixProvider.cs (2)
18where TTypeDeclarationSyntax : SyntaxNode 20protected abstract bool IsValidRefactoringContext(SyntaxNode? node, [NotNullWhen(true)] out TTypeDeclarationSyntax? typeDeclaration);
src\Analyzers\Core\CodeFixes\MakeTypePartial\AbstractMakeTypePartialCodeFixProvider.cs (3)
31var syntaxRoot = editor.OriginalRoot; 37var declaration = syntaxRoot.FindNode(diagnostic.Location.SourceSpan); 48var node = await reference.GetSyntaxAsync(cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\OrderModifiers\AbstractOrderModifiersCodeFixProvider.cs (1)
73var updatedMemberDeclaration = _syntaxFacts.WithModifiers(currentNode, orderedModifiers);
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchCodeFixProvider.cs (4)
30where TSwitchSyntax : SyntaxNode 31where TSwitchArmSyntax : SyntaxNode 32where TMemberAccessExpression : SyntaxNode 205ref SyntaxNode root,
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchExpressionCodeFixProvider.cs (2)
19where TExpressionSyntax : SyntaxNode 21where TSwitchArmSyntax : SyntaxNode
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchStatementCodeFixProvider.cs (5)
21where TSwitchSyntax : SyntaxNode 22where TSwitchArmSyntax : SyntaxNode 23where TMemberAccessExpression : SyntaxNode 47var root = editor.OriginalRoot; 50var newRoot = root.ReplaceNode(switchNode, newSwitchNode);
src\Analyzers\Core\CodeFixes\QualifyMemberAccess\AbstractQualifyMemberAccessCodeFixProvider.cs (2)
19where TSimpleNameSyntax : SyntaxNode 20where TInvocationSyntax : SyntaxNode
src\Analyzers\Core\CodeFixes\RemoveAsyncModifier\AbstractRemoveAsyncModifierCodeFixProvider.cs (36)
22where TReturnStatementSyntax : SyntaxNode 23where TExpressionSyntax : SyntaxNode 25protected abstract bool IsAsyncSupportingFunctionSyntax(SyntaxNode node); 26protected abstract SyntaxNode RemoveAsyncModifier(SyntaxGenerator generator, SyntaxNode methodLikeNode); 27protected abstract SyntaxNode? ConvertToBlockBody(SyntaxNode node, TExpressionSyntax expressionBody); 104private static IMethodSymbol? GetMethodSymbol(SyntaxNode node, SemanticModel semanticModel, CancellationToken cancellationToken) 117private SyntaxNode RemoveAsyncModifier( 121SyntaxNode node, 128var expression = generator.GetExpression(node); 134var blockBodiedNode = ConvertToBlockBody(node, expressionBody); 146var newExpressionBody = WrapExpressionWithTaskFromResult(generator, expressionBody, returnType, knownTypes); 166private static ControlFlowAnalysis? GetControlFlowAnalysis(SyntaxGenerator generator, SemanticModel semanticModel, SyntaxNode node) 177private static SyntaxNode AddReturnStatement(SyntaxGenerator generator, SyntaxNode node) 180private SyntaxNode ChangeReturnStatements( 184SyntaxNode node, 196var returnExpression = syntaxFacts.GetExpressionOfReturnStatement(returnSyntax); 200var returnTaskCompletedTask = GetReturnTaskCompletedTaskStatement(generator, returnType, knownTypes); 206var newExpression = WrapExpressionWithTaskFromResult(generator, returnExpression, returnType, knownTypes); 214private static SyntaxNode GetReturnTaskCompletedTaskStatement(SyntaxGenerator generator, ITypeSymbol returnType, KnownTaskTypes knownTypes) 216SyntaxNode invocation; 219var taskTypeExpression = TypeExpressionForStaticMemberAccess(generator, knownTypes.TaskType); 227var statement = generator.ReturnStatement(invocation); 231private static SyntaxNode WrapExpressionWithTaskFromResult(SyntaxGenerator generator, SyntaxNode expression, ITypeSymbol returnType, KnownTaskTypes knownTypes) 235var taskTypeExpression = TypeExpressionForStaticMemberAccess(generator, knownTypes.TaskType!); 237var memberName = generator.GenericName(nameof(Task.FromResult), unwrappedReturnType); 238var taskFromResult = generator.MemberAccessExpression(taskTypeExpression, memberName); 249private static SyntaxNode TypeExpressionForStaticMemberAccess(SyntaxGenerator generator, INamedTypeSymbol typeSymbol) 254var typeExpression = generator.TypeExpression(typeSymbol); 258static SyntaxNode QualifiedNameToMemberAccess(int qualifiedNameSyntaxKind, int memberAccessExpressionSyntaxKind, SyntaxNode expression, SyntaxGenerator generator) 262var left = QualifiedNameToMemberAccess(qualifiedNameSyntaxKind, memberAccessExpressionSyntaxKind, expression.ChildNodes().First(), generator); 263var right = expression.ChildNodes().Last();
src\Analyzers\Core\CodeFixes\RemoveRedundantEquality\RemoveRedundantEqualityCodeFixProvider.cs (5)
24internal sealed class RemoveRedundantEqualityCodeFixProvider() : ForkingSyntaxEditorBasedCodeFixProvider<SyntaxNode> 34SyntaxNode node, 49SyntaxNode RewriteNode() 77static SyntaxNode WithElasticTrailingTrivia(SyntaxNode node)
src\Analyzers\Core\CodeFixes\RemoveUnnecessaryParentheses\AbstractRemoveUnnecessaryParenthesesCodeFixProvider.cs (1)
20where TParenthesizedExpressionSyntax : SyntaxNode
src\Analyzers\Core\CodeFixes\RemoveUnnecessarySuppressions\RemoveUnnecessaryAttributeSuppressionsCodeFixProvider.cs (1)
44var node = editor.OriginalRoot.FindNode(diagnostic.Location.SourceSpan);
src\Analyzers\Core\CodeFixes\RemoveUnnecessarySuppressions\RemoveUnnecessaryPragmaSuppressionsCodeFixProvider.cs (3)
54using var _ = PooledHashSet<SyntaxNode>.GetInstance(out var processedNodes); 71HashSet<SyntaxNode> processedNodes, 74SyntaxNode node;
src\Analyzers\Core\CodeFixes\RemoveUnusedMembers\AbstractRemoveUnusedMembersCodeFixProvider.cs (8)
23where TFieldDeclarationSyntax : SyntaxNode 34protected abstract void AdjustAndAddAppropriateDeclaratorsToRemove(HashSet<TFieldDeclarationSyntax> fieldDeclarators, HashSet<SyntaxNode> declarators); 48var declarators = new HashSet<SyntaxNode>(); 86foreach (var declarator in declarators) 97protected static void AdjustAndAddAppropriateDeclaratorsToRemove(SyntaxNode parentDeclaration, IEnumerable<SyntaxNode> childDeclarators, HashSet<SyntaxNode> declarators) 106foreach (var childDeclarator in childDeclarators)
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (63)
48where TExpressionSyntax : SyntaxNode 49where TStatementSyntax : SyntaxNode 54where TVariableDeclaratorSyntax : SyntaxNode 55where TSwitchCaseBlockSyntax : SyntaxNode 56where TSwitchCaseLabelOrClauseSyntax : SyntaxNode 76protected abstract SyntaxNode? TryUpdateNameForFlaggedNode(SyntaxNode node, SyntaxToken newName); 100protected abstract SyntaxNode GetReplacementNodeForCompoundAssignment( 101SyntaxNode originalCompoundAssignment, 102SyntaxNode newAssignmentTarget, 110protected abstract SyntaxNode GetReplacementNodeForVarPattern(SyntaxNode originalVarPattern, SyntaxNode newNameNode); 122protected virtual SyntaxNode? TryUpdateParentOfUpdatedNode(SyntaxNode parent, SyntaxNode newNameNode, SyntaxEditor editor, ISyntaxFacts syntaxFacts, SemanticModel semanticModel) => null; 131protected abstract SyntaxNode ComputeReplacementNode(SyntaxNode originalOldNode, SyntaxNode changedOldNode, SyntaxNode proposedReplacementNode); 240private static IEnumerable<IGrouping<SyntaxNode, Diagnostic>> GetDiagnosticsGroupedByMember( 243SyntaxNode root, 265private static IEnumerable<IGrouping<SyntaxNode, Diagnostic>> GetDiagnosticsGroupedByMember( 268SyntaxNode root) 293private async Task<SyntaxNode> GetNewRootAsync( 325var containingMemberDeclaration = diagnosticsToFix.Key; 335var currentRoot = editor.GetChangedRoot(); 336var newRoot = await PostProcessDocumentAsync(document, options, currentRoot, 350SyntaxNode root, 351SyntaxNode containingMemberDeclaration, 387SyntaxNode root, 430var localDecl = editor.Generator.LocalDeclarationStatement( 446SyntaxNode root, 447SyntaxNode containingMemberDeclaration, 470using var _1 = PooledDictionary<SyntaxNode, SyntaxNode>.GetInstance(out var nodeReplacementMap); 471using var _2 = PooledHashSet<SyntaxNode>.GetInstance(out var nodesToRemove); 472using var _3 = PooledHashSet<(TLocalDeclarationStatementSyntax declarationStatement, SyntaxNode node)>.GetInstance(out var nodesToAdd); 474using var _4 = PooledHashSet<SyntaxNode>.GetInstance(out var processedNodes); 550var newNameNode = TryUpdateNameForFlaggedNode(node, newNameToken); 570var newParentNode = TryUpdateParentOfUpdatedNode(node.GetRequiredParent(), newNameNode, editor, syntaxFacts, semanticModel); 674IEnumerable<(SyntaxNode node, bool isUnusedLocalAssignment)> GetNodesToFix() 678var node = root.FindNode(diagnostic.Location.SourceSpan, getInnermostNodeForTie: true); 692void InsertLocalDeclarationStatement(TLocalDeclarationStatementSyntax declarationStatement, SyntaxNode node) 695var insertionNode = node.FirstAncestorOrSelf<SyntaxNode>( 726bool ShouldRemoveStatement(TLocalDeclarationStatementSyntax localDeclarationStatement, out SeparatedSyntaxList<SyntaxNode> variables) 732foreach (var variable in variables) 746private async Task<SyntaxNode> PostProcessDocumentAsync( 749SyntaxNode currentRoot, 775private static async Task<SyntaxNode> PostProcessDocumentCoreAsync( 776Func<SyntaxNode, Document, SyntaxFormattingOptions, CancellationToken, Task<SyntaxNode>> processMemberDeclarationAsync, 777SyntaxNode currentRoot, 787using var _1 = PooledDictionary<SyntaxNode, SyntaxNode>.GetInstance(out var memberDeclReplacementsMap); 807private async Task<SyntaxNode> ReplaceDiscardDeclarationsWithAssignmentsAsync(SyntaxNode memberDeclaration, Document document, SyntaxFormattingOptions options, CancellationToken cancellationToken) 823private async Task<SyntaxNode> AdjustLocalDeclarationsAsync( 824SyntaxNode memberDeclaration, 927SyntaxNode memberDeclaration, 932private readonly SyntaxNode _memberDeclaration = memberDeclaration; 938public SyntaxToken GenerateUniqueNameAtSpanStart(SyntaxNode node)
src\Analyzers\Core\CodeFixes\SimplifyBooleanExpression\SimplifyConditionalCodeFixProvider.cs (2)
61SyntaxNode SimplifyConditional(SemanticModel semanticModel, Diagnostic diagnostic, SyntaxNode expr)
src\Analyzers\Core\CodeFixes\SimplifyInterpolation\AbstractSimplifyInterpolationCodeFixProvider.cs (4)
27where TInterpolationSyntax : SyntaxNode 28where TExpressionSyntax : SyntaxNode 29where TInterpolationAlignmentClause : SyntaxNode 30where TInterpolationFormatClause : SyntaxNode
src\Analyzers\Core\CodeFixes\SimplifyLinqExpression\SimplifyLinqExpressionCodeFixProvider.cs (2)
40var root = editor.OriginalRoot; 44var invocation = root.FindNode(diagnostic.Location.SourceSpan, getInnermostNodeForTie: true);
src\Analyzers\Core\CodeFixes\UnsealClass\AbstractUnsealClassCodeFixProvider.cs (1)
76var newDeclaration = generator.WithModifiers(declaration, modifiers.WithIsSealed(false));
src\Analyzers\Core\CodeFixes\UpdateLegacySuppressions\UpdateLegacySuppressionsCodeFixProvider.cs (1)
45var node = editor.OriginalRoot.FindNode(diagnostic.Location.SourceSpan, getInnermostNodeForTie: true);
src\Analyzers\Core\CodeFixes\UseCoalesceExpression\AbstractUseCoalesceExpressionForIfNullStatementCheckCodeFixProvider.cs (8)
30SemanticModel semanticModel, SyntaxNode expressionToCoalesce, 31SyntaxNode leftAssignmentPart, SyntaxNode rightAssignmentPart, 58SyntaxNode TryAddExplicitCast(SyntaxNode expressionToCoalesce, SyntaxNode whenTrueStatement) 81SyntaxNode GetWhenNullExpression(SyntaxNode whenTrueStatement)
src\Analyzers\Core\CodeFixes\UseCoalesceExpression\UseCoalesceExpressionForNullableTernaryConditionalCheckCodeFixProvider.cs (4)
47var root = editor.OriginalRoot; 51var conditionalExpression = root.FindNode(diagnostic.AdditionalLocations[0].SourceSpan, getInnermostNodeForTie: true); 52var conditionExpression = root.FindNode(diagnostic.AdditionalLocations[1].SourceSpan); 53var whenPart = root.FindNode(diagnostic.AdditionalLocations[2].SourceSpan);
src\Analyzers\Core\CodeFixes\UseCoalesceExpression\UseCoalesceExpressionForTernaryConditionalCheckCodeFixProvider.cs (16)
62var root = editor.OriginalRoot; 63var conditionalExpression = root.FindNode(diagnostic.AdditionalLocations[0].SourceSpan, getInnermostNodeForTie: true); 64var conditionalPartHigh = root.FindNode(diagnostic.AdditionalLocations[1].SourceSpan); 65var whenPart = root.FindNode(diagnostic.AdditionalLocations[2].SourceSpan); 67conditionalExpression, out var condition, out var whenTrue, out var whenFalse); 74c, out var currentCondition, out var currentWhenTrue, out var currentWhenFalse); 92private static SyntaxNode GetCoalesceExpression( 94SyntaxNode whenPart, SyntaxNode whenTrue, 95SyntaxNode conditionalPartLow, 96SyntaxNode currentWhenTrue, SyntaxNode currentWhenFalse)
src\Analyzers\Core\CodeFixes\UseCollectionExpression\AbstractUseCollectionExpressionCodeFixProvider.cs (1)
14where TExpressionSyntax : SyntaxNode
src\Analyzers\Core\CodeFixes\UseCollectionInitializer\AbstractUseCollectionInitializerCodeFixProvider.cs (7)
31where TExpressionSyntax : SyntaxNode 32where TStatementSyntax : SyntaxNode 38where TVariableDeclaratorSyntax : SyntaxNode 55protected abstract Task<(SyntaxNode oldNode, SyntaxNode newNode)> GetReplacementNodesAsync( 57ImmutableArray<CollectionMatch<SyntaxNode>> preMatches, 58ImmutableArray<CollectionMatch<SyntaxNode>> postMatches, CancellationToken cancellationToken);
src\Analyzers\Core\CodeFixes\UseCompoundAssignment\AbstractUseCompoundAssignmentCodeFixProvider.cs (2)
22where TAssignmentSyntax : SyntaxNode 23where TExpressionSyntax : SyntaxNode
src\Analyzers\Core\CodeFixes\UseConditionalExpression\AbstractUseConditionalExpressionCodeFixProvider.cs (10)
27where TStatementSyntax : SyntaxNode 29where TExpressionSyntax : SyntaxNode 63var changedRoot = nestedEditor.GetChangedRoot(); 72var formattedRoot = SyntaxFormatting.GetFormattingResult(changedRoot, spansToFormat, formattingOptions, rules, cancellationToken).GetFormattedRoot(cancellationToken); 94var condition = WrapIfStatementIfNecessary(ifOperation); 125protected virtual SyntaxNode WrapIfStatementIfNecessary(IConditionalOperation operation) 138Document document, SyntaxNode condition, SyntaxNode trueSyntax, SyntaxNode falseSyntax, SyntaxFormattingOptions formattingOptions, 164var sourceSyntax = value.Syntax;
src\Analyzers\Core\CodeFixes\UseConditionalExpression\ForAssignment\AbstractUseConditionalExpressionForAssignmentCodeFixProvider.cs (5)
30where TStatementSyntax : SyntaxNode 33where TVariableDeclaratorSyntax : SyntaxNode 34where TExpressionSyntax : SyntaxNode 133var localDeclaration = localDeclarationOperation.Syntax; 142var updatedLocalDeclaration = localDeclaration.ReplaceNode(variable, updatedVariable);
src\Analyzers\Core\CodeFixes\UseConditionalExpression\ForReturn\AbstractUseConditionalExpressionForReturnCodeFixProvider.cs (2)
29where TStatementSyntax : SyntaxNode 31where TExpressionSyntax : SyntaxNode
src\Analyzers\Core\CodeFixes\UseConditionalExpression\UseConditionalExpressionHelpers.cs (1)
16ISyntaxFactsService syntaxFacts, SyntaxNode syntax)
src\Analyzers\Core\CodeFixes\UseExplicitTupleName\UseExplicitTupleNameCodeFixProvider.cs (1)
48var newNameNode = generator.IdentifierName(preferredName).WithTriviaFrom(oldNameNode);
src\Analyzers\Core\CodeFixes\UseInferredMemberName\AbstractUseInferredMemberNameCodeFixProvider.cs (3)
20protected abstract void LanguageSpecificRemoveSuggestedNode(SyntaxEditor editor, SyntaxNode node); 35var root = editor.OriginalRoot; 39var node = root.FindNode(diagnostic.Location.SourceSpan);
src\Analyzers\Core\CodeFixes\UseIsNullCheck\AbstractUseIsNullForReferenceEqualsCodeFixProvider.cs (3)
22where TExpressionSyntax : SyntaxNode 29protected abstract SyntaxNode CreateNullCheck(TExpressionSyntax argument, bool isUnconstrainedGeneric); 30protected abstract SyntaxNode CreateNotNullCheck(TExpressionSyntax argument);
src\Analyzers\Core\CodeFixes\UseNullPropagation\AbstractUseNullPropagationCodeFixProvider.cs (21)
38where TExpressionSyntax : SyntaxNode 39where TStatementSyntax : SyntaxNode 49where TElementBindingArgumentListSyntax : SyntaxNode 51protected abstract bool TryGetBlock(SyntaxNode? node, [NotNullWhen(true)] out TStatementSyntax? block); 53protected abstract SyntaxNode PostProcessElseIf(TIfStatementSyntax ifStatement, TStatementSyntax newWhenTrueStatement); 73var root = editor.OriginalRoot; 77var conditionalExpressionOrIfStatement = root.FindNode(diagnostic.AdditionalLocations[0].SourceSpan, getInnermostNodeForTie: true); 94SyntaxNode conditionalExpression, 97var root = editor.OriginalRoot; 102var conditionalPart = root.FindNode(diagnostic.AdditionalLocations[1].SourceSpan, getInnermostNodeForTie: true); 103var whenPart = root.FindNode(diagnostic.AdditionalLocations[2].SourceSpan, getInnermostNodeForTie: true); 145var root = editor.OriginalRoot; 155SyntaxNode nodeToBeReplaced = ifStatement; 156SyntaxNode? replacementNode = null; 216TContainer container, SyntaxNode match) where TContainer : SyntaxNode 222var memberAccess = match.Parent; 245TContainer whenPart, SyntaxNode match, SyntaxNode matchParent) where TContainer : SyntaxNode 249var memberAccess = matchParent;
src\Analyzers\Core\CodeFixes\UseObjectInitializer\AbstractUseObjectInitializerCodeFixProvider.cs (3)
30where TExpressionSyntax : SyntaxNode 31where TStatementSyntax : SyntaxNode 36where TVariableDeclaratorSyntax : SyntaxNode
src\Analyzers\Core\CodeFixes\UseSystemHashCode\UseSystemHashCodeCodeFixProvider.cs (1)
78var updatedDecl = generator.WithStatements(
src\Compilers\Core\AnalyzerDriver\DeclarationComputer.cs (12)
15internal static DeclarationInfo GetDeclarationInfo(SemanticModel model, SyntaxNode node, bool getSymbol, IEnumerable<SyntaxNode>? executableCodeBlocks, CancellationToken cancellationToken) 21internal static DeclarationInfo GetDeclarationInfo(SyntaxNode node, ISymbol? declaredSymbol, IEnumerable<SyntaxNode>? executableCodeBlocks) 23var codeBlocks = executableCodeBlocks?.Where(c => c != null).AsImmutableOrEmpty() ?? ImmutableArray<SyntaxNode>.Empty; 27internal static DeclarationInfo GetDeclarationInfo(SemanticModel model, SyntaxNode node, bool getSymbol, CancellationToken cancellationToken) 29return GetDeclarationInfo(model, node, getSymbol, (IEnumerable<SyntaxNode>?)null, cancellationToken); 32internal static DeclarationInfo GetDeclarationInfo(SemanticModel model, SyntaxNode node, bool getSymbol, SyntaxNode executableCodeBlock, CancellationToken cancellationToken) 37internal static DeclarationInfo GetDeclarationInfo(SemanticModel model, SyntaxNode node, bool getSymbol, CancellationToken cancellationToken, params SyntaxNode[] executableCodeBlocks) 42private static ISymbol? GetDeclaredSymbol(SemanticModel model, SyntaxNode node, bool getSymbol, CancellationToken cancellationToken)
src\Compilers\Core\AnalyzerDriver\DeclarationInfo.cs (4)
15internal DeclarationInfo(SyntaxNode declaredNode, ImmutableArray<SyntaxNode> executableCodeBlocks, ISymbol? declaredSymbol) 32public SyntaxNode DeclaredNode { get; } 37public ImmutableArray<SyntaxNode> ExecutableCodeBlocks { get; }
Structure\Syntax\AbstractSyntaxNodeStructureProvider.cs (2)
12where TSyntaxNode : SyntaxNode 25SyntaxNode node,
Structure\Syntax\AbstractSyntaxStructureProvider.cs (1)
14SyntaxNode node,
Structure\Syntax\AbstractSyntaxTriviaStructureProvider.cs (1)
15SyntaxNode node,
Structure\Syntax\BlockSpanCollector.cs (3)
33SyntaxNode syntaxRoot, 44private void Collect(SyntaxNode root, ArrayBuilder<BlockSpan> spans) 63private void GetBlockSpans(SyntaxToken previousToken, SyntaxNode node, ArrayBuilder<BlockSpan> spans)
Structure\Syntax\BlockStructureExtensions.cs (1)
16where TType : SyntaxNode
SyncNamespaces\AbstractSyncNamespacesService.cs (1)
25where TNamespaceSyntax : SyntaxNode
Testing\AbstractTestMethodFinder.cs (8)
17internal abstract class AbstractTestMethodFinder<TMethodDeclaration>(IEnumerable<ITestFrameworkMetadata> testFrameworks) : ITestMethodFinder where TMethodDeclaration : SyntaxNode 31protected abstract bool DescendIntoChildren(SyntaxNode node); 33public async Task<ImmutableArray<SyntaxNode>> GetPotentialTestMethodsAsync(Document document, TextSpan textSpan, CancellationToken cancellationToken) 50public bool IsMatch(SemanticModel semanticModel, SyntaxNode node, string fullyQualifiedTestName, CancellationToken cancellationToken) 81public bool IsTestMethod(SyntaxNode node) 86private async Task<ImmutableArray<SyntaxNode>> GetPotentialTestNodesAsync(Document document, TextSpan textSpan, CancellationToken cancellationToken) 91using var _ = ArrayBuilder<SyntaxNode>.GetInstance(out var testMethods); 102bool ShouldDescend(SyntaxNode node)
Testing\ITestMethodFinder.cs (3)
19Task<ImmutableArray<SyntaxNode>> GetPotentialTestMethodsAsync(Document document, TextSpan textSpan, CancellationToken cancellationToken); 25bool IsTestMethod(SyntaxNode node); 30bool IsMatch(SemanticModel model, SyntaxNode node, string fullyQualifiedTestName, CancellationToken cancellationToken);
UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (16)
30where TTypeDeclarationSyntax : SyntaxNode 31where TPropertyDeclaration : SyntaxNode 32where TVariableDeclarator : SyntaxNode 33where TConstructorDeclaration : SyntaxNode 34where TExpression : SyntaxNode 44protected abstract TPropertyDeclaration GetPropertyDeclaration(SyntaxNode node); 45protected abstract SyntaxNode GetNodeToRemove(TVariableDeclarator declarator); 50Document document, SyntaxNode finalPropertyDeclaration); 52protected abstract Task<SyntaxNode> UpdatePropertyAsync( 194var nodeToRemove = GetNodeToRemove(declarator); 246var newRoot = editor.GetChangedRoot(); 309private static SyntaxRemoveOptions CreateSyntaxRemoveOptions(SyntaxNode nodeToRemove) 323ISyntaxFactsService syntaxFacts, TPropertyDeclaration property, SyntaxNode fieldToRemove) 351private async Task<SyntaxNode> FormatAsync( 352SyntaxNode newRoot, 354SyntaxNode finalPropertyDeclaration,
UseNamedArguments\AbstractUseNamedArgumentsCodeRefactoringProvider.cs (9)
19Task ComputeRefactoringsAsync(CodeRefactoringContext context, SyntaxNode root); 23where TBaseArgumentSyntax : SyntaxNode 25where TArgumentListSyntax : SyntaxNode 28CodeRefactoringContext context, SyntaxNode root) 45var receiver = GetReceiver(argument); 137SyntaxNode root, 146var newRoot = root.ReplaceNode(argumentList, newArgumentList); 182protected abstract SyntaxNode? GetReceiver(SyntaxNode argument);
ValueTracking\ValueTracker.cs (2)
138private static async Task AddItemsFromAssignmentAsync(Document document, SyntaxNode lhsNode, OperationCollector collector, CancellationToken cancellationToken) 255private static async Task<(ISymbol?, SyntaxNode?)> GetSelectedSymbolAsync(TextSpan textSpan, Document document, CancellationToken cancellationToken)
ValueTracking\ValueTracker.FindReferencesProgress.cs (2)
101var elementAccess = node.FirstAncestorOrSelf<SyntaxNode>(syntaxFacts.IsElementAccessExpression); 180var invocationSyntax = originalNode.FirstAncestorOrSelf<SyntaxNode>(syntaxFacts.IsInvocationExpression);
Wrapping\AbstractCodeActionComputer.cs (9)
61private readonly List<SyntaxNode> _seenDocumentRoots = []; 147foreach (var seenRoot in _seenDocumentRoots) 163SyntaxNode rewrittenRoot, TextSpan spanToFormat, CancellationToken cancellationToken) 171private async Task<(SyntaxNode root, SyntaxNode rewrittenRoot, TextSpan spanToFormat)> RewriteTreeAsync( 220private async Task<(SyntaxNode root, SyntaxNode rewrittenRoot, TextSpan spanToFormat)> RewriteTreeAsync( 231var nodeToFormat = tokens.SelectAsArray(t => t.Parent).FindInnermostCommonNode<SyntaxNode>(); 265var trackedNode = rewrittenRoot.GetAnnotatedNodes(s_toFormatAnnotation).Single();
Wrapping\AbstractWrapper.cs (2)
35Document document, int position, SyntaxNode node, SyntaxWrappingOptions options, bool containsSyntaxError, CancellationToken cancellationToken); 65protected static bool ContainsOverlappingSyntaxError(SyntaxNode declaration, TextSpan headerSpan)
Wrapping\BinaryExpression\AbstractBinaryExpressionWrapper.cs (6)
22where TBinaryExpressionSyntax : SyntaxNode 44Document document, int position, SyntaxNode node, SyntaxWrappingOptions options, bool containsSyntaxError, CancellationToken cancellationToken) 104PrecedenceKind precedence, SyntaxNode expr, ArrayBuilder<SyntaxNodeOrToken> result) 115_syntaxFacts.GetPartsOfBinaryExpression(currentNodeOrToken.AsNode()!, out var left, out var opToken, out var right); 127bool IsValidBinaryExpression(PrecedenceKind precedence, SyntaxNode? node)
Wrapping\BinaryExpression\BinaryExpressionCodeActionComputer.cs (2)
95var left = _exprsAndOperators[i - 1].AsNode(); 97var right = _exprsAndOperators[i + 1].AsNode();
Wrapping\ChainedExpression\AbstractChainedExpressionWrapper.cs (6)
50where TNameSyntax : SyntaxNode 51where TBaseArgumentListSyntax : SyntaxNode 74Document document, int position, SyntaxNode node, SyntaxWrappingOptions options, bool containsSyntaxError, CancellationToken cancellationToken) 116private ImmutableArray<ImmutableArray<SyntaxNodeOrToken>> GetChainChunks(SyntaxNode node) 240private bool IsDecomposableChainPart(SyntaxNode? node) 268private void Decompose(SyntaxNode node, ArrayBuilder<SyntaxNodeOrToken> pieces)
Wrapping\ISyntaxWrapper.cs (1)
29Document document, int position, SyntaxNode node, SyntaxWrappingOptions options, bool containsSyntaxError, CancellationToken cancellationToken);
Wrapping\SeparatedSyntaxList\AbstractSeparatedSyntaxListWrapper.cs (6)
19where TListSyntax : SyntaxNode 20where TListItemSyntax : SyntaxNode 47protected abstract TListSyntax? TryGetApplicableList(SyntaxNode node); 50SyntaxNode root, int position, SyntaxNode declaration, bool containsSyntaxError, TListSyntax listSyntax); 53Document document, int position, SyntaxNode declaration, SyntaxWrappingOptions options, bool containsSyntaxError, CancellationToken cancellationToken)
Wrapping\SeparatedSyntaxList\SeparatedSyntaxListCodeActionComputer.cs (1)
312var item = itemsAndSeparators[i].AsNode()!;
Microsoft.CodeAnalysis.Features.Test.Utilities (27)
EditAndContinue\EditAndContinueTestVerifier.cs (20)
49public abstract ImmutableArray<SyntaxNode> GetDeclarators(ISymbol method); 52public abstract TreeComparer<SyntaxNode> TopSyntaxComparer { get; } 65var oldRoot = oldTree.GetRoot(); 279SyntaxNode oldRoot, 280SyntaxNode newRoot, 384public static SyntaxNode FindNode(SyntaxNode root, TextSpan span) 386var result = root.FindToken(span.Start).Parent!; 401SyntaxNode oldRoot, 402SyntaxNode newRoot, 410var newNode = FindNode(newRoot, newSpan); 411var expectedOldNode = FindNode(oldRoot, oldSpan); 488internal static IEnumerable<KeyValuePair<SyntaxNode, SyntaxNode>> GetMethodMatches(AbstractEditAndContinueAnalyzer analyzer, Match<SyntaxNode> bodyMatch) 493var result = new Dictionary<SyntaxNode, SyntaxNode>(); 508public static MatchingPairs ToMatchingPairs(Match<SyntaxNode> match) 511public static MatchingPairs ToMatchingPairs(IEnumerable<KeyValuePair<SyntaxNode, SyntaxNode>> matches)
EditAndContinue\EditScriptDescription.cs (4)
13internal readonly struct EditScriptDescription(string oldMarkedSource, string newMarkedSource, EditScript<SyntaxNode> edits) 17public readonly EditScript<SyntaxNode> Script = edits; 19public Match<SyntaxNode> Match => Script.Match; 20public ImmutableArray<Edit<SyntaxNode>> Edits => Script.Edits;
EditAndContinue\SyntaxMapDescription.cs (3)
16public readonly struct Mapping(ImmutableArray<(TextSpan oldSpan, TextSpan newSpan)> nodeSpans, ImmutableArray<TextSpan> newSpans, Match<SyntaxNode>? match) 45public readonly Match<SyntaxNode>? Match; 47public SyntaxMapDescription(string oldSource, string newSource, Match<SyntaxNode>? match = null)
Microsoft.CodeAnalysis.Features.UnitTests (1)
EditAndContinue\RudeEditDiagnosticTests.cs (1)
23var syntaxNode = tree.GetRoot();
Microsoft.CodeAnalysis.LanguageServer (2)
Testing\TestDiscoverer.cs (2)
79async Task<ImmutableArray<SyntaxNode>> GetPotentialTestMethodsAsync(LSP.Range range, Document document, ITestMethodFinder testMethodFinder, CancellationToken cancellationToken) 89private async Task<ImmutableArray<TestCase>> MatchDiscoveredTestsToTestsInRangeAsync(ImmutableArray<TestCase> discoveredTests, ImmutableArray<SyntaxNode> testMethods, ITestMethodFinder testMethodFinder, Document document, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.LanguageServer.Protocol (4)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.IncrementalMemberEditAnalyzer.cs (4)
201private async Task<(SyntaxNode changedMember, int changedMemberId, ImmutableArray<TextSpan> memberSpans, Document lastDocument)?> TryGetChangedMemberAsync( 203SyntaxNode root, 241SyntaxNode changedMember, 294SyntaxNode member,
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (2)
Diagnostics\NonLocalDiagnosticTests.cs (2)
93var root = tree.GetRoot(); 104var root = tree.GetRoot();
Microsoft.CodeAnalysis.Remote.ServiceHub (8)
Host\RemoteDocumentDifferenceService.cs (2)
46public Task<SyntaxNode?> GetChangedMemberAsync(Document oldDocument, Document newDocument, CancellationToken cancellationToken) 48return SpecializedTasks.Null<SyntaxNode>();
Services\CodeLensReferences\RemoteCodeLensReferencesService.cs (5)
28private static async ValueTask<SyntaxNode?> TryFindNodeAsync(Solution solution, DocumentId documentId, TextSpan textSpan, CancellationToken cancellationToken) 49var syntaxNode = await TryFindNodeAsync(solution, documentId, textSpan, cancellationToken).ConfigureAwait(false); 72var syntaxNode = await TryFindNodeAsync(solution, documentId, textSpan, cancellationToken).ConfigureAwait(false); 90var syntaxNode = await TryFindNodeAsync(solution, documentId, textSpan, cancellationToken).ConfigureAwait(false); 110var syntaxNode = await TryFindNodeAsync(solution, documentId, textSpan, cancellationToken).ConfigureAwait(false);
Services\ConvertTupleToStructCodeRefactoringProvider\RemoteConvertTupleToStructCodeRefactoringService.cs (1)
81var changedDocuments = await ProducerConsumer<(DocumentId documentId, SyntaxNode newRoot)>.RunParallelAsync(
Microsoft.CodeAnalysis.Remote.ServiceHub.UnitTests (1)
RemoteAnalyzerAssemblyLoaderTests.cs (1)
61var compilerAssemblyInCurrentAlc = typeof(SyntaxNode).GetTypeInfo().Assembly;
Microsoft.CodeAnalysis.Test.Utilities (100)
AssemblyLoadTestFixture.cs (3)
342var compilerReference = MetadataReference.CreateFromFile(typeof(Microsoft.CodeAnalysis.SyntaxNode).Assembly.Location); 460var fakeCompilerAssembly = GenerateDll("Microsoft.CodeAnalysis", analyzerWithFakeCompilerDependencyDirectory, publicKeyOpt: typeof(SyntaxNode).Assembly.GetName().GetPublicKey()?.ToImmutableArray() ?? default, csSource: @" 488var laterFakeCompilerAssembly = GenerateDll("Microsoft.CodeAnalysis", analyzerWithLaterFakeCompileDirectory, publicKeyOpt: typeof(SyntaxNode).Assembly.GetName().GetPublicKey()?.ToImmutableArray() ?? default, csSource: @"
CommonTestBase.cs (5)
599var root = model.SyntaxTree.GetRoot(); 627private static void CollectTopOperations(SemanticModel model, SyntaxNode node, HashSet<IOperation> topOperations) 629foreach (var child in node.ChildNodes()) 648foreach (var node in model.SyntaxTree.GetRoot().DescendantNodes()) 695SemanticModel semanticModel, HashSet<IOperation> set, SyntaxNode node)
Compilation\CompilationExtensions.cs (8)
188internal static void VerifyOperationTree(this Compilation compilation, SyntaxNode node, string expectedOperationTree) 202SyntaxNode root = tree.GetRoot(); 234ImmutableArray<SyntaxNode> executableCodeBlocks = declaration.ExecutableCodeBlocks; 240foreach (SyntaxNode executableCodeBlock in executableCodeBlocks) 290var root = tree.GetRoot(); 292foreach (var node in root.DescendantNodesAndSelf()) 320var explicitNodeMap = new Dictionary<SyntaxNode, IOperation>(); 395foreach (var node in nodes)
Compilation\ControlFlowGraphVerifier.cs (4)
28public static (ControlFlowGraph graph, ISymbol associatedSymbol) GetControlFlowGraph(SyntaxNode syntaxNode, SemanticModel model) 829SyntaxNode captureReferenceSyntax = reference.Syntax; 1040SyntaxNode whenNotNull = null; 1092bool isLongLivedCaptureReferenceSyntax(SyntaxNode captureReferenceSyntax)
Compilation\OperationTreeVerifier.cs (3)
28private readonly Dictionary<SyntaxNode, IOperation> _explicitNodeMap; 45_explicitNodeMap = new Dictionary<SyntaxNode, IOperation>(); 156private static string GetSnippetFromSyntax(SyntaxNode syntax)
Compilation\SemanticModelExtensions.cs (2)
13public static void VerifyOperationTree(this SemanticModel model, SyntaxNode node, string expectedOperationTree) 20public static void AppendOperationTree(this SemanticModel model, SyntaxNode node, StringBuilder actualTextBuilder, int initialIndent = 0)
Compilation\TestOperationVisitor.cs (3)
46var syntax = operation.Syntax; 192var explicitNodeMap = new Dictionary<SyntaxNode, IOperation>(); 795private static void CheckOperators(SemanticModel semanticModel, SyntaxNode syntax)
Diagnostics\BoxingOperationAnalyzer.cs (1)
77internal void Report(OperationAnalysisContext context, SyntaxNode boxingExpression)
Diagnostics\CommonDiagnosticAnalyzers.cs (7)
106var root = tree.GetRoot(); 184var root = tree.GetRoot(); 261var root = tree.GetRoot(); 314var root = tree.GetRoot(); 2849var root = tree.GetRoot(); 2992public readonly List<SyntaxNode> AnalyzedSyntaxNodes = new(); 2994public readonly List<SyntaxNode> AnalyzedSyntaxNodesInsideCodeBlock = new();
Diagnostics\CouldHaveMoreSpecificTypeAnalyzer.cs (1)
66SyntaxNode syntax = increment.Syntax;
Diagnostics\DiagnosticDescription.cs (4)
44private readonly Func<SyntaxNode, bool> _syntaxPredicate; 78Func<SyntaxNode, bool> syntaxNodePredicate, 103Func<SyntaxNode, bool> syntaxNodePredicate, 232public DiagnosticDescription WhereSyntax(Func<SyntaxNode, bool> syntaxPredicate)
Diagnostics\EmptyArrayAnalyzer.cs (1)
54internal void Report(OperationAnalysisContext context, SyntaxNode arrayCreationExpression)
Diagnostics\OperationTestAnalyzer.cs (11)
286private void Report(OperationAnalysisContext context, SyntaxNode syntax, DiagnosticDescriptor descriptor) 482private void Report(OperationAnalysisContext context, SyntaxNode syntax, DiagnosticDescriptor descriptor) 599private static void Report(OperationAnalysisContext context, SyntaxNode syntax, DiagnosticDescriptor descriptor) 676private static void Report(OperationAnalysisContext context, SyntaxNode syntax, DiagnosticDescriptor descriptor) 722private static void Report(OperationAnalysisContext context, SyntaxNode syntax, DiagnosticDescriptor descriptor) 763private static void Report(OperationAnalysisContext context, SyntaxNode syntax, DiagnosticDescriptor descriptor) 803private static void Report(OperationAnalysisContext context, SyntaxNode syntax, DiagnosticDescriptor descriptor) 860private static void Report(OperationAnalysisContext context, SyntaxNode syntax, DiagnosticDescriptor descriptor) 921private static void Report(OperationAnalysisContext context, SyntaxNode syntax, DiagnosticDescriptor descriptor) 2139var node = syntaxContext.Node; 2151var node = syntaxContext.Node;
Diagnostics\OptionsDiagnosticAnalyzer.cs (1)
27protected override void OnAbstractMember(string AbstractMemberName, SyntaxNode node = null, ISymbol symbol = null, [CallerMemberName] string callerName = null)
Diagnostics\TestDiagnosticAnalyzer.cs (1)
33protected abstract void OnAbstractMember(string abstractMemberName, SyntaxNode node = null, ISymbol symbol = null, [CallerMemberName] string callerName = null);
Diagnostics\ThrowingDiagnosticAnalyzer.cs (1)
52protected override void OnAbstractMember(string abstractMemberName, SyntaxNode node, ISymbol symbol, string methodName)
Diagnostics\TrackingDiagnosticAnalyzer.cs (2)
34public Entry(string abstractMemberName, string callerName, SyntaxNode node, ISymbol symbol) 52protected override void OnAbstractMember(string abstractMemberName, SyntaxNode node, ISymbol symbol, string callerName)
MarkedSource\SourceWithMarkedNodes.cs (15)
31public readonly SyntaxNode Root; 107public ImmutableDictionary<SyntaxNode, int> MapSyntaxNodesToMarks() 112public ImmutableDictionary<int, SyntaxNode> MapMarksToSyntaxNodes() 117public SyntaxNode GetNode(string tag, int id) 120private static SyntaxNode GetNode(SyntaxNode root, MarkedSpan marker) 122var node = root.FindNode(marker.MarkedSyntax, getInnermostNodeForTie: true); 128var nodeOfKind = node.FirstAncestorOrSelf<SyntaxNode>(n => n.RawKind == marker.SyntaxKind); 133public static Func<SyntaxNode, SyntaxNode> GetSyntaxMap(SourceWithMarkedNodes source0, SourceWithMarkedNodes source1, List<SyntaxNode> unmappedNodes = null) 138return new Func<SyntaxNode, SyntaxNode>(node1 => 142if (map0.TryGetValue(mark, out var result))
Mocks\TestMessageProvider.cs (7)
268protected override void ReportInvalidAttributeArgument(DiagnosticBag diagnostics, SyntaxNode attributeSyntax, int parameterIndex, AttributeData attribute) 273protected override void ReportInvalidNamedArgument(DiagnosticBag diagnostics, SyntaxNode attributeSyntax, int namedArgumentIndex, ITypeSymbol attributeClass, string parameterName) 278protected override void ReportParameterNotValidForType(DiagnosticBag diagnostics, SyntaxNode attributeSyntax, int namedArgumentIndex) 283protected override void ReportMarshalUnmanagedTypeNotValidForFields(DiagnosticBag diagnostics, SyntaxNode attributeSyntax, int parameterIndex, string unmanagedTypeName, AttributeData attribute) 288protected override void ReportMarshalUnmanagedTypeOnlyValidForFields(DiagnosticBag diagnostics, SyntaxNode attributeSyntax, int parameterIndex, string unmanagedTypeName, AttributeData attribute) 293protected override void ReportAttributeParameterRequired(DiagnosticBag diagnostics, SyntaxNode attributeSyntax, string parameterName) 298protected override void ReportAttributeParameterRequired(DiagnosticBag diagnostics, SyntaxNode attributeSyntax, string parameterName1, string parameterName2)
Syntax\NodeHelpers.cs (12)
31public static string GetKind(this SyntaxNode n) 78public static SyntaxNode GetRootNode(this SyntaxNodeOrToken node) 80SyntaxNode retVal = null; 93public static SyntaxNode GetRootNode(this SyntaxToken node) 95SyntaxNode retVal = node.Parent; 107public static SyntaxNode GetRootNode(this SyntaxNode node) 109var retVal = node.Parent == null ? node : node.Parent; 118public static SyntaxNode GetRootNode(this SyntaxTrivia node) 120SyntaxNode retVal = node.Token.Parent; 147public static NodeInfo GetNodeInfo(this SyntaxNode node) 206private static NodeInfo.FieldInfo GetFieldInfo(PropertyInfo prop, SyntaxNode node)
Syntax\TokenUtilities.cs (2)
84public static IList<SyntaxToken> GetTokens(SyntaxNode node) 96internal static SyntaxNode GetSyntaxRoot(string expectedText, string language, ParseOptions options = null)
Syntax\XmlHelpers.cs (2)
61public static void AddInfo(SyntaxNode node, XElement xml) 113public static XElement ToXml(this SyntaxNode node, SyntaxTree syntaxTree, XmlOptions options = null)
TestBase.cs (2)
332Func<SyntaxNode, bool>? syntaxNodePredicate = null, 351Func<SyntaxNode, bool>? syntaxNodePredicate = null,
TestHelpers.cs (2)
101Func<SyntaxNode, bool> syntaxNodePredicate = null, 127Func<SyntaxNode, bool> syntaxNodePredicate = null,
Microsoft.CodeAnalysis.UnitTests (6)
AnalyzerAssemblyLoaderTests.cs (1)
1202var compilerReference = MetadataReference.CreateFromFile(typeof(SyntaxNode).Assembly.Location);
CommonSyntaxTests.cs (3)
63var d = (SyntaxNodeOrToken)((SyntaxNode)null); 80SyntaxNode node = CSharp.SyntaxFactory.IdentifierName("test"); 96SyntaxNode node = VB.SyntaxFactory.IdentifierName("test");
Symbols\DocumentationCommentIdTests.cs (2)
176var root = await tree.GetRootAsync(); 179var node = token.Parent;
Microsoft.CodeAnalysis.VisualBasic (2995)
Analysis\FlowAnalysis\ControlFlowAnalysis.vb (10)
26Private _entryPoints As ImmutableArray(Of SyntaxNode) 27Private _exitPoints As ImmutableArray(Of SyntaxNode) 39Public Overrides ReadOnly Property EntryPoints As ImmutableArray(Of SyntaxNode) 43Dim result = If(Me._context.Failed, ImmutableArray(Of SyntaxNode).Empty, 44DirectCast(EntryPointsWalker.Analyze(_context.AnalysisInfo, _context.RegionInfo, _succeeded), IEnumerable(Of SyntaxNode)).ToImmutableArray()) 54Public Overrides ReadOnly Property ExitPoints As ImmutableArray(Of SyntaxNode) 57Dim result = If(Me._context.Failed, ImmutableArray(Of SyntaxNode).Empty, 58DirectCast(ExitPointsWalker.Analyze(_context.AnalysisInfo, _context.RegionInfo), IEnumerable(Of SyntaxNode)).ToImmutableArray()) 105Public Overrides ReadOnly Property ReturnStatements As ImmutableArray(Of SyntaxNode) 107Return ExitPoints.WhereAsArray(Function(s As SyntaxNode) As Boolean
Analysis\FlowAnalysis\DataFlowPass.Symbols.vb (1)
66Friend Overrides Function GetDeclaratorSyntax() As SyntaxNode
Analysis\FlowAnalysis\DataFlowPass.vb (7)
945Protected Sub CheckAssigned(symbol As Symbol, node As SyntaxNode, Optional rwContext As ReadWriteContext = ReadWriteContext.None) 981Private Sub CheckAssigned(fieldAccess As BoundFieldAccess, node As SyntaxNode, Optional rwContext As ReadWriteContext = ReadWriteContext.None) 1143node As SyntaxNode, 1223Private Sub CheckAssignedFunctionValue(local As LocalSymbol, node As SyntaxNode) 1237Private Sub ReportUnassignedFunctionValue(local As LocalSymbol, node As SyntaxNode) 1949Protected Sub CheckAssignedFromArgumentWrite(expr As BoundExpression, node As SyntaxNode) 2019Private Function DeclaredVariableIsAlwaysAssignedBeforeInitializer(syntax As SyntaxNode, boundInitializer As BoundExpression,
Analysis\FlowAnalysis\DataFlowsInWalker.vb (1)
108node As SyntaxNode,
Analysis\FlowAnalysis\DataFlowsOutWalker.vb (1)
142node As SyntaxNode,
Analysis\FlowAnalysis\UnassignedVariablesWalker.vb (1)
37node As SyntaxNode,
Analysis\IteratorAndAsyncAnalysis\IteratorAndAsyncCaptureWalker.vb (4)
29Private _lazyDisallowedCaptures As MultiDictionary(Of Symbol, SyntaxNode) 131Private Sub CaptureVariable(variable As Symbol, syntax As SyntaxNode) 140_lazyDisallowedCaptures = New MultiDictionary(Of Symbol, SyntaxNode)() 162Protected Overrides Sub ReportUnassigned(symbol As Symbol, node As SyntaxNode, rwContext As ReadWriteContext, Optional slot As Integer = -1, Optional boundFieldAccess As BoundFieldAccess = Nothing)
Binding\AttributeBinder.vb (1)
36Public Overrides Function GetBinder(node As SyntaxNode) As Binder
Binding\AttributeSemanticModel.vb (1)
52Friend Overrides Function Bind(binder As Binder, node As SyntaxNode, diagnostics As BindingDiagnosticBag) As BoundNode
Binding\BackstopBinder.vb (1)
38Public Overrides Function GetBinder(node As SyntaxNode) As Binder
Binding\Binder.vb (9)
312Public Overridable Function GetBinder(node As SyntaxNode) As Binder 469Friend Function GetWellKnownType(type As WellKnownType, syntax As SyntaxNode, diagBag As BindingDiagnosticBag) As NamedTypeSymbol 473Friend Shared Function GetWellKnownType(compilation As VisualBasicCompilation, type As WellKnownType, syntax As SyntaxNode, diagBag As BindingDiagnosticBag) As NamedTypeSymbol 552Friend Function GetSpecialTypeMember(member As SpecialMember, syntax As SyntaxNode, diagnostics As BindingDiagnosticBag) As Symbol 556Friend Shared Function GetSpecialTypeMember(assembly As AssemblySymbol, member As SpecialMember, syntax As SyntaxNode, diagnostics As BindingDiagnosticBag) As Symbol 591Friend Function GetWellKnownTypeMember(member As WellKnownMember, syntax As SyntaxNode, diagBag As BindingDiagnosticBag) As Symbol 595Friend Shared Function GetWellKnownTypeMember(compilation As VisualBasicCompilation, member As WellKnownMember, syntax As SyntaxNode, diagBag As BindingDiagnosticBag) As Symbol 949Friend Sub ReportDiagnosticsIfObsoleteOrNotSupported(diagnostics As BindingDiagnosticBag, symbol As Symbol, node As SyntaxNode) 981Friend Shared Sub ReportDiagnosticsIfObsolete(diagnostics As BindingDiagnosticBag, context As Symbol, symbol As Symbol, node As SyntaxNode)
Binding\Binder_Conversions.vb (19)
71node As SyntaxNode, 182node As SyntaxNode, 308node As SyntaxNode, 321node As SyntaxNode, 426tree As SyntaxNode, 661location As SyntaxNode, 675location As SyntaxNode, 978tree As SyntaxNode, 1062tree As SyntaxNode, 1089tree As SyntaxNode, 1195tree As SyntaxNode, 1304tree As SyntaxNode, 1506tree As SyntaxNode, 1583Dim location As SyntaxNode 1617Private Function ReclassifyInterpolatedStringExpression(conversionSemantics As SyntaxKind, tree As SyntaxNode, convKind As ConversionKind, isExplicit As Boolean, node As BoundInterpolatedStringExpression, targetType As TypeSymbol, diagnostics As BindingDiagnosticBag) As BoundExpression 1632tree As SyntaxNode, 1703location As SyntaxNode, 1741Private Shared Sub WarnOnLockConversion(sourceType As TypeSymbol, syntax As SyntaxNode, diagnostics As BindingDiagnosticBag) 1752location As SyntaxNode,
Binding\Binder_Delegates.vb (7)
302Dim addressOfSyntax As SyntaxNode = addressOfExpression.Syntax 339syntax As SyntaxNode, 719syntax As SyntaxNode, 743syntax As SyntaxNode, 1066syntaxNode As SyntaxNode, 1067methodGroupSyntax As SyntaxNode, 1139syntaxNode As SyntaxNode,
Binding\Binder_Expressions.vb (19)
288Protected Shared Function BadExpression(node As SyntaxNode, resultType As TypeSymbol) As BoundBadExpression 296Private Shared Function BadExpression(node As SyntaxNode, expr As BoundExpression, resultType As TypeSymbol) As BoundBadExpression 304Private Shared Function BadExpression(node As SyntaxNode, expr As BoundExpression, resultKind As LookupResultKind, resultType As TypeSymbol) As BoundBadExpression 312Private Shared Function BadExpression(node As SyntaxNode, exprs As ImmutableArray(Of BoundExpression), resultType As TypeSymbol) As BoundBadExpression 825node As SyntaxNode, 834node As SyntaxNode, 848node As SyntaxNode, 939node As SyntaxNode, 1489tree As SyntaxNode, 1713node As SyntaxNode, 2144syntax As SyntaxNode, 2348Private Function CreateMeReference(node As SyntaxNode, Optional isSynthetic As Boolean = False) As BoundMeReference 3508Private Sub CheckMemberTypeAccessibility(diagnostics As BindingDiagnosticBag, node As SyntaxNode, member As Symbol) 3637Private Function CheckSharedSymbolAccess(node As SyntaxNode, isShared As Boolean, <[In], Out> ByRef receiver As BoundExpression, qualKind As QualificationKind, diagnostics As BindingDiagnosticBag) As Boolean 3694Private Shared Function IsReceiverOfNameOfArgument(syntax As SyntaxNode) As Boolean 3703Private Shared Function IsNameOfArgument(syntax As SyntaxNode) As Boolean 4032Private Shared Function GetNamedArgumentIdentifier(argumentExpression As SyntaxNode) As SyntaxToken 4127Private Function CreateArrayBounds(node As SyntaxNode, knownSizes() As DimensionSize, diagnostics As BindingDiagnosticBag) As ImmutableArray(Of BoundExpression) 4476syntax As SyntaxNode,
Binding\Binder_Initializers.vb (6)
264equalsValueOrAsNewSyntax As SyntaxNode, 315Friend Function BindFieldInitializerExpression(equalsValueOrAsNewSyntax As SyntaxNode, fieldSymbol As FieldSymbol, diagnostics As BindingDiagnosticBag) As BoundExpression 335initValueOrAsNewNode As SyntaxNode, 340Dim syntaxNode As SyntaxNode = initValueOrAsNewNode 384Friend Function BindPropertyInitializerExpression(initValueOrAsNewNode As SyntaxNode, propertySymbol As PropertySymbol, diagnostics As BindingDiagnosticBag) As BoundExpression 392equalsValueOrAsNewSyntax As SyntaxNode,
Binding\Binder_InterpolatedString.vb (1)
108Private Function BindUnconvertedInterpolatedStringToFormattable(syntax As SyntaxNode, node As BoundInterpolatedStringExpression, targetType As TypeSymbol, diagnostics As BindingDiagnosticBag) As BoundExpression
Binding\Binder_Invocation.vb (29)
19node As SyntaxNode, 723node As SyntaxNode, 724target As SyntaxNode, 730callerInfoOpt As SyntaxNode, 822node As SyntaxNode, 823target As SyntaxNode, 885Dim errorLocation As SyntaxNode = lambda.Syntax 1083syntax As SyntaxNode, 1188node As SyntaxNode, 1194callerInfoOpt As SyntaxNode, 1218node As SyntaxNode, 1224callerInfoOpt As SyntaxNode, 1265node As SyntaxNode, 1273callerInfoOpt As SyntaxNode, 1296Public Shared Function GetLocationForOverloadResolutionDiagnostic(node As SyntaxNode, Optional groupOpt As BoundMethodOrPropertyGroup = Nothing) As Location 1297Dim result As SyntaxNode 1340node As SyntaxNode, 1348callerInfoOpt As SyntaxNode, 1824node As SyntaxNode, 1834callerInfoOpt As SyntaxNode 1978node As SyntaxNode, 1991callerInfoOpt As SyntaxNode, 2475Optional diagnosticNode As SyntaxNode = Nothing, 2544Optional diagnosticNode As SyntaxNode = Nothing, 2626node As SyntaxNode, 3092syntax As SyntaxNode, 3094callerInfoOpt As SyntaxNode, 3156Dim argumentSyntax As SyntaxNode = Nothing 3282Private Shared Function GetCallerLocation(syntax As SyntaxNode) As TextSpan
Binding\Binder_Lambda.vb (2)
428Dim endSyntax As SyntaxNode = lambdaSyntax 1007Private Shared Function LambdaHeaderErrorNode(source As UnboundLambda) As SyntaxNode
Binding\Binder_Latebound.vb (5)
18Private Function BindLateBoundMemberAccess(node As SyntaxNode, 29Private Function BindLateBoundMemberAccess(node As SyntaxNode, 78Private Function BindLateBoundInvocation(node As SyntaxNode, 100Dim memberSyntax As SyntaxNode 122Friend Function BindLateBoundInvocation(node As SyntaxNode,
Binding\Binder_ObjectInitializer.vb (5)
163syntax As SyntaxNode, 193typeNode As SyntaxNode, 196node As SyntaxNode, 524creationSyntax As SyntaxNode, 581node As SyntaxNode,
Binding\Binder_Operators.vb (7)
34node As SyntaxNode, 227node As SyntaxNode, 586node As SyntaxNode, 652node As SyntaxNode, 836node As SyntaxNode, 960syntax As SyntaxNode, 1238node As SyntaxNode,
Binding\Binder_Query.vb (4)
4550node As SyntaxNode, 4588node As SyntaxNode, 4605node As SyntaxNode, 4626node As SyntaxNode,
Binding\Binder_Statements.vb (10)
1925Friend Function AdjustAssignmentTarget(node As SyntaxNode, op1 As BoundExpression, diagnostics As BindingDiagnosticBag, ByRef isError As Boolean) As BoundExpression 2005Private Function BindAssignment(node As SyntaxNode, op1 As BoundExpression, op2 As BoundExpression, diagnostics As BindingDiagnosticBag) As BoundAssignmentOperator 2071Friend Function BindBlock(syntax As SyntaxNode, stmtList As SyntaxList(Of StatementSyntax), diagnostics As BindingDiagnosticBag) As BoundBlock 2079Friend Function BindBlock(syntax As SyntaxNode, stmtList As SyntaxList(Of StatementSyntax), diagnostics As BindingDiagnosticBag, stmtListBinder As Binder) As BoundBlock 4218syntax As SyntaxNode, 4271syntax As SyntaxNode, 4470Dim syntaxNodeForErrors As SyntaxNode 4557syntaxNode As SyntaxNode, 4593syntaxNode As SyntaxNode, 4640Private Sub ReportMutableStructureConstraintsInUsing(type As TypeSymbol, symbolName As String, syntaxNode As SyntaxNode, diagnostics As BindingDiagnosticBag)
Binding\Binder_Utils.vb (1)
757Public Shared Function ExtractTypeCharacter(node As SyntaxNode) As TypeCharacter
Binding\Binder_WithBlock.vb (2)
339Private Sub AssertExpressionIsNotFromStatementExpression(node As SyntaxNode) 353Public Overrides Function GetBinder(node As SyntaxNode) As Binder
Binding\Binder_XmlLiterals.vb (3)
1017Private Function BindInvocationExpressionIfGroupNotNothing(syntax As SyntaxNode, groupOpt As BoundMethodOrPropertyGroup, arguments As ImmutableArray(Of BoundExpression), diagnostics As BindingDiagnosticBag) As BoundExpression 1051syntax As SyntaxNode, 1965Friend Overrides ReadOnly Property Syntax As SyntaxNode
Binding\BinderBuilder.vb (1)
400Public Shared Function CreateBinderForMethodBody(methodSymbol As MethodSymbol, root As SyntaxNode, containingBinder As Binder) As Binder
Binding\BinderFactory.BinderFactoryVisitor.vb (1)
84Public Overrides Function DefaultVisit(node As SyntaxNode) As Binder
Binding\BinderFactory.vb (3)
47Private Function MakeBinder(node As SyntaxNode, position As Integer) As Binder 100Public Function GetBinderForPosition(node As SyntaxNode, position As Integer) As Binder 105Private Function GetBinderAtOrAbove(node As SyntaxNode, position As Integer) As Binder
Binding\BindingDiagnosticBag.vb (1)
90Friend Function ReportUseSite(symbol As Symbol, node As SyntaxNode) As Boolean
Binding\DeclarationInitializerBinder.vb (1)
79Public Overrides Function GetBinder(node As SyntaxNode) As Binder
Binding\DescendantBinderFactory.vb (6)
22Private ReadOnly _root As SyntaxNode 24Public Sub New(binder As ExecutableCodeBinder, root As SyntaxNode) 29Friend ReadOnly Property Root As SyntaxNode 41Friend Function GetBinder(node As SyntaxNode) As Binder 59Private _lazyNodeToBinderMap As ImmutableDictionary(Of SyntaxNode, BlockBaseBinder) 62Friend ReadOnly Property NodeToBinderMap As ImmutableDictionary(Of SyntaxNode, BlockBaseBinder)
Binding\ExecutableCodeBinder.vb (5)
27Private ReadOnly _syntaxRoot As SyntaxNode 32Public Sub New(root As SyntaxNode, containingBinder As Binder) 167Public Overrides Function GetBinder(node As SyntaxNode) As Binder 171Public ReadOnly Property Root As SyntaxNode 178Public ReadOnly Property NodeToBinderMap As ImmutableDictionary(Of SyntaxNode, BlockBaseBinder)
Binding\InitializerSemanticModel.vb (2)
37Friend Overrides Function Bind(binder As Binder, node As SyntaxNode, diagnostics As BindingDiagnosticBag) As BoundNode 98Private Function BindInitializer(binder As Binder, initializer As SyntaxNode, diagnostics As BindingDiagnosticBag) As BoundNode
Binding\LocalBinderBuilder.vb (5)
29Private _nodeMap As ImmutableDictionary(Of SyntaxNode, BlockBaseBinder) 36_nodeMap = ImmutableDictionary.Create(Of SyntaxNode, BlockBaseBinder)() 40Public Sub New(enclosingMethod As MethodSymbol, nodeMap As ImmutableDictionary(Of SyntaxNode, BlockBaseBinder), listMap As ImmutableDictionary(Of SyntaxList(Of StatementSyntax), BlockBaseBinder)) 46Public Sub MakeBinder(node As SyntaxNode, containingBinder As Binder) 53Public ReadOnly Property NodeToBinderMap As ImmutableDictionary(Of SyntaxNode, BlockBaseBinder)
Binding\MemberSemanticModel.vb (30)
25Private ReadOnly _root As SyntaxNode 31Friend Sub New(root As SyntaxNode, 50Friend NotOverridable Overrides ReadOnly Property Root As SyntaxNode 96Private Overloads Function GetEnclosingBinder(node As SyntaxNode) As Binder 156Friend Function GetUpperBoundNode(node As SyntaxNode) As BoundNode 1125Friend Sub CacheBoundNodes(boundNode As BoundNode, Optional thisSyntaxNodeOnly As SyntaxNode = Nothing) 1209Private ReadOnly _guardedBoundNodeMap As New SmallDictionary(Of SyntaxNode, ImmutableArray(Of BoundNode))(ReferenceEqualityComparer.Instance) 1210Private ReadOnly _guardedIOperationNodeMap As New Dictionary(Of SyntaxNode, IOperation) 1212Private ReadOnly _guardedQueryBindersMap As New Dictionary(Of SyntaxNode, ImmutableArray(Of Binder))() 1237Private Function GuardedGetBoundNodesFromMap(node As SyntaxNode) As ImmutableArray(Of BoundNode) 1258binderRoot As SyntaxNode, 1259node As SyntaxNode, 1266Dim current As SyntaxNode = node 1368node As SyntaxNode, 1699node As SyntaxNode, 1750Private Shared Function InWithStatementExpressionInterior(node As SyntaxNode) As Boolean 1829Friend Function GetBoundNodes(node As SyntaxNode) As ImmutableArray(Of BoundNode) 1910Private Shared Function IsNonExpressionCollectionInitializer(syntax As SyntaxNode) As Boolean 1911Dim parent As SyntaxNode = syntax.Parent 1928Private Sub GuardedIncrementalBind(bindingRoot As SyntaxNode, enclosingBinder As Binder) 1970Private Function GetBindingRoot(node As SyntaxNode) As SyntaxNode 2033Public Overrides Function GetBinder(node As SyntaxNode) As Binder 2105Private ReadOnly _thisSyntaxNodeOnly As SyntaxNode ' If not Nothing, record nodes for this syntax node only. 2107Private ReadOnly _nodeCache As OrderPreservingMultiDictionary(Of SyntaxNode, BoundNode) 2109Private Sub New(semanticModel As MemberSemanticModel, thisSyntaxNodeOnly As SyntaxNode, nodeCache As OrderPreservingMultiDictionary(Of SyntaxNode, BoundNode)) 2118nodeCache As SmallDictionary(Of SyntaxNode, ImmutableArray(Of BoundNode)), 2119Optional thisSyntaxNodeOnly As SyntaxNode = Nothing 2123Dim additionalNodes = OrderPreservingMultiDictionary(Of SyntaxNode, BoundNode).GetInstance()
Binding\MethodBodyBinder.vb (2)
29Public Sub New(methodSymbol As MethodSymbol, root As SyntaxNode, containingBinder As Binder) 45Private Function CreateFunctionValueLocal(methodSymbol As MethodSymbol, root As SyntaxNode) As LocalSymbol
Binding\MethodBodySemanticModel.vb (1)
14Friend Sub New(root As SyntaxNode,
Binding\NamedTypeBinder.vb (1)
41Public Overrides Function GetBinder(node As SyntaxNode) As Binder
Binding\SubOrFunctionBodyBinder.vb (1)
21Public Sub New(methodOrLambdaSymbol As MethodSymbol, root As SyntaxNode, containingBinder As Binder)
Binding\SyntheticBoundTrees\AnonymousTypeSyntheticMethods.vb (6)
22Dim syntax As SyntaxNode = Me.Syntax 59Dim syntax As SyntaxNode = Me.Syntax 90Dim syntax As SyntaxNode = Me.Syntax 189Dim syntax As SyntaxNode = Me.Syntax 261Dim syntax As SyntaxNode = Me.Syntax 331Dim syntax As SyntaxNode = Me.Syntax
BoundTree\BoundArrayAccess.vb (1)
15Public Sub New(syntax As SyntaxNode, expression As BoundExpression, indices As ImmutableArray(Of BoundExpression), type As TypeSymbol, Optional hasErrors As Boolean = False)
BoundTree\BoundArrayCreation.vb (2)
13Public Sub New(syntax As SyntaxNode, bounds As ImmutableArray(Of BoundExpression), initializerOpt As BoundArrayInitialization, type As TypeSymbol, Optional hasErrors As Boolean = False) 17Public Sub New(syntax As SyntaxNode, bounds As ImmutableArray(Of BoundExpression), initializerOpt As BoundArrayInitialization, arrayLiteralOpt As BoundArrayLiteral, arrayLiteralConversion As ConversionKind, type As TypeSymbol, Optional hasErrors As Boolean = False)
BoundTree\BoundAssignmentOperator.vb (3)
12Public Sub New(syntax As SyntaxNode, left As BoundExpression, right As BoundExpression, suppressObjectClone As Boolean, type As TypeSymbol, Optional hasErrors As Boolean = False) 16Public Sub New(syntax As SyntaxNode, left As BoundExpression, right As BoundExpression, suppressObjectClone As Boolean, Optional hasErrors As Boolean = False) 21syntax As SyntaxNode,
BoundTree\BoundBadVariable.vb (1)
12Public Sub New(syntax As SyntaxNode, expression As BoundExpression, type As TypeSymbol, Optional hasErrors As Boolean = False)
BoundTree\BoundBinaryOperator.vb (1)
14syntax As SyntaxNode,
BoundTree\BoundCall.vb (2)
13syntax As SyntaxNode, 32Public Sub New(syntax As SyntaxNode,
BoundTree\BoundConversion.vb (2)
14syntax As SyntaxNode, 26syntax As SyntaxNode,
BoundTree\BoundDirectCast.vb (3)
14syntax As SyntaxNode, 24syntax As SyntaxNode, 34Public Sub New(syntax As SyntaxNode, operand As BoundExpression, conversionKind As ConversionKind, constantValueOpt As ConstantValue, type As TypeSymbol, Optional hasErrors As Boolean = False)
BoundTree\BoundFieldAccess.vb (1)
14Public Sub New(syntax As SyntaxNode, receiverOpt As BoundExpression, fieldSymbol As FieldSymbol, isLValue As Boolean, type As TypeSymbol, Optional hasErrors As Boolean = False)
BoundTree\BoundLocal.vb (2)
13Public Sub New(syntax As SyntaxNode, localSymbol As LocalSymbol, type As TypeSymbol, hasErrors As Boolean) 17Public Sub New(syntax As SyntaxNode, localSymbol As LocalSymbol, type As TypeSymbol)
BoundTree\BoundLocalDeclaration.vb (1)
14Public Sub New(syntax As SyntaxNode, localSymbol As LocalSymbol, initializerOpt As BoundExpression)
BoundTree\BoundMethodGroup.vb (1)
17syntax As SyntaxNode,
BoundTree\BoundNamespaceExpression.vb (2)
12Public Sub New(syntax As SyntaxNode, unevaluatedReceiverOpt As BoundExpression, namespaceSymbol As NamespaceSymbol, hasErrors As Boolean) 16Public Sub New(syntax As SyntaxNode, unevaluatedReceiverOpt As BoundExpression, namespaceSymbol As NamespaceSymbol)
BoundTree\BoundNode.vb (5)
13Private ReadOnly _syntax As SyntaxNode 28Public Sub New(kind As BoundKind, syntax As SyntaxNode) 35Public Sub New(kind As BoundKind, syntax As SyntaxNode, hasErrors As Boolean) 50Private Shared Sub ValidateLocationInformation(kind As BoundKind, syntax As SyntaxNode) 92Public ReadOnly Property Syntax As SyntaxNode
BoundTree\BoundNoOpStatement.vb (2)
13Public Sub New(syntax As SyntaxNode) 17Public Sub New(syntax As SyntaxNode, hasErrors As Boolean)
BoundTree\BoundObjectCreationExpression.vb (1)
14Public Sub New(syntax As SyntaxNode, constructorOpt As MethodSymbol, arguments As ImmutableArray(Of BoundExpression), initializerOpt As BoundObjectInitializerExpressionBase, type As TypeSymbol,
BoundTree\BoundOnErrorStatement.vb (1)
20Public Sub New(syntax As SyntaxNode, label As LabelSymbol, labelExpressionOpt As BoundExpression, Optional hasErrors As Boolean = False)
BoundTree\BoundParameter.vb (4)
11Public Sub New(syntax As SyntaxNode, parameterSymbol As ParameterSymbol, isLValue As Boolean, type As TypeSymbol, hasErrors As Boolean) 15Public Sub New(syntax As SyntaxNode, parameterSymbol As ParameterSymbol, isLValue As Boolean, type As TypeSymbol) 19Public Sub New(syntax As SyntaxNode, parameterSymbol As ParameterSymbol, type As TypeSymbol, hasErrors As Boolean) 23Public Sub New(syntax As SyntaxNode, parameterSymbol As ParameterSymbol, type As TypeSymbol)
BoundTree\BoundPropertyAccess.vb (1)
18Public Sub New(syntax As SyntaxNode, propertySymbol As PropertySymbol, propertyGroupOpt As BoundPropertyGroup, accessKind As PropertyAccessKind, isWriteable As Boolean, receiverOpt As BoundExpression, arguments As ImmutableArray(Of BoundExpression),
BoundTree\BoundResumeStatement.vb (2)
19Public Sub New(syntax As SyntaxNode, Optional isNext As Boolean = False) 23Public Sub New(syntax As SyntaxNode, label As LabelSymbol, labelExpressionOpt As BoundExpression, Optional hasErrors As Boolean = False)
BoundTree\BoundTreeVisitor.vb (1)
162Dim syntax As SyntaxNode = node.Syntax
BoundTree\BoundTryCast.vb (3)
13syntax As SyntaxNode, 23syntax As SyntaxNode, 33Public Sub New(syntax As SyntaxNode, operand As BoundExpression, conversionKind As ConversionKind, constantValueOpt As ConstantValue, type As TypeSymbol, Optional hasErrors As Boolean = False)
BoundTree\BoundTypeExpression.vb (1)
13Public Sub New(syntax As SyntaxNode, type As TypeSymbol, Optional hasErrors As Boolean = False)
BoundTree\BoundUnaryOperator.vb (1)
14syntax As SyntaxNode,
BoundTree\BoundYieldStatement.vb (1)
19Friend Sub New(syntax As SyntaxNode, expression As BoundExpression, hasErrors As Boolean, returnTypeIsBeingInferred As Boolean)
CodeGen\CodeGenerator.vb (4)
192Private Sub EmitSymbolToken(symbol As FieldSymbol, syntaxNode As SyntaxNode) 196Private Sub EmitSymbolToken(symbol As MethodSymbol, syntaxNode As SyntaxNode, Optional encodeAsRawDefinitionToken As Boolean = False) 201Private Sub EmitSymbolToken(symbol As TypeSymbol, syntaxNode As SyntaxNode) 294Private Sub EmitSequencePoint(syntax As SyntaxNode)
CodeGen\EmitAddress.vb (1)
436Private Sub EmitStaticFieldAddress(field As FieldSymbol, syntaxNode As SyntaxNode)
CodeGen\EmitExpression.vb (14)
449Private Sub EmitDelegateCreation(receiver As BoundExpression, method As MethodSymbol, delegateType As TypeSymbol, used As Boolean, syntaxNode As SyntaxNode) 676Private Sub EmitStaticFieldLoad(field As FieldSymbol, used As Boolean, syntaxNode As SyntaxNode) 815Private Sub EmitLoadIndirect(type As TypeSymbol, syntaxNode As SyntaxNode) 1584Private Sub EmitStaticCast(toType As TypeSymbol, syntax As SyntaxNode) 1652Private Sub EmitInitObj(type As TypeSymbol, used As Boolean, syntaxNode As SyntaxNode) 1666syntaxNode As SyntaxNode) 1677Private Sub EmitLoadDefaultValueOfTypeParameter(type As TypeSymbol, used As Boolean, syntaxNode As SyntaxNode) 1682Private Sub EmitLoadDefaultValueOfTypeFromNothingLiteral(type As TypeSymbol, used As Boolean, syntaxNode As SyntaxNode) 1709Private Sub EmitConstantExpression(type As TypeSymbol, constantValue As ConstantValue, used As Boolean, syntaxNode As SyntaxNode) 2085Private Sub EmitArrayElementStore(arrayType As ArrayTypeSymbol, syntaxNode As SyntaxNode) 2096Private Sub EmitVectorElementStore(arrayType As ArrayTypeSymbol, syntaxNode As SyntaxNode) 2169Private Sub EmitStoreIndirect(type As TypeSymbol, syntaxNode As SyntaxNode) 2293Private Sub EmitBox(type As TypeSymbol, syntaxNode As SyntaxNode) 2298Private Sub EmitUnboxAny(type As TypeSymbol, syntaxNode As SyntaxNode)
CodeGen\EmitStatement.vb (6)
430Private Sub EmitSetProjectError(syntaxNode As SyntaxNode, errorLineNumberOpt As BoundExpression) 447Private Sub EmitClearProjectError(syntaxNode As SyntaxNode) 1086Private Sub EmitStringSwitchJumpTable(caseLabels As KeyValuePair(Of ConstantValue, Object)(), fallThroughLabel As LabelSymbol, key As LocalDefinition, syntaxNode As SyntaxNode) 1146Private Sub EmitStringCompareAndBranch(key As LocalOrParameter, syntaxNode As SyntaxNode, stringConstant As ConstantValue, targetLabel As Object, stringCompareMethodRef As Microsoft.Cci.IReference) 1242Private Function DefineLocal(local As LocalSymbol, syntaxNode As SyntaxNode) As LocalDefinition 1384Private Function AllocateTemp(type As TypeSymbol, syntaxNode As SyntaxNode) As LocalDefinition
CodeGen\ResumableStateMachineStateAllocator.vb (1)
46Public Function AllocateState(awaitOrYieldReturnSyntax As SyntaxNode) As StateMachineState
Compilation\DocumentationComments\DocumentationCommentCompiler.Common.vb (1)
676Private Function TryGetDocCommentTriviaAndGenerateDiagnostics(syntaxNode As SyntaxNode) As DocumentationCommentTriviaSyntax
Compilation\DocumentationComments\DocumentationCommentWalker.vb (2)
136Public Overrides Sub DefaultVisit(node As SyntaxNode) 277Private Sub ProcessErrorLocations(node As SyntaxNode, errorLocations As ImmutableArray(Of Location), useSiteInfo As CompoundUseSiteInfo(Of AssemblySymbol), errid As Nullable(Of ERRID))
Compilation\DocumentationComments\UnprocessedDocumentationCommentFinder.vb (2)
105Public Overrides Sub DefaultVisit(node As SyntaxNode) 112Private Sub DefaultVisitChildrenStartingWith(node As SyntaxNode, start As Integer)
Compilation\MethodCompiler.vb (1)
2084Dim syntaxNode As SyntaxNode = constructor.Syntax
Compilation\SemanticModel.vb (35)
48Friend MustOverride Shadows ReadOnly Property Root As SyntaxNode 140Protected Overrides Function GetOperationCore(node As SyntaxNode, cancellationToken As CancellationToken) As IOperation 366Public Function GetConversion(node As SyntaxNode, Optional cancellationToken As CancellationToken = Nothing) As Conversion 546Friend Function IsInTree(node As SyntaxNode) As Boolean 550Private Shared Function IsUnderNode(node As SyntaxNode, root As SyntaxNode) As Boolean 609Friend Function FindInitialNodeFromPosition(position As Integer) As SyntaxNode 996Dim parentSyntax As SyntaxNode = boundNodes.LowestBoundNodeOfSyntacticParent.Syntax 1426Dim parentSyntax As SyntaxNode = boundNodeOfSyntacticParent.Syntax 1562Friend Overridable Function Bind(binder As Binder, node As SyntaxNode, diagnostics As BindingDiagnosticBag) As BoundNode 3079Protected NotOverridable Overrides ReadOnly Property RootCore As SyntaxNode 3085Private Function GetSymbolInfoForNode(node As SyntaxNode, Optional cancellationToken As CancellationToken = Nothing) As SymbolInfo 3128Private Function GetTypeInfoForNode(node As SyntaxNode, Optional cancellationToken As CancellationToken = Nothing) As VisualBasicTypeInfo 3146Private Function GetMemberGroupForNode(node As SyntaxNode, Optional cancellationToken As CancellationToken = Nothing) As ImmutableArray(Of ISymbol) 3164Protected NotOverridable Overrides Function GetSpeculativeTypeInfoCore(position As Integer, expression As SyntaxNode, bindingOption As SpeculativeBindingOption) As TypeInfo 3170Protected NotOverridable Overrides Function GetSpeculativeSymbolInfoCore(position As Integer, expression As SyntaxNode, bindingOption As SpeculativeBindingOption) As SymbolInfo 3176Protected NotOverridable Overrides Function GetSpeculativeAliasInfoCore(position As Integer, nameSyntax As SyntaxNode, bindingOption As SpeculativeBindingOption) As IAliasSymbol 3182Protected NotOverridable Overrides Function GetSymbolInfoCore(node As SyntaxNode, Optional cancellationToken As CancellationToken = Nothing) As SymbolInfo 3186Protected NotOverridable Overrides Function GetTypeInfoCore(node As SyntaxNode, Optional cancellationToken As CancellationToken = Nothing) As TypeInfo 3190Protected NotOverridable Overrides Function GetAliasInfoCore(node As SyntaxNode, Optional cancellationToken As CancellationToken = Nothing) As IAliasSymbol 3203Protected NotOverridable Overrides Function GetPreprocessingSymbolInfoCore(node As SyntaxNode) As PreprocessingSymbolInfo 3212Protected NotOverridable Overrides Function GetMemberGroupCore(node As SyntaxNode, Optional cancellationToken As CancellationToken = Nothing) As ImmutableArray(Of ISymbol) 3248Protected NotOverridable Overrides Function GetDeclaredSymbolCore(declaration As SyntaxNode, Optional cancellationToken As CancellationToken = Nothing) As ISymbol 3360Protected NotOverridable Overrides Function GetDeclaredSymbolsCore(declaration As SyntaxNode, Optional cancellationToken As CancellationToken = Nothing) As ImmutableArray(Of ISymbol) 3376Protected NotOverridable Overrides Function AnalyzeDataFlowCore(firstStatement As SyntaxNode, lastStatement As SyntaxNode) As DataFlowAnalysis 3381Protected NotOverridable Overrides Function AnalyzeDataFlowCore(statementOrExpression As SyntaxNode) As DataFlowAnalysis 3402Protected NotOverridable Overrides Function AnalyzeControlFlowCore(firstStatement As SyntaxNode, lastStatement As SyntaxNode) As ControlFlowAnalysis 3407Protected NotOverridable Overrides Function AnalyzeControlFlowCore(statement As SyntaxNode) As ControlFlowAnalysis 3411Private Shared Function SafeCastArgument(Of T As Class)(node As SyntaxNode, argName As String) As T 3422Protected NotOverridable Overrides Function GetConstantValueCore(node As SyntaxNode, Optional cancellationToken As CancellationToken = Nothing) As [Optional](Of Object) 3523Friend Overrides Sub ComputeDeclarationsInNode(node As SyntaxNode, associatedSymbol As ISymbol, getSymbol As Boolean, builder As ArrayBuilder(Of DeclarationInfo), cancellationToken As CancellationToken, Optional levelsToCompute As Integer? = Nothing) 3527Protected Overrides Function GetTopmostNodeForDiagnosticAnalysis(symbol As ISymbol, declaringSyntax As SyntaxNode) As SyntaxNode
Compilation\SpeculativeSemanticModelWithMemberModel.vb (2)
83Friend Overrides ReadOnly Property Root As SyntaxNode 289Friend Overrides Function Bind(binder As Binder, node As SyntaxNode, diagnostics As BindingDiagnosticBag) As BoundNode
Compilation\SpeculativeSyntaxTreeSemanticModel.vb (2)
63Friend Overrides ReadOnly Property Root As SyntaxNode 75Friend Overrides Function Bind(binder As Binder, node As SyntaxNode, diagnostics As BindingDiagnosticBag) As BoundNode
Compilation\SyntaxTreeSemanticModel.vb (2)
56Friend Overrides ReadOnly Property Root As SyntaxNode 172Friend Function GetMemberSemanticModel(node As SyntaxNode) As MemberSemanticModel
Compilation\VisualBasicCompilation.vb (4)
1265Friend Overrides Function CompareSourceLocations(first As SyntaxNode, second As SyntaxNode) As Integer 2322Dim getKind As Func(Of SyntaxNode, SyntaxKind) = Function(node As SyntaxNode) node.Kind
Declarations\DeclarationTreeBuilder.vb (1)
40Private Function ForDeclaration(node As SyntaxNode) As SingleNamespaceOrTypeDeclaration
Emit\EditAndContinue\VisualBasicLambdaSyntaxFacts.vb (6)
16Public Overrides Function GetLambda(lambdaOrLambdaBodySyntax As SyntaxNode) As SyntaxNode 20Public Overrides Function TryGetCorrespondingLambdaBody(previousLambdaSyntax As SyntaxNode, lambdaOrLambdaBodySyntax As SyntaxNode) As SyntaxNode 24Public Overrides Function GetDeclaratorPosition(node As SyntaxNode) As Integer
Emit\NoPia\EmbeddedEvent.vb (3)
37Protected Overrides Function [GetType](moduleBuilder As PEModuleBuilder, syntaxNodeOpt As SyntaxNode, diagnostics As DiagnosticBag) As Cci.ITypeReference 59Protected Overrides Sub EmbedCorrespondingComEventInterfaceMethodInternal(syntaxNodeOpt As SyntaxNode, diagnostics As DiagnosticBag, isUsedForComAwareEventBinding As Boolean) 110Private Function EmbedMatchingInterfaceMethods(sourceInterface As NamedTypeSymbol, syntaxNodeOpt As SyntaxNode, diagnostics As DiagnosticBag) As Boolean
Emit\NoPia\EmbeddedType.vb (5)
33Public Sub EmbedAllMembersOfImplementedInterface(syntaxNodeOpt As SyntaxNode, diagnostics As DiagnosticBag) 69Protected Overrides Function GetBaseClass(moduleBuilder As PEModuleBuilder, syntaxNodeOpt As SyntaxNode, diagnostics As DiagnosticBag) As Cci.ITypeReference 194Protected Overrides Function CreateTypeIdentifierAttribute(hasGuid As Boolean, syntaxNodeOpt As SyntaxNode, diagnostics As DiagnosticBag) As VisualBasicAttributeData 229Protected Overrides Sub ReportMissingAttribute(description As AttributeDescription, syntaxNodeOpt As SyntaxNode, diagnostics As DiagnosticBag) 233Protected Overrides Sub EmbedDefaultMembers(defaultMember As String, syntaxNodeOpt As SyntaxNode, diagnostics As DiagnosticBag)
Emit\NoPia\EmbeddedTypesManager.vb (17)
26Inherits Microsoft.CodeAnalysis.Emit.NoPia.EmbeddedTypesManager(Of PEModuleBuilder, ModuleCompilationState, EmbeddedTypesManager, SyntaxNode, VisualBasicAttributeData, 44Public Function GetSystemStringType(syntaxNodeOpt As SyntaxNode, diagnostics As DiagnosticBag) As NamedTypeSymbol 63Public Function GetWellKnownMethod(method As WellKnownMember, syntaxNodeOpt As SyntaxNode, diagnostics As DiagnosticBag) As MethodSymbol 67Private Function LazyGetWellKnownTypeMethod(ByRef lazyMethod As MethodSymbol, method As WellKnownMember, syntaxNodeOpt As SyntaxNode, diagnostics As DiagnosticBag) As MethodSymbol 88Friend Overrides Function CreateSynthesizedAttribute(constructor As WellKnownMember, constructorArguments As ImmutableArray(Of TypedConstant), namedArguments As ImmutableArray(Of KeyValuePair(Of String, TypedConstant)), syntaxNodeOpt As SyntaxNode, diagnostics As DiagnosticBag) As VisualBasicAttributeData 118Friend Overrides Function TryGetAttributeArguments(attrData As VisualBasicAttributeData, ByRef constructorArguments As ImmutableArray(Of TypedConstant), ByRef namedArguments As ImmutableArray(Of KeyValuePair(Of String, TypedConstant)), syntaxNodeOpt As SyntaxNode, diagnostics As DiagnosticBag) As Boolean 203syntaxNodeOpt As SyntaxNode, 277Private Shared Sub ReportNotEmbeddableSymbol(id As ERRID, symbol As Symbol, syntaxNodeOpt As SyntaxNode, diagnostics As DiagnosticBag, typeManagerOpt As EmbeddedTypesManager) 286Friend Shared Sub ReportDiagnostic(diagnostics As DiagnosticBag, id As ERRID, syntaxNodeOpt As SyntaxNode, ParamArray args As Object()) 290Private Shared Sub ReportDiagnostic(diagnostics As DiagnosticBag, syntaxNodeOpt As SyntaxNode, info As DiagnosticInfo) 294Friend Function EmbedTypeIfNeedTo(namedType As NamedTypeSymbol, fromImplements As Boolean, syntaxNodeOpt As SyntaxNode, diagnostics As DiagnosticBag) As Cci.INamedTypeReference 305Private Function EmbedType(namedType As NamedTypeSymbol, fromImplements As Boolean, syntaxNodeOpt As SyntaxNode, diagnostics As DiagnosticBag) As EmbeddedType 361syntaxNodeOpt As SyntaxNode, 396syntaxNodeOpt As SyntaxNode, 446syntaxNodeOpt As SyntaxNode, 479syntaxNodeOpt As SyntaxNode, 517Protected Overrides Function GetEmbeddedTypeForMember(member As SymbolAdapter, syntaxNodeOpt As SyntaxNode, diagnostics As DiagnosticBag) As EmbeddedType
Emit\PEModuleBuilder.vb (4)
19Inherits PEModuleBuilder(Of VisualBasicCompilation, SourceModuleSymbol, AssemblySymbol, TypeSymbol, NamedTypeSymbol, MethodSymbol, SyntaxNode, NoPia.EmbeddedTypesManager, ModuleCompilationState) 592Friend NotOverridable Overrides Function GetSpecialType(specialType As SpecialType, syntaxNodeOpt As SyntaxNode, diagnostics As DiagnosticBag) As Cci.INamedTypeReference 599Private Function GetUntranslatedSpecialType(specialType As SpecialType, syntaxNodeOpt As SyntaxNode, diagnostics As DiagnosticBag) As NamedTypeSymbol 756Protected NotOverridable Overrides Function CreatePrivateImplementationDetailsStaticConstructor(syntaxOpt As SyntaxNode, diagnostics As DiagnosticBag) As Cci.IMethodDefinition
Emit\SymbolTranslator.vb (5)
112syntaxNodeOpt As SyntaxNode, 211Private Sub CheckTupleUnderlyingType(namedTypeSymbol As NamedTypeSymbol, syntaxNodeOpt As SyntaxNode, diagnostics As DiagnosticBag) 248syntaxNodeOpt As SyntaxNode, 267syntaxNodeOpt As SyntaxNode, 308syntaxNodeOpt As SyntaxNode,
Errors\MessageProvider.vb (7)
482Protected Overrides Sub ReportInvalidAttributeArgument(diagnostics As DiagnosticBag, attributeSyntax As SyntaxNode, parameterIndex As Integer, attribute As AttributeData) 487Protected Overrides Sub ReportInvalidNamedArgument(diagnostics As DiagnosticBag, attributeSyntax As SyntaxNode, namedArgumentIndex As Integer, attributeClass As ITypeSymbol, parameterName As String) 492Protected Overrides Sub ReportParameterNotValidForType(diagnostics As DiagnosticBag, attributeSyntax As SyntaxNode, namedArgumentIndex As Integer) 497Protected Overrides Sub ReportMarshalUnmanagedTypeNotValidForFields(diagnostics As DiagnosticBag, attributeSyntax As SyntaxNode, parameterIndex As Integer, unmanagedTypeName As String, attribute As AttributeData) 502Protected Overrides Sub ReportMarshalUnmanagedTypeOnlyValidForFields(diagnostics As DiagnosticBag, attributeSyntax As SyntaxNode, parameterIndex As Integer, unmanagedTypeName As String, attribute As AttributeData) 507Protected Overrides Sub ReportAttributeParameterRequired(diagnostics As DiagnosticBag, attributeSyntax As SyntaxNode, parameterName As String) 512Protected Overrides Sub ReportAttributeParameterRequired(diagnostics As DiagnosticBag, attributeSyntax As SyntaxNode, parameterName1 As String, parameterName2 As String)
Generated\BoundNodes.xml.Generated.vb (250)
216Protected Sub New(kind As BoundKind, syntax as SyntaxNode, type As TypeSymbol, hasErrors As Boolean) 221Protected Sub New(kind As BoundKind, syntax as SyntaxNode, type As TypeSymbol) 238Public Sub New(syntax As SyntaxNode, arguments As ImmutableArray(Of TypeSymbol), hasErrors As Boolean) 246Public Sub New(syntax As SyntaxNode, arguments As ImmutableArray(Of TypeSymbol)) 280Public Sub New(syntax As SyntaxNode, type As TypeSymbol, hasErrors As Boolean) 284Public Sub New(syntax As SyntaxNode, type As TypeSymbol) 307Protected Sub New(kind As BoundKind, syntax as SyntaxNode, type As TypeSymbol, hasErrors As Boolean) 314Protected Sub New(kind As BoundKind, syntax as SyntaxNode, type As TypeSymbol) 326Public Sub New(syntax As SyntaxNode, underlyingLValue As BoundExpression, type As TypeSymbol, Optional hasErrors As Boolean = False) 366Protected Sub New(kind As BoundKind, syntax as SyntaxNode, type As TypeSymbol, hasErrors As Boolean) 373Protected Sub New(kind As BoundKind, syntax as SyntaxNode, type As TypeSymbol) 385Protected Sub New(kind As BoundKind, syntax as SyntaxNode, type As TypeSymbol, hasErrors As Boolean) 392Protected Sub New(kind As BoundKind, syntax as SyntaxNode, type As TypeSymbol) 404Public Sub New(syntax As SyntaxNode, type As TypeSymbol, hasErrors As Boolean) 411Public Sub New(syntax As SyntaxNode, type As TypeSymbol) 437Public Sub New(syntax As SyntaxNode, type As TypeSymbol, hasErrors As Boolean) 444Public Sub New(syntax As SyntaxNode, type As TypeSymbol) 470Public Sub New(syntax As SyntaxNode, type As TypeSymbol, hasErrors As Boolean) 482Public Sub New(syntax As SyntaxNode, type As TypeSymbol) 510Public Sub New(syntax As SyntaxNode, type As TypeSymbol, hasErrors As Boolean) 522Public Sub New(syntax As SyntaxNode, type As TypeSymbol) 550Public Sub New(syntax As SyntaxNode, isReference As Boolean, type As TypeSymbol, hasErrors As Boolean) 555Public Sub New(syntax As SyntaxNode, isReference As Boolean, type As TypeSymbol) 586Public Sub New(syntax As SyntaxNode, resultKind As LookupResultKind, symbols As ImmutableArray(Of Symbol), childBoundNodes As ImmutableArray(Of BoundExpression), type As TypeSymbol, Optional hasErrors As Boolean = False) 642Public Sub New(syntax As SyntaxNode, childBoundNodes As ImmutableArray(Of BoundNode), Optional hasErrors As Boolean = False) 676Public Sub New(syntax As SyntaxNode, expression As BoundExpression, type As TypeSymbol, Optional hasErrors As Boolean = False) 715Public Sub New(syntax As SyntaxNode, expression As BoundExpression, isLValue As Boolean, type As TypeSymbol, Optional hasErrors As Boolean = False) 757Public Sub New(syntax As SyntaxNode, expression As BoundExpression, indices As ImmutableArray(Of BoundExpression), isLValue As Boolean, type As TypeSymbol, Optional hasErrors As Boolean = False) 814Public Sub New(syntax As SyntaxNode, expression As BoundExpression, type As TypeSymbol, Optional hasErrors As Boolean = False) 849Public Sub New(syntax As SyntaxNode, sourceType As BoundTypeExpression, getTypeFromHandle As MethodSymbol, type As TypeSymbol, Optional hasErrors As Boolean = False) 892Public Sub New(syntax As SyntaxNode, field As FieldSymbol, type As TypeSymbol, hasErrors As Boolean) 901Public Sub New(syntax As SyntaxNode, field As FieldSymbol, type As TypeSymbol) 936Public Sub New(syntax As SyntaxNode, method As MethodSymbol, getMethodFromHandle As MethodSymbol, type As TypeSymbol, hasErrors As Boolean) 947Public Sub New(syntax As SyntaxNode, method As MethodSymbol, getMethodFromHandle As MethodSymbol, type As TypeSymbol) 991Public Sub New(syntax As SyntaxNode, unevaluatedReceiverOpt As BoundExpression, aliasOpt As AliasSymbol, type As TypeSymbol, Optional hasErrors As Boolean = False) 1033Public Sub New(syntax As SyntaxNode, data As BoundTypeOrValueData, type As TypeSymbol, hasErrors As Boolean) 1041Public Sub New(syntax As SyntaxNode, data As BoundTypeOrValueData, type As TypeSymbol) 1075Public Sub New(syntax As SyntaxNode, unevaluatedReceiverOpt As BoundExpression, aliasOpt As AliasSymbol, namespaceSymbol As NamespaceSymbol, Optional hasErrors As Boolean = False) 1130Public Sub New(syntax As SyntaxNode, method As MethodSymbol, type As TypeSymbol, hasErrors As Boolean) 1139Public Sub New(syntax As SyntaxNode, method As MethodSymbol, type As TypeSymbol) 1174Public Sub New(syntax As SyntaxNode, type As TypeSymbol, hasErrors As Boolean) 1181Public Sub New(syntax As SyntaxNode, type As TypeSymbol) 1207Public Sub New(syntax As SyntaxNode, analysisKind As Integer, isLValue As Boolean, type As TypeSymbol, hasErrors As Boolean) 1216Public Sub New(syntax As SyntaxNode, analysisKind As Integer, isLValue As Boolean, type As TypeSymbol) 1258Public Sub New(syntax As SyntaxNode, isLValue As Boolean, type As TypeSymbol, hasErrors As Boolean) 1266Public Sub New(syntax As SyntaxNode, isLValue As Boolean, type As TypeSymbol) 1300Public Sub New(syntax As SyntaxNode, type As TypeSymbol, hasErrors As Boolean) 1307Public Sub New(syntax As SyntaxNode, type As TypeSymbol) 1333Public Sub New(syntax As SyntaxNode, document As Cci.DebugSourceDocument, type As TypeSymbol, hasErrors As Boolean) 1342Public Sub New(syntax As SyntaxNode, document As Cci.DebugSourceDocument, type As TypeSymbol) 1377Public Sub New(syntax As SyntaxNode, operatorKind As UnaryOperatorKind, operand As BoundExpression, checked As Boolean, constantValueOpt As ConstantValue, type As TypeSymbol, Optional hasErrors As Boolean = False) 1441Public Sub New(syntax As SyntaxNode, operatorKind As UnaryOperatorKind, underlyingExpression As BoundExpression, type As TypeSymbol, Optional hasErrors As Boolean = False) 1489Public Sub New(syntax As SyntaxNode, operand As BoundExpression, type As TypeSymbol, Optional hasErrors As Boolean = False) 1529Public Sub New(syntax As SyntaxNode, operatorKind As BinaryOperatorKind, left As BoundExpression, right As BoundExpression, checked As Boolean, constantValueOpt As ConstantValue, type As TypeSymbol, Optional hasErrors As Boolean = False) 1602Public Sub New(syntax As SyntaxNode, operatorKind As BinaryOperatorKind, underlyingExpression As BoundExpression, checked As Boolean, type As TypeSymbol, Optional hasErrors As Boolean = False) 1658Public Sub New(syntax As SyntaxNode, leftOperand As BoundExpression, leftOperandPlaceholder As BoundRValuePlaceholder, leftTest As BoundExpression, bitwiseOperator As BoundUserDefinedBinaryOperator, type As TypeSymbol, Optional hasErrors As Boolean = False) 1722Public Sub New(syntax As SyntaxNode, type As TypeSymbol, hasErrors As Boolean) 1729Public Sub New(syntax As SyntaxNode, type As TypeSymbol) 1755Public Sub New(syntax As SyntaxNode, left As BoundExpression, leftOnTheRightOpt As BoundCompoundAssignmentTargetPlaceholder, right As BoundExpression, suppressObjectClone As Boolean, type As TypeSymbol, Optional hasErrors As Boolean = False) 1820Public Sub New(syntax As SyntaxNode, byRefLocal As BoundLocal, lValue As BoundExpression, isLValue As Boolean, type As TypeSymbol, Optional hasErrors As Boolean = False) 1876Public Sub New(syntax As SyntaxNode, binder As Binder, withDependencies As Boolean, methodGroup As BoundMethodGroup, Optional hasErrors As Boolean = False) 1927Public Sub New(syntax As SyntaxNode, condition As BoundExpression, whenTrue As BoundExpression, whenFalse As BoundExpression, constantValueOpt As ConstantValue, type As TypeSymbol, Optional hasErrors As Boolean = False) 1993Public Sub New(syntax As SyntaxNode, testExpression As BoundExpression, convertedTestExpression As BoundExpression, testExpressionPlaceholder As BoundRValuePlaceholder, elseExpression As BoundExpression, constantValueOpt As ConstantValue, type As TypeSymbol, Optional hasErrors As Boolean = False) 2066Protected Sub New(kind As BoundKind, syntax as SyntaxNode, type As TypeSymbol, hasErrors As Boolean) 2073Protected Sub New(kind As BoundKind, syntax as SyntaxNode, type As TypeSymbol) 2085Public Sub New(syntax As SyntaxNode, operand As BoundExpression, conversionKind As ConversionKind, checked As Boolean, explicitCastInCode As Boolean, constantValueOpt As ConstantValue, extendedInfoOpt As BoundExtendedConversionInfo, type As TypeSymbol, Optional hasErrors As Boolean = False) 2165Protected Sub New(kind As BoundKind, syntax as SyntaxNode, hasErrors As Boolean) 2169Protected Sub New(kind As BoundKind, syntax as SyntaxNode) 2178Public Sub New(syntax As SyntaxNode, lambda As BoundLambda, receiverPlaceholderOpt As BoundRValuePlaceholder, Optional hasErrors As Boolean = False) 2220Public Sub New(syntax As SyntaxNode, elementPlaceholders As ImmutableArray(Of BoundRValuePlaceholder), convertedElements As ImmutableArray(Of BoundExpression), Optional hasErrors As Boolean = False) 2268Public Sub New(syntax As SyntaxNode, underlyingExpression As BoundExpression, inOutConversionFlags As Byte, type As TypeSymbol, Optional hasErrors As Boolean = False) 2316Public Sub New(syntax As SyntaxNode, operand As BoundExpression, conversionKind As ConversionKind, suppressVirtualCalls As Boolean, constantValueOpt As ConstantValue, relaxationLambdaOpt As BoundLambda, type As TypeSymbol, Optional hasErrors As Boolean = False) 2388Public Sub New(syntax As SyntaxNode, operand As BoundExpression, conversionKind As ConversionKind, constantValueOpt As ConstantValue, relaxationLambdaOpt As BoundLambda, type As TypeSymbol, Optional hasErrors As Boolean = False) 2452Public Sub New(syntax As SyntaxNode, operand As BoundExpression, isTypeOfIsNotExpression As Boolean, targetType As TypeSymbol, type As TypeSymbol, Optional hasErrors As Boolean = False) 2504Protected Sub New(kind As BoundKind, syntax as SyntaxNode, hasErrors As Boolean) 2508Protected Sub New(kind As BoundKind, syntax as SyntaxNode) 2517Public Sub New(syntax As SyntaxNode, statementOpt As BoundStatement, Optional hasErrors As Boolean = False) 2548Public Sub New(syntax As SyntaxNode, expression As BoundExpression, type As TypeSymbol, Optional hasErrors As Boolean = False) 2582Public Sub New(syntax As SyntaxNode, statementOpt As BoundStatement, span As TextSpan, Optional hasErrors As Boolean = False) 2621Public Sub New(syntax As SyntaxNode, flavor As NoOpStatementFlavor, hasErrors As Boolean) 2626Public Sub New(syntax As SyntaxNode, flavor As NoOpStatementFlavor) 2657Protected Sub New(kind As BoundKind, syntax as SyntaxNode, receiverOpt As BoundExpression, qualificationKind As QualificationKind, Optional hasErrors As Boolean = False) 2682Public Sub New(syntax As SyntaxNode, typeArgumentsOpt As BoundTypeArguments, methods As ImmutableArray(Of MethodSymbol), pendingExtensionMethodsOpt As ExtensionMethodGroup, resultKind As LookupResultKind, receiverOpt As BoundExpression, qualificationKind As QualificationKind, Optional hasErrors As Boolean = False) 2740Public Sub New(syntax As SyntaxNode, properties As ImmutableArray(Of PropertySymbol), resultKind As LookupResultKind, receiverOpt As BoundExpression, qualificationKind As QualificationKind, Optional hasErrors As Boolean = False) 2782Public Sub New(syntax As SyntaxNode, expressionOpt As BoundExpression, functionLocalOpt As LocalSymbol, exitLabelOpt As LabelSymbol, Optional hasErrors As Boolean = False) 2834Public Sub New(syntax As SyntaxNode, expression As BoundExpression, Optional hasErrors As Boolean = False) 2873Public Sub New(syntax As SyntaxNode, expressionOpt As BoundExpression, Optional hasErrors As Boolean = False) 2904Public Sub New(syntax As SyntaxNode, clauses As ImmutableArray(Of BoundRedimClause), Optional hasErrors As Boolean = False) 2938Public Sub New(syntax As SyntaxNode, operand As BoundExpression, indices As ImmutableArray(Of BoundExpression), arrayTypeOpt As ArrayTypeSymbol, preserve As Boolean, Optional hasErrors As Boolean = False) 3002Public Sub New(syntax As SyntaxNode, clauses As ImmutableArray(Of BoundAssignmentOperator), Optional hasErrors As Boolean = False) 3036Public Sub New(syntax As SyntaxNode, method As MethodSymbol, methodGroupOpt As BoundMethodGroup, receiverOpt As BoundExpression, arguments As ImmutableArray(Of BoundExpression), defaultArguments As BitVector, constantValueOpt As ConstantValue, isLValue As Boolean, suppressObjectClone As Boolean, type As TypeSymbol, Optional hasErrors As Boolean = False) 3133Public Sub New(syntax As SyntaxNode, constructor As MethodSymbol, constructorArguments As ImmutableArray(Of BoundExpression), constructorDefaultArguments As BitVector, namedArguments As ImmutableArray(Of BoundExpression), resultKind As LookupResultKind, type As TypeSymbol, Optional hasErrors As Boolean = False) 3201Public Sub New(syntax As SyntaxNode, nameOpt As String, containerTypeOpt As TypeSymbol, receiverOpt As BoundExpression, typeArgumentsOpt As BoundTypeArguments, accessKind As LateBoundAccessKind, type As TypeSymbol, Optional hasErrors As Boolean = False) 3272Public Sub New(syntax As SyntaxNode, member As BoundExpression, argumentsOpt As ImmutableArray(Of BoundExpression), argumentNamesOpt As ImmutableArray(Of string), accessKind As LateBoundAccessKind, methodOrPropertyGroupOpt As BoundMethodOrPropertyGroup, type As TypeSymbol, Optional hasErrors As Boolean = False) 3344Public Sub New(syntax As SyntaxNode, binder As Binder, memberAccess As BoundLateMemberAccess, type As TypeSymbol, Optional hasErrors As Boolean = False) 3387Protected Sub New(kind As BoundKind, syntax as SyntaxNode, arguments As ImmutableArray(Of BoundExpression), type As TypeSymbol, Optional hasErrors As Boolean = False) 3407Public Sub New(syntax As SyntaxNode, inferredType As TupleTypeSymbol, argumentNamesOpt As ImmutableArray(Of String), inferredNamesOpt As ImmutableArray(Of Boolean), arguments As ImmutableArray(Of BoundExpression), type As TypeSymbol, Optional hasErrors As Boolean = False) 3457Public Sub New(syntax As SyntaxNode, naturalTypeOpt As TypeSymbol, arguments As ImmutableArray(Of BoundExpression), type As TypeSymbol, Optional hasErrors As Boolean = False) 3492Protected Sub New(kind As BoundKind, syntax as SyntaxNode, initializerOpt As BoundObjectInitializerExpressionBase, type As TypeSymbol, Optional hasErrors As Boolean = False) 3517Public Sub New(syntax As SyntaxNode, constructorOpt As MethodSymbol, methodGroupOpt As BoundMethodGroup, arguments As ImmutableArray(Of BoundExpression), defaultArguments As BitVector, initializerOpt As BoundObjectInitializerExpressionBase, type As TypeSymbol, Optional hasErrors As Boolean = False) 3581Public Sub New(syntax As SyntaxNode, guidString As string, initializerOpt As BoundObjectInitializerExpressionBase, type As TypeSymbol, Optional hasErrors As Boolean = False) 3615Public Sub New(syntax As SyntaxNode, binderOpt As Binder.AnonymousTypeCreationBinder, declarations As ImmutableArray(Of BoundAnonymousTypePropertyAccess), arguments As ImmutableArray(Of BoundExpression), type As TypeSymbol, Optional hasErrors As Boolean = False) 3666Public Sub New(syntax As SyntaxNode, binder As Binder.AnonymousTypeCreationBinder, propertyIndex As Integer, type As TypeSymbol, hasErrors As Boolean) 3675Public Sub New(syntax As SyntaxNode, binder As Binder.AnonymousTypeCreationBinder, propertyIndex As Integer, type As TypeSymbol) 3717Public Sub New(syntax As SyntaxNode, binder As Binder.AnonymousTypeFieldInitializerBinder, value As BoundExpression, type As TypeSymbol, Optional hasErrors As Boolean = False) 3760Protected Sub New(kind As BoundKind, syntax as SyntaxNode, placeholderOpt As BoundWithLValueExpressionPlaceholder, initializers As ImmutableArray(Of BoundExpression), type As TypeSymbol, Optional hasErrors As Boolean = False) 3788Public Sub New(syntax As SyntaxNode, createTemporaryLocalForInitialization As Boolean, placeholderOpt As BoundWithLValueExpressionPlaceholder, initializers As ImmutableArray(Of BoundExpression), type As TypeSymbol, Optional hasErrors As Boolean = False) 3827Public Sub New(syntax As SyntaxNode, placeholderOpt As BoundWithLValueExpressionPlaceholder, initializers As ImmutableArray(Of BoundExpression), type As TypeSymbol, Optional hasErrors As Boolean = False) 3858Public Sub New(syntax As SyntaxNode, initializerOpt As BoundObjectInitializerExpressionBase, type As TypeSymbol, Optional hasErrors As Boolean = False) 3889Public Sub New(syntax As SyntaxNode, receiverOpt As BoundExpression, method As MethodSymbol, relaxationLambdaOpt As BoundLambda, relaxationReceiverPlaceholderOpt As BoundRValuePlaceholder, methodGroupOpt As BoundMethodGroup, type As TypeSymbol, Optional hasErrors As Boolean = False) 3956Public Sub New(syntax As SyntaxNode, isParamArrayArgument As Boolean, bounds As ImmutableArray(Of BoundExpression), initializerOpt As BoundArrayInitialization, arrayLiteralOpt As BoundArrayLiteral, arrayLiteralConversion As ConversionKind, type As TypeSymbol, Optional hasErrors As Boolean = False) 4028Public Sub New(syntax As SyntaxNode, hasDominantType As Boolean, numberOfCandidates As Integer, inferredType As ArrayTypeSymbol, bounds As ImmutableArray(Of BoundExpression), initializer As BoundArrayInitialization, binder As Binder, Optional hasErrors As Boolean = False) 4105Public Sub New(syntax As SyntaxNode, initializers As ImmutableArray(Of BoundExpression), type As TypeSymbol, Optional hasErrors As Boolean = False) 4139Public Sub New(syntax As SyntaxNode, receiverOpt As BoundExpression, fieldSymbol As FieldSymbol, isLValue As Boolean, suppressVirtualCalls As Boolean, constantsInProgressOpt As ConstantFieldsInProgress, type As TypeSymbol, Optional hasErrors As Boolean = False) 4211Public Sub New(syntax As SyntaxNode, propertySymbol As PropertySymbol, propertyGroupOpt As BoundPropertyGroup, accessKind As PropertyAccessKind, isWriteable As Boolean, isLValue As Boolean, receiverOpt As BoundExpression, arguments As ImmutableArray(Of BoundExpression), defaultArguments As BitVector, type As TypeSymbol, Optional hasErrors As Boolean = False) 4308Public Sub New(syntax As SyntaxNode, receiverOpt As BoundExpression, eventSymbol As EventSymbol, type As TypeSymbol, Optional hasErrors As Boolean = False) 4351Public Sub New(syntax As SyntaxNode, statementListSyntax As SyntaxList(Of StatementSyntax), locals As ImmutableArray(Of LocalSymbol), statements As ImmutableArray(Of BoundStatement), Optional hasErrors As Boolean = False) 4402Public Sub New(syntax As SyntaxNode, fields As ImmutableArray(Of FieldSymbol), statement As BoundStatement, Optional hasErrors As Boolean = False) 4445Protected Sub New(kind As BoundKind, syntax as SyntaxNode, hasErrors As Boolean) 4449Protected Sub New(kind As BoundKind, syntax as SyntaxNode) 4458Public Sub New(syntax As SyntaxNode, localSymbol As LocalSymbol, declarationInitializerOpt As BoundExpression, identifierInitializerOpt As BoundArrayCreation, initializedByAsNew As Boolean, Optional hasErrors As Boolean = False) 4521Public Sub New(syntax As SyntaxNode, localDeclarations As ImmutableArray(Of BoundLocalDeclaration), initializer As BoundExpression, binder As Binder, Optional hasErrors As Boolean = False) 4573Public Sub New(syntax As SyntaxNode, localDeclarations As ImmutableArray(Of BoundLocalDeclarationBase), initializerOpt As BoundExpression, Optional hasErrors As Boolean = False) 4615Protected Sub New(kind As BoundKind, syntax as SyntaxNode, hasErrors As Boolean) 4619Protected Sub New(kind As BoundKind, syntax as SyntaxNode) 4623Public Sub New(syntax As SyntaxNode, hasErrors As Boolean) 4627Public Sub New(syntax As SyntaxNode) 4641Protected Sub New(kind As BoundKind, syntax as SyntaxNode, memberAccessExpressionOpt As BoundExpression, initialValue As BoundExpression, binderOpt As Binder, Optional hasErrors As Boolean = False) 4677Public Sub New(syntax As SyntaxNode, initializedFields As ImmutableArray(Of FieldSymbol), memberAccessExpressionOpt As BoundExpression, initialValue As BoundExpression, binderOpt As Binder, Optional hasErrors As Boolean = False) 4712Public Sub New(syntax As SyntaxNode, initializedProperties As ImmutableArray(Of PropertySymbol), memberAccessExpressionOpt As BoundExpression, initialValue As BoundExpression, binderOpt As Binder, Optional hasErrors As Boolean = False) 4747Public Sub New(syntax As SyntaxNode, parameter As ParameterSymbol, value As BoundExpression, Optional hasErrors As Boolean = False) 4790Public Sub New(syntax As SyntaxNode, statement As BoundStatement, Optional hasErrors As Boolean = False) 4824Public Sub New(syntax As SyntaxNode, locals As ImmutableArray(Of LocalSymbol), sideEffects As ImmutableArray(Of BoundExpression), valueOpt As BoundExpression, type As TypeSymbol, Optional hasErrors As Boolean = False) 4881Public Sub New(syntax As SyntaxNode, expression As BoundExpression, Optional hasErrors As Boolean = False) 4915Public Sub New(syntax As SyntaxNode, condition As BoundExpression, consequence As BoundStatement, alternativeOpt As BoundStatement, Optional hasErrors As Boolean = False) 4966Public Sub New(syntax As SyntaxNode, expressionStatement As BoundExpressionStatement, exprPlaceholderOpt As BoundRValuePlaceholder, caseBlocks As ImmutableArray(Of BoundCaseBlock), recommendSwitchTable As Boolean, exitLabel As LabelSymbol, Optional hasErrors As Boolean = False) 5034Public Sub New(syntax As SyntaxNode, caseStatement As BoundCaseStatement, body As BoundBlock, Optional hasErrors As Boolean = False) 5077Public Sub New(syntax As SyntaxNode, caseClauses As ImmutableArray(Of BoundCaseClause), conditionOpt As BoundExpression, Optional hasErrors As Boolean = False) 5119Protected Sub New(kind As BoundKind, syntax as SyntaxNode, hasErrors As Boolean) 5123Protected Sub New(kind As BoundKind, syntax as SyntaxNode) 5132Protected Sub New(kind As BoundKind, syntax as SyntaxNode, valueOpt As BoundExpression, conditionOpt As BoundExpression, Optional hasErrors As Boolean = False) 5157Public Sub New(syntax As SyntaxNode, valueOpt As BoundExpression, conditionOpt As BoundExpression, Optional hasErrors As Boolean = False) 5185Public Sub New(syntax As SyntaxNode, lowerBoundOpt As BoundExpression, upperBoundOpt As BoundExpression, lowerBoundConditionOpt As BoundExpression, upperBoundConditionOpt As BoundExpression, Optional hasErrors As Boolean = False) 5245Public Sub New(syntax As SyntaxNode, operatorKind As BinaryOperatorKind, valueOpt As BoundExpression, conditionOpt As BoundExpression, Optional hasErrors As Boolean = False) 5281Protected Sub New(kind As BoundKind, syntax as SyntaxNode, continueLabel As LabelSymbol, exitLabel As LabelSymbol, hasErrors As Boolean) 5291Protected Sub New(kind As BoundKind, syntax as SyntaxNode, continueLabel As LabelSymbol, exitLabel As LabelSymbol) 5320Public Sub New(syntax As SyntaxNode, topConditionOpt As BoundExpression, bottomConditionOpt As BoundExpression, topConditionIsUntil As Boolean, bottomConditionIsUntil As Boolean, body As BoundStatement, continueLabel As LabelSymbol, exitLabel As LabelSymbol, Optional hasErrors As Boolean = False) 5388Public Sub New(syntax As SyntaxNode, condition As BoundExpression, body As BoundStatement, continueLabel As LabelSymbol, exitLabel As LabelSymbol, Optional hasErrors As Boolean = False) 5433Protected Sub New(kind As BoundKind, syntax as SyntaxNode, declaredOrInferredLocalOpt As LocalSymbol, controlVariable As BoundExpression, body As BoundStatement, nextVariablesOpt As ImmutableArray(Of BoundExpression), continueLabel As LabelSymbol, exitLabel As LabelSymbol, Optional hasErrors As Boolean = False) 5480Public Sub New(syntax As SyntaxNode, leftOperandPlaceholder As BoundRValuePlaceholder, rightOperandPlaceholder As BoundRValuePlaceholder, addition As BoundUserDefinedBinaryOperator, subtraction As BoundUserDefinedBinaryOperator, lessThanOrEqual As BoundExpression, greaterThanOrEqual As BoundExpression, Optional hasErrors As Boolean = False) 5564Public Sub New(syntax As SyntaxNode, initialValue As BoundExpression, limitValue As BoundExpression, stepValue As BoundExpression, checked As Boolean, operatorsOpt As BoundForToUserDefinedOperators, declaredOrInferredLocalOpt As LocalSymbol, controlVariable As BoundExpression, body As BoundStatement, nextVariablesOpt As ImmutableArray(Of BoundExpression), continueLabel As LabelSymbol, exitLabel As LabelSymbol, Optional hasErrors As Boolean = False) 5636Public Sub New(syntax As SyntaxNode, collection As BoundExpression, enumeratorInfo As ForEachEnumeratorInfo, declaredOrInferredLocalOpt As LocalSymbol, controlVariable As BoundExpression, body As BoundStatement, nextVariablesOpt As ImmutableArray(Of BoundExpression), continueLabel As LabelSymbol, exitLabel As LabelSymbol, Optional hasErrors As Boolean = False) 5683Public Sub New(syntax As SyntaxNode, label As LabelSymbol, hasErrors As Boolean) 5691Public Sub New(syntax As SyntaxNode, label As LabelSymbol) 5725Public Sub New(syntax As SyntaxNode, label As LabelSymbol, hasErrors As Boolean) 5733Public Sub New(syntax As SyntaxNode, label As LabelSymbol) 5767Public Sub New(syntax As SyntaxNode, tryBlock As BoundBlock, catchBlocks As ImmutableArray(Of BoundCatchBlock), finallyBlockOpt As BoundBlock, exitLabelOpt As LabelSymbol, Optional hasErrors As Boolean = False) 5826Public Sub New(syntax As SyntaxNode, localOpt As LocalSymbol, exceptionSourceOpt As BoundExpression, errorLineNumberOpt As BoundExpression, exceptionFilterOpt As BoundExpression, body As BoundBlock, isSynthesizedAsyncCatchAll As Boolean, Optional hasErrors As Boolean = False) 5900Public Sub New(syntax As SyntaxNode, value As ConstantValue, type As TypeSymbol, hasErrors As Boolean) 5913Public Sub New(syntax As SyntaxNode, value As ConstantValue, type As TypeSymbol) 5949Public Sub New(syntax As SyntaxNode, type As TypeSymbol, hasErrors As Boolean) 5956Public Sub New(syntax As SyntaxNode, type As TypeSymbol) 5982Public Sub New(syntax As SyntaxNode, type As TypeSymbol, hasErrors As Boolean) 5994Public Sub New(syntax As SyntaxNode, type As TypeSymbol) 6022Public Sub New(syntax As SyntaxNode, type As TypeSymbol, hasErrors As Boolean) 6029Public Sub New(syntax As SyntaxNode, type As TypeSymbol) 6055Public Sub New(syntax As SyntaxNode, type As TypeSymbol, hasErrors As Boolean) 6062Public Sub New(syntax As SyntaxNode, type As TypeSymbol) 6088Public Sub New(syntax As SyntaxNode, sourceType As NamedTypeSymbol, type As TypeSymbol, hasErrors As Boolean) 6097Public Sub New(syntax As SyntaxNode, sourceType As NamedTypeSymbol, type As TypeSymbol) 6132Public Sub New(syntax As SyntaxNode, type As TypeSymbol, hasErrors As Boolean) 6139Public Sub New(syntax As SyntaxNode, type As TypeSymbol) 6165Public Sub New(syntax As SyntaxNode, localSymbol As LocalSymbol, isLValue As Boolean, type As TypeSymbol, hasErrors As Boolean) 6180Public Sub New(syntax As SyntaxNode, localSymbol As LocalSymbol, isLValue As Boolean, type As TypeSymbol) 6225Public Sub New(syntax As SyntaxNode, localSymbol As LocalSymbol, isLValue As Boolean, emitExpressions As PseudoVariableExpressions, type As TypeSymbol, hasErrors As Boolean) 6242Public Sub New(syntax As SyntaxNode, localSymbol As LocalSymbol, isLValue As Boolean, emitExpressions As PseudoVariableExpressions, type As TypeSymbol) 6296Public Sub New(syntax As SyntaxNode, parameterSymbol As ParameterSymbol, isLValue As Boolean, suppressVirtualCalls As Boolean, type As TypeSymbol, hasErrors As Boolean) 6307Public Sub New(syntax As SyntaxNode, parameterSymbol As ParameterSymbol, isLValue As Boolean, suppressVirtualCalls As Boolean, type As TypeSymbol) 6358Public Sub New(syntax As SyntaxNode, isOut As Boolean, type As TypeSymbol, hasErrors As Boolean) 6366Public Sub New(syntax As SyntaxNode, isOut As Boolean, type As TypeSymbol) 6400Public Sub New(syntax As SyntaxNode, originalArgument As BoundExpression, inConversion As BoundExpression, inPlaceholder As BoundByRefArgumentPlaceholder, outConversion As BoundExpression, outPlaceholder As BoundRValuePlaceholder, type As TypeSymbol, Optional hasErrors As Boolean = False) 6475Public Sub New(syntax As SyntaxNode, originalArgument As BoundExpression, localSymbol As SynthesizedLocal, type As TypeSymbol, Optional hasErrors As Boolean = False) 6523Public Sub New(syntax As SyntaxNode, label As LabelSymbol, hasErrors As Boolean) 6531Public Sub New(syntax As SyntaxNode, label As LabelSymbol) 6565Public Sub New(syntax As SyntaxNode, label As LabelSymbol, type As TypeSymbol, hasErrors As Boolean) 6573Public Sub New(syntax As SyntaxNode, label As LabelSymbol, type As TypeSymbol) 6607Public Sub New(syntax As SyntaxNode, label As LabelSymbol, labelExpressionOpt As BoundLabel, Optional hasErrors As Boolean = False) 6649Public Sub New(syntax As SyntaxNode, statements As ImmutableArray(Of BoundStatement), Optional hasErrors As Boolean = False) 6683Public Sub New(syntax As SyntaxNode, condition As BoundExpression, jumpIfTrue As Boolean, label As LabelSymbol, Optional hasErrors As Boolean = False) 6734Public Sub New(syntax As SyntaxNode, originalExpression As BoundExpression, body As BoundBlock, binder As WithBlockBinder, Optional hasErrors As Boolean = False) 6786Public Sub New(syntax As SyntaxNode, binder As Binder, flags As SourceMemberFlags, parameters As ImmutableArray(Of ParameterSymbol), returnType As TypeSymbol, bindingCache As UnboundLambda.UnboundLambdaBindingCache, hasErrors As Boolean) 6805Public Sub New(syntax As SyntaxNode, binder As Binder, flags As SourceMemberFlags, parameters As ImmutableArray(Of ParameterSymbol), returnType As TypeSymbol, bindingCache As UnboundLambda.UnboundLambdaBindingCache) 6875Public Sub New(syntax As SyntaxNode, lambdaSymbol As LambdaSymbol, body As BoundBlock, diagnostics As ReadOnlyBindingDiagnostic(Of AssemblySymbol), lambdaBinderOpt As LambdaBodyBinder, delegateRelaxation As ConversionKind, methodConversionKind As MethodConversionKind, Optional hasErrors As Boolean = False) 6955Public Sub New(syntax As SyntaxNode, lastOperator As BoundQueryClauseBase, type As TypeSymbol, Optional hasErrors As Boolean = False) 6990Protected Sub New(kind As BoundKind, syntax as SyntaxNode, type As TypeSymbol, hasErrors As Boolean) 6997Protected Sub New(kind As BoundKind, syntax as SyntaxNode, type As TypeSymbol) 7009Public Sub New(syntax As SyntaxNode, expression As BoundExpression, type As TypeSymbol, Optional hasErrors As Boolean = False) 7044Public Sub New(syntax As SyntaxNode, conversionCall As BoundCall, type As TypeSymbol, Optional hasErrors As Boolean = False) 7079Protected Sub New(kind As BoundKind, syntax as SyntaxNode, rangeVariables As ImmutableArray(Of RangeVariableSymbol), compoundVariableType As TypeSymbol, binders As ImmutableArray(Of Binder), type As TypeSymbol, hasErrors As Boolean) 7092Protected Sub New(kind As BoundKind, syntax as SyntaxNode, rangeVariables As ImmutableArray(Of RangeVariableSymbol), compoundVariableType As TypeSymbol, binders As ImmutableArray(Of Binder), type As TypeSymbol) 7131Public Sub New(syntax As SyntaxNode, source As BoundQueryPart, rangeVariableOpt As RangeVariableSymbol, rangeVariables As ImmutableArray(Of RangeVariableSymbol), compoundVariableType As TypeSymbol, binders As ImmutableArray(Of Binder), type As TypeSymbol, Optional hasErrors As Boolean = False) 7182Public Sub New(syntax As SyntaxNode, underlyingExpression As BoundExpression, rangeVariables As ImmutableArray(Of RangeVariableSymbol), compoundVariableType As TypeSymbol, binders As ImmutableArray(Of Binder), type As TypeSymbol, Optional hasErrors As Boolean = False) 7220Public Sub New(syntax As SyntaxNode, underlyingExpression As BoundExpression, type As TypeSymbol, Optional hasErrors As Boolean = False) 7255Public Sub New(syntax As SyntaxNode, lambdaSymbol As SynthesizedLambdaSymbol, rangeVariables As ImmutableArray(Of RangeVariableSymbol), expression As BoundExpression, exprIsOperandOfConditionalBranch As Boolean, Optional hasErrors As Boolean = False) 7315Public Sub New(syntax As SyntaxNode, rangeVariable As RangeVariableSymbol, value As BoundExpression, type As TypeSymbol, Optional hasErrors As Boolean = False) 7359Public Sub New(syntax As SyntaxNode, binder As Binder, parameters As ImmutableArray(Of ParameterSymbol), compilation As VisualBasicCompilation, hasErrors As Boolean) 7371Public Sub New(syntax As SyntaxNode, binder As Binder, parameters As ImmutableArray(Of ParameterSymbol), compilation As VisualBasicCompilation) 7423Public Sub New(syntax As SyntaxNode, capturedGroupOpt As BoundQueryClauseBase, groupPlaceholderOpt As BoundRValuePlaceholder, underlyingExpression As BoundExpression, rangeVariables As ImmutableArray(Of RangeVariableSymbol), compoundVariableType As TypeSymbol, binders As ImmutableArray(Of Binder), type As TypeSymbol, Optional hasErrors As Boolean = False) 7477Public Sub New(syntax As SyntaxNode, group As BoundExpression, type As TypeSymbol, Optional hasErrors As Boolean = False) 7512Public Sub New(syntax As SyntaxNode, rangeVariable As RangeVariableSymbol, type As TypeSymbol, hasErrors As Boolean) 7521Public Sub New(syntax As SyntaxNode, rangeVariable As RangeVariableSymbol, type As TypeSymbol) 7556Protected Sub New(kind As BoundKind, syntax as SyntaxNode, eventAccess As BoundExpression, handler As BoundExpression, Optional hasErrors As Boolean = False) 7585Public Sub New(syntax As SyntaxNode, eventAccess As BoundExpression, handler As BoundExpression, Optional hasErrors As Boolean = False) 7612Public Sub New(syntax As SyntaxNode, eventAccess As BoundExpression, handler As BoundExpression, Optional hasErrors As Boolean = False) 7639Public Sub New(syntax As SyntaxNode, eventSymbol As EventSymbol, eventInvocation As BoundExpression, Optional hasErrors As Boolean = False) 7682Public Sub New(syntax As SyntaxNode, resourceList As ImmutableArray(Of BoundLocalDeclarationBase), resourceExpressionOpt As BoundExpression, body As BoundBlock, usingInfo As UsingInfo, locals As ImmutableArray(Of LocalSymbol), Optional hasErrors As Boolean = False) 7750Public Sub New(syntax As SyntaxNode, lockExpression As BoundExpression, body As BoundBlock, Optional hasErrors As Boolean = False) 7793Public Sub New(syntax As SyntaxNode, xmlNamespace As BoundExpression, localName As BoundExpression, objectCreation As BoundExpression, type As TypeSymbol, Optional hasErrors As Boolean = False) 7846Public Sub New(syntax As SyntaxNode, xmlNamespace As BoundExpression, objectCreation As BoundExpression, type As TypeSymbol, Optional hasErrors As Boolean = False) 7890Public Sub New(syntax As SyntaxNode, declaration As BoundExpression, childNodes As ImmutableArray(Of BoundExpression), rewriterInfo As BoundXmlContainerRewriterInfo, type As TypeSymbol, Optional hasErrors As Boolean = False) 7943Public Sub New(syntax As SyntaxNode, version As BoundExpression, encoding As BoundExpression, standalone As BoundExpression, objectCreation As BoundExpression, type As TypeSymbol, Optional hasErrors As Boolean = False) 8002Public Sub New(syntax As SyntaxNode, target As BoundExpression, data As BoundExpression, objectCreation As BoundExpression, type As TypeSymbol, Optional hasErrors As Boolean = False) 8055Public Sub New(syntax As SyntaxNode, value As BoundExpression, objectCreation As BoundExpression, type As TypeSymbol, Optional hasErrors As Boolean = False) 8099Public Sub New(syntax As SyntaxNode, name As BoundExpression, value As BoundExpression, matchesImport As Boolean, objectCreation As BoundExpression, type As TypeSymbol, Optional hasErrors As Boolean = False) 8165Public Sub New(syntax As SyntaxNode, argument As BoundExpression, childNodes As ImmutableArray(Of BoundExpression), rewriterInfo As BoundXmlContainerRewriterInfo, type As TypeSymbol, Optional hasErrors As Boolean = False) 8218Public Sub New(syntax As SyntaxNode, memberAccess As BoundExpression, type As TypeSymbol, Optional hasErrors As Boolean = False) 8253Public Sub New(syntax As SyntaxNode, expression As BoundExpression, type As TypeSymbol, Optional hasErrors As Boolean = False) 8288Public Sub New(syntax As SyntaxNode, value As BoundLiteral, objectCreation As BoundExpression, type As TypeSymbol, Optional hasErrors As Boolean = False) 8332Public Sub New(syntax As SyntaxNode, resumeKind As ResumeStatementKind, labelOpt As LabelSymbol, labelExpressionOpt As BoundExpression, Optional hasErrors As Boolean = False) 8384Public Sub New(syntax As SyntaxNode, onErrorKind As OnErrorStatementKind, labelOpt As LabelSymbol, labelExpressionOpt As BoundExpression, Optional hasErrors As Boolean = False) 8436Public Sub New(syntax As SyntaxNode, containsOnError As Boolean, containsResume As Boolean, resumeWithoutLabelOpt As StatementSyntax, trackLineNumber As Boolean, body As BoundBlock, Optional hasErrors As Boolean = False) 8507Public Sub New(syntax As SyntaxNode, activeHandlerLocal As BoundLocal, resumeTargetLocal As BoundLocal, type As TypeSymbol, Optional hasErrors As Boolean = False) 8556Public Sub New(syntax As SyntaxNode, value As BoundExpression, jumps As ImmutableArray(Of BoundGotoStatement), Optional hasErrors As Boolean = False) 8604Public Sub New(syntax As SyntaxNode, resumeTargetTemporary As BoundLocal, resumeLabel As BoundLabelStatement, resumeNextLabel As BoundLabelStatement, jumps As ImmutableArray(Of BoundGotoStatement), Optional hasErrors As Boolean = False) 8670Public Sub New(syntax As SyntaxNode, operand As BoundExpression, awaitableInstancePlaceholder As BoundRValuePlaceholder, getAwaiter As BoundExpression, awaiterInstancePlaceholder As BoundLValuePlaceholder, isCompleted As BoundExpression, getResult As BoundExpression, type As TypeSymbol, Optional hasErrors As Boolean = False) 8755Public Sub New(syntax As SyntaxNode, locals As ImmutableArray(Of LocalSymbol), spillFields As ImmutableArray(Of FieldSymbol), statements As ImmutableArray(Of BoundStatement), valueOpt As BoundExpression, type As TypeSymbol, Optional hasErrors As Boolean = False) 8820Public Sub New(syntax As SyntaxNode, hasErrors As Boolean) 8824Public Sub New(syntax As SyntaxNode) 8838Public Sub New(syntax As SyntaxNode, hasErrors As Boolean) 8842Public Sub New(syntax As SyntaxNode) 8856Public Sub New(syntax As SyntaxNode, original As BoundExpression, start As BoundExpression, lengthOpt As BoundExpression, source As BoundExpression, type As TypeSymbol, Optional hasErrors As Boolean = False) 8922Public Sub New(syntax As SyntaxNode, receiver As BoundExpression, placeholder As BoundRValuePlaceholder, accessExpression As BoundExpression, type As TypeSymbol, Optional hasErrors As Boolean = False) 8974Public Sub New(syntax As SyntaxNode, placeholderId As Integer, capture As Boolean, type As TypeSymbol, hasErrors As Boolean) 8988Public Sub New(syntax As SyntaxNode, placeholderId As Integer, capture As Boolean, type As TypeSymbol) 9032Public Sub New(syntax As SyntaxNode, receiverOrCondition As BoundExpression, captureReceiver As Boolean, placeholderId As Integer, whenNotNull As BoundExpression, whenNullOpt As BoundExpression, type As TypeSymbol, Optional hasErrors As Boolean = False) 9105Public Sub New(syntax As SyntaxNode, valueTypeReceiver As BoundExpression, referenceTypeReceiver As BoundExpression, type As TypeSymbol, Optional hasErrors As Boolean = False) 9154Public Sub New(syntax As SyntaxNode, argument As BoundExpression, constantValueOpt As ConstantValue, type As TypeSymbol, Optional hasErrors As Boolean = False) 9202Public Sub New(syntax As SyntaxNode, expression As BoundTypeExpression, type As TypeSymbol, Optional hasErrors As Boolean = False) 9242Public Sub New(syntax As SyntaxNode, contents As ImmutableArray(Of BoundNode), constructionOpt As BoundExpression, type As TypeSymbol, Optional hasErrors As Boolean = False) 9290Public Sub New(syntax As SyntaxNode, expression As BoundExpression, alignmentOpt As BoundExpression, formatStringOpt As BoundLiteral, Optional hasErrors As Boolean = False)
Generated\Syntax.xml.Internal.Generated.vb (488)
132Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 212Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 352Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 506Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 620Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 745Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 840Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 939Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 1049Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 1156Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 1353Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 1452Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 1551Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 1650Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 1762Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 1897Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 1995Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 2206Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 2289Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 2372Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 2455Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 2584Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 2741Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 2875Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 3010Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 3125Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 3258Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 3332Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 3431Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 3591Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 3686Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 3781Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 3877Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 3987Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 4105Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 4333Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 4496Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 4655Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 4826Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 5048Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 5228Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 5386Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 5541Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 5680Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 5775Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 5874Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 5982Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 6056Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 6144Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 6255Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 6387Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 6530Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 6668Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 6835Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 6929Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 7055Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 7170Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 7310Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 7408Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 7525Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 7662Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 7836Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 7974Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 8093Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 8221Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 8331Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 8425Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 8503Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 8583Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 8689Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 8809Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 8930Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 9051Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 9170Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 9264Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 9357Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 9444Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 9519Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 9600Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 9693Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 9792Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 9920Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 10058Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 10194Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 10344Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 10456Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 10565Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 10677Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 10765Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 10884Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 11012Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 11098Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 11226Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 11350Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 11448Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 11536Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 11616Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 11735Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 11878Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 11999Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 12110Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 12230Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 12342Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 12445Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 12554Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 12627Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 12714Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 12830Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 12938Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 13044Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 13156Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 13258Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 13356Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 13449Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 13616Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 13696Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 13876Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 14008Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 14113Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 14229Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 14345Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 14462Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 14565Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 14669Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 14761Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 14869Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 14996Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 15104Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 15215Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 15322Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 15420Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 15531Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 15626Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 15742Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 15858Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 15976Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 16063Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 16183Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 16234Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 16285Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 16370Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 16498Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 16632Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 16763Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 16910Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 17058Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 17246Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 17353Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 17464Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 17603Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 17811Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 17870Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 17929Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 18026Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 18149Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 18249Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 18370Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 18549Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 18745Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 18835Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 18941Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 19056Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 19180Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 19267Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 19362Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 19462Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 19566Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 19690Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 19814Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 19918Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 20029Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 20191Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 20309Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 20397Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 20495Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 20626Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 20747Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 20827Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 20927Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 21030Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 21168Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 21442Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 21525Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 21618Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 21744Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 21854Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 21956Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 22098Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 22246Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 22378Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 22485Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 22581Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 22682Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 22800Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 22917Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 23029Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 23159Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 23249Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 23334Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 23432Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 23526Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 23626Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 23741Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 23856Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 23958Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 24083Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 24175Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 24262Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 24390Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 24455Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 24545Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 24643Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 24743Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 24877Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 24991Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 25094Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 25183Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 25273Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 25367Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 25459Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 26020Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 26103Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 26206Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 26339Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 26462Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 26583Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 26710Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 26828Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 26942Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 27075Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 27168Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 27341Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 27485Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 27588Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 27668Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 27756Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 27850Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 27973Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 28093Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 28223Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 28372Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 28481Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 28577Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode 28648Friend Overrides Function CreateRed(ByVal parent As SyntaxNode, ByVal startLocation As Integer) As SyntaxNode
Generated\Syntax.xml.Main.Generated.vb (245)
1484Inherits VisualBasicSyntaxVisitor(Of SyntaxNode) 1486Public Overrides Function VisitEmptyStatement(ByVal node As EmptyStatementSyntax) As SyntaxNode 1499Public Overrides Function VisitEndBlockStatement(ByVal node As EndBlockStatementSyntax) As SyntaxNode 1514Public Overrides Function VisitCompilationUnit(ByVal node As CompilationUnitSyntax) As SyntaxNode 1535Public Overrides Function VisitOptionStatement(ByVal node As OptionStatementSyntax) As SyntaxNode 1552Public Overrides Function VisitImportsStatement(ByVal node As ImportsStatementSyntax) As SyntaxNode 1567Public Overrides Function VisitSimpleImportsClause(ByVal node As SimpleImportsClauseSyntax) As SyntaxNode 1582Public Overrides Function VisitImportAliasClause(ByVal node As ImportAliasClauseSyntax) As SyntaxNode 1597Public Overrides Function VisitXmlNamespaceImportsClause(ByVal node As XmlNamespaceImportsClauseSyntax) As SyntaxNode 1614Public Overrides Function VisitNamespaceBlock(ByVal node As NamespaceBlockSyntax) As SyntaxNode 1631Public Overrides Function VisitNamespaceStatement(ByVal node As NamespaceStatementSyntax) As SyntaxNode 1646Public Overrides Function VisitModuleBlock(ByVal node As ModuleBlockSyntax) As SyntaxNode 1667Public Overrides Function VisitStructureBlock(ByVal node As StructureBlockSyntax) As SyntaxNode 1688Public Overrides Function VisitInterfaceBlock(ByVal node As InterfaceBlockSyntax) As SyntaxNode 1709Public Overrides Function VisitClassBlock(ByVal node As ClassBlockSyntax) As SyntaxNode 1730Public Overrides Function VisitEnumBlock(ByVal node As EnumBlockSyntax) As SyntaxNode 1747Public Overrides Function VisitInheritsStatement(ByVal node As InheritsStatementSyntax) As SyntaxNode 1762Public Overrides Function VisitImplementsStatement(ByVal node As ImplementsStatementSyntax) As SyntaxNode 1777Public Overrides Function VisitModuleStatement(ByVal node As ModuleStatementSyntax) As SyntaxNode 1798Public Overrides Function VisitStructureStatement(ByVal node As StructureStatementSyntax) As SyntaxNode 1819Public Overrides Function VisitInterfaceStatement(ByVal node As InterfaceStatementSyntax) As SyntaxNode 1840Public Overrides Function VisitClassStatement(ByVal node As ClassStatementSyntax) As SyntaxNode 1861Public Overrides Function VisitEnumStatement(ByVal node As EnumStatementSyntax) As SyntaxNode 1882Public Overrides Function VisitTypeParameterList(ByVal node As TypeParameterListSyntax) As SyntaxNode 1901Public Overrides Function VisitTypeParameter(ByVal node As TypeParameterSyntax) As SyntaxNode 1918Public Overrides Function VisitTypeParameterSingleConstraintClause(ByVal node As TypeParameterSingleConstraintClauseSyntax) As SyntaxNode 1933Public Overrides Function VisitTypeParameterMultipleConstraintClause(ByVal node As TypeParameterMultipleConstraintClauseSyntax) As SyntaxNode 1952Public Overrides Function VisitSpecialConstraint(ByVal node As SpecialConstraintSyntax) As SyntaxNode 1965Public Overrides Function VisitTypeConstraint(ByVal node As TypeConstraintSyntax) As SyntaxNode 1978Public Overrides Function VisitEnumMemberDeclaration(ByVal node As EnumMemberDeclarationSyntax) As SyntaxNode 1995Public Overrides Function VisitMethodBlock(ByVal node As MethodBlockSyntax) As SyntaxNode 2012Public Overrides Function VisitConstructorBlock(ByVal node As ConstructorBlockSyntax) As SyntaxNode 2029Public Overrides Function VisitOperatorBlock(ByVal node As OperatorBlockSyntax) As SyntaxNode 2046Public Overrides Function VisitAccessorBlock(ByVal node As AccessorBlockSyntax) As SyntaxNode 2063Public Overrides Function VisitPropertyBlock(ByVal node As PropertyBlockSyntax) As SyntaxNode 2080Public Overrides Function VisitEventBlock(ByVal node As EventBlockSyntax) As SyntaxNode 2097Public Overrides Function VisitParameterList(ByVal node As ParameterListSyntax) As SyntaxNode 2114Public Overrides Function VisitMethodStatement(ByVal node As MethodStatementSyntax) As SyntaxNode 2143Public Overrides Function VisitSubNewStatement(ByVal node As SubNewStatementSyntax) As SyntaxNode 2164Public Overrides Function VisitDeclareStatement(ByVal node As DeclareStatementSyntax) As SyntaxNode 2199Public Overrides Function VisitDelegateStatement(ByVal node As DelegateStatementSyntax) As SyntaxNode 2226Public Overrides Function VisitEventStatement(ByVal node As EventStatementSyntax) As SyntaxNode 2253Public Overrides Function VisitOperatorStatement(ByVal node As OperatorStatementSyntax) As SyntaxNode 2276Public Overrides Function VisitPropertyStatement(ByVal node As PropertyStatementSyntax) As SyntaxNode 2303Public Overrides Function VisitAccessorStatement(ByVal node As AccessorStatementSyntax) As SyntaxNode 2322Public Overrides Function VisitImplementsClause(ByVal node As ImplementsClauseSyntax) As SyntaxNode 2337Public Overrides Function VisitHandlesClause(ByVal node As HandlesClauseSyntax) As SyntaxNode 2352Public Overrides Function VisitKeywordEventContainer(ByVal node As KeywordEventContainerSyntax) As SyntaxNode 2365Public Overrides Function VisitWithEventsEventContainer(ByVal node As WithEventsEventContainerSyntax) As SyntaxNode 2378Public Overrides Function VisitWithEventsPropertyEventContainer(ByVal node As WithEventsPropertyEventContainerSyntax) As SyntaxNode 2395Public Overrides Function VisitHandlesClauseItem(ByVal node As HandlesClauseItemSyntax) As SyntaxNode 2412Public Overrides Function VisitIncompleteMember(ByVal node As IncompleteMemberSyntax) As SyntaxNode 2429Public Overrides Function VisitFieldDeclaration(ByVal node As FieldDeclarationSyntax) As SyntaxNode 2446Public Overrides Function VisitVariableDeclarator(ByVal node As VariableDeclaratorSyntax) As SyntaxNode 2463Public Overrides Function VisitSimpleAsClause(ByVal node As SimpleAsClauseSyntax) As SyntaxNode 2480Public Overrides Function VisitAsNewClause(ByVal node As AsNewClauseSyntax) As SyntaxNode 2495Public Overrides Function VisitObjectMemberInitializer(ByVal node As ObjectMemberInitializerSyntax) As SyntaxNode 2514Public Overrides Function VisitObjectCollectionInitializer(ByVal node As ObjectCollectionInitializerSyntax) As SyntaxNode 2529Public Overrides Function VisitInferredFieldInitializer(ByVal node As InferredFieldInitializerSyntax) As SyntaxNode 2544Public Overrides Function VisitNamedFieldInitializer(ByVal node As NamedFieldInitializerSyntax) As SyntaxNode 2565Public Overrides Function VisitEqualsValue(ByVal node As EqualsValueSyntax) As SyntaxNode 2580Public Overrides Function VisitParameter(ByVal node As ParameterSyntax) As SyntaxNode 2601Public Overrides Function VisitModifiedIdentifier(ByVal node As ModifiedIdentifierSyntax) As SyntaxNode 2620Public Overrides Function VisitArrayRankSpecifier(ByVal node As ArrayRankSpecifierSyntax) As SyntaxNode 2637Public Overrides Function VisitAttributeList(ByVal node As AttributeListSyntax) As SyntaxNode 2654Public Overrides Function VisitAttribute(ByVal node As AttributeSyntax) As SyntaxNode 2671Public Overrides Function VisitAttributeTarget(ByVal node As AttributeTargetSyntax) As SyntaxNode 2686Public Overrides Function VisitAttributesStatement(ByVal node As AttributesStatementSyntax) As SyntaxNode 2699Public Overrides Function VisitExpressionStatement(ByVal node As ExpressionStatementSyntax) As SyntaxNode 2712Public Overrides Function VisitPrintStatement(ByVal node As PrintStatementSyntax) As SyntaxNode 2727Public Overrides Function VisitWhileBlock(ByVal node As WhileBlockSyntax) As SyntaxNode 2744Public Overrides Function VisitUsingBlock(ByVal node As UsingBlockSyntax) As SyntaxNode 2761Public Overrides Function VisitSyncLockBlock(ByVal node As SyncLockBlockSyntax) As SyntaxNode 2778Public Overrides Function VisitWithBlock(ByVal node As WithBlockSyntax) As SyntaxNode 2795Public Overrides Function VisitLocalDeclarationStatement(ByVal node As LocalDeclarationStatementSyntax) As SyntaxNode 2810Public Overrides Function VisitLabelStatement(ByVal node As LabelStatementSyntax) As SyntaxNode 2825Public Overrides Function VisitGoToStatement(ByVal node As GoToStatementSyntax) As SyntaxNode 2840Public Overrides Function VisitLabel(ByVal node As LabelSyntax) As SyntaxNode 2853Public Overrides Function VisitStopOrEndStatement(ByVal node As StopOrEndStatementSyntax) As SyntaxNode 2866Public Overrides Function VisitExitStatement(ByVal node As ExitStatementSyntax) As SyntaxNode 2881Public Overrides Function VisitContinueStatement(ByVal node As ContinueStatementSyntax) As SyntaxNode 2896Public Overrides Function VisitReturnStatement(ByVal node As ReturnStatementSyntax) As SyntaxNode 2911Public Overrides Function VisitSingleLineIfStatement(ByVal node As SingleLineIfStatementSyntax) As SyntaxNode 2932Public Overrides Function VisitSingleLineElseClause(ByVal node As SingleLineElseClauseSyntax) As SyntaxNode 2947Public Overrides Function VisitMultiLineIfBlock(ByVal node As MultiLineIfBlockSyntax) As SyntaxNode 2968Public Overrides Function VisitIfStatement(ByVal node As IfStatementSyntax) As SyntaxNode 2985Public Overrides Function VisitElseIfBlock(ByVal node As ElseIfBlockSyntax) As SyntaxNode 3000Public Overrides Function VisitElseIfStatement(ByVal node As ElseIfStatementSyntax) As SyntaxNode 3017Public Overrides Function VisitElseBlock(ByVal node As ElseBlockSyntax) As SyntaxNode 3032Public Overrides Function VisitElseStatement(ByVal node As ElseStatementSyntax) As SyntaxNode 3045Public Overrides Function VisitTryBlock(ByVal node As TryBlockSyntax) As SyntaxNode 3066Public Overrides Function VisitTryStatement(ByVal node As TryStatementSyntax) As SyntaxNode 3079Public Overrides Function VisitCatchBlock(ByVal node As CatchBlockSyntax) As SyntaxNode 3094Public Overrides Function VisitCatchStatement(ByVal node As CatchStatementSyntax) As SyntaxNode 3113Public Overrides Function VisitCatchFilterClause(ByVal node As CatchFilterClauseSyntax) As SyntaxNode 3128Public Overrides Function VisitFinallyBlock(ByVal node As FinallyBlockSyntax) As SyntaxNode 3143Public Overrides Function VisitFinallyStatement(ByVal node As FinallyStatementSyntax) As SyntaxNode 3156Public Overrides Function VisitErrorStatement(ByVal node As ErrorStatementSyntax) As SyntaxNode 3171Public Overrides Function VisitOnErrorGoToStatement(ByVal node As OnErrorGoToStatementSyntax) As SyntaxNode 3192Public Overrides Function VisitOnErrorResumeNextStatement(ByVal node As OnErrorResumeNextStatementSyntax) As SyntaxNode 3211Public Overrides Function VisitResumeStatement(ByVal node As ResumeStatementSyntax) As SyntaxNode 3226Public Overrides Function VisitSelectBlock(ByVal node As SelectBlockSyntax) As SyntaxNode 3243Public Overrides Function VisitSelectStatement(ByVal node As SelectStatementSyntax) As SyntaxNode 3260Public Overrides Function VisitCaseBlock(ByVal node As CaseBlockSyntax) As SyntaxNode 3275Public Overrides Function VisitCaseStatement(ByVal node As CaseStatementSyntax) As SyntaxNode 3290Public Overrides Function VisitElseCaseClause(ByVal node As ElseCaseClauseSyntax) As SyntaxNode 3303Public Overrides Function VisitSimpleCaseClause(ByVal node As SimpleCaseClauseSyntax) As SyntaxNode 3316Public Overrides Function VisitRangeCaseClause(ByVal node As RangeCaseClauseSyntax) As SyntaxNode 3333Public Overrides Function VisitRelationalCaseClause(ByVal node As RelationalCaseClauseSyntax) As SyntaxNode 3350Public Overrides Function VisitSyncLockStatement(ByVal node As SyncLockStatementSyntax) As SyntaxNode 3365Public Overrides Function VisitDoLoopBlock(ByVal node As DoLoopBlockSyntax) As SyntaxNode 3382Public Overrides Function VisitDoStatement(ByVal node As DoStatementSyntax) As SyntaxNode 3397Public Overrides Function VisitLoopStatement(ByVal node As LoopStatementSyntax) As SyntaxNode 3412Public Overrides Function VisitWhileOrUntilClause(ByVal node As WhileOrUntilClauseSyntax) As SyntaxNode 3427Public Overrides Function VisitWhileStatement(ByVal node As WhileStatementSyntax) As SyntaxNode 3442Public Overrides Function VisitForBlock(ByVal node As ForBlockSyntax) As SyntaxNode 3459Public Overrides Function VisitForEachBlock(ByVal node As ForEachBlockSyntax) As SyntaxNode 3476Public Overrides Function VisitForStatement(ByVal node As ForStatementSyntax) As SyntaxNode 3501Public Overrides Function VisitForStepClause(ByVal node As ForStepClauseSyntax) As SyntaxNode 3516Public Overrides Function VisitForEachStatement(ByVal node As ForEachStatementSyntax) As SyntaxNode 3537Public Overrides Function VisitNextStatement(ByVal node As NextStatementSyntax) As SyntaxNode 3552Public Overrides Function VisitUsingStatement(ByVal node As UsingStatementSyntax) As SyntaxNode 3569Public Overrides Function VisitThrowStatement(ByVal node As ThrowStatementSyntax) As SyntaxNode 3584Public Overrides Function VisitAssignmentStatement(ByVal node As AssignmentStatementSyntax) As SyntaxNode 3601Public Overrides Function VisitMidExpression(ByVal node As MidExpressionSyntax) As SyntaxNode 3616Public Overrides Function VisitCallStatement(ByVal node As CallStatementSyntax) As SyntaxNode 3631Public Overrides Function VisitAddRemoveHandlerStatement(ByVal node As AddRemoveHandlerStatementSyntax) As SyntaxNode 3650Public Overrides Function VisitRaiseEventStatement(ByVal node As RaiseEventStatementSyntax) As SyntaxNode 3667Public Overrides Function VisitWithStatement(ByVal node As WithStatementSyntax) As SyntaxNode 3682Public Overrides Function VisitReDimStatement(ByVal node As ReDimStatementSyntax) As SyntaxNode 3699Public Overrides Function VisitRedimClause(ByVal node As RedimClauseSyntax) As SyntaxNode 3714Public Overrides Function VisitEraseStatement(ByVal node As EraseStatementSyntax) As SyntaxNode 3729Public Overrides Function VisitLiteralExpression(ByVal node As LiteralExpressionSyntax) As SyntaxNode 3742Public Overrides Function VisitParenthesizedExpression(ByVal node As ParenthesizedExpressionSyntax) As SyntaxNode 3759Public Overrides Function VisitTupleExpression(ByVal node As TupleExpressionSyntax) As SyntaxNode 3776Public Overrides Function VisitTupleType(ByVal node As TupleTypeSyntax) As SyntaxNode 3793Public Overrides Function VisitTypedTupleElement(ByVal node As TypedTupleElementSyntax) As SyntaxNode 3806Public Overrides Function VisitNamedTupleElement(ByVal node As NamedTupleElementSyntax) As SyntaxNode 3821Public Overrides Function VisitMeExpression(ByVal node As MeExpressionSyntax) As SyntaxNode 3834Public Overrides Function VisitMyBaseExpression(ByVal node As MyBaseExpressionSyntax) As SyntaxNode 3847Public Overrides Function VisitMyClassExpression(ByVal node As MyClassExpressionSyntax) As SyntaxNode 3860Public Overrides Function VisitGetTypeExpression(ByVal node As GetTypeExpressionSyntax) As SyntaxNode 3879Public Overrides Function VisitTypeOfExpression(ByVal node As TypeOfExpressionSyntax) As SyntaxNode 3898Public Overrides Function VisitGetXmlNamespaceExpression(ByVal node As GetXmlNamespaceExpressionSyntax) As SyntaxNode 3917Public Overrides Function VisitMemberAccessExpression(ByVal node As MemberAccessExpressionSyntax) As SyntaxNode 3934Public Overrides Function VisitXmlMemberAccessExpression(ByVal node As XmlMemberAccessExpressionSyntax) As SyntaxNode 3955Public Overrides Function VisitInvocationExpression(ByVal node As InvocationExpressionSyntax) As SyntaxNode 3970Public Overrides Function VisitObjectCreationExpression(ByVal node As ObjectCreationExpressionSyntax) As SyntaxNode 3991Public Overrides Function VisitAnonymousObjectCreationExpression(ByVal node As AnonymousObjectCreationExpressionSyntax) As SyntaxNode 4008Public Overrides Function VisitArrayCreationExpression(ByVal node As ArrayCreationExpressionSyntax) As SyntaxNode 4031Public Overrides Function VisitCollectionInitializer(ByVal node As CollectionInitializerSyntax) As SyntaxNode 4048Public Overrides Function VisitCTypeExpression(ByVal node As CTypeExpressionSyntax) As SyntaxNode 4071Public Overrides Function VisitDirectCastExpression(ByVal node As DirectCastExpressionSyntax) As SyntaxNode 4094Public Overrides Function VisitTryCastExpression(ByVal node As TryCastExpressionSyntax) As SyntaxNode 4117Public Overrides Function VisitPredefinedCastExpression(ByVal node As PredefinedCastExpressionSyntax) As SyntaxNode 4136Public Overrides Function VisitBinaryExpression(ByVal node As BinaryExpressionSyntax) As SyntaxNode 4153Public Overrides Function VisitUnaryExpression(ByVal node As UnaryExpressionSyntax) As SyntaxNode 4168Public Overrides Function VisitBinaryConditionalExpression(ByVal node As BinaryConditionalExpressionSyntax) As SyntaxNode 4191Public Overrides Function VisitTernaryConditionalExpression(ByVal node As TernaryConditionalExpressionSyntax) As SyntaxNode 4218Public Overrides Function VisitSingleLineLambdaExpression(ByVal node As SingleLineLambdaExpressionSyntax) As SyntaxNode 4233Public Overrides Function VisitMultiLineLambdaExpression(ByVal node As MultiLineLambdaExpressionSyntax) As SyntaxNode 4250Public Overrides Function VisitLambdaHeader(ByVal node As LambdaHeaderSyntax) As SyntaxNode 4271Public Overrides Function VisitArgumentList(ByVal node As ArgumentListSyntax) As SyntaxNode 4288Public Overrides Function VisitOmittedArgument(ByVal node As OmittedArgumentSyntax) As SyntaxNode 4301Public Overrides Function VisitSimpleArgument(ByVal node As SimpleArgumentSyntax) As SyntaxNode 4316Public Overrides Function VisitNameColonEquals(ByVal node As NameColonEqualsSyntax) As SyntaxNode 4331Public Overrides Function VisitRangeArgument(ByVal node As RangeArgumentSyntax) As SyntaxNode 4348Public Overrides Function VisitQueryExpression(ByVal node As QueryExpressionSyntax) As SyntaxNode 4361Public Overrides Function VisitCollectionRangeVariable(ByVal node As CollectionRangeVariableSyntax) As SyntaxNode 4380Public Overrides Function VisitExpressionRangeVariable(ByVal node As ExpressionRangeVariableSyntax) As SyntaxNode 4395Public Overrides Function VisitAggregationRangeVariable(ByVal node As AggregationRangeVariableSyntax) As SyntaxNode 4410Public Overrides Function VisitVariableNameEquals(ByVal node As VariableNameEqualsSyntax) As SyntaxNode 4427Public Overrides Function VisitFunctionAggregation(ByVal node As FunctionAggregationSyntax) As SyntaxNode 4446Public Overrides Function VisitGroupAggregation(ByVal node As GroupAggregationSyntax) As SyntaxNode 4459Public Overrides Function VisitFromClause(ByVal node As FromClauseSyntax) As SyntaxNode 4474Public Overrides Function VisitLetClause(ByVal node As LetClauseSyntax) As SyntaxNode 4489Public Overrides Function VisitAggregateClause(ByVal node As AggregateClauseSyntax) As SyntaxNode 4510Public Overrides Function VisitDistinctClause(ByVal node As DistinctClauseSyntax) As SyntaxNode 4523Public Overrides Function VisitWhereClause(ByVal node As WhereClauseSyntax) As SyntaxNode 4538Public Overrides Function VisitPartitionWhileClause(ByVal node As PartitionWhileClauseSyntax) As SyntaxNode 4555Public Overrides Function VisitPartitionClause(ByVal node As PartitionClauseSyntax) As SyntaxNode 4570Public Overrides Function VisitGroupByClause(ByVal node As GroupByClauseSyntax) As SyntaxNode 4593Public Overrides Function VisitJoinCondition(ByVal node As JoinConditionSyntax) As SyntaxNode 4610Public Overrides Function VisitSimpleJoinClause(ByVal node As SimpleJoinClauseSyntax) As SyntaxNode 4631Public Overrides Function VisitGroupJoinClause(ByVal node As GroupJoinClauseSyntax) As SyntaxNode 4658Public Overrides Function VisitOrderByClause(ByVal node As OrderByClauseSyntax) As SyntaxNode 4675Public Overrides Function VisitOrdering(ByVal node As OrderingSyntax) As SyntaxNode 4690Public Overrides Function VisitSelectClause(ByVal node As SelectClauseSyntax) As SyntaxNode 4705Public Overrides Function VisitXmlDocument(ByVal node As XmlDocumentSyntax) As SyntaxNode 4724Public Overrides Function VisitXmlDeclaration(ByVal node As XmlDeclarationSyntax) As SyntaxNode 4747Public Overrides Function VisitXmlDeclarationOption(ByVal node As XmlDeclarationOptionSyntax) As SyntaxNode 4764Public Overrides Function VisitXmlElement(ByVal node As XmlElementSyntax) As SyntaxNode 4781Public Overrides Function VisitXmlText(ByVal node As XmlTextSyntax) As SyntaxNode 4794Public Overrides Function VisitXmlElementStartTag(ByVal node As XmlElementStartTagSyntax) As SyntaxNode 4813Public Overrides Function VisitXmlElementEndTag(ByVal node As XmlElementEndTagSyntax) As SyntaxNode 4830Public Overrides Function VisitXmlEmptyElement(ByVal node As XmlEmptyElementSyntax) As SyntaxNode 4849Public Overrides Function VisitXmlAttribute(ByVal node As XmlAttributeSyntax) As SyntaxNode 4866Public Overrides Function VisitXmlString(ByVal node As XmlStringSyntax) As SyntaxNode 4883Public Overrides Function VisitXmlPrefixName(ByVal node As XmlPrefixNameSyntax) As SyntaxNode 4896Public Overrides Function VisitXmlName(ByVal node As XmlNameSyntax) As SyntaxNode 4911Public Overrides Function VisitXmlBracketedName(ByVal node As XmlBracketedNameSyntax) As SyntaxNode 4928Public Overrides Function VisitXmlPrefix(ByVal node As XmlPrefixSyntax) As SyntaxNode 4943Public Overrides Function VisitXmlComment(ByVal node As XmlCommentSyntax) As SyntaxNode 4960Public Overrides Function VisitXmlProcessingInstruction(ByVal node As XmlProcessingInstructionSyntax) As SyntaxNode 4979Public Overrides Function VisitXmlCDataSection(ByVal node As XmlCDataSectionSyntax) As SyntaxNode 4996Public Overrides Function VisitXmlEmbeddedExpression(ByVal node As XmlEmbeddedExpressionSyntax) As SyntaxNode 5013Public Overrides Function VisitArrayType(ByVal node As ArrayTypeSyntax) As SyntaxNode 5028Public Overrides Function VisitNullableType(ByVal node As NullableTypeSyntax) As SyntaxNode 5043Public Overrides Function VisitPredefinedType(ByVal node As PredefinedTypeSyntax) As SyntaxNode 5056Public Overrides Function VisitIdentifierName(ByVal node As IdentifierNameSyntax) As SyntaxNode 5069Public Overrides Function VisitGenericName(ByVal node As GenericNameSyntax) As SyntaxNode 5084Public Overrides Function VisitQualifiedName(ByVal node As QualifiedNameSyntax) As SyntaxNode 5101Public Overrides Function VisitGlobalName(ByVal node As GlobalNameSyntax) As SyntaxNode 5114Public Overrides Function VisitTypeArgumentList(ByVal node As TypeArgumentListSyntax) As SyntaxNode 5133Public Overrides Function VisitCrefReference(ByVal node As CrefReferenceSyntax) As SyntaxNode 5150Public Overrides Function VisitCrefSignature(ByVal node As CrefSignatureSyntax) As SyntaxNode 5167Public Overrides Function VisitCrefSignaturePart(ByVal node As CrefSignaturePartSyntax) As SyntaxNode 5182Public Overrides Function VisitCrefOperatorReference(ByVal node As CrefOperatorReferenceSyntax) As SyntaxNode 5197Public Overrides Function VisitQualifiedCrefOperatorReference(ByVal node As QualifiedCrefOperatorReferenceSyntax) As SyntaxNode 5214Public Overrides Function VisitYieldStatement(ByVal node As YieldStatementSyntax) As SyntaxNode 5229Public Overrides Function VisitAwaitExpression(ByVal node As AwaitExpressionSyntax) As SyntaxNode 5244Public Overrides Function VisitSkippedTokensTrivia(ByVal node As SkippedTokensTriviaSyntax) As SyntaxNode 5257Public Overrides Function VisitDocumentationCommentTrivia(ByVal node As DocumentationCommentTriviaSyntax) As SyntaxNode 5270Public Overrides Function VisitXmlCrefAttribute(ByVal node As XmlCrefAttributeSyntax) As SyntaxNode 5291Public Overrides Function VisitXmlNameAttribute(ByVal node As XmlNameAttributeSyntax) As SyntaxNode 5312Public Overrides Function VisitConditionalAccessExpression(ByVal node As ConditionalAccessExpressionSyntax) As SyntaxNode 5329Public Overrides Function VisitNameOfExpression(ByVal node As NameOfExpressionSyntax) As SyntaxNode 5348Public Overrides Function VisitInterpolatedStringExpression(ByVal node As InterpolatedStringExpressionSyntax) As SyntaxNode 5365Public Overrides Function VisitInterpolatedStringText(ByVal node As InterpolatedStringTextSyntax) As SyntaxNode 5378Public Overrides Function VisitInterpolation(ByVal node As InterpolationSyntax) As SyntaxNode 5399Public Overrides Function VisitInterpolationAlignmentClause(ByVal node As InterpolationAlignmentClauseSyntax) As SyntaxNode 5414Public Overrides Function VisitInterpolationFormatClause(ByVal node As InterpolationFormatClauseSyntax) As SyntaxNode 5429Public Overrides Function VisitConstDirectiveTrivia(ByVal node As ConstDirectiveTriviaSyntax) As SyntaxNode 5450Public Overrides Function VisitIfDirectiveTrivia(ByVal node As IfDirectiveTriviaSyntax) As SyntaxNode 5471Public Overrides Function VisitElseDirectiveTrivia(ByVal node As ElseDirectiveTriviaSyntax) As SyntaxNode 5486Public Overrides Function VisitEndIfDirectiveTrivia(ByVal node As EndIfDirectiveTriviaSyntax) As SyntaxNode 5503Public Overrides Function VisitRegionDirectiveTrivia(ByVal node As RegionDirectiveTriviaSyntax) As SyntaxNode 5520Public Overrides Function VisitEndRegionDirectiveTrivia(ByVal node As EndRegionDirectiveTriviaSyntax) As SyntaxNode 5537Public Overrides Function VisitExternalSourceDirectiveTrivia(ByVal node As ExternalSourceDirectiveTriviaSyntax) As SyntaxNode 5562Public Overrides Function VisitEndExternalSourceDirectiveTrivia(ByVal node As EndExternalSourceDirectiveTriviaSyntax) As SyntaxNode 5579Public Overrides Function VisitExternalChecksumDirectiveTrivia(ByVal node As ExternalChecksumDirectiveTriviaSyntax) As SyntaxNode 5608Public Overrides Function VisitEnableWarningDirectiveTrivia(ByVal node As EnableWarningDirectiveTriviaSyntax) As SyntaxNode 5627Public Overrides Function VisitDisableWarningDirectiveTrivia(ByVal node As DisableWarningDirectiveTriviaSyntax) As SyntaxNode 5646Public Overrides Function VisitReferenceDirectiveTrivia(ByVal node As ReferenceDirectiveTriviaSyntax) As SyntaxNode 5663Public Overrides Function VisitBadDirectiveTrivia(ByVal node As BadDirectiveTriviaSyntax) As SyntaxNode
Generated\Syntax.xml.Syntax.Generated.vb (980)
123Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 138Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 154Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 176Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 203Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 211Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 280Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 329Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 336Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 391Friend _options as SyntaxNode 392Friend _imports as SyntaxNode 393Friend _attributes as SyntaxNode 394Friend _members as SyntaxNode 396Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 402Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), options As SyntaxNode, [imports] As SyntaxNode, attributes As SyntaxNode, members As SyntaxNode, endOfFileToken As InternalSyntax.PunctuationSyntax) 532Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 547Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 617Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 690Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 697Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 752Friend _importsClauses as SyntaxNode 754Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 760Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), importsKeyword As InternalSyntax.KeywordSyntax, importsClauses As SyntaxNode) 812Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 821Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 870Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 894Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 942Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 953Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 1010Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 1056Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 1063Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 1117Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 1175Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 1184Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 1242Friend _members as SyntaxNode 1245Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 1251Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), namespaceStatement As NamespaceStatementSyntax, members As SyntaxNode, endNamespaceStatement As EndBlockStatementSyntax) 1317Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 1330Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 1394Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 1439Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 1448Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 1497Friend _inherits as SyntaxNode 1498Friend _implements as SyntaxNode 1499Friend _members as SyntaxNode 1501Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 1618Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 1624Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), moduleStatement As ModuleStatementSyntax, [inherits] As SyntaxNode, [implements] As SyntaxNode, members As SyntaxNode, endModuleStatement As EndBlockStatementSyntax) 1778Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 1795Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 1870Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 1876Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), structureStatement As StructureStatementSyntax, [inherits] As SyntaxNode, [implements] As SyntaxNode, members As SyntaxNode, endStructureStatement As EndBlockStatementSyntax) 2030Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 2047Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 2122Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 2128Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), interfaceStatement As InterfaceStatementSyntax, [inherits] As SyntaxNode, [implements] As SyntaxNode, members As SyntaxNode, endInterfaceStatement As EndBlockStatementSyntax) 2282Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 2299Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 2374Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 2380Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), classStatement As ClassStatementSyntax, [inherits] As SyntaxNode, [implements] As SyntaxNode, members As SyntaxNode, endClassStatement As EndBlockStatementSyntax) 2534Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 2551Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 2624Friend _members as SyntaxNode 2627Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 2633Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), enumStatement As EnumStatementSyntax, members As SyntaxNode, endEnumStatement As EndBlockStatementSyntax) 2699Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 2712Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 2769Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 2789Friend _types as SyntaxNode 2791Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 2797Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), inheritsKeyword As InternalSyntax.KeywordSyntax, types As SyntaxNode) 2844Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 2853Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 2907Friend _types as SyntaxNode 2909Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 2915Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), implementsKeyword As InternalSyntax.KeywordSyntax, types As SyntaxNode) 2962Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 2971Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 3022Friend _attributeLists as SyntaxNode 3025Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 3169Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 3175Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), attributeLists As SyntaxNode, modifiers As GreenNode, moduleKeyword As InternalSyntax.KeywordSyntax, identifier As InternalSyntax.IdentifierTokenSyntax, typeParameterList As TypeParameterListSyntax) 3343Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 3354Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 3421Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 3427Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), attributeLists As SyntaxNode, modifiers As GreenNode, structureKeyword As InternalSyntax.KeywordSyntax, identifier As InternalSyntax.IdentifierTokenSyntax, typeParameterList As TypeParameterListSyntax) 3595Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 3606Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 3673Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 3679Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), attributeLists As SyntaxNode, modifiers As GreenNode, interfaceKeyword As InternalSyntax.KeywordSyntax, identifier As InternalSyntax.IdentifierTokenSyntax, typeParameterList As TypeParameterListSyntax) 3847Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 3858Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 3925Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 3931Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), attributeLists As SyntaxNode, modifiers As GreenNode, classKeyword As InternalSyntax.KeywordSyntax, identifier As InternalSyntax.IdentifierTokenSyntax, typeParameterList As TypeParameterListSyntax) 4099Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 4110Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 4176Friend _attributeLists as SyntaxNode 4179Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 4185Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), attributeLists As SyntaxNode, modifiers As GreenNode, enumKeyword As InternalSyntax.KeywordSyntax, identifier As InternalSyntax.IdentifierTokenSyntax, underlyingType As AsClauseSyntax) 4304Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 4315Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 4380Friend _parameters as SyntaxNode 4382Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 4388Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), openParenToken As InternalSyntax.PunctuationSyntax, ofKeyword As InternalSyntax.KeywordSyntax, parameters As SyntaxNode, closeParenToken As InternalSyntax.PunctuationSyntax) 4473Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 4482Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 4544Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 4620Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 4629Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 4682Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 4705Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 4753Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 4762Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 4817Friend _constraints as SyntaxNode 4819Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 4825Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), asKeyword As InternalSyntax.KeywordSyntax, openBraceToken As InternalSyntax.PunctuationSyntax, constraints As SyntaxNode, closeBraceToken As InternalSyntax.PunctuationSyntax) 4910Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 4919Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 4975Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 5000Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 5029Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 5037Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 5088Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 5115Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 5123Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 5173Friend _attributeLists as SyntaxNode 5176Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 5182Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), attributeLists As SyntaxNode, identifier As InternalSyntax.IdentifierTokenSyntax, initializer As EqualsValueSyntax) 5245Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 5256Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 5312Friend _statements as SyntaxNode 5314Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 5370Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 5376Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), subOrFunctionStatement As MethodStatementSyntax, statements As SyntaxNode, endSubOrFunctionStatement As EndBlockStatementSyntax) 5454Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 5467Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 5535Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 5541Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), subNewStatement As SubNewStatementSyntax, statements As SyntaxNode, endSubStatement As EndBlockStatementSyntax) 5619Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 5632Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 5697Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 5703Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), operatorStatement As OperatorStatementSyntax, statements As SyntaxNode, endOperatorStatement As EndBlockStatementSyntax) 5781Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 5794Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 5864Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 5870Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), accessorStatement As AccessorStatementSyntax, statements As SyntaxNode, endAccessorStatement As EndBlockStatementSyntax) 5950Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 5963Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 6029Friend _accessors as SyntaxNode 6032Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 6038Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), propertyStatement As PropertyStatementSyntax, accessors As SyntaxNode, endPropertyStatement As EndBlockStatementSyntax) 6102Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 6115Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 6178Friend _accessors as SyntaxNode 6181Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 6187Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), eventStatement As EventStatementSyntax, accessors As SyntaxNode, endEventStatement As EndBlockStatementSyntax) 6251Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 6264Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 6322Friend _attributeLists as SyntaxNode 6325Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 6446Friend _parameters as SyntaxNode 6448Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 6454Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), openParenToken As InternalSyntax.PunctuationSyntax, parameters As SyntaxNode, closeParenToken As InternalSyntax.PunctuationSyntax) 6525Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 6534Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 6600Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 6606Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), attributeLists As SyntaxNode, modifiers As GreenNode, subOrFunctionKeyword As InternalSyntax.KeywordSyntax, identifier As InternalSyntax.IdentifierTokenSyntax, typeParameterList As TypeParameterListSyntax, parameterList As ParameterListSyntax, asClause As SimpleAsClauseSyntax, handlesClause As HandlesClauseSyntax, implementsClause As ImplementsClauseSyntax) 6870Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 6889Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 6980Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 6986Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), attributeLists As SyntaxNode, modifiers As GreenNode, subKeyword As InternalSyntax.KeywordSyntax, newKeyword As InternalSyntax.KeywordSyntax, parameterList As ParameterListSyntax) 7148Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 7159Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 7229Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 7235Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), attributeLists As SyntaxNode, modifiers As GreenNode, declareKeyword As InternalSyntax.KeywordSyntax, charsetKeyword As InternalSyntax.KeywordSyntax, subOrFunctionKeyword As InternalSyntax.KeywordSyntax, identifier As InternalSyntax.IdentifierTokenSyntax, libKeyword As InternalSyntax.KeywordSyntax, libraryName As LiteralExpressionSyntax, aliasKeyword As InternalSyntax.KeywordSyntax, aliasName As LiteralExpressionSyntax, parameterList As ParameterListSyntax, asClause As SimpleAsClauseSyntax) 7545Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 7562Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 7661Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 7667Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), attributeLists As SyntaxNode, modifiers As GreenNode, delegateKeyword As InternalSyntax.KeywordSyntax, subOrFunctionKeyword As InternalSyntax.KeywordSyntax, identifier As InternalSyntax.IdentifierTokenSyntax, typeParameterList As TypeParameterListSyntax, parameterList As ParameterListSyntax, asClause As SimpleAsClauseSyntax) 7896Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 7911Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 7997Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 8003Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), attributeLists As SyntaxNode, modifiers As GreenNode, customKeyword As InternalSyntax.KeywordSyntax, eventKeyword As InternalSyntax.KeywordSyntax, identifier As InternalSyntax.IdentifierTokenSyntax, parameterList As ParameterListSyntax, asClause As SimpleAsClauseSyntax, implementsClause As ImplementsClauseSyntax) 8239Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 8254Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 8337Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 8343Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), attributeLists As SyntaxNode, modifiers As GreenNode, operatorKeyword As InternalSyntax.KeywordSyntax, operatorToken As InternalSyntax.SyntaxToken, parameterList As ParameterListSyntax, asClause As SimpleAsClauseSyntax) 8527Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 8540Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 8617Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 8623Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), attributeLists As SyntaxNode, modifiers As GreenNode, propertyKeyword As InternalSyntax.KeywordSyntax, identifier As InternalSyntax.IdentifierTokenSyntax, parameterList As ParameterListSyntax, asClause As AsClauseSyntax, initializer As EqualsValueSyntax, implementsClause As ImplementsClauseSyntax) 8856Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 8873Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 8961Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 8967Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), attributeLists As SyntaxNode, modifiers As GreenNode, accessorKeyword As InternalSyntax.KeywordSyntax, parameterList As ParameterListSyntax) 9112Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 9123Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 9189Friend _interfaceMembers as SyntaxNode 9191Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 9197Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), implementsKeyword As InternalSyntax.KeywordSyntax, interfaceMembers As SyntaxNode) 9245Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 9254Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 9309Friend _events as SyntaxNode 9311Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 9317Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), handlesKeyword As InternalSyntax.KeywordSyntax, events As SyntaxNode) 9364Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 9373Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 9422Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 9444Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 9473Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 9481Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 9528Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 9557Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 9565Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 9614Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 9679Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 9690Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 9752Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 9818Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 9829Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 9890Friend _attributeLists as SyntaxNode 9892Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 9898Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), attributeLists As SyntaxNode, modifiers As GreenNode, missingIdentifier As InternalSyntax.IdentifierTokenSyntax) 9985Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 9994Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 10054Friend _attributeLists as SyntaxNode 10055Friend _declarators as SyntaxNode 10057Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 10063Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), attributeLists As SyntaxNode, modifiers As GreenNode, declarators As SyntaxNode) 10151Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 10162Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 10222Friend _names as SyntaxNode 10226Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 10232Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), names As SyntaxNode, asClause As AsClauseSyntax, initializer As EqualsValueSyntax) 10306Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 10319Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 10378Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 10423Friend _attributeLists as SyntaxNode 10426Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 10432Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), asKeyword As InternalSyntax.KeywordSyntax, attributeLists As SyntaxNode, type As TypeSyntax) 10506Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 10517Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 10581Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 10635Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 10644Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 10694Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 10714Friend _initializers as SyntaxNode 10716Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 10722Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), withKeyword As InternalSyntax.KeywordSyntax, openBraceToken As InternalSyntax.PunctuationSyntax, initializers As SyntaxNode, closeBraceToken As InternalSyntax.PunctuationSyntax) 10806Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 10815Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 10878Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 10929Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 10938Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 10988Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 11041Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 11102Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 11111Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 11169Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 11283Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 11294Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 11362Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 11407Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 11416Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 11470Friend _attributeLists as SyntaxNode 11475Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 11481Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), attributeLists As SyntaxNode, modifiers As GreenNode, identifier As ModifiedIdentifierSyntax, asClause As SimpleAsClauseSyntax, [default] As EqualsValueSyntax) 11604Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 11619Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 11690Friend _arrayRankSpecifiers as SyntaxNode 11692Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 11698Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), identifier As InternalSyntax.IdentifierTokenSyntax, nullable As InternalSyntax.PunctuationSyntax, arrayBounds As ArgumentListSyntax, arrayRankSpecifiers As SyntaxNode) 11798Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 11809Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 11873Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 11948Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 11955Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 12010Friend _attributes as SyntaxNode 12012Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 12018Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), lessThanToken As InternalSyntax.PunctuationSyntax, attributes As SyntaxNode, greaterThanToken As InternalSyntax.PunctuationSyntax) 12087Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 12096Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 12157Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 12231Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 12244Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 12306Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 12354Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 12361Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 12414Friend _attributeLists as SyntaxNode 12416Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 12422Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), attributeLists As SyntaxNode) 12452Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 12460Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 12514Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 12542Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 12550Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 12602Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 12648Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 12657Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 12713Friend _statements as SyntaxNode 12716Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 12722Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), whileStatement As WhileStatementSyntax, statements As SyntaxNode, endWhileStatement As EndBlockStatementSyntax) 12788Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 12801Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 12864Friend _statements as SyntaxNode 12867Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 12873Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), usingStatement As UsingStatementSyntax, statements As SyntaxNode, endUsingStatement As EndBlockStatementSyntax) 12940Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 12953Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 13016Friend _statements as SyntaxNode 13019Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 13025Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), syncLockStatement As SyncLockStatementSyntax, statements As SyntaxNode, endSyncLockStatement As EndBlockStatementSyntax) 13092Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 13105Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 13168Friend _statements as SyntaxNode 13171Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 13177Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), withStatement As WithStatementSyntax, statements As SyntaxNode, endWithStatement As EndBlockStatementSyntax) 13244Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 13257Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 13318Friend _declarators as SyntaxNode 13320Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 13326Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), modifiers As GreenNode, declarators As SyntaxNode) 13384Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 13393Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 13448Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 13495Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 13502Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 13556Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 13602Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 13611Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 13669Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 13698Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 13706Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 13758Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 13786Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 13794Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 13853Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 13899Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 13906Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 13965Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 14012Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 14019Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 14076Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 14125Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 14134Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 14189Friend _statements as SyntaxNode 14192Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 14198Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), ifKeyword As InternalSyntax.KeywordSyntax, condition As ExpressionSyntax, thenKeyword As InternalSyntax.KeywordSyntax, statements As SyntaxNode, elseClause As SingleLineElseClauseSyntax) 14309Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 14322Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 14389Friend _statements as SyntaxNode 14391Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 14397Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), elseKeyword As InternalSyntax.KeywordSyntax, statements As SyntaxNode) 14446Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 14455Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 14511Friend _statements as SyntaxNode 14512Friend _elseIfBlocks as SyntaxNode 14516Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 14522Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), ifStatement As IfStatementSyntax, statements As SyntaxNode, elseIfBlocks As SyntaxNode, elseBlock As ElseBlockSyntax, endIfStatement As EndBlockStatementSyntax) 14643Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 14660Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 14733Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 14804Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 14813Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 14871Friend _statements as SyntaxNode 14873Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 14879Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), elseIfStatement As ElseIfStatementSyntax, statements As SyntaxNode) 14928Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 14939Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 14997Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 15068Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 15077Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 15135Friend _statements as SyntaxNode 15137Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 15143Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), elseStatement As ElseStatementSyntax, statements As SyntaxNode) 15191Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 15202Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 15259Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 15287Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 15295Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 15342Friend _statements as SyntaxNode 15343Friend _catchBlocks as SyntaxNode 15347Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 15353Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), tryStatement As TryStatementSyntax, statements As SyntaxNode, catchBlocks As SyntaxNode, finallyBlock As FinallyBlockSyntax, endTryStatement As EndBlockStatementSyntax) 15472Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 15489Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 15561Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 15589Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 15597Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 15644Friend _statements as SyntaxNode 15646Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 15652Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), catchStatement As CatchStatementSyntax, statements As SyntaxNode) 15701Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 15712Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 15772Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 15864Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 15877Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 15943Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 15988Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 15997Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 16052Friend _statements as SyntaxNode 16054Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 16060Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), finallyStatement As FinallyStatementSyntax, statements As SyntaxNode) 16108Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 16119Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 16176Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 16204Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 16212Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 16260Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 16306Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 16315Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 16373Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 16479Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 16488Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 16555Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 16637Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 16644Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 16707Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 16757Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 16766Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 16825Friend _caseBlocks as SyntaxNode 16828Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 16834Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), selectStatement As SelectStatementSyntax, caseBlocks As SyntaxNode, endSelectStatement As EndBlockStatementSyntax) 16900Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 16913Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 16977Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 17048Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 17057Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 17116Friend _statements as SyntaxNode 17118Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 17124Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), caseStatement As CaseStatementSyntax, statements As SyntaxNode) 17177Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 17188Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 17250Friend _cases as SyntaxNode 17252Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 17258Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), caseKeyword As InternalSyntax.KeywordSyntax, cases As SyntaxNode) 17306Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 17315Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 17368Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 17389Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 17417Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 17425Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 17473Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 17500Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 17508Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 17561Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 17625Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 17636Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 17702Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 17773Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 17782Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 17845Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 17891Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 17900Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 17960Friend _statements as SyntaxNode 17963Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 17969Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), doStatement As DoStatementSyntax, statements As SyntaxNode, loopStatement As LoopStatementSyntax) 18035Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 18048Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 18116Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 18166Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 18175Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 18236Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 18286Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 18295Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 18357Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 18403Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 18412Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 18472Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 18518Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 18527Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 18575Friend _statements as SyntaxNode 18578Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 18666Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 18672Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), forStatement As ForStatementSyntax, statements As SyntaxNode, nextStatement As NextStatementSyntax) 18772Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 18785Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 18850Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 18856Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), forEachStatement As ForEachStatementSyntax, statements As SyntaxNode, nextStatement As NextStatementSyntax) 18956Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 18969Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 19026Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 19104Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 19262Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 19277Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 19354Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 19400Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 19409Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 19471Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 19590Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 19601Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 19669Friend _controlVariables as SyntaxNode 19671Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 19677Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), nextKeyword As InternalSyntax.KeywordSyntax, controlVariables As SyntaxNode) 19728Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 19737Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 19794Friend _variables as SyntaxNode 19796Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 19802Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), usingKeyword As InternalSyntax.KeywordSyntax, expression As ExpressionSyntax, variables As SyntaxNode) 19876Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 19887Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 19948Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 19997Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 20006Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 20074Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 20137Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 20148Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 20212Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 20262Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 20271Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 20327Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 20374Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 20383Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 20442Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 20524Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 20535Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 20603Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 20674Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 20685Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 20748Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 20794Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 20803Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 20858Friend _clauses as SyntaxNode 20860Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 20866Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), reDimKeyword As InternalSyntax.KeywordSyntax, preserveKeyword As InternalSyntax.KeywordSyntax, clauses As SyntaxNode) 20940Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 20949Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 21012Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 21063Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 21074Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 21130Friend _expressions as SyntaxNode 21132Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 21138Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), eraseKeyword As InternalSyntax.KeywordSyntax, expressions As SyntaxNode) 21186Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 21195Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 21244Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 21275Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 21310Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 21318Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 21369Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 21433Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 21442Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 21499Friend _arguments as SyntaxNode 21501Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 21507Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), openParenToken As InternalSyntax.PunctuationSyntax, arguments As SyntaxNode, closeParenToken As InternalSyntax.PunctuationSyntax) 21573Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 21582Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 21639Friend _elements as SyntaxNode 21641Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 21647Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), openParenToken As InternalSyntax.PunctuationSyntax, elements As SyntaxNode, closeParenToken As InternalSyntax.PunctuationSyntax) 21713Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 21722Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 21774Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 21796Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 21823Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 21831Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 21884Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 21933Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 21942Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 21992Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 22036Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 22072Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 22080Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 22127Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 22163Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 22171Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 22218Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 22254Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 22262Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 22310Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 22391Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 22400Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 22464Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 22545Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 22556Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 22623Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 22707Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 22716Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 22781Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 22847Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 22858Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 22927Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 23039Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 23050Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 23123Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 23180Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 23191Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 23241Friend _attributeLists as SyntaxNode 23243Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 23323Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 23329Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), newKeyword As InternalSyntax.KeywordSyntax, attributeLists As SyntaxNode, type As TypeSyntax, argumentList As ArgumentListSyntax, initializer As ObjectCreationInitializerSyntax) 23463Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 23478Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 23549Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 23555Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), newKeyword As InternalSyntax.KeywordSyntax, attributeLists As SyntaxNode, initializer As ObjectMemberInitializerSyntax) 23647Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 23658Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 23719Friend _rankSpecifiers as SyntaxNode 23722Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 23728Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), newKeyword As InternalSyntax.KeywordSyntax, attributeLists As SyntaxNode, type As TypeSyntax, arrayBounds As ArgumentListSyntax, rankSpecifiers As SyntaxNode, initializer As CollectionInitializerSyntax) 23890Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 23907Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 23982Friend _initializers as SyntaxNode 23984Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 23990Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), openBraceToken As InternalSyntax.PunctuationSyntax, initializers As SyntaxNode, closeBraceToken As InternalSyntax.PunctuationSyntax) 24059Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 24068Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 24123Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 24278Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 24443Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 24454Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 24520Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 24685Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 24696Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 24762Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 24927Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 24938Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 25009Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 25091Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 25100Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 25188Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 25247Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 25258Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 25325Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 25371Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 25380Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 25441Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 25559Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 25570Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 25643Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 25797Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 25810Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 25882Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 25929Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 25984Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 25995Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 26055Friend _statements as SyntaxNode 26058Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 26064Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), subOrFunctionHeader As LambdaHeaderSyntax, statements As SyntaxNode, endSubOrFunctionStatement As EndBlockStatementSyntax) 26142Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 26155Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 26222Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 26228Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), attributeLists As SyntaxNode, modifiers As GreenNode, subOrFunctionKeyword As InternalSyntax.KeywordSyntax, parameterList As ParameterListSyntax, asClause As SimpleAsClauseSyntax) 26394Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 26407Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 26477Friend _arguments as SyntaxNode 26479Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 26485Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), openParenToken As InternalSyntax.PunctuationSyntax, arguments As SyntaxNode, closeParenToken As InternalSyntax.PunctuationSyntax) 26555Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 26564Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 26617Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 26639Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 26666Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 26674Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 26724Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 26773Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 26784Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 26842Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 26887Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 26896Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 26954Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 27018Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 27029Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 27090Friend _clauses as SyntaxNode 27092Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 27098Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), clauses As SyntaxNode) 27126Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 27134Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 27179Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 27204Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 27289Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 27302Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 27370Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 27420Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 27431Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 27492Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 27544Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 27555Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 27614Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 27681Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 27692Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 27747Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 27770Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 27869Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 27878Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 27941Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 27969Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 27977Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 28025Friend _variables as SyntaxNode 28027Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 28033Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), fromKeyword As InternalSyntax.KeywordSyntax, variables As SyntaxNode) 28081Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 28090Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 28144Friend _variables as SyntaxNode 28146Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 28152Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), letKeyword As InternalSyntax.KeywordSyntax, variables As SyntaxNode) 28200Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 28209Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 28263Friend _variables as SyntaxNode 28264Friend _additionalQueryOperators as SyntaxNode 28265Friend _aggregationVariables as SyntaxNode 28267Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 28273Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), aggregateKeyword As InternalSyntax.KeywordSyntax, variables As SyntaxNode, additionalQueryOperators As SyntaxNode, intoKeyword As InternalSyntax.KeywordSyntax, aggregationVariables As SyntaxNode) 28391Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 28404Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 28472Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 28500Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 28508Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 28556Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 28602Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 28611Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 28669Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 28733Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 28742Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 28805Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 28850Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 28859Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 28916Friend _items as SyntaxNode 28917Friend _keys as SyntaxNode 28918Friend _aggregationVariables as SyntaxNode 28920Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 28926Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), groupKeyword As InternalSyntax.KeywordSyntax, items As SyntaxNode, byKeyword As InternalSyntax.KeywordSyntax, keys As SyntaxNode, intoKeyword As InternalSyntax.KeywordSyntax, aggregationVariables As SyntaxNode) 29061Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 29074Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 29138Friend _joinedVariables as SyntaxNode 29139Friend _additionalJoins as SyntaxNode 29140Friend _joinConditions as SyntaxNode 29142Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 29297Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 29359Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 29370Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 29430Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 29436Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), joinKeyword As InternalSyntax.KeywordSyntax, joinedVariables As SyntaxNode, additionalJoins As SyntaxNode, onKeyword As InternalSyntax.KeywordSyntax, joinConditions As SyntaxNode) 29599Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 29612Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 29679Friend _aggregationVariables as SyntaxNode 29681Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 29687Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), groupKeyword As InternalSyntax.KeywordSyntax, joinKeyword As InternalSyntax.KeywordSyntax, joinedVariables As SyntaxNode, additionalJoins As SyntaxNode, onKeyword As InternalSyntax.KeywordSyntax, joinConditions As SyntaxNode, intoKeyword As InternalSyntax.KeywordSyntax, aggregationVariables As SyntaxNode) 29912Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 29927Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 30005Friend _orderings as SyntaxNode 30007Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 30013Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), orderKeyword As InternalSyntax.KeywordSyntax, byKeyword As InternalSyntax.KeywordSyntax, orderings As SyntaxNode) 30079Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 30088Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 30149Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 30203Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 30212Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 30269Friend _variables as SyntaxNode 30271Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 30277Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), selectKeyword As InternalSyntax.KeywordSyntax, variables As SyntaxNode) 30326Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 30335Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 30385Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 30406Friend _precedingMisc as SyntaxNode 30408Friend _followingMisc as SyntaxNode 30410Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 30416Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), declaration As XmlDeclarationSyntax, precedingMisc As SyntaxNode, root As XmlNodeSyntax, followingMisc As SyntaxNode) 30495Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 30510Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 30580Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 30686Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 30699Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 30772Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 30824Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 30833Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 30891Friend _content as SyntaxNode 30894Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 30900Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), startTag As XmlElementStartTagSyntax, content As SyntaxNode, endTag As XmlElementEndTagSyntax) 30956Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 30969Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 31031Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 31068Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 31076Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 31123Friend _attributes as SyntaxNode 31125Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 31131Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), lessThanToken As InternalSyntax.PunctuationSyntax, name As XmlNodeSyntax, attributes As SyntaxNode, greaterThanToken As InternalSyntax.PunctuationSyntax) 31202Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 31213Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 31277Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 31334Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 31343Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 31401Friend _attributes as SyntaxNode 31403Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 31409Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), lessThanToken As InternalSyntax.PunctuationSyntax, name As XmlNodeSyntax, attributes As SyntaxNode, slashGreaterThanToken As InternalSyntax.PunctuationSyntax) 31480Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 31491Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 31556Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 31609Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 31620Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 31674Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 31696Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 31762Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 31769Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 31825Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 31849Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 31857Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 31907Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 31949Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 31958Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 32016Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 32070Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 32079Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 32137Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 32176Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 32183Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 32237Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 32300Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 32307Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 32364Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 32441Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 32448Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 32507Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 32570Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 32577Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 32635Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 32690Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 32699Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 32753Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 32775Friend _rankSpecifiers as SyntaxNode 32777Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 32783Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), elementType As TypeSyntax, rankSpecifiers As SyntaxNode) 32828Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 32839Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 32897Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 32944Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 32953Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 33009Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 33037Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 33045Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 33087Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 33102Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 33147Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 33183Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 33191Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 33240Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 33299Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 33308Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 33365Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 33429Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 33440Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 33500Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 33528Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 33536Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 33582Friend _arguments as SyntaxNode 33584Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 33590Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), openParenToken As InternalSyntax.PunctuationSyntax, ofKeyword As InternalSyntax.KeywordSyntax, arguments As SyntaxNode, closeParenToken As InternalSyntax.PunctuationSyntax) 33674Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 33683Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 33748Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 33813Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 33826Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 33888Friend _argumentTypes as SyntaxNode 33890Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 33896Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), openParenToken As InternalSyntax.PunctuationSyntax, argumentTypes As SyntaxNode, closeParenToken As InternalSyntax.PunctuationSyntax) 33953Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 33962Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 34018Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 34067Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 34076Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 34128Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 34168Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 34175Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 34227Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 34280Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 34291Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 34352Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 34398Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 34407Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 34463Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 34509Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 34518Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 34583Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 34621Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 34629Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 34676Friend _content as SyntaxNode 34678Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 34684Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), content As SyntaxNode) 34711Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 34719Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 34774Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 34858Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 34869Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 34939Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 35023Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 35034Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 35102Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 35170Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 35181Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 35242Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 35324Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 35333Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 35393Friend _contents as SyntaxNode 35395Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 35401Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), dollarSignDoubleQuoteToken As InternalSyntax.PunctuationSyntax, contents As SyntaxNode, doubleQuoteToken As InternalSyntax.PunctuationSyntax) 35464Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 35473Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 35525Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 35546Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 35574Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 35582Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 35633Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 35740Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 35753Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 35823Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 35868Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 35877Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 35933Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 35979Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 35986Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 36034Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 36079Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 36186Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 36195Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 36262Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 36372Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 36381Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 36448Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 36499Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 36506Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 36559Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 36625Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 36632Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 36688Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 36759Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 36766Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 36822Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 36894Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 36901Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 36958Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 37084Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 37091Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 37159Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 37225Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 37232Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 37288Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 37443Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 37450Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 37523Friend _errorCodes as SyntaxNode 37525Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 37531Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), hashToken As InternalSyntax.PunctuationSyntax, enableKeyword As InternalSyntax.KeywordSyntax, warningKeyword As InternalSyntax.KeywordSyntax, errorCodes As SyntaxNode) 37614Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 37623Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 37683Friend _errorCodes as SyntaxNode 37685Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 37691Friend Sub New(ByVal kind As SyntaxKind, ByVal errors as DiagnosticInfo(), ByVal annotations as SyntaxAnnotation(), hashToken As InternalSyntax.PunctuationSyntax, disableKeyword As InternalSyntax.KeywordSyntax, warningKeyword As InternalSyntax.KeywordSyntax, errorCodes As SyntaxNode) 37774Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 37783Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 37844Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 37909Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 37916Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode 37975Friend Sub New(ByVal green As GreenNode, ByVal parent as SyntaxNode, ByVal startLocation As Integer) 38011Friend Overrides Function GetCachedSlot(i as Integer) as SyntaxNode 38019Friend Overrides Function GetNodeSlot(i as Integer) as SyntaxNode
Lowering\AsyncRewriter\AsyncRewriter.CapturedSymbolOrExpression.vb (1)
73Dim syntax As SyntaxNode = rewriter.F.Syntax
Lowering\Diagnostics\DiagnosticsPass.vb (1)
146Dim errorSyntax As SyntaxNode = node.Syntax
Lowering\ExpressionLambdaRewriter\ExpressionLambdaRewriter.vb (2)
43node As SyntaxNode, recursionDepth As Integer, diagnostics As BindingDiagnosticBag) 193Dim old As SyntaxNode = _factory.Syntax
Lowering\ExpressionLambdaRewriter\ExpressionLambdaRewriter_ConditionalExpresion.vb (1)
140Dim syntax As SyntaxNode = expression.Syntax
Lowering\Instrumentation\CodeCoverageInstrumenter.vb (12)
93Private Shared Function HasValidMappedLineSpan(syntax As SyntaxNode) As Boolean 127Dim bodySyntax As SyntaxNode = methodBody.Syntax 172methodBodySyntax As SyntaxNode, 435Private Shared Function GetSourceDocument(debugDocumentProvider As DebugDocumentProvider, syntax As SyntaxNode) As Cci.DebugSourceDocument 439Private Shared Function GetSourceDocument(debugDocumentProvider As DebugDocumentProvider, syntax As SyntaxNode, span As FileLinePositionSpan) As Cci.DebugSourceDocument 449Private Function AddAnalysisPoint(syntaxForSpan As SyntaxNode, alternateSpan As Text.TextSpan, statementFactory As SyntheticBoundNodeFactory) As BoundStatement 453Private Function AddAnalysisPoint(syntaxForSpan As SyntaxNode, statementFactory As SyntheticBoundNodeFactory) As BoundStatement 457Private Function AddAnalysisPoint(syntaxForSpan As SyntaxNode, span As FileLinePositionSpan, statementFactory As SyntheticBoundNodeFactory) As BoundStatement 477Private Shared Function SyntaxForSpan(statement As BoundStatement) As SyntaxNode 515Private Shared Function GetCreatePayloadOverload(compilation As VisualBasicCompilation, overload As WellKnownMember, syntax As SyntaxNode, diagnostics As BindingDiagnosticBag) As MethodSymbol 520Private Shared Function SkipAttributes(syntax As SyntaxNode) As Text.TextSpan 546Private Shared Function SkipAttributes(syntax As SyntaxNode, attributes As SyntaxList(Of AttributeListSyntax), modifiers As SyntaxTokenList, keyword As SyntaxToken) As Text.TextSpan
Lowering\Instrumentation\DebugInfoInjector.vb (2)
104Dim createSequencePoint As SyntaxNode = Nothing 400Dim syntaxForSequencePoint As SyntaxNode
Lowering\Instrumentation\DebugInfoInjector_SequencePoints.vb (6)
33synthesizedVariableSyntax As SyntaxNode, 66Private Shared Function MakeLocalRead(syntax As SyntaxNode, localSym As LocalSymbol) As BoundLocal 72Private Shared Function MakeLocalWrite(syntax As SyntaxNode, localSym As LocalSymbol) As BoundLocal 78Private Shared Function MakeAssignmentExpression(syntax As SyntaxNode, left As BoundExpression, right As BoundExpression) As BoundExpression 118Private Shared Function MarkInitializerSequencePoint(rewrittenStatement As BoundStatement, syntax As SyntaxNode, nameIndex As Integer) As BoundStatement 152Private Shared Function MarkInitializerSequencePoint(rewrittenStatement As BoundStatement, syntax As SyntaxNode) As BoundStatement
Lowering\IteratorRewriter\IteratorRewriter.IteratorMethodToClassRewriter.vb (1)
218Dim syntax As SyntaxNode = Me.F.Syntax
Lowering\LambdaRewriter\LambdaFrame.vb (5)
32Private ReadOnly _scopeSyntaxOpt As SyntaxNode 50scopeSyntaxOpt As SyntaxNode, 87Private Shared Function MakeName(scopeSyntaxOpt As SyntaxNode, 104Private Shared Sub AssertIsClosureScopeSyntax(syntaxOpt As SyntaxNode) 123Public ReadOnly Property ScopeSyntax As SyntaxNode
Lowering\LambdaRewriter\LambdaFrameConstructor.vb (1)
17syntaxNode As SyntaxNode,
Lowering\LambdaRewriter\LambdaFrameCopyConstructor.vb (1)
26Friend Sub New(syntaxNode As SyntaxNode, containingType As LambdaFrame)
Lowering\LambdaRewriter\LambdaRewriter.Analysis.vb (2)
403Private Sub ReferenceVariable(variableOrParameter As Symbol, syntax As SyntaxNode) 442Private Sub VerifyCaptured(variableOrParameter As Symbol, syntax As SyntaxNode)
Lowering\LambdaRewriter\LambdaRewriter.vb (10)
379Private Function FrameOfType(syntax As SyntaxNode, frameType As NamedTypeSymbol) As BoundExpression 393Friend Overrides Function FramePointer(syntax As SyntaxNode, frameClass As NamedTypeSymbol) As BoundExpression 427Dim syntaxNode As SyntaxNode = constructor.Syntax 529Dim syntaxNode As SyntaxNode = node.Syntax 634Private Sub InitVariableProxy(syntaxNode As SyntaxNode, 982Private Function GetClosureId(scope As BoundNode, syntax As SyntaxNode, closureDebugInfo As ArrayBuilder(Of EncClosureInfo), <Out> ByRef rudeEdit As RuntimeRudeEdit?) As DebugId 1014Private Function GetLambdaId(syntax As SyntaxNode, closureKind As ClosureKind, closureOrdinal As Integer, closureRudeEdit As RuntimeRudeEdit?) As DebugId 1017Dim lambdaOrLambdaBodySyntax As SyntaxNode 1278Private Shared Function InLoopOrLambda(lambdaSyntax As SyntaxNode, scopeSyntax As SyntaxNode) As Boolean
Lowering\LocalRewriter\LocalRewriter.vb (3)
47Private ReadOnly _unstructuredExceptionHandlingResumableStatements As New Dictionary(Of SyntaxNode, BoundStatement)(ReferenceEqualityComparer.Instance) 481syntax As SyntaxNode, 565Private Function GetSpecialTypeWithUseSiteDiagnostics(specialType As SpecialType, syntax As SyntaxNode) As NamedTypeSymbol
Lowering\LocalRewriter\LocalRewriter_AddRemoveHandler.vb (1)
83Dim syntax As SyntaxNode = node.Syntax
Lowering\LocalRewriter\LocalRewriter_Conversion.vb (1)
175Private Function MakeTupleConversion(syntax As SyntaxNode, rewrittenOperand As BoundExpression, destinationType As TypeSymbol, convertedElements As BoundConvertedTupleElements) As BoundExpression
Lowering\LocalRewriter\LocalRewriter_FieldAccess.vb (2)
32syntax As SyntaxNode, 71Private Shared Function MakeBadFieldAccess(syntax As SyntaxNode, tupleField As FieldSymbol, rewrittenReceiver As BoundExpression) As BoundBadExpression
Lowering\LocalRewriter\LocalRewriter_ForEach.vb (1)
709syntaxNode As SyntaxNode,
Lowering\LocalRewriter\LocalRewriter_If.vb (1)
112syntaxNode As SyntaxNode,
Lowering\LocalRewriter\LocalRewriter_LateAddressOf.vb (1)
28syntaxNode As SyntaxNode,
Lowering\LocalRewriter\LocalRewriter_LateBindingHelpers.vb (18)
14Private Function LateMakeReceiverArgument(node As SyntaxNode, 34Private Function LateMakeContainerArgument(node As SyntaxNode, 47Private Function LateMakeTypeArgumentArrayArgument(node As SyntaxNode, arguments As BoundTypeArguments, typeArrayType As TypeSymbol) As BoundExpression 56Private Function LateMakeCopyBackArray(node As SyntaxNode, 84Private Function LateMakeArgumentArrayArgument(node As SyntaxNode, 155Private Function LateMakeSetArgumentArrayArgument(node As SyntaxNode, 244Private Shared Function LateAssignToArrayElement(node As SyntaxNode, 260Private Function LateMakeArgumentArrayArgumentNoNamed(node As SyntaxNode, 299Private Function LateMakeArgumentNameArrayArgument(node As SyntaxNode, 412Private Function LateMakeCopyback(syntax As SyntaxNode, 509Private Function LateSet(syntax As SyntaxNode, 590Private Function LateIndexSet(syntax As SyntaxNode, 918Private Shared Function MakeStringLiteral(node As SyntaxNode, 929Private Shared Function MakeBooleanLiteral(node As SyntaxNode, 936Private Function MakeGetTypeExpression(node As SyntaxNode, 944Private Function MakeArrayOfGetTypeExpressions(node As SyntaxNode, 964syntax As SyntaxNode, 989syntax As SyntaxNode,
Lowering\LocalRewriter\LocalRewriter_NullableHelpers.vb (10)
287Private Shared Function NullableNull(syntax As SyntaxNode, nullableType As TypeSymbol) As BoundExpression 318Private Function NullableFalse(syntax As SyntaxNode, nullableOfBoolean As TypeSymbol) As BoundExpression 324Private Function NullableTrue(syntax As SyntaxNode, nullableOfBoolean As TypeSymbol) As BoundExpression 330Private Function GetNullableMethod(syntax As SyntaxNode, nullableType As TypeSymbol, member As SpecialMember, Optional isOptional As Boolean = False) As MethodSymbol 341Private Function NullableOfBooleanValue(syntax As SyntaxNode, isTrue As Boolean, nullableOfBoolean As TypeSymbol) As BoundExpression 392Private Function MakeBinaryExpression(syntax As SyntaxNode, 493Private Function MakeBooleanBinaryExpression(syntax As SyntaxNode, 504Private Shared Function MakeNullLiteral(syntax As SyntaxNode, type As TypeSymbol) As BoundLiteral 518Private Shared Function MakeSequence(syntax As SyntaxNode, 537Private Function MakeTernaryConditionalExpression(syntax As SyntaxNode,
Lowering\LocalRewriter\LocalRewriter_Query.vb (1)
126syntax As SyntaxNode,
Lowering\LocalRewriter\LocalRewriter_RaiseEvent.vb (1)
114Private Function GetWindowsRuntimeEventReceiver(syntax As SyntaxNode, rewrittenReceiver As BoundExpression) As BoundExpression
Lowering\LocalRewriter\LocalRewriter_Return.vb (1)
69Dim syntaxNode As SyntaxNode = node.Syntax
Lowering\LocalRewriter\LocalRewriter_SelectCase.vb (1)
64syntaxNode As SyntaxNode,
Lowering\LocalRewriter\LocalRewriter_SyncLock.vb (2)
166syntaxNode As SyntaxNode, 229syntaxNode As SyntaxNode,
Lowering\LocalRewriter\LocalRewriter_Try.vb (1)
68syntaxNode As SyntaxNode,
Lowering\LocalRewriter\LocalRewriter_TupleLiteralExpression.vb (1)
34Private Function MakeTupleCreationExpression(syntax As SyntaxNode, type As NamedTypeSymbol, rewrittenArguments As ImmutableArray(Of BoundExpression)) As BoundExpression
Lowering\LocalRewriter\LocalRewriter_UnstructuredExceptionHandling.vb (6)
449Private Function AddResumeTargetLabel(syntax As SyntaxNode) As BoundLabelStatement 457Private Sub AddResumeTargetLabelAndUpdateCurrentStatementTemporary(syntax As SyntaxNode, canThrow As Boolean, statements As ArrayBuilder(Of BoundStatement)) 598Private Sub RegisterUnstructuredExceptionHandlingResumeTarget(syntax As SyntaxNode, canThrow As Boolean, statements As ArrayBuilder(Of BoundStatement)) 602Private Function RegisterUnstructuredExceptionHandlingResumeTarget(syntax As SyntaxNode, node As BoundStatement, canThrow As Boolean) As BoundStatement 609Private Function RegisterUnstructuredExceptionHandlingNonThrowingResumeTarget(syntax As SyntaxNode) As BoundLabelStatement 613Private Function RegisterUnstructuredExceptionHandlingResumeTarget(syntax As SyntaxNode, canThrow As Boolean) As ImmutableArray(Of BoundStatement)
Lowering\LocalRewriter\LocalRewriter_Using.vb (1)
194resourceSyntax As SyntaxNode,
Lowering\LocalRewriter\LocalRewriter_With.vb (1)
63Dim syntax As SyntaxNode = node.Syntax
Lowering\LocalRewriter\LocalRewriter_XmlLiterals.vb (8)
148Private Function CreateTempLocal(syntax As SyntaxNode, type As TypeSymbol, expr As BoundExpression, sideEffects As ArrayBuilder(Of BoundExpression)) As BoundLocal 280Private Function CreateTempLocalInExpressionLambda(syntax As SyntaxNode, type As TypeSymbol, expr As BoundExpression) As BoundLocal 289syntax As SyntaxNode, 310Private Function BindXmlNamespace(syntax As SyntaxNode, [namespace] As BoundExpression) As BoundExpression 325Private Function CreateStringLiteral(syntax As SyntaxNode, str As String) As BoundLiteral 329Private Function CreateCompilerGeneratedXmlnsPrefix(syntax As SyntaxNode, prefix As String) As BoundExpression 333Private Function CreateCompilerGeneratedXmlNamespace(syntax As SyntaxNode, [namespace] As String) As BoundExpression 342syntax As SyntaxNode,
Lowering\MethodToClassRewriter\MethodToClassRewriter.MyBaseMyClassWrapper.vb (2)
86Dim syntax As SyntaxNode = Me.CurrentMethod.Syntax 170syntax As SyntaxNode)
Lowering\MethodToClassRewriter\MethodToClassRewriter.vb (1)
45Friend MustOverride Function FramePointer(syntax As SyntaxNode, frameClass As NamedTypeSymbol) As BoundExpression
Lowering\StateMachineRewriter\StateMachineRewriter.StateMachineMethodToClassRewriter.vb (7)
58Private _tryBlockSyntaxForNextFinalizerState As SyntaxNode 141Friend Overrides Function FramePointer(syntax As SyntaxNode, frameClass As NamedTypeSymbol) As BoundExpression 142Dim oldSyntax As SyntaxNode = Me.F.Syntax 160Protected Sub AddResumableState(awaitOrYieldReturnSyntax As SyntaxNode, <Out> ByRef state As StateMachineState, <Out> ByRef resumeLabel As GeneratedLabelSymbol) 178Protected Sub AddStateDebugInfo(node As SyntaxNode, state As StateMachineState) 236Dim oldSyntax As SyntaxNode = Me.F.Syntax 338Dim oldTryBlockSyntax As SyntaxNode = Me._tryBlockSyntaxForNextFinalizerState
Lowering\StateMachineRewriter\StateMachineRewriter.vb (1)
299Dim declaratorSyntax As SyntaxNode = local.GetDeclaratorSyntax()
Lowering\StateMachineRewriter\SynthesizedStateMachineMethod.vb (3)
32syntax As SyntaxNode, 189syntax As SyntaxNode, 242syntax As SyntaxNode,
Lowering\StateMachineRewriter\SynthesizedStateMachineProperty.vb (1)
26syntax As SyntaxNode,
Lowering\SyntheticBoundNodeFactory.vb (9)
32Private _syntax As SyntaxNode 52Public Property Syntax As SyntaxNode 56Set(value As SyntaxNode) 67Public Sub New(topLevelMethod As MethodSymbol, currentMethod As MethodSymbol, node As SyntaxNode, compilationState As TypeCompilationState, diagnostics As BindingDiagnosticBag) 71Public Sub New(topLevelMethod As MethodSymbol, currentMethod As MethodSymbol, currentClass As NamedTypeSymbol, node As SyntaxNode, compilationState As TypeCompilationState, diagnostics As BindingDiagnosticBag) 404Public Function SynthesizedLocal(type As TypeSymbol, Optional kind As SynthesizedLocalKind = SynthesizedLocalKind.LoweringTemp, Optional syntax As SyntaxNode = Nothing) As LocalSymbol 1109Public Function SequencePoint(syntax As SyntaxNode, statement As BoundStatement) As BoundStatement 1113Public Function SequencePoint(syntax As SyntaxNode) As BoundStatement 1117Public Function SequencePointWithSpan(syntax As SyntaxNode, textSpan As TextSpan, boundStatement As BoundStatement) As BoundStatement
Operations\VisualBasicOperationFactory.vb (95)
374Dim syntax As SyntaxNode = boundAssignmentOperator.Syntax 383Dim syntax As SyntaxNode = boundMeReference.Syntax 391Dim syntax As SyntaxNode = boundMyBaseReference.Syntax 399Dim syntax As SyntaxNode = boundMyClassReference.Syntax 406Dim syntax As SyntaxNode = boundLiteral.Syntax 415Dim syntax As SyntaxNode = boundAwaitOperator.Syntax 423Dim syntax As SyntaxNode = boundNameOfOperator.Syntax 433Dim syntax As SyntaxNode = boundLambda.Syntax 451Dim syntax As SyntaxNode = boundCall.Syntax 458Dim syntax As SyntaxNode = boundOmittedArgument.Syntax 466Dim syntax As SyntaxNode = boundParenthesized.Syntax 476Dim syntax As SyntaxNode = boundArrayAccess.Syntax 502Dim syntax As SyntaxNode = boundUnaryOperator.Syntax 515Dim syntax As SyntaxNode = boundUserDefinedUnaryOperator.Syntax 568Dim syntax As SyntaxNode = currentBinary.Syntax 587Dim syntax As SyntaxNode = boundUserDefinedBinaryOperator.Syntax 599Dim syntax As SyntaxNode = boundBinaryConditionalExpression.Syntax 628Dim syntax As SyntaxNode = boundUserDefinedShortCircuitingOperator.Syntax 649Dim syntax As SyntaxNode = boundBadExpression.Syntax 666Dim syntax As SyntaxNode = boundTypeArguments.Syntax 702Dim syntax As SyntaxNode = boundConversion.Syntax 723Dim syntax As SyntaxNode = boundConversionOrCast.Syntax 750Dim syntax As SyntaxNode = boundDelegateCreationExpression.Syntax 771Dim syntax As SyntaxNode = boundDelegateCreationExpression.Syntax 781Dim syntax As SyntaxNode = boundTernaryConditionalExpression.Syntax 793Dim syntax As SyntaxNode = boundTypeOf.Syntax 801Dim syntax As SyntaxNode = boundGetType.Syntax 812Dim syntax As SyntaxNode = boundLateInvocation.Syntax 824Dim syntax As SyntaxNode = boundObjectCreationExpression.Syntax 833Dim syntax As SyntaxNode = boundObjectInitializerExpression.Syntax 841Dim syntax As SyntaxNode = boundCollectionInitializerExpression.Syntax 849Dim syntax As SyntaxNode = boundNewT.Syntax 857Dim syntax As SyntaxNode = creation.Syntax 866Dim syntax As SyntaxNode = boundArrayCreation.Syntax 874Dim syntax As SyntaxNode = boundArrayInitialization.Syntax 886Dim syntax As SyntaxNode = boundPropertyAccess.Syntax 894Dim syntax As SyntaxNode = boundWithLValueExpressionPlaceholder.Syntax 902Dim syntax As SyntaxNode = boundWithRValueExpressionPlaceholder.Syntax 912Dim syntax As SyntaxNode = boundEventAccess.Syntax 923Dim syntax As SyntaxNode = boundFieldAccess.Syntax 934Dim syntax As SyntaxNode = boundConditionalAccess.Syntax 941Dim syntax As SyntaxNode = boundConditionalAccessReceiverPlaceholder.Syntax 949Dim syntax As SyntaxNode = boundParameter.Syntax 958Dim syntax As SyntaxNode = boundLocal.Syntax 984Dim syntax As SyntaxNode = boundLateMemberAccess.Syntax 993Dim syntax As SyntaxNode = boundFieldInitializer.Syntax 1001Dim syntax As SyntaxNode = boundPropertyInitializer.Syntax 1009Dim syntax As SyntaxNode = boundParameterEqualsValue.Syntax 1022Dim syntax As SyntaxNode = boundRValuePlaceholder.Syntax 1064Dim syntax As SyntaxNode = boundIfStatement.Syntax 1077Dim syntax As SyntaxNode = boundSelectStatement.Syntax 1110Dim syntax As SyntaxNode = boundCaseBlock.Syntax 1118Dim syntax As SyntaxNode = boundSimpleCaseClause.Syntax 1127Dim syntax As SyntaxNode = boundRangeCaseClause.Syntax 1135Dim syntax As SyntaxNode = boundRelationalCaseClause.Syntax 1150Dim syntax As SyntaxNode = boundDoLoopStatement.Syntax 1169Dim syntax As SyntaxNode = boundForToStatement.Syntax 1250Dim syntax As SyntaxNode = boundForEachStatement.Syntax 1268Dim syntax As SyntaxNode = boundTryStatement.Syntax 1291Dim syntax As SyntaxNode = boundCatchBlock.Syntax 1299Dim syntax As SyntaxNode = boundBlock.Syntax 1305Dim syntax As SyntaxNode = boundBadStatement.Syntax 1325Dim syntax As SyntaxNode = boundReturnStatement.Syntax 1330Private Shared Function IsEndSubOrFunctionStatement(syntax As SyntaxNode) As Boolean 1337Dim syntax As SyntaxNode = boundThrowStatement.Syntax 1352Dim syntax As SyntaxNode = boundWhileStatement.Syntax 1359Dim syntax As SyntaxNode = boundDimStatement.Syntax 1367Dim syntax As SyntaxNode = boundLocalDeclaration.Syntax 1375Dim syntax As SyntaxNode = boundYieldStatement.Syntax 1383Dim syntax As SyntaxNode = boundLabelStatement.Syntax 1391Dim syntax As SyntaxNode = boundGotoStatement.Syntax 1399Dim syntax As SyntaxNode = boundContinueStatement.Syntax 1407Dim syntax As SyntaxNode = boundExitStatement.Syntax 1422Dim syntax As SyntaxNode = boundSyncLockStatement.Syntax 1428Dim syntax As SyntaxNode = boundNoOpStatement.Syntax 1436Dim syntax As SyntaxNode = boundStopStatement.Syntax 1442Dim syntax As SyntaxNode = boundEndStatement.Syntax 1450Dim syntax As SyntaxNode = boundWithStatement.Syntax 1467Dim syntax As SyntaxNode = boundUsingStatement.Syntax 1474Dim syntax As SyntaxNode = boundExpressionStatement.Syntax 1509Dim syntax As SyntaxNode = boundRaiseEventStatement.Syntax 1530Dim syntax As SyntaxNode = boundAddHandlerStatement.Syntax 1537Dim syntax As SyntaxNode = boundRemoveHandlerStatement.Syntax 1554Dim syntax As SyntaxNode = boundTupleExpression.Syntax 1562Dim syntax As SyntaxNode = boundInterpolatedString.Syntax 1585Dim syntax As SyntaxNode = boundInterpolation.Syntax 1592Dim syntax As SyntaxNode = boundLiteral.Syntax 1599Dim syntax As SyntaxNode = boundAnonymousTypeCreationExpression.Syntax 1613Dim syntax As SyntaxNode = boundAnonymousTypePropertyAccess.Syntax 1619Private Function CreateAnonymousTypePropertyAccessImplicitReceiverOperation(propertySym As IPropertySymbol, syntax As SyntaxNode) As InstanceReferenceOperation 1632Dim syntax As SyntaxNode = boundQueryExpression.Syntax 1649Dim syntax As SyntaxNode = boundAggregateClause.Syntax 1656Dim syntax As SyntaxNode = boundNullableIsTrueOperator.Syntax 1690Dim syntax As SyntaxNode = boundRedimStatement.Syntax 1698Dim syntax As SyntaxNode = boundRedimClause.Syntax
Operations\VisualBasicOperationFactory_Methods.vb (5)
90Dim syntax As SyntaxNode = boundAssignment.Syntax 348Dim syntax As SyntaxNode = If(value.Syntax?.Parent, expression.Syntax) 419Dim initializerSyntax As SyntaxNode = declaratorSyntax.Initializer 468Private Function GetUsingStatementDeclaration(resourceList As ImmutableArray(Of BoundLocalDeclarationBase), syntax As SyntaxNode) As IVariableDeclarationGroupOperation 588Private Shared Function IsDelegateCreation(conversionSyntax As SyntaxNode, operand As BoundNode, targetType As TypeSymbol) As Boolean
Scanner\Blender.vb (2)
109node As SyntaxNode, 131Private Shared Function IsStatementLike(node As SyntaxNode) As Boolean
Semantics\OverloadResolution.vb (8)
810callerInfoOpt As SyntaxNode, 873callerInfoOpt As SyntaxNode, 1004callerInfoOpt As SyntaxNode, 1071callerInfoOpt As SyntaxNode, 2593callerInfoOpt As SyntaxNode, 2859callerInfoOpt As SyntaxNode, 3414Private Shared Function IsWithinAppliedAttributeName(syntax As SyntaxNode) As Boolean 3415Dim parent As SyntaxNode = syntax.Parent
Semantics\TypeInference\TypeArgumentInference.vb (6)
122Public ArgumentLocation As SyntaxNode 228Dim argumentLocation As SyntaxNode 358argumentLocation As SyntaxNode, 1280argumentLocation As SyntaxNode, 1356argumentLocation As SyntaxNode, 1607argumentLocation As SyntaxNode,
SourceGeneration\VisualBasicSyntaxHelper.vb (12)
23Public Overrides Function IsAnyNamespaceBlock(node As SyntaxNode) As Boolean 27Public Overrides Function IsAttribute(node As SyntaxNode) As Boolean 31Public Overrides Function GetNameOfAttribute(node As SyntaxNode) As SyntaxNode 35Public Overrides Function IsAttributeList(node As SyntaxNode) As Boolean 39Public Overrides Sub AddAttributeTargets(node As SyntaxNode, targets As ArrayBuilder(Of SyntaxNode)) 59Public Overrides Function GetAttributesOfAttributeList(node As SyntaxNode) As SeparatedSyntaxList(Of SyntaxNode) 63Public Overrides Function IsLambdaExpression(node As SyntaxNode) As Boolean 67Public Overrides Function GetUnqualifiedIdentifierOfName(node As SyntaxNode) As String 119Public Overrides Function ContainsGlobalAliases(root As SyntaxNode) As Boolean
src\Compilers\VisualBasic\BasicAnalyzerDriver\VisualBasicDeclarationComputer.vb (21)
26node As SyntaxNode, 42node As SyntaxNode, 43shouldSkip As Func(Of SyntaxNode, Integer?, Boolean), 70builder.Add(New DeclarationInfo(name, ImmutableArray(Of SyntaxNode).Empty, declaredSymbol)) 91Dim codeBlocks = SpecializedCollections.SingletonEnumerable(Of SyntaxNode)(t.Initializer).Concat(attributes) 157Dim codeBlocks = SpecializedCollections.SingletonEnumerable(Of SyntaxNode)(methodBlock). 174Private Shared Function GetAttributes(attributeStatements As SyntaxList(Of AttributesStatementSyntax)) As IEnumerable(Of SyntaxNode) 175Dim attributes = SpecializedCollections.EmptyEnumerable(Of SyntaxNode) 183Private Shared Function GetPropertyStatementCodeBlocks(propertyStatement As PropertyStatementSyntax) As IEnumerable(Of SyntaxNode) 184Dim initializer As SyntaxNode = propertyStatement.Initializer 194Private Shared Function GetMethodBaseCodeBlocks(methodBase As MethodBaseSyntax) As IEnumerable(Of SyntaxNode) 236Private Shared Function GetReturnTypeAttributes(asClause As AsClauseSyntax) As IEnumerable(Of SyntaxNode) 239SpecializedCollections.EmptyEnumerable(Of SyntaxNode)) 242Private Shared Iterator Function GetAttributes(attributeLists As SyntaxList(Of AttributeListSyntax)) As IEnumerable(Of SyntaxNode) 250Private Shared Function GetParameterListInitializersAndAttributes(parameterList As ParameterListSyntax) As IEnumerable(Of SyntaxNode) 253SpecializedCollections.EmptyEnumerable(Of SyntaxNode)) 256Private Shared Function GetParameterInitializersAndAttributes(parameter As ParameterSyntax) As IEnumerable(Of SyntaxNode) 257Return SpecializedCollections.SingletonEnumerable(Of SyntaxNode)(parameter.Default).Concat(GetAttributes(parameter.AttributeLists)) 260Private Shared Function GetInitializerNode(variableDeclarator As VariableDeclaratorSyntax) As SyntaxNode 261Dim initializer As SyntaxNode = variableDeclarator.Initializer 269Private Shared Function GetAsNewClauseInitializer(asClause As AsClauseSyntax) As SyntaxNode
Symbols\ConstraintsHelper.vb (1)
448syntaxNode As SyntaxNode,
Symbols\ErrorMethodSymbol.vb (1)
234Friend Overrides ReadOnly Property Syntax As SyntaxNode
Symbols\LexicalSortKey.vb (2)
209Public Shared Function Compare(first As SyntaxNode, second As SyntaxNode, compilation As VisualBasicCompilation) As Integer
Symbols\Metadata\PE\PEMethodSymbol.vb (1)
1167Friend Overrides ReadOnly Property Syntax As SyntaxNode
Symbols\MethodSymbol.vb (1)
200Friend MustOverride ReadOnly Property Syntax As SyntaxNode
Symbols\ReducedExtensionMethodSymbol.vb (1)
535Friend Overrides ReadOnly Property Syntax As SyntaxNode
Symbols\Retargeting\RetargetingMethodSymbol.vb (1)
482Friend Overrides ReadOnly Property Syntax As SyntaxNode
Symbols\SignatureOnlyMethodSymbol.vb (1)
240Friend Overrides ReadOnly Property Syntax As SyntaxNode
Symbols\Source\BoundLambdaParameterSymbol.vb (3)
21Private ReadOnly _syntaxNode As SyntaxNode 28syntaxNode As SyntaxNode, 35Public ReadOnly Property Syntax As SyntaxNode
Symbols\Source\LambdaSymbol.vb (3)
46Private ReadOnly _syntaxNode As SyntaxNode 59syntaxNode As SyntaxNode, 314Friend Overrides ReadOnly Property Syntax As SyntaxNode
Symbols\Source\LocalSymbol.vb (5)
184Friend MustOverride Function GetDeclaratorSyntax() As SyntaxNode 471Private Function ILocalSymbolInternal_GetDeclaratorSyntax() As SyntaxNode Implements ILocalSymbolInternal.GetDeclaratorSyntax 529Friend Overrides Function GetDeclaratorSyntax() As SyntaxNode 530Dim node As SyntaxNode 1021Friend Overrides Function GetDeclaratorSyntax() As SyntaxNode
Symbols\Source\SourceLambdaSymbol.vb (1)
18syntaxNode As SyntaxNode,
Symbols\Source\SourceMethodSymbol.vb (1)
756Friend Overrides ReadOnly Property Syntax As SyntaxNode
Symbols\Source\SourceNamedTypeSymbol_ComClass.vb (1)
1304Friend Overrides ReadOnly Property Syntax As SyntaxNode
Symbols\Source\SynthesizedEntryPointSymbol.vb (1)
74Friend Overrides ReadOnly Property Syntax As SyntaxNode
Symbols\Source\SynthesizedInteractiveInitializerMethod.vb (2)
129Friend Overrides ReadOnly Property Syntax As SyntaxNode 136Dim syntax As SyntaxNode = Me.Syntax
Symbols\Source\SynthesizedLambdaSymbol.vb (1)
20syntaxNode As SyntaxNode,
Symbols\Source\SynthesizedMainTypeEntryPoint.vb (1)
51Dim syntaxNode As SyntaxNode = Me.Syntax
Symbols\Source\SynthesizedSubmissionConstructorSymbol.vb (2)
47Dim node As SyntaxNode = Me.Syntax 56syntax As SyntaxNode,
Symbols\Source\SynthesizedWithEventsAccessorSymbol.vb (1)
56Friend Overrides ReadOnly Property Syntax As SyntaxNode
Symbols\SubstitutedMethodSymbol.vb (1)
459Friend Overrides ReadOnly Property Syntax As SyntaxNode
Symbols\Symbol.vb (1)
918Friend Shared Function IsDefinedInSourceTree(syntaxNode As SyntaxNode, tree As SyntaxTree, definedWithinSpan As TextSpan?, Optional cancellationToken As CancellationToken = Nothing) As Boolean
Symbols\SynthesizedSymbols\SynthesizedConstructorBase.vb (1)
205Friend NotOverridable Overrides ReadOnly Property Syntax As SyntaxNode
Symbols\SynthesizedSymbols\SynthesizedDelegateMethodSymbol.vb (1)
423Friend Overrides ReadOnly Property Syntax As SyntaxNode
Symbols\SynthesizedSymbols\SynthesizedGlobalMethodBase.vb (1)
182Friend NotOverridable Overrides ReadOnly Property Syntax As SyntaxNode
Symbols\SynthesizedSymbols\SynthesizedLocal.vb (3)
18Private ReadOnly _syntaxOpt As SyntaxNode 23Optional syntaxOpt As SyntaxNode = Nothing, 46Friend Overrides Function GetDeclaratorSyntax() As SyntaxNode
Symbols\SynthesizedSymbols\SynthesizedMethod.vb (4)
24Private ReadOnly _syntaxNodeOpt As SyntaxNode 27syntaxNode As SyntaxNode, 182Dim node As SyntaxNode = Me.Syntax 203Friend Overrides ReadOnly Property Syntax As SyntaxNode
Symbols\SynthesizedSymbols\SynthesizedMethodBase.vb (1)
166Friend Overrides ReadOnly Property Syntax As SyntaxNode
Symbols\SynthesizedSymbols\SynthesizedRegularMethodBase.vb (1)
155Friend NotOverridable Overrides ReadOnly Property Syntax As SyntaxNode
Symbols\Tuples\TupleTypeSymbol.vb (3)
367Optional syntax As SyntaxNode = Nothing, 543Private Shared Function GetTupleUnderlyingType(elementTypes As ImmutableArray(Of TypeSymbol), syntax As SyntaxNode, compilation As VisualBasicCompilation, diagnostics As BindingDiagnosticBag) As NamedTypeSymbol 644Friend Shared Function GetWellKnownMemberInType(type As NamedTypeSymbol, relativeMember As WellKnownMember, diagnostics As BindingDiagnosticBag, syntax As SyntaxNode) As Symbol
Symbols\Wrapped\WrappedMethodSymbol.vb (1)
228Friend Overrides ReadOnly Property Syntax As SyntaxNode
Syntax\BaseSyntaxExtensions.vb (1)
26Friend Function ToRed(node As InternalSyntax.VisualBasicSyntaxNode) As SyntaxNode
Syntax\BeginOfBlockSyntaxReference.vb (1)
19Protected Overrides Function Translate(reference As SyntaxReference, cancellationToken As CancellationToken) As SyntaxNode
Syntax\InternalSyntax\SyntaxNode.vb (7)
206Private Shared ReadOnly s_structuresTable As New ConditionalWeakTable(Of SyntaxNode, Dictionary(Of Microsoft.CodeAnalysis.SyntaxTrivia, WeakReference(Of SyntaxNode))) 208Public Overrides Function GetStructure(trivia As Microsoft.CodeAnalysis.SyntaxTrivia) As SyntaxNode 218Dim [structure] As SyntaxNode = Nothing 222Dim weakStructure As WeakReference(Of SyntaxNode) = Nothing 225structsInParent.Add(trivia, New WeakReference(Of SyntaxNode)([structure])) 235Public Overrides Function CreateSeparator(element As SyntaxNode) As CodeAnalysis.SyntaxToken
Syntax\InternalSyntax\SyntaxToken.vb (2)
444Friend Overrides Function CreateRed(parent As SyntaxNode, position As Integer) As SyntaxNode
Syntax\InternalSyntax\SyntaxTrivia.vb (2)
107Friend Overrides Function CreateRed(parent As SyntaxNode, position As Integer) As SyntaxNode
Syntax\LambdaUtilities.vb (36)
16Public Shared Function IsLambda(node As SyntaxNode) As Boolean 43Public Shared Function IsNotLambda(node As SyntaxNode) As Boolean 50Public Shared Function GetLambda(lambdaBody As SyntaxNode) As SyntaxNode 67Public Shared Function GetCorrespondingLambdaBody(oldBody As SyntaxNode, newLambdaOrPeer As SyntaxNode) As SyntaxNode 70Dim newLambdaBody As SyntaxNode = Nothing 101Public Shared Function IsLambdaBody(node As SyntaxNode) As Boolean 102Dim body As SyntaxNode = Nothing 114Public Shared Function IsLambdaBodyStatementOrExpression(node As SyntaxNode, <Out> Optional ByRef lambdaBody As SyntaxNode = Nothing) As Boolean 220Private Shared Function IsJoinClause(node As SyntaxNode) As Boolean 268Private Shared Function GetExpressionRangeVariableLambdaBody(rangeVariable As ExpressionRangeVariableSyntax) As SyntaxNode 305Public Shared Function TryGetLambdaBodies(node As SyntaxNode, <Out> ByRef lambdaBody1 As SyntaxNode, <Out> ByRef lambdaBody2 As SyntaxNode) As Boolean 359Friend Shared Function GetLambdaBodyExpressionsAndStatements(lambdaBody As SyntaxNode) As IEnumerable(Of SyntaxNode) 437Private Shared Function GetAggregateLambdaBodyExpressions(clause As AggregateClauseSyntax) As IEnumerable(Of SyntaxNode) 438Dim result = ArrayBuilder(Of SyntaxNode).GetInstance() 458Private Shared Sub AddFirstJoinVariableRecursive(result As ArrayBuilder(Of SyntaxNode), joinClause As JoinClauseSyntax) 466Private Shared Iterator Function EnumerateExpressions(variables As SeparatedSyntaxList(Of ExpressionRangeVariableSyntax)) As IEnumerable(Of SyntaxNode) 472Private Shared Iterator Function EnumerateJoinClauseLeftExpressions(clause As JoinClauseSyntax) As IEnumerable(Of SyntaxNode) 478Private Shared Iterator Function EnumerateJoinClauseRightExpressions(clause As JoinClauseSyntax) As IEnumerable(Of SyntaxNode) 488Private Shared Function TryGetSimpleLambdaBody(node As SyntaxNode, <Out> ByRef lambdaBody As SyntaxNode) As Boolean 524Friend Shared Function IsLambdaExpressionRangeVariable(expressionRangeVariable As SyntaxNode) As Boolean 557Friend Shared Function IsLambdaCollectionRangeVariable(collectionRangeVariable As SyntaxNode) As Boolean 579Private Shared Function IsQueryStartingClause(clause As SyntaxNode) As Boolean 585Private Shared Function GetCollectionRangeVariables(clause As SyntaxNode) As SeparatedSyntaxList(Of CollectionRangeVariableSyntax) 602Friend Shared Function IsLambdaJoinCondition(joinCondition As SyntaxNode) As Boolean 610Public Shared Function AreEquivalentIgnoringLambdaBodies(oldNode As SyntaxNode, newNode As SyntaxNode) As Boolean 623Friend Shared Function IsNonUserCodeQueryLambda(syntax As SyntaxNode) As Boolean 636Friend Shared Function IsClosureScope(node As SyntaxNode) As Boolean
Syntax\NamespaceDeclarationSyntaxReference.vb (1)
21Protected Overrides Function Translate(reference As SyntaxReference, cancellationToken As CancellationToken) As SyntaxNode
Syntax\SimpleSyntaxReference.vb (3)
16Private ReadOnly _node As SyntaxNode 18Friend Sub New(tree As SyntaxTree, node As SyntaxNode) 35Public Overrides Function GetSyntax(Optional cancellationToken As CancellationToken = Nothing) As SyntaxNode
Syntax\StructuredTriviaSyntax.vb (1)
20Friend Sub New(green As GreenNode, parent As SyntaxNode, startLocation As Integer)
Syntax\SyntaxBindingUtilities.vb (2)
11Public Shared Function BindsToResumableStateMachineState(node As SyntaxNode) As Boolean 15Public Shared Function BindsToTryStatement(node As SyntaxNode) As Boolean
Syntax\SyntaxEquivalence.vb (2)
22Public Function AreEquivalent(before As SyntaxNode, after As SyntaxNode, ignoreChildNode As Func(Of SyntaxKind, Boolean), topLevel As Boolean) As Boolean
Syntax\SyntaxExtensions.vb (3)
24Public Function NormalizeWhitespace(Of TNode As SyntaxNode)(node As TNode, useDefaultCasing As Boolean, indentation As String, elasticTrivia As Boolean) As TNode 29Public Function NormalizeWhitespace(Of TNode As SyntaxNode)(node As TNode, useDefaultCasing As Boolean, Optional indentation As String = Microsoft.CodeAnalysis.SyntaxNodeExtensions.DefaultIndentation, Optional eol As String = Microsoft.CodeAnalysis.SyntaxNodeExtensions.DefaultEOL, Optional elasticTrivia As Boolean = False) As TNode 114Public Function TryGetInferredMemberName(syntax As SyntaxNode) As String
Syntax\SyntaxFactory.vb (7)
956Public Shared Function AreEquivalent(oldNode As SyntaxNode, newNode As SyntaxNode, topLevel As Boolean) As Boolean 969Public Shared Function AreEquivalent(oldNode As SyntaxNode, newNode As SyntaxNode, Optional ignoreChildNode As Func(Of SyntaxKind, Boolean) = Nothing) As Boolean 1000Public Shared Function AreEquivalent(Of TNode As SyntaxNode)(oldList As SyntaxList(Of TNode), newList As SyntaxList(Of TNode), Optional ignoreChildNode As Func(Of SyntaxKind, Boolean) = Nothing) As Boolean 1013Public Shared Function AreEquivalent(Of TNode As SyntaxNode)(oldList As SeparatedSyntaxList(Of TNode), newList As SeparatedSyntaxList(Of TNode), Optional ignoreChildNode As Func(Of SyntaxKind, Boolean) = Nothing) As Boolean 1031Private Shared Function IsPartOfLinqQueryNotFollowedByNewLine(token As SyntaxToken, statementNode As SyntaxNode, endOfFileToken As SyntaxToken) As Boolean
Syntax\SyntaxFacts.vb (17)
124Friend Shared Function IsImplementedMember(node As SyntaxNode) As Boolean 132Friend Shared Function IsHandlesEvent(node As SyntaxNode) As Boolean 142Friend Shared Function IsHandlesContainer(node As SyntaxNode) As Boolean 149Friend Shared Function IsHandlesProperty(node As SyntaxNode) As Boolean 159Public Shared Function IsInNamespaceOrTypeContext(node As SyntaxNode) As Boolean 193Private Shared Function InOrBeforeSpanOrEffectiveTrailingOfNode(node As SyntaxNode, position As Integer) As Boolean 201Friend Shared Function InSpanOrEffectiveTrailingOfNode(node As SyntaxNode, position As Integer) As Boolean 226Friend Shared Function InBlockInterior(possibleBlock As SyntaxNode, position As Integer) As Boolean 235possibleLambda As SyntaxNode, 280Friend Shared Function InBlockInterior(possibleBlock As SyntaxNode, 331Friend Shared Function IsBlockStatement(possibleBlock As SyntaxNode, 510Friend Shared Function BeginOfBlockStatementIfAny(node As SyntaxNode) As SyntaxNode 632Public Shared Function IsAttributeName(node As SyntaxNode) As Boolean 634Dim nextNode As SyntaxNode = node 667Public Shared Function IsNamedArgumentName(node As SyntaxNode) As Boolean 1158Friend Shared Function IsWithinPreprocessorConditionalExpression(node As SyntaxNode) As Boolean
Syntax\SyntaxNodeExtensions.vb (2)
86Public Function IsLambdaExpressionSyntax(this As SyntaxNode) As Boolean 322Public Function QueryClauseKeywordOrRangeVariableIdentifier(syntax As SyntaxNode) As SyntaxToken
Syntax\SyntaxNodeFactories.vb (11)
32root As SyntaxNode, 141''' Since this API does not create a <see cref="SyntaxNode"/> that owns all produced tokens, 772Public Shared Function List(Of TNode As SyntaxNode)() As SyntaxList(Of TNode) 781Public Shared Function SingletonList(Of TNode As SyntaxNode)(node As TNode) As SyntaxList(Of TNode) 790Public Shared Function List(Of TNode As SyntaxNode)(nodes As IEnumerable(Of TNode)) As SyntaxList(Of TNode) 860Public Shared Function SeparatedList(Of TNode As SyntaxNode)() As SeparatedSyntaxList(Of TNode) 869Public Shared Function SingletonSeparatedList(Of TNode As SyntaxNode)(node As TNode) As SeparatedSyntaxList(Of TNode) 878Public Shared Function SeparatedList(Of TNode As SyntaxNode)(nodes As IEnumerable(Of TNode)) As SeparatedSyntaxList(Of TNode) 914Public Shared Function SeparatedList(Of TNode As SyntaxNode)(nodes As IEnumerable(Of TNode), separators As IEnumerable(Of SyntaxToken)) As SeparatedSyntaxList(Of TNode) 964Public Shared Function SeparatedList(Of TNode As SyntaxNode)(nodesAndTokens As IEnumerable(Of SyntaxNodeOrToken)) As SeparatedSyntaxList(Of TNode) 974Public Shared Function SeparatedList(Of TNode As SyntaxNode)(nodesAndTokens As SyntaxNodeOrTokenList) As SeparatedSyntaxList(Of TNode)
Syntax\SyntaxNodeRemover.vb (18)
16Friend Shared Function RemoveNodes(Of TRoot As SyntaxNode)(root As TRoot, nodes As IEnumerable(Of SyntaxNode), options As SyntaxRemoveOptions) As TRoot 17Dim nodesToRemove As SyntaxNode() = nodes.ToArray() 38Private ReadOnly _nodesToRemove As HashSet(Of SyntaxNode) 42Private _directivesToKeep As HashSet(Of SyntaxNode) 44Public Sub New(nodes As SyntaxNode(), options As SyntaxRemoveOptions) 46Me._nodesToRemove = New HashSet(Of SyntaxNode)(nodes) 52Private Shared Function ComputeTotalSpan(nodes As SyntaxNode()) As TextSpan 99Private Function IsForRemoval(node As SyntaxNode) As Boolean 103Private Function ShouldVisit(node As SyntaxNode) As Boolean 107Public Overrides Function Visit(node As SyntaxNode) As SyntaxNode 140Public Overrides Function VisitList(Of TNode As SyntaxNode)(list As SeparatedSyntaxList(Of TNode)) As SeparatedSyntaxList(Of TNode) 211Private Sub AddTrivia(node As SyntaxNode) 233Private Sub AddTrivia(token As SyntaxToken, node As SyntaxNode) 260Private Sub AddTrivia(node As SyntaxNode, token As SyntaxToken) 298Private Sub AddDirectives(node As SyntaxNode, span As TextSpan) 301Me._directivesToKeep = New HashSet(Of SyntaxNode)()
Syntax\SyntaxNormalizer.vb (80)
30Private ReadOnly _lastStatementsInBlocks As HashSet(Of SyntaxNode) = New HashSet(Of SyntaxNode)() 56Friend Shared Function Normalize(Of TNode As SyntaxNode)(node As TNode, indentWhitespace As String, eolWhitespace As String, useElasticTrivia As Boolean, useDefaultCasing As Boolean) As SyntaxNode 682Private Sub AddLinebreaksAfterElementsIfNeeded(Of TNode As SyntaxNode)( 712Private Sub MarkLastStatementIfNeeded(Of TNode As SyntaxNode)(list As SyntaxList(Of TNode)) 731Public Overrides Function VisitCompilationUnit(node As CompilationUnitSyntax) As SyntaxNode 763Public Overrides Function VisitNamespaceBlock(node As NamespaceBlockSyntax) As SyntaxNode 782Public Overrides Function VisitModuleBlock(ByVal node As ModuleBlockSyntax) As SyntaxNode 788Public Overrides Function VisitClassBlock(ByVal node As ClassBlockSyntax) As SyntaxNode 794Public Overrides Function VisitStructureBlock(ByVal node As StructureBlockSyntax) As SyntaxNode 800Public Overrides Function VisitInterfaceBlock(ByVal node As InterfaceBlockSyntax) As SyntaxNode 855Public Overrides Function VisitMultiLineIfBlock(node As MultiLineIfBlockSyntax) As SyntaxNode 889Public Overrides Function VisitEventBlock(node As EventBlockSyntax) As SyntaxNode 898Public Overrides Function VisitDoLoopBlock(node As DoLoopBlockSyntax) As SyntaxNode 914Public Overrides Function VisitSyncLockBlock(node As SyncLockBlockSyntax) As SyntaxNode 928Public Overrides Function VisitMethodBlock(node As MethodBlockSyntax) As SyntaxNode 938Public Overrides Function VisitConstructorBlock(node As ConstructorBlockSyntax) As SyntaxNode 948Public Overrides Function VisitOperatorBlock(node As OperatorBlockSyntax) As SyntaxNode 958Public Overrides Function VisitAccessorBlock(node As AccessorBlockSyntax) As SyntaxNode 971Public Overrides Function VisitEnumBlock(node As EnumBlockSyntax) As SyntaxNode 978Public Overrides Function VisitWhileBlock(node As WhileBlockSyntax) As SyntaxNode 992Public Overrides Function VisitForBlock(node As ForBlockSyntax) As SyntaxNode 998Public Overrides Function VisitForEachBlock(node As ForEachBlockSyntax) As SyntaxNode 1020Public Overrides Function VisitUsingBlock(node As UsingBlockSyntax) As SyntaxNode 1036Public Overrides Function VisitWithBlock(node As WithBlockSyntax) As SyntaxNode 1046Public Overrides Function VisitSelectBlock(node As SelectBlockSyntax) As SyntaxNode 1058Public Overrides Function VisitCaseBlock(node As CaseBlockSyntax) As SyntaxNode 1069Public Overrides Function VisitTryBlock(node As TryBlockSyntax) As SyntaxNode 1086Public Overrides Function VisitCatchBlock(node As CatchBlockSyntax) As SyntaxNode 1094Public Overrides Function VisitFinallyBlock(node As FinallyBlockSyntax) As SyntaxNode 1104Public Overrides Function VisitPropertyBlock(node As PropertyBlockSyntax) As SyntaxNode 1112Public Overrides Function VisitElseBlock(node As ElseBlockSyntax) As SyntaxNode 1122Public Overrides Function VisitElseIfBlock(node As ElseIfBlockSyntax) As SyntaxNode 1132Public Overrides Function VisitMultiLineLambdaExpression(node As MultiLineLambdaExpressionSyntax) As SyntaxNode 1146Public Overrides Function VisitConstDirectiveTrivia(node As ConstDirectiveTriviaSyntax) As SyntaxNode 1152Public Overrides Function VisitIfDirectiveTrivia(node As IfDirectiveTriviaSyntax) As SyntaxNode 1158Public Overrides Function VisitElseDirectiveTrivia(node As ElseDirectiveTriviaSyntax) As SyntaxNode 1164Public Overrides Function VisitEndIfDirectiveTrivia(node As EndIfDirectiveTriviaSyntax) As SyntaxNode 1170Public Overrides Function VisitRegionDirectiveTrivia(node As RegionDirectiveTriviaSyntax) As SyntaxNode 1176Public Overrides Function VisitEndRegionDirectiveTrivia(node As EndRegionDirectiveTriviaSyntax) As SyntaxNode 1182Public Overrides Function VisitExternalSourceDirectiveTrivia(node As ExternalSourceDirectiveTriviaSyntax) As SyntaxNode 1188Public Overrides Function VisitEndExternalSourceDirectiveTrivia(node As EndExternalSourceDirectiveTriviaSyntax) As SyntaxNode 1194Public Overrides Function VisitExternalChecksumDirectiveTrivia(node As ExternalChecksumDirectiveTriviaSyntax) As SyntaxNode 1200Public Overrides Function VisitEnableWarningDirectiveTrivia(node As EnableWarningDirectiveTriviaSyntax) As SyntaxNode 1206Public Overrides Function VisitDisableWarningDirectiveTrivia(node As DisableWarningDirectiveTriviaSyntax) As SyntaxNode 1212Public Overrides Function VisitReferenceDirectiveTrivia(node As ReferenceDirectiveTriviaSyntax) As SyntaxNode 1218Public Overrides Function VisitBadDirectiveTrivia(node As BadDirectiveTriviaSyntax) As SyntaxNode 1224Public Overrides Function VisitAttributeList(node As AttributeListSyntax) As SyntaxNode 1235Public Overrides Function VisitEndBlockStatement(node As EndBlockStatementSyntax) As SyntaxNode 1241Public Overrides Function VisitElseStatement(node As ElseStatementSyntax) As SyntaxNode 1249Public Overrides Function VisitElseIfStatement(node As ElseIfStatementSyntax) As SyntaxNode 1257Public Overrides Function VisitIfStatement(node As IfStatementSyntax) As SyntaxNode 1264Public Overrides Function VisitWithStatement(node As WithStatementSyntax) As SyntaxNode 1271Public Overrides Function VisitSyncLockStatement(node As SyncLockStatementSyntax) As SyntaxNode 1278Public Overrides Function VisitModuleStatement(node As ModuleStatementSyntax) As SyntaxNode 1285Public Overrides Function VisitNamespaceStatement(node As NamespaceStatementSyntax) As SyntaxNode 1292Public Overrides Function VisitInterfaceStatement(node As InterfaceStatementSyntax) As SyntaxNode 1299Public Overrides Function VisitStructureStatement(node As StructureStatementSyntax) As SyntaxNode 1306Public Overrides Function VisitEnumStatement(node As EnumStatementSyntax) As SyntaxNode 1313Public Overrides Function VisitClassStatement(node As ClassStatementSyntax) As SyntaxNode 1320Public Overrides Function VisitWhileStatement(node As WhileStatementSyntax) As SyntaxNode 1327Public Overrides Function VisitDoStatement(node As DoStatementSyntax) As SyntaxNode 1334Public Overrides Function VisitSelectStatement(node As SelectStatementSyntax) As SyntaxNode 1341Public Overrides Function VisitCaseStatement(node As CaseStatementSyntax) As SyntaxNode 1348Public Overrides Function VisitLoopStatement(node As LoopStatementSyntax) As SyntaxNode 1354Public Overrides Function VisitForStatement(node As ForStatementSyntax) As SyntaxNode 1361Public Overrides Function VisitForEachStatement(node As ForEachStatementSyntax) As SyntaxNode 1368Public Overrides Function VisitTryStatement(node As TryStatementSyntax) As SyntaxNode 1375Public Overrides Function VisitCatchStatement(node As CatchStatementSyntax) As SyntaxNode 1383Public Overrides Function VisitFinallyStatement(node As FinallyStatementSyntax) As SyntaxNode 1391Public Overrides Function VisitUsingStatement(node As UsingStatementSyntax) As SyntaxNode 1398Public Overrides Function VisitMethodStatement(node As MethodStatementSyntax) As SyntaxNode 1410Public Overrides Function VisitSubNewStatement(node As SubNewStatementSyntax) As SyntaxNode 1417Public Overrides Function VisitAccessorStatement(node As AccessorStatementSyntax) As SyntaxNode 1424Public Overrides Function VisitOperatorStatement(node As OperatorStatementSyntax) As SyntaxNode 1431Public Overrides Function VisitEventStatement(node As EventStatementSyntax) As SyntaxNode 1442Public Overrides Function VisitPropertyStatement(node As PropertyStatementSyntax) As SyntaxNode 1453Public Overrides Function VisitLabelStatement(node As LabelStatementSyntax) As SyntaxNode 1463Public Overrides Function VisitNextStatement(node As NextStatementSyntax) As SyntaxNode
Syntax\SyntaxReplacer.vb (44)
15Friend Shared Function Replace(Of TNode As SyntaxNode)( 16root As SyntaxNode, 18Optional computeReplacementNode As Func(Of TNode, TNode, SyntaxNode) = Nothing, 22Optional computeReplacementTrivia As Func(Of SyntaxTrivia, SyntaxTrivia, SyntaxTrivia) = Nothing) As SyntaxNode 35Optional nodes As IEnumerable(Of SyntaxNode) = Nothing, 36Optional computeReplacementNode As Func(Of SyntaxNode, SyntaxNode, SyntaxNode) = Nothing, 42Dim replacer = New Replacer(Of SyntaxNode)(nodes, computeReplacementNode, tokens, computeReplacementToken, trivia, computeReplacementTrivia) 51Private Class Replacer(Of TNode As SyntaxNode) 54Private ReadOnly _computeReplacementNode As Func(Of TNode, TNode, SyntaxNode) 58Private ReadOnly _nodeSet As HashSet(Of SyntaxNode) 69computeReplacementNode As Func(Of TNode, TNode, SyntaxNode), 79Me._nodeSet = If(nodes IsNot Nothing, New HashSet(Of SyntaxNode)(nodes), s_noNodes) 96Private Shared ReadOnly s_noNodes As HashSet(Of SyntaxNode) = New HashSet(Of SyntaxNode)() 145Public Overrides Function Visit(node As SyntaxNode) As SyntaxNode 189Public Shared Function ReplaceNodeInList(root As SyntaxNode, originalNode As SyntaxNode, newNodes As IEnumerable(Of SyntaxNode)) As SyntaxNode 193Public Shared Function InsertNodeInList(root As SyntaxNode, nodeInList As SyntaxNode, nodesToInsert As IEnumerable(Of SyntaxNode), insertBefore As Boolean) As SyntaxNode 197Public Shared Function ReplaceTokenInList(root As SyntaxNode, tokenInList As SyntaxToken, newTokens As IEnumerable(Of SyntaxToken)) As SyntaxNode 201Public Shared Function InsertTokenInList(root As SyntaxNode, tokenInList As SyntaxToken, newTokens As IEnumerable(Of SyntaxToken), insertBefore As Boolean) As SyntaxNode 205Public Shared Function ReplaceTriviaInList(root As SyntaxNode, triviaInList As SyntaxTrivia, newTrivia As IEnumerable(Of SyntaxTrivia)) As SyntaxNode 209Public Shared Function InsertTriviaInList(root As SyntaxNode, triviaInList As SyntaxTrivia, newTrivia As IEnumerable(Of SyntaxTrivia), insertBefore As Boolean) As SyntaxNode 260Public Overrides Function Visit(node As SyntaxNode) As SyntaxNode 288Private ReadOnly _originalNode As SyntaxNode 289Private ReadOnly _replacementNodes As IEnumerable(Of SyntaxNode) 291Public Sub New(originalNode As SyntaxNode, replacementNodes As IEnumerable(Of SyntaxNode), editKind As ListEditKind) 297Public Overrides Function Visit(node As SyntaxNode) As SyntaxNode 305Public Overrides Function VisitList(Of TNode As SyntaxNode)(list As SeparatedSyntaxList(Of TNode)) As SeparatedSyntaxList(Of TNode) 322Public Overrides Function VisitList(Of TNode As SyntaxNode)(list As SyntaxList(Of TNode)) As SyntaxList(Of TNode)
Syntax\VisualBasicSyntaxNode.vb (22)
25Friend Sub New(green As GreenNode, parent As SyntaxNode, position As Integer) 54Dim stack = ArrayBuilder(Of SyntaxNode).GetInstance() 57Dim current As SyntaxNode = Me 58Dim rootCandidate As SyntaxNode = Nothing 130Public Shared Function DeserializeFrom(stream As IO.Stream, Optional cancellationToken As CancellationToken = Nothing) As SyntaxNode 393Protected Overrides Function ReplaceCore(Of TNode As SyntaxNode)( 395Optional computeReplacementNode As Func(Of TNode, TNode, SyntaxNode) = Nothing, 399Optional computeReplacementTrivia As Func(Of SyntaxTrivia, SyntaxTrivia, SyntaxTrivia) = Nothing) As SyntaxNode 404Protected Overrides Function RemoveNodesCore(nodes As IEnumerable(Of SyntaxNode), options As SyntaxRemoveOptions) As SyntaxNode 408Protected Overrides Function ReplaceNodeInListCore(originalNode As SyntaxNode, replacementNodes As IEnumerable(Of SyntaxNode)) As SyntaxNode 412Protected Overrides Function InsertNodesInListCore(nodeInList As SyntaxNode, nodesToInsert As IEnumerable(Of SyntaxNode), insertBefore As Boolean) As SyntaxNode 416Protected Overrides Function ReplaceTokenInListCore(originalToken As SyntaxToken, newTokens As IEnumerable(Of SyntaxToken)) As SyntaxNode 420Protected Overrides Function InsertTokensInListCore(originalToken As SyntaxToken, newTokens As IEnumerable(Of SyntaxToken), insertBefore As Boolean) As SyntaxNode 424Protected Overrides Function ReplaceTriviaInListCore(originalTrivia As SyntaxTrivia, newTrivia As IEnumerable(Of SyntaxTrivia)) As SyntaxNode 428Protected Overrides Function InsertTriviaInListCore(originalTrivia As SyntaxTrivia, newTrivia As IEnumerable(Of SyntaxTrivia), insertBefore As Boolean) As SyntaxNode 432Protected Overrides Function NormalizeWhitespaceCore(indentation As String, eol As String, elasticTrivia As Boolean) As SyntaxNode 469Protected Overrides Function IsEquivalentToCore(node As SyntaxNode, Optional topLevel As Boolean = False) As Boolean
Syntax\VisualBasicSyntaxRewriter.vb (7)
10''' Represents a <see cref="VisualBasicSyntaxVisitor"/> which descends an entire <see cref="SyntaxNode"/> graph and 14Inherits VisualBasicSyntaxVisitor(Of SyntaxNode) 30Public Overrides Function Visit(node As SyntaxNode) As SyntaxNode 75Public Overridable Function VisitList(Of TNode As SyntaxNode)(list As SyntaxList(Of TNode)) As SyntaxList(Of TNode) 100Public Overridable Function VisitListElement(Of TNode As SyntaxNode)(node As TNode) As TNode 132Public Overridable Function VisitList(Of TNode As SyntaxNode)(list As SeparatedSyntaxList(Of TNode)) As SeparatedSyntaxList(Of TNode)
Syntax\VisualBasicSyntaxTree.DummySyntaxTree.vb (2)
67Public Overrides Function GetReference(node As SyntaxNode) As SyntaxReference 90Public Overrides Function WithRootAndOptions(root As SyntaxNode, options As ParseOptions) As SyntaxTree
Syntax\VisualBasicSyntaxTree.LazySyntaxTree.vb (2)
110Public Overrides Function GetReference(node As SyntaxNode) As SyntaxReference 114Public Overrides Function WithRootAndOptions(root As SyntaxNode, options As ParseOptions) As SyntaxTree
Syntax\VisualBasicSyntaxTree.ParsedSyntaxTree.vb (2)
135Public Overrides Function GetReference(node As SyntaxNode) As SyntaxReference 139Public Overrides Function WithRootAndOptions(root As SyntaxNode, options As ParseOptions) As SyntaxTree
Syntax\VisualBasicSyntaxTree.vb (6)
210''' <para>NOTE: This method is only intended to be used from <see cref="SyntaxNode.SyntaxTree"/> property.</para> 317Public Overrides Function GetDiagnostics(node As SyntaxNode) As IEnumerable(Of Diagnostic) 383Private Function InDocumentationComment(node As SyntaxNode) As Boolean 542Protected Overrides Function GetRootCore(CancellationToken As CancellationToken) As SyntaxNode 546Protected Overrides Async Function GetRootAsyncCore(cancellationToken As CancellationToken) As Task(Of SyntaxNode) 550Protected Overrides Function TryGetRootCore(ByRef root As SyntaxNode) As Boolean
Syntax\VisualBasicSyntaxVisitor.vb (8)
11''' Represents a <see cref="SyntaxNode"/> visitor that visits only the single SyntaxNode 12''' passed into its <see cref="Visit(SyntaxNode)"/> method. 16Public Overridable Sub Visit(ByVal node As SyntaxNode) 22Public Overridable Sub DefaultVisit(ByVal node As SyntaxNode) 27''' Represents a <see cref="SyntaxNode"/> visitor that visits only the single SyntaxNode 28''' passed into its <see cref="Visit(SyntaxNode)"/> method and produces 36Public Overridable Function Visit(ByVal node As SyntaxNode) As TResult 44Public Overridable Function DefaultVisit(ByVal node As SyntaxNode) As TResult
Syntax\VisualBasicSyntaxWalker.vb (4)
7''' Represents a <see cref="VisualBasicSyntaxVisitor"/> that descends an entire <see cref="SyntaxNode"/> tree 8''' visiting each SyntaxNode and its child <see cref="SyntaxNode"/>s and <see cref="SyntaxToken"/>s in depth-first order. 21Public Overrides Sub Visit(node As SyntaxNode) 32Public Overrides Sub DefaultVisit(node As SyntaxNode)
VisualBasicExtensions.vb (17)
45''' Determines if <see cref="SyntaxNode"/> is of a specified kind. 51Public Function IsKind(node As SyntaxNode, kind As SyntaxKind) As Boolean 66''' <inheritdoc cref="SyntaxNode.ContainsDirective"/> 68Public Function ContainsDirective(node As SyntaxNode, kind As SyntaxKind) As Boolean 79Public Function IndexOf(Of TNode As SyntaxNode)(list As SyntaxList(Of TNode), kind As SyntaxKind) As Integer 89Public Function Any(Of TNode As SyntaxNode)(list As SyntaxList(Of TNode), kind As SyntaxKind) As Boolean 100Public Function IndexOf(Of TNode As SyntaxNode)(list As SeparatedSyntaxList(Of TNode), kind As SyntaxKind) As Integer 110Public Function Any(Of TNode As SyntaxNode)(list As SeparatedSyntaxList(Of TNode), kind As SyntaxKind) As Boolean 205''' Returns <see cref="SyntaxKind"/> for <see cref="SyntaxNode"/> from <see cref="SyntaxNode.RawKind"/> property. 208Public Function Kind(node As SyntaxNode) As SyntaxKind 453Friend Function AsSeparatedList(Of TOther As SyntaxNode)(list As SyntaxNodeOrTokenList) As SeparatedSyntaxList(Of TOther) 458builder.Add(DirectCast(DirectCast(node, SyntaxNode), TOther)) 473Public Function GetDirectives(node As SyntaxNode, Optional filter As Func(Of DirectiveTriviaSyntax, Boolean) = Nothing) As IList(Of DirectiveTriviaSyntax) 483<Extension> Public Function GetFirstDirective(node As SyntaxNode, Optional predicate As Func(Of DirectiveTriviaSyntax, Boolean) = Nothing) As DirectiveTriviaSyntax 494Public Function GetLastDirective(node As SyntaxNode, Optional predicate As Func(Of DirectiveTriviaSyntax, Boolean) = Nothing) As DirectiveTriviaSyntax 1371Public Function GetConversion(semanticModel As SemanticModel, expression As SyntaxNode, Optional cancellationToken As CancellationToken = Nothing) As Conversion
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (556)
src\Analyzers\VisualBasic\Analyzers\NewLines\ConsecutiveStatementPlacement\VisualBasicConsecutiveStatementPlacementDiagnosticAnalyzer.vb (2)
37Protected Overrides Function IsBlockLikeStatement(node As SyntaxNode) As Boolean 43Protected Overrides Function GetDiagnosticLocation(block As SyntaxNode) As Location
src\Analyzers\VisualBasic\Analyzers\OrderModifiers\VisualBasicOrderModifiersDiagnosticAnalyzer.vb (1)
31root As SyntaxNode)
src\Analyzers\VisualBasic\Analyzers\QualifyMemberAccess\VisualBasicQualifyMemberAccessDiagnosticAnalyzer.vb (1)
26Protected Overrides Function CanMemberAccessBeQualified(containingSymbol As ISymbol, node As SyntaxNode) As Boolean
src\Analyzers\VisualBasic\Analyzers\RemoveUnnecessaryImports\VisualBasicRemoveUnnecessaryImportsDiagnosticAnalyzer.vb (4)
36Protected Overrides Function MergeImports(unnecessaryImports As ImmutableArray(Of ImportsClauseSyntax)) As ImmutableArray(Of SyntaxNode) 37Dim result = ArrayBuilder(Of SyntaxNode).GetInstance() 55nodes As IEnumerable(Of SyntaxNode), tree As SyntaxTree, cancellationToken As CancellationToken) As IEnumerable(Of TextSpan) 60Protected Overrides Function TryGetLastToken(node As SyntaxNode) As SyntaxToken?
src\Analyzers\VisualBasic\Analyzers\RemoveUnnecessarySuppressions\VisualBasicRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.vb (1)
33Protected Overrides Function ContainsPragmaDirective(root As SyntaxNode) As Boolean
src\Analyzers\VisualBasic\Analyzers\RemoveUnusedMembers\VisualBasicRemoveUnusedMembersDiagnosticAnalyzer.vb (2)
66Protected Overrides Function GetParentIfSoleDeclarator(node As SyntaxNode) As SyntaxNode
src\Analyzers\VisualBasic\Analyzers\RemoveUnusedParametersAndValues\VisualBasicRemoveUnusedParametersAndValuesDiagnosticAnalyzer.vb (2)
45Protected Overrides Function IsIfConditionalDirective(node As SyntaxNode) As Boolean 53Protected Overrides Function ReturnsThrow(node As SyntaxNode) As Boolean
src\Analyzers\VisualBasic\Analyzers\SimplifyInterpolation\VisualBasicSimplifyInterpolationHelpers.vb (1)
18Protected Overrides Function GetPreservedInterpolationExpressionSyntax(operation As IOperation) As SyntaxNode
src\Analyzers\VisualBasic\Analyzers\UseAutoProperty\Utilities.vb (1)
9Friend Function GetNodeToRemove(identifier As ModifiedIdentifierSyntax) As SyntaxNode
src\Analyzers\VisualBasic\Analyzers\UseAutoProperty\VisualBasicUseAutoPropertyAnalyzer.vb (3)
51ineligibleFieldUsageIfOutsideProperty As ConcurrentDictionary(Of IFieldSymbol, ConcurrentSet(Of SyntaxNode)), 53codeBlock As SyntaxNode, 147Protected Overrides Function GetFieldNode(fieldDeclaration As FieldDeclarationSyntax, identifier As ModifiedIdentifierSyntax) As SyntaxNode
src\Analyzers\VisualBasic\Analyzers\UseCoalesceExpression\VisualBasicUseCoalesceExpressionForIfNullStatementCheckDiagnosticAnalyzer.vb (1)
32Protected Overrides Function GetDeclarationNode(declarator As VariableDeclaratorSyntax) As SyntaxNode
src\Analyzers\VisualBasic\Analyzers\UseCollectionInitializer\VisualBasicCollectionInitializerAnalyzer.vb (3)
31Protected Overrides Function IsComplexElementInitializer(expression As SyntaxNode) As Boolean 42preMatches As ArrayBuilder(Of CollectionMatch(Of SyntaxNode)), 43postMatches As ArrayBuilder(Of CollectionMatch(Of SyntaxNode)),
src\Analyzers\VisualBasic\Analyzers\UseCollectionInitializer\VisualBasicUseCollectionInitializerDiagnosticAnalyzer.vb (1)
47matches As ImmutableArray(Of CollectionMatch(Of SyntaxNode)),
src\Analyzers\VisualBasic\Analyzers\ValidateFormatString\VisualBasicValidateFormatStringDiagnosticAnalyzer.vb (4)
22arguments As SeparatedSyntaxList(Of SyntaxNode), 23searchArgumentName As String) As SyntaxNode 35Protected Overrides Function GetArgumentExpression(syntaxNode As SyntaxNode) As SyntaxNode
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\DirectiveSyntaxExtensions.vb (5)
13Private ReadOnly s_rootToDirectiveInfo As New ConditionalWeakTable(Of SyntaxNode, DirectiveInfo(Of DirectiveTriviaSyntax))() 15Private Function GetDirectiveInfo(node As SyntaxNode, cancellationToken As CancellationToken) As DirectiveInfo(Of DirectiveTriviaSyntax) 19Private Function GetDirectiveInfoForRoot(root As SyntaxNode, cancellationToken As CancellationToken) As DirectiveInfo(Of DirectiveTriviaSyntax) 25Private Function GetAbsoluteRoot(node As SyntaxNode) As SyntaxNode
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\MemberAccessExpressionSyntaxExtensions.vb (2)
49Dim statement As SyntaxNode 100Dim current As SyntaxNode = memberAccessExpression
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SemanticModelExtensions.vb (1)
82Public Function GetImportNamespacesInScope(semanticModel As SemanticModel, location As SyntaxNode) As ISet(Of INamespaceSymbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\StatementSyntaxExtensions.vb (4)
159Public Function GetModifiers(member As SyntaxNode) As SyntaxTokenList 217Public Function WithModifiers(Of TNode As SyntaxNode)(member As TNode, modifiers As SyntaxTokenList) As TNode 221Private Function WithModifiersHelper(member As SyntaxNode, modifiers As SyntaxTokenList) As SyntaxNode
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxNodeExtensions.vb (66)
17Public Function IsParentKind(node As SyntaxNode, kind As SyntaxKind) As Boolean 23Public Function IsParentKind(node As SyntaxNode, kind1 As SyntaxKind, kind2 As SyntaxKind) As Boolean 29Public Function IsParentKind(node As SyntaxNode, kind1 As SyntaxKind, kind2 As SyntaxKind, kind3 As SyntaxKind) As Boolean 35Public Function IsKind(node As SyntaxNode, kind1 As SyntaxKind, kind2 As SyntaxKind) As Boolean 45Public Function IsKind(node As SyntaxNode, kind1 As SyntaxKind, kind2 As SyntaxKind, kind3 As SyntaxKind) As Boolean 56Public Function IsKind(node As SyntaxNode, kind1 As SyntaxKind, kind2 As SyntaxKind, kind3 As SyntaxKind, kind4 As SyntaxKind) As Boolean 68Public Function IsKind(node As SyntaxNode, ParamArray kinds As SyntaxKind()) As Boolean 77Public Function IsInConstantContext(expression As SyntaxNode) As Boolean 87Public Function IsInStaticContext(node As SyntaxNode) As Boolean 99Public Function IsStatementContainerNode(node As SyntaxNode) As Boolean 113Public Function GetStatements(node As SyntaxNode) As SyntaxList(Of StatementSyntax) 213Friend Function IsAsyncSupportedFunctionSyntax(node As SyntaxNode) As Boolean 229Friend Function IsMultiLineLambda(node As SyntaxNode) As Boolean 254Public Function SpansPreprocessorDirective(Of TSyntaxNode As SyntaxNode)(list As IEnumerable(Of TSyntaxNode)) As Boolean 259Public Function ConvertToSingleLine(Of TNode As SyntaxNode)(node As TNode, Optional useElasticTrivia As Boolean = False) As TNode 275Public Function SplitNodesOnPreprocessorBoundaries(Of TSyntaxNode As SyntaxNode)( 373Public Function ContainsInterleavedDirective(node As SyntaxNode, cancellationToken As CancellationToken) As Boolean 438Public Function GetLeadingBlankLines(Of TSyntaxNode As SyntaxNode)(node As TSyntaxNode) As ImmutableArray(Of SyntaxTrivia) 443Public Function GetNodeWithoutLeadingBlankLines(Of TSyntaxNode As SyntaxNode)(node As TSyntaxNode) As TSyntaxNode 448Public Function GetNodeWithoutLeadingBlankLines(Of TSyntaxNode As SyntaxNode)(node As TSyntaxNode, ByRef strippedTrivia As ImmutableArray(Of SyntaxTrivia)) As TSyntaxNode 453Public Function GetLeadingBannerAndPreprocessorDirectives(Of TSyntaxNode As SyntaxNode)(node As TSyntaxNode) As ImmutableArray(Of SyntaxTrivia) 458Public Function GetNodeWithoutLeadingBannerAndPreprocessorDirectives(Of TSyntaxNode As SyntaxNode)(node As TSyntaxNode) As TSyntaxNode 463Public Function GetNodeWithoutLeadingBannerAndPreprocessorDirectives(Of TSyntaxNode As SyntaxNode)(node As TSyntaxNode, ByRef strippedTrivia As ImmutableArray(Of SyntaxTrivia)) As TSyntaxNode 472Public Function IsExecutableBlock(node As SyntaxNode) As Boolean 505Public Function GetContainingExecutableBlocks(node As SyntaxNode) As IEnumerable(Of SyntaxNode) 512Public Function GetContainingMultiLineExecutableBlocks(node As SyntaxNode) As IEnumerable(Of SyntaxNode) 519Public Function FindInnermostCommonExecutableBlock(nodes As IEnumerable(Of SyntaxNode)) As SyntaxNode 520Dim blocks As IEnumerable(Of SyntaxNode) = Nothing 531Public Function GetExecutableBlockStatements(node As SyntaxNode) As SyntaxList(Of StatementSyntax) 579Public Function ReplaceStatements(node As SyntaxNode, 581ParamArray annotations As SyntaxAnnotation()) As SyntaxNode 611ParamArray annotations As SyntaxAnnotation()) As SyntaxNode 638executableBlock As SyntaxNode, 640ParamArray annotations As SyntaxAnnotation()) As SyntaxNode 650Public Function IsSingleLineExecutableBlock(executableBlock As SyntaxNode) As Boolean 662Public Function IsMultiLineExecutableBlock(node As SyntaxNode) As Boolean 666Private Sub UpdateStatements(executableBlock As SyntaxNode, 714block As SyntaxNode, 716ParamArray annotations As SyntaxAnnotation()) As SyntaxNode 754Public Function GetBraces(node As SyntaxNode) As (openBrace As SyntaxToken, closeBrace As SyntaxToken) 759Function(n As SyntaxNode) CType(Nothing, (SyntaxToken, SyntaxToken))) 763Public Function GetParentheses(node As SyntaxNode) As ValueTuple(Of SyntaxToken, SyntaxToken) 782Function(n As SyntaxNode) CType(Nothing, (SyntaxToken, SyntaxToken))) 786Public Function IsLeftSideOfSimpleAssignmentStatement(node As SyntaxNode) As Boolean 792Public Function IsLeftSideOfAnyAssignmentStatement(node As SyntaxNode) As Boolean 799Public Function IsAnyAssignmentStatement(node As SyntaxNode) As Boolean 805Public Function IsLeftSideOfCompoundAssignmentStatement(node As SyntaxNode) As Boolean 812Public Function IsCompoundAssignmentStatement(node As SyntaxNode) As Boolean 832Public Function ParentingNodeContainsDiagnostics(node As SyntaxNode) As Boolean 856Public Function CheckTopLevel(node As SyntaxNode, span As TextSpan) As Boolean 890Public Function GetMembers(node As SyntaxNode) As SyntaxList(Of StatementSyntax) 915Public Function GetBodies(node As SyntaxNode) As IEnumerable(Of SyntaxNode) 951Return SpecializedCollections.EmptyEnumerable(Of SyntaxNode)() 1066Public Function IsInExpressionTree(node As SyntaxNode, 1106Public Function GetParameterList(declaration As SyntaxNode) As ParameterListSyntax 1148Public Function GetAttributeLists(node As SyntaxNode) As SyntaxList(Of AttributeListSyntax) 1220Public Function GetBlockFromBegin(node As SyntaxNode) As SyntaxNode 1221Dim parent As SyntaxNode = node.Parent 1222Dim begin As SyntaxNode = Nothing 1262Dim parent As SyntaxNode = node.Parent 1263Dim begin As SyntaxNode = Nothing
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxTokenExtensions.vb (11)
62Public Function FirstAncestorOrSelf(token As SyntaxToken, predicate As Func(Of SyntaxNode, Boolean)) As SyntaxNode 67Public Function HasAncestor(Of T As SyntaxNode)(token As SyntaxToken) As Boolean 78Public Function IsChildToken(Of TParent As SyntaxNode)(token As SyntaxToken, childGetter As Func(Of TParent, SyntaxToken)) As Boolean 97Public Function IsChildSeparatorToken(Of TParent As SyntaxNode, TChild As SyntaxNode)(token As SyntaxToken, childGetter As Func(Of TParent, SeparatedSyntaxList(Of TChild))) As Boolean 115Public Function IsDescendantOf(token As SyntaxToken, node As SyntaxNode) As Boolean 121Friend Function GetInnermostDeclarationContext(node As SyntaxToken) As SyntaxNode 122Dim ancestors = node.GetAncestors(Of SyntaxNode) 156Private Function FilterAncestors(ancestors As IEnumerable(Of SyntaxNode), 158precedingEndBlock As EndBlockStatementSyntax) As IEnumerable(Of SyntaxNode)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxTreeExtensions.vb (3)
88Private Function PartOfSingleLineLambda(node As SyntaxNode) As Boolean 99Private Function PartOfMultilineLambdaFooter(node As SyntaxNode) As Boolean 372Public Function GetFirstEnclosingStatement(node As SyntaxNode) As StatementSyntax
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxTriviaExtensions.vb (1)
44Public Function IsPragmaDirective(trivia As SyntaxTrivia, ByRef isDisable As Boolean, ByRef isActive As Boolean, ByRef errorCodes As SeparatedSyntaxList(Of SyntaxNode)) As Boolean
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Helpers\RemoveUnnecessaryImports\VisualBasicRemoveUnnecessaryImportsRewriter.vb (4)
34Public Overrides Function DefaultVisit(node As SyntaxNode) As SyntaxNode 39Public Overrides Function VisitImportsStatement(node As ImportsStatementSyntax) As SyntaxNode 138Public Overrides Function VisitCompilationUnit(node As CompilationUnitSyntax) As SyntaxNode
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Helpers\RemoveUnnecessaryImports\VisualBasicUnnecessaryImportsProvider.vb (5)
27predicate As Func(Of SyntaxNode, Boolean), 31predicate = If(predicate, Functions(Of SyntaxNode).True) 88predicate As Func(Of SyntaxNode, Boolean), 112predicate As Func(Of SyntaxNode, Boolean), 135predicate As Func(Of SyntaxNode, Boolean),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Services\SelectedMembers\VisualBasicSelectedMembers.vb (3)
27Protected Overrides Function GetDeclaratorsAndIdentifiers(member As StatementSyntax) As ImmutableArray(Of (declarator As SyntaxNode, identifier As SyntaxToken)) 31Select(Function(name) (declarator:=DirectCast(name, SyntaxNode), identifier:=name.Identifier))). 34Return ImmutableArray.Create((declaration:=DirectCast(member, SyntaxNode), identifier:=member.GetNameToken()))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Services\SemanticFacts\VisualBasicSemanticFacts.vb (26)
40Public Function IsOnlyWrittenTo(semanticModel As SemanticModel, node As SyntaxNode, cancellationToken As CancellationToken) As Boolean Implements ISemanticFacts.IsOnlyWrittenTo 44Public Function IsWrittenTo(semanticModel As SemanticModel, node As SyntaxNode, cancellationToken As CancellationToken) As Boolean Implements ISemanticFacts.IsWrittenTo 48Public Function IsInOutContext(semanticModel As SemanticModel, node As SyntaxNode, cancellationToken As CancellationToken) As Boolean Implements ISemanticFacts.IsInOutContext 52Public Function IsInRefContext(semanticModel As SemanticModel, node As SyntaxNode, cancellationToken As CancellationToken) As Boolean Implements ISemanticFacts.IsInRefContext 56Public Function IsInInContext(semanticModel As SemanticModel, node As SyntaxNode, cancellationToken As CancellationToken) As Boolean Implements ISemanticFacts.IsInInContext 60Public Function CanReplaceWithRValue(semanticModel As SemanticModel, expression As SyntaxNode, cancellationToken As CancellationToken) As Boolean Implements ISemanticFacts.CanReplaceWithRValue 67For Each ancestor In token.GetAncestors(Of SyntaxNode)() 110Public Function TryGetSpeculativeSemanticModel(oldSemanticModel As SemanticModel, oldNode As SyntaxNode, newNode As SyntaxNode, <Out> ByRef speculativeModel As SemanticModel) As Boolean Implements ISemanticFacts.TryGetSpeculativeSemanticModel 167Public Function GetForEachSymbols(model As SemanticModel, forEachStatement As SyntaxNode) As ForEachSymbols Implements ISemanticFacts.GetForEachSymbols 193Public Function GetCollectionInitializerSymbolInfo(semanticModel As SemanticModel, node As SyntaxNode, cancellationToken As CancellationToken) As SymbolInfo Implements ISemanticFacts.GetCollectionInitializerSymbolInfo 197Public Function GetGetAwaiterMethod(model As SemanticModel, node As SyntaxNode) As IMethodSymbol Implements ISemanticFacts.GetGetAwaiterMethod 207Public Function GetDeconstructionAssignmentMethods(model As SemanticModel, deconstruction As SyntaxNode) As ImmutableArray(Of IMethodSymbol) Implements ISemanticFacts.GetDeconstructionAssignmentMethods 211Public Function GetDeconstructionForEachMethods(model As SemanticModel, deconstruction As SyntaxNode) As ImmutableArray(Of IMethodSymbol) Implements ISemanticFacts.GetDeconstructionForEachMethods 223Public Function GetDeclaredSymbols(semanticModel As SemanticModel, memberDeclaration As SyntaxNode, cancellationToken As CancellationToken) As IEnumerable(Of ISymbol) Implements ISemanticFacts.GetDeclaredSymbols 233Public Function FindParameterForArgument(semanticModel As SemanticModel, argument As SyntaxNode, allowUncertainCandidates As Boolean, allowParams As Boolean, cancellationToken As CancellationToken) As IParameterSymbol Implements ISemanticFacts.FindParameterForArgument 237Public Function FindParameterForAttributeArgument(semanticModel As SemanticModel, argument As SyntaxNode, allowUncertainCandidates As Boolean, allowParams As Boolean, cancellationToken As CancellationToken) As IParameterSymbol Implements ISemanticFacts.FindParameterForAttributeArgument 241Public Function FindFieldOrPropertyForArgument(semanticModel As SemanticModel, node As SyntaxNode, cancellationToken As CancellationToken) As ISymbol Implements ISemanticFacts.FindFieldOrPropertyForArgument 256Public Function FindFieldOrPropertyForAttributeArgument(semanticModel As SemanticModel, node As SyntaxNode, cancellationToken As CancellationToken) As ISymbol Implements ISemanticFacts.FindFieldOrPropertyForAttributeArgument 260Public Function GetBestOrAllSymbols(semanticModel As SemanticModel, node As SyntaxNode, token As SyntaxToken, cancellationToken As CancellationToken) As ImmutableArray(Of ISymbol) Implements ISemanticFacts.GetBestOrAllSymbols 271Public Function IsInsideNameOfExpression(semanticModel As SemanticModel, node As SyntaxNode, cancellationToken As CancellationToken) As Boolean Implements ISemanticFacts.IsInsideNameOfExpression 279Public Function IsInExpressionTree(semanticModel As SemanticModel, node As SyntaxNode, expressionTypeOpt As INamedTypeSymbol, cancellationToken As CancellationToken) As Boolean Implements ISemanticFacts.IsInExpressionTree 284expression As SyntaxNode, 291Public Function GetPreprocessingSymbol(model As SemanticModel, node As SyntaxNode) As IPreprocessingSymbol Implements ISemanticFacts.GetPreprocessingSymbol 313Dim current As SyntaxNode = node 314Dim parent As SyntaxNode = node.Parent
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Services\SyntaxFacts\VisualBasicAccessibilityFacts.vb (5)
23Public Function CanHaveAccessibility(declaration As SyntaxNode, Optional ignoreDeclarationModifiers As Boolean = False) As Boolean Implements IAccessibilityFacts.CanHaveAccessibility 82Private Shared Function IsChildOf(node As SyntaxNode, kind As SyntaxKind) As Boolean 86Private Shared Function IsChildOfVariableDeclaration(node As SyntaxNode) As Boolean 90Public Function GetAccessibility(declaration As SyntaxNode) As Accessibility Implements IAccessibilityFacts.GetAccessibility 103Public Shared Function GetModifierTokens(declaration As SyntaxNode) As SyntaxTokenList
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Services\SyntaxFacts\VisualBasicBlockFacts.vb (9)
13Public Overrides Function IsScopeBlock(node As SyntaxNode) As Boolean 18Public Overrides Function IsExecutableBlock(node As SyntaxNode) As Boolean 22Public Overrides Function GetExecutableBlockStatements(node As SyntaxNode) As IReadOnlyList(Of SyntaxNode) 26Public Overrides Function FindInnermostCommonExecutableBlock(nodes As IEnumerable(Of SyntaxNode)) As SyntaxNode 30Public Overrides Function IsStatementContainer(node As SyntaxNode) As Boolean 34Public Overrides Function GetStatementContainerStatements(node As SyntaxNode) As IReadOnlyList(Of SyntaxNode)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Services\SyntaxFacts\VisualBasicDocumentationCommentService.vb (1)
49Protected Overrides Function GetName(xmlElement As XmlElementSyntax) As SyntaxNode
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Services\SyntaxFacts\VisualBasicHeaderFacts.vb (18)
21root As SyntaxNode, 24ByRef typeDeclaration As SyntaxNode) As Boolean 43Public Overrides Function IsOnPropertyDeclarationHeader(root As SyntaxNode, position As Integer, ByRef propertyDeclaration As SyntaxNode) As Boolean 58Public Overrides Function IsOnParameterHeader(root As SyntaxNode, position As Integer, ByRef parameter As SyntaxNode) As Boolean 69Public Overrides Function IsOnMethodHeader(root As SyntaxNode, position As Integer, ByRef method As SyntaxNode) As Boolean 88Public Overrides Function IsOnLocalFunctionHeader(root As SyntaxNode, position As Integer, ByRef localFunction As SyntaxNode) As Boolean 93Public Overrides Function IsOnLocalDeclarationHeader(root As SyntaxNode, position As Integer, ByRef localDeclaration As SyntaxNode) As Boolean 107Public Overrides Function IsOnIfStatementHeader(root As SyntaxNode, position As Integer, ByRef ifStatement As SyntaxNode) As Boolean 125Public Overrides Function IsOnWhileStatementHeader(root As SyntaxNode, position As Integer, ByRef whileStatement As SyntaxNode) As Boolean 137Public Overrides Function IsOnForeachHeader(root As SyntaxNode, position As Integer, ByRef foreachStatement As SyntaxNode) As Boolean
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Services\SyntaxFacts\VisualBasicSyntaxFacts.vb (316)
31Private Shared ReadOnly s_syntaxNodeListPool As ObjectPool(Of List(Of SyntaxNode)) = New ObjectPool(Of List(Of SyntaxNode))(Function() New List(Of SyntaxNode), trimOnFree:=False) 146Public Function IsDirective(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsDirective 150Public Function TryGetExternalSourceInfo(node As SyntaxNode, ByRef info As ExternalSourceInfo) As Boolean Implements ISyntaxFacts.TryGetExternalSourceInfo 164Public Function IsDeclarationExpression(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsDeclarationExpression 169Public Function IsNameOfSimpleMemberAccessExpression(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsNameOfSimpleMemberAccessExpression 174Public Function IsNameOfAnyMemberAccessExpression(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsNameOfAnyMemberAccessExpression 179Public Function GetStandaloneExpression(node As SyntaxNode) As SyntaxNode Implements ISyntaxFacts.GetStandaloneExpression 183Public Function GetRootConditionalAccessExpression(node As SyntaxNode) As SyntaxNode Implements ISyntaxFacts.GetRootConditionalAccessExpression 187Public Function IsNamedArgument(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsNamedArgument 192Public Function IsNameOfNamedArgument(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsNameOfNamedArgument 196Public Function GetParameterList(node As SyntaxNode) As SyntaxNode Implements ISyntaxFacts.GetParameterList 200Public Function IsParameterList(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsParameterList 204Public Function IsUsingDirectiveName(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsUsingDirectiveName 209Public Function IsDeconstructionAssignment(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsDeconstructionAssignment 213Public Function IsDeconstructionForEachStatement(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsDeconstructionForEachStatement 217Public Function IsStatement(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsStatement 221Public Function IsExecutableStatement(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsExecutableStatement 225Public Function IsGlobalStatement(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsGlobalStatement 230Public Function GetStatementOfGlobalStatement(node As SyntaxNode) As SyntaxNode Implements ISyntaxFacts.GetStatementOfGlobalStatement 235Public Function AreStatementsInSameContainer(firstStatement As SyntaxNode, secondStatement As SyntaxNode) As Boolean Implements ISyntaxFacts.AreStatementsInSameContainer 242Public Function IsMethodBody(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsMethodBody 246Public Function GetExpressionOfRefExpression(node As SyntaxNode) As SyntaxNode Implements ISyntaxFacts.GetExpressionOfRefExpression 250Public Function GetExpressionOfReturnStatement(node As SyntaxNode) As SyntaxNode Implements ISyntaxFacts.GetExpressionOfReturnStatement 313Public Function IsPredefinedType(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsPredefinedType 318Public Function IsPredefinedType(node As SyntaxNode, type As PredefinedType) As Boolean Implements ISyntaxFacts.IsPredefinedType 522Public Function IsPointerMemberAccessExpression(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsPointerMemberAccessExpression 526Public Sub GetNameAndArityOfSimpleName(node As SyntaxNode, ByRef name As String, ByRef arity As Integer) Implements ISyntaxFacts.GetNameAndArityOfSimpleName 532Public Function LooksGeneric(name As SyntaxNode) As Boolean Implements ISyntaxFacts.LooksGeneric 536Public Function GetTypeArgumentsOfGenericName(genericName As SyntaxNode) As SeparatedSyntaxList(Of SyntaxNode) Implements ISyntaxFacts.GetTypeArgumentsOfGenericName 545Public Function GetExpressionOfMemberAccessExpression(node As SyntaxNode, Optional allowImplicitTarget As Boolean = False) As SyntaxNode Implements ISyntaxFacts.GetExpressionOfMemberAccessExpression 549Public Function GetTargetOfMemberBinding(node As SyntaxNode) As SyntaxNode Implements ISyntaxFacts.GetTargetOfMemberBinding 554Public Function GetNameOfMemberBindingExpression(node As SyntaxNode) As SyntaxNode Implements ISyntaxFacts.GetNameOfMemberBindingExpression 559Public Sub GetPartsOfElementAccessExpression(node As SyntaxNode, ByRef expression As SyntaxNode, ByRef argumentList As SyntaxNode) Implements ISyntaxFacts.GetPartsOfElementAccessExpression 575Public Function GetExpressionOfInterpolation(node As SyntaxNode) As SyntaxNode Implements ISyntaxFacts.GetExpressionOfInterpolation 579Public Function IsInNamespaceOrTypeContext(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsInNamespaceOrTypeContext 583Public Function IsBaseTypeList(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsBaseTypeList 587Public Function IsInStaticContext(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsInStaticContext 591Public Function GetExpressionOfArgument(node As SyntaxNode) As SyntaxNode Implements ISyntaxFacts.GetExpressionOfArgument 595Public Function GetExpressionOfAttributeArgument(node As SyntaxNode) As SyntaxNode Implements ISyntaxFacts.GetExpressionOfAttributeArgument 599Public Function GetRefKindOfArgument(node As SyntaxNode) As RefKind Implements ISyntaxFacts.GetRefKindOfArgument 604Public Function IsArgument(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsArgument 608Public Function IsAttributeArgument(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsAttributeArgument 612Public Function IsSimpleArgument(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsSimpleArgument 617Public Function IsInConstantContext(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsInConstantContext 621Public Function IsInConstructor(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsInConstructor 625Public Function IsUnsafeContext(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsUnsafeContext 629Public Function IsAttributeNamedArgumentIdentifier(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsAttributeNamedArgumentIdentifier 637Public Function GetContainingTypeDeclaration(root As SyntaxNode, position As Integer) As SyntaxNode Implements ISyntaxFacts.GetContainingTypeDeclaration 640GetAncestors(Of SyntaxNode)(). 644Public Function GetContainingVariableDeclaratorOfFieldDeclaration(node As SyntaxNode) As SyntaxNode Implements ISyntaxFacts.GetContainingVariableDeclaratorOfFieldDeclaration 663node As SyntaxNode, 664ByRef initializedInstance As SyntaxNode) As Boolean Implements ISyntaxFacts.IsMemberInitializerNamedAssignmentIdentifier 678Public Function IsAnyInitializerExpression(node As SyntaxNode, ByRef creationExpression As SyntaxNode) As Boolean Implements ISyntaxFacts.IsAnyInitializerExpression 693Public Function IsNameOfSubpattern(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsNameOfSubpattern 697Public Function IsPropertyPatternClause(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsPropertyPatternClause 701Public Function IsElementAccessExpression(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsElementAccessExpression 707Public Function GetContainingMemberDeclaration(root As SyntaxNode, position As Integer, Optional useFullSpan As Boolean = True) As SyntaxNode Implements ISyntaxFacts.GetContainingMemberDeclaration 708Dim isApplicableDeclaration = Function(node As SyntaxNode) 740Public Function GetContainingMethodDeclaration(root As SyntaxNode, position As Integer, Optional useFullSpan As Boolean = True) As SyntaxNode Implements ISyntaxFacts.GetContainingMethodDeclaration 741Dim isApplicableDeclaration = Function(node As SyntaxNode) 756Private Shared Function GetContainingMemberDeclaration(root As SyntaxNode, position As Integer, isApplicableDeclaration As Func(Of SyntaxNode, Boolean), Optional useFullSpan As Boolean = True) As SyntaxNode 780Public Function IsMethodLevelMember(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsMethodLevelMember 820Public Function GetMemberBodySpanForSpeculativeBinding(node As SyntaxNode) As TextSpan Implements ISyntaxFacts.GetMemberBodySpanForSpeculativeBinding 849Public Function ContainsInMemberBody(node As SyntaxNode, span As TextSpan) As Boolean Implements ISyntaxFacts.ContainsInMemberBody 891Private Shared Function GetSyntaxListSpan(Of T As SyntaxNode)(list As SyntaxList(Of T)) As TextSpan 896Private Shared Function GetSeparatedSyntaxListSpan(Of T As SyntaxNode)(list As SeparatedSyntaxList(Of T)) As TextSpan 901Public Function GetTopLevelAndMethodLevelMembers(root As SyntaxNode) As PooledObject(Of List(Of SyntaxNode)) Implements ISyntaxFacts.GetTopLevelAndMethodLevelMembers 902Dim pooledList = PooledObject(Of List(Of SyntaxNode)).Create(s_syntaxNodeListPool) 910Public Function GetMethodLevelMembers(root As SyntaxNode) As PooledObject(Of List(Of SyntaxNode)) Implements ISyntaxFacts.GetMethodLevelMembers 911Dim pooledList = PooledObject(Of List(Of SyntaxNode)).Create(s_syntaxNodeListPool) 919Public Function GetMembersOfTypeDeclaration(typeDeclaration As SyntaxNode) As SyntaxList(Of SyntaxNode) Implements ISyntaxFacts.GetMembersOfTypeDeclaration 923Public Function IsTopLevelNodeWithMembers(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsTopLevelNodeWithMembers 931Public Function GetDisplayName(node As SyntaxNode, options As DisplayNameOptions, Optional rootNamespace As String = Nothing) As String Implements ISyntaxFacts.GetDisplayName 1001Private Shared Function GetName(node As SyntaxNode, options As DisplayNameOptions, ByRef containsGlobalKeyword As Boolean) As String 1063Private Sub AppendMembers(node As SyntaxNode, list As List(Of SyntaxNode), topLevel As Boolean, methodLevel As Boolean) 1082Public Function TryGetBindableParent(token As SyntaxToken) As SyntaxNode Implements ISyntaxFacts.TryGetBindableParent 1134Public Function GetConstructors(root As SyntaxNode, cancellationToken As CancellationToken) As IEnumerable(Of SyntaxNode) Implements ISyntaxFacts.GetConstructors 1137Return SpecializedCollections.EmptyEnumerable(Of SyntaxNode)() 1140Dim constructors = New List(Of SyntaxNode)() 1145Private Shared Sub AppendConstructors(members As SyntaxList(Of StatementSyntax), constructors As List(Of SyntaxNode), cancellationToken As CancellationToken) 1181Public Function GetNameForArgument(argument As SyntaxNode) As String Implements ISyntaxFacts.GetNameForArgument 1189Public Function GetNameForAttributeArgument(argument As SyntaxNode) As String Implements ISyntaxFacts.GetNameForAttributeArgument 1194Public Function IsLeftSideOfDot(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsLeftSideOfDot 1198Public Function GetRightSideOfDot(node As SyntaxNode) As SyntaxNode Implements ISyntaxFacts.GetRightSideOfDot 1203Public Function GetLeftSideOfDot(node As SyntaxNode, Optional allowImplicitTarget As Boolean = False) As SyntaxNode Implements ISyntaxFacts.GetLeftSideOfDot 1208Public Function IsLeftSideOfExplicitInterfaceSpecifier(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsLeftSideOfExplicitInterfaceSpecifier 1212Public Function IsLeftSideOfAssignment(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsLeftSideOfAssignment 1216Public Function IsLeftSideOfAnyAssignment(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsLeftSideOfAnyAssignment 1220Public Function IsLeftSideOfCompoundAssignment(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsLeftSideOfCompoundAssignment 1224Public Function GetRightHandSideOfAssignment(node As SyntaxNode) As SyntaxNode Implements ISyntaxFacts.GetRightHandSideOfAssignment 1228Public Function IsInferredAnonymousObjectMemberDeclarator(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsInferredAnonymousObjectMemberDeclarator 1232Public Function IsOperandOfIncrementExpression(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsOperandOfIncrementExpression 1236Public Function IsOperandOfIncrementOrDecrementExpression(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsOperandOfIncrementOrDecrementExpression 1240Public Function GetContentsOfInterpolatedString(interpolatedString As SyntaxNode) As SyntaxList(Of SyntaxNode) Implements ISyntaxFacts.GetContentsOfInterpolatedString 1255Public Function GetArgumentsOfObjectCreationExpression(node As SyntaxNode) As SeparatedSyntaxList(Of SyntaxNode) Implements ISyntaxFacts.GetArgumentsOfObjectCreationExpression 1260Public Function GetArgumentsOfArgumentList(node As SyntaxNode) As SeparatedSyntaxList(Of SyntaxNode) Implements ISyntaxFacts.GetArgumentsOfArgumentList 1264Public Function GetArgumentsOfAttributeArgumentList(node As SyntaxNode) As SeparatedSyntaxList(Of SyntaxNode) Implements ISyntaxFacts.GetArgumentsOfAttributeArgumentList 1268Public Function ConvertToSingleLine(node As SyntaxNode, Optional useElasticTrivia As Boolean = False) As SyntaxNode Implements ISyntaxFacts.ConvertToSingleLine 1272Public Function IsDocumentationComment(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsDocumentationComment 1276Public Function IsUsingOrExternOrImport(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsUsingOrExternOrImport 1280Public Function IsGlobalAssemblyAttribute(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsGlobalAssemblyAttribute 1284Public Function IsGlobalModuleAttribute(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsGlobalModuleAttribute 1288Private Shared Function IsGlobalAttribute(node As SyntaxNode, attributeTarget As SyntaxKind) As Boolean 1299Public Function IsDeclaration(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsDeclaration 1382Public Function IsTypeDeclaration(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsTypeDeclaration 1397Public Function IsAnyAssignmentStatement(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsAnyAssignmentStatement 1401Public Function IsSimpleAssignmentStatement(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsSimpleAssignmentStatement 1405Public Sub GetPartsOfAssignmentStatement(statement As SyntaxNode, ByRef left As SyntaxNode, ByRef operatorToken As SyntaxToken, ByRef right As SyntaxNode) Implements ISyntaxFacts.GetPartsOfAssignmentStatement 1410Public Sub GetPartsOfAssignmentExpressionOrStatement(statement As SyntaxNode, ByRef left As SyntaxNode, ByRef operatorToken As SyntaxToken, ByRef right As SyntaxNode) Implements ISyntaxFacts.GetPartsOfAssignmentExpressionOrStatement 1417Public Function GetIdentifierOfSimpleName(node As SyntaxNode) As SyntaxToken Implements ISyntaxFacts.GetIdentifierOfSimpleName 1421Public Function GetIdentifierOfVariableDeclarator(node As SyntaxNode) As SyntaxToken Implements ISyntaxFacts.GetIdentifierOfVariableDeclarator 1425Public Function GetIdentifierOfTypeDeclaration(node As SyntaxNode) As SyntaxToken Implements ISyntaxFacts.GetIdentifierOfTypeDeclaration 1442Public Function IsDeclaratorOfLocalDeclarationStatement(declarator As SyntaxNode, localDeclarationStatement As SyntaxNode) As Boolean Implements ISyntaxFacts.IsDeclaratorOfLocalDeclarationStatement 1451Public Function AreEquivalent(node1 As SyntaxNode, node2 As SyntaxNode) As Boolean Implements ISyntaxFacts.AreEquivalent 1455Public Function IsExpressionOfForeach(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsExpressionOfForeach 1459Public Function GetExpressionOfExpressionStatement(node As SyntaxNode) As SyntaxNode Implements ISyntaxFacts.GetExpressionOfExpressionStatement 1463Public Sub GetPartsOfTupleExpression(Of TArgumentSyntax As SyntaxNode)(node As SyntaxNode, ByRef openParen As SyntaxToken, ByRef arguments As SeparatedSyntaxList(Of TArgumentSyntax), ByRef closeParen As SyntaxToken) Implements ISyntaxFacts.GetPartsOfTupleExpression 1466arguments = CType(CType(tupleExpr.Arguments, SeparatedSyntaxList(Of SyntaxNode)), SeparatedSyntaxList(Of TArgumentSyntax)) 1486Public Function IsPragmaDirective(trivia As SyntaxTrivia, ByRef isDisable As Boolean, ByRef isActive As Boolean, ByRef errorCodes As SeparatedSyntaxList(Of SyntaxNode)) As Boolean Implements ISyntaxFacts.IsPragmaDirective 1498Public Function GetModifiers(node As SyntaxNode) As SyntaxTokenList Implements ISyntaxFacts.GetModifiers 1502Public Function WithModifiers(node As SyntaxNode, modifiers As SyntaxTokenList) As SyntaxNode Implements ISyntaxFacts.WithModifiers 1506Public Function GetVariablesOfLocalDeclarationStatement(node As SyntaxNode) As SeparatedSyntaxList(Of SyntaxNode) Implements ISyntaxFacts.GetVariablesOfLocalDeclarationStatement 1510Public Function GetInitializerOfVariableDeclarator(node As SyntaxNode) As SyntaxNode Implements ISyntaxFacts.GetInitializerOfVariableDeclarator 1514Public Function GetInitializerOfPropertyDeclaration(node As SyntaxNode) As SyntaxNode Implements ISyntaxFacts.GetInitializerOfPropertyDeclaration 1518Public Function GetTypeOfVariableDeclarator(node As SyntaxNode) As SyntaxNode Implements ISyntaxFacts.GetTypeOfVariableDeclarator 1523Public Function GetValueOfEqualsValueClause(node As SyntaxNode) As SyntaxNode Implements ISyntaxFacts.GetValueOfEqualsValueClause 1527Public Function IsEqualsValueOfPropertyDeclaration(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsEqualsValueOfPropertyDeclaration 1531Public Function IsConversionExpression(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsConversionExpression 1535Public Function IsCastExpression(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsCastExpression 1539Public Sub GetPartsOfCastExpression(node As SyntaxNode, ByRef type As SyntaxNode, ByRef expression As SyntaxNode) Implements ISyntaxFacts.GetPartsOfCastExpression 1545Public Function GetDeconstructionReferenceLocation(node As SyntaxNode) As Location Implements ISyntaxFacts.GetDeconstructionReferenceLocation 1567Public Function IsPostfixUnaryExpression(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsPostfixUnaryExpression 1572Public Function IsElementBindingExpression(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsElementBindingExpression 1577Public Function IsMemberBindingExpression(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsMemberBindingExpression 1582Public Function IsNameOfMemberBindingExpression(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsNameOfMemberBindingExpression 1587Public Function GetAttributeLists(node As SyntaxNode) As SyntaxList(Of SyntaxNode) Implements ISyntaxFacts.GetAttributeLists 1591Public Function IsUsingAliasDirective(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsUsingAliasDirective 1611node As SyntaxNode, 1614ByRef name As SyntaxNode) Implements ISyntaxFacts.GetPartsOfUsingAliasDirective 1633Public Function IsParameterNameXmlElementSyntax(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsParameterNameXmlElementSyntax 1643Public Function GetContentFromDocumentationCommentTriviaSyntax(trivia As SyntaxTrivia) As SyntaxList(Of SyntaxNode) Implements ISyntaxFacts.GetContentFromDocumentationCommentTriviaSyntax 1652Friend Shared Function IsChildOf(node As SyntaxNode, kind As SyntaxKind) As Boolean 1656Friend Shared Function IsChildOfVariableDeclaration(node As SyntaxNode) As Boolean 1660Private Shared Function GetDeclarationCount(nodes As IReadOnlyList(Of SyntaxNode)) As Integer 1669Friend Shared Function GetDeclarationCount(node As SyntaxNode) As Integer 1696Public Function IsAnyPattern(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsAnyPattern 1700Public Function IsBinaryPattern(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsBinaryPattern 1704Public Function IsUnaryPattern(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsUnaryPattern 1708Public Sub GetPartsOfAnyIsTypeExpression(node As SyntaxNode, ByRef expression As SyntaxNode, ByRef type As SyntaxNode) Implements ISyntaxFacts.GetPartsOfAnyIsTypeExpression 1714Public Sub GetPartsOfIsPatternExpression(node As SyntaxNode, ByRef left As SyntaxNode, ByRef isToken As SyntaxToken, ByRef right As SyntaxNode) Implements ISyntaxFacts.GetPartsOfIsPatternExpression 1718Public Function GetExpressionOfConstantPattern(node As SyntaxNode) As SyntaxNode Implements ISyntaxFacts.GetExpressionOfConstantPattern 1722Public Sub GetPartsOfParenthesizedPattern(node As SyntaxNode, ByRef openParen As SyntaxToken, ByRef pattern As SyntaxNode, ByRef closeParen As SyntaxToken) Implements ISyntaxFacts.GetPartsOfParenthesizedPattern 1726Public Sub GetPartsOfBinaryPattern(node As SyntaxNode, ByRef left As SyntaxNode, ByRef operatorToken As SyntaxToken, ByRef right As SyntaxNode) Implements ISyntaxFacts.GetPartsOfBinaryPattern 1730Public Sub GetPartsOfUnaryPattern(node As SyntaxNode, ByRef operatorToken As SyntaxToken, ByRef pattern As SyntaxNode) Implements ISyntaxFacts.GetPartsOfUnaryPattern 1734Public Sub GetPartsOfRelationalPattern(node As SyntaxNode, ByRef operatorToken As SyntaxToken, ByRef expression As SyntaxNode) Implements ISyntaxFacts.GetPartsOfRelationalPattern 1738Public Sub GetPartsOfDeclarationPattern(node As SyntaxNode, ByRef type As SyntaxNode, ByRef designation As SyntaxNode) Implements ISyntaxFacts.GetPartsOfDeclarationPattern 1742Public Sub GetPartsOfRecursivePattern(node As SyntaxNode, ByRef type As SyntaxNode, ByRef positionalPart As SyntaxNode, ByRef propertyPart As SyntaxNode, ByRef designation As SyntaxNode) Implements ISyntaxFacts.GetPartsOfRecursivePattern 1746Public Function GetTypeOfTypePattern(node As SyntaxNode) As SyntaxNode Implements ISyntaxFacts.GetTypeOfTypePattern 1750Public Function IsVerbatimInterpolatedStringExpression(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsVerbatimInterpolatedStringExpression 1764Public Function IsAnonymousFunctionExpression(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsAnonymousFunctionExpression 1768Public Function IsBaseNamespaceDeclaration(<NotNullWhen(True)> node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsBaseNamespaceDeclaration 1772Public Function IsBinaryExpression(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsBinaryExpression 1776Public Function IsLiteralExpression(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsLiteralExpression 1780Public Function IsMemberAccessExpression(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsMemberAccessExpression 1784Public Function IsMethodDeclaration(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsMethodDeclaration 1788Public Function IsSimpleName(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsSimpleName 1792Public Function IsAnyName(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsAnyName 1796Public Function IsAnyType(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsAnyType 1800Public Function IsNamedMemberInitializer(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsNamedMemberInitializer 1804Public Function IsElementAccessInitializer(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsElementAccessInitializer 1808Public Function IsObjectMemberInitializer(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsObjectMemberInitializer 1812Public Function IsObjectCollectionInitializer(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsObjectCollectionInitializer 1820Public Sub GetPartsOfArgumentList(node As SyntaxNode, ByRef openParenToken As SyntaxToken, ByRef arguments As SeparatedSyntaxList(Of SyntaxNode), ByRef closeParenToken As SyntaxToken) Implements ISyntaxFacts.GetPartsOfArgumentList 1827Public Sub GetPartsOfAttribute(node As SyntaxNode, ByRef name As SyntaxNode, ByRef argumentList As SyntaxNode) Implements ISyntaxFacts.GetPartsOfAttribute 1833Public Sub GetPartsOfBaseObjectCreationExpression(node As SyntaxNode, ByRef argumentList As SyntaxNode, ByRef initializer As SyntaxNode) Implements ISyntaxFacts.GetPartsOfBaseObjectCreationExpression 1839Public Sub GetPartsOfBinaryExpression(node As SyntaxNode, ByRef left As SyntaxNode, ByRef operatorToken As SyntaxToken, ByRef right As SyntaxNode) Implements ISyntaxFacts.GetPartsOfBinaryExpression 1846Public Sub GetPartsOfCompilationUnit(node As SyntaxNode, ByRef [imports] As SyntaxList(Of SyntaxNode), ByRef attributeLists As SyntaxList(Of SyntaxNode), ByRef members As SyntaxList(Of SyntaxNode)) Implements ISyntaxFacts.GetPartsOfCompilationUnit 1853Public Sub GetPartsOfConditionalAccessExpression(node As SyntaxNode, ByRef expression As SyntaxNode, ByRef operatorToken As SyntaxToken, ByRef whenNotNull As SyntaxNode) Implements ISyntaxFacts.GetPartsOfConditionalAccessExpression 1860Public Sub GetPartsOfConditionalExpression(node As SyntaxNode, ByRef condition As SyntaxNode, ByRef whenTrue As SyntaxNode, ByRef whenFalse As SyntaxNode) Implements ISyntaxFacts.GetPartsOfConditionalExpression 1867Public Function GetExpressionOfForeachStatement(statement As SyntaxNode) As SyntaxNode Implements ISyntaxFacts.GetExpressionOfForeachStatement 1871Public Sub GetPartsOfInterpolationExpression(node As SyntaxNode, ByRef stringStartToken As SyntaxToken, ByRef contents As SyntaxList(Of SyntaxNode), ByRef stringEndToken As SyntaxToken) Implements ISyntaxFacts.GetPartsOfInterpolationExpression 1878Public Sub GetPartsOfInvocationExpression(node As SyntaxNode, ByRef expression As SyntaxNode, ByRef argumentList As SyntaxNode) Implements ISyntaxFacts.GetPartsOfInvocationExpression 1884Public Sub GetPartsOfGenericName(node As SyntaxNode, ByRef identifier As SyntaxToken, ByRef typeArguments As SeparatedSyntaxList(Of SyntaxNode)) Implements ISyntaxFacts.GetPartsOfGenericName 1890Public Sub GetPartsOfMemberAccessExpression(node As SyntaxNode, ByRef expression As SyntaxNode, ByRef operatorToken As SyntaxToken, ByRef name As SyntaxNode) Implements ISyntaxFacts.GetPartsOfMemberAccessExpression 1897Public Sub GetPartsOfBaseNamespaceDeclaration(node As SyntaxNode, ByRef name As SyntaxNode, ByRef [imports] As SyntaxList(Of SyntaxNode), ByRef members As SyntaxList(Of SyntaxNode)) Implements ISyntaxFacts.GetPartsOfBaseNamespaceDeclaration 1904Public Sub GetPartsOfNamedMemberInitializer(node As SyntaxNode, ByRef identifier As SyntaxNode, ByRef expression As SyntaxNode) Implements ISyntaxFacts.GetPartsOfNamedMemberInitializer 1910Public Sub GetPartsOfObjectCreationExpression(node As SyntaxNode, ByRef keyword As SyntaxToken, ByRef type As SyntaxNode, ByRef argumentList As SyntaxNode, ByRef initializer As SyntaxNode) Implements ISyntaxFacts.GetPartsOfObjectCreationExpression 1918Public Sub GetPartsOfImplicitObjectCreationExpression(node As SyntaxNode, ByRef keyword As SyntaxToken, ByRef argumentList As SyntaxNode, ByRef initializer As SyntaxNode) Implements ISyntaxFacts.GetPartsOfImplicitObjectCreationExpression 1922Public Sub GetPartsOfParameter(node As SyntaxNode, ByRef identifier As SyntaxToken, ByRef [default] As SyntaxNode) Implements ISyntaxFacts.GetPartsOfParameter 1928Public Sub GetPartsOfParenthesizedExpression(node As SyntaxNode, ByRef openParen As SyntaxToken, ByRef expression As SyntaxNode, ByRef closeParen As SyntaxToken) Implements ISyntaxFacts.GetPartsOfParenthesizedExpression 1935Public Sub GetPartsOfPrefixUnaryExpression(node As SyntaxNode, ByRef operatorToken As SyntaxToken, ByRef operand As SyntaxNode) Implements ISyntaxFacts.GetPartsOfPrefixUnaryExpression 1941Public Sub GetPartsOfQualifiedName(node As SyntaxNode, ByRef left As SyntaxNode, ByRef dotToken As SyntaxToken, ByRef right As SyntaxNode) Implements ISyntaxFacts.GetPartsOfQualifiedName 1952Public Function GetArgumentListOfImplicitElementAccess(node As SyntaxNode) As SyntaxNode Implements ISyntaxFacts.GetArgumentListOfImplicitElementAccess 1956Public Function GetAttributesOfAttributeList(node As SyntaxNode) As SeparatedSyntaxList(Of SyntaxNode) Implements ISyntaxFacts.GetAttributesOfAttributeList 1960Public Function GetExpressionOfAwaitExpression(node As SyntaxNode) As SyntaxNode Implements ISyntaxFacts.GetExpressionOfAwaitExpression 1964Public Function GetExpressionOfThrowExpression(node As SyntaxNode) As SyntaxNode Implements ISyntaxFacts.GetExpressionOfThrowExpression 1968Public Function GetExpressionOfThrowStatement(node As SyntaxNode) As SyntaxNode Implements ISyntaxFacts.GetExpressionOfThrowStatement 1972Public Function GetInitializersOfObjectMemberInitializer(node As SyntaxNode) As SeparatedSyntaxList(Of SyntaxNode) Implements ISyntaxFacts.GetInitializersOfObjectMemberInitializer 1981Public Function GetExpressionsOfObjectCollectionInitializer(node As SyntaxNode) As SeparatedSyntaxList(Of SyntaxNode) Implements ISyntaxFacts.GetExpressionsOfObjectCollectionInitializer 1990Public Function GetTokenOfLiteralExpression(node As SyntaxNode) As SyntaxToken Implements ISyntaxFacts.GetTokenOfLiteralExpression
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Utilities\CastAnalyzer.vb (1)
142Private Shared Function AsTypeInVariableDeclarator(node As SyntaxNode, semanticModel As SemanticModel) As ITypeSymbol
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Utilities\SpeculationAnalyzer.vb (19)
55Protected Overrides Function GetSemanticRootForSpeculation(expression As ExpressionSyntax) As SyntaxNode 70Public Shared Function CanSpeculateOnNode(node As SyntaxNode) As Boolean 79Protected Overrides Function GetSemanticRootOfReplacedExpression(semanticRootOfOriginalExpr As SyntaxNode, annotatedReplacedExpression As ExpressionSyntax) As SyntaxNode 100Protected Overrides Sub ValidateSpeculativeSemanticModel(speculativeSemanticModel As SemanticModel, nodeToSpeculate As SyntaxNode) 107Protected Overrides Function CreateSpeculativeSemanticModel(originalNode As SyntaxNode, nodeToSpeculate As SyntaxNode, semanticModel As SemanticModel) As SemanticModel 111Public Shared Function CreateSpeculativeSemanticModelForNode(originalNode As SyntaxNode, nodeToSpeculate As SyntaxNode, semanticModel As SemanticModel) As SemanticModel 117Public Shared Function CreateSpeculativeSemanticModelForNode(nodeToSpeculate As SyntaxNode, semanticModel As SemanticModel, position As Integer, isInNamespaceOrTypeContext As Boolean) As SemanticModel 250Dim originalLambdaBody As SyntaxNode, replacedLambdaBody As SyntaxNode 320originalRoot As SyntaxNode) As Boolean 338Protected Overrides Function ReplacementChangesSemanticsForNodeLanguageSpecific(currentOriginalNode As SyntaxNode, currentReplacedNode As SyntaxNode, previousOriginalNode As SyntaxNode, previousReplacedNode As SyntaxNode) As Boolean 449Protected Overrides Function ExpressionMightReferenceMember(node As SyntaxNode) As Boolean 539Protected Overrides Function IsParenthesizedExpression(node As SyntaxNode) As Boolean
src\Workspaces\VisualBasic\Portable\Formatting\DefaultOperationProvider.vb (7)
40Public Overrides Sub AddSuppressOperationsSlow(operations As ArrayBuilder(Of SuppressOperation), node As SyntaxNode, ByRef nextAction As NextSuppressOperationAction) 43Public Overrides Sub AddAnchorIndentationOperationsSlow(operations As List(Of AnchorIndentationOperation), node As SyntaxNode, ByRef nextAction As NextAnchorIndentationOperationAction) 46Public Overrides Sub AddIndentBlockOperationsSlow(operations As List(Of IndentBlockOperation), node As SyntaxNode, ByRef nextAction As NextIndentBlockOperationAction) 49Public Overrides Sub AddAlignTokensOperationsSlow(operations As List(Of AlignTokensOperation), node As SyntaxNode, ByRef nextAction As NextAlignTokensOperationAction) 69ElseIf lastTrivia.RawKind = SyntaxKind.LineContinuationTrivia AndAlso previousToken.Parent.GetAncestorsOrThis(Of SyntaxNode)().Any(Function(node As SyntaxNode) IsSingleLineIfOrElseClauseSyntax(node)) Then 152Private Shared Function IsSingleLineIfOrElseClauseSyntax(node As SyntaxNode) As Boolean
src\Workspaces\VisualBasic\Portable\Formatting\Engine\AggregatedFormattingResult.vb (2)
15Public Sub New(node As SyntaxNode, results As IList(Of AbstractFormattingResult), formattingSpans As TextSpanMutableIntervalTree) 19Protected Overrides Function Rewriter(changeMap As Dictionary(Of ValueTuple(Of SyntaxToken, SyntaxToken), TriviaData), cancellationToken As CancellationToken) As SyntaxNode
src\Workspaces\VisualBasic\Portable\Formatting\Engine\FormattingResult.vb (1)
25Protected Overrides Function Rewriter(changeMap As Dictionary(Of ValueTuple(Of SyntaxToken, SyntaxToken), TriviaData), cancellationToken As CancellationToken) As SyntaxNode
src\Workspaces\VisualBasic\Portable\Formatting\Engine\Trivia\TriviaDataFactory.TriviaRewriter.vb (5)
15Private ReadOnly _node As SyntaxNode 23Public Sub New(node As SyntaxNode, spanToFormat As TextSpanMutableIntervalTree, map As Dictionary(Of ValueTuple(Of SyntaxToken, SyntaxToken), TriviaData), cancellationToken As CancellationToken) 38Public Function Transform() As SyntaxNode 119Public Overrides Function Visit(node As SyntaxNode) As SyntaxNode
src\Workspaces\VisualBasic\Portable\Formatting\Engine\VisualBasicFormatEngine.vb (1)
15Public Sub New(node As SyntaxNode,
src\Workspaces\VisualBasic\Portable\Formatting\FormattingHelpers.vb (1)
236Public Function IsGreaterThanInXmlTag(tag As SyntaxNode, token As SyntaxToken) As Boolean
src\Workspaces\VisualBasic\Portable\Formatting\Rules\AlignTokensFormattingRule.vb (1)
16Public Overrides Sub AddAlignTokensOperationsSlow(operations As List(Of AlignTokensOperation), node As SyntaxNode, ByRef nextOperation As NextAlignTokensOperationAction)
src\Workspaces\VisualBasic\Portable\Formatting\Rules\BaseFormattingRule.vb (1)
91Protected Shared Sub AddAlignIndentationOfTokensToBaseTokenOperation(operations As List(Of AlignTokensOperation), containingNode As SyntaxNode, baseToken As SyntaxToken, tokens As IEnumerable(Of SyntaxToken))
src\Workspaces\VisualBasic\Portable\Formatting\Rules\ElasticTriviaFormattingRule.vb (3)
18Public Overrides Sub AddSuppressOperationsSlow(list As ArrayBuilder(Of SuppressOperation), node As SyntaxNode, ByRef nextOperation As NextSuppressOperationAction) 22Public Overrides Sub AddIndentBlockOperationsSlow(list As List(Of IndentBlockOperation), node As SyntaxNode, ByRef nextOperation As NextIndentBlockOperationAction) 61node As SyntaxNode,
src\Workspaces\VisualBasic\Portable\Formatting\Rules\NodeBasedFormattingRule.vb (5)
16node As SyntaxNode, 40Private Shared Function IsBlockSyntax(node As SyntaxNode) As Boolean 50node As SyntaxNode, 199Private Shared Function GetOuterBlockWithDifferentStartTokenUsingXmlElement(firstTokenOfInnerBlock As SyntaxToken) As SyntaxNode 310Private Shared Function GetFirstAndLastMembers(node As SyntaxNode) As ValueTuple(Of SyntaxToken, SyntaxToken)
src\Workspaces\VisualBasic\Portable\Formatting\VisualBasicSyntaxFormatting.vb (2)
42Protected Overrides Function CreateAggregatedFormattingResult(node As SyntaxNode, results As IList(Of AbstractFormattingResult), Optional formattingSpans As TextSpanMutableIntervalTree = Nothing) As IFormattingResult 46Protected Overrides Function Format(root As SyntaxNode, options As SyntaxFormattingOptions, formattingRules As ImmutableArray(Of AbstractFormattingRule), startToken As SyntaxToken, endToken As SyntaxToken, cancellationToken As CancellationToken) As AbstractFormattingResult
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (359)
src\Analyzers\VisualBasic\CodeFixes\AddAccessibilityModifiers\VisualBasicAddAccessibilityModifiersCodeFixProvider.vb (2)
21Protected Overrides Function MapToDeclarator(declaration As SyntaxNode) As SyntaxNode
src\Analyzers\VisualBasic\CodeFixes\AddExplicitCast\ArgumentFixer.vb (1)
11Inherits Fixer(Of ArgumentSyntax, ArgumentListSyntax, SyntaxNode)
src\Analyzers\VisualBasic\CodeFixes\AddExplicitCast\VisualBasicAddExplicitCastCodeFixProvider.vb (4)
38ByRef type As SyntaxNode, 59root As SyntaxNode, 169root As SyntaxNode, 170invocationNode As SyntaxNode,
src\Analyzers\VisualBasic\CodeFixes\AddParameter\VisualBasicAddParameterCodeFixProvider.vb (1)
52Protected Overrides Function GetArgumentType(argumentNode As SyntaxNode, semanticModel As SemanticModel, cancellationToken As CancellationToken) As ITypeSymbol
src\Analyzers\VisualBasic\CodeFixes\ConvertToAsync\VisualBasicConvertToAsyncFunctionCodeFixProvider.vb (5)
35Protected Overrides Async Function GetDescriptionAsync(diagnostic As Diagnostic, node As SyntaxNode, semanticModel As SemanticModel, cancellationToken As CancellationToken) As Task(Of String) 40Protected Overrides Async Function GetRootInOtherSyntaxTreeAsync(node As SyntaxNode, semanticModel As SemanticModel, diagnostic As Diagnostic, cancellationToken As CancellationToken) As Task(Of Tuple(Of SyntaxTree, SyntaxNode)) 53Private Shared Async Function GetMethodFromExpressionAsync(oldNode As SyntaxNode, semanticModel As SemanticModel, cancellationToken As CancellationToken) As Task(Of Tuple(Of SyntaxNode, MethodBlockSyntax))
src\Analyzers\VisualBasic\CodeFixes\ConvertTypeOfToNameOf\VisualBasicConvertGetTypeToNameOfCodeFixProvider.vb (1)
29Protected Overrides Function GetSymbolTypeExpression(semanticModel As SemanticModel, node As MemberAccessExpressionSyntax, cancellationToken As CancellationToken) As SyntaxNode
src\Analyzers\VisualBasic\CodeFixes\GenerateConstructor\GenerateConstructorCodeFixProvider.vb (4)
34Protected Overrides Function GetCodeActionsAsync(document As Document, node As SyntaxNode, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of CodeAction)) 39Protected Overrides Function GetTargetNode(node As SyntaxNode) As SyntaxNode 58Protected Overrides Function IsCandidate(node As SyntaxNode, token As SyntaxToken, diagnostic As Diagnostic) As Boolean
src\Analyzers\VisualBasic\CodeFixes\GenerateConstructor\VisualBasicGenerateConstructorService.vb (7)
25Protected Overrides Function IsImplicitObjectCreation(document As SemanticDocument, node As SyntaxNode, cancellationToken As CancellationToken) As Boolean 29Protected Overrides Function TryInitializeImplicitObjectCreation(document As SemanticDocument, node As SyntaxNode, cancellationToken As CancellationToken, ByRef token As SyntaxToken, ByRef arguments As ImmutableArray(Of Argument), ByRef typeToGenerateIn As INamedTypeSymbol) As Boolean 51Protected Overrides Function IsConstructorInitializerGeneration(document As SemanticDocument, node As SyntaxNode, cancellationToken As CancellationToken) As Boolean 59node As SyntaxNode, 88Protected Overrides Function IsSimpleNameGeneration(document As SemanticDocument, node As SyntaxNode, cancellationToken As CancellationToken) As Boolean 94node As SyntaxNode, 129node As SyntaxNode,
src\Analyzers\VisualBasic\CodeFixes\GenerateDefaultConstructors\VisualBasicGenerateDefaultConstructorsCodeFixProvider.vb (1)
28Protected Overrides Function TryGetTypeName(typeDeclaration As SyntaxNode) As SyntaxToken?
src\Analyzers\VisualBasic\CodeFixes\GenerateDefaultConstructors\VisualBasicGenerateDefaultConstructorsService.vb (1)
32Dim typeDecl As SyntaxNode = Nothing
src\Analyzers\VisualBasic\CodeFixes\GenerateEnumMember\GenerateEnumMemberCodeFixProvider.vb (4)
35Protected Overrides Function GetCodeActionsAsync(document As Document, node As SyntaxNode, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of CodeAction)) 40Protected Overrides Function IsCandidate(node As SyntaxNode, token As SyntaxToken, diagnostic As Diagnostic) As Boolean 44Protected Overrides Function GetTargetNode(node As SyntaxNode) As SyntaxNode
src\Analyzers\VisualBasic\CodeFixes\GenerateEnumMember\VisualBasicGenerateEnumMemberService.vb (1)
22Protected Overrides Function IsIdentifierNameGeneration(node As SyntaxNode) As Boolean
src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\GenerateConversionCodeFixProvider.vb (4)
35Protected Overrides Function GetCodeActionsAsync(document As Document, node As SyntaxNode, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of CodeAction)) 40Protected Overrides Function IsCandidate(node As SyntaxNode, token As SyntaxToken, diagnostic As Diagnostic) As Boolean 49Protected Overrides Function GetTargetNode(node As SyntaxNode) As SyntaxNode
src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\GenerateParameterizedMemberCodeFixProvider.vb (4)
54Protected Overrides Function GetCodeActionsAsync(document As Document, node As SyntaxNode, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of CodeAction)) 59Protected Overrides Function IsCandidate(node As SyntaxNode, token As SyntaxToken, diagnostic As Diagnostic) As Boolean 75Protected Overrides Function GetTargetNode(node As SyntaxNode) As SyntaxNode
src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\VisualBasicGenerateConversionService.vb (9)
32Protected Overrides Function IsExplicitConversionGeneration(node As SyntaxNode) As Boolean 36Protected Overrides Function IsImplicitConversionGeneration(node As SyntaxNode) As Boolean 43Private Shared Function IsInImplementsClause(node As SyntaxNode) As Boolean 47Private Shared Function IsInMemberAccessExpression(node As SyntaxNode) As Boolean 55Protected Overrides Function TryInitializeExplicitConversionState(document As SemanticDocument, expression As SyntaxNode, classInterfaceModuleStructTypes As ISet(Of TypeKind), cancellationToken As CancellationToken, ByRef identifierToken As SyntaxToken, ByRef methodSymbol As IMethodSymbol, ByRef typeToGenerateIn As INamedTypeSymbol) As Boolean 69Protected Overrides Function TryInitializeImplicitConversionState(document As SemanticDocument, expression As SyntaxNode, classInterfaceModuleStructTypes As ISet(Of TypeKind), cancellationToken As CancellationToken, ByRef identifierToken As SyntaxToken, ByRef methodSymbol As IMethodSymbol, ByRef typeToGenerateIn As INamedTypeSymbol) As Boolean 83Private Shared Function TryGetConversionMethodAndTypeToGenerateIn(document As SemanticDocument, expression As SyntaxNode, classInterfaceModuleStructTypes As ISet(Of TypeKind), cancellationToken As CancellationToken, ByRef methodSymbol As IMethodSymbol, ByRef typeToGenerateIn As INamedTypeSymbol) As Boolean 109Private Shared Function IsCastExpression(node As SyntaxNode) As Boolean 129Private Shared Function TryGetImplicitConversionMethodAndTypeToGenerateIn(document As SemanticDocument, expression As SyntaxNode, classInterfaceModuleStructTypes As ISet(Of TypeKind), cancellationToken As CancellationToken, ByRef methodSymbol As IMethodSymbol, ByRef typeToGenerateIn As INamedTypeSymbol) As Boolean
src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\VisualBasicGenerateMethodService.vb (3)
24Protected Overrides Function IsExplicitInterfaceGeneration(node As SyntaxNode) As Boolean 28Protected Overrides Function IsSimpleNameGeneration(node As SyntaxNode) As Boolean 42node As SyntaxNode,
src\Analyzers\VisualBasic\CodeFixes\GenerateVariable\VisualBasicGenerateVariableCodeFixProvider.vb (4)
38Protected Overrides Async Function GetCodeActionsAsync(document As Document, node As SyntaxNode, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of CodeAction)) 52Protected Overrides Function IsCandidate(node As SyntaxNode, token As SyntaxToken, diagnostic As Diagnostic) As Boolean 69Protected Overrides Function GetTargetNode(node As SyntaxNode) As SyntaxNode
src\Analyzers\VisualBasic\CodeFixes\ImplementInterface\VisualBasicImplementInterfaceService.vb (6)
43document As Document, model As SemanticModel, node As SyntaxNode, cancellationToken As CancellationToken, 44ByRef classOrStructDecl As SyntaxNode, ByRef classOrStructType As INamedTypeSymbol, 91node As SyntaxNode, 101Protected Overrides Function AddCommentInsideIfStatement(ifStatement As SyntaxNode, trivia As SyntaxTriviaList) As SyntaxNode 110disposeMethodDisplayString As String) As SyntaxNode
src\Analyzers\VisualBasic\CodeFixes\Iterator\VisualBasicChangeToYieldCodeFixProvider.vb (2)
36Protected Overrides Function GetCodeFixAsync(root As SyntaxNode, node As SyntaxNode, document As Document, diagnostics As Diagnostic, cancellationToken As CancellationToken) As Task(Of CodeAction)
src\Analyzers\VisualBasic\CodeFixes\Iterator\VisualBasicConvertToIteratorCodeFixProvider.vb (6)
38Protected Overrides Async Function GetCodeFixAsync(root As SyntaxNode, node As SyntaxNode, document As Document, diagnostics As Diagnostic, cancellationToken As CancellationToken) As Task(Of CodeAction) 111Private Shared Function AddIteratorKeywordToMethod(root As SyntaxNode, methodStatementNode As MethodStatementSyntax) As SyntaxNode 130Private Shared Function AddIteratorKeywordToLambda(root As SyntaxNode, lambdaNode As LambdaExpressionSyntax) As SyntaxNode
src\Analyzers\VisualBasic\CodeFixes\MakeFieldReadonly\VisualBasicMakeFieldReadonlyCodeFixProvider.vb (1)
26Protected Overrides Function GetInitializerNode(declaration As ModifiedIdentifierSyntax) As SyntaxNode
src\Analyzers\VisualBasic\CodeFixes\MakeMethodAsynchronous\VisualBasicMakeMethodAsynchronousCodeFixProvider.vb (6)
52Protected Overrides Function IsAsyncSupportingFunctionSyntax(node As SyntaxNode) As Boolean 63node As SyntaxNode, 65cancellationToken As CancellationToken) As SyntaxNode 83Private Shared Function FixFunctionBlock(methodSymbol As IMethodSymbol, node As MethodBlockSyntax, knownTypes As KnownTaskTypes) As SyntaxNode 98keepVoid As Boolean, node As MethodBlockSyntax, taskType As INamedTypeSymbol) As SyntaxNode 143Private Shared Function FixMultiLineLambdaExpression(node As MultiLineLambdaExpressionSyntax) As SyntaxNode
src\Analyzers\VisualBasic\CodeFixes\MakeMethodSynchronous\VisualBasicMakeMethodSynchronousCodeFixProvider.vb (5)
34Protected Overrides Function IsAsyncSupportingFunctionSyntax(node As SyntaxNode) As Boolean 38Protected Overrides Function RemoveAsyncTokenAndFixReturnType(methodSymbolOpt As IMethodSymbol, node As SyntaxNode, knownTypes As KnownTaskTypes) As SyntaxNode 54Private Shared Function FixFunctionBlock(methodSymbol As IMethodSymbol, node As MethodBlockSyntax, knownTypes As KnownTaskTypes) As SyntaxNode 91Private Shared Function FixSubBlock(node As MethodBlockSyntax) As SyntaxNode
src\Analyzers\VisualBasic\CodeFixes\MakeTypeAbstract\VisualBasicMakeTypeAbstractCodeFixProvider.vb (1)
25Protected Overrides Function IsValidRefactoringContext(node As SyntaxNode, ByRef typeDeclaration As ClassBlockSyntax) As Boolean
src\Analyzers\VisualBasic\CodeFixes\RemoveAsyncModifier\RemoveAsyncModifierHelpers.vb (1)
38Friend Shared Function FixMultiLineLambdaExpression(node As MultiLineLambdaExpressionSyntax) As SyntaxNode
src\Analyzers\VisualBasic\CodeFixes\RemoveAsyncModifier\VisualBasicRemoveAsyncModifierCodeFixProvider.vb (5)
30Protected Overrides Function IsAsyncSupportingFunctionSyntax(node As SyntaxNode) As Boolean 34Protected Overrides Function RemoveAsyncModifier(generator As SyntaxGenerator, methodLikeNode As SyntaxNode) As SyntaxNode 55Protected Overrides Function ConvertToBlockBody(node As SyntaxNode, expressionBody As ExpressionSyntax) As SyntaxNode
src\Analyzers\VisualBasic\CodeFixes\RemoveUnnecessaryCast\VisualBasicRemoveUnnecessaryCastCodeFixProvider.vb (2)
95cancellationToken As CancellationToken) As Task(Of SyntaxNode) 117cancellationToken As CancellationToken) As Task(Of SyntaxNode)
src\Analyzers\VisualBasic\CodeFixes\RemoveUnusedMembers\VisualBasicRemoveUnusedMembersCodeFixProvider.vb (1)
27Protected Overrides Sub AdjustAndAddAppropriateDeclaratorsToRemove(fieldDeclarators As HashSet(Of FieldDeclarationSyntax), declarators As HashSet(Of SyntaxNode))
src\Analyzers\VisualBasic\CodeFixes\RemoveUnusedParametersAndValues\VisualBasicRemoveUnusedValuesCodeFixProvider.vb (12)
40Protected Overrides Function TryUpdateNameForFlaggedNode(node As SyntaxNode, newName As SyntaxToken) As SyntaxNode 59Protected Overrides Function GetReplacementNodeForCompoundAssignment(originalCompoundAssignment As SyntaxNode, newAssignmentTarget As SyntaxNode, editor As SyntaxEditor, syntaxFacts As ISyntaxFactsService) As SyntaxNode 64Protected Overrides Function GetReplacementNodeForVarPattern(originalVarPattern As SyntaxNode, newNameNode As SyntaxNode) As SyntaxNode 69Protected Overrides Function ComputeReplacementNode(originalOldNode As SyntaxNode, changedOldNode As SyntaxNode, proposedReplacementNode As SyntaxNode) As SyntaxNode
src\Analyzers\VisualBasic\CodeFixes\UseCollectionInitializer\VisualBasicUseCollectionInitializerCodeFixProvider.vb (8)
45preMatches As ImmutableArray(Of CollectionMatch(Of SyntaxNode)), 46postMatches As ImmutableArray(Of CollectionMatch(Of SyntaxNode)), 47cancellationToken As CancellationToken) As Task(Of (SyntaxNode, SyntaxNode)) 70Return Task.FromResult((DirectCast(statement, SyntaxNode), DirectCast(result, SyntaxNode))) 75matches As ImmutableArray(Of CollectionMatch(Of SyntaxNode))) As ObjectCreationExpressionSyntax 85matches As ImmutableArray(Of CollectionMatch(Of SyntaxNode))) As CollectionInitializerSyntax
src\Analyzers\VisualBasic\CodeFixes\UseConditionalExpression\MultiLineConditionalExpressionFormattingRule.vb (1)
52list As List(Of IndentBlockOperation), node As SyntaxNode, ByRef nextOperation As NextIndentBlockOperationAction)
src\Analyzers\VisualBasic\CodeFixes\UseInferredMemberName\VisualBasicUseInferredMemberNameCodeFixProvider.vb (1)
22Protected Overrides Sub LanguageSpecificRemoveSuggestedNode(editor As SyntaxEditor, node As SyntaxNode)
src\Analyzers\VisualBasic\CodeFixes\UseIsNullCheck\VisualBasicUseIsNullCheckForReferenceEqualsCodeFixProvider.vb (2)
25Protected Overrides Function CreateNullCheck(argument As ExpressionSyntax, isUnconstrainedGeneric As Boolean) As SyntaxNode 31Protected Overrides Function CreateNotNullCheck(argument As ExpressionSyntax) As SyntaxNode
src\Analyzers\VisualBasic\CodeFixes\UseNullPropagation\VisualBasicUseNullPropagationCodeFixProvider.vb (2)
34Protected Overrides Function TryGetBlock(node As SyntaxNode, ByRef block As ExecutableStatementSyntax) As Boolean 42Protected Overrides Function PostProcessElseIf(ifStatement As MultiLineIfBlockSyntax, newWhenTrueStatement As ExecutableStatementSyntax) As SyntaxNode
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\ArgumentGenerator.vb (2)
9Public Function GenerateArgument(argument As SyntaxNode) As ArgumentSyntax 17Friend Function GenerateArgumentList(arguments As IList(Of SyntaxNode)) As ArgumentListSyntax
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\ConstructorGenerator.vb (2)
13Private Function LastConstructorOrField(Of TDeclaration As SyntaxNode)(members As SyntaxList(Of TDeclaration)) As TDeclaration 106Private Function CreateThisConstructorCall(arguments As IList(Of SyntaxNode)) As StatementSyntax
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\FieldGenerator.vb (1)
15Private Function LastField(Of TDeclaration As SyntaxNode)(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\MethodGenerator.vb (1)
113Private Shared Function GenerateHandlesClause(expressions As IList(Of SyntaxNode)) As HandlesClauseSyntax
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\NamespaceGenerator.vb (8)
44Public Function GenerateNamespaceDeclaration(service As ICodeGenerationService, [namespace] As INamespaceSymbol, options As CodeGenerationContextInfo, cancellationToken As CancellationToken) As SyntaxNode 59declaration As SyntaxNode, 62cancellationToken As CancellationToken) As SyntaxNode 68Private Function GetDeclarationSyntaxWithoutMembers([namespace] As INamespaceSymbol, innermostNamespace As INamespaceSymbol, name As String, options As CodeGenerationContextInfo) As SyntaxNode 69Dim reusableSyntax = GetReuseableSyntaxNodeForSymbol(Of SyntaxNode)([namespace], options) 77Private Function RemoveAllMembers(declaration As SyntaxNode) As SyntaxNode 88Private Function GenerateNamespaceDeclarationWorker(name As String, [namespace] As INamespaceSymbol) As SyntaxNode
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\PropertyGenerator.vb (1)
14Private Function LastPropertyOrField(Of TDeclaration As SyntaxNode)(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\StatementGenerator.vb (1)
11Friend Function GenerateStatements(statements As IEnumerable(Of SyntaxNode)) As SyntaxList(Of StatementSyntax)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\VisualBasicCodeGenerationHelpers.vb (12)
91Public Function FirstMember(Of TDeclaration As SyntaxNode)(members As SyntaxList(Of TDeclaration)) As TDeclaration 95Public Function FirstMethod(Of TDeclaration As SyntaxNode)(members As SyntaxList(Of TDeclaration)) As TDeclaration 99Public Function LastField(Of TDeclaration As SyntaxNode)(members As SyntaxList(Of TDeclaration)) As TDeclaration 103Public Function LastConstructor(Of TDeclaration As SyntaxNode)(members As SyntaxList(Of TDeclaration)) As TDeclaration 107Public Function LastMethod(Of TDeclaration As SyntaxNode)(members As SyntaxList(Of TDeclaration)) As TDeclaration 111Public Function LastOperator(Of TDeclaration As SyntaxNode)(members As SyntaxList(Of TDeclaration)) As TDeclaration 115Private Function AfterDeclaration(Of TDeclaration As SyntaxNode)( 121Private Function BeforeDeclaration(Of TDeclaration As SyntaxNode)( 127Public Function Insert(Of TDeclaration As SyntaxNode)( 151Public Function GetDestination(destination As SyntaxNode) As CodeGenerationDestination 176Public Function ConditionallyAddDocumentationCommentTo(Of TSyntaxNode As SyntaxNode)( 198Public Function GetReuseableSyntaxNodeForSymbol(Of T As SyntaxNode)(symbol As ISymbol, options As CodeGenerationContextInfo) As T
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\VisualBasicCodeGenerationService.vb (37)
41Public Overloads Overrides Function GetDestination(containerNode As SyntaxNode) As CodeGenerationDestination 45Protected Overrides Function GetMemberComparer() As IComparer(Of SyntaxNode) 49Protected Overrides Function GetAvailableInsertionIndices(destination As SyntaxNode, cancellationToken As CancellationToken) As IList(Of Boolean) 92Protected Overrides Function AddEvent(Of TDeclarationNode As SyntaxNode)( 102Protected Overrides Function AddField(Of TDeclarationNode As SyntaxNode)( 118Protected Overrides Function AddProperty(Of TDeclarationNode As SyntaxNode)( 133Protected Overrides Function AddMethod(Of TDeclarationNode As SyntaxNode)( 177Protected Overloads Overrides Function AddNamedType(Of TDeclarationNode As SyntaxNode)( 193Protected Overrides Function AddNamespace(Of TDeclarationNode As SyntaxNode)( 208Public Overrides Function AddParameters(Of TDeclarationNode As SyntaxNode)( 236Protected Overrides Function AddMembers(Of TDeclarationNode As SyntaxNode)(destination As TDeclarationNode, members As IEnumerable(Of SyntaxNode)) As TDeclarationNode 249Private Overloads Function AddParametersToMethod(Of TDeclarationNode As SyntaxNode)( 284Private Overloads Function AddParametersToProperty(Of TDeclarationNode As SyntaxNode)( 291Dim newPropertyBlock As SyntaxNode = propertyBlock.WithPropertyStatement(newPropertyStatement) 325Public Overrides Function AddAttributes(Of TDeclarationNode As SyntaxNode)( 359Public Overrides Function RemoveAttribute(Of TDeclarationNode As SyntaxNode)(destination As TDeclarationNode, attributeToRemove As AttributeData, options As VisualBasicCodeGenerationContextInfo, cancellationToken As CancellationToken) As TDeclarationNode 368Public Overrides Function RemoveAttribute(Of TDeclarationNode As SyntaxNode)(destination As TDeclarationNode, attributeToRemove As SyntaxNode, options As VisualBasicCodeGenerationContextInfo, cancellationToken As CancellationToken) As TDeclarationNode 409Private Shared Function RemoveAttributeFromAttributeLists(attributeLists As SyntaxList(Of AttributeListSyntax), attributeToRemove As SyntaxNode, 438Private Shared Function RemoveAttributeFromAttributeStatements(attributeStatements As SyntaxList(Of AttributesStatementSyntax), attributeToRemove As SyntaxNode, 459Public Overrides Function AddStatements(Of TDeclarationNode As SyntaxNode)( 461statements As IEnumerable(Of SyntaxNode), 492Private Shared Function AddStatementsWorker(Of TDeclarationNode As SyntaxNode)( 494statements As IEnumerable(Of SyntaxNode), 509Dim newBlock As SyntaxNode 530cancellationToken As CancellationToken) As SyntaxNode 551cancellationToken As CancellationToken) As SyntaxNode 558cancellationToken As CancellationToken) As SyntaxNode 569cancellationToken As CancellationToken) As SyntaxNode 576cancellationToken As CancellationToken) As SyntaxNode 583cancellationToken As CancellationToken) As SyntaxNode 587Private Overloads Shared Function UpdateDeclarationModifiers(Of TDeclarationNode As SyntaxNode)(declaration As TDeclarationNode, computeNewModifiersList As Func(Of SyntaxTokenList, SyntaxTokenList)) As TDeclarationNode 633Public Overrides Function UpdateDeclarationModifiers(Of TDeclarationNode As SyntaxNode)(declaration As TDeclarationNode, newModifiers As IEnumerable(Of SyntaxToken), options As VisualBasicCodeGenerationContextInfo, cancellationToken As CancellationToken) As TDeclarationNode 641Public Overrides Function UpdateDeclarationAccessibility(Of TDeclarationNode As SyntaxNode)(declaration As TDeclarationNode, newAccessibility As Accessibility, options As VisualBasicCodeGenerationContextInfo, cancellationToken As CancellationToken) As TDeclarationNode 696Public Overrides Function UpdateDeclarationType(Of TDeclarationNode As SyntaxNode)(declaration As TDeclarationNode, newType As ITypeSymbol, options As VisualBasicCodeGenerationContextInfo, cancellationToken As CancellationToken) As TDeclarationNode 758Public Overrides Function UpdateDeclarationMembers(Of TDeclarationNode As SyntaxNode)(declaration As TDeclarationNode, newMembers As IList(Of ISymbol), options As VisualBasicCodeGenerationContextInfo, cancellationToken As CancellationToken) As TDeclarationNode
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\VisualBasicDeclarationComparer.vb (9)
9Implements IComparer(Of SyntaxNode) 72Public Function Compare(x As SyntaxNode, y As SyntaxNode) As Integer Implements IComparer(Of SyntaxNode).Compare 126Private Shared Function ConvertBlockToStatement(node As SyntaxNode) As SyntaxNode 302Private Shared Function GetAccessibilityPrecedence(declaration As SyntaxNode, modifiers As IEnumerable(Of SyntaxToken)) As Integer 377Private Shared Function EqualAccessibility(x As SyntaxNode, xModifiers As SyntaxTokenList, y As SyntaxNode, yModifiers As SyntaxTokenList, ByRef comparisonResult As Integer) As Boolean
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\VisualBasicFlagsEnumGenerator.vb (1)
21constantValue As Object) As SyntaxNode
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeRefactorings\VisualBasicRefactoringHelpersService.vb (5)
25Public Overrides Function IsBetweenTypeMembers(sourceText As SourceText, root As SyntaxNode, position As Integer, ByRef typeDeclaration As SyntaxNode) As Boolean 68Protected Overrides Iterator Function ExtractNodesSimple(node As SyntaxNode, syntaxFacts As ISyntaxFactsService) As IEnumerable(Of SyntaxNode) 104Public Shared Function IsIdentifierOfParameter(node As SyntaxNode) As Boolean
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Editing\VisualBasicImportAdder.vb (7)
25Protected Overrides Function GetExplicitNamespaceSymbol(node As SyntaxNode, model As SemanticModel) As INamespaceSymbol 39Protected Overrides Function AddPotentiallyConflictingImportsAsync(model As SemanticModel, container As SyntaxNode, namespaceSymbols As ImmutableArray(Of INamespaceSymbol), conflicts As HashSet(Of INamespaceSymbol), cancellationToken As CancellationToken) As Task 128Public Async Function AddPotentiallyConflictingImportsAsync(container As SyntaxNode, conflicts As HashSet(Of INamespaceSymbol), cancellationToken As CancellationToken) As Task 129Dim nodes = ArrayBuilder(Of SyntaxNode).GetInstance() 135Function(node As SyntaxNode, onItemsFound As Action(Of INamespaceSymbol), conflictFinder As ConflictFinder, cancellationToken1 As CancellationToken) As Task 155Private Sub CollectInfoFromContainer(container As SyntaxNode, nodes As ArrayBuilder(Of SyntaxNode), ByRef containsAnonymousMethods As Boolean)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\CompilationUnitSyntaxExtensions.vb (1)
19Public Function CanAddImportsStatements(contextNode As SyntaxNode, allowInHiddenRegions As Boolean, cancellationToken As CancellationToken) As Boolean
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ContextQuery\IsStatementTerminatingTokenVisitor.vb (1)
24Public Overrides Function DefaultVisit(node As SyntaxNode) As Boolean
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ContextQuery\SyntaxTreeExtensions.vb (2)
810Friend Function IsFollowingCompleteExpression(Of TParent As SyntaxNode)( 853Friend Function GetExpressionTerminatingToken(expression As SyntaxNode) As SyntaxToken
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ContextQuery\VisualBasicSyntaxContext.vb (1)
231For Each node In targetToken.GetAncestors(Of SyntaxNode)()
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ContextQuery\VisualBasicSyntaxContextExtensions.vb (2)
38Friend Function IsFollowingCompleteStatement(Of TParent As SyntaxNode)(context As VisualBasicSyntaxContext, childGetter As Func(Of TParent, StatementSyntax)) As Boolean 82Private Function IsInStatementBlockHelper(Of TArg)(context As VisualBasicSyntaxContext, predicate As Func(Of SyntaxNode, TArg, Boolean), arg As TArg) As Boolean
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ExpressionSyntaxExtensions.vb (3)
221Public Function GetImplicitMemberAccessExpressions(expression As SyntaxNode, span As TextSpan) As IEnumerable(Of ExpressionSyntax) 237Public Function GetImplicitMemberAccessExpressions(expression As SyntaxNode) As IEnumerable(Of ExpressionSyntax) 241Private Function ContainsImplicitMemberAccessWorker(expression As SyntaxNode) As Boolean
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\INamespaceOrTypeSymbolExtensions.vb (1)
19Public Function GetAliasForSymbol(symbol As INamespaceOrTypeSymbol, node As SyntaxNode, semanticModel As SemanticModel) As IAliasSymbol
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\SyntaxListExtensions.vb (3)
10Public Function RemoveRange(Of T As SyntaxNode)(syntaxList As SyntaxList(Of T), index As Integer, count As Integer) As SyntaxList(Of T) 17Public Function ToSyntaxList(Of T As SyntaxNode)(sequence As IEnumerable(Of T)) As SyntaxList(Of T) 22Public Function Insert(Of T As SyntaxNode)(syntaxList As SyntaxList(Of T), index As Integer, item As T) As SyntaxList(Of T)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\TypeBlockSyntaxExtensions.vb (2)
44Private Function ReplaceTrailingColonToEndOfLineTrivia(Of TNode As SyntaxNode)(node As TNode) As TNode 48Private Function EnsureProperList(Of TSyntax As SyntaxNode)(list As SyntaxList(Of TSyntax)) As SyntaxList(Of TSyntax)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Indentation\SpecialFormattingOperation.vb (10)
22Public Overrides Sub AddSuppressOperationsSlow(list As ArrayBuilder(Of SuppressOperation), node As SyntaxNode, ByRef nextOperation As NextSuppressOperationAction) 57Public Overrides Sub AddIndentBlockOperationsSlow(list As List(Of IndentBlockOperation), node As SyntaxNode, ByRef nextOperation As NextIndentBlockOperationAction) 83Private Overloads Shared Sub AddIndentBlockOperations(Of T As SyntaxNode)(list As List(Of IndentBlockOperation), node As SyntaxNode, predicate As Func(Of T, Boolean), Optional indentationDelta As Integer = 0) 96Private Overloads Shared Sub AddIndentBlockOperations(list As List(Of IndentBlockOperation), parameterOrArgumentList As SyntaxNode, indentationDelta As Integer) 113Private Shared Sub AddArgumentListIndentBlockOperations(operations As List(Of IndentBlockOperation), node As SyntaxNode) 169Public Overrides Sub AddAlignTokensOperationsSlow(operations As List(Of AlignTokensOperation), node As SyntaxNode, ByRef nextAction As NextAlignTokensOperationAction) 184Private Shared Sub AddCaseClauseAlignTokensOperations(operations As List(Of AlignTokensOperation), node As SyntaxNode) 201Private Overloads Shared Sub AddAlignTokensOperations(Of T As SyntaxNode)(operations As List(Of AlignTokensOperation), node As SyntaxNode, baseTokenGetter As Func(Of T, SyntaxToken))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Indentation\VisualBasicIndentationService.Indenter.vb (1)
215Private Shared Function ContainingStatementHasDiagnostic(node As SyntaxNode) As Boolean
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicAddImportsService.vb (13)
40Protected Overrides Function IsEquivalentImport(a As SyntaxNode, b As SyntaxNode) As Boolean 51Protected Overrides Function GetGlobalImports(compilation As Compilation, generator As SyntaxGenerator) As ImmutableArray(Of SyntaxNode) 52Dim result = ArrayBuilder(Of SyntaxNode).GetInstance() 63Protected Overrides Function GetAlias(usingOrAlias As ImportsStatementSyntax) As SyntaxNode 79Protected Overrides Function GetExterns(node As SyntaxNode) As SyntaxList(Of ImportsStatementSyntax) 83Protected Overrides Function GetUsingsAndAliases(node As SyntaxNode) As SyntaxList(Of ImportsStatementSyntax) 96externContainer As SyntaxNode, 97usingContainer As SyntaxNode, 98staticUsingContainer As SyntaxNode, 99aliasContainer As SyntaxNode, 101root As SyntaxNode, 102cancellationToken As CancellationToken) As SyntaxNode
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicMoveDeclarationNearReferenceService.vb (5)
25Protected Overrides Function IsMeaningfulBlock(node As SyntaxNode) As Boolean 33Protected Overrides Function GetVariableDeclaratorSymbolNode(variableDeclarator As VariableDeclaratorSyntax) As SyntaxNode 45Protected Overrides Function TypesAreCompatibleAsync(document As Document, localSymbol As ILocalSymbol, declarationStatement As LocalDeclarationStatementSyntax, right As SyntaxNode, cancellationToken As CancellationToken) As Task(Of Boolean) 49Protected Overrides Function CanMoveToBlock(localSymbol As ILocalSymbol, currentBlock As SyntaxNode, destinationBlock As SyntaxNode) As Boolean
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicRemoveUnnecessaryImportsService.vb (2)
28predicate As Func(Of SyntaxNode, Boolean), 31predicate = If(predicate, Functions(Of SyntaxNode).True)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicSemanticFactsService.vb (12)
107semanticModel As SemanticModel, location As SyntaxNode, containerOpt As SyntaxNode, baseName As String, cancellationToken As CancellationToken) As SyntaxToken Implements ISemanticFactsService.GenerateUniqueName 112semanticModel As SemanticModel, location As SyntaxNode, containerOpt As SyntaxNode, baseName As String, usedNames As IEnumerable(Of String), cancellationToken As CancellationToken) As SyntaxToken Implements ISemanticFactsService.GenerateUniqueName 117semanticModel As SemanticModel, location As SyntaxNode, containerOpt As SyntaxNode, baseName As String, cancellationToken As CancellationToken) As SyntaxToken Implements ISemanticFactsService.GenerateUniqueLocalName 122semanticModel As SemanticModel, location As SyntaxNode, containerOpt As SyntaxNode, baseName As String, usedName As IEnumerable(Of String), cancellationToken As CancellationToken) As SyntaxToken Implements ISemanticFactsService.GenerateUniqueLocalName 126Private Function ISemanticFactsService_GenerateUniqueName(semanticModel As SemanticModel, location As SyntaxNode, containerOpt As SyntaxNode, baseName As String, filter As Func(Of ISymbol, Boolean), usedNames As IEnumerable(Of String), cancellationToken As CancellationToken) As SyntaxToken Implements ISemanticFactsService.GenerateUniqueName 134Public Function ClassifyConversion(semanticModel As SemanticModel, expression As SyntaxNode, destination As ITypeSymbol) As CommonConversion Implements ISemanticFactsService.ClassifyConversion 138Public Function TryGetDisposeMethod(semanticModel As SemanticModel, node As SyntaxNode, cancellationToken As CancellationToken) As IMethodSymbol Implements ISemanticFactsService.TryGetDisposeMethod
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicSymbolDeclarationService.vb (2)
42Public Overrides Function GetSyntax(Optional cancellationToken As CancellationToken = Nothing) As SyntaxNode 46Public Overrides Async Function GetSyntaxAsync(Optional cancellationToken As CancellationToken = Nothing) As Task(Of SyntaxNode)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicSyntaxFactsService.vb (4)
31Public Sub AddFirstMissingCloseBrace(Of TContextNode As SyntaxNode)( 32root As SyntaxNode, contextNode As TContextNode, 33ByRef newRoot As SyntaxNode, ByRef newContextNode As TContextNode) Implements ISyntaxFactsService.AddFirstMissingCloseBrace 39Public Function GetSelectedFieldsAndPropertiesAsync(tree As SyntaxTree, textSpan As TextSpan, allowPartialSelection As Boolean, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of SyntaxNode)) Implements ISyntaxFactsService.GetSelectedFieldsAndPropertiesAsync
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicSyntaxGeneratorInternal.vb (86)
57Public Overloads Overrides Function LocalDeclarationStatement(type As SyntaxNode, identifier As SyntaxToken, Optional initializer As SyntaxNode = Nothing, Optional isConst As Boolean = False) As SyntaxNode 63Public Overrides Function WithInitializer(variableDeclarator As SyntaxNode, initializer As SyntaxNode) As SyntaxNode 67Public Overrides Function EqualsValueClause(operatorToken As SyntaxToken, value As SyntaxNode) As SyntaxNode 71Friend Shared Function VariableDeclarator(type As SyntaxNode, name As ModifiedIdentifierSyntax, Optional expression As SyntaxNode = Nothing) As VariableDeclaratorSyntax 84Public Overrides Function ConditionalAccessExpression(expression As SyntaxNode, whenNotNull As SyntaxNode) As SyntaxNode 90Public Overrides Function MemberBindingExpression(name As SyntaxNode) As SyntaxNode 94Public Overrides Function RefExpression(expression As SyntaxNode) As SyntaxNode 98Public Overrides Function AddParentheses(expression As SyntaxNode, Optional includeElasticTrivia As Boolean = True, Optional addSimplifierAnnotation As Boolean = True) As SyntaxNode 102Friend Shared Function Parenthesize(expression As SyntaxNode, Optional addSimplifierAnnotation As Boolean = True) As ParenthesizedExpressionSyntax 106Public Overrides Function YieldReturnStatement(expression As SyntaxNode) As SyntaxNode 116Public Overrides Function InterpolatedStringExpression(startToken As SyntaxToken, content As IEnumerable(Of SyntaxNode), endToken As SyntaxToken) As SyntaxNode 121Public Overrides Function InterpolatedStringText(textToken As SyntaxToken) As SyntaxNode 129Public Overrides Function Interpolation(syntaxNode As SyntaxNode) As SyntaxNode 133Public Overrides Function InterpolationAlignmentClause(alignment As SyntaxNode) As SyntaxNode 139Public Overrides Function InterpolationFormatClause(format As String) As SyntaxNode 145Public Overrides Function TypeParameterList(typeParameterNames As IEnumerable(Of String)) As SyntaxNode 151Public Overrides Function Type(typeSymbol As ITypeSymbol, typeContext As Boolean) As SyntaxNode 155Public Overrides Function NegateEquality(generator As SyntaxGenerator, node As SyntaxNode, left As SyntaxNode, negatedKind As Operations.BinaryOperatorKind, right As SyntaxNode) As SyntaxNode 170Public Overrides Function IsNotTypeExpression(expression As SyntaxNode, type As SyntaxNode) As SyntaxNode 176type As SyntaxNode, 179Optional parameters As IEnumerable(Of SyntaxNode) = Nothing, 180Optional addAccessorStatements As IEnumerable(Of SyntaxNode) = Nothing, 181Optional removeAccessorStatements As IEnumerable(Of SyntaxNode) = Nothing, 182Optional raiseAccessorStatements As IEnumerable(Of SyntaxNode) = Nothing) As SyntaxNode 192addAccessorStatements = SpecializedCollections.EmptyEnumerable(Of SyntaxNode)() 196removeAccessorStatements = SpecializedCollections.EmptyEnumerable(Of SyntaxNode)() 200raiseAccessorStatements = SpecializedCollections.EmptyEnumerable(Of SyntaxNode)() 224Friend Shared Function CreateAddHandlerAccessorBlock(delegateType As SyntaxNode, statements As IEnumerable(Of SyntaxNode)) As AccessorBlockSyntax 246Friend Shared Function CreateRemoveHandlerAccessorBlock(delegateType As SyntaxNode, statements As IEnumerable(Of SyntaxNode)) As AccessorBlockSyntax 268Friend Shared Function CreateRaiseEventAccessorBlock(parameters As IEnumerable(Of SyntaxNode), statements As IEnumerable(Of SyntaxNode)) As AccessorBlockSyntax 283Friend Shared Function GetStatementList(nodes As IEnumerable(Of SyntaxNode)) As SyntaxList(Of StatementSyntax) 291Friend Shared Function AsStatement(node As SyntaxNode) As StatementSyntax 360Friend Shared Function GetParameterList(parameters As IEnumerable(Of SyntaxNode)) As ParameterListSyntax 364Friend Shared Function GetModifierList(accessibility As Accessibility, modifiers As DeclarationModifiers, declaration As SyntaxNode, kind As DeclarationKind, Optional isDefault As Boolean = False) As SyntaxTokenList 465Public Overrides Function IsPatternExpression(expression As SyntaxNode, isToken As SyntaxToken, pattern As SyntaxNode) As SyntaxNode 469Public Overrides Function AndPattern(left As SyntaxNode, right As SyntaxNode) As SyntaxNode 473Public Overrides Function ConstantPattern(expression As SyntaxNode) As SyntaxNode 477Public Overrides Function DeclarationPattern(type As INamedTypeSymbol, name As String) As SyntaxNode 481Public Overrides Function LessThanRelationalPattern(expression As SyntaxNode) As SyntaxNode 485Public Overrides Function LessThanEqualsRelationalPattern(expression As SyntaxNode) As SyntaxNode 489Public Overrides Function GreaterThanRelationalPattern(expression As SyntaxNode) As SyntaxNode 493Public Overrides Function GreaterThanEqualsRelationalPattern(expression As SyntaxNode) As SyntaxNode 497Public Overrides Function NotPattern(pattern As SyntaxNode) As SyntaxNode 501Public Overrides Function OrPattern(left As SyntaxNode, right As SyntaxNode) As SyntaxNode 505Public Overrides Function ParenthesizedPattern(pattern As SyntaxNode) As SyntaxNode 509Public Overrides Function TypePattern(type As SyntaxNode) As SyntaxNode 513Public Overrides Function UnaryPattern(operatorToken As SyntaxToken, pattern As SyntaxNode) As SyntaxNode
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicTypeInferenceService.TypeInferrer.vb (3)
27Protected Overrides Function GetTypes_DoNotCallDirectly(node As SyntaxNode, objectAsDefault As Boolean) As IEnumerable(Of TypeInferenceInfo) 51Protected Overrides Function InferTypesWorker_DoNotCallDirectly(node As SyntaxNode) As IEnumerable(Of TypeInferenceInfo) 982parameterName As String, node As SyntaxNode) As ITypeSymbol
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.UnitTests (11)
src\Features\VisualBasicTest\Utils.vb (11)
53Friend Function FindFirstNodeOfType(Of T As SyntaxNode)(node As SyntaxNode) As T 71Friend Function DigToNthNodeOfType(Of T As SyntaxNode)(node As SyntaxNode, index As Integer) As T 78Friend Function DigToFirstNodeOfType(Of T As SyntaxNode)(node As SyntaxNode) As T 85Friend Function DigToFirstNodeOfType(Of T As SyntaxNode)(syntaxTree As SyntaxTree) As T 90Friend Function DigToLastNodeOfType(Of T As SyntaxNode)(node As SyntaxNode) As T 110Friend Class TreeNodePair(Of T As SyntaxNode) 137Friend Shared Function Create(Of T As SyntaxNode)(syntaxTree As SyntaxTree, node As T) As TreeNodePair(Of T)
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures (17)
AutomaticCompletion\AutomaticLineEnderCommandHandler.vb (2)
50Protected Overrides Sub ModifySelectedNode(args As AutomaticLineEnderCommandArgs, document As ParsedDocument, selectedNode As SyntaxNode, addBrace As Boolean, caretPosition As Integer, fallbackOptions As StructuredAnalyzerConfigOptions, cancellationToken As CancellationToken) 53Protected Overrides Function GetValidNodeToModifyBraces(document As ParsedDocument, caretPosition As Integer, cancellationToken As CancellationToken) As (SyntaxNode, Boolean)?
AutomaticEndConstructCorrection\AutomaticEndConstructCorrector.vb (7)
210Function(dontCare As SyntaxNode) CType(Nothing, SyntaxNode)) 245Function(dontCare As SyntaxNode) New SyntaxToken()) 263Private Shared Function BeginStatementIsInValidForm(node As SyntaxNode) As Boolean 273Function(dontCare As SyntaxNode) False) 276Private Shared Function GetBeginToken(node As SyntaxNode) As SyntaxToken 284Function(dontCare As SyntaxNode) New SyntaxToken())
EndConstructGeneration\VisualBasicEndConstructGenerationService.vb (2)
49Private Shared Function IsMissingStatementError(statement As SyntaxNode, [error] As String) As Boolean 316Private Shared Function GetNodeFromToken(Of T As SyntaxNode)(token As SyntaxToken, expectedKind As SyntaxKind) As T
LineCommit\CommitFormatter.vb (1)
259Public Overrides Sub AddAnchorIndentationOperationsSlow(list As List(Of AnchorIndentationOperation), node As SyntaxNode, ByRef nextOperation As NextAnchorIndentationOperationAction)
LineCommit\ContainingStatementInfo.vb (2)
16Public Sub New(node As SyntaxNode) 20Public Sub New(node As SyntaxNode, span As TextSpan)
NavigationBar\VisualBasicEditorNavigationBarItemService_CodeGeneration.vb (2)
121Dim statements As New ArrayBuilder(Of SyntaxNode) 195handlesExpressions:=ImmutableArray.Create(Of SyntaxNode)(handlesSyntax))
SplitComment\VisualBasicSplitCommentService.vb (1)
25Public Function IsAllowed(root As SyntaxNode, trivia As SyntaxTrivia) As Boolean Implements ISplitCommentService.IsAllowed
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (19)
CodeGen\CodeGenTuples.vb (2)
20825Assert.Equal("(System.Int32, elem2 As System.Int32).Item1 As System.Int32", model.GetDeclaredSymbol(DirectCast(type.Elements.First(), SyntaxNode)).ToTestDisplayString()) 20826Assert.Equal("(System.Int32, elem2 As System.Int32).elem2 As System.Int32", model.GetDeclaredSymbol(DirectCast(type.Elements.Last(), SyntaxNode)).ToTestDisplayString())
Emit\EditAndContinue\EditAndContinueClosureTests.vb (4)
799''' This handling is done in <see cref="LambdaUtilities.GetCorrespondingLambdaBody(SyntaxNode, SyntaxNode)"/> 863''' This handling is done in <see cref="LambdaUtilities.GetCorrespondingLambdaBody(SyntaxNode, SyntaxNode)"/>
Emit\EditAndContinue\EditAndContinueTest.vb (2)
48Protected Overrides Function GetEquivalentNodesMap(left As ISymbol, right As ISymbol) As Func(Of SyntaxNode, SyntaxNode)
Emit\EditAndContinue\EditAndContinueTestBase.vb (11)
51Friend Shared Function GetSyntaxMapFromMarkers(source0 As SourceWithMarkedNodes, source1 As SourceWithMarkedNodes) As Func(Of SyntaxNode, SyntaxNode) 59Optional rudeEdits As Func(Of SyntaxNode, RuntimeRudeEdit?) = Nothing, 119Friend Shared Function GetLocalName(node As SyntaxNode) As String 127Friend Shared Function GetSyntaxMapByKind(method As MethodSymbol, ParamArray kinds As SyntaxKind()) As Func(Of SyntaxNode, SyntaxNode) 128Return Function(node As SyntaxNode) 139Friend Shared Function GetEquivalentNodesMap(method1 As MethodSymbol, method0 As MethodSymbol) As Func(Of SyntaxNode, SyntaxNode) 147Return Function(s As SyntaxNode) 178Friend Shared Function GetNearestStatement(node As SyntaxNode) As StatementSyntax
Microsoft.CodeAnalysis.VisualBasic.ExpressionCompiler (23)
EEAssemblyBuilder.vb (4)
186Public Overrides Function TryGetPreviousHoistedLocalSlotIndex(currentDeclarator As SyntaxNode, currentType As ITypeReference, synthesizedKind As SynthesizedLocalKind, currentId As LocalDebugId, diagnostics As DiagnosticBag, <Out> ByRef slotIndex As Integer) As Boolean 196Public Overrides Function TryGetPreviousClosure(closureSyntax As SyntaxNode, parentClosureId As DebugId?, structCaptures As ImmutableArray(Of String), ByRef closureId As DebugId, ByRef runtimeRudeEdit As RuntimeRudeEdit?) As Boolean 202Public Overrides Function TryGetPreviousLambda(lambdaOrLambdaBodySyntax As SyntaxNode, isLambdaBody As Boolean, closureOrdinal As Integer, structClosureIds As ImmutableArray(Of DebugId), ByRef lambdaId As DebugId, ByRef runtimeRudeEdit As RuntimeRudeEdit?) As Boolean 208Public Overrides Function TryGetPreviousStateMachineState(syntax As SyntaxNode, awaitId As AwaitDebugId, ByRef state As StateMachineState) As Boolean
Rewriters\CapturedVariableRewriter.vb (3)
124Private Function GetRewrittenMeParameter(syntax As SyntaxNode, node As BoundExpression) As BoundExpression 135Private Function RewriteParameter(syntax As SyntaxNode, symbol As ParameterSymbol, node As BoundExpression) As BoundExpression 157Private Sub ReportMissingMe(syntax As SyntaxNode)
Rewriters\LocalDeclarationRewriter.vb (1)
57syntax As SyntaxNode,
Symbols\DisplayClassInstance.vb (3)
13Friend MustOverride Function ToBoundExpression(syntax As SyntaxNode) As BoundExpression 57Friend Overrides Function ToBoundExpression(syntax As SyntaxNode) As BoundExpression 98Friend Overrides Function ToBoundExpression(syntax As SyntaxNode) As BoundExpression
Symbols\DisplayClassVariable.vb (1)
63Friend Function ToBoundExpression(syntax As SyntaxNode, isLValue As Boolean, suppressVirtualCalls As Boolean) As BoundExpression
Symbols\EELocalSymbolBase.vb (1)
38Friend Overrides Function GetDeclaratorSyntax() As SyntaxNode
Symbols\EEMethodSymbol.vb (2)
438Friend Overrides ReadOnly Property Syntax As SyntaxNode 469Dim syntax As SyntaxNode = body.Syntax
Symbols\EEStaticLocalSymbol.vb (1)
74syntax As SyntaxNode,
Symbols\ExceptionLocalSymbol.vb (1)
29syntax As SyntaxNode,
Symbols\ObjectIdLocalSymbol.vb (4)
30syntax As SyntaxNode, 40syntax As SyntaxNode, 50syntax As SyntaxNode, 101Private Shared Function InvokeGetMethod(method As MethodSymbol, syntax As SyntaxNode, name As String) As BoundExpression
Symbols\PlaceholderLocalSymbol.vb (1)
111syntax As SyntaxNode,
Symbols\ReturnValueLocalSymbol.vb (1)
30syntax As SyntaxNode,
Microsoft.CodeAnalysis.VisualBasic.Features (1126)
AddImport\VisualBasicAddImportFeatureService.vb (20)
28Protected Overrides Function CanAddImport(node As SyntaxNode, allowInHiddenRegions As Boolean, cancellationToken As CancellationToken) As Boolean 36node As SyntaxNode, 96Protected Overrides Function CanAddImportForNamespace(diagnosticId As String, node As SyntaxNode, ByRef nameNode As SimpleNameSyntax) As Boolean 109Protected Overrides Function CanAddImportForDeconstruct(diagnosticId As String, node As SyntaxNode) As Boolean 114Protected Overrides Function CanAddImportForGetAwaiter(diagnosticId As String, syntaxFactsService As ISyntaxFacts, node As SyntaxNode) As Boolean 119Protected Overrides Function CanAddImportForGetEnumerator(diagnosticId As String, syntaxFactsService As ISyntaxFacts, node As SyntaxNode) As Boolean 123Protected Overrides Function CanAddImportForGetAsyncEnumerator(diagnosticId As String, syntaxFactsService As ISyntaxFacts, node As SyntaxNode) As Boolean 127Protected Overrides Function CanAddImportForQuery(diagnosticId As String, node As SyntaxNode) As Boolean 133diagnosticId As String, node As SyntaxNode, ByRef nameNode As SimpleNameSyntax) As Boolean 159Private Shared Function CanAddImportForTypeOrNamespaceCore(node As SyntaxNode, ByRef nameNode As SimpleNameSyntax) As Boolean 192root As SyntaxNode, 217Protected Overrides Function GetImportNamespacesInScope(semanticModel As SemanticModel, node As SyntaxNode, cancellationToken As CancellationToken) As ISet(Of INamespaceSymbol) 221Protected Overrides Function GetDeconstructInfo(semanticModel As SemanticModel, node As SyntaxNode, cancellationToken As CancellationToken) As ITypeSymbol 227node As SyntaxNode, 277contextNode As SyntaxNode, 289contextNode As SyntaxNode, 308contextNode As SyntaxNode, 327expression As SyntaxNode, 335Dim leftExpression As SyntaxNode 353Protected Overrides Function IsAddMethodContext(node As SyntaxNode, semanticModel As SemanticModel) As Boolean
ChangeSignature\ChangeSignatureFormattingRule.vb (2)
13Public Overrides Sub AddIndentBlockOperationsSlow(list As List(Of IndentBlockOperation), node As SyntaxNode, ByRef nextOperation As NextIndentBlockOperationAction) 22Private Shared Sub AddChangeSignatureIndentOperation(list As List(Of IndentBlockOperation), node As SyntaxNode)
ChangeSignature\VisualBasicChangeSignatureService.vb (29)
152Private Shared Function TryGetSelectedIndexFromDeclaration(position As Integer, matchingNode As SyntaxNode) As Integer 157Private Shared Function GetMatchingNode(node As SyntaxNode, restrictToDeclarations As Boolean) As SyntaxNode 176Private Shared Function IsInSymbolHeader(matchingNode As SyntaxNode, position As Integer) As Boolean 204matchingNode As SyntaxNode, 228Public Overrides Function FindNodeToUpdate(document As Document, node As SyntaxNode) As SyntaxNode 243Private Shared Function GetNodeContainingTargetNode(originalNode As SyntaxNode, matchingNode As SyntaxNode) As SyntaxNode 262Private Shared Function GetUpdatableNode(matchingNode As SyntaxNode) As SyntaxNode 277potentiallyUpdatedNode As SyntaxNode, 278originalNode As SyntaxNode, 280cancellationToken As CancellationToken) As Task(Of SyntaxNode) 521Private Shared Function IsParamsArrayExpanded(semanticModel As SemanticModel, node As SyntaxNode, symbolInfo As SymbolInfo, cancellationToken As CancellationToken) As Boolean 579Private Function UpdateDeclaration(Of T As SyntaxNode)( 632Private Function VerifyAndPermuteParamNodes(paramNodes As ImmutableArray(Of XmlElementSyntax), declarationSymbol As ISymbol, updatedSignature As SignatureChange) As ImmutableArray(Of SyntaxNode) 640Return ImmutableArray(Of SyntaxNode).Empty 644Return ImmutableArray(Of SyntaxNode).Empty 652Return ImmutableArray(Of SyntaxNode).Empty 657Return ImmutableArray(Of SyntaxNode).Empty 665Dim permutedParams = ArrayBuilder(Of SyntaxNode).GetInstance() 744Protected Overrides Function TransferLeadingWhitespaceTrivia(Of T As SyntaxNode)(newArgument As T, oldArgument As SyntaxNode) As T 760Protected Overrides Function CreateExplicitParamsArrayFromIndividualArguments(Of TArgumentSyntax As SyntaxNode)(newArguments As SeparatedSyntaxList(Of TArgumentSyntax), indexInExistingList As Integer, parameterSymbol As IParameterSymbol) As TArgumentSyntax 766Protected Overrides Function AddNameToArgument(Of TArgumentSyntax As SyntaxNode)(newArgument As TArgumentSyntax, name As String) As TArgumentSyntax 769Return CType(CType(simpleArgument.WithNameColonEquals(NameColonEquals(IdentifierName(name))), SyntaxNode), TArgumentSyntax) 774Return CType(CType(omittedArgument, SyntaxNode), TArgumentSyntax)
CodeFixes\CorrectNextControlVariable\CorrectNextControlVariableCodeFixProvider.CodeAction.vb (4)
14Private ReadOnly _newNode As SyntaxNode 15Private ReadOnly _node As SyntaxNode 17Public Sub New(document As Document, node As SyntaxNode, newNode As SyntaxNode)
CodeFixes\CorrectNextControlVariable\CorrectNextControlVariableCodeFixProvider.vb (2)
78Dim currentNode As SyntaxNode = nextStatement 91Dim controlVariable As SyntaxNode
CodeFixes\GenerateEndConstruct\GenerateEndConstructCodeFixProvider.vb (13)
72Dim beginStatement = token.GetAncestors(Of SyntaxNode) _ 114Private Shared Function IsCandidate(node As SyntaxNode) As Boolean 127Private Shared Function GetBeginStatement(node As SyntaxNode) As SyntaxNode 142(Function(n As TryBlockSyntax) DirectCast(n, SyntaxNode)), 147Private Shared Function GetEndStatement(node As SyntaxNode) As SyntaxNode 149(Function(n As MultiLineIfBlockSyntax) DirectCast(n.EndIfStatement, SyntaxNode)), 188updatedProperty = DirectCast(gen.WithGetAccessorStatements(updatedProperty, Array.Empty(Of SyntaxNode)()), PropertyBlockSyntax) 192updatedProperty = DirectCast(gen.WithSetAccessorStatements(updatedProperty, Array.Empty(Of SyntaxNode)()), PropertyBlockSyntax) 199Public Shared Function GetDescription(node As SyntaxNode) As String 213Private Shared Async Function GenerateEndConstructAsync(document As Document, endStatement As SyntaxNode, cancellationToken As CancellationToken) As Task(Of Document) 231Private Shared Async Function InsertEndConstructAsync(document As Document, endStatement As SyntaxNode, cancellationToken As CancellationToken) As Task(Of Document)
CodeFixes\GenerateEvent\GenerateEventCodeFixProvider.vb (2)
53For Each node In token.GetAncestors(Of SyntaxNode).Where(Function(c) c.Span.IntersectsWith(context.Span) AndAlso IsCandidate(c)) 237Private Shared Function IsCandidate(node As SyntaxNode) As Boolean
CodeFixes\GenerateType\GenerateTypeCodeFixProvider.vb (4)
43Protected Overrides Function GetCodeActionsAsync(document As Document, node As SyntaxNode, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of CodeAction)) 48Protected Overrides Function IsCandidate(node As SyntaxNode, token As SyntaxToken, diagnostic As Diagnostic) As Boolean 67Protected Overrides Function GetTargetNode(node As SyntaxNode) As SyntaxNode
CodeFixes\IncorrectExitContinue\IncorrectExitContinueCodeFixProvider.AddKeywordCodeAction.vb (8)
15Private ReadOnly _node As SyntaxNode 16Private ReadOnly _containingBlock As SyntaxNode 18Private ReadOnly _updateNode As Func(Of SyntaxNode, SyntaxNode, SyntaxKind, Document, CancellationToken, StatementSyntax) 21Public Sub New(node As SyntaxNode, 23containingBlock As SyntaxNode, 25updateNode As Func(Of SyntaxNode, SyntaxNode, SyntaxKind, Document, CancellationToken, StatementSyntax))
CodeFixes\IncorrectExitContinue\IncorrectExitContinueCodeFixProvider.ReplaceKeywordCodeAction.vb (8)
16Private ReadOnly _node As SyntaxNode 18Private ReadOnly _updateNode As Func(Of SyntaxNode, SyntaxNode, SyntaxKind, Document, CancellationToken, StatementSyntax) 19Private ReadOnly _containingBlock As SyntaxNode 22Public Sub New(createBlockKind As SyntaxKind, invalidToken As SyntaxToken, syntax As SyntaxNode, containingBlock As SyntaxNode, document As Document, 23updateNode As Func(Of SyntaxNode, SyntaxNode, SyntaxKind, Document, CancellationToken, StatementSyntax))
CodeFixes\IncorrectExitContinue\IncorrectExitContinueCodeFixProvider.vb (20)
69Dim node = token.GetAncestors(Of SyntaxNode) _ 94Private Sub CreateContinueCodeActions(document As SemanticDocument, node As SyntaxNode, enclosingblocks As IEnumerable(Of SyntaxNode), ByRef codeActions As List(Of CodeAction), cancellationToken As CancellationToken) 126Private Sub CreateExitCodeActions(document As SemanticDocument, node As SyntaxNode, enclosingblocks As IEnumerable(Of SyntaxNode), ByRef codeActions As List(Of CodeAction), cancellationToken As CancellationToken) 158Private Shared Function GetEnclosingBlockKinds(enclosingblocks As IEnumerable(Of SyntaxNode), enclosingDeclaration As ISymbol) As IEnumerable(Of SyntaxKind) 179Private Shared Function GetEnclosingContinuableBlockKinds(enclosingblocks As IEnumerable(Of SyntaxNode)) As IEnumerable(Of SyntaxKind) 191Private Function CreateExitStatement(exitSyntax As SyntaxNode, containingBlock As SyntaxNode, 210Private Function CreateContinueStatement(continueSyntax As SyntaxNode, containingBlock As SyntaxNode, 305Private Shared Sub CreateAddKeywordActions(node As SyntaxNode, 307enclosingBlock As SyntaxNode, 309updateNode As Func(Of SyntaxNode, SyntaxNode, SyntaxKind, Document, CancellationToken, StatementSyntax), 316node As SyntaxNode, 317enclosingBlock As SyntaxNode, 319updateNode As Func(Of SyntaxNode, SyntaxNode, SyntaxKind, Document, CancellationToken, StatementSyntax), 329Private Shared Function CreateDeleteString(node As SyntaxNode) As String
CodeFixes\IncorrectFunctionReturnType\IncorrectFunctionReturnTypeCodeFixProvider.vb (3)
73Private Shared Function GetNodeToFix(Of T As SyntaxNode)(token As SyntaxToken, span As TextSpan) As T 78Private Shared Async Function GetCodeActionsAsync(document As Document, node As SyntaxNode, rewrittenNode As SyntaxNode, cancellationToken As CancellationToken) As Task(Of IEnumerable(Of CodeAction))
CodeFixes\MoveToTopOfFile\MoveToTopOfFileCodeFixProvider.vb (2)
93Private Shared Function DeclarationsExistAfterImports(node As SyntaxNode, root As CompilationUnitSyntax) As Boolean 161Private Shared Function FindLastContiguousStatement(nodes As IEnumerable(Of SyntaxNode), trivia As IEnumerable(Of SyntaxTrivia)) As Integer
CodeFixes\OverloadBase\OverloadBaseCodeFixProvider.AddKeywordAction.vb (5)
20Private ReadOnly _node As SyntaxNode 36Public Sub New(document As Document, node As SyntaxNode, title As String, modifier As SyntaxKind) 53Private Async Function GetNewNodeAsync(document As Document, node As SyntaxNode, options As SyntaxFormattingOptions, cancellationToken As CancellationToken) As Task(Of SyntaxNode) 54Dim newNode As SyntaxNode = Nothing
CodeFixes\Suppression\VisualBasicSuppressionCodeFixProvider.vb (13)
28Protected Overrides Function CreatePragmaRestoreDirectiveTrivia(diagnostic As Diagnostic, formatNode As Func(Of SyntaxNode, CancellationToken, SyntaxNode), needsLeadingEndOfLine As Boolean, needsTrailingEndOfLine As Boolean, cancellationToken As CancellationToken) As SyntaxTriviaList 35Protected Overrides Function CreatePragmaDisableDirectiveTrivia(diagnostic As Diagnostic, formatNode As Func(Of SyntaxNode, CancellationToken, SyntaxNode), needsLeadingEndOfLine As Boolean, needsTrailingEndOfLine As Boolean, cancellationToken As CancellationToken) As SyntaxTriviaList 55formatNode As Func(Of SyntaxNode, CancellationToken, SyntaxNode), 82Protected Overrides Function GetContainingStatement(token As SyntaxToken) As SyntaxNode 102Protected Overrides Function IsAttributeListWithAssemblyAttributes(node As SyntaxNode) As Boolean 117newRoot As SyntaxNode, 124cancellationToken As CancellationToken) As SyntaxNode 152targetNode As SyntaxNode, 155diagnostic As Diagnostic) As SyntaxNode 209Protected Overrides Function IsSingleAttributeInAttributeList(attribute As SyntaxNode) As Boolean
CodeLens\VisualBasicDisplayInfoService.vb (5)
37Public Function GetDisplayNode(node As SyntaxNode) As SyntaxNode Implements ICodeLensDisplayInfoService.GetDisplayNode 70Private Shared Function FormatPropertyAccessor(node As SyntaxNode, symbolName As String) As String 83Private Shared Function FormatEventHandler(node As SyntaxNode, symbolName As String) As String 119Public Function GetDisplayName(semanticModel As SemanticModel, node As SyntaxNode) As String Implements ICodeLensDisplayInfoService.GetDisplayName
CodeRefactorings\AddAwait\VisualBasicAddAwaitCodeRefactoringProvider.vb (1)
29Protected Overrides Function IsInAsyncContext(node As SyntaxNode) As Boolean
CodeRefactorings\InlineMethod\VisualBasicInlineMethodRefactoringProvider.vb (3)
49Protected Overrides Function GenerateTypeSyntax(symbol As ITypeSymbol, allowVar As Boolean) As SyntaxNode 57Protected Overrides Function IsFieldDeclarationSyntax(node As SyntaxNode) As Boolean 65Protected Overrides Function CanBeReplacedByThrowExpression(syntaxNode As SyntaxNode) As Boolean
CodeRefactorings\InlineTemporary\VisualBasicInlineTemporaryCodeRefactoringProvider.ReferenceRewriter.vb (4)
47Public Overrides Function VisitIdentifierName(node As IdentifierNameSyntax) As SyntaxNode 67Public Overrides Function VisitNameColonEquals(node As NameColonEqualsSyntax) As SyntaxNode 81scope As SyntaxNode, 85) As SyntaxNode
CodeRefactorings\InlineTemporary\VisualBasicInlineTemporaryCodeRefactoringProvider.vb (11)
240Private Shared Iterator Function FindReferenceAnnotatedNodes(root As SyntaxNode) As IEnumerable(Of IdentifierNameSyntax) 250Private Shared Function GetScope(modifiedIdentifier As ModifiedIdentifierSyntax) As SyntaxNode 272Private Shared Function RemoveDefinition(modifiedIdentifier As ModifiedIdentifierSyntax, newBlock As SyntaxNode) As SyntaxNode 436Dim replacementNodesWithChangedSemantics As Dictionary(Of SyntaxNode, SyntaxNode) = Nothing 451replacementNodesWithChangedSemantics = New Dictionary(Of SyntaxNode, SyntaxNode) 464Dim conflictAnnotationAdder = Function(oldNode As SyntaxNode, newNode As SyntaxNode) As SyntaxNode
CodeRefactorings\MoveStaticMembers\VisualBasicMoveStaticMembersRefactoringProvider.vb (1)
22Protected Overrides Async Function GetSelectedNodesAsync(context As CodeRefactoringContext) As Task(Of ImmutableArray(Of SyntaxNode))
CodeRefactorings\NodeSelectionHelpers.vb (6)
14Friend Async Function GetSelectedMemberDeclarationAsync(context As CodeRefactoringContext) As Task(Of ImmutableArray(Of SyntaxNode)) 22Return ImmutableArray.Create(Of SyntaxNode)(methodMember) 31Return ImmutableArray(Of SyntaxNode).Empty 33Return ImmutableArray.Create(Of SyntaxNode)(modifiedIdentifier) 37Return fieldDeclaration.Declarators.SelectMany(Function(vds) vds.Names).Cast(Of SyntaxNode).AsImmutable() 48Return ImmutableArray(Of SyntaxNode).Empty
CodeRefactorings\RemoveStatementCodeAction.vb (2)
14Private ReadOnly _node As SyntaxNode 17Public Sub New(document As Document, node As SyntaxNode, title As String)
CodeRefactorings\SyncNamespace\VisualBasicChangeNamespaceService.vb (9)
24Public Overrides Function TryGetReplacementReferenceSyntax(reference As SyntaxNode, newNamespaceParts As ImmutableArray(Of String), syntaxFacts As ISyntaxFactsService, ByRef old As SyntaxNode, ByRef [new] As SyntaxNode) As Boolean 60Protected Overrides Function GetValidContainersFromAllLinkedDocumentsAsync(document As Document, container As SyntaxNode, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of (DocumentId, SyntaxNode))) 61Return SpecializedTasks.Default(Of ImmutableArray(Of (DocumentId, SyntaxNode)))() 70Protected Overrides Function GetMemberDeclarationsInContainer(container As SyntaxNode) As SyntaxList(Of StatementSyntax) 75Protected Overrides Function TryGetApplicableContainerFromSpanAsync(document As Document, span As TextSpan, cancellationToken As CancellationToken) As Task(Of SyntaxNode) 80Protected Overrides Function GetDeclaredNamespace(container As SyntaxNode) As String
Completion\CompletionProviders\AwaitCompletionProvider.vb (4)
34Protected Overrides Function GetSpanStart(declaration As SyntaxNode) As Integer 49Protected Overrides Function GetAsyncSupportingDeclaration(targetToken As SyntaxToken, position As Integer) As SyntaxNode 53Protected Overrides Function GetTypeSymbolOfExpression(semanticModel As SemanticModel, potentialAwaitableExpression As SyntaxNode, cancellationToken As CancellationToken) As ITypeSymbol 63Protected Overrides Function GetExpressionToPlaceAwaitInFrontOf(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As SyntaxNode
Completion\CompletionProviders\CrefCompletionProvider.vb (2)
37Private _testSpeculativeNodeCallbackOpt As Action(Of SyntaxNode) 288Public Sub SetSpeculativeNodeCallback(value As Action(Of SyntaxNode))
Completion\CompletionProviders\ImplementsClauseCompletionProvider.vb (3)
191Private Function GetInterfacesAndContainers(position As Integer, node As SyntaxNode, semanticModel As SemanticModel, kind As SyntaxKind, cancellationToken As CancellationToken) As ImmutableArray(Of ISymbol) 228Private Shared Sub AddAliasesAndContainers(symbol As ISymbol, interfacesAndContainers As ICollection(Of ISymbol), node As SyntaxNode, semanticModel As SemanticModel) 246Private Shared Sub AddAlias(symbol As ISymbol, interfacesAndContainers As ICollection(Of ISymbol), node As SyntaxNode, semanticModel As SemanticModel)
Completion\CompletionProviders\ImportCompletionProvider\ExtensionMethodImportCompletionProvider.vb (1)
44Protected Overrides Function IsFinalSemicolonOfUsingOrExtern(directive As SyntaxNode, token As SyntaxToken) As Boolean
Completion\CompletionProviders\ImportCompletionProvider\TypeImportCompletionProvider.vb (1)
39Protected Overrides Function IsFinalSemicolonOfUsingOrExtern(directive As SyntaxNode, token As SyntaxToken) As Boolean
Completion\CompletionProviders\InternalsVisibleToCompletionProvider.vb (7)
32Protected Overrides Function GetAssemblyScopedAttributeSyntaxNodesOfDocument(documentRoot As SyntaxNode) As IImmutableList(Of SyntaxNode) 33Dim builder As ImmutableList(Of SyntaxNode).Builder = Nothing 38builder = If(builder, ImmutableList.CreateBuilder(Of SyntaxNode)()) 44Return If(builder Is Nothing, ImmutableList(Of SyntaxNode).Empty, builder.ToImmutable()) 47Protected Overrides Function GetConstructorArgumentOfInternalsVisibleToAttribute(internalsVisibleToAttribute As SyntaxNode) As SyntaxNode
Completion\CompletionProviders\NamedParameterCompletionProvider.vb (2)
132invocableNode As SyntaxNode, 197Private Shared Sub GetInvocableNode(token As SyntaxToken, ByRef invocableNode As SyntaxNode, ByRef argumentList As ArgumentListSyntax)
Completion\CompletionProviders\ObjectCreationCompletionProvider.vb (2)
40Protected Overrides Function GetObjectCreationNewExpression(tree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As SyntaxNode 41Dim newExpression As SyntaxNode = Nothing
Completion\CompletionProviders\OverrideCompletionProvider.vb (3)
39Protected Overrides Function GetSyntax(commonSyntaxToken As SyntaxToken) As SyntaxNode 200Protected Overrides Function GetTargetCaretPosition(caretTarget As SyntaxNode) As Integer 201Dim node = DirectCast(caretTarget, SyntaxNode)
Completion\CompletionProviders\PartialTypeCompletionProvider.vb (1)
57Protected Overrides Function GetPartialTypeSyntaxNode(tree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As SyntaxNode
Completion\CompletionProviders\XmlDocCommentCompletionProvider.vb (2)
185Private Sub AddXmlElementItems(items As List(Of CompletionItem), xmlElement As SyntaxNode) 221Private Shared Function GetStartTagName(element As SyntaxNode) As String
Completion\KeywordRecommenders\Declarations\EndBlockKeywordRecommender.vb (2)
97Private Shared Function GetUnclosedBlockKeywords(node As SyntaxNode) As IEnumerable(Of SyntaxKind) 100Return From ancestor In node.GetAncestorsOrThis(Of SyntaxNode)()
Completion\KeywordRecommenders\Declarations\GetSetKeywordRecommender.vb (1)
36Dim accessorBlock = previousToken.GetAncestors(Of SyntaxNode)().FirstOrDefault(Function(ancestor) ancestor.IsKind(SyntaxKind.GetAccessorBlock, SyntaxKind.SetAccessorBlock))
Completion\KeywordRecommenders\Declarations\InKeywordRecommender.vb (1)
53Private Shared Function IsAfterCompleteAsClause(Of T As {SyntaxNode})(
Completion\KeywordRecommenders\PreprocessorDirectives\PreprocessorHelpers.vb (1)
33Public Overrides Sub DefaultVisit(node As SyntaxNode)
Completion\KeywordRecommenders\RecommendationHelpers.vb (6)
14Friend Function IsOnErrorStatement(node As SyntaxNode) As Boolean 22Friend Function GetParentOrNull(node As SyntaxNode) As SyntaxNode 122Friend Function IsFromIdentifierNode(token As SyntaxToken, node As SyntaxNode) As Boolean 141Friend Function IsFromIdentifierNode(Of TParent As SyntaxNode)(token As SyntaxToken, identifierNodeSelector As Func(Of TParent, SyntaxNode)) As Boolean
ConvertAutoPropertyToFullProperty\VisualBasicConvertAutoPropertyToFullProperty.vb (13)
40propertyNode As SyntaxNode, 43cancellationToken As CancellationToken) As (newGetAccessor As SyntaxNode, newSetAccessor As SyntaxNode) 47Dim getAccessor As SyntaxNode = SyntaxFactory.GetAccessorBlock( 53Dim setAccessor As SyntaxNode 79Protected Overrides Function GetPropertyWithoutInitializer(propertyNode As SyntaxNode) As SyntaxNode 83Protected Overrides Function GetInitializerValue(propertyNode As SyntaxNode) As SyntaxNode 87Protected Overrides Function ConvertPropertyToExpressionBodyIfDesired(info As VisualBasicCodeGenerationContextInfo, propertyNode As SyntaxNode) As SyntaxNode 91Protected Overrides Function GetTypeBlock(syntaxNode As SyntaxNode) As SyntaxNode
ConvertForEachToFor\VisualBasicConvertForEachToForCodeRefactoringProvider.vb (7)
37Protected Overrides Function GetForEachBody(foreachBlock As ForEachBlockSyntax) As (start As SyntaxNode, [end] As SyntaxNode) 122collectionVariableName As SyntaxNode, indexVariable As SyntaxToken) As SyntaxList(Of StatementSyntax) 126Dim foreachVariable As SyntaxNode = Nothing 127Dim type As SyntaxNode = Nothing 153forEachStatement As ForEachStatementSyntax, ByRef foreachVariable As SyntaxNode, ByRef type As SyntaxNode)
ConvertForToForEach\VisualBasicConvertForToForEachCodeRefactoringProvider.vb (1)
81foreachIdentifier As SyntaxToken, collectionExpression As ExpressionSyntax, iterationVariableType As ITypeSymbol) As SyntaxNode
ConvertIfToSwitch\VisualBasicConvertIfToSwitchCodeRefactoringProvider.Analyzer.vb (1)
34Public Overrides Function CanImplicitlyConvert(semanticModel As SemanticModel, syntax As SyntaxNode, targetType As ITypeSymbol) As Boolean
ConvertIfToSwitch\VisualBasicConvertIfToSwitchCodeRefactoringProvider.Rewriting.vb (7)
22Public Overrides Function CreateSwitchExpressionStatement(target As SyntaxNode, sections As ImmutableArray(Of AnalyzedSwitchSection), feature As Feature) As SyntaxNode 26Public Overrides Function CreateSwitchStatement(ifStatement As ExecutableStatementSyntax, expression As SyntaxNode, sectionList As IEnumerable(Of SyntaxNode)) As SyntaxNode 30Public Overrides Function AsSwitchSectionStatements(operation As IOperation) As IEnumerable(Of SyntaxNode) 35Public Overrides Function AsSwitchLabelSyntax(label As AnalyzedSwitchLabel, feature As Feature) As SyntaxNode
ConvertIfToSwitch\VisualBasicConvertIfToSwitchCodeRefactoringProvider.vb (3)
15Inherits AbstractConvertIfToSwitchCodeRefactoringProvider(Of ExecutableStatementSyntax, ExpressionSyntax, SyntaxNode, SyntaxNode) 31Protected Overrides Function GetLeadingTriviaToTransfer(syntaxToRemove As SyntaxNode) As SyntaxTriviaList
Diagnostics\Analyzers\TypeSyntaxSimplifierWalker.vb (1)
189Private Function TrySimplify(node As SyntaxNode) As Boolean
Diagnostics\Analyzers\VisualBasicSimplifyTypeNamesDiagnosticAnalyzer.vb (6)
29Protected Overrides Function IsIgnoredCodeBlock(codeBlock As SyntaxNode) As Boolean 38Protected Overrides Function AnalyzeCodeBlock(context As CodeBlockAnalysisContext, root As SyntaxNode) As ImmutableArray(Of Diagnostic) 54Protected Overrides Function AnalyzeSemanticModel(context As SemanticModelAnalysisContext, root As SyntaxNode, codeBlockIntervalTree As TextSpanMutableIntervalTree) As ImmutableArray(Of Diagnostic) 66Private Shared Function IsNodeKindInteresting(node As SyntaxNode) As Boolean 70Friend Overrides Function IsCandidate(node As SyntaxNode) As Boolean 75model As SemanticModel, node As SyntaxNode, options As VisualBasicSimplifierOptions,
Diagnostics\Analyzers\VisualBasicUnboundIdentifiersDiagnosticAnalyzer.vb (1)
27Protected Overrides Function IsNameOf(node As SyntaxNode) As Boolean
EditAndContinue\BreakpointSpans.vb (7)
58Public Function TryGetClosestBreakpointSpan(root As SyntaxNode, position As Integer, minLength As Integer, <Out> ByRef span As TextSpan) As Boolean 91Private Function CreateSpan(node As SyntaxNode) As TextSpan 95Private Function TryCreateSpan(Of TNode As SyntaxNode)(list As SeparatedSyntaxList(Of TNode)) As TextSpan? 103Private Function TryCreateSpanForNode(node As SyntaxNode, position As Integer) As TextSpan? 294Private Function FindClosestNode(Of TListNode As SyntaxNode, TResult As SyntaxNode)(nodes As SeparatedSyntaxList(Of TListNode), position As Integer, predicate As Func(Of TListNode, TResult)) As TResult 324Private Function GetItemIndexByPosition(Of TNode As SyntaxNode)(list As SeparatedSyntaxList(Of TNode), position As Integer) As Integer
EditAndContinue\DeclarationBody\FieldOrPropertyDeclarationBody.vb (11)
37Public MustOverride ReadOnly Property InitializerActiveStatement As SyntaxNode 43Public MustOverride ReadOnly Property OtherActiveStatementContainer As SyntaxNode 51Public NotOverridable Overrides ReadOnly Property RootNodes As OneOrMany(Of SyntaxNode) 57Public NotOverridable Overrides Function ComputeSingleRootMatch(newBody As DeclarationBody, knownMatches As IEnumerable(Of KeyValuePair(Of SyntaxNode, SyntaxNode))) As Match(Of SyntaxNode) 81span As TextSpan, partnerDeclarationBody As MemberBody, ByRef partnerStatement As SyntaxNode, ByRef statementPart As Integer) As SyntaxNode 104Public Overrides Function TryMatchActiveStatement(newBody As DeclarationBody, oldStatement As SyntaxNode, ByRef statementPart As Integer, <NotNullWhen(True)> ByRef newStatement As SyntaxNode) As Boolean 114Public Overrides ReadOnly Property EncompassingAncestor As SyntaxNode
EditAndContinue\DeclarationBody\FieldWithInitializerDeclarationBody.vb (2)
30Public Overrides ReadOnly Property InitializerActiveStatement As SyntaxNode 36Public Overrides ReadOnly Property OtherActiveStatementContainer As SyntaxNode
EditAndContinue\DeclarationBody\FieldWithMultipleArrayBoundsDeclarationBody.vb (2)
23Public Overrides ReadOnly Property InitializerActiveStatement As SyntaxNode 29Public Overrides ReadOnly Property OtherActiveStatementContainer As SyntaxNode
EditAndContinue\DeclarationBody\FieldWithMultipleAsNewClauseDeclarationBody.vb (3)
23Public Overrides ReadOnly Property InitializerActiveStatement As SyntaxNode 29Public Overrides ReadOnly Property OtherActiveStatementContainer As SyntaxNode 46Public Overrides ReadOnly Property EncompassingAncestor As SyntaxNode
EditAndContinue\DeclarationBody\FieldWithSingleArrayBoundsDeclarationBody.vb (2)
28Public Overrides ReadOnly Property InitializerActiveStatement As SyntaxNode 34Public Overrides ReadOnly Property OtherActiveStatementContainer As SyntaxNode
EditAndContinue\DeclarationBody\FieldWithSingleAsNewClauseDeclarationBody.vb (2)
21Public Overrides ReadOnly Property InitializerActiveStatement As SyntaxNode 27Public Overrides ReadOnly Property OtherActiveStatementContainer As SyntaxNode
EditAndContinue\DeclarationBody\MethodBody.vb (7)
34Public Overrides Function ComputeSingleRootMatch(newBody As DeclarationBody, knownMatches As IEnumerable(Of KeyValuePair(Of SyntaxNode, SyntaxNode))) As Match(Of SyntaxNode) 38Public Overrides Function FindStatementAndPartner(span As TextSpan, partnerDeclarationBody As MemberBody, <Out> ByRef partnerStatement As SyntaxNode, <Out> ByRef statementPart As Integer) As SyntaxNode 47Public Overrides Function TryMatchActiveStatement(newBody As DeclarationBody, oldStatement As SyntaxNode, ByRef statementPart As Integer, <NotNullWhen(True)> ByRef newStatement As SyntaxNode) As Boolean
EditAndContinue\DeclarationBody\PropertyWithInitializerDeclarationBody.vb (2)
23Public Overrides ReadOnly Property InitializerActiveStatement As SyntaxNode 29Public Overrides ReadOnly Property OtherActiveStatementContainer As SyntaxNode
EditAndContinue\DeclarationBody\PropertyWithNewClauseDeclarationBody.vb (2)
23Public Overrides ReadOnly Property InitializerActiveStatement As SyntaxNode 29Public Overrides ReadOnly Property OtherActiveStatementContainer As SyntaxNode
EditAndContinue\DeclarationBody\VisualBasicLambdaBody.vb (12)
15Private ReadOnly _node As SyntaxNode 17Public Sub New(node As SyntaxNode) 28Public Overrides ReadOnly Property RootNodes As OneOrMany(Of SyntaxNode) 34Public Overrides ReadOnly Property EncompassingAncestor As SyntaxNode 48Public Overrides Function TryGetPartnerLambdaBody(newLambda As SyntaxNode) As LambdaBody 52Public Overrides Function GetExpressionsAndStatements() As IEnumerable(Of SyntaxNode) 56Public Overrides Function GetLambda() As SyntaxNode 64Public Overrides Function ComputeSingleRootMatch(newBody As DeclarationBody, knownMatches As IEnumerable(Of KeyValuePair(Of SyntaxNode, SyntaxNode))) As Match(Of SyntaxNode) 78Public Overrides Function TryMatchActiveStatement(newBody As DeclarationBody, oldStatement As SyntaxNode, ByRef statementPart As Integer, <NotNullWhen(True)> ByRef newStatement As SyntaxNode) As Boolean
EditAndContinue\SyntaxComparer.vb (45)
20Public Sub New(oldRoot As SyntaxNode, newRoot As SyntaxNode, oldRootChildren As IEnumerable(Of SyntaxNode), newRootChildren As IEnumerable(Of SyntaxNode), Optional matchingLambdas As Boolean = False, Optional compareStatementSyntax As Boolean = False) 26Protected Overrides Function IsLambdaBodyStatementOrExpression(node As SyntaxNode) As Boolean 307Friend Overrides Function Classify(kind As Integer, node As SyntaxNode, ByRef isLeaf As Boolean) As Integer 312Friend Overloads Function Classify(kind As SyntaxKind, nodeOpt As SyntaxNode, ByRef isLeaf As Boolean, ignoreVariableDeclarations As Boolean) As Label 320Friend Shared Function ClassifyStatementSyntax(kind As SyntaxKind, nodeOpt As SyntaxNode, ByRef isLeaf As Boolean) As Label 726Private Shared Function ClassifyTopSyntax(kind As SyntaxKind, nodeOpt As SyntaxNode, ByRef isLeaf As Boolean, ignoreVariableDeclarations As Boolean) As Label 870Protected Overrides Function GetLabel(node As SyntaxNode) As Integer 878Friend Function GetLabelImpl(node As SyntaxNode) As Label 903Public Overrides Function ValuesEqual(left As SyntaxNode, right As SyntaxNode) As Boolean 939Protected Overrides Function TryComputeWeightedDistance(leftNode As SyntaxNode, rightNode As SyntaxNode, ByRef distance As Double) As Boolean 948Dim getParts = Function(node As SyntaxNode) 1032Dim ifParts = Function(node As SyntaxNode) 1056Dim elseStatements = Function(node As SyntaxNode) 1080Dim getParts = Function(node As SyntaxNode) 1138Private Shared Function ComputeWeightedDistance(leftHeader As SyntaxNode, 1140rightHeader As SyntaxNode, 1145Private Shared Function ComputeWeightedDistance(leftControlVariable As SyntaxNode, 1146leftHeader As SyntaxNode, 1148rightControlVariable As SyntaxNode, 1149rightHeader As SyntaxNode, 1211Private Shared Function TryGetName(node As SyntaxNode) As SyntaxNodeOrToken? 1294Public Overrides Function GetDistance(oldNode As SyntaxNode, newNode As SyntaxNode) As Double 1313Friend Shared Function ComputeValueDistance(leftNode As SyntaxNode, rightNode As SyntaxNode) As Double 1343Friend Overloads Shared Function ComputeDistance(Of TSyntaxNode As SyntaxNode)(oldList As SyntaxList(Of TSyntaxNode), newList As SyntaxList(Of TSyntaxNode)) As Double 1347Friend Overloads Shared Function ComputeDistance(Of TSyntaxNode As SyntaxNode)(oldList As SeparatedSyntaxList(Of TSyntaxNode), newList As SeparatedSyntaxList(Of TSyntaxNode)) As Double 1354Friend Shared Iterator Function GetDescendantTokensIgnoringSeparators(Of TSyntaxNode As SyntaxNode)(list As SyntaxList(Of TSyntaxNode)) As IEnumerable(Of SyntaxToken) 1365Private Shared Iterator Function GetDescendantTokensIgnoringSeparators(Of TSyntaxNode As SyntaxNode)(list As SeparatedSyntaxList(Of TSyntaxNode)) As IEnumerable(Of SyntaxToken) 1379Public Overloads Shared Function ComputeDistance(oldNode As SyntaxNode, newNode As SyntaxNode) As Double 1419Public Overloads Shared Function ComputeDistance(oldTokens As IEnumerable(Of SyntaxNode), newTokens As IEnumerable(Of SyntaxNode)) As Double 1426Public Shared Function GetSequenceEdits(oldNodes As IEnumerable(Of SyntaxNode), newNodes As IEnumerable(Of SyntaxNode)) As IEnumerable(Of SequenceEdit) 1433Public Shared Function GetSequenceEdits(oldNodes As ImmutableArray(Of SyntaxNode), newNodes As ImmutableArray(Of SyntaxNode)) As IEnumerable(Of SequenceEdit) 1462Inherits LongestCommonImmutableArraySubsequence(Of SyntaxNode) 1466Protected Overrides Function Equals(oldElement As SyntaxNode, newElement As SyntaxNode) As Boolean
EditAndContinue\SyntaxUtilities.vb (13)
11Public Shared Function CreateLambdaBody(node As SyntaxNode) As LambdaBody 15Public Shared Function TryGetDeclarationBody(node As SyntaxNode) As MemberBody 145Public Shared Sub AssertIsBody(syntax As SyntaxNode, allowLambda As Boolean) 190Public Shared Function GetBody(node As LambdaExpressionSyntax) As SyntaxList(Of SyntaxNode) 201Public Shared Function IsParameterlessConstructor(declaration As SyntaxNode) As Boolean 210Public Shared Function HasBackingField(propertyDeclaration As SyntaxNode) As Boolean 216Public Shared Function IsAsyncMethodOrLambda(declarationOrBody As SyntaxNode) As Boolean 220Public Shared Function IsIteratorMethodOrLambda(declaration As SyntaxNode) As Boolean 224Public Shared Function GetAwaitExpressions(body As SyntaxNode) As ImmutableArray(Of SyntaxNode) 230Public Shared Function GetYieldStatements(body As SyntaxNode) As ImmutableArray(Of SyntaxNode) 237Public Shared Function GetModifiers(declarationOrBody As SyntaxNode) As SyntaxTokenList
EditAndContinue\VisualBasicEditAndContinueAnalyzer.vb (155)
37Public Sub New(Optional testFaultInjector As Action(Of SyntaxNode) = Nothing) 43Friend Overrides Function TryFindMemberDeclaration(rootOpt As SyntaxNode, node As SyntaxNode, activeSpan As TextSpan, <Out> ByRef declarations As OneOrMany(Of SyntaxNode)) As Boolean 72declarations = OneOrMany.Create(Of SyntaxNode)(variableDeclarator.Names(0)) 74declarations = OneOrMany.Create(variableDeclarator.Names.SelectAsArray(Function(n) CType(n, SyntaxNode))) 101Friend Overrides Function TryGetDeclarationBody(node As SyntaxNode, symbol As ISymbol) As MemberBody 105Friend Overrides Function IsDeclarationWithSharedBody(declaration As SyntaxNode, member As ISymbol) As Boolean 114Protected Overrides Function GetVariableUseSites(roots As IEnumerable(Of SyntaxNode), localOrParameter As ISymbol, model As SemanticModel, cancellationToken As CancellationToken) As IEnumerable(Of SyntaxNode) 131body As SyntaxNode, 132partnerBody As SyntaxNode, 133<Out> ByRef partnerStatement As SyntaxNode, 134<Out> ByRef statementPart As Integer) As SyntaxNode 143Dim node As SyntaxNode = Nothing 186Friend Overrides Function IsClosureScope(node As SyntaxNode) As Boolean 190Friend Overrides Function GetCapturedParameterScope(methodOrLambda As SyntaxNode) As SyntaxNode 194Protected Overrides Function FindEnclosingLambdaBody(encompassingAncestor As SyntaxNode, node As SyntaxNode) As LambdaBody 196Dim body As SyntaxNode = Nothing 207Protected Overrides Function ComputeTopLevelMatch(oldCompilationUnit As SyntaxNode, newCompilationUnit As SyntaxNode) As Match(Of SyntaxNode) 211Protected Overrides Function ComputeParameterMap(oldDeclaration As SyntaxNode, newDeclaration As SyntaxNode) As BidirectionalMap(Of SyntaxNode)? 222Dim map = BidirectionalMap(Of SyntaxNode).FromMatch(If(primaryMatch, secondaryMatch)) 231Private Shared Function GetTopLevelMatch(oldNode As SyntaxNode, newNode As SyntaxNode) As Match(Of SyntaxNode) 235Private Shared Function GetDeclarationParameterLists(declaration As SyntaxNode) As (Primary As SyntaxNode, Secondary As SyntaxNode) 254Protected Overrides Function IsNamespaceDeclaration(node As SyntaxNode) As Boolean 259Private Shared Function IsTypeDeclaration(node As SyntaxNode) As Boolean 263Protected Overrides Function IsCompilationUnitWithGlobalStatements(node As SyntaxNode) As Boolean 267Protected Overrides Function IsGlobalStatement(node As SyntaxNode) As Boolean 271Protected Overrides Iterator Function GetTopLevelTypeDeclarations(compilationUnit As SyntaxNode) As IEnumerable(Of SyntaxNode) 305Protected Overrides Function GetSyntaxSequenceEdits(oldNodes As ImmutableArray(Of SyntaxNode), newNodes As ImmutableArray(Of SyntaxNode)) As IEnumerable(Of SequenceEdit) 309Friend Overrides ReadOnly Property EmptyCompilationUnit As SyntaxNode 320Protected Overrides Function StatementLabelEquals(node1 As SyntaxNode, node2 As SyntaxNode) As Boolean 324Private Shared Function ChildrenCompiledInBody(node As SyntaxNode) As Boolean 335Protected Overrides Function TryGetActiveSpan(node As SyntaxNode, statementPart As Integer, minLength As Integer, <Out> ByRef span As TextSpan) As Boolean 339Protected Overrides Iterator Function EnumerateNearStatements(statement As SyntaxNode) As IEnumerable(Of ValueTuple(Of SyntaxNode, Integer)) 347Dim lastBlockStatement As SyntaxNode = Nothing 411Private Shared Function GetFieldOrPropertyModifiers(node As SyntaxNode) As SyntaxTokenList? 421Private Shared Function AreEquivalentIgnoringLambdaBodies(left As SyntaxNode, right As SyntaxNode) As Boolean 430Protected Overrides Function AreEquivalentActiveStatements(oldStatement As SyntaxNode, newStatement As SyntaxNode, statementPart As Integer) As Boolean 463Private Shared Function HasMultiInitializer(modifiedIdentifier As SyntaxNode) As Boolean 472Friend Overrides Function IsInterfaceDeclaration(node As SyntaxNode) As Boolean 476Friend Overrides Function IsRecordDeclaration(node As SyntaxNode) As Boolean 481Friend Overrides Function TryGetContainingTypeDeclaration(node As SyntaxNode) As SyntaxNode 485Friend Overrides Function IsDeclarationWithInitializer(declaration As SyntaxNode) As Boolean 510Friend Overrides Function IsPrimaryConstructorDeclaration(declaration As SyntaxNode) As Boolean 532Protected Overrides Function GetSymbolDeclarationSyntax(symbol As ISymbol, selector As Func(Of ImmutableArray(Of SyntaxReference), SyntaxReference), cancellationToken As CancellationToken) As SyntaxNode 637Protected Overrides Function GetDeclaredSymbol(model As SemanticModel, declaration As SyntaxNode, cancellationToken As CancellationToken) As ISymbol 707oldNode As SyntaxNode, 708newNode As SyntaxNode, 748oldNode As SyntaxNode, 750newNode As SyntaxNode, 754topMatch As Match(Of SyntaxNode), 755editMap As IReadOnlyDictionary(Of SyntaxNode, EditKind), 895node As SyntaxNode, 943Private Function GetParameterContainingMemberOrType(node As SyntaxNode, otherNode As SyntaxNode, model As SemanticModel, fromOtherMap As IReadOnlyDictionary(Of SyntaxNode, SyntaxNode), cancellationToken As CancellationToken) As ISymbol 950Dim declaration As SyntaxNode = Nothing 960Private Shared Function GetContainingDeclaration(node As SyntaxNode) As SyntaxNode 964Friend Overrides ReadOnly Property IsLambda As Func(Of SyntaxNode, Boolean) 970Friend Overrides ReadOnly Property IsNotLambda As Func(Of SyntaxNode, Boolean) 976Friend Overrides Function IsNestedFunction(node As SyntaxNode) As Boolean 980Friend Overrides Function IsLocalFunction(node As SyntaxNode) As Boolean 984Friend Overrides Function IsGenericLocalFunction(node As SyntaxNode) As Boolean 988Friend Overrides Function TryGetLambdaBodies(node As SyntaxNode, <Out> ByRef body1 As LambdaBody, <Out> ByRef body2 As LambdaBody) As Boolean 989Dim bodyNode1 As SyntaxNode = Nothing 990Dim bodyNode2 As SyntaxNode = Nothing 1000Friend Overrides Function GetLambdaExpressionSymbol(model As SemanticModel, lambdaExpression As SyntaxNode, cancellationToken As CancellationToken) As IMethodSymbol 1007Friend Overrides Function GetContainingQueryExpression(node As SyntaxNode) As SyntaxNode 1011Friend Overrides Function QueryClauseLambdasTypeEquivalent(oldModel As SemanticModel, oldNode As SyntaxNode, newModel As SemanticModel, newNode As SyntaxNode, cancellationToken As CancellationToken) As Boolean 1069Protected Overrides Function TryGetDiagnosticSpan(node As SyntaxNode, editKind As EditKind) As TextSpan? 1073Protected Overloads Shared Function GetDiagnosticSpan(node As SyntaxNode, editKind As EditKind) As TextSpan 1077Private Shared Function TryGetDiagnosticSpanImpl(node As SyntaxNode, editKind As EditKind) As TextSpan? 1081Protected Overrides Function GetBodyDiagnosticSpan(node As SyntaxNode, editKind As EditKind) As TextSpan 1086Friend Shared Function TryGetDiagnosticSpanImpl(kind As SyntaxKind, node As SyntaxNode, editKind As EditKind) As TextSpan? 1318Private Overloads Shared Function GetDiagnosticSpan(ifKeyword As SyntaxToken, condition As SyntaxNode, thenKeywordOpt As SyntaxToken) As TextSpan 1415Friend Overrides Function GetLambdaParameterDiagnosticSpan(lambda As SyntaxNode, ordinal As Integer) As TextSpan 1458Protected Overrides Function TryGetDisplayName(node As SyntaxNode, editKind As EditKind) As String 1462Protected Overloads Shared Function GetDisplayName(node As SyntaxNode, editKind As EditKind) As String 1472Protected Overrides Function GetBodyDisplayName(node As SyntaxNode, Optional editKind As EditKind = EditKind.Update) As String 1476Private Shared Function TryGetDisplayNameImpl(node As SyntaxNode, editKind As EditKind) As String 1705Private ReadOnly _match As Match(Of SyntaxNode) 1706Private ReadOnly _oldNode As SyntaxNode 1707Private ReadOnly _newNode As SyntaxNode 1713oldNode As SyntaxNode, 1714newNode As SyntaxNode, 1716Optional match As Match(Of SyntaxNode) = Nothing, 1776Private Sub ClassifyMove(newNode As SyntaxNode) 1799Private Sub ClassifyReorder(oldNode As SyntaxNode, newNode As SyntaxNode) 1822Private Sub ClassifyInsert(node As SyntaxNode) 1854Private Sub ClassifyDelete(oldNode As SyntaxNode) 1881Private Sub ClassifyUpdate(newNode As SyntaxNode) 1905match As Match(Of SyntaxNode), 1906edit As Edit(Of SyntaxNode), 1907editMap As Dictionary(Of SyntaxNode, EditKind)) 1938Friend Overrides Function HasUnsupportedOperation(nodes As IEnumerable(Of SyntaxNode), <Out> ByRef unsupportedNode As SyntaxNode, <Out> ByRef rudeEdit As RudeEditKind) As Boolean 1981Friend Overrides Sub ReportInsertedMemberSymbolRudeEdits(diagnostics As ArrayBuilder(Of RudeEditDiagnostic), newSymbol As ISymbol, newNode As SyntaxNode, insertingIntoExistingContainingType As Boolean) 2056Protected Overrides Function GetExceptionHandlingAncestors(node As SyntaxNode, root As SyntaxNode, isNonLeaf As Boolean) As List(Of SyntaxNode) 2057Dim result = New List(Of SyntaxNode)() 2093exceptionHandlingEdits As IEnumerable(Of Edit(Of SyntaxNode)), 2094oldStatement As SyntaxNode, 2105Private Shared Function AreExceptionHandlingPartsEquivalent(oldNode As SyntaxNode, newNode As SyntaxNode) As Boolean 2127Protected Overrides Function GetExceptionHandlingRegion(node As SyntaxNode, <Out> ByRef coversAllChildren As Boolean) As TextSpan 2157Friend Overrides Function IsStateMachineMethod(declaration As SyntaxNode) As Boolean 2162Friend Shared Function GetStateMachineInfo(body As SyntaxNode) As StateMachineInfo 2173Friend Overrides Sub ReportStateMachineSuspensionPointRudeEdits(diagnosticContext As DiagnosticContext, oldNode As SyntaxNode, newNode As SyntaxNode) 2188Private Shared Function FindContainingStatementPart(node As SyntaxNode) As SyntaxNode 2214Private Shared Function HasNoSpilledState(awaitExpression As SyntaxNode, containingStatementPart As SyntaxNode) As Boolean 2259Private Shared Function GetExpressionFromStatementPart(statement As SyntaxNode) As ExpressionSyntax 2272Private Shared Function IsSimpleAwaitAssignment(node As SyntaxNode, awaitExpression As SyntaxNode) As Boolean 2285forwardMap As IReadOnlyDictionary(Of SyntaxNode, SyntaxNode), 2286oldActiveStatement As SyntaxNode, 2289newActiveStatement As SyntaxNode, 2303Private Shared Function FindOnErrorOrResumeStatement(newBody As DeclarationBody) As SyntaxNode 2323forwardMap As IReadOnlyDictionary(Of SyntaxNode, SyntaxNode), 2324oldActiveStatement As SyntaxNode, 2325oldEncompassingAncestor As SyntaxNode, 2327newActiveStatement As SyntaxNode, 2328newEncompassingAncestor As SyntaxNode, 2343getTypedNodes:=Function(n) OneOrMany.Create(Of SyntaxNode)(n.SyncLockStatement.Expression), 2350getTypedNodes:=Function(n) OneOrMany.Create(Of SyntaxNode)(n.WithStatement.Expression), 2357getTypedNodes:=Function(n) OneOrMany.Create(Of SyntaxNode)(n.UsingStatement.Expression), 2364getTypedNodes:=Function(n) OneOrMany.Create(Of SyntaxNode)(n.ForEachStatement.Expression),
EncapsulateField\VisualBasicEncapsulateFieldService.vb (1)
29cancellationToken As CancellationToken) As Task(Of SyntaxNode)
ExtractInterface\VisualBasicExtractInterfaceService.vb (2)
28cancellationToken As CancellationToken) As Task(Of SyntaxNode) 95Friend Overrides Function ShouldIncludeAccessibilityModifier(typeNode As SyntaxNode) As Boolean
ExtractMethod\Extensions.vb (26)
17Public Function GetUnparenthesizedExpression(node As SyntaxNode) As ExpressionSyntax 27Public Function GetStatementContainer(node As SyntaxNode) As SyntaxNode 39Public Function GetStatementUnderContainer(node As SyntaxNode) As ExecutableStatementSyntax 56Public Function ContainStatement(node As SyntaxNode, statement As StatementSyntax) As Boolean 68Public Function GetOutermostNodeWithSameSpan(initialNode As SyntaxNode, predicate As Func(Of SyntaxNode, Boolean)) As SyntaxNode 87Return CType(If(lastNode, initialNode), SyntaxNode) 91Public Function PartOfConstantInitializerExpression(node As SyntaxNode) As Boolean 97Private Function PartOfConstantInitializerExpression(Of T As SyntaxNode)(node As SyntaxNode, modifiersGetter As Func(Of T, SyntaxTokenList)) As Boolean 117Public Function IsArgumentForByRefParameter(node As SyntaxNode, model As SemanticModel, cancellationToken As CancellationToken) As Boolean 225Public Function ContainsFieldInitializer(node As SyntaxNode) As Boolean 232Public Function ContainsDotMemberAccess(node As SyntaxNode) As Boolean 233Dim predicate = Function(n As SyntaxNode) 269Dim predicate As Func(Of SyntaxNode, Boolean) = 295Return token.GetAncestors(Of SyntaxNode)().Any(predicate) 299Public Function ContainedInValidType(node As SyntaxNode) As Boolean 325Public Function UnderValidContext(ByVal node As SyntaxNode) As Boolean 328Dim predicate As Func(Of SyntaxNode, Boolean) = 339If Not node.GetAncestorsOrThis(Of SyntaxNode)().Any(predicate) Then 351Public Function IsReturnableConstruct(node As SyntaxNode) As Boolean 358Public Function HasSyntaxAnnotation([set] As HashSet(Of SyntaxAnnotation), node As SyntaxNode) As Boolean 370Public Function ToSeparatedList(Of T As SyntaxNode)(nodes As IEnumerable(Of Tuple(Of T, SyntaxToken))) As SeparatedSyntaxList(Of T) 463Public Function IsExpressionInCast(node As SyntaxNode) As Boolean
ExtractMethod\VisualBasicMethodExtractor.Analyzer.vb (1)
49Protected Overrides Function ContainsReturnStatementInSelectedCode(jumpOutOfRegionStatements As IEnumerable(Of SyntaxNode)) As Boolean
ExtractMethod\VisualBasicMethodExtractor.TriviaResult.vb (5)
29Protected Overrides Function GetAnnotationResolver(callsite As SyntaxNode, method As SyntaxNode) As AnnotationResolver 38Protected Overrides Function GetTriviaResolver(method As SyntaxNode) As TriviaResolver 48node As SyntaxNode, 51callsite As SyntaxNode,
ExtractMethod\VisualBasicMethodExtractor.vb (4)
33analyzerResult As AnalyzerResult, cancellationToken As CancellationToken) As SyntaxNode 41Dim enclosingTopLevelNode As SyntaxNode = basePosition.GetAncestor(Of PropertyBlockSyntax)() 78Protected Overrides Function ParseTypeName(name As String) As SyntaxNode 129methodDefinition As SyntaxNode,
ExtractMethod\VisualBasicMethodExtractor.VisualBasicCodeGenerator.CallSiteContainerRewriter.vb (31)
14Private ReadOnly _outmostCallSiteContainer As SyntaxNode 22Public Sub New(outmostCallSiteContainer As SyntaxNode, 44Public Function Generate() As SyntaxNode 56Private ReadOnly Property ContainerOfStatementsOrFieldToReplace() As SyntaxNode 62Public Overrides Function VisitLocalDeclarationStatement(node As LocalDeclarationStatementSyntax) As SyntaxNode 98Public Overrides Function VisitMethodBlock(node As MethodBlockSyntax) As SyntaxNode 108Public Overrides Function VisitConstructorBlock(node As ConstructorBlockSyntax) As SyntaxNode 118Public Overrides Function VisitOperatorBlock(node As OperatorBlockSyntax) As SyntaxNode 128Public Overrides Function VisitAccessorBlock(node As AccessorBlockSyntax) As SyntaxNode 138Public Overrides Function VisitWhileBlock(node As WhileBlockSyntax) As SyntaxNode 148Public Overrides Function VisitUsingBlock(node As UsingBlockSyntax) As SyntaxNode 157Public Overrides Function VisitSyncLockBlock(node As SyncLockBlockSyntax) As SyntaxNode 166Public Overrides Function VisitWithBlock(node As WithBlockSyntax) As SyntaxNode 175Public Overrides Function VisitSingleLineIfStatement(node As SingleLineIfStatementSyntax) As SyntaxNode 188Public Overrides Function VisitSingleLineElseClause(node As SingleLineElseClauseSyntax) As SyntaxNode 196Public Overrides Function VisitMultiLineIfBlock(node As MultiLineIfBlockSyntax) As SyntaxNode 205Public Overrides Function VisitElseBlock(node As ElseBlockSyntax) As SyntaxNode 214Public Overrides Function VisitTryBlock(node As TryBlockSyntax) As SyntaxNode 223Public Overrides Function VisitCatchBlock(node As CatchBlockSyntax) As SyntaxNode 232Public Overrides Function VisitFinallyBlock(node As FinallyBlockSyntax) As SyntaxNode 241Public Overrides Function VisitSelectBlock(node As SelectBlockSyntax) As SyntaxNode 251Public Overrides Function VisitCaseBlock(node As CaseBlockSyntax) As SyntaxNode 260Public Overrides Function VisitDoLoopBlock(node As DoLoopBlockSyntax) As SyntaxNode 270Public Overrides Function VisitForBlock(node As ForBlockSyntax) As SyntaxNode 280Public Overrides Function VisitForEachBlock(node As ForEachBlockSyntax) As SyntaxNode 290Public Overrides Function VisitSingleLineLambdaExpression(node As SingleLineLambdaExpressionSyntax) As SyntaxNode 300Public Overrides Function VisitMultiLineLambdaExpression(node As MultiLineLambdaExpressionSyntax) As SyntaxNode 371Public Overrides Function VisitModuleBlock(ByVal node As ModuleBlockSyntax) As SyntaxNode 380Public Overrides Function VisitClassBlock(ByVal node As ClassBlockSyntax) As SyntaxNode 389Public Overrides Function VisitStructureBlock(ByVal node As StructureBlockSyntax) As SyntaxNode 398Public Overrides Function VisitCompilationUnit(node As CompilationUnitSyntax) As SyntaxNode
ExtractMethod\VisualBasicMethodExtractor.VisualBasicCodeGenerator.ExpressionCodeGenerator.vb (1)
39Private Shared Function GetMethodNameBasedOnExpression(methodName As String, expression As SyntaxNode) As String
ExtractMethod\VisualBasicMethodExtractor.VisualBasicCodeGenerator.vb (14)
56Protected Overrides Function ShouldLocalFunctionCaptureParameter(node As SyntaxNode) As Boolean 60Protected Overrides Function GenerateMethodDefinition(insertionPointNode As SyntaxNode, cancellationToken As CancellationToken) As IMethodSymbol 73statements:=statements.CastArray(Of SyntaxNode)) 80insertionPointNode As SyntaxNode, 81container As SyntaxNode, 82cancellationToken As CancellationToken) As Task(Of SyntaxNode) 103insertionPointNode As SyntaxNode, cancellationToken As CancellationToken) As Task(Of IEnumerable(Of StatementSyntax)) 134Protected Overrides Function GetCallSiteContainerFromOutermostMoveInVariable(cancellationToken As CancellationToken) As SyntaxNode 164insertionPointNode As SyntaxNode, cancellationToken As CancellationToken) As OperationStatus(Of ImmutableArray(Of SyntaxNode)) 167Return status.With(statements.CastArray(Of SyntaxNode)) 170Private Function CreateMethodBody(insertionPointNode As SyntaxNode, cancellationToken As CancellationToken) As ImmutableArray(Of StatementSyntax) 282insertionPointNode As SyntaxNode, 308Dim container = lastStatement.GetAncestorsOrThis(Of SyntaxNode).Where(Function(n) n.IsReturnableConstruct()).FirstOrDefault()
ExtractMethod\VisualBasicSelectionResult.vb (5)
91Public Overrides Function GetOutermostCallSiteContainerToProcess(cancellationToken As CancellationToken) As SyntaxNode 134Public Overrides Function GetContainingScope() As SyntaxNode 148Return first.GetAncestors(Of SyntaxNode).FirstOrDefault(Function(n) TypeOf n Is MethodBlockBaseSyntax OrElse TypeOf n Is LambdaExpressionSyntax) 282Public Function InnermostStatementContainer() As SyntaxNode 288.GetAncestorsOrThis(Of SyntaxNode)() _
ExtractMethod\VisualBasicSelectionValidator.Validator.vb (1)
11Public Shared Function Check(semanticModel As SemanticModel, node As SyntaxNode, cancellationToken As CancellationToken) As Boolean
ExtractMethod\VisualBasicSelectionValidator.vb (19)
222Private Shared Function GetFinalTokenCommonRoot(selection As SelectionInfo) As SyntaxNode 226Private Shared Function GetCommonRoot(token1 As SyntaxToken, token2 As SyntaxToken) As SyntaxNode 231root As SyntaxNode, 332Dim firstValidNode = node.GetAncestors(Of SyntaxNode)().FirstOrDefault( 356Private Shared Function AssignInitialFinalTokens(selectionInfo As SelectionInfo, root As SyntaxNode, cancellationToken As CancellationToken) As SelectionInfo 438.GetAncestorsOrThis(Of SyntaxNode)() _ 462Private Function GetInitialSelectionInfo(root As SyntaxNode) As SelectionInfo 553Public Overrides Function ContainsNonReturnExitPointsStatements(jumpsOutOfRegion As IEnumerable(Of SyntaxNode)) As Boolean 574Public Overrides Function GetOuterReturnStatements(commonRoot As SyntaxNode, jumpsOutOfRegionStatements As IEnumerable(Of SyntaxNode)) As IEnumerable(Of SyntaxNode) 577Dim container = commonRoot.GetAncestorsOrThis(Of SyntaxNode)().Where(Function(a) a.IsReturnableConstruct()).FirstOrDefault() 579Return SpecializedCollections.EmptyEnumerable(Of SyntaxNode)() 583Select(Function(r) (r, r.GetAncestors(Of SyntaxNode)().Where(Function(a) a.IsReturnableConstruct()).FirstOrDefault())). 590Public Overrides Function IsFinalSpanSemanticallyValidSpan(root As SyntaxNode, 592returnStatements As IEnumerable(Of SyntaxNode), 600Function(n As SyntaxNode) True) 613Dim container = nextToken.GetAncestors(Of SyntaxNode).Where(Function(n) n.IsReturnableConstruct()).FirstOrDefault() 634Private Shared Function GetAdjustedSpan(root As SyntaxNode, textSpan As TextSpan) As TextSpan
FullyQualify\VisualBasicFullyQualifyService.vb (2)
25Protected Overrides Function CanFullyQualify(node As SyntaxNode, <NotNullWhen(True)> ByRef simpleName As SimpleNameSyntax) As Boolean 61Protected Overrides Async Function ReplaceNodeAsync(simpleName As SimpleNameSyntax, containerName As String, resultingSymbolIsType As Boolean, cancellationToken As CancellationToken) As Task(Of SyntaxNode)
GenerateEqualsAndGetHashCodeFromMembers\VisualBasicGenericEqualsAndGetHashCodeService.vb (2)
20Protected Overrides Function TryWrapWithUnchecked(statements As ImmutableArray(Of SyntaxNode), ByRef wrappedStatements As ImmutableArray(Of SyntaxNode)) As Boolean
GenerateMember\GenerateVariable\VisualBasicGenerateVariableService.vb (2)
33document As SemanticDocument, node As SyntaxNode, cancellationToken As CancellationToken, 120Protected Overrides Function TryConvertToLocalDeclaration(type As ITypeSymbol, identifierToken As SyntaxToken, semanticModel As SemanticModel, cancellationToken As CancellationToken, ByRef newRoot As SyntaxNode) As Boolean
GenerateType\VisualBasicGenerateTypeService.vb (8)
381genericName.TypeArgumentList.Arguments.OfType(Of SyntaxNode)().ToList(), 382Enumerable.Repeat(Of SyntaxNode)(Nothing, state.SimpleName.Arity)) 426Public Overrides Async Function GetOrGenerateEnclosingNamespaceSymbolAsync(namedTypeSymbol As INamedTypeSymbol, containers() As String, selectedDocument As Document, selectedDocumentRoot As SyntaxNode, cancellationToken As CancellationToken) As Task(Of (INamespaceSymbol, INamespaceOrTypeSymbol, Location)) 468Private Shared Function GetDeclaringNamespace(containers As List(Of String), indexDone As Integer, localRoot As SyntaxNode) As NamespaceStatementSyntax 563Dim node As SyntaxNode = expression 595Private Shared Function IsAllContainingTypeBlocksPublic(node As SyntaxNode) As Boolean 620modifiedRoot As SyntaxNode, 631Dim root As SyntaxNode = Nothing
GoToDefinition\VisualBasicGoToDefinitionSymbolService.vb (16)
71Private Shared Function TryGetExitTarget(node As SyntaxNode) As SyntaxNode 94Private Shared Function TryGetContinueTarget(node As SyntaxNode) As SyntaxNode 107Private Shared Function FindContainingSelect(node As SyntaxNode) As SyntaxNode 119Private Shared Function FindContainingWhile(node As SyntaxNode) As SyntaxNode 131Private Shared Function FindContainingFor(node As SyntaxNode) As SyntaxNode 143Private Shared Function FindContainingDoLoop(node As SyntaxNode) As SyntaxNode 155Private Shared Function FindContainingTry(node As SyntaxNode) As SyntaxNode 167Private Shared Function FindContainingReturnableConstruct(node As SyntaxNode) As SyntaxNode
Highlighting\KeywordHighlighters\AccessorDeclarationHighlighter.vb (2)
15Inherits AbstractKeywordHighlighter(Of SyntaxNode) 22Protected Overloads Overrides Sub AddHighlights(node As SyntaxNode, highlights As List(Of TextSpan), cancellationToken As CancellationToken)
Highlighting\KeywordHighlighters\ConstructorDeclarationHighlighter.vb (2)
15Inherits AbstractKeywordHighlighter(Of SyntaxNode) 22Protected Overloads Overrides Sub AddHighlights(node As SyntaxNode, highlights As List(Of TextSpan), cancellationToken As CancellationToken)
Highlighting\KeywordHighlighters\DoLoopBlockHighlighter.vb (2)
15Inherits AbstractKeywordHighlighter(Of SyntaxNode) 22Protected Overloads Overrides Sub AddHighlights(node As SyntaxNode, highlights As List(Of TextSpan), cancellationToken As CancellationToken)
Highlighting\KeywordHighlighters\EnumBlockHighlighter.vb (2)
15Inherits AbstractKeywordHighlighter(Of SyntaxNode) 22Protected Overloads Overrides Sub AddHighlights(node As SyntaxNode, highlights As List(Of TextSpan), cancellationToken As CancellationToken)
Highlighting\KeywordHighlighters\EventBlockHighlighter.vb (2)
15Inherits AbstractKeywordHighlighter(Of SyntaxNode) 22Protected Overloads Overrides Sub AddHighlights(node As SyntaxNode, highlights As List(Of TextSpan), cancellationToken As CancellationToken)
Highlighting\KeywordHighlighters\ForLoopBlockHighlighter.vb (3)
15Inherits AbstractKeywordHighlighter(Of SyntaxNode) 22Protected Overloads Overrides Sub AddHighlights(node As SyntaxNode, highlights As List(Of TextSpan), cancellationToken As CancellationToken) 56Private Shared Function GetForBlockFromNode(node As SyntaxNode) As ForOrForEachBlockSyntax
Highlighting\KeywordHighlighters\MethodDeclarationHighlighter.vb (2)
15Inherits AbstractKeywordHighlighter(Of SyntaxNode) 22Protected Overloads Overrides Sub AddHighlights(node As SyntaxNode, highlights As List(Of TextSpan), cancellationToken As CancellationToken)
Highlighting\KeywordHighlighters\MultiLineLambdaExpressionHighlighter.vb (2)
15Inherits AbstractKeywordHighlighter(Of SyntaxNode) 22Protected Overloads Overrides Sub AddHighlights(node As SyntaxNode, highlights As List(Of TextSpan), cancellationToken As CancellationToken)
Highlighting\KeywordHighlighters\NamespaceBlockHighlighter.vb (2)
15Inherits AbstractKeywordHighlighter(Of SyntaxNode) 22Protected Overloads Overrides Sub AddHighlights(node As SyntaxNode, highlights As List(Of TextSpan), cancellationToken As CancellationToken)
Highlighting\KeywordHighlighters\OperatorDeclarationHighlighter.vb (2)
15Inherits AbstractKeywordHighlighter(Of SyntaxNode) 22Protected Overloads Overrides Sub AddHighlights(node As SyntaxNode, highlights As List(Of TextSpan), cancellationToken As CancellationToken)
Highlighting\KeywordHighlighters\PropertyBlockHighlighter.vb (2)
15Inherits AbstractKeywordHighlighter(Of SyntaxNode) 22Protected Overloads Overrides Sub AddHighlights(node As SyntaxNode, highlights As List(Of TextSpan), cancellationToken As CancellationToken)
Highlighting\KeywordHighlighters\SelectBlockHighlighter.vb (2)
15Inherits AbstractKeywordHighlighter(Of SyntaxNode) 22Protected Overloads Overrides Sub AddHighlights(node As SyntaxNode, highlights As List(Of TextSpan), cancellationToken As CancellationToken)
Highlighting\KeywordHighlighters\SyncLockBlockHighlighter.vb (2)
15Inherits AbstractKeywordHighlighter(Of SyntaxNode) 22Protected Overloads Overrides Sub AddHighlights(node As SyntaxNode, highlights As List(Of TextSpan), cancellationToken As CancellationToken)
Highlighting\KeywordHighlighters\TryBlockHighlighter.vb (3)
15Inherits AbstractKeywordHighlighter(Of SyntaxNode) 22Protected Overloads Overrides Sub AddHighlights(node As SyntaxNode, highlights As List(Of TextSpan), cancellationToken As CancellationToken) 57Private Shared Sub HighlightRelatedStatements(node As SyntaxNode, highlights As List(Of TextSpan))
Highlighting\KeywordHighlighters\TypeBlockHighlighter.vb (2)
15Inherits AbstractKeywordHighlighter(Of SyntaxNode) 22Protected Overloads Overrides Sub AddHighlights(node As SyntaxNode, highlights As List(Of TextSpan), cancellationToken As CancellationToken)
Highlighting\KeywordHighlighters\UsingBlockHighlighter.vb (2)
15Inherits AbstractKeywordHighlighter(Of SyntaxNode) 22Protected Overloads Overrides Sub AddHighlights(node As SyntaxNode, highlights As List(Of TextSpan), cancellationToken As CancellationToken)
Highlighting\KeywordHighlighters\WhileBlockHighlighter.vb (2)
15Inherits AbstractKeywordHighlighter(Of SyntaxNode) 22Protected Overloads Overrides Sub AddHighlights(node As SyntaxNode, highlights As List(Of TextSpan), cancellationToken As CancellationToken)
Highlighting\KeywordHighlighters\WithBlockHighlighter.vb (2)
15Inherits AbstractKeywordHighlighter(Of SyntaxNode) 22Protected Overloads Overrides Sub AddHighlights(node As SyntaxNode, highlights As List(Of TextSpan), cancellationToken As CancellationToken)
Highlighting\KeywordHighlightingHelpers.vb (8)
13Private Sub HighlightRelatedStatements(Of T As SyntaxNode)( 14node As SyntaxNode, 47Friend Function GetRelatedStatementHighlights(Of T As SyntaxNode)( 58Friend Function IsIncorrectContinueStatement(node As SyntaxNode, expectedKind As SyntaxKind) As Boolean 68Friend Function IsIncorrectExitStatement(node As SyntaxNode, expectedKind As SyntaxKind) As Boolean 78Friend Sub HighlightRelatedAwaits(node As SyntaxNode, highlights As List(Of TextSpan), cancellationToken As CancellationToken) 115Private Sub HighlightRelatedYieldStatements(Of T)(node As SyntaxNode, highlights As List(Of TextSpan)) 130Friend Function GetRelatedYieldStatementHighlights(Of T As SyntaxNode)(node As T) As IEnumerable(Of TextSpan)
InheritanceMargin\VisualBasicInheritanceMarginService.vb (5)
26Protected Overrides Function GetMembers(nodesToSearch As IEnumerable(Of SyntaxNode)) As ImmutableArray(Of SyntaxNode) 29Dim builder As ArrayBuilder(Of SyntaxNode) = Nothing 30Using ArrayBuilder(Of SyntaxNode).GetInstance(builder) 74Protected Overrides Function GetDeclarationToken(declarationNode As SyntaxNode) As SyntaxToken
InitializeParameter\InitializeParameterHelpers.vb (7)
12Public Shared Function IsFunctionDeclaration(node As SyntaxNode) As Boolean 17Public Shared Function GetBody(node As SyntaxNode) As SyntaxNode 21Private Shared Function GetStatements(functionDeclaration As SyntaxNode) As SyntaxList(Of StatementSyntax) 43Public Shared Function TryGetLastStatement(blockStatementOpt As IBlockOperation) As SyntaxNode 49functionDeclaration As SyntaxNode, 50statementToAddAfterOpt As SyntaxNode,
InitializeParameter\VisualBasicAddParameterCheckCodeRefactoringProvider.vb (6)
32Protected Overrides Function IsFunctionDeclaration(node As SyntaxNode) As Boolean 36Protected Overrides Function GetBody(functionDeclaration As SyntaxNode) As SyntaxNode 40Protected Overrides Sub InsertStatement(editor As SyntaxEditor, functionDeclaration As SyntaxNode, returnsVoid As Boolean, statementToAddAfterOpt As SyntaxNode, statement As StatementSyntax) 48Protected Overrides Function CanOffer(body As SyntaxNode) As Boolean
InitializeParameter\VisualBasicInitializeMemberFromParameterCodeRefactoringProvider.vb (9)
32Protected Overrides Function IsFunctionDeclaration(node As SyntaxNode) As Boolean 36Protected Overrides Function TryGetLastStatement(blockStatement As IBlockOperation) As SyntaxNode 44Protected Overrides Sub InsertStatement(editor As SyntaxEditor, functionDeclaration As SyntaxNode, returnsVoid As Boolean, statementToAddAfterOpt As SyntaxNode, statement As StatementSyntax) 58Protected Overrides Function GetBody(functionDeclaration As SyntaxNode) As SyntaxNode 62Protected Overrides Function GetAccessorBody(accessor As IMethodSymbol, cancellationToken As CancellationToken) As SyntaxNode 71Protected Overrides Function RemoveThrowNotImplemented(propertySyntax As SyntaxNode) As SyntaxNode
InlineHints\VisualBasicInlineParameterNameHintsService.vb (2)
27node As SyntaxNode, 94Protected Overrides Function IsIndexer(node As SyntaxNode, parameter As IParameterSymbol) As Boolean
IntroduceParameter\VisualBasicIntroduceParameterCodeRefactoringProvider.vb (5)
22Protected Overrides Function GenerateExpressionFromOptionalParameter(parameterSymbol As IParameterSymbol) As SyntaxNode 26Protected Overrides Function GetLocalDeclarationFromDeclarator(variableDecl As SyntaxNode) As SyntaxNode 30Protected Overrides Function UpdateArgumentListSyntax(node As SyntaxNode, arguments As SeparatedSyntaxList(Of ArgumentSyntax)) As SyntaxNode
IntroduceUsingStatement\VisualBasicIntroduceUsingStatementCodeRefactoringProvider.vb (3)
33Protected Overrides Function CanRefactorToContainBlockStatements(parent As SyntaxNode) As Boolean 42Protected Overrides Function WithStatements(parentOfStatementsToSurround As SyntaxNode, statements As SyntaxList(Of StatementSyntax)) As SyntaxNode
IntroduceVariable\VisualBasicIntroduceVariableService.Rewriter.vb (8)
15Private ReadOnly _replacementNode As SyntaxNode 18Private Sub New(replacementNode As SyntaxNode, matches As ISet(Of ExpressionSyntax)) 23Public Overrides Function Visit(node As SyntaxNode) As SyntaxNode 35Public Overrides Function VisitParenthesizedExpression(node As ParenthesizedExpressionSyntax) As SyntaxNode 48Public Overloads Shared Function Visit(node As SyntaxNode, replacementNode As SyntaxNode, matches As ISet(Of ExpressionSyntax)) As SyntaxNode
IntroduceVariable\VisualBasicIntroduceVariableService.vb (4)
23Protected Overrides Function GetContainingExecutableBlocks(expression As ExpressionSyntax) As IEnumerable(Of SyntaxNode) 150Protected Overrides Function RewriteCore(Of TNode As SyntaxNode)(node As TNode, replacementNode As SyntaxNode, matches As ISet(Of ExpressionSyntax)) As TNode 154Protected Overrides Function BlockOverlapsHiddenPosition(block As SyntaxNode, cancellationToken As CancellationToken) As Boolean
IntroduceVariable\VisualBasicIntroduceVariableService_IntroduceField.vb (1)
78Dim destination As SyntaxNode = oldTypeBlock
IntroduceVariable\VisualBasicIntroduceVariableService_IntroduceLocal.vb (2)
57cancellationToken As CancellationToken) As SyntaxNode 118container As SyntaxNode,
InvertIf\VisualBasicInvertIfCodeRefactoringProvider.MultiLine.vb (2)
29Protected Overrides Function GetCondition(ifNode As MultiLineIfBlockSyntax) As SyntaxNode 44condition As SyntaxNode,
InvertIf\VisualBasicInvertIfCodeRefactoringProvider.SingleLine.vb (2)
31Protected Overrides Function GetCondition(ifNode As SingleLineIfStatementSyntax) As SyntaxNode 46condition As SyntaxNode,
InvertIf\VisualBasicInvertIfCodeRefactoringProvider.vb (8)
21Protected NotOverridable Overrides Function CanControlFlowOut(node As SyntaxNode) As Boolean 30Protected NotOverridable Overrides Function GetJumpStatementKind(node As SyntaxNode) As SyntaxKind? 55Protected NotOverridable Overrides Function IsStatementContainer(node As SyntaxNode) As Boolean 59Protected NotOverridable Overrides Function GetStatements(node As SyntaxNode) As SyntaxList(Of StatementSyntax) 91Protected NotOverridable Overrides Function IsNoOpSyntaxNode(node As SyntaxNode) As Boolean 95Protected NotOverridable Overrides Function IsExecutableStatement(node As SyntaxNode) As Boolean 115Protected NotOverridable Overrides Function WithStatements(node As SyntaxNode, statements As IEnumerable(Of StatementSyntax)) As SyntaxNode
LanguageServices\VisualBasicSymbolDisplayService.SymbolDescriptionBuilder.vb (2)
97Private Async Function GetFirstDeclarationAsync(Of T As SyntaxNode)(symbol As ISymbol) As Task(Of T) 109Private Async Function GetDeclarationsAsync(Of T As SyntaxNode)(symbol As ISymbol) As Task(Of List(Of T))
LineSeparators\VisualBasicLineSeparatorService.vb (4)
42Private Function IsSeparableContainer(node As SyntaxNode) As Boolean 63Dim blocks = root.Traverse(Of SyntaxNode)(textSpan, AddressOf IsSeparableContainer) 103Private Shared Sub ProcessNodeList(Of T As SyntaxNode)(children As SyntaxList(Of T), spans As ArrayBuilder(Of TextSpan), token As CancellationToken) 151Private Shared Function GetLineSeparatorSpanForNode(node As SyntaxNode) As TextSpan
MetadataAsSource\VisualBasicMetadataAsSourceService.vb (5)
119Public Overrides Sub AddAnchorIndentationOperationsSlow(list As List(Of AnchorIndentationOperation), node As SyntaxNode, ByRef nextOperation As NextAnchorIndentationOperationAction) 156Public Shared Function ConvertToRegularComments(node As SyntaxNode, formattingService As IDocumentationCommentFormattingService, cancellationToken As CancellationToken) As SyntaxNode 162Public Overrides Function Visit(node As SyntaxNode) As SyntaxNode
NavigationBar\VisualBasicNavigationBarItemService.vb (5)
61Private Shared Function GetTypesAndDeclarationsInFile(semanticModel As SemanticModel, cancellationToken As CancellationToken) As IEnumerable(Of Tuple(Of INamedTypeSymbol, SyntaxNode)) 63Dim typesAndDeclarations As New Dictionary(Of INamedTypeSymbol, SyntaxNode) 64Dim nodesToVisit As New Stack(Of SyntaxNode) 66nodesToVisit.Push(DirectCast(semanticModel.SyntaxTree.GetRoot(cancellationToken), SyntaxNode)) 70Return SpecializedCollections.EmptyEnumerable(Of Tuple(Of INamedTypeSymbol, SyntaxNode))()
Organizing\Organizers\MemberDeclarationsOrganizer.vb (3)
31Private Shared Sub TransferTrivia(Of TSyntaxNode As SyntaxNode)( 60Private Shared Sub FixupOriginalFirstNode(Of TSyntaxNode As SyntaxNode)( 81Private Shared Sub CopyBanner(Of TSyntaxNode As SyntaxNode)(
Organizing\VisualBasicOrganizerService.Rewriter.vb (5)
13Private ReadOnly _nodeToOrganizersGetter As Func(Of SyntaxNode, IEnumerable(Of ISyntaxOrganizer)) 26Public Overrides Function DefaultVisit(node As SyntaxNode) As SyntaxNode 31Public Overrides Function Visit(node As SyntaxNode) As SyntaxNode
Organizing\VisualBasicOrganizerService.vb (1)
23Dim root = DirectCast(Await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(False), SyntaxNode)
QuickInfo\VisualBasicSemanticQuickInfoProvider.vb (3)
131Protected Overrides Function GetBindableNodeForTokenIndicatingLambda(token As SyntaxToken, <Out> ByRef found As SyntaxNode) As Boolean 141Protected Overrides Function GetBindableNodeForTokenIndicatingPossibleIndexerAccess(token As SyntaxToken, ByRef found As SyntaxNode) As Boolean 206expression As SyntaxNode,
RemoveSharedFromModuleMembers\VisualBasicRemoveSharedFromModuleMembersCodeFixProvider.vb (2)
72Private Shared Function GetReplacement(document As Document, node As SyntaxNode) As SyntaxNode
RemoveUnusedVariable\VisualBasicRemoveUnusedVariableCodeFixProvider.vb (5)
36Protected Overrides Function GetNodeToRemoveOrReplace(node As SyntaxNode) As SyntaxNode 41Protected Overrides Sub RemoveOrReplaceNode(editor As SyntaxEditor, node As SyntaxNode, blockFacts As IBlockFactsService) 45Protected Overrides Function GetVariables(localDeclarationStatement As LocalDeclarationStatementSyntax) As SeparatedSyntaxList(Of SyntaxNode) 49Protected Overrides Function ShouldOfferFixForLocalDeclaration(blockFacts As IBlockFactsService, node As SyntaxNode) As Boolean
ReplaceDocCommentTextWithTag\VisualBasicReplaceDocCommentTextWithTagCodeRefactoringProvider.vb (1)
34Protected Overrides Function ParseExpression(text As String) As SyntaxNode
ReplaceMethodWithProperty\VisualBasicReplaceMethodWithPropertyService.vb (4)
27Public Sub RemoveSetMethod(editor As SyntaxEditor, setMethodDeclaration As SyntaxNode) Implements IReplaceMethodWithPropertyService.RemoveSetMethod 155Function(c As SyntaxNode, g As SyntaxGenerator) 207Dim result As SyntaxNode = SyntaxFactory.SimpleAssignmentStatement( 215Private Function IReplaceMethodWithPropertyService_GetMethodDeclarationAsync(context As CodeRefactoringContext) As Task(Of SyntaxNode) Implements IReplaceMethodWithPropertyService.GetMethodDeclarationAsync
ReplacePropertyWithMethods\VisualBasicReplacePropertyWithMethods.ConvertValueToParamRewriter.vb (3)
20Private Shared Function ConvertToParam(name As XmlNodeSyntax) As SyntaxNode 25Public Overrides Function VisitXmlElementStartTag(node As XmlElementStartTagSyntax) As SyntaxNode 34Public Overrides Function VisitXmlElementEndTag(node As XmlElementEndTagSyntax) As SyntaxNode
ReplacePropertyWithMethods\VisualBasicReplacePropertyWithMethods.ConvertValueToReturnsRewriter.vb (3)
20Private Shared Function ConvertToReturns(name As XmlNodeSyntax) As SyntaxNode 25Public Overrides Function VisitXmlElementStartTag(node As XmlElementStartTagSyntax) As SyntaxNode 31Public Overrides Function VisitXmlElementEndTag(node As XmlElementEndTagSyntax) As SyntaxNode
ReplacePropertyWithMethods\VisualBasicReplacePropertyWithMethods.vb (15)
29propertyDeclarationNode As SyntaxNode, 33cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of SyntaxNode)) 37Return SpecializedTasks.EmptyImmutableArray(Of SyntaxNode) 54cancellationToken As CancellationToken) As ImmutableArray(Of SyntaxNode) 56Dim result = ArrayBuilder(Of SyntaxNode).GetInstance() 86cancellationToken As CancellationToken) As SyntaxNode 87Dim statements = New List(Of SyntaxNode)() 119cancellationToken As CancellationToken) As SyntaxNode 120Dim statements = New List(Of SyntaxNode)() 186methodDeclaration As SyntaxNode, 187documentationCommentRewriter As VisualBasicSyntaxRewriter) As SyntaxNode 209Public Overrides Function GetPropertyNodeToReplace(propertyDeclaration As SyntaxNode) As SyntaxNode 232Protected Overrides Function CreateCrefSyntax(originalCref As CrefReferenceSyntax, identifierToken As SyntaxToken, parameterType As SyntaxNode) As CrefReferenceSyntax 250Protected Overrides Function UnwrapCompoundAssignment(compoundAssignment As SyntaxNode, readExpression As ExpressionSyntax) As ExpressionSyntax
SignatureHelp\AbstractIntrinsicOperatorSignatureHelpProvider.vb (4)
12Friend MustInherit Class AbstractIntrinsicOperatorSignatureHelpProvider(Of TSyntaxNode As SyntaxNode) 19Private Function TryGetSyntaxNode(root As SyntaxNode, position As Integer, syntaxFacts As ISyntaxFactsService, triggerReason As SignatureHelpTriggerReason, cancellationToken As CancellationToken, ByRef node As TSyntaxNode) As Boolean 83Protected Overridable Function GetCurrentArgumentStateWorker(node As SyntaxNode, position As Integer) As SignatureHelpState 104Private Function GetCurrentArgumentState(root As SyntaxNode, position As Integer, syntaxFacts As ISyntaxFactsService, currentSpan As TextSpan, cancellationToken As CancellationToken) As SignatureHelpState
SignatureHelp\AttributeSignatureHelpProvider.vb (2)
34Private Function TryGetAttributeExpression(root As SyntaxNode, position As Integer, syntaxFacts As ISyntaxFactsService, triggerReason As SignatureHelpTriggerReason, cancellationToken As CancellationToken, ByRef attribute As AttributeSyntax) As Boolean 95Private Function GetCurrentArgumentState(root As SyntaxNode, position As Integer, syntaxFacts As ISyntaxFactsService, currentSpan As TextSpan, cancellationToken As CancellationToken) As SignatureHelpState?
SignatureHelp\CollectionInitializerSignatureHelpProvider.vb (2)
32Private Function TryGetInitializerExpression(root As SyntaxNode, position As Integer, syntaxFacts As ISyntaxFactsService, triggerReason As SignatureHelpTriggerReason, cancellationToken As CancellationToken, <Out> ByRef expression As CollectionInitializerSyntax) As Boolean 70Private Function GetCurrentArgumentState(root As SyntaxNode, position As Integer, syntaxFacts As ISyntaxFactsService, currentSpan As TextSpan, cancellationToken As CancellationToken) As SignatureHelpState?
SignatureHelp\ConditionalExpressionSignatureHelpProvider.vb (1)
13Friend MustInherit Class ConditionalExpressionSignatureHelpProvider(Of T As SyntaxNode)
SignatureHelp\FunctionAggregationSignatureHelpProvider.vb (2)
33Private Shared Function GetCurrentArgumentState(root As SyntaxNode, position As Integer, syntaxFacts As ISyntaxFactsService, currentSpan As TextSpan, cancellationToken As CancellationToken) As SignatureHelpState 43Private Shared Function TryGetFunctionAggregation(root As SyntaxNode, position As Integer, syntaxFacts As ISyntaxFactsService, triggerReason As SignatureHelpTriggerReason,
SignatureHelp\GenericNameSignatureHelpProvider.vb (2)
33Private Shared Function GetCurrentArgumentState(root As SyntaxNode, position As Integer, syntaxFacts As ISyntaxFactsService, currentSpan As TextSpan, cancellationToken As CancellationToken) As SignatureHelpState? 44Private Shared Function TryGetGenericName(root As SyntaxNode, position As Integer, syntaxFacts As ISyntaxFactsService, triggerReason As SignatureHelpTriggerReason, cancellationToken As CancellationToken, ByRef genericName As GenericNameSyntax) As Boolean
SignatureHelp\InvocationExpressionSignatureHelpProvider.vb (2)
34Private Shared Function GetCurrentArgumentState(root As SyntaxNode, position As Integer, syntaxFacts As ISyntaxFactsService, currentSpan As TextSpan, cancellationToken As CancellationToken) As SignatureHelpState? 45Private Shared Function TryGetInvocationExpression(root As SyntaxNode, position As Integer, syntaxFacts As ISyntaxFactsService, triggerReason As SignatureHelpTriggerReason, cancellationToken As CancellationToken, ByRef expression As InvocationExpressionSyntax) As Boolean
SignatureHelp\MidAssignmentSignatureHelpProvider.vb (1)
47Protected Overrides Function GetCurrentArgumentStateWorker(node As SyntaxNode, position As Integer) As SignatureHelpState
SignatureHelp\ObjectCreationExpressionSignatureHelpProvider.vb (2)
33Private Shared Function GetCurrentArgumentState(root As SyntaxNode, position As Integer, syntaxFacts As ISyntaxFactsService, currentSpan As TextSpan, cancellationToken As CancellationToken) As SignatureHelpState? 44Private Shared Function TryGetObjectCreationExpression(root As SyntaxNode, position As Integer, syntaxFacts As ISyntaxFactsService, triggerReason As SignatureHelpTriggerReason, cancellationToken As CancellationToken, ByRef expression As ObjectCreationExpressionSyntax) As Boolean
SignatureHelp\RaiseEventStatementSignatureHelpProvider.vb (2)
32Private Shared Function GetCurrentArgumentState(root As SyntaxNode, position As Integer, syntaxFacts As ISyntaxFactsService, currentSpan As TextSpan, cancellationToken As CancellationToken) As SignatureHelpState? 43Private Shared Function TryGetRaiseEventStatement(root As SyntaxNode, position As Integer, syntaxFacts As ISyntaxFactsService, triggerReason As SignatureHelpTriggerReason, cancellationToken As CancellationToken, ByRef statement As RaiseEventStatementSyntax) As Boolean
SimplifyThisOrMe\VisualBasicSimplifyThisOrMeCodeFixProvider.vb (3)
27Protected Overrides Function Rewrite(root As SyntaxNode, memberAccessNodes As ISet(Of MemberAccessExpressionSyntax)) As SyntaxNode 40Public Overrides Function VisitMemberAccessExpression(node As MemberAccessExpressionSyntax) As SyntaxNode
SimplifyTypeNames\SimplifyTypeNamesCodeFixProvider.vb (2)
41Protected Overrides Function AddSimplificationAnnotationTo(expression As SyntaxNode) As SyntaxNode
SpellCheck\VisualBasicSpellCheckCodeFixProvider.vb (1)
56Protected Overrides Function DescendIntoChildren(arg As SyntaxNode) As Boolean
SplitOrMergeIfStatements\VisualBasicIfLikeStatementGenerator.vb (36)
22Public Function IsIfOrElseIf(node As SyntaxNode) As Boolean Implements IIfLikeStatementGenerator.IsIfOrElseIf 27Public Function IsCondition(expression As SyntaxNode, ByRef ifOrElseIf As SyntaxNode) As Boolean Implements IIfLikeStatementGenerator.IsCondition 46Public Function IsElseIfClause(node As SyntaxNode, ByRef parentIfOrElseIf As SyntaxNode) As Boolean Implements IIfLikeStatementGenerator.IsElseIfClause 50parentIfOrElseIf = If(index > 0, ifBlock.ElseIfBlocks(index - 1), DirectCast(ifBlock, SyntaxNode)) 58Public Function HasElseIfClause(ifOrElseIf As SyntaxNode, ByRef elseIfClause As SyntaxNode) As Boolean Implements IIfLikeStatementGenerator.HasElseIfClause 77Public Function GetCondition(ifOrElseIf As SyntaxNode) As SyntaxNode Implements IIfLikeStatementGenerator.GetCondition 87Public Function GetRootIfStatement(ifOrElseIf As SyntaxNode) As SyntaxNode Implements IIfLikeStatementGenerator.GetRootIfStatement 97Public Function GetElseIfAndElseClauses(ifOrElseIf As SyntaxNode) As ImmutableArray(Of SyntaxNode) Implements IIfLikeStatementGenerator.GetElseIfAndElseClauses 111Private Shared Function AddIfNotNull(list As SyntaxList(Of SyntaxNode), node As SyntaxNode) As SyntaxList(Of SyntaxNode) 115Public Function WithCondition(ifOrElseIf As SyntaxNode, condition As SyntaxNode) As SyntaxNode Implements IIfLikeStatementGenerator.WithCondition 127Public Function WithStatementInBlock(ifOrElseIf As SyntaxNode, statement As SyntaxNode) As SyntaxNode Implements IIfLikeStatementGenerator.WithStatementInBlock 131Public Function WithStatementsOf(ifOrElseIf As SyntaxNode, otherIfOrElseIf As SyntaxNode) As SyntaxNode Implements IIfLikeStatementGenerator.WithStatementsOf 135Public Function WithElseIfAndElseClausesOf(ifStatement As SyntaxNode, otherIfStatement As SyntaxNode) As SyntaxNode Implements IIfLikeStatementGenerator.WithElseIfAndElseClausesOf 141Public Function ToIfStatement(ifOrElseIf As SyntaxNode) As SyntaxNode Implements IIfLikeStatementGenerator.ToIfStatement 163Public Function ToElseIfClause(ifOrElseIf As SyntaxNode) As SyntaxNode Implements IIfLikeStatementGenerator.ToElseIfClause 180Public Sub InsertElseIfClause(editor As SyntaxEditor, afterIfOrElseIf As SyntaxNode, elseIfClause As SyntaxNode) Implements IIfLikeStatementGenerator.InsertElseIfClause 196Public Sub RemoveElseIfClause(editor As SyntaxEditor, elseIfClause As SyntaxNode) Implements IIfLikeStatementGenerator.RemoveElseIfClause
SplitOrMergeIfStatements\VisualBasicMergeConsecutiveIfStatementsCodeRefactoringProvider.vb (2)
22Protected Overrides Function IsApplicableSpan(node As SyntaxNode, span As TextSpan, ByRef ifOrElseIf As SyntaxNode) As Boolean
SplitOrMergeIfStatements\VisualBasicMergeNestedIfStatementsCodeRefactoringProvider.vb (2)
22Protected Overrides Function IsApplicableSpan(node As SyntaxNode, span As TextSpan, ByRef ifOrElseIf As SyntaxNode) As Boolean
src\Analyzers\VisualBasic\Analyzers\NewLines\ConsecutiveStatementPlacement\VisualBasicConsecutiveStatementPlacementDiagnosticAnalyzer.vb (2)
37Protected Overrides Function IsBlockLikeStatement(node As SyntaxNode) As Boolean 43Protected Overrides Function GetDiagnosticLocation(block As SyntaxNode) As Location
src\Analyzers\VisualBasic\Analyzers\OrderModifiers\VisualBasicOrderModifiersDiagnosticAnalyzer.vb (1)
31root As SyntaxNode)
src\Analyzers\VisualBasic\Analyzers\QualifyMemberAccess\VisualBasicQualifyMemberAccessDiagnosticAnalyzer.vb (1)
26Protected Overrides Function CanMemberAccessBeQualified(containingSymbol As ISymbol, node As SyntaxNode) As Boolean
src\Analyzers\VisualBasic\Analyzers\RemoveUnnecessaryImports\VisualBasicRemoveUnnecessaryImportsDiagnosticAnalyzer.vb (4)
36Protected Overrides Function MergeImports(unnecessaryImports As ImmutableArray(Of ImportsClauseSyntax)) As ImmutableArray(Of SyntaxNode) 37Dim result = ArrayBuilder(Of SyntaxNode).GetInstance() 55nodes As IEnumerable(Of SyntaxNode), tree As SyntaxTree, cancellationToken As CancellationToken) As IEnumerable(Of TextSpan) 60Protected Overrides Function TryGetLastToken(node As SyntaxNode) As SyntaxToken?
src\Analyzers\VisualBasic\Analyzers\RemoveUnnecessarySuppressions\VisualBasicRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.vb (1)
33Protected Overrides Function ContainsPragmaDirective(root As SyntaxNode) As Boolean
src\Analyzers\VisualBasic\Analyzers\RemoveUnusedMembers\VisualBasicRemoveUnusedMembersDiagnosticAnalyzer.vb (2)
66Protected Overrides Function GetParentIfSoleDeclarator(node As SyntaxNode) As SyntaxNode
src\Analyzers\VisualBasic\Analyzers\RemoveUnusedParametersAndValues\VisualBasicRemoveUnusedParametersAndValuesDiagnosticAnalyzer.vb (2)
45Protected Overrides Function IsIfConditionalDirective(node As SyntaxNode) As Boolean 53Protected Overrides Function ReturnsThrow(node As SyntaxNode) As Boolean
src\Analyzers\VisualBasic\Analyzers\SimplifyInterpolation\VisualBasicSimplifyInterpolationHelpers.vb (1)
18Protected Overrides Function GetPreservedInterpolationExpressionSyntax(operation As IOperation) As SyntaxNode
src\Analyzers\VisualBasic\Analyzers\UseAutoProperty\Utilities.vb (1)
9Friend Function GetNodeToRemove(identifier As ModifiedIdentifierSyntax) As SyntaxNode
src\Analyzers\VisualBasic\Analyzers\UseAutoProperty\VisualBasicUseAutoPropertyAnalyzer.vb (3)
51ineligibleFieldUsageIfOutsideProperty As ConcurrentDictionary(Of IFieldSymbol, ConcurrentSet(Of SyntaxNode)), 53codeBlock As SyntaxNode, 147Protected Overrides Function GetFieldNode(fieldDeclaration As FieldDeclarationSyntax, identifier As ModifiedIdentifierSyntax) As SyntaxNode
src\Analyzers\VisualBasic\Analyzers\UseCoalesceExpression\VisualBasicUseCoalesceExpressionForIfNullStatementCheckDiagnosticAnalyzer.vb (1)
32Protected Overrides Function GetDeclarationNode(declarator As VariableDeclaratorSyntax) As SyntaxNode
src\Analyzers\VisualBasic\Analyzers\UseCollectionInitializer\VisualBasicCollectionInitializerAnalyzer.vb (3)
31Protected Overrides Function IsComplexElementInitializer(expression As SyntaxNode) As Boolean 42preMatches As ArrayBuilder(Of CollectionMatch(Of SyntaxNode)), 43postMatches As ArrayBuilder(Of CollectionMatch(Of SyntaxNode)),
src\Analyzers\VisualBasic\Analyzers\UseCollectionInitializer\VisualBasicUseCollectionInitializerDiagnosticAnalyzer.vb (1)
47matches As ImmutableArray(Of CollectionMatch(Of SyntaxNode)),
src\Analyzers\VisualBasic\Analyzers\ValidateFormatString\VisualBasicValidateFormatStringDiagnosticAnalyzer.vb (4)
22arguments As SeparatedSyntaxList(Of SyntaxNode), 23searchArgumentName As String) As SyntaxNode 35Protected Overrides Function GetArgumentExpression(syntaxNode As SyntaxNode) As SyntaxNode
src\Analyzers\VisualBasic\CodeFixes\AddAccessibilityModifiers\VisualBasicAddAccessibilityModifiersCodeFixProvider.vb (2)
21Protected Overrides Function MapToDeclarator(declaration As SyntaxNode) As SyntaxNode
src\Analyzers\VisualBasic\CodeFixes\AddExplicitCast\ArgumentFixer.vb (1)
11Inherits Fixer(Of ArgumentSyntax, ArgumentListSyntax, SyntaxNode)
src\Analyzers\VisualBasic\CodeFixes\AddExplicitCast\VisualBasicAddExplicitCastCodeFixProvider.vb (4)
38ByRef type As SyntaxNode, 59root As SyntaxNode, 169root As SyntaxNode, 170invocationNode As SyntaxNode,
src\Analyzers\VisualBasic\CodeFixes\AddParameter\VisualBasicAddParameterCodeFixProvider.vb (1)
52Protected Overrides Function GetArgumentType(argumentNode As SyntaxNode, semanticModel As SemanticModel, cancellationToken As CancellationToken) As ITypeSymbol
src\Analyzers\VisualBasic\CodeFixes\ConvertToAsync\VisualBasicConvertToAsyncFunctionCodeFixProvider.vb (5)
35Protected Overrides Async Function GetDescriptionAsync(diagnostic As Diagnostic, node As SyntaxNode, semanticModel As SemanticModel, cancellationToken As CancellationToken) As Task(Of String) 40Protected Overrides Async Function GetRootInOtherSyntaxTreeAsync(node As SyntaxNode, semanticModel As SemanticModel, diagnostic As Diagnostic, cancellationToken As CancellationToken) As Task(Of Tuple(Of SyntaxTree, SyntaxNode)) 53Private Shared Async Function GetMethodFromExpressionAsync(oldNode As SyntaxNode, semanticModel As SemanticModel, cancellationToken As CancellationToken) As Task(Of Tuple(Of SyntaxNode, MethodBlockSyntax))
src\Analyzers\VisualBasic\CodeFixes\ConvertTypeOfToNameOf\VisualBasicConvertGetTypeToNameOfCodeFixProvider.vb (1)
29Protected Overrides Function GetSymbolTypeExpression(semanticModel As SemanticModel, node As MemberAccessExpressionSyntax, cancellationToken As CancellationToken) As SyntaxNode
src\Analyzers\VisualBasic\CodeFixes\GenerateConstructor\GenerateConstructorCodeFixProvider.vb (4)
34Protected Overrides Function GetCodeActionsAsync(document As Document, node As SyntaxNode, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of CodeAction)) 39Protected Overrides Function GetTargetNode(node As SyntaxNode) As SyntaxNode 58Protected Overrides Function IsCandidate(node As SyntaxNode, token As SyntaxToken, diagnostic As Diagnostic) As Boolean
src\Analyzers\VisualBasic\CodeFixes\GenerateConstructor\VisualBasicGenerateConstructorService.vb (7)
25Protected Overrides Function IsImplicitObjectCreation(document As SemanticDocument, node As SyntaxNode, cancellationToken As CancellationToken) As Boolean 29Protected Overrides Function TryInitializeImplicitObjectCreation(document As SemanticDocument, node As SyntaxNode, cancellationToken As CancellationToken, ByRef token As SyntaxToken, ByRef arguments As ImmutableArray(Of Argument), ByRef typeToGenerateIn As INamedTypeSymbol) As Boolean 51Protected Overrides Function IsConstructorInitializerGeneration(document As SemanticDocument, node As SyntaxNode, cancellationToken As CancellationToken) As Boolean 59node As SyntaxNode, 88Protected Overrides Function IsSimpleNameGeneration(document As SemanticDocument, node As SyntaxNode, cancellationToken As CancellationToken) As Boolean 94node As SyntaxNode, 129node As SyntaxNode,
src\Analyzers\VisualBasic\CodeFixes\GenerateDefaultConstructors\VisualBasicGenerateDefaultConstructorsCodeFixProvider.vb (1)
28Protected Overrides Function TryGetTypeName(typeDeclaration As SyntaxNode) As SyntaxToken?
src\Analyzers\VisualBasic\CodeFixes\GenerateDefaultConstructors\VisualBasicGenerateDefaultConstructorsService.vb (1)
32Dim typeDecl As SyntaxNode = Nothing
src\Analyzers\VisualBasic\CodeFixes\GenerateEnumMember\GenerateEnumMemberCodeFixProvider.vb (4)
35Protected Overrides Function GetCodeActionsAsync(document As Document, node As SyntaxNode, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of CodeAction)) 40Protected Overrides Function IsCandidate(node As SyntaxNode, token As SyntaxToken, diagnostic As Diagnostic) As Boolean 44Protected Overrides Function GetTargetNode(node As SyntaxNode) As SyntaxNode
src\Analyzers\VisualBasic\CodeFixes\GenerateEnumMember\VisualBasicGenerateEnumMemberService.vb (1)
22Protected Overrides Function IsIdentifierNameGeneration(node As SyntaxNode) As Boolean
src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\GenerateConversionCodeFixProvider.vb (4)
35Protected Overrides Function GetCodeActionsAsync(document As Document, node As SyntaxNode, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of CodeAction)) 40Protected Overrides Function IsCandidate(node As SyntaxNode, token As SyntaxToken, diagnostic As Diagnostic) As Boolean 49Protected Overrides Function GetTargetNode(node As SyntaxNode) As SyntaxNode
src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\GenerateParameterizedMemberCodeFixProvider.vb (4)
54Protected Overrides Function GetCodeActionsAsync(document As Document, node As SyntaxNode, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of CodeAction)) 59Protected Overrides Function IsCandidate(node As SyntaxNode, token As SyntaxToken, diagnostic As Diagnostic) As Boolean 75Protected Overrides Function GetTargetNode(node As SyntaxNode) As SyntaxNode
src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\VisualBasicGenerateConversionService.vb (9)
32Protected Overrides Function IsExplicitConversionGeneration(node As SyntaxNode) As Boolean 36Protected Overrides Function IsImplicitConversionGeneration(node As SyntaxNode) As Boolean 43Private Shared Function IsInImplementsClause(node As SyntaxNode) As Boolean 47Private Shared Function IsInMemberAccessExpression(node As SyntaxNode) As Boolean 55Protected Overrides Function TryInitializeExplicitConversionState(document As SemanticDocument, expression As SyntaxNode, classInterfaceModuleStructTypes As ISet(Of TypeKind), cancellationToken As CancellationToken, ByRef identifierToken As SyntaxToken, ByRef methodSymbol As IMethodSymbol, ByRef typeToGenerateIn As INamedTypeSymbol) As Boolean 69Protected Overrides Function TryInitializeImplicitConversionState(document As SemanticDocument, expression As SyntaxNode, classInterfaceModuleStructTypes As ISet(Of TypeKind), cancellationToken As CancellationToken, ByRef identifierToken As SyntaxToken, ByRef methodSymbol As IMethodSymbol, ByRef typeToGenerateIn As INamedTypeSymbol) As Boolean 83Private Shared Function TryGetConversionMethodAndTypeToGenerateIn(document As SemanticDocument, expression As SyntaxNode, classInterfaceModuleStructTypes As ISet(Of TypeKind), cancellationToken As CancellationToken, ByRef methodSymbol As IMethodSymbol, ByRef typeToGenerateIn As INamedTypeSymbol) As Boolean 109Private Shared Function IsCastExpression(node As SyntaxNode) As Boolean 129Private Shared Function TryGetImplicitConversionMethodAndTypeToGenerateIn(document As SemanticDocument, expression As SyntaxNode, classInterfaceModuleStructTypes As ISet(Of TypeKind), cancellationToken As CancellationToken, ByRef methodSymbol As IMethodSymbol, ByRef typeToGenerateIn As INamedTypeSymbol) As Boolean
src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\VisualBasicGenerateMethodService.vb (3)
24Protected Overrides Function IsExplicitInterfaceGeneration(node As SyntaxNode) As Boolean 28Protected Overrides Function IsSimpleNameGeneration(node As SyntaxNode) As Boolean 42node As SyntaxNode,
src\Analyzers\VisualBasic\CodeFixes\GenerateVariable\VisualBasicGenerateVariableCodeFixProvider.vb (4)
38Protected Overrides Async Function GetCodeActionsAsync(document As Document, node As SyntaxNode, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of CodeAction)) 52Protected Overrides Function IsCandidate(node As SyntaxNode, token As SyntaxToken, diagnostic As Diagnostic) As Boolean 69Protected Overrides Function GetTargetNode(node As SyntaxNode) As SyntaxNode
src\Analyzers\VisualBasic\CodeFixes\ImplementInterface\VisualBasicImplementInterfaceService.vb (6)
43document As Document, model As SemanticModel, node As SyntaxNode, cancellationToken As CancellationToken, 44ByRef classOrStructDecl As SyntaxNode, ByRef classOrStructType As INamedTypeSymbol, 91node As SyntaxNode, 101Protected Overrides Function AddCommentInsideIfStatement(ifStatement As SyntaxNode, trivia As SyntaxTriviaList) As SyntaxNode 110disposeMethodDisplayString As String) As SyntaxNode
src\Analyzers\VisualBasic\CodeFixes\Iterator\VisualBasicChangeToYieldCodeFixProvider.vb (2)
36Protected Overrides Function GetCodeFixAsync(root As SyntaxNode, node As SyntaxNode, document As Document, diagnostics As Diagnostic, cancellationToken As CancellationToken) As Task(Of CodeAction)
src\Analyzers\VisualBasic\CodeFixes\Iterator\VisualBasicConvertToIteratorCodeFixProvider.vb (6)
38Protected Overrides Async Function GetCodeFixAsync(root As SyntaxNode, node As SyntaxNode, document As Document, diagnostics As Diagnostic, cancellationToken As CancellationToken) As Task(Of CodeAction) 111Private Shared Function AddIteratorKeywordToMethod(root As SyntaxNode, methodStatementNode As MethodStatementSyntax) As SyntaxNode 130Private Shared Function AddIteratorKeywordToLambda(root As SyntaxNode, lambdaNode As LambdaExpressionSyntax) As SyntaxNode
src\Analyzers\VisualBasic\CodeFixes\MakeFieldReadonly\VisualBasicMakeFieldReadonlyCodeFixProvider.vb (1)
26Protected Overrides Function GetInitializerNode(declaration As ModifiedIdentifierSyntax) As SyntaxNode
src\Analyzers\VisualBasic\CodeFixes\MakeMethodAsynchronous\VisualBasicMakeMethodAsynchronousCodeFixProvider.vb (6)
52Protected Overrides Function IsAsyncSupportingFunctionSyntax(node As SyntaxNode) As Boolean 63node As SyntaxNode, 65cancellationToken As CancellationToken) As SyntaxNode 83Private Shared Function FixFunctionBlock(methodSymbol As IMethodSymbol, node As MethodBlockSyntax, knownTypes As KnownTaskTypes) As SyntaxNode 98keepVoid As Boolean, node As MethodBlockSyntax, taskType As INamedTypeSymbol) As SyntaxNode 143Private Shared Function FixMultiLineLambdaExpression(node As MultiLineLambdaExpressionSyntax) As SyntaxNode
src\Analyzers\VisualBasic\CodeFixes\MakeMethodSynchronous\VisualBasicMakeMethodSynchronousCodeFixProvider.vb (5)
34Protected Overrides Function IsAsyncSupportingFunctionSyntax(node As SyntaxNode) As Boolean 38Protected Overrides Function RemoveAsyncTokenAndFixReturnType(methodSymbolOpt As IMethodSymbol, node As SyntaxNode, knownTypes As KnownTaskTypes) As SyntaxNode 54Private Shared Function FixFunctionBlock(methodSymbol As IMethodSymbol, node As MethodBlockSyntax, knownTypes As KnownTaskTypes) As SyntaxNode 91Private Shared Function FixSubBlock(node As MethodBlockSyntax) As SyntaxNode
src\Analyzers\VisualBasic\CodeFixes\MakeTypeAbstract\VisualBasicMakeTypeAbstractCodeFixProvider.vb (1)
25Protected Overrides Function IsValidRefactoringContext(node As SyntaxNode, ByRef typeDeclaration As ClassBlockSyntax) As Boolean
src\Analyzers\VisualBasic\CodeFixes\RemoveAsyncModifier\RemoveAsyncModifierHelpers.vb (1)
38Friend Shared Function FixMultiLineLambdaExpression(node As MultiLineLambdaExpressionSyntax) As SyntaxNode
src\Analyzers\VisualBasic\CodeFixes\RemoveAsyncModifier\VisualBasicRemoveAsyncModifierCodeFixProvider.vb (5)
30Protected Overrides Function IsAsyncSupportingFunctionSyntax(node As SyntaxNode) As Boolean 34Protected Overrides Function RemoveAsyncModifier(generator As SyntaxGenerator, methodLikeNode As SyntaxNode) As SyntaxNode 55Protected Overrides Function ConvertToBlockBody(node As SyntaxNode, expressionBody As ExpressionSyntax) As SyntaxNode
src\Analyzers\VisualBasic\CodeFixes\RemoveUnnecessaryCast\VisualBasicRemoveUnnecessaryCastCodeFixProvider.vb (2)
95cancellationToken As CancellationToken) As Task(Of SyntaxNode) 117cancellationToken As CancellationToken) As Task(Of SyntaxNode)
src\Analyzers\VisualBasic\CodeFixes\RemoveUnusedMembers\VisualBasicRemoveUnusedMembersCodeFixProvider.vb (1)
27Protected Overrides Sub AdjustAndAddAppropriateDeclaratorsToRemove(fieldDeclarators As HashSet(Of FieldDeclarationSyntax), declarators As HashSet(Of SyntaxNode))
src\Analyzers\VisualBasic\CodeFixes\RemoveUnusedParametersAndValues\VisualBasicRemoveUnusedValuesCodeFixProvider.vb (12)
40Protected Overrides Function TryUpdateNameForFlaggedNode(node As SyntaxNode, newName As SyntaxToken) As SyntaxNode 59Protected Overrides Function GetReplacementNodeForCompoundAssignment(originalCompoundAssignment As SyntaxNode, newAssignmentTarget As SyntaxNode, editor As SyntaxEditor, syntaxFacts As ISyntaxFactsService) As SyntaxNode 64Protected Overrides Function GetReplacementNodeForVarPattern(originalVarPattern As SyntaxNode, newNameNode As SyntaxNode) As SyntaxNode 69Protected Overrides Function ComputeReplacementNode(originalOldNode As SyntaxNode, changedOldNode As SyntaxNode, proposedReplacementNode As SyntaxNode) As SyntaxNode
src\Analyzers\VisualBasic\CodeFixes\UseCollectionInitializer\VisualBasicUseCollectionInitializerCodeFixProvider.vb (8)
45preMatches As ImmutableArray(Of CollectionMatch(Of SyntaxNode)), 46postMatches As ImmutableArray(Of CollectionMatch(Of SyntaxNode)), 47cancellationToken As CancellationToken) As Task(Of (SyntaxNode, SyntaxNode)) 70Return Task.FromResult((DirectCast(statement, SyntaxNode), DirectCast(result, SyntaxNode))) 75matches As ImmutableArray(Of CollectionMatch(Of SyntaxNode))) As ObjectCreationExpressionSyntax 85matches As ImmutableArray(Of CollectionMatch(Of SyntaxNode))) As CollectionInitializerSyntax
src\Analyzers\VisualBasic\CodeFixes\UseConditionalExpression\MultiLineConditionalExpressionFormattingRule.vb (1)
52list As List(Of IndentBlockOperation), node As SyntaxNode, ByRef nextOperation As NextIndentBlockOperationAction)
src\Analyzers\VisualBasic\CodeFixes\UseInferredMemberName\VisualBasicUseInferredMemberNameCodeFixProvider.vb (1)
22Protected Overrides Sub LanguageSpecificRemoveSuggestedNode(editor As SyntaxEditor, node As SyntaxNode)
src\Analyzers\VisualBasic\CodeFixes\UseIsNullCheck\VisualBasicUseIsNullCheckForReferenceEqualsCodeFixProvider.vb (2)
25Protected Overrides Function CreateNullCheck(argument As ExpressionSyntax, isUnconstrainedGeneric As Boolean) As SyntaxNode 31Protected Overrides Function CreateNotNullCheck(argument As ExpressionSyntax) As SyntaxNode
src\Analyzers\VisualBasic\CodeFixes\UseNullPropagation\VisualBasicUseNullPropagationCodeFixProvider.vb (2)
34Protected Overrides Function TryGetBlock(node As SyntaxNode, ByRef block As ExecutableStatementSyntax) As Boolean 42Protected Overrides Function PostProcessElseIf(ifStatement As MultiLineIfBlockSyntax, newWhenTrueStatement As ExecutableStatementSyntax) As SyntaxNode
src\Compilers\VisualBasic\BasicAnalyzerDriver\VisualBasicDeclarationComputer.vb (21)
26node As SyntaxNode, 42node As SyntaxNode, 43shouldSkip As Func(Of SyntaxNode, Integer?, Boolean), 70builder.Add(New DeclarationInfo(name, ImmutableArray(Of SyntaxNode).Empty, declaredSymbol)) 91Dim codeBlocks = SpecializedCollections.SingletonEnumerable(Of SyntaxNode)(t.Initializer).Concat(attributes) 157Dim codeBlocks = SpecializedCollections.SingletonEnumerable(Of SyntaxNode)(methodBlock). 174Private Shared Function GetAttributes(attributeStatements As SyntaxList(Of AttributesStatementSyntax)) As IEnumerable(Of SyntaxNode) 175Dim attributes = SpecializedCollections.EmptyEnumerable(Of SyntaxNode) 183Private Shared Function GetPropertyStatementCodeBlocks(propertyStatement As PropertyStatementSyntax) As IEnumerable(Of SyntaxNode) 184Dim initializer As SyntaxNode = propertyStatement.Initializer 194Private Shared Function GetMethodBaseCodeBlocks(methodBase As MethodBaseSyntax) As IEnumerable(Of SyntaxNode) 236Private Shared Function GetReturnTypeAttributes(asClause As AsClauseSyntax) As IEnumerable(Of SyntaxNode) 239SpecializedCollections.EmptyEnumerable(Of SyntaxNode)) 242Private Shared Iterator Function GetAttributes(attributeLists As SyntaxList(Of AttributeListSyntax)) As IEnumerable(Of SyntaxNode) 250Private Shared Function GetParameterListInitializersAndAttributes(parameterList As ParameterListSyntax) As IEnumerable(Of SyntaxNode) 253SpecializedCollections.EmptyEnumerable(Of SyntaxNode)) 256Private Shared Function GetParameterInitializersAndAttributes(parameter As ParameterSyntax) As IEnumerable(Of SyntaxNode) 257Return SpecializedCollections.SingletonEnumerable(Of SyntaxNode)(parameter.Default).Concat(GetAttributes(parameter.AttributeLists)) 260Private Shared Function GetInitializerNode(variableDeclarator As VariableDeclaratorSyntax) As SyntaxNode 261Dim initializer As SyntaxNode = variableDeclarator.Initializer 269Private Shared Function GetAsNewClauseInitializer(asClause As AsClauseSyntax) As SyntaxNode
src\Compilers\VisualBasic\Portable\Syntax\LambdaUtilities.vb (36)
16Public Shared Function IsLambda(node As SyntaxNode) As Boolean 43Public Shared Function IsNotLambda(node As SyntaxNode) As Boolean 50Public Shared Function GetLambda(lambdaBody As SyntaxNode) As SyntaxNode 67Public Shared Function GetCorrespondingLambdaBody(oldBody As SyntaxNode, newLambdaOrPeer As SyntaxNode) As SyntaxNode 70Dim newLambdaBody As SyntaxNode = Nothing 101Public Shared Function IsLambdaBody(node As SyntaxNode) As Boolean 102Dim body As SyntaxNode = Nothing 114Public Shared Function IsLambdaBodyStatementOrExpression(node As SyntaxNode, <Out> Optional ByRef lambdaBody As SyntaxNode = Nothing) As Boolean 220Private Shared Function IsJoinClause(node As SyntaxNode) As Boolean 268Private Shared Function GetExpressionRangeVariableLambdaBody(rangeVariable As ExpressionRangeVariableSyntax) As SyntaxNode 305Public Shared Function TryGetLambdaBodies(node As SyntaxNode, <Out> ByRef lambdaBody1 As SyntaxNode, <Out> ByRef lambdaBody2 As SyntaxNode) As Boolean 359Friend Shared Function GetLambdaBodyExpressionsAndStatements(lambdaBody As SyntaxNode) As IEnumerable(Of SyntaxNode) 437Private Shared Function GetAggregateLambdaBodyExpressions(clause As AggregateClauseSyntax) As IEnumerable(Of SyntaxNode) 438Dim result = ArrayBuilder(Of SyntaxNode).GetInstance() 458Private Shared Sub AddFirstJoinVariableRecursive(result As ArrayBuilder(Of SyntaxNode), joinClause As JoinClauseSyntax) 466Private Shared Iterator Function EnumerateExpressions(variables As SeparatedSyntaxList(Of ExpressionRangeVariableSyntax)) As IEnumerable(Of SyntaxNode) 472Private Shared Iterator Function EnumerateJoinClauseLeftExpressions(clause As JoinClauseSyntax) As IEnumerable(Of SyntaxNode) 478Private Shared Iterator Function EnumerateJoinClauseRightExpressions(clause As JoinClauseSyntax) As IEnumerable(Of SyntaxNode) 488Private Shared Function TryGetSimpleLambdaBody(node As SyntaxNode, <Out> ByRef lambdaBody As SyntaxNode) As Boolean 524Friend Shared Function IsLambdaExpressionRangeVariable(expressionRangeVariable As SyntaxNode) As Boolean 557Friend Shared Function IsLambdaCollectionRangeVariable(collectionRangeVariable As SyntaxNode) As Boolean 579Private Shared Function IsQueryStartingClause(clause As SyntaxNode) As Boolean 585Private Shared Function GetCollectionRangeVariables(clause As SyntaxNode) As SeparatedSyntaxList(Of CollectionRangeVariableSyntax) 602Friend Shared Function IsLambdaJoinCondition(joinCondition As SyntaxNode) As Boolean 610Public Shared Function AreEquivalentIgnoringLambdaBodies(oldNode As SyntaxNode, newNode As SyntaxNode) As Boolean 623Friend Shared Function IsNonUserCodeQueryLambda(syntax As SyntaxNode) As Boolean 636Friend Shared Function IsClosureScope(node As SyntaxNode) As Boolean
Structure\VisualBasicStructureHelpers.vb (9)
19Private Function GetNodeBannerText(node As SyntaxNode) As String 76Friend Sub CollectCommentsRegions(node As SyntaxNode, 92Private Function TryGetLeadingCollapsibleSpan(node As SyntaxNode, <[Out]> ByRef span As BlockSpan) As Boolean 126Private Function GetEndToken(node As SyntaxNode) As SyntaxToken 163Private Function GetHintTextEndToken(node As SyntaxNode) As SyntaxToken 186blockNode As SyntaxNode, 198blockNode As SyntaxNode, 199bannerNode As SyntaxNode, 209Private Function GetHintSpan(blockNode As SyntaxNode) As TextSpan
UseAutoProperty\VisualBasicUseAutoPropertyCodeFixProvider.vb (4)
26Protected Overrides Function GetPropertyDeclaration(node As SyntaxNode) As PropertyBlockSyntax 34Protected Overrides Function GetNodeToRemove(identifier As ModifiedIdentifierSyntax) As SyntaxNode 38Protected Overrides Function GetFormattingRules(document As Document, finalProperty As SyntaxNode) As ImmutableArray(Of AbstractFormattingRule) 57cancellationToken As CancellationToken) As Task(Of SyntaxNode)
UseNamedArguments\VisualBasicUseNamedArgumentsCodeRefactoringProvider.vb (2)
29Protected Overrides Function GetReceiver(argument As SyntaxNode) As SyntaxNode
Wrapping\SeparatedSyntaxList\AbstractVisualBasicSeparatedSyntaxListWrapper.vb (2)
11Of TListSyntax As SyntaxNode, TListItemSyntax As SyntaxNode)
Wrapping\SeparatedSyntaxList\VisualBasicArgumentWrapper.vb (3)
40Protected Overrides Function TryGetApplicableList(node As SyntaxNode) As ArgumentListSyntax 46root As SyntaxNode, position As Integer, declaration As SyntaxNode, containsSyntaxError As Boolean, listSyntax As ArgumentListSyntax) As Boolean
Wrapping\SeparatedSyntaxList\VisualBasicCollectionCreationExpressionWrapper.vb (3)
55Protected Overrides Function TryGetApplicableList(node As SyntaxNode) As CollectionInitializerSyntax 61root As SyntaxNode, position As Integer, declaration As SyntaxNode, containsSyntaxError As Boolean, listSyntax As CollectionInitializerSyntax) As Boolean
Wrapping\SeparatedSyntaxList\VisualBasicParameterWrapper.vb (3)
41Protected Overrides Function TryGetApplicableList(node As SyntaxNode) As ParameterListSyntax 46root As SyntaxNode, position As Integer, declaration As SyntaxNode,
Microsoft.CodeAnalysis.VisualBasic.Features.UnitTests (33)
EditAndContinue\BreakpointSpansTests.vb (1)
84Public Shared Iterator Function GetBreakpointSequence(root As SyntaxNode, position As Integer) As IEnumerable(Of TextSpan)
EditAndContinue\Helpers\EditingTestBase.vb (6)
233Friend Shared Function GetMethodMatch(src1 As String, src2 As String, Optional methodKind As MethodKind = MethodKind.Regular) As Match(Of SyntaxNode) 250Optional kind As MethodKind = MethodKind.Regular) As IEnumerable(Of KeyValuePair(Of SyntaxNode, SyntaxNode)) 255Public Shared Function ToMatchingPairs(match As Match(Of SyntaxNode)) As MatchingPairs 259Public Shared Function ToMatchingPairs(matches As IEnumerable(Of KeyValuePair(Of SyntaxNode, SyntaxNode))) As MatchingPairs
EditAndContinue\Helpers\VisualBasicEditAndContinueTestVerifier.vb (3)
20Public Sub New(Optional faultInjector As Action(Of SyntaxNode) = Nothing) 42Public Overrides ReadOnly Property TopSyntaxComparer As TreeComparer(Of SyntaxNode) 48Public Overrides Function GetDeclarators(method As ISymbol) As ImmutableArray(Of SyntaxNode)
EditAndContinue\StatementMatchingTests.vb (4)
74Dim knownMatches = {New KeyValuePair(Of SyntaxNode, SyntaxNode)(m1.RootNodes.First(), m2.RootNodes().First())} 1398Dim knownMatches = {New KeyValuePair(Of SyntaxNode, SyntaxNode)(b1.Statements(1), b2.Statements(0))}
EditAndContinue\SyntaxComparerTests.vb (3)
13Private Shared Function MakeLiteral(n As Integer) As SyntaxNode 132Array.Empty(Of SyntaxNode)) 137Array.Empty(Of SyntaxNode),
EditAndContinue\SyntaxUtilitiesTests.vb (4)
83Dim leftNode As SyntaxNode = Nothing 84Dim rightNodeOpt As SyntaxNode = Nothing 127Dim leftNode As SyntaxNode = Nothing 128Dim rightNodeOpt As SyntaxNode = Nothing
EditAndContinue\VisualBasicEditAndContinueAnalyzerTests.vb (1)
33Private Shared Sub TestSpans(source As String, hasLabel As Func(Of SyntaxNode, Boolean))
Utils.vb (11)
53Friend Function FindFirstNodeOfType(Of T As SyntaxNode)(node As SyntaxNode) As T 71Friend Function DigToNthNodeOfType(Of T As SyntaxNode)(node As SyntaxNode, index As Integer) As T 78Friend Function DigToFirstNodeOfType(Of T As SyntaxNode)(node As SyntaxNode) As T 85Friend Function DigToFirstNodeOfType(Of T As SyntaxNode)(syntaxTree As SyntaxTree) As T 90Friend Function DigToLastNodeOfType(Of T As SyntaxNode)(node As SyntaxNode) As T 110Friend Class TreeNodePair(Of T As SyntaxNode) 137Friend Shared Function Create(Of T As SyntaxNode)(syntaxTree As SyntaxTree, node As T) As TreeNodePair(Of T)
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (15)
Compilation\SemanticModelGetDeclaredSymbolAPITests.vb (1)
2424Dim node As SyntaxNode = Nothing
Diagnostics\GetDiagnosticsTests.vb (2)
618Dim uniqueCallbacks As New HashSet(Of SyntaxNode) 655Private Sub AnalyzeNode(node As SyntaxNode, containingSymbol As ISymbol, reportDiagnostic As Action(Of Diagnostic))
Extensions.vb (1)
21Friend Function GetDeclaredSymbolFromSyntaxNode(model As SemanticModel, node As SyntaxNode, Optional cancellationToken As CancellationToken = Nothing) As Symbol
Semantics\QueryExpressions_SemanticModel.vb (2)
1180commonSymbolInfo = semanticModel.GetSymbolInfo(DirectCast(node11, SyntaxNode)) 3388Dim commonSymbolInfo = semanticModel.GetSymbolInfo(DirectCast(node9, SyntaxNode))
Semantics\SyntaxTreeRootTests.vb (2)
36Dim root As SyntaxNode = Nothing 101tree.GetDiagnostics(DirectCast(Nothing, SyntaxNode))
SourceGeneration\GeneratorDriverTests.vb (4)
171Dim rootFromTryGetRoot As SyntaxNode = Nothing 770Public _nodes As List(Of SyntaxNode) = New List(Of SyntaxNode)() 772Public Sub OnVisitSyntaxNode(syntaxNode As SyntaxNode) Implements ISyntaxReceiver.OnVisitSyntaxNode
SourceGeneration\GeneratorDriverTests_Attributes_FullyQualifiedName.vb (2)
16Public Function ForAttributeWithSimpleName(Of T As SyntaxNode)( 25Public Function ForAttributeWithMetadataName(Of T As SyntaxNode)(
SourceGeneration\GeneratorDriverTests_Attributes_SimpleName.vb (1)
158Dim input = ctx.ForAttributeWithSimpleName(Of SyntaxNode)("XAttribute")
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (50)
SymbolsTests\AnonymousTypes\AnonymousTypesSemanticsTests.vb (39)
49Dim nodes As New List(Of SyntaxNode) 501Dim nodes As New List(Of SyntaxNode) 555Dim nodes As New List(Of SyntaxNode) 583Dim nodes As New List(Of SyntaxNode) 622Dim nodes As New List(Of SyntaxNode) 665Dim nodes As New List(Of SyntaxNode) 702Dim nodes As New List(Of SyntaxNode) 745Dim nodes As New List(Of SyntaxNode) 786Dim nodes As New List(Of SyntaxNode) 822Dim nodes As New List(Of SyntaxNode) 863Dim nodes As New List(Of SyntaxNode) 898Dim nodes As New List(Of SyntaxNode) 925Dim nodes As New List(Of SyntaxNode) 978Dim nodes As New List(Of SyntaxNode) 1001Dim nodes As New List(Of SyntaxNode) 1032Dim nodes As New List(Of SyntaxNode) 1068Dim nodes As New List(Of SyntaxNode) 1095Dim nodes As New List(Of SyntaxNode) 1124Dim nodes As New List(Of SyntaxNode) 1153Dim nodes As New List(Of SyntaxNode) 1182Dim nodes As New List(Of SyntaxNode) 1206Dim nodes As New List(Of SyntaxNode) 1235Dim nodes As New List(Of SyntaxNode) 1267Dim nodes As New List(Of SyntaxNode) 1291Dim nodes As New List(Of SyntaxNode) 1316Dim nodes As New List(Of SyntaxNode) 1342Dim nodes As New List(Of SyntaxNode) 1376Dim nodes As New List(Of SyntaxNode) 1409Dim nodes As New List(Of SyntaxNode) 1442Dim nodes As New List(Of SyntaxNode) 1469Dim nodes As New List(Of SyntaxNode) 1496Dim nodes As New List(Of SyntaxNode) 1523Dim nodes As New List(Of SyntaxNode) 1553Dim nodes As New List(Of SyntaxNode) 1580Dim nodes As New List(Of SyntaxNode) 1607Dim nodes As New List(Of SyntaxNode) 1650Dim nodes As New List(Of SyntaxNode) 1967Private Function Compile(text As XElement, ByRef tree As SyntaxTree, nodes As List(Of SyntaxNode), Optional errors As XElement = Nothing) As VisualBasicCompilation 1981Dim stack As New Stack(Of SyntaxNode)
SymbolsTests\MyBaseMyClassSemanticsTests.vb (3)
66Dim nodes As New List(Of SyntaxNode) 116Private Function Compile(text As XElement, ByRef tree As SyntaxTree, nodes As List(Of SyntaxNode), Optional errors As XElement = Nothing) As VisualBasicCompilation 130Dim stack As New Stack(Of SyntaxNode)
SymbolsTests\WithStatementSymbolsTests.vb (8)
38Dim nodes As New List(Of SyntaxNode) 87Dim nodes As New List(Of SyntaxNode) 118Dim nodes As New List(Of SyntaxNode) 153Dim nodes As New List(Of SyntaxNode) 205Dim nodes As New List(Of SyntaxNode) 251Dim nodes As New List(Of SyntaxNode) 269Private Function Compile(text As XElement, ByRef tree As SyntaxTree, nodes As List(Of SyntaxNode), Optional errors As XElement = Nothing) As VisualBasicCompilation 283Dim stack As New Stack(Of SyntaxNode)
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (84)
IncrementalParser\IncrementalParser.vb (4)
83Dim root As SyntaxNode = Nothing 2559Private Shared Function GetTokens(root As SyntaxNode) As InternalSyntax.VisualBasicSyntaxNode() 2563Private Shared Sub VerifyTokensEquivalent(rootA As SyntaxNode, rootB As SyntaxNode)
Parser\ParseDirectives.vb (2)
3155Private ReadOnly _reporter As Func(Of SyntaxNode, DiagnosticDescriptor, Diagnostic) 3157Public Sub New(descriptor As DiagnosticDescriptor, kind As SyntaxKind, reporter As Func(Of SyntaxNode, DiagnosticDescriptor, Diagnostic))
Syntax\GeneratedTests.vb (2)
104Public Overrides Function DefaultVisit(node As SyntaxNode) As SyntaxNode
Syntax\SeparatedSyntaxListTests.vb (17)
19Dim list = SyntaxFactory.SeparatedList(Of SyntaxNode)(New SyntaxNode() { 38Dim nodeD As SyntaxNode = SyntaxFactory.ParseExpression("D") 39Dim nodeE As SyntaxNode = SyntaxFactory.ParseExpression("E") 125newList = list.ReplaceRange(elementA, New SyntaxNode() {}) 129newList = list.ReplaceRange(elementB, New SyntaxNode() {}) 133newList = list.ReplaceRange(elementC, New SyntaxNode() {}) 147Assert.Throws(Of ArgumentNullException)(Function() list.AddRange(DirectCast(Nothing, IEnumerable(Of SyntaxNode)))) 149Assert.Throws(Of ArgumentNullException)(Function() list.InsertRange(0, DirectCast(Nothing, IEnumerable(Of SyntaxNode)))) 150Assert.Throws(Of ArgumentNullException)(Function() list.ReplaceRange(elementA, DirectCast(Nothing, IEnumerable(Of SyntaxNode)))) 155DoTestAddInsertRemoveReplaceOnEmptyList(SyntaxFactory.SeparatedList(Of SyntaxNode)()) 159Private Sub DoTestAddInsertRemoveReplaceOnEmptyList(list As SeparatedSyntaxList(Of SyntaxNode)) 162Dim nodeD As SyntaxNode = SyntaxFactory.ParseExpression("D") 163Dim nodeE As SyntaxNode = SyntaxFactory.ParseExpression("E") 193Assert.Throws(Of ArgumentNullException)(Function() list.AddRange(DirectCast(Nothing, IEnumerable(Of SyntaxNode)))) 195Assert.Throws(Of ArgumentNullException)(Function() list.InsertRange(0, DirectCast(Nothing, IEnumerable(Of SyntaxNode)))) 200Dim list = SyntaxFactory.SeparatedList(New SyntaxNode() {
Syntax\StatementSyntaxWalkerTests.vb (1)
115Public Overrides Sub DefaultVisit(node As SyntaxNode)
Syntax\SyntaxAnnotationTests.vb (22)
323Private Sub TestMultipleAnnotationsInTree(oldRoot As SyntaxNode, newRoot As SyntaxNode, annotations As List(Of SyntaxAnnotation)) 396Private Function CopyAnnotationsTo(sourceTreeRoot As SyntaxNode, destTreeRoot As SyntaxNode) As SyntaxNode 494Public Function Replace(Of TRoot As SyntaxNode)(root As TRoot, oldNodeOrToken As SyntaxNodeOrToken, newNodeOrToken As SyntaxNodeOrToken) As TRoot 506Private Sub TestAnnotations(annotations As List(Of Tuple(Of SyntaxAnnotation, SyntaxNodeOrToken)), currentRoot As SyntaxNode) 532Dim newRoot As SyntaxNode 547Private Sub TestAnnotation(annotation As SyntaxAnnotation, root As SyntaxNode, oldNodeOrToken As SyntaxNodeOrToken) 557Private Sub TestAnnotation(annotation As SyntaxAnnotation, root As SyntaxNode, oldNode As SyntaxNode) 570Private Sub TestAnnotation(annotation As SyntaxAnnotation, root As SyntaxNode, oldToken As SyntaxToken) 583Private Sub TestAnnotation(annotation As SyntaxAnnotation, root As SyntaxNode, oldTrivia As SyntaxTrivia) 596Private Function GetAllTrivia(root As SyntaxNode) As List(Of SyntaxTrivia) 603Private Function GetAllNodesAndTokens(root As SyntaxNode) As List(Of SyntaxNodeOrToken) 638Public Overrides Sub Visit(node As SyntaxNode) 672Public Overrides Function Visit(node As SyntaxNode) As SyntaxNode 712Public Overrides Function Visit(node As SyntaxNode) As SyntaxNode 756Public Overrides Function Visit(node As SyntaxNode) As SyntaxNode
Syntax\SyntaxListTests.vb (16)
13Dim list = SyntaxFactory.List(Of SyntaxNode)({ 32Dim nodeD As SyntaxNode = SyntaxFactory.ParseExpression("D ") 33Dim nodeE As SyntaxNode = SyntaxFactory.ParseExpression("E ") 119newList = list.ReplaceRange(elementA, New SyntaxNode() {}) 123newList = list.ReplaceRange(elementB, New SyntaxNode() {}) 127newList = list.ReplaceRange(elementC, New SyntaxNode() {}) 141Assert.Throws(Of ArgumentNullException)(Function() list.AddRange(DirectCast(Nothing, IEnumerable(Of SyntaxNode)))) 143Assert.Throws(Of ArgumentNullException)(Function() list.InsertRange(0, DirectCast(Nothing, IEnumerable(Of SyntaxNode)))) 144Assert.Throws(Of ArgumentNullException)(Function() list.ReplaceRange(elementA, DirectCast(Nothing, IEnumerable(Of SyntaxNode)))) 149DoTestAddInsertRemoveReplaceOnEmptyList(SyntaxFactory.List(Of SyntaxNode)()) 153Private Sub DoTestAddInsertRemoveReplaceOnEmptyList(list As SyntaxList(Of SyntaxNode)) 156Dim nodeD As SyntaxNode = SyntaxFactory.ParseExpression("D ") 157Dim nodeE As SyntaxNode = SyntaxFactory.ParseExpression("E ") 187Assert.Throws(Of ArgumentNullException)(Function() list.AddRange(DirectCast(Nothing, IEnumerable(Of SyntaxNode)))) 189Assert.Throws(Of ArgumentNullException)(Function() list.InsertRange(0, DirectCast(Nothing, IEnumerable(Of SyntaxNode)))) 194Dim list = SyntaxFactory.List(Of SyntaxNode)(
Syntax\SyntaxRewriterTests.vb (10)
552Dim newRoot = root.ReplaceNode(invocation.ArgumentList.Arguments(0), New SyntaxNode() {argC, argD}) 573Dim newNode = invocation.InsertNodesBefore(invocation.ArgumentList.Arguments(0), New SyntaxNode() {argC, argD}) 580Dim newNode2 = invocation.InsertNodesAfter(invocation.ArgumentList.Arguments(0), New SyntaxNode() {argC, argD}) 713Public Overrides Function VisitRegionDirectiveTrivia(node As RegionDirectiveTriviaSyntax) As SyntaxNode 814Private ReadOnly _rewriteNode As Func(Of SyntaxNode, SyntaxNode) 819Optional rewriteNode As Func(Of SyntaxNode, SyntaxNode) = Nothing, 827Public Overrides Function Visit(node As SyntaxNode) As SyntaxNode
TestSyntaxNodes.vb (10)
323Private Sub VerifyAllSpans(tree As SyntaxNode) 1153Public Overrides Function VisitMethodStatement(node As MethodStatementSyntax) As SyntaxNode 1308newNode = invocation.ReplaceNode(invocation.ArgumentList.Arguments(0), New SyntaxNode() {}) 1312newNode = invocation.ReplaceNode(invocation.ArgumentList.Arguments(1), New SyntaxNode() {}) 1401newBlock = ifBlock.ReplaceNode(ifBlock.Statements(0), New SyntaxNode() {}) 1408newBlock = ifBlock.ReplaceNode(ifBlock.Statements(1), New SyntaxNode() {}) 1734Dim node As SyntaxNode = tree.GetRoot() 1764Dim node As SyntaxNode = tree.GetRoot() 2334Private Sub CheckFindToken(node As SyntaxNode) 2929Dim x As New SyntaxList(Of SyntaxNode)
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (58)
BasicTestBase.vb (32)
693Public Overrides Sub DefaultVisit(node As SyntaxNode) 704Public Shared Function FindNames(node As SyntaxNode) As List(Of NameSyntax) 718Public Overrides Sub DefaultVisit(node As SyntaxNode) 729Public Shared Function FindExpression(node As SyntaxNode) As List(Of ExpressionSyntax) 743Public Overrides Sub DefaultVisit(node As SyntaxNode) 751Private ReadOnly _nodes As New List(Of SyntaxNode) 754Public Shared Function FindNodes(Of T As SyntaxNode)(node As SyntaxNode, ParamArray kinds() As SyntaxKind) As List(Of T) 758Public Shared Function FindNodes(node As SyntaxNode, ParamArray kinds() As SyntaxKind) As List(Of SyntaxNode) 782Friend Shared Function GetOperationTreeForTest(Of TSyntaxNode As SyntaxNode)(compilation As VisualBasicCompilation, fileName As String, Optional which As Integer = 0) As (tree As String, syntax As SyntaxNode, operation As IOperation) 783Dim node As SyntaxNode = CompilationUtils.FindBindingText(Of TSyntaxNode)(compilation, fileName, which, prefixMatch:=True) 799Friend Shared Function GetOperationTreeForTest(Of TSyntaxNode As SyntaxNode)( 804Optional useLatestFrameworkReferences As Boolean = False) As (tree As String, syntax As SyntaxNode, operation As IOperation, compilation As Compilation) 815Friend Shared Sub VerifyOperationTreeForTest(Of TSyntaxNode As SyntaxNode)(compilation As VisualBasicCompilation, fileName As String, expectedOperationTree As String, Optional which As Integer = 0, Optional additionalOperationTreeVerifier As Action(Of IOperation, Compilation, SyntaxNode) = Nothing) 823Protected Shared Sub VerifyFlowGraphForTest(Of TSyntaxNode As SyntaxNode)(compilation As VisualBasicCompilation, expectedFlowGraph As String, Optional which As Integer = 0) 825Dim syntaxNode As SyntaxNode = CompilationUtils.FindBindingText(Of TSyntaxNode)(compilation, tree.FilePath, which, prefixMatch:=True) 829Protected Shared Sub VerifyFlowGraph(compilation As VisualBasicCompilation, syntaxNode As SyntaxNode, expectedFlowGraph As String) 835Friend Shared Sub VerifyOperationTreeForTest(Of TSyntaxNode As SyntaxNode)( 841Optional additionalOperationTreeVerifier As Action(Of IOperation, Compilation, SyntaxNode) = Nothing, 851Friend Shared Sub VerifyNoOperationTreeForTest(Of TSyntaxNode As SyntaxNode)( 862Friend Shared Sub VerifyOperationTreeAndDiagnosticsForTest(Of TSyntaxNode As SyntaxNode)(compilation As VisualBasicCompilation, fileName As String, expectedOperationTree As String, expectedDiagnostics As String, Optional which As Integer = 0, Optional additionalOperationTreeVerifier As Action(Of IOperation, Compilation, SyntaxNode) = Nothing) 867Friend Shared Sub VerifyFlowGraphAndDiagnosticsForTest(Of TSyntaxNode As SyntaxNode)(compilation As VisualBasicCompilation, expectedFlowGraph As String, expectedDiagnostics As String, Optional which As Integer = 0) 872Friend Shared Sub VerifyOperationTreeAndDiagnosticsForTest(Of TSyntaxNode As SyntaxNode)( 880Optional additionalOperationTreeVerifier As Action(Of IOperation, Compilation, SyntaxNode) = Nothing, 893Friend Shared Sub VerifyFlowGraphAndDiagnosticsForTest(Of TSyntaxNode As SyntaxNode)( 916Friend Shared Function GetOperationAndSyntaxForTest(Of TSyntaxNode As SyntaxNode)(compilation As Compilation, fileName As String, Optional which As Integer = 0) As (operation As IOperation, syntaxNode As SyntaxNode) 917Dim node As SyntaxNode = CompilationUtils.FindBindingText(Of TSyntaxNode)(compilation, fileName, which, prefixMatch:=True)
CompilationTestUtils.vb (9)
424Public Function FindBindingText(Of TNode As SyntaxNode)(compilation As Compilation, Optional fileName As String = Nothing, Optional which As Integer = 0, Optional prefixMatch As Boolean = False) As TNode 432Dim hasMatchingText As Func(Of SyntaxNode, Boolean) = Function(n) n.ToString = bindText OrElse 504Public Function FindBindingStartText(Of TNode As SyntaxNode)(compilation As Compilation, fileName As String, Optional which As Integer = 0) As TNode 537Public Function GetSemanticInfoSummary(model As SemanticModel, node As SyntaxNode) As SemanticInfoSummary 605Public Function GetSemanticInfoSummary(compilation As Compilation, node As SyntaxNode) As SemanticInfoSummary 611Public Function GetSemanticInfoSummary(Of TSyntax As SyntaxNode)(compilation As Compilation, fileName As String, Optional which As Integer = 0) As SemanticInfoSummary 673Public Function FindNodeFromText(tree As SyntaxTree, textToFind As String) As SyntaxNode 678Public Function FindNodeOfTypeFromText(Of TNode As SyntaxNode)(tree As SyntaxTree, textToFind As String) As TNode 1133Dim node As SyntaxNode
LocalVariableDeclaratorsCollector.vb (4)
11Private ReadOnly _builder As ArrayBuilder(Of SyntaxNode) 13Public Sub New(builder As ArrayBuilder(Of SyntaxNode)) 17Friend Shared Function GetDeclarators(method As SourceMethodSymbol) As ImmutableArray(Of SyntaxNode) 18Dim builder = ArrayBuilder(Of SyntaxNode).GetInstance()
MockSymbols.vb (1)
636Friend Overrides ReadOnly Property Syntax As SyntaxNode
ParserTestUtilities.vb (5)
364Public Function VerifyNoWhitespaceInKeywords(node As SyntaxNode) As SyntaxNode 478Public Function GetSyntaxErrorsNoTree(n As SyntaxNode) As IEnumerable(Of Diagnostic) 489Public Overrides Function GetReference(node As SyntaxNode) As SyntaxReference 549Public Overrides Function WithRootAndOptions(root As SyntaxNode, options As ParseOptions) As SyntaxTree
SemanticModelTestBase.vb (5)
28Protected Function FindBindingText(Of TNode As SyntaxNode)(compilation As Compilation, fileName As String, Optional which As Integer = 0) As TNode 69Protected Function FindBindingStartText(Of TNode As SyntaxNode)(compilation As Compilation, fileName As String, Optional which As Integer = 0) As TNode 88Protected Function GetStartSpanErrorMessage(syntax As SyntaxNode, tpSymbol As ISymbol) As String 101Protected Function GetBlockOrStatementInfoForTest(Of StmtSyntax As SyntaxNode)(compilation As Compilation, fileName As String, Optional which As Integer = 0, Optional useParent As Boolean = False) As Object 102Dim node As SyntaxNode = CompilationUtils.FindBindingText(Of StmtSyntax)(compilation, fileName, which)
SyntaxTreeExtensions.vb (2)
61Friend Function Dump(node As SyntaxNode) As String 86Public Overrides Sub DefaultVisit(node As SyntaxNode)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (1688)
CaseCorrection\VisualBasicCaseCorrectionService.Rewriter.vb (2)
112For Each param As SyntaxNode In methodDeclaration.ParameterList.Parameters 172Private Function GetAliasOrAnySymbol(model As SemanticModel, node As SyntaxNode, cancellationToken As CancellationToken) As ISymbol
CaseCorrection\VisualBasicCaseCorrectionService.vb (2)
28root As SyntaxNode, 38root As SyntaxNode,
Classification\ClassificationHelpers.vb (1)
276Private Function TryClassifyModifiedIdentifer(node As SyntaxNode, identifier As SyntaxToken, ByRef classification As String) As Boolean
Classification\SyntaxClassification\IdentifierNameSyntaxClassifier.vb (1)
21Public Overrides Sub AddClassifications(syntax As SyntaxNode, textSpan As TextSpan, semanticModel As SemanticModel, options As ClassificationOptions, result As SegmentedList(Of ClassifiedSpan), cancellationToken As CancellationToken)
Classification\SyntaxClassification\ImportAliasClauseSyntaxClassifier.vb (1)
20Public Overrides Sub AddClassifications(syntax As SyntaxNode, textSpan As TextSpan, semanticModel As SemanticModel, options As ClassificationOptions, result As SegmentedList(Of ClassifiedSpan), cancellationToken As CancellationToken)
Classification\SyntaxClassification\NameSyntaxClassifier.vb (2)
31syntax As SyntaxNode, 63Protected Overrides Function IsParentAnAttribute(node As SyntaxNode) As Boolean
Classification\SyntaxClassification\OperatorOverloadSyntaxClassifier.vb (2)
23syntax As SyntaxNode, 48Private Shared Function GetOperatorTokenSpan(syntax As SyntaxNode) As TextSpan
Classification\SyntaxClassification\VisualBasicSyntaxClassificationService.vb (1)
39Public Overrides Sub AddSyntacticClassifications(root As SyntaxNode, textSpans As ImmutableArray(Of TextSpan), result As SegmentedList(Of ClassifiedSpan), cancellationToken As CancellationToken)
Classification\Worker.vb (5)
38node As SyntaxNode, textSpan As TextSpan, list As SegmentedList(Of ClassifiedSpan), cancellationToken As CancellationToken) 59Friend Sub ClassifyNode(node As SyntaxNode) 71Private Shared Function IsXmlNode(node As SyntaxNode) As Boolean 78Private Sub ClassifyXmlNode(node As SyntaxNode) 182Private Sub ClassifyDirectiveSyntax(directiveSyntax As SyntaxNode)
Classification\Worker.XmlClassifier.vb (1)
26Friend Sub ClassifyNode(node As SyntaxNode)
CodeCleanup\Providers\AbstractTokensCodeCleanupProvider.vb (6)
20document As Document, root As SyntaxNode, spans As ImmutableArray(Of TextSpan), cancellationToken As CancellationToken) As Task(Of Rewriter) 30Public Async Function CleanupAsync(root As SyntaxNode, spans As ImmutableArray(Of TextSpan), options As SyntaxFormattingOptions, services As SolutionServices, cancellationToken As CancellationToken) As Task(Of SyntaxNode) Implements ICodeCleanupProvider.CleanupAsync 53Protected Function ShouldRewrite(node As SyntaxNode) As Boolean 60Public Overrides Function Visit(node As SyntaxNode) As SyntaxNode
CodeCleanup\Providers\AddMissingTokensCodeCleanupProvider.vb (41)
29Protected Overrides Async Function GetRewriterAsync(document As Document, root As SyntaxNode, spans As ImmutableArray(Of TextSpan), cancellationToken As CancellationToken) As Task(Of Rewriter) 52Public Overrides Function Visit(node As SyntaxNode) As SyntaxNode 60Private Function VisitExpression(node As ExpressionSyntax) As SyntaxNode 136Public Overrides Function VisitInvocationExpression(node As InvocationExpressionSyntax) As SyntaxNode 157Public Overrides Function VisitRaiseEventStatement(node As RaiseEventStatementSyntax) As SyntaxNode 162Public Overrides Function VisitMethodStatement(node As MethodStatementSyntax) As SyntaxNode 167Public Overrides Function VisitSubNewStatement(node As SubNewStatementSyntax) As SyntaxNode 171Public Overrides Function VisitDeclareStatement(node As DeclareStatementSyntax) As SyntaxNode 175Public Overrides Function VisitDelegateStatement(node As DelegateStatementSyntax) As SyntaxNode 179Public Overrides Function VisitEventStatement(node As EventStatementSyntax) As SyntaxNode 187Public Overrides Function VisitAccessorStatement(node As AccessorStatementSyntax) As SyntaxNode 198Public Overrides Function VisitAttribute(node As AttributeSyntax) As SyntaxNode 203Public Overrides Function VisitOperatorStatement(node As OperatorStatementSyntax) As SyntaxNode 209Public Overrides Function VisitPropertyStatement(node As PropertyStatementSyntax) As SyntaxNode 215Public Overrides Function VisitLambdaHeader(node As LambdaHeaderSyntax) As SyntaxNode 221Private Shared Function TryFixupTrivia(Of T As SyntaxNode)(node As T, previousToken As SyntaxToken, lastToken As SyntaxToken, ByRef newNode As T) As Boolean 260Private Function AddParameterListTransform(Of T As MethodBaseSyntax)(node As T, newNode As SyntaxNode, nameChecker As Func(Of T, Boolean)) As T 288Private Function AddParenthesesTransform(Of T As SyntaxNode)( 290node As SyntaxNode, 292listGetter As Func(Of T, SyntaxNode), 324Private Function AddParenthesesTransform(Of T As SyntaxNode)( 326node As SyntaxNode, 328listGetter As Func(Of T, SyntaxNode), 363Private Shared Function CheckSkippedTriviaForMissingToken(node As SyntaxNode, ParamArray kinds As SyntaxKind()) As Boolean 376Public Overrides Function VisitIfStatement(node As IfStatementSyntax) As SyntaxNode 380Public Overrides Function VisitIfDirectiveTrivia(node As IfDirectiveTriviaSyntax) As SyntaxNode 384Public Overrides Function VisitElseIfStatement(node As ElseIfStatementSyntax) As SyntaxNode 388Public Overrides Function VisitTypeArgumentList(node As TypeArgumentListSyntax) As SyntaxNode 392Public Overrides Function VisitTypeParameterList(node As TypeParameterListSyntax) As SyntaxNode 396Public Overrides Function VisitContinueStatement(node As ContinueStatementSyntax) As SyntaxNode 400Public Overrides Function VisitOptionStatement(node As OptionStatementSyntax) As SyntaxNode 411Public Overrides Function VisitSelectStatement(node As SelectStatementSyntax) As SyntaxNode 418Private Function AddMissingOrOmittedTokenTransform(Of T As SyntaxNode)( 419originalNode As T, node As SyntaxNode, tokenGetter As Func(Of T, SyntaxToken), ParamArray kinds As SyntaxKind()) As T 445Private Function ProcessToken(originalToken As SyntaxToken, token As SyntaxToken, parent As SyntaxNode) As SyntaxToken 467Private Shared Function ReplaceOrSetToken(Of T As SyntaxNode)(originalParent As T, tokenToFix As SyntaxToken, replacementToken As SyntaxToken) As T 475Private Shared Function SetOmittedToken(originalParent As SyntaxNode, newToken As SyntaxToken) As SyntaxNode 525Private Shared Function ProcessOmittedToken(originalToken As SyntaxToken, token As SyntaxToken, parent As SyntaxNode) As SyntaxToken 566Private Shared Function Exist(node As SyntaxNode) As Boolean
CodeCleanup\Providers\CaseCorrectionCodeCleanupProvider.vb (2)
35Public Function CleanupAsync(root As SyntaxNode, spans As ImmutableArray(Of TextSpan), options As SyntaxFormattingOptions, services As SolutionServices, cancellationToken As CancellationToken) As Task(Of SyntaxNode) Implements ICodeCleanupProvider.CleanupAsync
CodeCleanup\Providers\FixIncorrectTokensCodeCleanupProvider.vb (6)
38Protected Overrides Function GetRewriterAsync(document As Document, root As SyntaxNode, spans As ImmutableArray(Of TextSpan), cancellationToken As CancellationToken) As Task(Of Rewriter) 79Public Overrides Function VisitIdentifierName(node As IdentifierNameSyntax) As SyntaxNode 148Public Overrides Function VisitEndBlockStatement(node As EndBlockStatementSyntax) As SyntaxNode 156Public Overrides Function VisitEndIfDirectiveTrivia(node As EndIfDirectiveTriviaSyntax) As SyntaxNode 177Private Shared Function RewriteEndIfStatementOrDirectiveSyntax(curNode As SyntaxNode, curEndKeyword As SyntaxToken, curIfKeyword As SyntaxToken) As SyntaxNode
CodeCleanup\Providers\NormalizeModifiersOrOperatorsCodeCleanupProvider.vb (28)
42Public Function CleanupAsync(root As SyntaxNode, spans As ImmutableArray(Of TextSpan), options As SyntaxFormattingOptions, services As SolutionServices, cancellationToken As CancellationToken) As Task(Of SyntaxNode) Implements ICodeCleanupProvider.CleanupAsync 88Public Overrides Function Visit(node As SyntaxNode) As SyntaxNode 101Public Overrides Function VisitModuleStatement(node As ModuleStatementSyntax) As SyntaxNode 105Public Overrides Function VisitStructureStatement(node As StructureStatementSyntax) As SyntaxNode 109Public Overrides Function VisitInterfaceStatement(node As InterfaceStatementSyntax) As SyntaxNode 113Public Overrides Function VisitClassStatement(node As ClassStatementSyntax) As SyntaxNode 117Public Overrides Function VisitEnumStatement(node As EnumStatementSyntax) As SyntaxNode 121Public Overrides Function VisitMethodStatement(node As MethodStatementSyntax) As SyntaxNode 125Public Overrides Function VisitSubNewStatement(node As SubNewStatementSyntax) As SyntaxNode 129Public Overrides Function VisitDeclareStatement(node As DeclareStatementSyntax) As SyntaxNode 133Public Overrides Function VisitDelegateStatement(node As DelegateStatementSyntax) As SyntaxNode 137Public Overrides Function VisitEventStatement(node As EventStatementSyntax) As SyntaxNode 141Public Overrides Function VisitPropertyStatement(node As PropertyStatementSyntax) As SyntaxNode 145Public Overrides Function VisitAccessorStatement(node As AccessorStatementSyntax) As SyntaxNode 149Public Overrides Function VisitIncompleteMember(node As IncompleteMemberSyntax) As SyntaxNode 154Public Overrides Function VisitFieldDeclaration(node As FieldDeclarationSyntax) As SyntaxNode 158Public Overrides Function VisitLocalDeclarationStatement(node As LocalDeclarationStatementSyntax) As SyntaxNode 162Public Overrides Function VisitParameterList(node As ParameterListSyntax) As SyntaxNode 194Public Overrides Function VisitLambdaHeader(node As LambdaHeaderSyntax) As SyntaxNode 199Public Overrides Function VisitOperatorStatement(node As OperatorStatementSyntax) As SyntaxNode 233Public Overrides Function VisitBinaryExpression(node As BinaryExpressionSyntax) As SyntaxNode 438Private Function NormalizeModifiers(Of T As SyntaxNode)(originalNode As T, node As SyntaxNode, modifiersGetter As Func(Of T, SyntaxTokenList), withModifiers As Func(Of T, SyntaxTokenList, T)) As T 445Private Function NormalizeModifiers(Of T As SyntaxNode)(originalNode As T, node As T, modifiersGetter As Func(Of T, SyntaxTokenList), withModifiers As Func(Of T, SyntaxTokenList, T)) As T 485Private Shared Function RemoveDimKeyword(Of T As SyntaxNode)(node As T, modifiersGetter As Func(Of T, SyntaxTokenList)) As T 492Private Shared Function RemoveModifierKeyword(Of T As SyntaxNode)(node As T, modifiersGetter As Func(Of T, SyntaxTokenList), modifierKind As SyntaxKind) As T
CodeCleanup\Providers\ReduceTokensCodeCleanupProvider.vb (2)
33Protected Overrides Function GetRewriterAsync(document As Document, root As SyntaxNode, spans As ImmutableArray(Of TextSpan), cancellationToken As CancellationToken) As Task(Of Rewriter) 44Public Overrides Function VisitLiteralExpression(node As LiteralExpressionSyntax) As SyntaxNode
CodeCleanup\Providers\RemoveUnnecessaryLineContinuationCodeCleanupProvider.vb (8)
45Public Function CleanupAsync(root As SyntaxNode, spans As ImmutableArray(Of TextSpan), options As SyntaxFormattingOptions, services As SolutionServices, cancellationToken As CancellationToken) As Task(Of SyntaxNode) Implements ICodeCleanupProvider.CleanupAsync 54Private ReadOnly _root As SyntaxNode 57Public Shared Function Process(root As SyntaxNode, spans As ImmutableArray(Of TextSpan), cancellationToken As CancellationToken) As SyntaxNode 62Private Sub New(root As SyntaxNode, spans As ImmutableArray(Of TextSpan)) 67Private Function [Do](cancellationToken As CancellationToken) As SyntaxNode 102Private Sub Cleanup(root As SyntaxNode, span As TextSpan, cancellationToken As CancellationToken)
CodeCleanup\VisualBasicCodeCleanerService.vb (5)
31Protected Overrides Function GetSpansToAvoid(root As SyntaxNode) As ImmutableArray(Of TextSpan) 46Private Shared Sub ProcessNode(node As SyntaxNode, result As ArrayBuilder(Of TextSpan)) 89Private Shared Function ContainsMultiLineStringLiteral(node As SyntaxNode) As Boolean 101Private Shared Function GetMultiLineContainer(node As SyntaxNode) As SyntaxNode
CodeGeneration\VisualBasicSyntaxGenerator.vb (643)
36Friend Overrides Function SeparatedList(Of TElement As SyntaxNode)(list As SyntaxNodeOrTokenList) As SeparatedSyntaxList(Of TElement) 48Friend Overrides Function SeparatedList(Of TElement As SyntaxNode)(nodes As IEnumerable(Of TElement), separators As IEnumerable(Of SyntaxToken)) As SeparatedSyntaxList(Of TElement) 52Friend Overrides Function Trivia(node As SyntaxNode) As SyntaxTrivia 61Friend Overrides Function DocumentationCommentTrivia(nodes As IEnumerable(Of SyntaxNode), trailingTrivia As SyntaxTriviaList, endOfLineString As String) As SyntaxNode 69Friend Overrides Function DocumentationCommentTriviaWithUpdatedContent(trivia As SyntaxTrivia, content As IEnumerable(Of SyntaxNode)) As SyntaxNode 80Public Overrides Function AddEventHandler([event] As SyntaxNode, handler As SyntaxNode) As SyntaxNode 84Public Overrides Function RemoveEventHandler([event] As SyntaxNode, handler As SyntaxNode) As SyntaxNode 88Public Overrides Function AwaitExpression(expression As SyntaxNode) As SyntaxNode 92Public Overrides Function NameOfExpression(expression As SyntaxNode) As SyntaxNode 96Public Overrides Function TupleExpression(arguments As IEnumerable(Of SyntaxNode)) As SyntaxNode 100Private Shared Function Parenthesize(expression As SyntaxNode, Optional addSimplifierAnnotation As Boolean = True) As ParenthesizedExpressionSyntax 104Public Overrides Function AddExpression(left As SyntaxNode, right As SyntaxNode) As SyntaxNode 108Public Overloads Overrides Function Argument(name As String, refKind As RefKind, expression As SyntaxNode) As SyntaxNode 116Public Overrides Function TryCastExpression(expression As SyntaxNode, type As SyntaxNode) As SyntaxNode 120Public Overrides Function AssignmentStatement(left As SyntaxNode, right As SyntaxNode) As SyntaxNode 127Public Overrides Function BaseExpression() As SyntaxNode 131Public Overrides Function BitwiseAndExpression(left As SyntaxNode, right As SyntaxNode) As SyntaxNode 135Public Overrides Function BitwiseOrExpression(left As SyntaxNode, right As SyntaxNode) As SyntaxNode 139Public Overrides Function CastExpression(type As SyntaxNode, expression As SyntaxNode) As SyntaxNode 143Public Overrides Function ConvertExpression(type As SyntaxNode, expression As SyntaxNode) As SyntaxNode 147Public Overrides Function ConditionalExpression(condition As SyntaxNode, whenTrue As SyntaxNode, whenFalse As SyntaxNode) As SyntaxNode 154Public Overrides Function TypedConstantExpression(value As TypedConstant) As SyntaxNode 158Private Protected Overrides Function GenerateExpression(type As ITypeSymbol, value As Object, canUseFieldReference As Boolean) As SyntaxNode 166Public Overrides Function DefaultExpression(type As ITypeSymbol) As SyntaxNode 170Public Overrides Function DefaultExpression(type As SyntaxNode) As SyntaxNode 174Public Overloads Overrides Function ElementAccessExpression(expression As SyntaxNode, arguments As IEnumerable(Of SyntaxNode)) As SyntaxNode 178Public Overrides Function ExpressionStatement(expression As SyntaxNode) As SyntaxNode 186Public Overloads Overrides Function GenericName(identifier As String, typeArguments As IEnumerable(Of SyntaxNode)) As SyntaxNode 190Friend Overrides Function GenericName(identifier As SyntaxToken, typeArguments As IEnumerable(Of SyntaxNode)) As SyntaxNode 197Public Overrides Function IdentifierName(identifier As String) As SyntaxNode 201Public Overrides Function IfStatement(condition As SyntaxNode, trueStatements As IEnumerable(Of SyntaxNode), Optional falseStatements As IEnumerable(Of SyntaxNode) = Nothing) As SyntaxNode 244Private Shared Function GetStatementList(nodes As IEnumerable(Of SyntaxNode)) As SyntaxList(Of StatementSyntax) 248Private Shared Function AsStatement(node As SyntaxNode) As StatementSyntax 252Public Overloads Overrides Function InvocationExpression(expression As SyntaxNode, arguments As IEnumerable(Of SyntaxNode)) As SyntaxNode 256Public Overrides Function IsTypeExpression(expression As SyntaxNode, type As SyntaxNode) As SyntaxNode 260Public Overrides Function TypeOfExpression(type As SyntaxNode) As SyntaxNode 264Public Overrides Function LogicalAndExpression(left As SyntaxNode, right As SyntaxNode) As SyntaxNode 268Public Overrides Function LogicalNotExpression(expression As SyntaxNode) As SyntaxNode 272Public Overrides Function LogicalOrExpression(left As SyntaxNode, right As SyntaxNode) As SyntaxNode 276Friend Overrides Function MemberAccessExpressionWorker(expression As SyntaxNode, simpleName As SyntaxNode) As SyntaxNode 283Public Overrides Function ConditionalAccessExpression(expression As SyntaxNode, whenNotNull As SyntaxNode) As SyntaxNode 287Public Overrides Function MemberBindingExpression(name As SyntaxNode) As SyntaxNode 291Public Overrides Function ElementBindingExpression(arguments As IEnumerable(Of SyntaxNode)) As SyntaxNode 297Private Shared Function ParenthesizeLeft(expression As SyntaxNode) As ExpressionSyntax 310Public Overrides Function MultiplyExpression(left As SyntaxNode, right As SyntaxNode) As SyntaxNode 314Public Overrides Function NegateExpression(expression As SyntaxNode) As SyntaxNode 318Private Shared Function AsExpressionList(expressions As IEnumerable(Of SyntaxNode)) As SeparatedSyntaxList(Of ExpressionSyntax) 322Public Overrides Function ArrayCreationExpression(elementType As SyntaxNode, size As SyntaxNode) As SyntaxNode 328Public Overrides Function ArrayCreationExpression(elementType As SyntaxNode, elements As IEnumerable(Of SyntaxNode)) As SyntaxNode 334Public Overloads Overrides Function ObjectCreationExpression(typeName As SyntaxNode, arguments As IEnumerable(Of SyntaxNode)) As SyntaxNode 342Friend Overrides Function ObjectCreationExpression(typeName As SyntaxNode, openParen As SyntaxToken, arguments As SeparatedSyntaxList(Of SyntaxNode), closeParen As SyntaxToken) As SyntaxNode 350Public Overrides Function QualifiedName(left As SyntaxNode, right As SyntaxNode) As SyntaxNode 354Friend Overrides Function GlobalAliasedName(name As SyntaxNode) As SyntaxNode 358Public Overrides Function ReferenceEqualsExpression(left As SyntaxNode, right As SyntaxNode) As SyntaxNode 362Public Overrides Function ReferenceNotEqualsExpression(left As SyntaxNode, right As SyntaxNode) As SyntaxNode 366Public Overrides Function ReturnStatement(Optional expressionOpt As SyntaxNode = Nothing) As SyntaxNode 370Public Overrides Function ThisExpression() As SyntaxNode 374Public Overrides Function ThrowStatement(Optional expressionOpt As SyntaxNode = Nothing) As SyntaxNode 378Public Overrides Function ThrowExpression(expression As SyntaxNode) As SyntaxNode 382Public Overrides Function NameExpression(namespaceOrTypeSymbol As INamespaceOrTypeSymbol) As SyntaxNode 386Private Protected Overrides Function TypeExpression(typeSymbol As ITypeSymbol, refKind As RefKind) As SyntaxNode 391Public Overrides Function TypeExpression(specialType As SpecialType) As SyntaxNode 430Public Overloads Overrides Function UsingStatement(type As SyntaxNode, identifier As String, expression As SyntaxNode, statements As IEnumerable(Of SyntaxNode)) As SyntaxNode 438Public Overloads Overrides Function UsingStatement(expression As SyntaxNode, statements As IEnumerable(Of SyntaxNode)) As SyntaxNode 446Public Overrides Function LockStatement(expression As SyntaxNode, statements As IEnumerable(Of SyntaxNode)) As SyntaxNode 453Public Overrides Function ValueEqualsExpression(left As SyntaxNode, right As SyntaxNode) As SyntaxNode 457Public Overrides Function ValueNotEqualsExpression(left As SyntaxNode, right As SyntaxNode) As SyntaxNode 461Private Function CreateArgumentList(arguments As IEnumerable(Of SyntaxNode)) As ArgumentListSyntax 465Private Function CreateArguments(arguments As IEnumerable(Of SyntaxNode)) As SeparatedSyntaxList(Of ArgumentSyntax) 469Private Function AsArgument(argOrExpression As SyntaxNode) As ArgumentSyntax 474Private Function AsSimpleArgument(argOrExpression As SyntaxNode) As SimpleArgumentSyntax 479Public Overloads Overrides Function LocalDeclarationStatement(type As SyntaxNode, identifier As String, Optional initializer As SyntaxNode = Nothing, Optional isConst As Boolean = False) As SyntaxNode 483Public Overloads Overrides Function SwitchStatement(expression As SyntaxNode, caseClauses As IEnumerable(Of SyntaxNode)) As SyntaxNode 489Public Overloads Overrides Function SwitchSection(expressions As IEnumerable(Of SyntaxNode), statements As IEnumerable(Of SyntaxNode)) As SyntaxNode 495Friend Overrides Function SwitchSectionFromLabels(labels As IEnumerable(Of SyntaxNode), statements As IEnumerable(Of SyntaxNode)) As SyntaxNode 501Public Overrides Function DefaultSwitchSection(statements As IEnumerable(Of SyntaxNode)) As SyntaxNode 507Private Shared Function GetCaseClauses(expressions As IEnumerable(Of SyntaxNode)) As SeparatedSyntaxList(Of CaseClauseSyntax) 517Public Overrides Function ExitSwitchStatement() As SyntaxNode 521Public Overloads Overrides Function ValueReturningLambdaExpression(parameters As IEnumerable(Of SyntaxNode), expression As SyntaxNode) As SyntaxNode 527Public Overrides Function VoidReturningLambdaExpression(lambdaParameters As IEnumerable(Of SyntaxNode), expression As SyntaxNode) As SyntaxNode 533Public Overloads Overrides Function ValueReturningLambdaExpression(lambdaParameters As IEnumerable(Of SyntaxNode), statements As IEnumerable(Of SyntaxNode)) As SyntaxNode 540Public Overrides Function VoidReturningLambdaExpression(lambdaParameters As IEnumerable(Of SyntaxNode), statements As IEnumerable(Of SyntaxNode)) As SyntaxNode 547Public Overrides Function LambdaParameter(identifier As String, Optional type As SyntaxNode = Nothing) As SyntaxNode 551Public Overrides Function ArrayTypeExpression(type As SyntaxNode) As SyntaxNode 560Public Overrides Function NullableTypeExpression(type As SyntaxNode) As SyntaxNode 569Friend Overrides Function CreateTupleType(elements As IEnumerable(Of SyntaxNode)) As SyntaxNode 573Public Overrides Function TupleElementExpression(type As SyntaxNode, Optional name As String = Nothing) As SyntaxNode 581Public Overrides Function WithTypeArguments(name As SyntaxNode, typeArguments As IEnumerable(Of SyntaxNode)) As SyntaxNode 596Public Overrides Function SubtractExpression(left As SyntaxNode, right As SyntaxNode) As SyntaxNode 600Public Overrides Function DivideExpression(left As SyntaxNode, right As SyntaxNode) As SyntaxNode 604Public Overrides Function ModuloExpression(left As SyntaxNode, right As SyntaxNode) As SyntaxNode 608Public Overrides Function BitwiseNotExpression(operand As SyntaxNode) As SyntaxNode 612Public Overrides Function CoalesceExpression(left As SyntaxNode, right As SyntaxNode) As SyntaxNode 616Public Overrides Function LessThanExpression(left As SyntaxNode, right As SyntaxNode) As SyntaxNode 620Public Overrides Function LessThanOrEqualExpression(left As SyntaxNode, right As SyntaxNode) As SyntaxNode 624Public Overrides Function GreaterThanExpression(left As SyntaxNode, right As SyntaxNode) As SyntaxNode 628Public Overrides Function GreaterThanOrEqualExpression(left As SyntaxNode, right As SyntaxNode) As SyntaxNode 632Public Overrides Function TryCatchStatement(tryStatements As IEnumerable(Of SyntaxNode), catchClauses As IEnumerable(Of SyntaxNode), Optional finallyStatements As IEnumerable(Of SyntaxNode) = Nothing) As SyntaxNode 640Public Overrides Function CatchClause(type As SyntaxNode, identifier As String, statements As IEnumerable(Of SyntaxNode)) As SyntaxNode 651Public Overrides Function WhileStatement(condition As SyntaxNode, statements As IEnumerable(Of SyntaxNode)) As SyntaxNode 657Friend Overrides Function ScopeBlock(statements As IEnumerable(Of SyntaxNode)) As SyntaxNode 661Friend Overrides Function GlobalStatement(statement As SyntaxNode) As SyntaxNode 666Friend Overrides Function ParseExpression(stringToParse As String) As SyntaxNode 677Public Overrides Function FieldDeclaration(name As String, type As SyntaxNode, Optional accessibility As Accessibility = Nothing, Optional modifiers As DeclarationModifiers = Nothing, Optional initializer As SyntaxNode = Nothing) As SyntaxNode 687parameters As IEnumerable(Of SyntaxNode), 688typeParameters As IEnumerable(Of SyntaxNode), 689returnType As SyntaxNode, 692statements As IEnumerable(Of SyntaxNode)) As SyntaxNode 718Optional parameters As IEnumerable(Of SyntaxNode) = Nothing, 719Optional returnType As SyntaxNode = Nothing, 722Optional statements As IEnumerable(Of SyntaxNode) = Nothing) As SyntaxNode 727Private Protected Overrides Function OperatorDeclaration(operatorName As String, isImplicitConversion As Boolean, Optional parameters As IEnumerable(Of SyntaxNode) = Nothing, Optional returnType As SyntaxNode = Nothing, Optional accessibility As Accessibility = Accessibility.NotApplicable, Optional modifiers As DeclarationModifiers = Nothing, Optional statements As IEnumerable(Of SyntaxNode) = Nothing) As SyntaxNode 811Private Shared Function GetParameterList(parameters As IEnumerable(Of SyntaxNode)) As ParameterListSyntax 817type As SyntaxNode, 818initializer As SyntaxNode, 822isScoped As Boolean) As SyntaxNode 839Private Shared Function GetParameterModifiers(refKind As RefKind, initializer As SyntaxNode) As SyntaxTokenList 852Public Overrides Function GetAccessorDeclaration(Optional accessibility As Accessibility = Accessibility.NotApplicable, Optional statements As IEnumerable(Of SyntaxNode) = Nothing) As SyntaxNode 858Private Protected Overrides Function SetAccessorDeclaration(accessibility As Accessibility, isInitOnly As Boolean, statements As IEnumerable(Of SyntaxNode)) As SyntaxNode 864Public Overrides Function WithAccessorDeclarations(declaration As SyntaxNode, accessorDeclarations As IEnumerable(Of SyntaxNode)) As SyntaxNode 886DirectCast(propertyBlock, SyntaxNode)) 889Private Shared Function GetPropertyBlock(declaration As SyntaxNode) As PropertyBlockSyntax 905type As SyntaxNode, 908Optional getAccessorStatements As IEnumerable(Of SyntaxNode) = Nothing, 909Optional setAccessorStatements As IEnumerable(Of SyntaxNode) = Nothing) As SyntaxNode 922type As SyntaxNode, 923getAccessor As SyntaxNode, 924setAccessor As SyntaxNode, 926modifiers As DeclarationModifiers) As SyntaxNode 954parameters As IEnumerable(Of SyntaxNode), 955type As SyntaxNode, 958Optional getAccessorStatements As IEnumerable(Of SyntaxNode) = Nothing, 959Optional setAccessorStatements As IEnumerable(Of SyntaxNode) = Nothing) As SyntaxNode 991Private Shared Function AccessorBlock(kind As SyntaxKind, statements As IEnumerable(Of SyntaxNode), type As SyntaxNode) As AccessorBlockSyntax 1006Private Shared Function CreateGetAccessorBlock(statements As IEnumerable(Of SyntaxNode)) As AccessorBlockSyntax 1014Private Shared Function CreateSetAccessorBlock(type As SyntaxNode, statements As IEnumerable(Of SyntaxNode)) As AccessorBlockSyntax 1036Public Overrides Function AsPublicInterfaceImplementation(declaration As SyntaxNode, interfaceTypeName As SyntaxNode, interfaceMemberName As String) As SyntaxNode 1040Private Function AsPublicInterfaceImplementationInternal(declaration As SyntaxNode, interfaceTypeName As SyntaxNode, interfaceMemberName As String) As SyntaxNode 1053Public Overrides Function AsPrivateInterfaceImplementation(declaration As SyntaxNode, interfaceTypeName As SyntaxNode, interfaceMemberName As String) As SyntaxNode 1057Private Function AsPrivateInterfaceImplementationInternal(declaration As SyntaxNode, interfaceTypeName As SyntaxNode, interfaceMemberName As String) As SyntaxNode 1070Private Function GetInterfaceMemberName(declaration As SyntaxNode) As String 1082Private Shared Function GetImplementsClause(declaration As SyntaxNode) As ImplementsClauseSyntax 1099Private Shared Function WithImplementsClause(declaration As SyntaxNode, clause As ImplementsClauseSyntax) As SyntaxNode 1118Private Shared Function GetNameAsIdentifier(type As SyntaxNode) As String 1137Private Function WithBody(declaration As SyntaxNode, allowDefault As Boolean) As SyntaxNode 1179Private Function WithIsDefault(modifierList As SyntaxTokenList, isDefault As Boolean, declaration As SyntaxNode) As SyntaxTokenList 1195Optional parameters As IEnumerable(Of SyntaxNode) = Nothing, 1198Optional baseConstructorArguments As IEnumerable(Of SyntaxNode) = Nothing, 1199Optional statements As IEnumerable(Of SyntaxNode) = Nothing) As SyntaxNode 1216Private Protected Overrides Function DestructorDeclaration(destructorMethod As IMethodSymbol) As SyntaxNode 1233typeParameters As IEnumerable(Of SyntaxNode), 1236baseType As SyntaxNode, 1237interfaceTypes As IEnumerable(Of SyntaxNode), 1238members As IEnumerable(Of SyntaxNode)) As SyntaxNode 1256Private Function AsClassMembers(nodes As IEnumerable(Of SyntaxNode)) As SyntaxList(Of StatementSyntax) 1264Private Function AsClassMember(node As SyntaxNode) As StatementSyntax 1271typeParameters As IEnumerable(Of SyntaxNode), 1274interfaceTypes As IEnumerable(Of SyntaxNode), 1275members As IEnumerable(Of SyntaxNode)) As SyntaxNode 1295typeParameters As IEnumerable(Of SyntaxNode), 1297interfaceTypes As IEnumerable(Of SyntaxNode), 1298members As IEnumerable(Of SyntaxNode)) As SyntaxNode 1316Private Function AsInterfaceMembers(nodes As IEnumerable(Of SyntaxNode)) As SyntaxList(Of StatementSyntax) 1324Friend Overrides Function AsInterfaceMember(node As SyntaxNode) As SyntaxNode 1355Optional members As IEnumerable(Of SyntaxNode) = Nothing) As SyntaxNode 1361underlyingType As SyntaxNode, 1364Optional members As IEnumerable(Of SyntaxNode) = Nothing) As SyntaxNode 1377Public Overrides Function EnumMember(name As String, Optional expression As SyntaxNode = Nothing) As SyntaxNode 1384Private Function AsEnumMembers(nodes As IEnumerable(Of SyntaxNode)) As SyntaxList(Of StatementSyntax) 1392Private Function AsEnumMember(node As SyntaxNode) As StatementSyntax 1412parameters As IEnumerable(Of SyntaxNode), 1413typeParameters As IEnumerable(Of SyntaxNode), 1414returnType As SyntaxNode, 1416modifiers As DeclarationModifiers) As SyntaxNode 1431Public Overrides Function CompilationUnit(declarations As IEnumerable(Of SyntaxNode)) As SyntaxNode 1435Private Function AsImports(declarations As IEnumerable(Of SyntaxNode)) As SyntaxList(Of ImportsStatementSyntax) 1439Private Function AsNamespaceImport(node As SyntaxNode) As SyntaxNode 1448Private Shared Function AsNamespaceMembers(declarations As IEnumerable(Of SyntaxNode)) As SyntaxList(Of StatementSyntax) 1452Public Overrides Function NamespaceImportDeclaration(name As SyntaxNode) As SyntaxNode 1456Public Overrides Function AliasImportDeclaration(aliasIdentifierName As String, name As SyntaxNode) As SyntaxNode 1468Public Overrides Function NamespaceDeclaration(name As SyntaxNode, nestedDeclarations As IEnumerable(Of SyntaxNode)) As SyntaxNode 1480Public Overrides Function Attribute(name As SyntaxNode, Optional attributeArguments As IEnumerable(Of SyntaxNode) = Nothing) As SyntaxNode 1489Private Function AsArgumentList(arguments As IEnumerable(Of SyntaxNode)) As ArgumentListSyntax 1497Public Overrides Function AttributeArgument(name As String, expression As SyntaxNode) As SyntaxNode 1501Public Overrides Function ClearTrivia(Of TNode As SyntaxNode)(node As TNode) As TNode 1509Private Function AsAttributeLists(attributes As IEnumerable(Of SyntaxNode)) As SyntaxList(Of AttributeListSyntax) 1517Private Function AsAttributeList(node As SyntaxNode) As AttributeListSyntax 1538Friend Overrides Function GetPrimaryConstructorParameterList(declaration As SyntaxNode) As SyntaxNode 1542Friend Overrides Function GetTypeInheritance(declaration As SyntaxNode) As ImmutableArray(Of SyntaxNode) 1545Return ImmutableArray(Of SyntaxNode).Empty 1548Dim builder = ArrayBuilder(Of SyntaxNode).GetInstance() 1554Public Overrides Function GetAttributes(declaration As SyntaxNode) As IReadOnlyList(Of SyntaxNode) 1568Public Overrides Function InsertAttributes(declaration As SyntaxNode, index As Integer, attributes As IEnumerable(Of SyntaxNode)) As SyntaxNode 1572Private Function InsertAttributesInternal(declaration As SyntaxNode, index As Integer, attributes As IEnumerable(Of SyntaxNode)) As SyntaxNode 1606Private Function WithRequiredTargetSpecifier(attributes As SyntaxList(Of AttributeListSyntax), declaration As SyntaxNode) As SyntaxList(Of AttributeListSyntax) 1614Public Overrides Function GetReturnAttributes(declaration As SyntaxNode) As IReadOnlyList(Of SyntaxNode) 1618Public Overrides Function InsertReturnAttributes(declaration As SyntaxNode, index As Integer, attributes As IEnumerable(Of SyntaxNode)) As SyntaxNode 1629Private Function InsertReturnAttributesInternal(declaration As SyntaxNode, index As Integer, attributes As IEnumerable(Of SyntaxNode)) As SyntaxNode 1644Private Shared Function GetReturnAttributeLists(declaration As SyntaxNode) As SyntaxList(Of AttributeListSyntax) 1658Private Shared Function WithReturnAttributeLists(declaration As SyntaxNode, lists As IEnumerable(Of AttributeListSyntax)) As SyntaxNode 1683Private Function WithAttributeLists(node As SyntaxNode, lists As IEnumerable(Of AttributeListSyntax)) As SyntaxNode 1756Public Overrides Function GetDeclarationKind(declaration As SyntaxNode) As DeclarationKind 1857Private Shared Function IsIndexer(declaration As SyntaxNode) As Boolean 1872Private Shared Function GetDeclarationCount(node As SyntaxNode) As Integer 1876Private Shared Function IsChildOf(node As SyntaxNode, kind As SyntaxKind) As Boolean 1880Private Shared Function IsChildOfVariableDeclaration(node As SyntaxNode) As Boolean 1884Private Shared Function Isolate(declaration As SyntaxNode, editor As Func(Of SyntaxNode, SyntaxNode)) As SyntaxNode 1890Private Shared Function GetFullDeclaration(declaration As SyntaxNode) As SyntaxNode 1914Private Shared Function AsIsolatedDeclaration(declaration As SyntaxNode) As SyntaxNode 1937Private Shared Function WithSingleVariable(declaration As SyntaxNode, variable As ModifiedIdentifierSyntax) As SyntaxNode 1953Public Overrides Function GetName(declaration As SyntaxNode) As String 2032Public Overrides Function WithName(declaration As SyntaxNode, name As String) As SyntaxNode 2036Private Function WithNameInternal(declaration As SyntaxNode, name As String) As SyntaxNode 2104Public Overrides Function [GetType](declaration As SyntaxNode) As SyntaxNode 2121Public Overrides Function WithType(declaration As SyntaxNode, type As SyntaxNode) As SyntaxNode 2125Private Function WithTypeInternal(declaration As SyntaxNode, type As SyntaxNode) As SyntaxNode 2159Private Shared Function GetAsClause(declaration As SyntaxNode) As AsClauseSyntax 2199Private Shared Function WithAsClause(declaration As SyntaxNode, asClause As AsClauseSyntax) As SyntaxNode 2234Private Function AsFunction(declaration As SyntaxNode) As SyntaxNode 2238Private Function AsFunctionInternal(declaration As SyntaxNode) As SyntaxNode 2319Private Function AsSub(declaration As SyntaxNode) As SyntaxNode 2323Private Function AsSubInternal(declaration As SyntaxNode) As SyntaxNode 2404Public Overrides Function GetModifiers(declaration As SyntaxNode) As DeclarationModifiers 2417Private Shared Function GetModifierTokens(declaration As SyntaxNode) As SyntaxTokenList 2421Public Overrides Function WithModifiers(declaration As SyntaxNode, modifiers As DeclarationModifiers) As SyntaxNode 2425Private Function WithModifiersInternal(declaration As SyntaxNode, modifiers As DeclarationModifiers) As SyntaxNode 2441Private Shared Function WithModifierTokens(declaration As SyntaxNode, tokens As SyntaxTokenList) As SyntaxNode 2508Public Overrides Function GetAccessibility(declaration As SyntaxNode) As Accessibility 2512Public Overrides Function WithAccessibility(declaration As SyntaxNode, accessibility As Accessibility) As SyntaxNode 2521Private Shared Function CanHaveAccessibility(declaration As SyntaxNode) As Boolean 2525Private Function WithAccessibilityInternal(declaration As SyntaxNode, accessibility As Accessibility) As SyntaxNode 2551Friend Shared Function GetModifierList(accessibility As Accessibility, modifiers As DeclarationModifiers, declaration As SyntaxNode, kind As DeclarationKind, Optional isDefault As Boolean = False) As SyntaxTokenList 2555Private Protected Overrides Function TypeParameter(name As String) As SyntaxNode 2559Private Protected Overrides Function TypeParameter(symbol As ITypeParameterSymbol) As SyntaxNode 2574Private Shared Function GetTypeParameters(typeParameterNodes As IEnumerable(Of SyntaxNode)) As TypeParameterListSyntax 2583Private Protected Overrides Function WithTypeParameters(declaration As SyntaxNode, typeParameters As IEnumerable(Of SyntaxNode)) As SyntaxNode 2588Private Shared Function ReplaceTypeParameterList(declaration As SyntaxNode, replacer As Func(Of TypeParameterListSyntax, TypeParameterListSyntax)) As SyntaxNode 2618declaration As SyntaxNode, 2620Optional removeDefaults As Boolean = True) As SyntaxNode 2649declaration As SyntaxNode, 2653types As IEnumerable(Of SyntaxNode)) As SyntaxNode 2684Private Protected Overrides Function WithDefaultConstraint(declaration As SyntaxNode, typeParameterName As String) As SyntaxNode 2700Public Overrides Function GetParameters(declaration As SyntaxNode) As IReadOnlyList(Of SyntaxNode) 2704SpecializedCollections.EmptyReadOnlyList(Of SyntaxNode)) 2707Public Overrides Function InsertParameters(declaration As SyntaxNode, index As Integer, parameters As IEnumerable(Of SyntaxNode)) As SyntaxNode 2717Public Overrides Function GetSwitchSections(switchStatement As SyntaxNode) As IReadOnlyList(Of SyntaxNode) 2720Return SpecializedCollections.EmptyReadOnlyList(Of SyntaxNode) 2726Public Overrides Function InsertSwitchSections(switchStatement As SyntaxNode, index As Integer, switchSections As IEnumerable(Of SyntaxNode)) As SyntaxNode 2736Friend Overrides Function GetParameterListNode(declaration As SyntaxNode) As SyntaxNode 2740Private Shared Function WithParameterList(declaration As SyntaxNode, list As ParameterListSyntax) As SyntaxNode 2784Public Overrides Function GetExpression(declaration As SyntaxNode) As SyntaxNode 2799Private Shared Function AsExpression(node As SyntaxNode) As ExpressionSyntax 2808Public Overrides Function WithExpression(declaration As SyntaxNode, expression As SyntaxNode) As SyntaxNode 2812Private Shared Function WithExpressionInternal(declaration As SyntaxNode, expression As SyntaxNode) As SyntaxNode 2852Private Shared Function GetEqualsValue(declaration As SyntaxNode) As EqualsValueSyntax 2873Private Shared Function WithEqualsValue(declaration As SyntaxNode, ev As EqualsValueSyntax) As SyntaxNode 2892Public Overrides Function GetNamespaceImports(declaration As SyntaxNode) As IReadOnlyList(Of SyntaxNode) 2896Private Shared Function GetUnflattenedNamespaceImports(declaration As SyntaxNode) As IReadOnlyList(Of SyntaxNode) 2901Return SpecializedCollections.EmptyReadOnlyList(Of SyntaxNode) 2905Public Overrides Function InsertNamespaceImports(declaration As SyntaxNode, index As Integer, [imports] As IEnumerable(Of SyntaxNode)) As SyntaxNode 2909Private Function InsertNamespaceImportsInternal(declaration As SyntaxNode, index As Integer, [imports] As IEnumerable(Of SyntaxNode)) As SyntaxNode 2928Public Overrides Function GetMembers(declaration As SyntaxNode) As IReadOnlyList(Of SyntaxNode) 2932Private Shared Function GetUnflattenedMembers(declaration As SyntaxNode) As IReadOnlyList(Of SyntaxNode) 2947Return SpecializedCollections.EmptyReadOnlyList(Of SyntaxNode)() 2951Private Function AsMembersOf(declaration As SyntaxNode, members As IEnumerable(Of SyntaxNode)) As IEnumerable(Of StatementSyntax) 2971Public Overrides Function InsertMembers(declaration As SyntaxNode, index As Integer, members As IEnumerable(Of SyntaxNode)) As SyntaxNode 2975Private Function InsertMembersInternal(declaration As SyntaxNode, index As Integer, members As IEnumerable(Of SyntaxNode)) As SyntaxNode 3009Public Overrides Function GetStatements(declaration As SyntaxNode) As IReadOnlyList(Of SyntaxNode) 3026Return SpecializedCollections.EmptyReadOnlyList(Of SyntaxNode) 3030Public Overrides Function WithStatements(declaration As SyntaxNode, statements As IEnumerable(Of SyntaxNode)) As SyntaxNode 3034Private Shared Function WithStatementsInternal(declaration As SyntaxNode, statements As IEnumerable(Of SyntaxNode)) As SyntaxNode 3064Public Overrides Function GetAccessors(declaration As SyntaxNode) As IReadOnlyList(Of SyntaxNode) 3071Return SpecializedCollections.EmptyReadOnlyList(Of SyntaxNode)() 3075Public Overrides Function InsertAccessors(declaration As SyntaxNode, index As Integer, accessors As IEnumerable(Of SyntaxNode)) As SyntaxNode 3087Friend Shared Function GetAccessorList(declaration As SyntaxNode) As SyntaxList(Of AccessorBlockSyntax) 3098Private Shared Function WithAccessorList(declaration As SyntaxNode, accessorList As SyntaxList(Of AccessorBlockSyntax)) As SyntaxNode 3109Private Shared Function AsAccessorList(nodes As IEnumerable(Of SyntaxNode), parentKind As SyntaxKind) As SyntaxList(Of AccessorBlockSyntax) 3113Private Shared Function AsAccessor(node As SyntaxNode, parentKind As SyntaxKind) As AccessorBlockSyntax 3143Public Overrides Function GetGetAccessorStatements(declaration As SyntaxNode) As IReadOnlyList(Of SyntaxNode) 3147Public Overrides Function WithGetAccessorStatements(declaration As SyntaxNode, statements As IEnumerable(Of SyntaxNode)) As SyntaxNode 3151Public Overrides Function GetSetAccessorStatements(declaration As SyntaxNode) As IReadOnlyList(Of SyntaxNode) 3155Public Overrides Function WithSetAccessorStatements(declaration As SyntaxNode, statements As IEnumerable(Of SyntaxNode)) As SyntaxNode 3159Private Function GetAccessorStatements(declaration As SyntaxNode, kind As SyntaxKind) As IReadOnlyList(Of SyntaxNode) 3164Return SpecializedCollections.EmptyReadOnlyList(Of SyntaxNode)() 3168Private Function WithAccessorStatements(declaration As SyntaxNode, statements As IEnumerable(Of SyntaxNode), kind As SyntaxKind) As SyntaxNode 3181Private Shared Function GetAccessorBlock(declaration As SyntaxNode, kind As SyntaxKind) As AccessorBlockSyntax 3192Private Function WithAccessorBlock(declaration As SyntaxNode, kind As SyntaxKind, accessor As AccessorBlockSyntax) As SyntaxNode 3211Public Overrides Function EventDeclaration(name As String, type As SyntaxNode, Optional accessibility As Accessibility = Accessibility.NotApplicable, Optional modifiers As DeclarationModifiers = Nothing) As SyntaxNode 3224name As String, type As SyntaxNode, 3227Optional parameters As IEnumerable(Of SyntaxNode) = Nothing, 3228Optional addAccessorStatements As IEnumerable(Of SyntaxNode) = Nothing, 3229Optional removeAccessorStatements As IEnumerable(Of SyntaxNode) = Nothing) As SyntaxNode 3235Public Overrides Function GetAttributeArguments(attributeDeclaration As SyntaxNode) As IReadOnlyList(Of SyntaxNode) 3240Return SpecializedCollections.EmptyReadOnlyList(Of SyntaxNode)() 3244Public Overrides Function InsertAttributeArguments(attributeDeclaration As SyntaxNode, index As Integer, attributeArguments As IEnumerable(Of SyntaxNode)) As SyntaxNode 3248Private Function InsertAttributeArgumentsInternal(attributeDeclaration As SyntaxNode, index As Integer, attributeArguments As IEnumerable(Of SyntaxNode)) As SyntaxNode 3261Private Shared Function GetArgumentList(declaration As SyntaxNode) As ArgumentListSyntax 3275Private Shared Function WithArgumentList(declaration As SyntaxNode, argumentList As ArgumentListSyntax) As SyntaxNode 3289Public Overrides Function GetBaseAndInterfaceTypes(declaration As SyntaxNode) As IReadOnlyList(Of SyntaxNode) 3293Public Overrides Function AddBaseType(declaration As SyntaxNode, baseType As SyntaxNode) As SyntaxNode 3306Public Overrides Function AddInterfaceType(declaration As SyntaxNode, interfaceType As SyntaxNode) As SyntaxNode 3330Private Shared Function GetInherits(declaration As SyntaxNode) As SyntaxList(Of InheritsStatementSyntax) 3341Private Shared Function WithInherits(declaration As SyntaxNode, list As SyntaxList(Of InheritsStatementSyntax)) As SyntaxNode 3352Private Shared Function GetImplements(declaration As SyntaxNode) As SyntaxList(Of ImplementsStatementSyntax) 3363Private Shared Function WithImplements(declaration As SyntaxNode, list As SyntaxList(Of ImplementsStatementSyntax)) As SyntaxNode 3377Public Overrides Function ReplaceNode(root As SyntaxNode, declaration As SyntaxNode, newDeclaration As SyntaxNode) As SyntaxNode 3410Private Shared Function AreInlineReplaceableSubDeclarations(decl1 As SyntaxNode, decl2 As SyntaxNode) As Boolean 3427Private Shared Function AreSimilarExceptForSubDeclarations(decl1 As SyntaxNode, decl2 As SyntaxNode) As Boolean 3461Public Overrides Function InsertNodesBefore(root As SyntaxNode, declaration As SyntaxNode, newDeclarations As IEnumerable(Of SyntaxNode)) As SyntaxNode 3469Private Function InsertDeclarationsBeforeInternal(root As SyntaxNode, declaration As SyntaxNode, newDeclarations As IEnumerable(Of SyntaxNode)) As SyntaxNode 3487Public Overrides Function InsertNodesAfter(root As SyntaxNode, declaration As SyntaxNode, newDeclarations As IEnumerable(Of SyntaxNode)) As SyntaxNode 3495Private Function InsertNodesAfterInternal(root As SyntaxNode, declaration As SyntaxNode, newDeclarations As IEnumerable(Of SyntaxNode)) As SyntaxNode 3513Private Function SplitAndInsert(multiPartDeclaration As SyntaxNode, subDeclarations As IReadOnlyList(Of SyntaxNode), index As Integer, newDeclarations As IEnumerable(Of SyntaxNode)) As IEnumerable(Of SyntaxNode) 3515Dim newNodes = New List(Of SyntaxNode)() 3523Private Function ReplaceSubDeclaration(root As SyntaxNode, declaration As SyntaxNode, index As Integer, newDeclaration As SyntaxNode) As SyntaxNode 3524Dim newNodes = New List(Of SyntaxNode)() 3547Private Function WithSubDeclarationsRemoved(declaration As SyntaxNode, index As Integer, count As Integer) As SyntaxNode 3551Private Shared Function GetSubDeclarations(declaration As SyntaxNode) As IReadOnlyList(Of SyntaxNode) 3562Return SpecializedCollections.EmptyReadOnlyList(Of SyntaxNode) 3566Private Shared Function Flatten(members As IReadOnlyList(Of SyntaxNode)) As IReadOnlyList(Of SyntaxNode) 3567Dim builder = ArrayBuilder(Of SyntaxNode).GetInstance() 3572Private Shared Sub Flatten(builder As ArrayBuilder(Of SyntaxNode), members As IReadOnlyList(Of SyntaxNode)) 3597Public Overrides Function RemoveNode(root As SyntaxNode, declaration As SyntaxNode) As SyntaxNode 3601Public Overrides Function RemoveNode(root As SyntaxNode, declaration As SyntaxNode, options As SyntaxRemoveOptions) As SyntaxNode 3609Private Shared Function RemoveNodeInternal(root As SyntaxNode, node As SyntaxNode, options As SyntaxRemoveOptions) As SyntaxNode 3674Friend Overrides Function IdentifierName(identifier As SyntaxToken) As SyntaxNode 3678Friend Overrides Function NamedAnonymousObjectMemberDeclarator(identifier As SyntaxNode, expression As SyntaxNode) As SyntaxNode 3688Friend Overrides Function RemoveAllComments(node As SyntaxNode) As SyntaxNode
FindSymbols\VisualBasicDeclaredSymbolInfoFactoryService.vb (6)
134Protected Overrides Sub AddSynthesizedDeclaredSymbolInfos(container As SyntaxNode, memberDeclaration As StatementSyntax, stringTable As StringTable, declaredSymbolInfos As ArrayBuilder(Of DeclaredSymbolInfo), containerDisplayName As String, fullyQualifiedContainerName As String, cancellationToken As CancellationToken) 139container As SyntaxNode, 177container As SyntaxNode, 200container As SyntaxNode, 405Private Shared Function GetAccessibility(container As SyntaxNode, node As StatementSyntax, modifiers As SyntaxTokenList) As Accessibility 584Private Shared Function TryGetSimpleTypeNameWorker(node As SyntaxNode, typeParameterNames As ImmutableArray(Of String)?, ByRef simpleTypeName As String, ByRef isArray As Boolean) As Boolean
Formatting\DefaultOperationProvider.vb (7)
40Public Overrides Sub AddSuppressOperationsSlow(operations As ArrayBuilder(Of SuppressOperation), node As SyntaxNode, ByRef nextAction As NextSuppressOperationAction) 43Public Overrides Sub AddAnchorIndentationOperationsSlow(operations As List(Of AnchorIndentationOperation), node As SyntaxNode, ByRef nextAction As NextAnchorIndentationOperationAction) 46Public Overrides Sub AddIndentBlockOperationsSlow(operations As List(Of IndentBlockOperation), node As SyntaxNode, ByRef nextAction As NextIndentBlockOperationAction) 49Public Overrides Sub AddAlignTokensOperationsSlow(operations As List(Of AlignTokensOperation), node As SyntaxNode, ByRef nextAction As NextAlignTokensOperationAction) 69ElseIf lastTrivia.RawKind = SyntaxKind.LineContinuationTrivia AndAlso previousToken.Parent.GetAncestorsOrThis(Of SyntaxNode)().Any(Function(node As SyntaxNode) IsSingleLineIfOrElseClauseSyntax(node)) Then 152Private Shared Function IsSingleLineIfOrElseClauseSyntax(node As SyntaxNode) As Boolean
Formatting\Engine\AggregatedFormattingResult.vb (2)
15Public Sub New(node As SyntaxNode, results As IList(Of AbstractFormattingResult), formattingSpans As TextSpanMutableIntervalTree) 19Protected Overrides Function Rewriter(changeMap As Dictionary(Of ValueTuple(Of SyntaxToken, SyntaxToken), TriviaData), cancellationToken As CancellationToken) As SyntaxNode
Formatting\Engine\FormattingResult.vb (1)
25Protected Overrides Function Rewriter(changeMap As Dictionary(Of ValueTuple(Of SyntaxToken, SyntaxToken), TriviaData), cancellationToken As CancellationToken) As SyntaxNode
Formatting\Engine\Trivia\TriviaDataFactory.TriviaRewriter.vb (5)
15Private ReadOnly _node As SyntaxNode 23Public Sub New(node As SyntaxNode, spanToFormat As TextSpanMutableIntervalTree, map As Dictionary(Of ValueTuple(Of SyntaxToken, SyntaxToken), TriviaData), cancellationToken As CancellationToken) 38Public Function Transform() As SyntaxNode 119Public Overrides Function Visit(node As SyntaxNode) As SyntaxNode
Formatting\Engine\VisualBasicFormatEngine.vb (1)
15Public Sub New(node As SyntaxNode,
Formatting\FormattingHelpers.vb (1)
236Public Function IsGreaterThanInXmlTag(tag As SyntaxNode, token As SyntaxToken) As Boolean
Formatting\Rules\AlignTokensFormattingRule.vb (1)
16Public Overrides Sub AddAlignTokensOperationsSlow(operations As List(Of AlignTokensOperation), node As SyntaxNode, ByRef nextOperation As NextAlignTokensOperationAction)
Formatting\Rules\BaseFormattingRule.vb (1)
91Protected Shared Sub AddAlignIndentationOfTokensToBaseTokenOperation(operations As List(Of AlignTokensOperation), containingNode As SyntaxNode, baseToken As SyntaxToken, tokens As IEnumerable(Of SyntaxToken))
Formatting\Rules\ElasticTriviaFormattingRule.vb (3)
18Public Overrides Sub AddSuppressOperationsSlow(list As ArrayBuilder(Of SuppressOperation), node As SyntaxNode, ByRef nextOperation As NextSuppressOperationAction) 22Public Overrides Sub AddIndentBlockOperationsSlow(list As List(Of IndentBlockOperation), node As SyntaxNode, ByRef nextOperation As NextIndentBlockOperationAction) 61node As SyntaxNode,
Formatting\Rules\NodeBasedFormattingRule.vb (5)
16node As SyntaxNode, 40Private Shared Function IsBlockSyntax(node As SyntaxNode) As Boolean 50node As SyntaxNode, 199Private Shared Function GetOuterBlockWithDifferentStartTokenUsingXmlElement(firstTokenOfInnerBlock As SyntaxToken) As SyntaxNode 310Private Shared Function GetFirstAndLastMembers(node As SyntaxNode) As ValueTuple(Of SyntaxToken, SyntaxToken)
Formatting\VisualBasicSyntaxFormatting.vb (2)
42Protected Overrides Function CreateAggregatedFormattingResult(node As SyntaxNode, results As IList(Of AbstractFormattingResult), Optional formattingSpans As TextSpanMutableIntervalTree = Nothing) As IFormattingResult 46Protected Overrides Function Format(root As SyntaxNode, options As SyntaxFormattingOptions, formattingRules As ImmutableArray(Of AbstractFormattingRule), startToken As SyntaxToken, endToken As SyntaxToken, cancellationToken As CancellationToken) As AbstractFormattingResult
OrganizeImports\VisualBasicOrganizeImportsService.Rewriter.vb (8)
28Public Overrides Function VisitCompilationUnit(node As CompilationUnitSyntax) As SyntaxNode 41Public Overrides Function VisitImportsStatement(node As ImportsStatementSyntax) As SyntaxNode 52Private Sub AddTextChange(Of TSyntax As SyntaxNode)(list As SeparatedSyntaxList(Of TSyntax), 59Private Sub AddTextChange(Of TSyntax As SyntaxNode)(list As SyntaxList(Of TSyntax), 66Private Shared Function GetNewText(Of TSyntax As SyntaxNode)(organizedList As SyntaxList(Of TSyntax)) As String 70Private Shared Function GetNewText(Of TSyntax As SyntaxNode)(organizedList As SeparatedSyntaxList(Of TSyntax)) As String 74Private Shared Function GetTextSpan(Of TSyntax As SyntaxNode)(list As SyntaxList(Of TSyntax)) As TextSpan 78Private Shared Function GetTextSpan(Of TSyntax As SyntaxNode)(list As SeparatedSyntaxList(Of TSyntax)) As TextSpan
ReassignedVariable\VisualBasicReassignedVariableService.vb (5)
32Protected Overrides Function GetMemberBlock(methodOrPropertyDeclaration As SyntaxNode) As SyntaxNode 36Protected Overrides Function HasInitializer(variable As SyntaxNode) As Boolean 40Protected Overrides Function GetParentScope(localDeclaration As SyntaxNode) As SyntaxNode
Recommendations\VisualBasicRecommendationServiceRunner.vb (1)
69Public Overrides Function TryGetExplicitTypeOfLambdaParameter(lambdaSyntax As SyntaxNode, ordinalInLambda As Integer, <NotNullWhen(True)> ByRef explicitLambdaParameterType As ITypeSymbol) As Boolean
Rename\LabelConflictVisitor.vb (1)
18Public Overrides Sub DefaultVisit(node As SyntaxNode)
Rename\LocalConflictVisitor.vb (2)
23Public Overrides Sub DefaultVisit(node As SyntaxNode) 139Dim controlVariable As SyntaxNode
Rename\VisualBasicRenameRewriterLanguageService.vb (24)
32Public Overrides Function AnnotateAndRename(parameters As RenameRewriterParameters) As SyntaxNode 132Public Overrides Function Visit(node As SyntaxNode) As SyntaxNode 152Dim result As SyntaxNode 165Private Function ShouldComplexifyNode(node As SyntaxNode, isInConflictLambdaBody As Boolean) As Boolean 178Private Function Complexify(originalNode As SyntaxNode, newNode As SyntaxNode) As SyntaxNode 191newNode = speculativeTree.GetAnnotatedNodes(Of SyntaxNode)(annotation).First() 198newNode = Me._speculativeModel.SyntaxTree.GetRoot(_cancellationToken).GetAnnotatedNodes(Of SyntaxNode)(annotation).First() 209cancellationToken:=_cancellationToken), SyntaxNode) 213Dim probableRenameNode = speculativeTree.GetAnnotatedNodes(Of SyntaxNode)(annotation).First() 214Dim speculativeNewNode = speculativeTree.GetAnnotatedNodes(Of SyntaxNode)(annotationForSpeculativeNode).First() 222probableRenameNode = Me._speculativeModel.SyntaxTree.GetRoot(_cancellationToken).GetAnnotatedNodes(Of SyntaxNode)(annotation).First() 223speculativeNewNode = Me._speculativeModel.SyntaxTree.GetRoot(_cancellationToken).GetAnnotatedNodes(Of SyntaxNode)(annotationForSpeculativeNode).First() 229probableRenameNode = expandedNewNode.GetAnnotatedNodes(Of SyntaxNode)(annotation).First() 244Private Function IsExpandWithinMultiLineLambda(node As SyntaxNode) As Boolean 510Public Overrides Function VisitInvocationExpression(node As InvocationExpressionSyntax) As SyntaxNode 747Dim containingMethod = token.Parent.FirstAncestorOrSelf(Of SyntaxNode)( 837Public Overrides Function GetExpansionTargetForLocation(token As SyntaxToken) As SyntaxNode 841Private Shared Function GetExpansionTarget(token As SyntaxToken) As SyntaxNode 860Dim possibleLambdaExpression As SyntaxNode = Nothing 1019Public Shared Function GetSemanticModelForNode(node As SyntaxNode, originalSemanticModel As SemanticModel) As SemanticModel 1026Dim nodeToSpeculate = syntax.GetAncestorsOrThis(Of SyntaxNode).Where(Function(n) SpeculationAnalyzer.CanSpeculateOnNode(n)).LastOrDefault
SemanticModelReuse\VisualBasicSemanticModelReuseLanguageService.vb (4)
41Public Overrides Function TryGetContainingMethodBodyForSpeculation(node As SyntaxNode) As SyntaxNode 56Protected Overrides Function TryGetSpeculativeSemanticModelWorker(previousSemanticModel As SemanticModel, previousBodyNode As SyntaxNode, currentBodyNode As SyntaxNode) As SemanticModel
Simplification\Reducers\AbstractVisualBasicReducer.AbstractReductionRewriter.vb (19)
23Private ReadOnly _processedParentNodes As HashSet(Of SyntaxNode) = New HashSet(Of SyntaxNode)() 64Private Shared Function GetParentNode(expression As ExpressionSyntax) As SyntaxNode 71Private Shared Function GetParentNode(statement As StatementSyntax) As SyntaxNode 79Protected Function SimplifyNode(Of TNode As SyntaxNode)( 81newNode As SyntaxNode, 82parentNode As SyntaxNode, 83simplifyFunc As Func(Of TNode, SemanticModel, VisualBasicSimplifierOptions, CancellationToken, SyntaxNode) 84) As SyntaxNode 158newNode As SyntaxNode, 159simplifier As Func(Of TExpression, SemanticModel, VisualBasicSimplifierOptions, CancellationToken, SyntaxNode) 160) As SyntaxNode 167newNode As SyntaxNode, 168simplifier As Func(Of TStatement, SemanticModel, SimplifierOptions, CancellationToken, SyntaxNode) 169) As SyntaxNode 187Public Overrides Function VisitAccessorBlock(node As AccessorBlockSyntax) As SyntaxNode 191Public Overrides Function VisitConstructorBlock(node As ConstructorBlockSyntax) As SyntaxNode 195Public Overrides Function VisitMethodBlock(node As MethodBlockSyntax) As SyntaxNode 199Public Overrides Function VisitOperatorBlock(node As OperatorBlockSyntax) As SyntaxNode
Simplification\Reducers\AbstractVisualBasicReducer.vb (2)
21Protected Shared ReadOnly s_reduceParentheses As Func(Of ParenthesizedExpressionSyntax, SemanticModel, SimplifierOptions, CancellationToken, SyntaxNode) = AddressOf ReduceParentheses 28) As SyntaxNode
Simplification\Reducers\VisualBasicCallReducer.Rewriter.vb (2)
17Public Overrides Function VisitCallStatement(node As CallStatementSyntax) As SyntaxNode 24Public Overrides Function VisitParenthesizedExpression(node As ParenthesizedExpressionSyntax) As SyntaxNode
Simplification\Reducers\VisualBasicCallReducer.vb (1)
18Private Shared ReadOnly s_simplifyCallStatement As Func(Of CallStatementSyntax, SemanticModel, SimplifierOptions, CancellationToken, SyntaxNode) = AddressOf SimplifyCallStatement
Simplification\Reducers\VisualBasicCastReducer.Rewriter.vb (4)
17Public Overrides Function VisitCTypeExpression(node As CTypeExpressionSyntax) As SyntaxNode 24Public Overrides Function VisitDirectCastExpression(node As DirectCastExpressionSyntax) As SyntaxNode 31Public Overrides Function VisitTryCastExpression(node As TryCastExpressionSyntax) As SyntaxNode 38Public Overrides Function VisitPredefinedCastExpression(node As PredefinedCastExpressionSyntax) As SyntaxNode
Simplification\Reducers\VisualBasicCastReducer.vb (2)
18Private Shared ReadOnly s_simplifyCast As Func(Of CastExpressionSyntax, SemanticModel, SimplifierOptions, CancellationToken, SyntaxNode) = AddressOf SimplifyCast 42Private Shared ReadOnly s_simplifyPredefinedCast As Func(Of PredefinedCastExpressionSyntax, SemanticModel, SimplifierOptions, CancellationToken, SyntaxNode) = AddressOf SimplifyPredefinedCast
Simplification\Reducers\VisualBasicExtensionMethodReducer.Rewriter.vb (1)
18Public Overrides Function VisitInvocationExpression(node As InvocationExpressionSyntax) As SyntaxNode
Simplification\Reducers\VisualBasicExtensionMethodReducer.vb (1)
17Private Shared ReadOnly s_simplifyInvocationExpression As Func(Of InvocationExpressionSyntax, SemanticModel, VisualBasicSimplifierOptions, CancellationToken, SyntaxNode) = AddressOf SimplifyInvocationExpression
Simplification\Reducers\VisualBasicInferredMemberNameReducer.Rewriter.vb (4)
22Private ReadOnly s_simplifyNamedFieldInitializer As Func(Of NamedFieldInitializerSyntax, SemanticModel, SimplifierOptions, CancellationToken, SyntaxNode) = AddressOf SimplifyNamedFieldInitializer 24Private Function SimplifyNamedFieldInitializer(node As NamedFieldInitializerSyntax, arg2 As SemanticModel, options As SimplifierOptions, arg4 As CancellationToken) As SyntaxNode 46Public Overrides Function VisitSimpleArgument(node As SimpleArgumentSyntax) As SyntaxNode 62Public Overrides Function VisitNamedFieldInitializer(node As NamedFieldInitializerSyntax) As SyntaxNode
Simplification\Reducers\VisualBasicMiscellaneousReducer.Rewriter.vb (3)
18Public Overrides Function VisitInvocationExpression(node As InvocationExpressionSyntax) As SyntaxNode 27Public Overrides Function VisitObjectCreationExpression(node As ObjectCreationExpressionSyntax) As SyntaxNode 36Public Overrides Function VisitParameter(node As ParameterSyntax) As SyntaxNode
Simplification\Reducers\VisualBasicMiscellaneousReducer.vb (2)
43Private Shared ReadOnly s_simplifyInvocationExpression As Func(Of InvocationExpressionSyntax, SemanticModel, SimplifierOptions, CancellationToken, SyntaxNode) = AddressOf SimplifyInvocationExpression 66Private Shared ReadOnly s_simplifyObjectCreationExpression As Func(Of ObjectCreationExpressionSyntax, SemanticModel, SimplifierOptions, CancellationToken, SyntaxNode) = AddressOf SimplifyObjectCreationExpression
Simplification\Reducers\VisualBasicNameReducer.Rewriter.vb (6)
18Public Overrides Function VisitGenericName(node As GenericNameSyntax) As SyntaxNode 34Public Overrides Function VisitIdentifierName(node As IdentifierNameSyntax) As SyntaxNode 50Public Overrides Function VisitQualifiedName(node As QualifiedNameSyntax) As SyntaxNode 66Public Overrides Function VisitMemberAccessExpression(node As MemberAccessExpressionSyntax) As SyntaxNode 82Public Overrides Function VisitNullableType(node As NullableTypeSyntax) As SyntaxNode 98Public Overrides Function VisitArrayType(node As ArrayTypeSyntax) As SyntaxNode
Simplification\Reducers\VisualBasicNameReducer.vb (1)
22Private Shared ReadOnly s_simplifyName As Func(Of ExpressionSyntax, SemanticModel, SimplifierOptions, CancellationToken, SyntaxNode) = AddressOf SimplifyName
Simplification\Reducers\VisualBasicParenthesesReducer.Rewriter.vb (1)
17Public Overrides Function VisitParenthesizedExpression(node As ParenthesizedExpressionSyntax) As SyntaxNode
Simplification\Reducers\VisualBasicVariableDeclaratorReducer.Rewriter.vb (1)
17Public Overrides Function VisitVariableDeclarator(node As VariableDeclaratorSyntax) As SyntaxNode
Simplification\Reducers\VisualBasicVariableDeclaratorReducer.vb (4)
21Private Shared ReadOnly s_simplifyVariableDeclarator As Func(Of VariableDeclaratorSyntax, SemanticModel, VisualBasicSimplifierOptions, CancellationToken, SyntaxNode) = AddressOf SimplifyVariableDeclarator 36) As SyntaxNode 37Dim replacementNode As SyntaxNode = Nothing 52<Out> ByRef replacementNode As SyntaxNode,
Simplification\Simplifiers\AbstractVisualBasicSimplifier.vb (2)
13Friend MustInherit Class AbstractVisualBasicSimplifier(Of TSyntax As SyntaxNode, TSimplifiedSyntax As SyntaxNode)
Simplification\Simplifiers\NameSimplifier.vb (2)
260Private Shared Function IsPartOfNamespaceDeclarationName(node As SyntaxNode) As Boolean 262Dim nextNode As SyntaxNode = node
Simplification\VisualBasicSimplificationService.Expander.vb (18)
18Private ReadOnly _expandInsideNode As Func(Of SyntaxNode, Boolean) 25expandInsideNode As Func(Of SyntaxNode, Boolean), 39Public Overrides Function Visit(node As SyntaxNode) As SyntaxNode 102Public Overrides Function VisitParameter(node As ParameterSyntax) As SyntaxNode 128Public Overrides Function VisitAssignmentStatement(node As AssignmentStatementSyntax) As SyntaxNode 144Public Overrides Function VisitExpressionStatement(node As ExpressionStatementSyntax) As SyntaxNode 167Public Overrides Function VisitEqualsValue(node As EqualsValueSyntax) As SyntaxNode 188Public Overrides Function VisitInvocationExpression(node As InvocationExpressionSyntax) As SyntaxNode 278Public Overrides Function VisitObjectCreationExpression(node As ObjectCreationExpressionSyntax) As SyntaxNode 295Public Overrides Function VisitSimpleArgument(node As SimpleArgumentSyntax) As SyntaxNode 376Public Overrides Function VisitInferredFieldInitializer(node As InferredFieldInitializerSyntax) As SyntaxNode 393Public Overrides Function VisitGenericName(node As GenericNameSyntax) As SyntaxNode 400Public Overrides Function VisitSingleLineLambdaExpression(node As SingleLineLambdaExpressionSyntax) As SyntaxNode 411Public Overrides Function VisitQualifiedName(node As QualifiedNameSyntax) As SyntaxNode 445Public Overrides Function VisitMemberAccessExpression(node As MemberAccessExpressionSyntax) As SyntaxNode 480Public Overrides Function VisitIdentifierName(node As IdentifierNameSyntax) As SyntaxNode 811Public Overrides Function VisitLabelStatement(node As LabelStatementSyntax) As SyntaxNode
Simplification\VisualBasicSimplificationService.NodesAndTokensToReduceComputer.vb (8)
25Public Shared Function Compute(root As SyntaxNode, isNodeOrTokenOutsideSimplifySpans As Func(Of SyntaxNodeOrToken, Boolean)) As ImmutableArray(Of NodeOrTokenToReduce) 39Public Overrides Function Visit(node As SyntaxNode) As SyntaxNode 78Private Shared Function IsNodeVariableDeclaratorOfFieldDeclaration(node As SyntaxNode) As Boolean 120Public Overrides Function VisitMethodBlock(node As MethodBlockSyntax) As SyntaxNode 127Public Overrides Function VisitOperatorBlock(node As OperatorBlockSyntax) As SyntaxNode 134Public Overrides Function VisitConstructorBlock(node As ConstructorBlockSyntax) As SyntaxNode 141Public Overrides Function VisitAccessorBlock(node As AccessorBlockSyntax) As SyntaxNode
Simplification\VisualBasicSimplificationService.vb (13)
51Public Overrides Function Expand(node As SyntaxNode, semanticModel As SemanticModel, aliasReplacementAnnotation As SyntaxAnnotation, expandInsideNode As Func(Of SyntaxNode, Boolean), expandParameter As Boolean, cancellationToken As CancellationToken) As SyntaxNode 70Public Overrides Function Expand(token As SyntaxToken, semanticModel As SemanticModel, expandInsideNode As Func(Of SyntaxNode, Boolean), cancellationToken As CancellationToken) As SyntaxToken 77Protected Overrides Function GetSpeculativeSemanticModel(ByRef nodeToSpeculate As SyntaxNode, originalSemanticModel As SemanticModel, originalNode As SyntaxNode) As SemanticModel 134Protected Overrides Function TransformReducedNode(reducedNode As SyntaxNode, originalNode As SyntaxNode) As SyntaxNode 151Protected Overrides Function GetNodesAndTokensToReduce(root As SyntaxNode, isNodeOrTokenOutsideSimplifySpans As Func(Of SyntaxNodeOrToken, Boolean)) As ImmutableArray(Of NodeOrTokenToReduce) 155Protected Overrides Function NodeRequiresNonSpeculativeSemanticModel(node As SyntaxNode) As Boolean 164Protected Overrides Sub GetUnusedNamespaceImports(model As SemanticModel, namespaceImports As HashSet(Of SyntaxNode), cancellationToken As CancellationToken) 180Protected Overrides Sub AddImportDeclarations(root As CompilationUnitSyntax, importDeclarations As ArrayBuilder(Of SyntaxNode))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\DirectiveSyntaxExtensions.vb (5)
13Private ReadOnly s_rootToDirectiveInfo As New ConditionalWeakTable(Of SyntaxNode, DirectiveInfo(Of DirectiveTriviaSyntax))() 15Private Function GetDirectiveInfo(node As SyntaxNode, cancellationToken As CancellationToken) As DirectiveInfo(Of DirectiveTriviaSyntax) 19Private Function GetDirectiveInfoForRoot(root As SyntaxNode, cancellationToken As CancellationToken) As DirectiveInfo(Of DirectiveTriviaSyntax) 25Private Function GetAbsoluteRoot(node As SyntaxNode) As SyntaxNode
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\MemberAccessExpressionSyntaxExtensions.vb (2)
49Dim statement As SyntaxNode 100Dim current As SyntaxNode = memberAccessExpression
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SemanticModelExtensions.vb (1)
82Public Function GetImportNamespacesInScope(semanticModel As SemanticModel, location As SyntaxNode) As ISet(Of INamespaceSymbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\StatementSyntaxExtensions.vb (4)
159Public Function GetModifiers(member As SyntaxNode) As SyntaxTokenList 217Public Function WithModifiers(Of TNode As SyntaxNode)(member As TNode, modifiers As SyntaxTokenList) As TNode 221Private Function WithModifiersHelper(member As SyntaxNode, modifiers As SyntaxTokenList) As SyntaxNode
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxNodeExtensions.vb (66)
17Public Function IsParentKind(node As SyntaxNode, kind As SyntaxKind) As Boolean 23Public Function IsParentKind(node As SyntaxNode, kind1 As SyntaxKind, kind2 As SyntaxKind) As Boolean 29Public Function IsParentKind(node As SyntaxNode, kind1 As SyntaxKind, kind2 As SyntaxKind, kind3 As SyntaxKind) As Boolean 35Public Function IsKind(node As SyntaxNode, kind1 As SyntaxKind, kind2 As SyntaxKind) As Boolean 45Public Function IsKind(node As SyntaxNode, kind1 As SyntaxKind, kind2 As SyntaxKind, kind3 As SyntaxKind) As Boolean 56Public Function IsKind(node As SyntaxNode, kind1 As SyntaxKind, kind2 As SyntaxKind, kind3 As SyntaxKind, kind4 As SyntaxKind) As Boolean 68Public Function IsKind(node As SyntaxNode, ParamArray kinds As SyntaxKind()) As Boolean 77Public Function IsInConstantContext(expression As SyntaxNode) As Boolean 87Public Function IsInStaticContext(node As SyntaxNode) As Boolean 99Public Function IsStatementContainerNode(node As SyntaxNode) As Boolean 113Public Function GetStatements(node As SyntaxNode) As SyntaxList(Of StatementSyntax) 213Friend Function IsAsyncSupportedFunctionSyntax(node As SyntaxNode) As Boolean 229Friend Function IsMultiLineLambda(node As SyntaxNode) As Boolean 254Public Function SpansPreprocessorDirective(Of TSyntaxNode As SyntaxNode)(list As IEnumerable(Of TSyntaxNode)) As Boolean 259Public Function ConvertToSingleLine(Of TNode As SyntaxNode)(node As TNode, Optional useElasticTrivia As Boolean = False) As TNode 275Public Function SplitNodesOnPreprocessorBoundaries(Of TSyntaxNode As SyntaxNode)( 373Public Function ContainsInterleavedDirective(node As SyntaxNode, cancellationToken As CancellationToken) As Boolean 438Public Function GetLeadingBlankLines(Of TSyntaxNode As SyntaxNode)(node As TSyntaxNode) As ImmutableArray(Of SyntaxTrivia) 443Public Function GetNodeWithoutLeadingBlankLines(Of TSyntaxNode As SyntaxNode)(node As TSyntaxNode) As TSyntaxNode 448Public Function GetNodeWithoutLeadingBlankLines(Of TSyntaxNode As SyntaxNode)(node As TSyntaxNode, ByRef strippedTrivia As ImmutableArray(Of SyntaxTrivia)) As TSyntaxNode 453Public Function GetLeadingBannerAndPreprocessorDirectives(Of TSyntaxNode As SyntaxNode)(node As TSyntaxNode) As ImmutableArray(Of SyntaxTrivia) 458Public Function GetNodeWithoutLeadingBannerAndPreprocessorDirectives(Of TSyntaxNode As SyntaxNode)(node As TSyntaxNode) As TSyntaxNode 463Public Function GetNodeWithoutLeadingBannerAndPreprocessorDirectives(Of TSyntaxNode As SyntaxNode)(node As TSyntaxNode, ByRef strippedTrivia As ImmutableArray(Of SyntaxTrivia)) As TSyntaxNode 472Public Function IsExecutableBlock(node As SyntaxNode) As Boolean 505Public Function GetContainingExecutableBlocks(node As SyntaxNode) As IEnumerable(Of SyntaxNode) 512Public Function GetContainingMultiLineExecutableBlocks(node As SyntaxNode) As IEnumerable(Of SyntaxNode) 519Public Function FindInnermostCommonExecutableBlock(nodes As IEnumerable(Of SyntaxNode)) As SyntaxNode 520Dim blocks As IEnumerable(Of SyntaxNode) = Nothing 531Public Function GetExecutableBlockStatements(node As SyntaxNode) As SyntaxList(Of StatementSyntax) 579Public Function ReplaceStatements(node As SyntaxNode, 581ParamArray annotations As SyntaxAnnotation()) As SyntaxNode 611ParamArray annotations As SyntaxAnnotation()) As SyntaxNode 638executableBlock As SyntaxNode, 640ParamArray annotations As SyntaxAnnotation()) As SyntaxNode 650Public Function IsSingleLineExecutableBlock(executableBlock As SyntaxNode) As Boolean 662Public Function IsMultiLineExecutableBlock(node As SyntaxNode) As Boolean 666Private Sub UpdateStatements(executableBlock As SyntaxNode, 714block As SyntaxNode, 716ParamArray annotations As SyntaxAnnotation()) As SyntaxNode 754Public Function GetBraces(node As SyntaxNode) As (openBrace As SyntaxToken, closeBrace As SyntaxToken) 759Function(n As SyntaxNode) CType(Nothing, (SyntaxToken, SyntaxToken))) 763Public Function GetParentheses(node As SyntaxNode) As ValueTuple(Of SyntaxToken, SyntaxToken) 782Function(n As SyntaxNode) CType(Nothing, (SyntaxToken, SyntaxToken))) 786Public Function IsLeftSideOfSimpleAssignmentStatement(node As SyntaxNode) As Boolean 792Public Function IsLeftSideOfAnyAssignmentStatement(node As SyntaxNode) As Boolean 799Public Function IsAnyAssignmentStatement(node As SyntaxNode) As Boolean 805Public Function IsLeftSideOfCompoundAssignmentStatement(node As SyntaxNode) As Boolean 812Public Function IsCompoundAssignmentStatement(node As SyntaxNode) As Boolean 832Public Function ParentingNodeContainsDiagnostics(node As SyntaxNode) As Boolean 856Public Function CheckTopLevel(node As SyntaxNode, span As TextSpan) As Boolean 890Public Function GetMembers(node As SyntaxNode) As SyntaxList(Of StatementSyntax) 915Public Function GetBodies(node As SyntaxNode) As IEnumerable(Of SyntaxNode) 951Return SpecializedCollections.EmptyEnumerable(Of SyntaxNode)() 1066Public Function IsInExpressionTree(node As SyntaxNode, 1106Public Function GetParameterList(declaration As SyntaxNode) As ParameterListSyntax 1148Public Function GetAttributeLists(node As SyntaxNode) As SyntaxList(Of AttributeListSyntax) 1220Public Function GetBlockFromBegin(node As SyntaxNode) As SyntaxNode 1221Dim parent As SyntaxNode = node.Parent 1222Dim begin As SyntaxNode = Nothing 1262Dim parent As SyntaxNode = node.Parent 1263Dim begin As SyntaxNode = Nothing
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxTokenExtensions.vb (11)
62Public Function FirstAncestorOrSelf(token As SyntaxToken, predicate As Func(Of SyntaxNode, Boolean)) As SyntaxNode 67Public Function HasAncestor(Of T As SyntaxNode)(token As SyntaxToken) As Boolean 78Public Function IsChildToken(Of TParent As SyntaxNode)(token As SyntaxToken, childGetter As Func(Of TParent, SyntaxToken)) As Boolean 97Public Function IsChildSeparatorToken(Of TParent As SyntaxNode, TChild As SyntaxNode)(token As SyntaxToken, childGetter As Func(Of TParent, SeparatedSyntaxList(Of TChild))) As Boolean 115Public Function IsDescendantOf(token As SyntaxToken, node As SyntaxNode) As Boolean 121Friend Function GetInnermostDeclarationContext(node As SyntaxToken) As SyntaxNode 122Dim ancestors = node.GetAncestors(Of SyntaxNode) 156Private Function FilterAncestors(ancestors As IEnumerable(Of SyntaxNode), 158precedingEndBlock As EndBlockStatementSyntax) As IEnumerable(Of SyntaxNode)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxTreeExtensions.vb (3)
88Private Function PartOfSingleLineLambda(node As SyntaxNode) As Boolean 99Private Function PartOfMultilineLambdaFooter(node As SyntaxNode) As Boolean 372Public Function GetFirstEnclosingStatement(node As SyntaxNode) As StatementSyntax
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxTriviaExtensions.vb (1)
44Public Function IsPragmaDirective(trivia As SyntaxTrivia, ByRef isDisable As Boolean, ByRef isActive As Boolean, ByRef errorCodes As SeparatedSyntaxList(Of SyntaxNode)) As Boolean
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Helpers\RemoveUnnecessaryImports\VisualBasicRemoveUnnecessaryImportsRewriter.vb (4)
34Public Overrides Function DefaultVisit(node As SyntaxNode) As SyntaxNode 39Public Overrides Function VisitImportsStatement(node As ImportsStatementSyntax) As SyntaxNode 138Public Overrides Function VisitCompilationUnit(node As CompilationUnitSyntax) As SyntaxNode
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Helpers\RemoveUnnecessaryImports\VisualBasicUnnecessaryImportsProvider.vb (5)
27predicate As Func(Of SyntaxNode, Boolean), 31predicate = If(predicate, Functions(Of SyntaxNode).True) 88predicate As Func(Of SyntaxNode, Boolean), 112predicate As Func(Of SyntaxNode, Boolean), 135predicate As Func(Of SyntaxNode, Boolean),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Services\SelectedMembers\VisualBasicSelectedMembers.vb (3)
27Protected Overrides Function GetDeclaratorsAndIdentifiers(member As StatementSyntax) As ImmutableArray(Of (declarator As SyntaxNode, identifier As SyntaxToken)) 31Select(Function(name) (declarator:=DirectCast(name, SyntaxNode), identifier:=name.Identifier))). 34Return ImmutableArray.Create((declaration:=DirectCast(member, SyntaxNode), identifier:=member.GetNameToken()))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Services\SemanticFacts\VisualBasicSemanticFacts.vb (26)
40Public Function IsOnlyWrittenTo(semanticModel As SemanticModel, node As SyntaxNode, cancellationToken As CancellationToken) As Boolean Implements ISemanticFacts.IsOnlyWrittenTo 44Public Function IsWrittenTo(semanticModel As SemanticModel, node As SyntaxNode, cancellationToken As CancellationToken) As Boolean Implements ISemanticFacts.IsWrittenTo 48Public Function IsInOutContext(semanticModel As SemanticModel, node As SyntaxNode, cancellationToken As CancellationToken) As Boolean Implements ISemanticFacts.IsInOutContext 52Public Function IsInRefContext(semanticModel As SemanticModel, node As SyntaxNode, cancellationToken As CancellationToken) As Boolean Implements ISemanticFacts.IsInRefContext 56Public Function IsInInContext(semanticModel As SemanticModel, node As SyntaxNode, cancellationToken As CancellationToken) As Boolean Implements ISemanticFacts.IsInInContext 60Public Function CanReplaceWithRValue(semanticModel As SemanticModel, expression As SyntaxNode, cancellationToken As CancellationToken) As Boolean Implements ISemanticFacts.CanReplaceWithRValue 67For Each ancestor In token.GetAncestors(Of SyntaxNode)() 110Public Function TryGetSpeculativeSemanticModel(oldSemanticModel As SemanticModel, oldNode As SyntaxNode, newNode As SyntaxNode, <Out> ByRef speculativeModel As SemanticModel) As Boolean Implements ISemanticFacts.TryGetSpeculativeSemanticModel 167Public Function GetForEachSymbols(model As SemanticModel, forEachStatement As SyntaxNode) As ForEachSymbols Implements ISemanticFacts.GetForEachSymbols 193Public Function GetCollectionInitializerSymbolInfo(semanticModel As SemanticModel, node As SyntaxNode, cancellationToken As CancellationToken) As SymbolInfo Implements ISemanticFacts.GetCollectionInitializerSymbolInfo 197Public Function GetGetAwaiterMethod(model As SemanticModel, node As SyntaxNode) As IMethodSymbol Implements ISemanticFacts.GetGetAwaiterMethod 207Public Function GetDeconstructionAssignmentMethods(model As SemanticModel, deconstruction As SyntaxNode) As ImmutableArray(Of IMethodSymbol) Implements ISemanticFacts.GetDeconstructionAssignmentMethods 211Public Function GetDeconstructionForEachMethods(model As SemanticModel, deconstruction As SyntaxNode) As ImmutableArray(Of IMethodSymbol) Implements ISemanticFacts.GetDeconstructionForEachMethods 223Public Function GetDeclaredSymbols(semanticModel As SemanticModel, memberDeclaration As SyntaxNode, cancellationToken As CancellationToken) As IEnumerable(Of ISymbol) Implements ISemanticFacts.GetDeclaredSymbols 233Public Function FindParameterForArgument(semanticModel As SemanticModel, argument As SyntaxNode, allowUncertainCandidates As Boolean, allowParams As Boolean, cancellationToken As CancellationToken) As IParameterSymbol Implements ISemanticFacts.FindParameterForArgument 237Public Function FindParameterForAttributeArgument(semanticModel As SemanticModel, argument As SyntaxNode, allowUncertainCandidates As Boolean, allowParams As Boolean, cancellationToken As CancellationToken) As IParameterSymbol Implements ISemanticFacts.FindParameterForAttributeArgument 241Public Function FindFieldOrPropertyForArgument(semanticModel As SemanticModel, node As SyntaxNode, cancellationToken As CancellationToken) As ISymbol Implements ISemanticFacts.FindFieldOrPropertyForArgument 256Public Function FindFieldOrPropertyForAttributeArgument(semanticModel As SemanticModel, node As SyntaxNode, cancellationToken As CancellationToken) As ISymbol Implements ISemanticFacts.FindFieldOrPropertyForAttributeArgument 260Public Function GetBestOrAllSymbols(semanticModel As SemanticModel, node As SyntaxNode, token As SyntaxToken, cancellationToken As CancellationToken) As ImmutableArray(Of ISymbol) Implements ISemanticFacts.GetBestOrAllSymbols 271Public Function IsInsideNameOfExpression(semanticModel As SemanticModel, node As SyntaxNode, cancellationToken As CancellationToken) As Boolean Implements ISemanticFacts.IsInsideNameOfExpression 279Public Function IsInExpressionTree(semanticModel As SemanticModel, node As SyntaxNode, expressionTypeOpt As INamedTypeSymbol, cancellationToken As CancellationToken) As Boolean Implements ISemanticFacts.IsInExpressionTree 284expression As SyntaxNode, 291Public Function GetPreprocessingSymbol(model As SemanticModel, node As SyntaxNode) As IPreprocessingSymbol Implements ISemanticFacts.GetPreprocessingSymbol 313Dim current As SyntaxNode = node 314Dim parent As SyntaxNode = node.Parent
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Services\SyntaxFacts\VisualBasicAccessibilityFacts.vb (5)
23Public Function CanHaveAccessibility(declaration As SyntaxNode, Optional ignoreDeclarationModifiers As Boolean = False) As Boolean Implements IAccessibilityFacts.CanHaveAccessibility 82Private Shared Function IsChildOf(node As SyntaxNode, kind As SyntaxKind) As Boolean 86Private Shared Function IsChildOfVariableDeclaration(node As SyntaxNode) As Boolean 90Public Function GetAccessibility(declaration As SyntaxNode) As Accessibility Implements IAccessibilityFacts.GetAccessibility 103Public Shared Function GetModifierTokens(declaration As SyntaxNode) As SyntaxTokenList
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Services\SyntaxFacts\VisualBasicBlockFacts.vb (9)
13Public Overrides Function IsScopeBlock(node As SyntaxNode) As Boolean 18Public Overrides Function IsExecutableBlock(node As SyntaxNode) As Boolean 22Public Overrides Function GetExecutableBlockStatements(node As SyntaxNode) As IReadOnlyList(Of SyntaxNode) 26Public Overrides Function FindInnermostCommonExecutableBlock(nodes As IEnumerable(Of SyntaxNode)) As SyntaxNode 30Public Overrides Function IsStatementContainer(node As SyntaxNode) As Boolean 34Public Overrides Function GetStatementContainerStatements(node As SyntaxNode) As IReadOnlyList(Of SyntaxNode)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Services\SyntaxFacts\VisualBasicDocumentationCommentService.vb (1)
49Protected Overrides Function GetName(xmlElement As XmlElementSyntax) As SyntaxNode
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Services\SyntaxFacts\VisualBasicHeaderFacts.vb (18)
21root As SyntaxNode, 24ByRef typeDeclaration As SyntaxNode) As Boolean 43Public Overrides Function IsOnPropertyDeclarationHeader(root As SyntaxNode, position As Integer, ByRef propertyDeclaration As SyntaxNode) As Boolean 58Public Overrides Function IsOnParameterHeader(root As SyntaxNode, position As Integer, ByRef parameter As SyntaxNode) As Boolean 69Public Overrides Function IsOnMethodHeader(root As SyntaxNode, position As Integer, ByRef method As SyntaxNode) As Boolean 88Public Overrides Function IsOnLocalFunctionHeader(root As SyntaxNode, position As Integer, ByRef localFunction As SyntaxNode) As Boolean 93Public Overrides Function IsOnLocalDeclarationHeader(root As SyntaxNode, position As Integer, ByRef localDeclaration As SyntaxNode) As Boolean 107Public Overrides Function IsOnIfStatementHeader(root As SyntaxNode, position As Integer, ByRef ifStatement As SyntaxNode) As Boolean 125Public Overrides Function IsOnWhileStatementHeader(root As SyntaxNode, position As Integer, ByRef whileStatement As SyntaxNode) As Boolean 137Public Overrides Function IsOnForeachHeader(root As SyntaxNode, position As Integer, ByRef foreachStatement As SyntaxNode) As Boolean
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Services\SyntaxFacts\VisualBasicSyntaxFacts.vb (316)
31Private Shared ReadOnly s_syntaxNodeListPool As ObjectPool(Of List(Of SyntaxNode)) = New ObjectPool(Of List(Of SyntaxNode))(Function() New List(Of SyntaxNode), trimOnFree:=False) 146Public Function IsDirective(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsDirective 150Public Function TryGetExternalSourceInfo(node As SyntaxNode, ByRef info As ExternalSourceInfo) As Boolean Implements ISyntaxFacts.TryGetExternalSourceInfo 164Public Function IsDeclarationExpression(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsDeclarationExpression 169Public Function IsNameOfSimpleMemberAccessExpression(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsNameOfSimpleMemberAccessExpression 174Public Function IsNameOfAnyMemberAccessExpression(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsNameOfAnyMemberAccessExpression 179Public Function GetStandaloneExpression(node As SyntaxNode) As SyntaxNode Implements ISyntaxFacts.GetStandaloneExpression 183Public Function GetRootConditionalAccessExpression(node As SyntaxNode) As SyntaxNode Implements ISyntaxFacts.GetRootConditionalAccessExpression 187Public Function IsNamedArgument(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsNamedArgument 192Public Function IsNameOfNamedArgument(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsNameOfNamedArgument 196Public Function GetParameterList(node As SyntaxNode) As SyntaxNode Implements ISyntaxFacts.GetParameterList 200Public Function IsParameterList(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsParameterList 204Public Function IsUsingDirectiveName(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsUsingDirectiveName 209Public Function IsDeconstructionAssignment(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsDeconstructionAssignment 213Public Function IsDeconstructionForEachStatement(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsDeconstructionForEachStatement 217Public Function IsStatement(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsStatement 221Public Function IsExecutableStatement(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsExecutableStatement 225Public Function IsGlobalStatement(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsGlobalStatement 230Public Function GetStatementOfGlobalStatement(node As SyntaxNode) As SyntaxNode Implements ISyntaxFacts.GetStatementOfGlobalStatement 235Public Function AreStatementsInSameContainer(firstStatement As SyntaxNode, secondStatement As SyntaxNode) As Boolean Implements ISyntaxFacts.AreStatementsInSameContainer 242Public Function IsMethodBody(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsMethodBody 246Public Function GetExpressionOfRefExpression(node As SyntaxNode) As SyntaxNode Implements ISyntaxFacts.GetExpressionOfRefExpression 250Public Function GetExpressionOfReturnStatement(node As SyntaxNode) As SyntaxNode Implements ISyntaxFacts.GetExpressionOfReturnStatement 313Public Function IsPredefinedType(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsPredefinedType 318Public Function IsPredefinedType(node As SyntaxNode, type As PredefinedType) As Boolean Implements ISyntaxFacts.IsPredefinedType 522Public Function IsPointerMemberAccessExpression(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsPointerMemberAccessExpression 526Public Sub GetNameAndArityOfSimpleName(node As SyntaxNode, ByRef name As String, ByRef arity As Integer) Implements ISyntaxFacts.GetNameAndArityOfSimpleName 532Public Function LooksGeneric(name As SyntaxNode) As Boolean Implements ISyntaxFacts.LooksGeneric 536Public Function GetTypeArgumentsOfGenericName(genericName As SyntaxNode) As SeparatedSyntaxList(Of SyntaxNode) Implements ISyntaxFacts.GetTypeArgumentsOfGenericName 545Public Function GetExpressionOfMemberAccessExpression(node As SyntaxNode, Optional allowImplicitTarget As Boolean = False) As SyntaxNode Implements ISyntaxFacts.GetExpressionOfMemberAccessExpression 549Public Function GetTargetOfMemberBinding(node As SyntaxNode) As SyntaxNode Implements ISyntaxFacts.GetTargetOfMemberBinding 554Public Function GetNameOfMemberBindingExpression(node As SyntaxNode) As SyntaxNode Implements ISyntaxFacts.GetNameOfMemberBindingExpression 559Public Sub GetPartsOfElementAccessExpression(node As SyntaxNode, ByRef expression As SyntaxNode, ByRef argumentList As SyntaxNode) Implements ISyntaxFacts.GetPartsOfElementAccessExpression 575Public Function GetExpressionOfInterpolation(node As SyntaxNode) As SyntaxNode Implements ISyntaxFacts.GetExpressionOfInterpolation 579Public Function IsInNamespaceOrTypeContext(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsInNamespaceOrTypeContext 583Public Function IsBaseTypeList(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsBaseTypeList 587Public Function IsInStaticContext(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsInStaticContext 591Public Function GetExpressionOfArgument(node As SyntaxNode) As SyntaxNode Implements ISyntaxFacts.GetExpressionOfArgument 595Public Function GetExpressionOfAttributeArgument(node As SyntaxNode) As SyntaxNode Implements ISyntaxFacts.GetExpressionOfAttributeArgument 599Public Function GetRefKindOfArgument(node As SyntaxNode) As RefKind Implements ISyntaxFacts.GetRefKindOfArgument 604Public Function IsArgument(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsArgument 608Public Function IsAttributeArgument(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsAttributeArgument 612Public Function IsSimpleArgument(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsSimpleArgument 617Public Function IsInConstantContext(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsInConstantContext 621Public Function IsInConstructor(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsInConstructor 625Public Function IsUnsafeContext(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsUnsafeContext 629Public Function IsAttributeNamedArgumentIdentifier(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsAttributeNamedArgumentIdentifier 637Public Function GetContainingTypeDeclaration(root As SyntaxNode, position As Integer) As SyntaxNode Implements ISyntaxFacts.GetContainingTypeDeclaration 640GetAncestors(Of SyntaxNode)(). 644Public Function GetContainingVariableDeclaratorOfFieldDeclaration(node As SyntaxNode) As SyntaxNode Implements ISyntaxFacts.GetContainingVariableDeclaratorOfFieldDeclaration 663node As SyntaxNode, 664ByRef initializedInstance As SyntaxNode) As Boolean Implements ISyntaxFacts.IsMemberInitializerNamedAssignmentIdentifier 678Public Function IsAnyInitializerExpression(node As SyntaxNode, ByRef creationExpression As SyntaxNode) As Boolean Implements ISyntaxFacts.IsAnyInitializerExpression 693Public Function IsNameOfSubpattern(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsNameOfSubpattern 697Public Function IsPropertyPatternClause(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsPropertyPatternClause 701Public Function IsElementAccessExpression(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsElementAccessExpression 707Public Function GetContainingMemberDeclaration(root As SyntaxNode, position As Integer, Optional useFullSpan As Boolean = True) As SyntaxNode Implements ISyntaxFacts.GetContainingMemberDeclaration 708Dim isApplicableDeclaration = Function(node As SyntaxNode) 740Public Function GetContainingMethodDeclaration(root As SyntaxNode, position As Integer, Optional useFullSpan As Boolean = True) As SyntaxNode Implements ISyntaxFacts.GetContainingMethodDeclaration 741Dim isApplicableDeclaration = Function(node As SyntaxNode) 756Private Shared Function GetContainingMemberDeclaration(root As SyntaxNode, position As Integer, isApplicableDeclaration As Func(Of SyntaxNode, Boolean), Optional useFullSpan As Boolean = True) As SyntaxNode 780Public Function IsMethodLevelMember(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsMethodLevelMember 820Public Function GetMemberBodySpanForSpeculativeBinding(node As SyntaxNode) As TextSpan Implements ISyntaxFacts.GetMemberBodySpanForSpeculativeBinding 849Public Function ContainsInMemberBody(node As SyntaxNode, span As TextSpan) As Boolean Implements ISyntaxFacts.ContainsInMemberBody 891Private Shared Function GetSyntaxListSpan(Of T As SyntaxNode)(list As SyntaxList(Of T)) As TextSpan 896Private Shared Function GetSeparatedSyntaxListSpan(Of T As SyntaxNode)(list As SeparatedSyntaxList(Of T)) As TextSpan 901Public Function GetTopLevelAndMethodLevelMembers(root As SyntaxNode) As PooledObject(Of List(Of SyntaxNode)) Implements ISyntaxFacts.GetTopLevelAndMethodLevelMembers 902Dim pooledList = PooledObject(Of List(Of SyntaxNode)).Create(s_syntaxNodeListPool) 910Public Function GetMethodLevelMembers(root As SyntaxNode) As PooledObject(Of List(Of SyntaxNode)) Implements ISyntaxFacts.GetMethodLevelMembers 911Dim pooledList = PooledObject(Of List(Of SyntaxNode)).Create(s_syntaxNodeListPool) 919Public Function GetMembersOfTypeDeclaration(typeDeclaration As SyntaxNode) As SyntaxList(Of SyntaxNode) Implements ISyntaxFacts.GetMembersOfTypeDeclaration 923Public Function IsTopLevelNodeWithMembers(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsTopLevelNodeWithMembers 931Public Function GetDisplayName(node As SyntaxNode, options As DisplayNameOptions, Optional rootNamespace As String = Nothing) As String Implements ISyntaxFacts.GetDisplayName 1001Private Shared Function GetName(node As SyntaxNode, options As DisplayNameOptions, ByRef containsGlobalKeyword As Boolean) As String 1063Private Sub AppendMembers(node As SyntaxNode, list As List(Of SyntaxNode), topLevel As Boolean, methodLevel As Boolean) 1082Public Function TryGetBindableParent(token As SyntaxToken) As SyntaxNode Implements ISyntaxFacts.TryGetBindableParent 1134Public Function GetConstructors(root As SyntaxNode, cancellationToken As CancellationToken) As IEnumerable(Of SyntaxNode) Implements ISyntaxFacts.GetConstructors 1137Return SpecializedCollections.EmptyEnumerable(Of SyntaxNode)() 1140Dim constructors = New List(Of SyntaxNode)() 1145Private Shared Sub AppendConstructors(members As SyntaxList(Of StatementSyntax), constructors As List(Of SyntaxNode), cancellationToken As CancellationToken) 1181Public Function GetNameForArgument(argument As SyntaxNode) As String Implements ISyntaxFacts.GetNameForArgument 1189Public Function GetNameForAttributeArgument(argument As SyntaxNode) As String Implements ISyntaxFacts.GetNameForAttributeArgument 1194Public Function IsLeftSideOfDot(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsLeftSideOfDot 1198Public Function GetRightSideOfDot(node As SyntaxNode) As SyntaxNode Implements ISyntaxFacts.GetRightSideOfDot 1203Public Function GetLeftSideOfDot(node As SyntaxNode, Optional allowImplicitTarget As Boolean = False) As SyntaxNode Implements ISyntaxFacts.GetLeftSideOfDot 1208Public Function IsLeftSideOfExplicitInterfaceSpecifier(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsLeftSideOfExplicitInterfaceSpecifier 1212Public Function IsLeftSideOfAssignment(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsLeftSideOfAssignment 1216Public Function IsLeftSideOfAnyAssignment(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsLeftSideOfAnyAssignment 1220Public Function IsLeftSideOfCompoundAssignment(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsLeftSideOfCompoundAssignment 1224Public Function GetRightHandSideOfAssignment(node As SyntaxNode) As SyntaxNode Implements ISyntaxFacts.GetRightHandSideOfAssignment 1228Public Function IsInferredAnonymousObjectMemberDeclarator(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsInferredAnonymousObjectMemberDeclarator 1232Public Function IsOperandOfIncrementExpression(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsOperandOfIncrementExpression 1236Public Function IsOperandOfIncrementOrDecrementExpression(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsOperandOfIncrementOrDecrementExpression 1240Public Function GetContentsOfInterpolatedString(interpolatedString As SyntaxNode) As SyntaxList(Of SyntaxNode) Implements ISyntaxFacts.GetContentsOfInterpolatedString 1255Public Function GetArgumentsOfObjectCreationExpression(node As SyntaxNode) As SeparatedSyntaxList(Of SyntaxNode) Implements ISyntaxFacts.GetArgumentsOfObjectCreationExpression 1260Public Function GetArgumentsOfArgumentList(node As SyntaxNode) As SeparatedSyntaxList(Of SyntaxNode) Implements ISyntaxFacts.GetArgumentsOfArgumentList 1264Public Function GetArgumentsOfAttributeArgumentList(node As SyntaxNode) As SeparatedSyntaxList(Of SyntaxNode) Implements ISyntaxFacts.GetArgumentsOfAttributeArgumentList 1268Public Function ConvertToSingleLine(node As SyntaxNode, Optional useElasticTrivia As Boolean = False) As SyntaxNode Implements ISyntaxFacts.ConvertToSingleLine 1272Public Function IsDocumentationComment(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsDocumentationComment 1276Public Function IsUsingOrExternOrImport(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsUsingOrExternOrImport 1280Public Function IsGlobalAssemblyAttribute(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsGlobalAssemblyAttribute 1284Public Function IsGlobalModuleAttribute(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsGlobalModuleAttribute 1288Private Shared Function IsGlobalAttribute(node As SyntaxNode, attributeTarget As SyntaxKind) As Boolean 1299Public Function IsDeclaration(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsDeclaration 1382Public Function IsTypeDeclaration(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsTypeDeclaration 1397Public Function IsAnyAssignmentStatement(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsAnyAssignmentStatement 1401Public Function IsSimpleAssignmentStatement(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsSimpleAssignmentStatement 1405Public Sub GetPartsOfAssignmentStatement(statement As SyntaxNode, ByRef left As SyntaxNode, ByRef operatorToken As SyntaxToken, ByRef right As SyntaxNode) Implements ISyntaxFacts.GetPartsOfAssignmentStatement 1410Public Sub GetPartsOfAssignmentExpressionOrStatement(statement As SyntaxNode, ByRef left As SyntaxNode, ByRef operatorToken As SyntaxToken, ByRef right As SyntaxNode) Implements ISyntaxFacts.GetPartsOfAssignmentExpressionOrStatement 1417Public Function GetIdentifierOfSimpleName(node As SyntaxNode) As SyntaxToken Implements ISyntaxFacts.GetIdentifierOfSimpleName 1421Public Function GetIdentifierOfVariableDeclarator(node As SyntaxNode) As SyntaxToken Implements ISyntaxFacts.GetIdentifierOfVariableDeclarator 1425Public Function GetIdentifierOfTypeDeclaration(node As SyntaxNode) As SyntaxToken Implements ISyntaxFacts.GetIdentifierOfTypeDeclaration 1442Public Function IsDeclaratorOfLocalDeclarationStatement(declarator As SyntaxNode, localDeclarationStatement As SyntaxNode) As Boolean Implements ISyntaxFacts.IsDeclaratorOfLocalDeclarationStatement 1451Public Function AreEquivalent(node1 As SyntaxNode, node2 As SyntaxNode) As Boolean Implements ISyntaxFacts.AreEquivalent 1455Public Function IsExpressionOfForeach(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsExpressionOfForeach 1459Public Function GetExpressionOfExpressionStatement(node As SyntaxNode) As SyntaxNode Implements ISyntaxFacts.GetExpressionOfExpressionStatement 1463Public Sub GetPartsOfTupleExpression(Of TArgumentSyntax As SyntaxNode)(node As SyntaxNode, ByRef openParen As SyntaxToken, ByRef arguments As SeparatedSyntaxList(Of TArgumentSyntax), ByRef closeParen As SyntaxToken) Implements ISyntaxFacts.GetPartsOfTupleExpression 1466arguments = CType(CType(tupleExpr.Arguments, SeparatedSyntaxList(Of SyntaxNode)), SeparatedSyntaxList(Of TArgumentSyntax)) 1486Public Function IsPragmaDirective(trivia As SyntaxTrivia, ByRef isDisable As Boolean, ByRef isActive As Boolean, ByRef errorCodes As SeparatedSyntaxList(Of SyntaxNode)) As Boolean Implements ISyntaxFacts.IsPragmaDirective 1498Public Function GetModifiers(node As SyntaxNode) As SyntaxTokenList Implements ISyntaxFacts.GetModifiers 1502Public Function WithModifiers(node As SyntaxNode, modifiers As SyntaxTokenList) As SyntaxNode Implements ISyntaxFacts.WithModifiers 1506Public Function GetVariablesOfLocalDeclarationStatement(node As SyntaxNode) As SeparatedSyntaxList(Of SyntaxNode) Implements ISyntaxFacts.GetVariablesOfLocalDeclarationStatement 1510Public Function GetInitializerOfVariableDeclarator(node As SyntaxNode) As SyntaxNode Implements ISyntaxFacts.GetInitializerOfVariableDeclarator 1514Public Function GetInitializerOfPropertyDeclaration(node As SyntaxNode) As SyntaxNode Implements ISyntaxFacts.GetInitializerOfPropertyDeclaration 1518Public Function GetTypeOfVariableDeclarator(node As SyntaxNode) As SyntaxNode Implements ISyntaxFacts.GetTypeOfVariableDeclarator 1523Public Function GetValueOfEqualsValueClause(node As SyntaxNode) As SyntaxNode Implements ISyntaxFacts.GetValueOfEqualsValueClause 1527Public Function IsEqualsValueOfPropertyDeclaration(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsEqualsValueOfPropertyDeclaration 1531Public Function IsConversionExpression(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsConversionExpression 1535Public Function IsCastExpression(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsCastExpression 1539Public Sub GetPartsOfCastExpression(node As SyntaxNode, ByRef type As SyntaxNode, ByRef expression As SyntaxNode) Implements ISyntaxFacts.GetPartsOfCastExpression 1545Public Function GetDeconstructionReferenceLocation(node As SyntaxNode) As Location Implements ISyntaxFacts.GetDeconstructionReferenceLocation 1567Public Function IsPostfixUnaryExpression(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsPostfixUnaryExpression 1572Public Function IsElementBindingExpression(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsElementBindingExpression 1577Public Function IsMemberBindingExpression(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsMemberBindingExpression 1582Public Function IsNameOfMemberBindingExpression(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsNameOfMemberBindingExpression 1587Public Function GetAttributeLists(node As SyntaxNode) As SyntaxList(Of SyntaxNode) Implements ISyntaxFacts.GetAttributeLists 1591Public Function IsUsingAliasDirective(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsUsingAliasDirective 1611node As SyntaxNode, 1614ByRef name As SyntaxNode) Implements ISyntaxFacts.GetPartsOfUsingAliasDirective 1633Public Function IsParameterNameXmlElementSyntax(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsParameterNameXmlElementSyntax 1643Public Function GetContentFromDocumentationCommentTriviaSyntax(trivia As SyntaxTrivia) As SyntaxList(Of SyntaxNode) Implements ISyntaxFacts.GetContentFromDocumentationCommentTriviaSyntax 1652Friend Shared Function IsChildOf(node As SyntaxNode, kind As SyntaxKind) As Boolean 1656Friend Shared Function IsChildOfVariableDeclaration(node As SyntaxNode) As Boolean 1660Private Shared Function GetDeclarationCount(nodes As IReadOnlyList(Of SyntaxNode)) As Integer 1669Friend Shared Function GetDeclarationCount(node As SyntaxNode) As Integer 1696Public Function IsAnyPattern(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsAnyPattern 1700Public Function IsBinaryPattern(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsBinaryPattern 1704Public Function IsUnaryPattern(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsUnaryPattern 1708Public Sub GetPartsOfAnyIsTypeExpression(node As SyntaxNode, ByRef expression As SyntaxNode, ByRef type As SyntaxNode) Implements ISyntaxFacts.GetPartsOfAnyIsTypeExpression 1714Public Sub GetPartsOfIsPatternExpression(node As SyntaxNode, ByRef left As SyntaxNode, ByRef isToken As SyntaxToken, ByRef right As SyntaxNode) Implements ISyntaxFacts.GetPartsOfIsPatternExpression 1718Public Function GetExpressionOfConstantPattern(node As SyntaxNode) As SyntaxNode Implements ISyntaxFacts.GetExpressionOfConstantPattern 1722Public Sub GetPartsOfParenthesizedPattern(node As SyntaxNode, ByRef openParen As SyntaxToken, ByRef pattern As SyntaxNode, ByRef closeParen As SyntaxToken) Implements ISyntaxFacts.GetPartsOfParenthesizedPattern 1726Public Sub GetPartsOfBinaryPattern(node As SyntaxNode, ByRef left As SyntaxNode, ByRef operatorToken As SyntaxToken, ByRef right As SyntaxNode) Implements ISyntaxFacts.GetPartsOfBinaryPattern 1730Public Sub GetPartsOfUnaryPattern(node As SyntaxNode, ByRef operatorToken As SyntaxToken, ByRef pattern As SyntaxNode) Implements ISyntaxFacts.GetPartsOfUnaryPattern 1734Public Sub GetPartsOfRelationalPattern(node As SyntaxNode, ByRef operatorToken As SyntaxToken, ByRef expression As SyntaxNode) Implements ISyntaxFacts.GetPartsOfRelationalPattern 1738Public Sub GetPartsOfDeclarationPattern(node As SyntaxNode, ByRef type As SyntaxNode, ByRef designation As SyntaxNode) Implements ISyntaxFacts.GetPartsOfDeclarationPattern 1742Public Sub GetPartsOfRecursivePattern(node As SyntaxNode, ByRef type As SyntaxNode, ByRef positionalPart As SyntaxNode, ByRef propertyPart As SyntaxNode, ByRef designation As SyntaxNode) Implements ISyntaxFacts.GetPartsOfRecursivePattern 1746Public Function GetTypeOfTypePattern(node As SyntaxNode) As SyntaxNode Implements ISyntaxFacts.GetTypeOfTypePattern 1750Public Function IsVerbatimInterpolatedStringExpression(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsVerbatimInterpolatedStringExpression 1764Public Function IsAnonymousFunctionExpression(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsAnonymousFunctionExpression 1768Public Function IsBaseNamespaceDeclaration(<NotNullWhen(True)> node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsBaseNamespaceDeclaration 1772Public Function IsBinaryExpression(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsBinaryExpression 1776Public Function IsLiteralExpression(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsLiteralExpression 1780Public Function IsMemberAccessExpression(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsMemberAccessExpression 1784Public Function IsMethodDeclaration(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsMethodDeclaration 1788Public Function IsSimpleName(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsSimpleName 1792Public Function IsAnyName(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsAnyName 1796Public Function IsAnyType(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsAnyType 1800Public Function IsNamedMemberInitializer(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsNamedMemberInitializer 1804Public Function IsElementAccessInitializer(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsElementAccessInitializer 1808Public Function IsObjectMemberInitializer(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsObjectMemberInitializer 1812Public Function IsObjectCollectionInitializer(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsObjectCollectionInitializer 1820Public Sub GetPartsOfArgumentList(node As SyntaxNode, ByRef openParenToken As SyntaxToken, ByRef arguments As SeparatedSyntaxList(Of SyntaxNode), ByRef closeParenToken As SyntaxToken) Implements ISyntaxFacts.GetPartsOfArgumentList 1827Public Sub GetPartsOfAttribute(node As SyntaxNode, ByRef name As SyntaxNode, ByRef argumentList As SyntaxNode) Implements ISyntaxFacts.GetPartsOfAttribute 1833Public Sub GetPartsOfBaseObjectCreationExpression(node As SyntaxNode, ByRef argumentList As SyntaxNode, ByRef initializer As SyntaxNode) Implements ISyntaxFacts.GetPartsOfBaseObjectCreationExpression 1839Public Sub GetPartsOfBinaryExpression(node As SyntaxNode, ByRef left As SyntaxNode, ByRef operatorToken As SyntaxToken, ByRef right As SyntaxNode) Implements ISyntaxFacts.GetPartsOfBinaryExpression 1846Public Sub GetPartsOfCompilationUnit(node As SyntaxNode, ByRef [imports] As SyntaxList(Of SyntaxNode), ByRef attributeLists As SyntaxList(Of SyntaxNode), ByRef members As SyntaxList(Of SyntaxNode)) Implements ISyntaxFacts.GetPartsOfCompilationUnit 1853Public Sub GetPartsOfConditionalAccessExpression(node As SyntaxNode, ByRef expression As SyntaxNode, ByRef operatorToken As SyntaxToken, ByRef whenNotNull As SyntaxNode) Implements ISyntaxFacts.GetPartsOfConditionalAccessExpression 1860Public Sub GetPartsOfConditionalExpression(node As SyntaxNode, ByRef condition As SyntaxNode, ByRef whenTrue As SyntaxNode, ByRef whenFalse As SyntaxNode) Implements ISyntaxFacts.GetPartsOfConditionalExpression 1867Public Function GetExpressionOfForeachStatement(statement As SyntaxNode) As SyntaxNode Implements ISyntaxFacts.GetExpressionOfForeachStatement 1871Public Sub GetPartsOfInterpolationExpression(node As SyntaxNode, ByRef stringStartToken As SyntaxToken, ByRef contents As SyntaxList(Of SyntaxNode), ByRef stringEndToken As SyntaxToken) Implements ISyntaxFacts.GetPartsOfInterpolationExpression 1878Public Sub GetPartsOfInvocationExpression(node As SyntaxNode, ByRef expression As SyntaxNode, ByRef argumentList As SyntaxNode) Implements ISyntaxFacts.GetPartsOfInvocationExpression 1884Public Sub GetPartsOfGenericName(node As SyntaxNode, ByRef identifier As SyntaxToken, ByRef typeArguments As SeparatedSyntaxList(Of SyntaxNode)) Implements ISyntaxFacts.GetPartsOfGenericName 1890Public Sub GetPartsOfMemberAccessExpression(node As SyntaxNode, ByRef expression As SyntaxNode, ByRef operatorToken As SyntaxToken, ByRef name As SyntaxNode) Implements ISyntaxFacts.GetPartsOfMemberAccessExpression 1897Public Sub GetPartsOfBaseNamespaceDeclaration(node As SyntaxNode, ByRef name As SyntaxNode, ByRef [imports] As SyntaxList(Of SyntaxNode), ByRef members As SyntaxList(Of SyntaxNode)) Implements ISyntaxFacts.GetPartsOfBaseNamespaceDeclaration 1904Public Sub GetPartsOfNamedMemberInitializer(node As SyntaxNode, ByRef identifier As SyntaxNode, ByRef expression As SyntaxNode) Implements ISyntaxFacts.GetPartsOfNamedMemberInitializer 1910Public Sub GetPartsOfObjectCreationExpression(node As SyntaxNode, ByRef keyword As SyntaxToken, ByRef type As SyntaxNode, ByRef argumentList As SyntaxNode, ByRef initializer As SyntaxNode) Implements ISyntaxFacts.GetPartsOfObjectCreationExpression 1918Public Sub GetPartsOfImplicitObjectCreationExpression(node As SyntaxNode, ByRef keyword As SyntaxToken, ByRef argumentList As SyntaxNode, ByRef initializer As SyntaxNode) Implements ISyntaxFacts.GetPartsOfImplicitObjectCreationExpression 1922Public Sub GetPartsOfParameter(node As SyntaxNode, ByRef identifier As SyntaxToken, ByRef [default] As SyntaxNode) Implements ISyntaxFacts.GetPartsOfParameter 1928Public Sub GetPartsOfParenthesizedExpression(node As SyntaxNode, ByRef openParen As SyntaxToken, ByRef expression As SyntaxNode, ByRef closeParen As SyntaxToken) Implements ISyntaxFacts.GetPartsOfParenthesizedExpression 1935Public Sub GetPartsOfPrefixUnaryExpression(node As SyntaxNode, ByRef operatorToken As SyntaxToken, ByRef operand As SyntaxNode) Implements ISyntaxFacts.GetPartsOfPrefixUnaryExpression 1941Public Sub GetPartsOfQualifiedName(node As SyntaxNode, ByRef left As SyntaxNode, ByRef dotToken As SyntaxToken, ByRef right As SyntaxNode) Implements ISyntaxFacts.GetPartsOfQualifiedName 1952Public Function GetArgumentListOfImplicitElementAccess(node As SyntaxNode) As SyntaxNode Implements ISyntaxFacts.GetArgumentListOfImplicitElementAccess 1956Public Function GetAttributesOfAttributeList(node As SyntaxNode) As SeparatedSyntaxList(Of SyntaxNode) Implements ISyntaxFacts.GetAttributesOfAttributeList 1960Public Function GetExpressionOfAwaitExpression(node As SyntaxNode) As SyntaxNode Implements ISyntaxFacts.GetExpressionOfAwaitExpression 1964Public Function GetExpressionOfThrowExpression(node As SyntaxNode) As SyntaxNode Implements ISyntaxFacts.GetExpressionOfThrowExpression 1968Public Function GetExpressionOfThrowStatement(node As SyntaxNode) As SyntaxNode Implements ISyntaxFacts.GetExpressionOfThrowStatement 1972Public Function GetInitializersOfObjectMemberInitializer(node As SyntaxNode) As SeparatedSyntaxList(Of SyntaxNode) Implements ISyntaxFacts.GetInitializersOfObjectMemberInitializer 1981Public Function GetExpressionsOfObjectCollectionInitializer(node As SyntaxNode) As SeparatedSyntaxList(Of SyntaxNode) Implements ISyntaxFacts.GetExpressionsOfObjectCollectionInitializer 1990Public Function GetTokenOfLiteralExpression(node As SyntaxNode) As SyntaxToken Implements ISyntaxFacts.GetTokenOfLiteralExpression
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Utilities\CastAnalyzer.vb (1)
142Private Shared Function AsTypeInVariableDeclarator(node As SyntaxNode, semanticModel As SemanticModel) As ITypeSymbol
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Utilities\SpeculationAnalyzer.vb (19)
55Protected Overrides Function GetSemanticRootForSpeculation(expression As ExpressionSyntax) As SyntaxNode 70Public Shared Function CanSpeculateOnNode(node As SyntaxNode) As Boolean 79Protected Overrides Function GetSemanticRootOfReplacedExpression(semanticRootOfOriginalExpr As SyntaxNode, annotatedReplacedExpression As ExpressionSyntax) As SyntaxNode 100Protected Overrides Sub ValidateSpeculativeSemanticModel(speculativeSemanticModel As SemanticModel, nodeToSpeculate As SyntaxNode) 107Protected Overrides Function CreateSpeculativeSemanticModel(originalNode As SyntaxNode, nodeToSpeculate As SyntaxNode, semanticModel As SemanticModel) As SemanticModel 111Public Shared Function CreateSpeculativeSemanticModelForNode(originalNode As SyntaxNode, nodeToSpeculate As SyntaxNode, semanticModel As SemanticModel) As SemanticModel 117Public Shared Function CreateSpeculativeSemanticModelForNode(nodeToSpeculate As SyntaxNode, semanticModel As SemanticModel, position As Integer, isInNamespaceOrTypeContext As Boolean) As SemanticModel 250Dim originalLambdaBody As SyntaxNode, replacedLambdaBody As SyntaxNode 320originalRoot As SyntaxNode) As Boolean 338Protected Overrides Function ReplacementChangesSemanticsForNodeLanguageSpecific(currentOriginalNode As SyntaxNode, currentReplacedNode As SyntaxNode, previousOriginalNode As SyntaxNode, previousReplacedNode As SyntaxNode) As Boolean 449Protected Overrides Function ExpressionMightReferenceMember(node As SyntaxNode) As Boolean 539Protected Overrides Function IsParenthesizedExpression(node As SyntaxNode) As Boolean
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\ArgumentGenerator.vb (2)
9Public Function GenerateArgument(argument As SyntaxNode) As ArgumentSyntax 17Friend Function GenerateArgumentList(arguments As IList(Of SyntaxNode)) As ArgumentListSyntax
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\ConstructorGenerator.vb (2)
13Private Function LastConstructorOrField(Of TDeclaration As SyntaxNode)(members As SyntaxList(Of TDeclaration)) As TDeclaration 106Private Function CreateThisConstructorCall(arguments As IList(Of SyntaxNode)) As StatementSyntax
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\FieldGenerator.vb (1)
15Private Function LastField(Of TDeclaration As SyntaxNode)(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\MethodGenerator.vb (1)
113Private Shared Function GenerateHandlesClause(expressions As IList(Of SyntaxNode)) As HandlesClauseSyntax
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\NamespaceGenerator.vb (8)
44Public Function GenerateNamespaceDeclaration(service As ICodeGenerationService, [namespace] As INamespaceSymbol, options As CodeGenerationContextInfo, cancellationToken As CancellationToken) As SyntaxNode 59declaration As SyntaxNode, 62cancellationToken As CancellationToken) As SyntaxNode 68Private Function GetDeclarationSyntaxWithoutMembers([namespace] As INamespaceSymbol, innermostNamespace As INamespaceSymbol, name As String, options As CodeGenerationContextInfo) As SyntaxNode 69Dim reusableSyntax = GetReuseableSyntaxNodeForSymbol(Of SyntaxNode)([namespace], options) 77Private Function RemoveAllMembers(declaration As SyntaxNode) As SyntaxNode 88Private Function GenerateNamespaceDeclarationWorker(name As String, [namespace] As INamespaceSymbol) As SyntaxNode
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\PropertyGenerator.vb (1)
14Private Function LastPropertyOrField(Of TDeclaration As SyntaxNode)(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\StatementGenerator.vb (1)
11Friend Function GenerateStatements(statements As IEnumerable(Of SyntaxNode)) As SyntaxList(Of StatementSyntax)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\VisualBasicCodeGenerationHelpers.vb (12)
91Public Function FirstMember(Of TDeclaration As SyntaxNode)(members As SyntaxList(Of TDeclaration)) As TDeclaration 95Public Function FirstMethod(Of TDeclaration As SyntaxNode)(members As SyntaxList(Of TDeclaration)) As TDeclaration 99Public Function LastField(Of TDeclaration As SyntaxNode)(members As SyntaxList(Of TDeclaration)) As TDeclaration 103Public Function LastConstructor(Of TDeclaration As SyntaxNode)(members As SyntaxList(Of TDeclaration)) As TDeclaration 107Public Function LastMethod(Of TDeclaration As SyntaxNode)(members As SyntaxList(Of TDeclaration)) As TDeclaration 111Public Function LastOperator(Of TDeclaration As SyntaxNode)(members As SyntaxList(Of TDeclaration)) As TDeclaration 115Private Function AfterDeclaration(Of TDeclaration As SyntaxNode)( 121Private Function BeforeDeclaration(Of TDeclaration As SyntaxNode)( 127Public Function Insert(Of TDeclaration As SyntaxNode)( 151Public Function GetDestination(destination As SyntaxNode) As CodeGenerationDestination 176Public Function ConditionallyAddDocumentationCommentTo(Of TSyntaxNode As SyntaxNode)( 198Public Function GetReuseableSyntaxNodeForSymbol(Of T As SyntaxNode)(symbol As ISymbol, options As CodeGenerationContextInfo) As T
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\VisualBasicCodeGenerationService.vb (37)
41Public Overloads Overrides Function GetDestination(containerNode As SyntaxNode) As CodeGenerationDestination 45Protected Overrides Function GetMemberComparer() As IComparer(Of SyntaxNode) 49Protected Overrides Function GetAvailableInsertionIndices(destination As SyntaxNode, cancellationToken As CancellationToken) As IList(Of Boolean) 92Protected Overrides Function AddEvent(Of TDeclarationNode As SyntaxNode)( 102Protected Overrides Function AddField(Of TDeclarationNode As SyntaxNode)( 118Protected Overrides Function AddProperty(Of TDeclarationNode As SyntaxNode)( 133Protected Overrides Function AddMethod(Of TDeclarationNode As SyntaxNode)( 177Protected Overloads Overrides Function AddNamedType(Of TDeclarationNode As SyntaxNode)( 193Protected Overrides Function AddNamespace(Of TDeclarationNode As SyntaxNode)( 208Public Overrides Function AddParameters(Of TDeclarationNode As SyntaxNode)( 236Protected Overrides Function AddMembers(Of TDeclarationNode As SyntaxNode)(destination As TDeclarationNode, members As IEnumerable(Of SyntaxNode)) As TDeclarationNode 249Private Overloads Function AddParametersToMethod(Of TDeclarationNode As SyntaxNode)( 284Private Overloads Function AddParametersToProperty(Of TDeclarationNode As SyntaxNode)( 291Dim newPropertyBlock As SyntaxNode = propertyBlock.WithPropertyStatement(newPropertyStatement) 325Public Overrides Function AddAttributes(Of TDeclarationNode As SyntaxNode)( 359Public Overrides Function RemoveAttribute(Of TDeclarationNode As SyntaxNode)(destination As TDeclarationNode, attributeToRemove As AttributeData, options As VisualBasicCodeGenerationContextInfo, cancellationToken As CancellationToken) As TDeclarationNode 368Public Overrides Function RemoveAttribute(Of TDeclarationNode As SyntaxNode)(destination As TDeclarationNode, attributeToRemove As SyntaxNode, options As VisualBasicCodeGenerationContextInfo, cancellationToken As CancellationToken) As TDeclarationNode 409Private Shared Function RemoveAttributeFromAttributeLists(attributeLists As SyntaxList(Of AttributeListSyntax), attributeToRemove As SyntaxNode, 438Private Shared Function RemoveAttributeFromAttributeStatements(attributeStatements As SyntaxList(Of AttributesStatementSyntax), attributeToRemove As SyntaxNode, 459Public Overrides Function AddStatements(Of TDeclarationNode As SyntaxNode)( 461statements As IEnumerable(Of SyntaxNode), 492Private Shared Function AddStatementsWorker(Of TDeclarationNode As SyntaxNode)( 494statements As IEnumerable(Of SyntaxNode), 509Dim newBlock As SyntaxNode 530cancellationToken As CancellationToken) As SyntaxNode 551cancellationToken As CancellationToken) As SyntaxNode 558cancellationToken As CancellationToken) As SyntaxNode 569cancellationToken As CancellationToken) As SyntaxNode 576cancellationToken As CancellationToken) As SyntaxNode 583cancellationToken As CancellationToken) As SyntaxNode 587Private Overloads Shared Function UpdateDeclarationModifiers(Of TDeclarationNode As SyntaxNode)(declaration As TDeclarationNode, computeNewModifiersList As Func(Of SyntaxTokenList, SyntaxTokenList)) As TDeclarationNode 633Public Overrides Function UpdateDeclarationModifiers(Of TDeclarationNode As SyntaxNode)(declaration As TDeclarationNode, newModifiers As IEnumerable(Of SyntaxToken), options As VisualBasicCodeGenerationContextInfo, cancellationToken As CancellationToken) As TDeclarationNode 641Public Overrides Function UpdateDeclarationAccessibility(Of TDeclarationNode As SyntaxNode)(declaration As TDeclarationNode, newAccessibility As Accessibility, options As VisualBasicCodeGenerationContextInfo, cancellationToken As CancellationToken) As TDeclarationNode 696Public Overrides Function UpdateDeclarationType(Of TDeclarationNode As SyntaxNode)(declaration As TDeclarationNode, newType As ITypeSymbol, options As VisualBasicCodeGenerationContextInfo, cancellationToken As CancellationToken) As TDeclarationNode 758Public Overrides Function UpdateDeclarationMembers(Of TDeclarationNode As SyntaxNode)(declaration As TDeclarationNode, newMembers As IList(Of ISymbol), options As VisualBasicCodeGenerationContextInfo, cancellationToken As CancellationToken) As TDeclarationNode
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\VisualBasicDeclarationComparer.vb (9)
9Implements IComparer(Of SyntaxNode) 72Public Function Compare(x As SyntaxNode, y As SyntaxNode) As Integer Implements IComparer(Of SyntaxNode).Compare 126Private Shared Function ConvertBlockToStatement(node As SyntaxNode) As SyntaxNode 302Private Shared Function GetAccessibilityPrecedence(declaration As SyntaxNode, modifiers As IEnumerable(Of SyntaxToken)) As Integer 377Private Shared Function EqualAccessibility(x As SyntaxNode, xModifiers As SyntaxTokenList, y As SyntaxNode, yModifiers As SyntaxTokenList, ByRef comparisonResult As Integer) As Boolean
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\VisualBasicFlagsEnumGenerator.vb (1)
21constantValue As Object) As SyntaxNode
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeRefactorings\VisualBasicRefactoringHelpersService.vb (5)
25Public Overrides Function IsBetweenTypeMembers(sourceText As SourceText, root As SyntaxNode, position As Integer, ByRef typeDeclaration As SyntaxNode) As Boolean 68Protected Overrides Iterator Function ExtractNodesSimple(node As SyntaxNode, syntaxFacts As ISyntaxFactsService) As IEnumerable(Of SyntaxNode) 104Public Shared Function IsIdentifierOfParameter(node As SyntaxNode) As Boolean
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Editing\VisualBasicImportAdder.vb (7)
25Protected Overrides Function GetExplicitNamespaceSymbol(node As SyntaxNode, model As SemanticModel) As INamespaceSymbol 39Protected Overrides Function AddPotentiallyConflictingImportsAsync(model As SemanticModel, container As SyntaxNode, namespaceSymbols As ImmutableArray(Of INamespaceSymbol), conflicts As HashSet(Of INamespaceSymbol), cancellationToken As CancellationToken) As Task 128Public Async Function AddPotentiallyConflictingImportsAsync(container As SyntaxNode, conflicts As HashSet(Of INamespaceSymbol), cancellationToken As CancellationToken) As Task 129Dim nodes = ArrayBuilder(Of SyntaxNode).GetInstance() 135Function(node As SyntaxNode, onItemsFound As Action(Of INamespaceSymbol), conflictFinder As ConflictFinder, cancellationToken1 As CancellationToken) As Task 155Private Sub CollectInfoFromContainer(container As SyntaxNode, nodes As ArrayBuilder(Of SyntaxNode), ByRef containsAnonymousMethods As Boolean)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\CompilationUnitSyntaxExtensions.vb (1)
19Public Function CanAddImportsStatements(contextNode As SyntaxNode, allowInHiddenRegions As Boolean, cancellationToken As CancellationToken) As Boolean
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ContextQuery\IsStatementTerminatingTokenVisitor.vb (1)
24Public Overrides Function DefaultVisit(node As SyntaxNode) As Boolean
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ContextQuery\SyntaxTreeExtensions.vb (2)
810Friend Function IsFollowingCompleteExpression(Of TParent As SyntaxNode)( 853Friend Function GetExpressionTerminatingToken(expression As SyntaxNode) As SyntaxToken
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ContextQuery\VisualBasicSyntaxContext.vb (1)
231For Each node In targetToken.GetAncestors(Of SyntaxNode)()
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ContextQuery\VisualBasicSyntaxContextExtensions.vb (2)
38Friend Function IsFollowingCompleteStatement(Of TParent As SyntaxNode)(context As VisualBasicSyntaxContext, childGetter As Func(Of TParent, StatementSyntax)) As Boolean 82Private Function IsInStatementBlockHelper(Of TArg)(context As VisualBasicSyntaxContext, predicate As Func(Of SyntaxNode, TArg, Boolean), arg As TArg) As Boolean
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ExpressionSyntaxExtensions.vb (3)
221Public Function GetImplicitMemberAccessExpressions(expression As SyntaxNode, span As TextSpan) As IEnumerable(Of ExpressionSyntax) 237Public Function GetImplicitMemberAccessExpressions(expression As SyntaxNode) As IEnumerable(Of ExpressionSyntax) 241Private Function ContainsImplicitMemberAccessWorker(expression As SyntaxNode) As Boolean
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\INamespaceOrTypeSymbolExtensions.vb (1)
19Public Function GetAliasForSymbol(symbol As INamespaceOrTypeSymbol, node As SyntaxNode, semanticModel As SemanticModel) As IAliasSymbol
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\SyntaxListExtensions.vb (3)
10Public Function RemoveRange(Of T As SyntaxNode)(syntaxList As SyntaxList(Of T), index As Integer, count As Integer) As SyntaxList(Of T) 17Public Function ToSyntaxList(Of T As SyntaxNode)(sequence As IEnumerable(Of T)) As SyntaxList(Of T) 22Public Function Insert(Of T As SyntaxNode)(syntaxList As SyntaxList(Of T), index As Integer, item As T) As SyntaxList(Of T)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\TypeBlockSyntaxExtensions.vb (2)
44Private Function ReplaceTrailingColonToEndOfLineTrivia(Of TNode As SyntaxNode)(node As TNode) As TNode 48Private Function EnsureProperList(Of TSyntax As SyntaxNode)(list As SyntaxList(Of TSyntax)) As SyntaxList(Of TSyntax)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Indentation\SpecialFormattingOperation.vb (10)
22Public Overrides Sub AddSuppressOperationsSlow(list As ArrayBuilder(Of SuppressOperation), node As SyntaxNode, ByRef nextOperation As NextSuppressOperationAction) 57Public Overrides Sub AddIndentBlockOperationsSlow(list As List(Of IndentBlockOperation), node As SyntaxNode, ByRef nextOperation As NextIndentBlockOperationAction) 83Private Overloads Shared Sub AddIndentBlockOperations(Of T As SyntaxNode)(list As List(Of IndentBlockOperation), node As SyntaxNode, predicate As Func(Of T, Boolean), Optional indentationDelta As Integer = 0) 96Private Overloads Shared Sub AddIndentBlockOperations(list As List(Of IndentBlockOperation), parameterOrArgumentList As SyntaxNode, indentationDelta As Integer) 113Private Shared Sub AddArgumentListIndentBlockOperations(operations As List(Of IndentBlockOperation), node As SyntaxNode) 169Public Overrides Sub AddAlignTokensOperationsSlow(operations As List(Of AlignTokensOperation), node As SyntaxNode, ByRef nextAction As NextAlignTokensOperationAction) 184Private Shared Sub AddCaseClauseAlignTokensOperations(operations As List(Of AlignTokensOperation), node As SyntaxNode) 201Private Overloads Shared Sub AddAlignTokensOperations(Of T As SyntaxNode)(operations As List(Of AlignTokensOperation), node As SyntaxNode, baseTokenGetter As Func(Of T, SyntaxToken))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Indentation\VisualBasicIndentationService.Indenter.vb (1)
215Private Shared Function ContainingStatementHasDiagnostic(node As SyntaxNode) As Boolean
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicAddImportsService.vb (13)
40Protected Overrides Function IsEquivalentImport(a As SyntaxNode, b As SyntaxNode) As Boolean 51Protected Overrides Function GetGlobalImports(compilation As Compilation, generator As SyntaxGenerator) As ImmutableArray(Of SyntaxNode) 52Dim result = ArrayBuilder(Of SyntaxNode).GetInstance() 63Protected Overrides Function GetAlias(usingOrAlias As ImportsStatementSyntax) As SyntaxNode 79Protected Overrides Function GetExterns(node As SyntaxNode) As SyntaxList(Of ImportsStatementSyntax) 83Protected Overrides Function GetUsingsAndAliases(node As SyntaxNode) As SyntaxList(Of ImportsStatementSyntax) 96externContainer As SyntaxNode, 97usingContainer As SyntaxNode, 98staticUsingContainer As SyntaxNode, 99aliasContainer As SyntaxNode, 101root As SyntaxNode, 102cancellationToken As CancellationToken) As SyntaxNode
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicMoveDeclarationNearReferenceService.vb (5)
25Protected Overrides Function IsMeaningfulBlock(node As SyntaxNode) As Boolean 33Protected Overrides Function GetVariableDeclaratorSymbolNode(variableDeclarator As VariableDeclaratorSyntax) As SyntaxNode 45Protected Overrides Function TypesAreCompatibleAsync(document As Document, localSymbol As ILocalSymbol, declarationStatement As LocalDeclarationStatementSyntax, right As SyntaxNode, cancellationToken As CancellationToken) As Task(Of Boolean) 49Protected Overrides Function CanMoveToBlock(localSymbol As ILocalSymbol, currentBlock As SyntaxNode, destinationBlock As SyntaxNode) As Boolean
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicRemoveUnnecessaryImportsService.vb (2)
28predicate As Func(Of SyntaxNode, Boolean), 31predicate = If(predicate, Functions(Of SyntaxNode).True)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicSemanticFactsService.vb (12)
107semanticModel As SemanticModel, location As SyntaxNode, containerOpt As SyntaxNode, baseName As String, cancellationToken As CancellationToken) As SyntaxToken Implements ISemanticFactsService.GenerateUniqueName 112semanticModel As SemanticModel, location As SyntaxNode, containerOpt As SyntaxNode, baseName As String, usedNames As IEnumerable(Of String), cancellationToken As CancellationToken) As SyntaxToken Implements ISemanticFactsService.GenerateUniqueName 117semanticModel As SemanticModel, location As SyntaxNode, containerOpt As SyntaxNode, baseName As String, cancellationToken As CancellationToken) As SyntaxToken Implements ISemanticFactsService.GenerateUniqueLocalName 122semanticModel As SemanticModel, location As SyntaxNode, containerOpt As SyntaxNode, baseName As String, usedName As IEnumerable(Of String), cancellationToken As CancellationToken) As SyntaxToken Implements ISemanticFactsService.GenerateUniqueLocalName 126Private Function ISemanticFactsService_GenerateUniqueName(semanticModel As SemanticModel, location As SyntaxNode, containerOpt As SyntaxNode, baseName As String, filter As Func(Of ISymbol, Boolean), usedNames As IEnumerable(Of String), cancellationToken As CancellationToken) As SyntaxToken Implements ISemanticFactsService.GenerateUniqueName 134Public Function ClassifyConversion(semanticModel As SemanticModel, expression As SyntaxNode, destination As ITypeSymbol) As CommonConversion Implements ISemanticFactsService.ClassifyConversion 138Public Function TryGetDisposeMethod(semanticModel As SemanticModel, node As SyntaxNode, cancellationToken As CancellationToken) As IMethodSymbol Implements ISemanticFactsService.TryGetDisposeMethod
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicSymbolDeclarationService.vb (2)
42Public Overrides Function GetSyntax(Optional cancellationToken As CancellationToken = Nothing) As SyntaxNode 46Public Overrides Async Function GetSyntaxAsync(Optional cancellationToken As CancellationToken = Nothing) As Task(Of SyntaxNode)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicSyntaxFactsService.vb (4)
31Public Sub AddFirstMissingCloseBrace(Of TContextNode As SyntaxNode)( 32root As SyntaxNode, contextNode As TContextNode, 33ByRef newRoot As SyntaxNode, ByRef newContextNode As TContextNode) Implements ISyntaxFactsService.AddFirstMissingCloseBrace 39Public Function GetSelectedFieldsAndPropertiesAsync(tree As SyntaxTree, textSpan As TextSpan, allowPartialSelection As Boolean, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of SyntaxNode)) Implements ISyntaxFactsService.GetSelectedFieldsAndPropertiesAsync
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicSyntaxGeneratorInternal.vb (86)
57Public Overloads Overrides Function LocalDeclarationStatement(type As SyntaxNode, identifier As SyntaxToken, Optional initializer As SyntaxNode = Nothing, Optional isConst As Boolean = False) As SyntaxNode 63Public Overrides Function WithInitializer(variableDeclarator As SyntaxNode, initializer As SyntaxNode) As SyntaxNode 67Public Overrides Function EqualsValueClause(operatorToken As SyntaxToken, value As SyntaxNode) As SyntaxNode 71Friend Shared Function VariableDeclarator(type As SyntaxNode, name As ModifiedIdentifierSyntax, Optional expression As SyntaxNode = Nothing) As VariableDeclaratorSyntax 84Public Overrides Function ConditionalAccessExpression(expression As SyntaxNode, whenNotNull As SyntaxNode) As SyntaxNode 90Public Overrides Function MemberBindingExpression(name As SyntaxNode) As SyntaxNode 94Public Overrides Function RefExpression(expression As SyntaxNode) As SyntaxNode 98Public Overrides Function AddParentheses(expression As SyntaxNode, Optional includeElasticTrivia As Boolean = True, Optional addSimplifierAnnotation As Boolean = True) As SyntaxNode 102Friend Shared Function Parenthesize(expression As SyntaxNode, Optional addSimplifierAnnotation As Boolean = True) As ParenthesizedExpressionSyntax 106Public Overrides Function YieldReturnStatement(expression As SyntaxNode) As SyntaxNode 116Public Overrides Function InterpolatedStringExpression(startToken As SyntaxToken, content As IEnumerable(Of SyntaxNode), endToken As SyntaxToken) As SyntaxNode 121Public Overrides Function InterpolatedStringText(textToken As SyntaxToken) As SyntaxNode 129Public Overrides Function Interpolation(syntaxNode As SyntaxNode) As SyntaxNode 133Public Overrides Function InterpolationAlignmentClause(alignment As SyntaxNode) As SyntaxNode 139Public Overrides Function InterpolationFormatClause(format As String) As SyntaxNode 145Public Overrides Function TypeParameterList(typeParameterNames As IEnumerable(Of String)) As SyntaxNode 151Public Overrides Function Type(typeSymbol As ITypeSymbol, typeContext As Boolean) As SyntaxNode 155Public Overrides Function NegateEquality(generator As SyntaxGenerator, node As SyntaxNode, left As SyntaxNode, negatedKind As Operations.BinaryOperatorKind, right As SyntaxNode) As SyntaxNode 170Public Overrides Function IsNotTypeExpression(expression As SyntaxNode, type As SyntaxNode) As SyntaxNode 176type As SyntaxNode, 179Optional parameters As IEnumerable(Of SyntaxNode) = Nothing, 180Optional addAccessorStatements As IEnumerable(Of SyntaxNode) = Nothing, 181Optional removeAccessorStatements As IEnumerable(Of SyntaxNode) = Nothing, 182Optional raiseAccessorStatements As IEnumerable(Of SyntaxNode) = Nothing) As SyntaxNode 192addAccessorStatements = SpecializedCollections.EmptyEnumerable(Of SyntaxNode)() 196removeAccessorStatements = SpecializedCollections.EmptyEnumerable(Of SyntaxNode)() 200raiseAccessorStatements = SpecializedCollections.EmptyEnumerable(Of SyntaxNode)() 224Friend Shared Function CreateAddHandlerAccessorBlock(delegateType As SyntaxNode, statements As IEnumerable(Of SyntaxNode)) As AccessorBlockSyntax 246Friend Shared Function CreateRemoveHandlerAccessorBlock(delegateType As SyntaxNode, statements As IEnumerable(Of SyntaxNode)) As AccessorBlockSyntax 268Friend Shared Function CreateRaiseEventAccessorBlock(parameters As IEnumerable(Of SyntaxNode), statements As IEnumerable(Of SyntaxNode)) As AccessorBlockSyntax 283Friend Shared Function GetStatementList(nodes As IEnumerable(Of SyntaxNode)) As SyntaxList(Of StatementSyntax) 291Friend Shared Function AsStatement(node As SyntaxNode) As StatementSyntax 360Friend Shared Function GetParameterList(parameters As IEnumerable(Of SyntaxNode)) As ParameterListSyntax 364Friend Shared Function GetModifierList(accessibility As Accessibility, modifiers As DeclarationModifiers, declaration As SyntaxNode, kind As DeclarationKind, Optional isDefault As Boolean = False) As SyntaxTokenList 465Public Overrides Function IsPatternExpression(expression As SyntaxNode, isToken As SyntaxToken, pattern As SyntaxNode) As SyntaxNode 469Public Overrides Function AndPattern(left As SyntaxNode, right As SyntaxNode) As SyntaxNode 473Public Overrides Function ConstantPattern(expression As SyntaxNode) As SyntaxNode 477Public Overrides Function DeclarationPattern(type As INamedTypeSymbol, name As String) As SyntaxNode 481Public Overrides Function LessThanRelationalPattern(expression As SyntaxNode) As SyntaxNode 485Public Overrides Function LessThanEqualsRelationalPattern(expression As SyntaxNode) As SyntaxNode 489Public Overrides Function GreaterThanRelationalPattern(expression As SyntaxNode) As SyntaxNode 493Public Overrides Function GreaterThanEqualsRelationalPattern(expression As SyntaxNode) As SyntaxNode 497Public Overrides Function NotPattern(pattern As SyntaxNode) As SyntaxNode 501Public Overrides Function OrPattern(left As SyntaxNode, right As SyntaxNode) As SyntaxNode 505Public Overrides Function ParenthesizedPattern(pattern As SyntaxNode) As SyntaxNode 509Public Overrides Function TypePattern(type As SyntaxNode) As SyntaxNode 513Public Overrides Function UnaryPattern(operatorToken As SyntaxToken, pattern As SyntaxNode) As SyntaxNode
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicTypeInferenceService.TypeInferrer.vb (3)
27Protected Overrides Function GetTypes_DoNotCallDirectly(node As SyntaxNode, objectAsDefault As Boolean) As IEnumerable(Of TypeInferenceInfo) 51Protected Overrides Function InferTypesWorker_DoNotCallDirectly(node As SyntaxNode) As IEnumerable(Of TypeInferenceInfo) 982parameterName As String, node As SyntaxNode) As ITypeSymbol
Utilities\IntrinsicOperators\AbstractCastExpressionDocumentation.vb (1)
45Public Overrides Function TryGetTypeNameParameter(syntaxNode As SyntaxNode, index As Integer) As TypeSyntax
Utilities\IntrinsicOperators\AbstractIntrinsicOperatorDocumentation.vb (2)
30Public Overridable Function TryGetTypeNameParameter(syntaxNode As SyntaxNode, index As Integer) As TypeSyntax 34Public Overridable Function GetSuffix(semanticModel As SemanticModel, position As Integer, nodeToBind As SyntaxNode, cancellationToken As CancellationToken) As IList(Of SymbolDisplayPart)
Utilities\IntrinsicOperators\GetTypeExpressionDocumentation.vb (1)
56Public Overrides Function TryGetTypeNameParameter(syntaxNode As SyntaxNode, index As Integer) As TypeSyntax
Utilities\IntrinsicOperators\MidAssignmentDocumentation.vb (1)
63Public Overrides Function GetSuffix(semanticModel As SemanticModel, position As Integer, nodeToBind As SyntaxNode, cancellationToken As CancellationToken) As IList(Of SymbolDisplayPart)
Workspace\LanguageServices\VisualBasicSyntaxTreeFactoryService.NodeSyntaxReference.vb (3)
12Private ReadOnly _node As SyntaxNode 14Friend Sub New(node As SyntaxNode) 30Public Overrides Function GetSyntax(Optional cancellationToken As CancellationToken = Nothing) As SyntaxNode
Workspace\LanguageServices\VisualBasicSyntaxTreeFactoryService.ParsedSyntaxTree.vb (2)
76Public Overrides Function WithRootAndOptions(root As SyntaxNode, options As ParseOptions) As SyntaxTree 94Public Overrides Function GetReference(node As SyntaxNode) As SyntaxReference
Workspace\LanguageServices\VisualBasicSyntaxTreeFactoryService.vb (1)
73Public Overrides Function CreateSyntaxTree(filePath As String, options As ParseOptions, text As SourceText, encoding As Encoding, checksumAlgorithm As SourceHashAlgorithm, root As SyntaxNode) As SyntaxTree
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (18)
CodeGeneration\SyntaxGeneratorTests.vb (17)
41Private Shared Sub VerifySyntax(Of TSyntax As SyntaxNode)(type As SyntaxNode, expectedText As String) 48Private Shared Sub VerifySyntaxRaw(Of TSyntax As SyntaxNode)(type As SyntaxNode, expectedText As String) 454VerifySyntax(Of LocalDeclarationStatementSyntax)(Generator.LocalDeclarationStatement(DirectCast(Nothing, SyntaxNode), "y", Generator.IdentifierName("z"), isConst:=True), "Const y = z") 497Generator.IfStatement(Generator.IdentifierName("x"), New SyntaxNode() {}), 507Generator.IfStatement(Generator.IdentifierName("x"), New SyntaxNode() {}, New SyntaxNode() {}), 722Generator.ValueReturningLambdaExpression(New SyntaxNode() {}, Generator.IdentifierName("y")), 734Generator.VoidReturningLambdaExpression(New SyntaxNode() {}, Generator.IdentifierName("y")), 750Generator.ValueReturningLambdaExpression(New SyntaxNode() {}, {Generator.ReturnStatement(Generator.IdentifierName("y"))}), 768Generator.VoidReturningLambdaExpression(New SyntaxNode() {}, {Generator.IdentifierName("y")}), 2286Private Sub CheckAddRemoveAttribute(declaration As SyntaxNode) 3140Private Sub AssertNamesEqual(expectedNames As String(), actualNodes As IReadOnlyList(Of SyntaxNode)) 3148Private Sub AssertMemberNamesEqual(expectedNames As String(), declaration As SyntaxNode) 3152Private Sub AssertMemberNamesEqual(expectedName As String, declaration As SyntaxNode) 3193Private Sub TestRemoveAllMembers(declaration As SyntaxNode)
Formatting\VisualBasicFormattingTestBase.vb (1)
32Protected Overrides Function ParseCompilation(text As String, parseOptions As ParseOptions) As SyntaxNode
Microsoft.CodeAnalysis.Workspaces (3109)
CaseCorrection\AbstractCaseCorrectionService.cs (7)
20protected abstract void AddReplacements(SemanticModel? semanticModel, SyntaxNode root, ImmutableArray<TextSpan> spans, ConcurrentDictionary<SyntaxToken, SyntaxToken> replacements, CancellationToken cancellationToken); 29var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 37var newRoot = CaseCorrect(semanticModel, root, spans, cancellationToken); 41public SyntaxNode CaseCorrect(SyntaxNode root, ImmutableArray<TextSpan> spans, CancellationToken cancellationToken) 44private SyntaxNode CaseCorrect(SemanticModel? semanticModel, SyntaxNode root, ImmutableArray<TextSpan> spans, CancellationToken cancellationToken)
CaseCorrection\CaseCorrector.cs (4)
28var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 43var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 69internal static SyntaxNode CaseCorrect(SyntaxNode root, ImmutableArray<TextSpan> spans, SolutionServices services, CancellationToken cancellationToken = default)
CaseCorrection\ICaseCorrectionService.cs (2)
23SyntaxNode CaseCorrect(SyntaxNode root, ImmutableArray<TextSpan> spans, CancellationToken cancellationToken);
ChangeNamespace\IChangeNamespaceService.cs (3)
40Task<bool> CanChangeNamespaceAsync(Document document, SyntaxNode container, CancellationToken cancellationToken); 56Task<Solution> ChangeNamespaceAsync(Document document, SyntaxNode container, string targetNamespace, CancellationToken cancellationToken); 60/// use namespace containers considered valid by <see cref="CanChangeNamespaceAsync(Document, SyntaxNode, CancellationToken)"/>
Classification\AbstractClassificationService.cs (6)
28private Func<SyntaxNode, ImmutableArray<ISyntaxClassifier>>? _getNodeClassifiers; 186(Func<SyntaxNode, ImmutableArray<ISyntaxClassifier>>, Func<SyntaxToken, ImmutableArray<ISyntaxClassifier>>) GetExtensionClassifiers( 204var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 209SolutionServices services, SyntaxNode? root, ImmutableArray<TextSpan> textSpans, SegmentedList<ClassifiedSpan> result, CancellationToken cancellationToken) 232public TextChangeRange? ComputeSyntacticChangeRange(SolutionServices services, SyntaxNode oldRoot, SyntaxNode newRoot, TimeSpan timeout, CancellationToken cancellationToken)
Classification\ClassificationServiceExtensions.cs (1)
18SyntaxNode? root,
Classification\Classifier.cs (1)
90var root = semanticModel.SyntaxTree.GetRoot(cancellationToken);
Classification\IClassificationService.cs (3)
34void AddSyntacticClassifications(SolutionServices services, SyntaxNode? root, ImmutableArray<TextSpan> textSpans, SegmentedList<ClassifiedSpan> result, CancellationToken cancellationToken); 112SolutionServices workspace, SyntaxNode oldRoot, SyntaxNode newRoot,
Classification\SyntaxClassification\AbstractNameSyntaxClassifier.cs (2)
13protected abstract bool IsParentAnAttribute(SyntaxNode node); 15protected ISymbol? TryGetSymbol(SyntaxNode node, SymbolInfo symbolInfo)
Classification\SyntaxClassification\AbstractSyntaxClassificationService.cs (5)
20public abstract void AddSyntacticClassifications(SyntaxNode root, ImmutableArray<TextSpan> textSpans, SegmentedList<ClassifiedSpan> result, CancellationToken cancellationToken); 30Func<SyntaxNode, ImmutableArray<ISyntaxClassifier>> getNodeClassifiers, 51Func<SyntaxNode, ImmutableArray<ISyntaxClassifier>> getNodeClassifiers, 60public TextChangeRange? ComputeSyntacticChangeRange(SyntaxNode oldRoot, SyntaxNode newRoot, TimeSpan timeout, CancellationToken cancellationToken)
Classification\SyntaxClassification\AbstractSyntaxClassificationService.Worker.cs (6)
25private readonly Func<SyntaxNode, ImmutableArray<ISyntaxClassifier>> _getNodeClassifiers; 38Func<SyntaxNode, ImmutableArray<ISyntaxClassifier>> getNodeClassifiers, 60Func<SyntaxNode, ImmutableArray<ISyntaxClassifier>> getNodeClassifiers, 65var root = semanticModel.SyntaxTree.GetRoot(cancellationToken); 117if (nodeOrToken.AsNode(out var node)) 123private void ClassifyNode(SyntaxNode syntax)
Classification\SyntaxClassification\AbstractSyntaxClassifier.cs (1)
22public virtual void AddClassifications(SyntaxNode syntax, TextSpan textSpan, SemanticModel semanticModel, ClassificationOptions options, SegmentedList<ClassifiedSpan> result, CancellationToken cancellationToken)
Classification\SyntaxClassification\ISyntaxClassificationService.cs (5)
28SyntaxNode root, 38Func<SyntaxNode, ImmutableArray<ISyntaxClassifier>> getNodeClassifiers, 47Func<SyntaxNode, ImmutableArray<ISyntaxClassifier>> getNodeClassifiers, 60SyntaxNode oldRoot, SyntaxNode newRoot, TimeSpan timeout, CancellationToken cancellationToken);
Classification\SyntaxClassification\ISyntaxClassifier.cs (1)
29void AddClassifications(SyntaxNode node, TextSpan textSpan, SemanticModel semanticModel, ClassificationOptions options, SegmentedList<ClassifiedSpan> result, CancellationToken cancellationToken);
Classification\SyntaxClassification\SyntacticChangeRangeComputer.cs (3)
18/// cref="SyntaxNode.IsIncrementallyIdenticalTo"/>). This algorithm is intended to be <em>fast</em>. It is 41public static TextChangeRange ComputeSyntacticChangeRange(SyntaxNode oldRoot, SyntaxNode newRoot, TimeSpan timeout, CancellationToken cancellationToken)
Classification\SyntaxClassification\SyntaxClassificationExtensions.cs (3)
19SyntaxNode root, 32Func<SyntaxNode, ImmutableArray<ISyntaxClassifier>> getNodeClassifiers, 51Func<SyntaxNode, ImmutableArray<ISyntaxClassifier>> getNodeClassifiers,
CodeActions\CodeAction_Cleanup.cs (2)
143var changedRoots = await ProducerConsumer<(DocumentId documentId, SyntaxNode newRoot)>.RunParallelAsync( 164var newRoot = await cleanedDocument.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
CodeCleanup\AbstractCodeCleanerService.cs (28)
27protected abstract ImmutableArray<TextSpan> GetSpansToAvoid(SyntaxNode root); 42var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 62var annotatedRoot = newNode; 73public async Task<SyntaxNode> CleanupAsync(SyntaxNode root, ImmutableArray<TextSpan> spans, SyntaxFormattingOptions options, SolutionServices services, ImmutableArray<ICodeCleanupProvider> providers, CancellationToken cancellationToken) 104var annotatedRoot = newNode; 115SyntaxNode node, 149SyntaxNode node, 269private static (SyntaxNode newNode, List<(SyntaxAnnotation previous, SyntaxAnnotation next)> annotations) AnnotateNodeForTextSpans( 270SyntaxNode root, ImmutableArray<TextSpan> spans, CancellationToken cancellationToken) 313var newNode = InjectAnnotations(root, tokenAnnotationMap); 321SyntaxNode root, ImmutableArray<TextSpan> spans, CancellationToken cancellationToken) 359SyntaxNode root, TextSpan span, 382SyntaxNode root, TextSpan span, 404private static SyntaxToken FindTokenOnRightOfPosition(SyntaxNode root, int position) 418private static SyntaxToken FindTokenOnLeftOfPosition(SyntaxNode root, int position) 458Func<SyntaxNode, ImmutableArray<TextSpan>> spanGetter, 483var root = await currentDocument.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 521SyntaxNode root, Func<SyntaxNode, ImmutableArray<TextSpan>> spanGetter) 535private async Task<SyntaxNode> IterateAllCodeCleanupProvidersAsync( 536SyntaxNode originalRoot, 537SyntaxNode annotatedRoot, 539Func<SyntaxNode, ImmutableArray<TextSpan>> spanGetter, 546var currentRoot = annotatedRoot; 547SyntaxNode? previousRoot = null; 593private static SyntaxNode InjectAnnotations(SyntaxNode node, Dictionary<SyntaxToken, List<SyntaxAnnotation>> map)
CodeCleanup\CodeCleaner.cs (5)
62var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 87public static Task<SyntaxNode> CleanupAsync(SyntaxNode root, TextSpan span, SyntaxFormattingOptions options, SolutionServices services, ImmutableArray<ICodeCleanupProvider> providers = default, CancellationToken cancellationToken = default) 94public static Task<SyntaxNode> CleanupAsync(SyntaxNode root, ImmutableArray<TextSpan> spans, SyntaxFormattingOptions options, SolutionServices services, ImmutableArray<ICodeCleanupProvider> providers = default, CancellationToken cancellationToken = default)
CodeCleanup\ICodeCleanerService.cs (2)
37Task<SyntaxNode> CleanupAsync(SyntaxNode root, ImmutableArray<TextSpan> spans, SyntaxFormattingOptions options, SolutionServices services, ImmutableArray<ICodeCleanupProvider> providers, CancellationToken cancellationToken);
CodeCleanup\Providers\FormatCodeCleanupProvider.cs (3)
23var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 32public Task<SyntaxNode> CleanupAsync(SyntaxNode root, ImmutableArray<TextSpan> spans, SyntaxFormattingOptions options, SolutionServices services, CancellationToken cancellationToken)
CodeCleanup\Providers\ICodeCleanupProvider.cs (2)
34Task<SyntaxNode> CleanupAsync(SyntaxNode root, ImmutableArray<TextSpan> spans, SyntaxFormattingOptions options, SolutionServices services, CancellationToken cancellationToken);
CodeCleanup\Providers\SimplificationCodeCleanupProvider.cs (2)
22public Task<SyntaxNode> CleanupAsync(SyntaxNode root, ImmutableArray<TextSpan> spans, SyntaxFormattingOptions options, SolutionServices services, CancellationToken cancellationToken)
CodeFixesAndRefactorings\DocumentBasedFixAllProviderHelpers.cs (2)
70var changedRootsAndTexts = await ProducerConsumer<(DocumentId documentId, (SyntaxNode? node, SourceText? text))>.RunParallelAsync( 90var newRoot = newDocument.SupportsSyntaxTree ? await newDocument.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false) : null;
CodeRefactorings\SyntaxEditorBasedCodeRefactoringProvider.cs (2)
70var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 75var newRoot = editor.GetChangedRoot();
Differencing\AbstractSyntaxComparer.cs (38)
12internal abstract class AbstractSyntaxComparer : TreeComparer<SyntaxNode> 19protected readonly SyntaxNode? _oldRoot; 20protected readonly SyntaxNode? _newRoot; 21private readonly IEnumerable<SyntaxNode>? _oldRootChildren; 22private readonly IEnumerable<SyntaxNode>? _newRootChildren; 31SyntaxNode? oldRoot, 32SyntaxNode? newRoot, 33IEnumerable<SyntaxNode>? oldRootChildren, 34IEnumerable<SyntaxNode>? newRootChildren, 45protected internal sealed override bool TreesEqual(SyntaxNode oldNode, SyntaxNode newNode) 48protected internal sealed override TextSpan GetSpan(SyntaxNode node) 55protected abstract bool TryComputeWeightedDistance(SyntaxNode oldNode, SyntaxNode newNode, out double distance); 57protected abstract bool IsLambdaBodyStatementOrExpression(SyntaxNode node); 59protected internal override bool TryGetParent(SyntaxNode node, [NotNullWhen(true)] out SyntaxNode? parent) 76protected internal override IEnumerable<SyntaxNode>? GetChildren(SyntaxNode node) 91private IEnumerable<SyntaxNode> EnumerateChildren(SyntaxNode node) 93foreach (var child in node.ChildNodes()) 106foreach (var descendant in child.DescendantNodes(DescendIntoChildren)) 116private bool DescendIntoChildren(SyntaxNode node) 119protected internal sealed override IEnumerable<SyntaxNode> GetDescendants(SyntaxNode node) 125private IEnumerable<SyntaxNode> EnumerateDescendants(IEnumerable<SyntaxNode> nodes) 127foreach (var node in nodes) 134foreach (var descendant in EnumerateDescendants(node)) 144private IEnumerable<SyntaxNode> EnumerateDescendants(SyntaxNode node) 150var descendantNode = descendant.AsNode(); 160bool ShouldEnumerateChildren(SyntaxNode child) 179protected bool HasChildren(SyntaxNode node) 195internal bool HasLabel(SyntaxNode node) 198internal abstract int Classify(int kind, SyntaxNode? node, out bool isLeaf); 200protected internal override int GetLabel(SyntaxNode node)
Editing\DocumentEditor.cs (2)
18private DocumentEditor(Document document, SemanticModel model, SyntaxNode root) 36var root = model.SyntaxTree.GetRoot(cancellationToken);
Editing\ImportAdder.cs (2)
21var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 27var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
Editing\SymbolEditor.cs (13)
183public async Task<IReadOnlyList<SyntaxNode>> GetCurrentDeclarationsAsync(ISymbol symbol, CancellationToken cancellationToken = default) 192private IEnumerable<SyntaxNode> GetDeclarations(ISymbol symbol) 203private bool TryGetBestDeclarationForSingleEdit(ISymbol symbol, out SyntaxNode declaration) 215public delegate void DeclarationEditAction(DocumentEditor editor, SyntaxNode declaration); 224public delegate Task AsyncDeclarationEditAction(DocumentEditor editor, SyntaxNode declaration, CancellationToken cancellationToken); 242if (TryGetBestDeclarationForSingleEdit(currentSymbol, out var declaration)) 283SyntaxNode declaration, 298var newDeclaration = model.SyntaxTree.GetRoot(cancellationToken).GetCurrentNode(declaration); 374var decl = this.GetDeclarations(currentSymbol).FirstOrDefault(d => 411var declaration = this.GetDeclarations(currentSymbol).FirstOrDefault(d => memberDecls.Any(md => md.SyntaxTree == d.SyntaxTree && d.FullSpan.IntersectsWith(md.FullSpan))); 472foreach (var decl in declGroup) 487foreach (var decl in declGroup) 489var newDeclaration = model.SyntaxTree.GetRoot(cancellationToken).GetCurrentNode(decl);
Editing\SymbolEditorExtensions.cs (6)
19public static async Task<SyntaxNode> GetBaseOrInterfaceDeclarationReferenceAsync( 38foreach (var decl in currentDecls) 44var typeRef = gen.GetBaseAndInterfaceTypes(decl).FirstOrDefault(r => model.GetTypeInfo(r, cancellationToken).Type.Equals(baseOrInterfaceType)); 60Func<SyntaxGenerator, SyntaxNode> getNewBaseType, 68var typeRef = await editor.GetBaseOrInterfaceDeclarationReferenceAsync(symbol, baseType, cancellationToken).ConfigureAwait(false); 82var newBaseType = getNewBaseType(e.Generator);
Editing\SyntaxEditor.cs (51)
15/// particular tree <em>in order</em>. Changes are given a <see cref="SyntaxNode"/> they will apply to in the 24/// Each change has its given <see cref="SyntaxNode"/> tracked, using a <see cref="SyntaxAnnotation"/>, producing a 32/// A change first attempts to find its <see cref="SyntaxNode"/> in the 'current' root. If that node cannot be 38/// cref="SyntaxNode"/> found in the current root. The 'current' root will then be updated by replacing the current 52/// <para/> If a client wants to make a replacement, then find the <em>value</em> <see cref="SyntaxNode"/> put into 64public SyntaxEditor(SyntaxNode root, Workspace workspace) 72public SyntaxEditor(SyntaxNode root, HostWorkspaceServices services) 80public SyntaxEditor(SyntaxNode root, SolutionServices services) 86internal SyntaxEditor(SyntaxNode root, SyntaxGenerator generator) 93/// The <see cref="SyntaxNode"/> that was specified when the <see cref="SyntaxEditor"/> was constructed. 95public SyntaxNode OriginalRoot { get; } 98/// A <see cref="SyntaxGenerator"/> to use to create and change <see cref="SyntaxNode"/>'s. 105public SyntaxNode GetChangedRoot() 109var newRoot = OriginalRoot.TrackNodes(nodes); 120public void TrackNode(SyntaxNode node) 130public void RemoveNode(SyntaxNode node) 138public void RemoveNode(SyntaxNode node, SyntaxRemoveOptions options) 150public void ReplaceNode(SyntaxNode node, Func<SyntaxNode, SyntaxGenerator, SyntaxNode> computeReplacement) 159internal void ReplaceNode(SyntaxNode node, Func<SyntaxNode, SyntaxGenerator, IEnumerable<SyntaxNode>> computeReplacement) 168internal void ReplaceNode<TArgument>(SyntaxNode node, Func<SyntaxNode, SyntaxGenerator, TArgument, SyntaxNode> computeReplacement, TArgument argument) 182public void ReplaceNode(SyntaxNode node, SyntaxNode newNode) 196public void InsertBefore(SyntaxNode node, IEnumerable<SyntaxNode> newNodes) 210public void InsertBefore(SyntaxNode node, SyntaxNode newNode) 218public void InsertAfter(SyntaxNode node, IEnumerable<SyntaxNode> newNodes) 232public void InsertAfter(SyntaxNode node, SyntaxNode newNode) 235private void CheckNodeInOriginalTree(SyntaxNode node) 246private abstract class Change(SyntaxNode node) 248internal readonly SyntaxNode OriginalNode = node; 250public SyntaxNode Apply(SyntaxNode root, SyntaxGenerator generator) 252var currentNode = root.GetCurrentNode(OriginalNode); 259protected static SyntaxNode ValidateNewRoot(SyntaxNode? root) 262protected abstract SyntaxNode Apply(SyntaxNode root, SyntaxNode currentNode, SyntaxGenerator generator); 265private sealed class NoChange(SyntaxNode node) : Change(node) 267protected override SyntaxNode Apply(SyntaxNode root, SyntaxNode currentNode, SyntaxGenerator generator)
Editing\SyntaxEditorExtensions.cs (38)
13public static void SetAccessibility(this SyntaxEditor editor, SyntaxNode declaration, Accessibility accessibility) 16public static void SetModifiers(this SyntaxEditor editor, SyntaxNode declaration, DeclarationModifiers modifiers) 19internal static void RemoveAllAttributes(this SyntaxEditor editor, SyntaxNode declaration) 22internal static void RemoveAllComments(this SyntaxEditor editor, SyntaxNode declaration) 25internal static void RemoveAllTypeInheritance(this SyntaxEditor editor, SyntaxNode declaration) 28public static void SetName(this SyntaxEditor editor, SyntaxNode declaration, string name) 31public static void SetType(this SyntaxEditor editor, SyntaxNode declaration, SyntaxNode type) 34public static void SetTypeParameters(this SyntaxEditor editor, SyntaxNode declaration, IEnumerable<string> typeParameters) 37public static void SetTypeConstraint(this SyntaxEditor editor, SyntaxNode declaration, string typeParameterName, SpecialTypeConstraintKind kind, IEnumerable<SyntaxNode> types) 40public static void SetExpression(this SyntaxEditor editor, SyntaxNode declaration, SyntaxNode expression) 43public static void SetStatements(this SyntaxEditor editor, SyntaxNode declaration, IEnumerable<SyntaxNode> statements) 46public static void SetGetAccessorStatements(this SyntaxEditor editor, SyntaxNode declaration, IEnumerable<SyntaxNode> statements) 49public static void SetSetAccessorStatements(this SyntaxEditor editor, SyntaxNode declaration, IEnumerable<SyntaxNode> statements) 52public static void AddParameter(this SyntaxEditor editor, SyntaxNode declaration, SyntaxNode parameter) 55public static void InsertParameter(this SyntaxEditor editor, SyntaxNode declaration, int index, SyntaxNode parameter) 58public static void AddAttribute(this SyntaxEditor editor, SyntaxNode declaration, SyntaxNode attribute) 61public static void AddReturnAttribute(this SyntaxEditor editor, SyntaxNode declaration, SyntaxNode attribute) 64public static void AddAttributeArgument(this SyntaxEditor editor, SyntaxNode attributeDeclaration, SyntaxNode attributeArgument) 67public static void AddMember(this SyntaxEditor editor, SyntaxNode declaration, SyntaxNode member) 70public static void InsertMembers(this SyntaxEditor editor, SyntaxNode declaration, int index, IEnumerable<SyntaxNode> members) 73public static void AddInterfaceType(this SyntaxEditor editor, SyntaxNode declaration, SyntaxNode interfaceType) 76public static void AddBaseType(this SyntaxEditor editor, SyntaxNode declaration, SyntaxNode baseType) 79internal static void RemovePrimaryConstructor(this SyntaxEditor editor, SyntaxNode declaration)
Editing\SyntaxGenerator.cs (800)
28/// possible. For example, generating <see cref="MemberAccessExpression(SyntaxNode, string)"/> 85public SyntaxNode? GetDeclaration(SyntaxNode? node) 103public SyntaxNode? GetDeclaration(SyntaxNode? node, DeclarationKind kind) 121public abstract SyntaxNode FieldDeclaration( 123SyntaxNode type, 126SyntaxNode? initializer = null); 131public SyntaxNode FieldDeclaration(IFieldSymbol field) 135var initializer = field.HasConstantValue ? this.LiteralExpression(field.ConstantValue, canUseFieldReference) : null; 142public SyntaxNode FieldDeclaration(IFieldSymbol field, SyntaxNode? initializer) 160public SyntaxNode MethodDeclaration( 162IEnumerable<SyntaxNode>? parameters = null, 164SyntaxNode? returnType = null, 167IEnumerable<SyntaxNode>? statements = null) 174private protected abstract SyntaxNode MethodDeclaration( 176IEnumerable<SyntaxNode>? parameters, 177IEnumerable<SyntaxNode>? typeParameters, 178SyntaxNode? returnType, 181IEnumerable<SyntaxNode>? statements); 186public SyntaxNode MethodDeclaration(IMethodSymbol method, IEnumerable<SyntaxNode>? statements = null) 189internal SyntaxNode MethodDeclaration(IMethodSymbol method, string name, IEnumerable<SyntaxNode>? statements = null) 191var decl = MethodDeclaration( 255public virtual SyntaxNode OperatorDeclaration( 257IEnumerable<SyntaxNode>? parameters = null, 258SyntaxNode? returnType = null, 261IEnumerable<SyntaxNode>? statements = null) 266private protected abstract SyntaxNode OperatorDeclaration( 269IEnumerable<SyntaxNode>? parameters = null, 270SyntaxNode? returnType = null, 273IEnumerable<SyntaxNode>? statements = null); 278public SyntaxNode OperatorDeclaration(IMethodSymbol method, IEnumerable<SyntaxNode>? statements = null) 283var decl = OperatorDeclaration( 299public SyntaxNode ParameterDeclaration( 301SyntaxNode? type = null, 302SyntaxNode? initializer = null, 309private protected abstract SyntaxNode ParameterDeclaration( 311SyntaxNode? type, 312SyntaxNode? initializer, 321public SyntaxNode ParameterDeclaration(IParameterSymbol symbol, SyntaxNode? initializer = null) 335private protected abstract SyntaxNode TypeParameter(ITypeParameterSymbol typeParameter); 336private protected abstract SyntaxNode TypeParameter(string name); 338private protected abstract SyntaxNode GenerateExpression(ITypeSymbol? type, object? value, bool canUseFieldReference); 353public abstract SyntaxNode PropertyDeclaration( 355SyntaxNode type, 358IEnumerable<SyntaxNode>? getAccessorStatements = null, 359IEnumerable<SyntaxNode>? setAccessorStatements = null); 364public SyntaxNode PropertyDeclaration( 366IEnumerable<SyntaxNode>? getAccessorStatements = null, 367IEnumerable<SyntaxNode>? setAccessorStatements = null) 373SyntaxNode? getAccessor = null; 374SyntaxNode? setAccessor = null; 391var propDecl = PropertyDeclaration( 408private protected abstract SyntaxNode PropertyDeclaration( 410SyntaxNode type, 411SyntaxNode? getAccessor, 412SyntaxNode? setAccessor, 416public SyntaxNode WithAccessorDeclarations(SyntaxNode declaration, params SyntaxNode[] accessorDeclarations) 417=> WithAccessorDeclarations(declaration, (IEnumerable<SyntaxNode>)accessorDeclarations); 419public abstract SyntaxNode WithAccessorDeclarations(SyntaxNode declaration, IEnumerable<SyntaxNode> accessorDeclarations); 421public abstract SyntaxNode GetAccessorDeclaration( 423IEnumerable<SyntaxNode>? statements = null); 425public SyntaxNode SetAccessorDeclaration( 427IEnumerable<SyntaxNode>? statements = null) 430private protected abstract SyntaxNode SetAccessorDeclaration( 431Accessibility accessibility, bool isInitOnly, IEnumerable<SyntaxNode>? statements); 436public abstract SyntaxNode IndexerDeclaration( 437IEnumerable<SyntaxNode> parameters, 438SyntaxNode type, 441IEnumerable<SyntaxNode>? getAccessorStatements = null, 442IEnumerable<SyntaxNode>? setAccessorStatements = null); 447public SyntaxNode IndexerDeclaration( 449IEnumerable<SyntaxNode>? getAccessorStatements = null, 450IEnumerable<SyntaxNode>? setAccessorStatements = null) 452var indexerDecl = IndexerDeclaration( 472public abstract SyntaxNode AddEventHandler(SyntaxNode @event, SyntaxNode handler); 477public abstract SyntaxNode RemoveEventHandler(SyntaxNode @event, SyntaxNode handler); 482public abstract SyntaxNode EventDeclaration( 484SyntaxNode type, 491public SyntaxNode EventDeclaration(IEventSymbol symbol) 493var ev = EventDeclaration( 511public abstract SyntaxNode CustomEventDeclaration( 513SyntaxNode type, 516IEnumerable<SyntaxNode>? parameters = null, 517IEnumerable<SyntaxNode>? addAccessorStatements = null, 518IEnumerable<SyntaxNode>? removeAccessorStatements = null); 523public SyntaxNode CustomEventDeclaration( 525IEnumerable<SyntaxNode>? addAccessorStatements = null, 526IEnumerable<SyntaxNode>? removeAccessorStatements = null) 544public abstract SyntaxNode ConstructorDeclaration( 546IEnumerable<SyntaxNode>? parameters = null, 549IEnumerable<SyntaxNode>? baseConstructorArguments = null, 550IEnumerable<SyntaxNode>? statements = null); 555public SyntaxNode ConstructorDeclaration( 557IEnumerable<SyntaxNode>? baseConstructorArguments = null, 558IEnumerable<SyntaxNode>? statements = null) 569private protected abstract SyntaxNode DestructorDeclaration(IMethodSymbol destructorMethod); 575public SyntaxNode? AsPublicInterfaceImplementation(SyntaxNode declaration, SyntaxNode interfaceType) 582public abstract SyntaxNode? AsPublicInterfaceImplementation(SyntaxNode declaration, SyntaxNode interfaceType, string? interfaceMemberName); 588public SyntaxNode? AsPrivateInterfaceImplementation(SyntaxNode declaration, SyntaxNode interfaceType) 595public abstract SyntaxNode? AsPrivateInterfaceImplementation(SyntaxNode declaration, SyntaxNode interfaceType, string? interfaceMemberName); 600public SyntaxNode ClassDeclaration( 605SyntaxNode? baseType = null, 606IEnumerable<SyntaxNode>? interfaceTypes = null, 607IEnumerable<SyntaxNode>? members = null) 613private protected abstract SyntaxNode ClassDeclaration( 616IEnumerable<SyntaxNode>? typeParameters, 619SyntaxNode? baseType, 620IEnumerable<SyntaxNode>? interfaceTypes, 621IEnumerable<SyntaxNode>? members); 626public SyntaxNode StructDeclaration( 631IEnumerable<SyntaxNode>? interfaceTypes = null, 632IEnumerable<SyntaxNode>? members = null) 638private protected abstract SyntaxNode StructDeclaration( 641IEnumerable<SyntaxNode>? typeParameters, 644IEnumerable<SyntaxNode>? interfaceTypes, 645IEnumerable<SyntaxNode>? members); 650public SyntaxNode InterfaceDeclaration( 654IEnumerable<SyntaxNode>? interfaceTypes = null, 655IEnumerable<SyntaxNode>? members = null) 661private protected abstract SyntaxNode InterfaceDeclaration( 663IEnumerable<SyntaxNode>? typeParameters, 665IEnumerable<SyntaxNode>? interfaceTypes, 666IEnumerable<SyntaxNode>? members); 671public abstract SyntaxNode EnumDeclaration( 675IEnumerable<SyntaxNode>? members = null); 680internal abstract SyntaxNode EnumDeclaration( 682SyntaxNode? underlyingType, 685IEnumerable<SyntaxNode>? members = null); 690public abstract SyntaxNode EnumMember(string name, SyntaxNode? expression = null); 695public SyntaxNode DelegateDeclaration( 697IEnumerable<SyntaxNode>? parameters = null, 699SyntaxNode? returnType = null, 707private protected abstract SyntaxNode DelegateDeclaration( 709IEnumerable<SyntaxNode>? parameters, 710IEnumerable<SyntaxNode>? typeParameters, 711SyntaxNode? returnType, 718public SyntaxNode Declaration(ISymbol symbol) 759var declaration = type.TypeKind switch 861private SyntaxNode WithTypeParametersAndConstraints(SyntaxNode declaration, ImmutableArray<ITypeParameterSymbol> typeParameters) 887internal abstract SyntaxNode WithExplicitInterfaceImplementations( 888SyntaxNode declaration, ImmutableArray<ISymbol> explicitInterfaceImplementations, bool removeDefaults = true); 893public SyntaxNode WithTypeParameters(SyntaxNode declaration, IEnumerable<string> typeParameters) 896private protected abstract SyntaxNode WithTypeParameters(SyntaxNode declaration, IEnumerable<SyntaxNode> typeParameters); 901public SyntaxNode WithTypeParameters(SyntaxNode declaration, params string[] typeParameters) 908public SyntaxNode WithTypeConstraint(SyntaxNode declaration, string typeParameterName, SpecialTypeConstraintKind kinds, IEnumerable<SyntaxNode>? types = null) 912private protected abstract SyntaxNode WithTypeConstraint( 913SyntaxNode declaration, string typeParameterName, SpecialTypeConstraintKind kinds, bool isUnamangedType, IEnumerable<SyntaxNode>? types); 915private protected abstract SyntaxNode WithDefaultConstraint(SyntaxNode declaration, string typeParameterName); 920public SyntaxNode WithTypeConstraint(SyntaxNode declaration, string typeParameterName, SpecialTypeConstraintKind kinds, params SyntaxNode[] types) 921=> WithTypeConstraint(declaration, typeParameterName, kinds, (IEnumerable<SyntaxNode>)types); 926public SyntaxNode WithTypeConstraint(SyntaxNode declaration, string typeParameterName, params SyntaxNode[] types) 927=> WithTypeConstraint(declaration, typeParameterName, SpecialTypeConstraintKind.None, (IEnumerable<SyntaxNode>)types); 934public abstract SyntaxNode NamespaceDeclaration(SyntaxNode name, IEnumerable<SyntaxNode> declarations); 941public SyntaxNode NamespaceDeclaration(SyntaxNode name, params SyntaxNode[] declarations) 942=> NamespaceDeclaration(name, (IEnumerable<SyntaxNode>)declarations); 949public SyntaxNode NamespaceDeclaration(string name, IEnumerable<SyntaxNode> declarations) 957public SyntaxNode NamespaceDeclaration(string name, params SyntaxNode[] declarations) 958=> NamespaceDeclaration(DottedName(name), (IEnumerable<SyntaxNode>)declarations); 964public abstract SyntaxNode CompilationUnit(IEnumerable<SyntaxNode> declarations); 970public SyntaxNode CompilationUnit(params SyntaxNode[] declarations) 971=> CompilationUnit((IEnumerable<SyntaxNode>)declarations); 977public abstract SyntaxNode NamespaceImportDeclaration(SyntaxNode name); 983public SyntaxNode NamespaceImportDeclaration(string name) 991public SyntaxNode AliasImportDeclaration(string aliasIdentifierName, INamespaceOrTypeSymbol symbol) 999public abstract SyntaxNode AliasImportDeclaration(string aliasIdentifierName, SyntaxNode name); 1004public abstract SyntaxNode Attribute(SyntaxNode name, IEnumerable<SyntaxNode>? attributeArguments = null); 1009public SyntaxNode Attribute(string name, IEnumerable<SyntaxNode>? attributeArguments = null) 1015public SyntaxNode Attribute(string name, params SyntaxNode[] attributeArguments) 1016=> Attribute(name, (IEnumerable<SyntaxNode>)attributeArguments); 1021public SyntaxNode Attribute(AttributeData attribute) 1037public abstract SyntaxNode AttributeArgument(string? name, SyntaxNode expression); 1042public SyntaxNode AttributeArgument(SyntaxNode expression) 1048public SyntaxNode RemoveAllAttributes(SyntaxNode declaration) 1055internal abstract SyntaxNode RemoveAllComments(SyntaxNode node); 1057internal SyntaxNode RemovePrimaryConstructor(SyntaxNode declaration) 1059var node = GetPrimaryConstructorParameterList(declaration); 1063internal abstract SyntaxNode? GetPrimaryConstructorParameterList(SyntaxNode declaration); 1065internal SyntaxNode RemoveLeadingAndTrailingComments(SyntaxNode node) 1081internal SyntaxNode RemoveAllTypeInheritance(SyntaxNode declaration) 1084internal abstract ImmutableArray<SyntaxNode> GetTypeInheritance(SyntaxNode declaration); 1089public abstract IReadOnlyList<SyntaxNode> GetAttributes(SyntaxNode declaration); 1094public abstract SyntaxNode InsertAttributes(SyntaxNode declaration, int index, IEnumerable<SyntaxNode> attributes); 1099public SyntaxNode InsertAttributes(SyntaxNode declaration, int index, params SyntaxNode[] attributes) 1100=> this.InsertAttributes(declaration, index, (IEnumerable<SyntaxNode>)attributes); 1105public SyntaxNode AddAttributes(SyntaxNode declaration, IEnumerable<SyntaxNode> attributes) 1111public SyntaxNode AddAttributes(SyntaxNode declaration, params SyntaxNode[] attributes) 1112=> AddAttributes(declaration, (IEnumerable<SyntaxNode>)attributes); 1117public abstract IReadOnlyList<SyntaxNode> GetReturnAttributes(SyntaxNode declaration); 1122public abstract SyntaxNode InsertReturnAttributes(SyntaxNode declaration, int index, IEnumerable<SyntaxNode> attributes); 1127public SyntaxNode InsertReturnAttributes(SyntaxNode declaration, int index, params SyntaxNode[] attributes) 1128=> this.InsertReturnAttributes(declaration, index, (IEnumerable<SyntaxNode>)attributes); 1133public SyntaxNode AddReturnAttributes(SyntaxNode declaration, IEnumerable<SyntaxNode> attributes) 1139public SyntaxNode AddReturnAttributes(SyntaxNode declaration, params SyntaxNode[] attributes) 1140=> AddReturnAttributes(declaration, (IEnumerable<SyntaxNode>)attributes); 1145public abstract IReadOnlyList<SyntaxNode> GetAttributeArguments(SyntaxNode attributeDeclaration); 1150public abstract SyntaxNode InsertAttributeArguments(SyntaxNode attributeDeclaration, int index, IEnumerable<SyntaxNode> attributeArguments); 1155public SyntaxNode AddAttributeArguments(SyntaxNode attributeDeclaration, IEnumerable<SyntaxNode> attributeArguments) 1161public abstract IReadOnlyList<SyntaxNode> GetNamespaceImports(SyntaxNode declaration); 1166public abstract SyntaxNode InsertNamespaceImports(SyntaxNode declaration, int index, IEnumerable<SyntaxNode> imports); 1171public SyntaxNode InsertNamespaceImports(SyntaxNode declaration, int index, params SyntaxNode[] imports) 1172=> this.InsertNamespaceImports(declaration, index, (IEnumerable<SyntaxNode>)imports); 1177public SyntaxNode AddNamespaceImports(SyntaxNode declaration, IEnumerable<SyntaxNode> imports) 1183public SyntaxNode AddNamespaceImports(SyntaxNode declaration, params SyntaxNode[] imports) 1184=> this.AddNamespaceImports(declaration, (IEnumerable<SyntaxNode>)imports); 1189public abstract IReadOnlyList<SyntaxNode> GetMembers(SyntaxNode declaration); 1194public abstract SyntaxNode InsertMembers(SyntaxNode declaration, int index, IEnumerable<SyntaxNode> members); 1199public SyntaxNode InsertMembers(SyntaxNode declaration, int index, params SyntaxNode[] members) 1200=> this.InsertMembers(declaration, index, (IEnumerable<SyntaxNode>)members); 1205public SyntaxNode AddMembers(SyntaxNode declaration, IEnumerable<SyntaxNode> members) 1211public SyntaxNode AddMembers(SyntaxNode declaration, params SyntaxNode[] members) 1212=> this.AddMembers(declaration, (IEnumerable<SyntaxNode>)members); 1217public abstract Accessibility GetAccessibility(SyntaxNode declaration); 1222public abstract SyntaxNode WithAccessibility(SyntaxNode declaration, Accessibility accessibility); 1227public abstract DeclarationModifiers GetModifiers(SyntaxNode declaration); 1232public abstract SyntaxNode WithModifiers(SyntaxNode declaration, DeclarationModifiers modifiers); 1237public abstract DeclarationKind GetDeclarationKind(SyntaxNode declaration); 1242public abstract string GetName(SyntaxNode declaration); 1247public abstract SyntaxNode WithName(SyntaxNode declaration, string name); 1252public abstract SyntaxNode? GetType(SyntaxNode declaration); 1257public abstract SyntaxNode WithType(SyntaxNode declaration, SyntaxNode type); 1262public abstract IReadOnlyList<SyntaxNode> GetParameters(SyntaxNode declaration); 1264internal abstract SyntaxNode? GetParameterListNode(SyntaxNode declaration); 1269public abstract SyntaxNode InsertParameters(SyntaxNode declaration, int index, IEnumerable<SyntaxNode> parameters); 1274public SyntaxNode AddParameters(SyntaxNode declaration, IEnumerable<SyntaxNode> parameters) 1280public abstract IReadOnlyList<SyntaxNode> GetSwitchSections(SyntaxNode switchStatement); 1285public abstract SyntaxNode InsertSwitchSections(SyntaxNode switchStatement, int index, IEnumerable<SyntaxNode> switchSections); 1290public SyntaxNode AddSwitchSections(SyntaxNode switchStatement, IEnumerable<SyntaxNode> switchSections) 1296public abstract SyntaxNode? GetExpression(SyntaxNode declaration); 1301public abstract SyntaxNode WithExpression(SyntaxNode declaration, SyntaxNode expression); 1306public abstract IReadOnlyList<SyntaxNode> GetStatements(SyntaxNode declaration); 1311public abstract SyntaxNode WithStatements(SyntaxNode declaration, IEnumerable<SyntaxNode> statements); 1316public abstract IReadOnlyList<SyntaxNode> GetAccessors(SyntaxNode declaration); 1321public SyntaxNode? GetAccessor(SyntaxNode declaration, DeclarationKind kind) 1327public abstract SyntaxNode InsertAccessors(SyntaxNode declaration, int index, IEnumerable<SyntaxNode> accessors); 1332public SyntaxNode AddAccessors(SyntaxNode declaration, IEnumerable<SyntaxNode> accessors) 1338public abstract IReadOnlyList<SyntaxNode> GetGetAccessorStatements(SyntaxNode declaration); 1343public abstract SyntaxNode WithGetAccessorStatements(SyntaxNode declaration, IEnumerable<SyntaxNode> statements); 1348public abstract IReadOnlyList<SyntaxNode> GetSetAccessorStatements(SyntaxNode declaration); 1353public abstract SyntaxNode WithSetAccessorStatements(SyntaxNode declaration, IEnumerable<SyntaxNode> statements); 1358public abstract IReadOnlyList<SyntaxNode> GetBaseAndInterfaceTypes(SyntaxNode declaration); 1363public abstract SyntaxNode AddBaseType(SyntaxNode declaration, SyntaxNode baseType); 1368public abstract SyntaxNode AddInterfaceType(SyntaxNode declaration, SyntaxNode interfaceType); 1370internal abstract SyntaxNode AsInterfaceMember(SyntaxNode member); 1379public virtual SyntaxNode ReplaceNode(SyntaxNode root, SyntaxNode node, SyntaxNode? newDeclaration) 1382internal static SyntaxNode ReplaceNode(SyntaxNode root, SyntaxNode node, IEnumerable<SyntaxNode> newDeclarations) 1391public virtual SyntaxNode InsertNodesBefore(SyntaxNode root, SyntaxNode node, IEnumerable<SyntaxNode> newDeclarations) 1397public virtual SyntaxNode InsertNodesAfter(SyntaxNode root, SyntaxNode node, IEnumerable<SyntaxNode> newDeclarations) 1403public virtual SyntaxNode RemoveNode(SyntaxNode root, SyntaxNode node) 1409public virtual SyntaxNode RemoveNode(SyntaxNode root, SyntaxNode node, SyntaxRemoveOptions options) 1415public SyntaxNode RemoveNodes(SyntaxNode root, IEnumerable<SyntaxNode> declarations) 1417var newRoot = root.TrackNodes(declarations); 1419foreach (var declaration in declarations) 1421var newDeclaration = newRoot.GetCurrentNode(declaration); 1437internal abstract SeparatedSyntaxList<TElement> SeparatedList<TElement>(SyntaxNodeOrTokenList list) where TElement : SyntaxNode; 1439internal abstract SeparatedSyntaxList<TElement> SeparatedList<TElement>(IEnumerable<TElement> nodes, IEnumerable<SyntaxToken> separators) where TElement : SyntaxNode; 1464protected static SyntaxNode? PreserveTrivia<TNode>(TNode? node, Func<TNode, SyntaxNode> nodeChanger) where TNode : SyntaxNode 1473var changedNode = nodeChanger(nodeWithoutTrivia); 1484protected static SyntaxNode ReplaceWithTrivia(SyntaxNode root, SyntaxNode original, SyntaxNode replacement) 1486var combinedTriviaReplacement = 1493protected static SyntaxNode ReplaceWithTrivia<TNode>(SyntaxNode root, TNode original, Func<TNode, SyntaxNode> replacer) 1494where TNode : SyntaxNode 1499protected static SyntaxNode ReplaceWithTrivia(SyntaxNode root, SyntaxToken original, SyntaxToken replacement) 1512public abstract TNode ClearTrivia<TNode>([MaybeNull] TNode node) where TNode : SyntaxNode; 1529protected static SyntaxNode ReplaceRange(SyntaxNode root, SyntaxNode node, IEnumerable<SyntaxNode> replacements) 1531var first = replacements.First(); 1532var trackedFirst = first.TrackNodes(first); 1533var newRoot = root.ReplaceNode(node, trackedFirst); 1534var currentFirst = newRoot.GetCurrentNode(first); 1541where TNode : SyntaxNode 1552where TNode : SyntaxNode 1570public abstract SyntaxNode ExpressionStatement(SyntaxNode expression); 1576public abstract SyntaxNode ReturnStatement(SyntaxNode? expression = null); 1582internal SyntaxNode YieldReturnStatement(SyntaxNode expression) 1589public abstract SyntaxNode ThrowStatement(SyntaxNode? expression = null); 1594public abstract SyntaxNode ThrowExpression(SyntaxNode expression); 1605/// <see cref="LocalDeclarationStatement(ITypeSymbol, string, SyntaxNode, bool)"/>. 1613public abstract SyntaxNode LocalDeclarationStatement( 1614SyntaxNode? type, string identifier, SyntaxNode? initializer = null, bool isConst = false); 1616internal SyntaxNode LocalDeclarationStatement(SyntaxNode? type, SyntaxToken identifier, SyntaxNode? initializer = null, bool isConst = false) 1619internal SyntaxNode WithInitializer(SyntaxNode variableDeclarator, SyntaxNode initializer) 1622internal SyntaxNode EqualsValueClause(SyntaxToken operatorToken, SyntaxNode value) 1628public SyntaxNode LocalDeclarationStatement(ITypeSymbol type, string name, SyntaxNode? initializer = null, bool isConst = false) 1634public SyntaxNode LocalDeclarationStatement(string name, SyntaxNode initializer) 1635=> LocalDeclarationStatement(type: (SyntaxNode?)null, name, initializer); 1640internal SyntaxNode LocalDeclarationStatement(SyntaxToken name, SyntaxNode initializer) 1649public abstract SyntaxNode IfStatement( 1650SyntaxNode condition, IEnumerable<SyntaxNode> trueStatements, IEnumerable<SyntaxNode>? falseStatements = null); 1658public SyntaxNode IfStatement(SyntaxNode condition, IEnumerable<SyntaxNode> trueStatements, SyntaxNode falseStatement) 1664public abstract SyntaxNode SwitchStatement(SyntaxNode expression, IEnumerable<SyntaxNode> sections); 1669public SyntaxNode SwitchStatement(SyntaxNode expression, params SyntaxNode[] sections) 1670=> SwitchStatement(expression, (IEnumerable<SyntaxNode>)sections); 1675public abstract SyntaxNode SwitchSection(IEnumerable<SyntaxNode> caseExpressions, IEnumerable<SyntaxNode> statements); 1677internal abstract SyntaxNode SwitchSectionFromLabels(IEnumerable<SyntaxNode> labels, IEnumerable<SyntaxNode> statements); 1682public SyntaxNode SwitchSection(SyntaxNode caseExpression, IEnumerable<SyntaxNode> statements) 1688public abstract SyntaxNode DefaultSwitchSection(IEnumerable<SyntaxNode> statements); 1693public abstract SyntaxNode ExitSwitchStatement(); 1698public abstract SyntaxNode UsingStatement(SyntaxNode? type, string name, SyntaxNode expression, IEnumerable<SyntaxNode> statements); 1703public SyntaxNode UsingStatement(string name, SyntaxNode expression, IEnumerable<SyntaxNode> statements) 1709public abstract SyntaxNode UsingStatement(SyntaxNode expression, IEnumerable<SyntaxNode> statements); 1714public abstract SyntaxNode LockStatement(SyntaxNode expression, IEnumerable<SyntaxNode> statements); 1719public abstract SyntaxNode TryCatchStatement(IEnumerable<SyntaxNode> tryStatements, IEnumerable<SyntaxNode>? catchClauses, IEnumerable<SyntaxNode>? finallyStatements = null); 1724public SyntaxNode TryCatchStatement(IEnumerable<SyntaxNode> tryStatements, params SyntaxNode[] catchClauses) 1725=> TryCatchStatement(tryStatements, (IEnumerable<SyntaxNode>?)catchClauses); 1730public SyntaxNode TryFinallyStatement(IEnumerable<SyntaxNode> tryStatements, IEnumerable<SyntaxNode> finallyStatements) 1736public abstract SyntaxNode CatchClause(SyntaxNode type, string identifier, IEnumerable<SyntaxNode> statements); 1741public SyntaxNode CatchClause(ITypeSymbol type, string identifier, IEnumerable<SyntaxNode> statements) 1747public abstract SyntaxNode WhileStatement(SyntaxNode condition, IEnumerable<SyntaxNode> statements); 1752internal abstract SyntaxNode ScopeBlock(IEnumerable<SyntaxNode> statements); 1754internal abstract SyntaxNode GlobalStatement(SyntaxNode statement); 1764internal SyntaxNode InterpolatedStringText(SyntaxToken textToken) 1766internal SyntaxNode Interpolation(SyntaxNode syntaxNode) 1768internal SyntaxNode InterpolatedStringExpression(SyntaxToken startToken, IEnumerable<SyntaxNode> content, SyntaxToken endToken) 1770internal SyntaxNode InterpolationAlignmentClause(SyntaxNode alignment) 1772internal SyntaxNode InterpolationFormatClause(string format) 1779public abstract SyntaxNode DefaultExpression(SyntaxNode type); 1780public abstract SyntaxNode DefaultExpression(ITypeSymbol type); 1785public abstract SyntaxNode ThisExpression(); 1790public abstract SyntaxNode BaseExpression(); 1795public SyntaxNode LiteralExpression(object? value) 1801private SyntaxNode LiteralExpression(object? value, bool canUseFieldReference) 1807public abstract SyntaxNode TypedConstantExpression(TypedConstant value); 1812public SyntaxNode FalseLiteralExpression() 1818public SyntaxNode TrueLiteralExpression() 1824public SyntaxNode NullLiteralExpression() 1832public abstract SyntaxNode IdentifierName(string identifier); 1834internal abstract SyntaxNode IdentifierName(SyntaxToken identifier); 1836internal abstract SyntaxNode NamedAnonymousObjectMemberDeclarator(SyntaxNode identifier, SyntaxNode expression); 1841public abstract SyntaxNode GenericName(string identifier, IEnumerable<SyntaxNode> typeArguments); 1843internal abstract SyntaxNode GenericName(SyntaxToken identifier, IEnumerable<SyntaxNode> typeArguments); 1848public SyntaxNode GenericName(string identifier, IEnumerable<ITypeSymbol> typeArguments) 1854public SyntaxNode GenericName(string identifier, params SyntaxNode[] typeArguments) 1855=> GenericName(identifier, (IEnumerable<SyntaxNode>)typeArguments); 1860public SyntaxNode GenericName(string identifier, params ITypeSymbol[] typeArguments) 1867public abstract SyntaxNode WithTypeArguments(SyntaxNode expression, IEnumerable<SyntaxNode> typeArguments); 1873public SyntaxNode WithTypeArguments(SyntaxNode expression, params SyntaxNode[] typeArguments) 1874=> WithTypeArguments(expression, (IEnumerable<SyntaxNode>)typeArguments); 1881public abstract SyntaxNode QualifiedName(SyntaxNode left, SyntaxNode right); 1886internal abstract SyntaxNode GlobalAliasedName(SyntaxNode name); 1891public SyntaxNode DottedName(string dottedName) 1901SyntaxNode? name = null; 1925public abstract SyntaxNode NameExpression(INamespaceOrTypeSymbol namespaceOrTypeSymbol); 1930public SyntaxNode TypeExpression(ITypeSymbol typeSymbol) 1933private protected abstract SyntaxNode TypeExpression(ITypeSymbol typeSymbol, RefKind refKind); 1940public SyntaxNode TypeExpression(ITypeSymbol typeSymbol, bool addImport) 1942var expression = TypeExpression(typeSymbol); 1951public abstract SyntaxNode TypeExpression(SpecialType specialType); 1956public abstract SyntaxNode ArrayTypeExpression(SyntaxNode type); 1961public abstract SyntaxNode NullableTypeExpression(SyntaxNode type); 1966public SyntaxNode TupleTypeExpression(IEnumerable<SyntaxNode> elements) 1981internal abstract SyntaxNode CreateTupleType(IEnumerable<SyntaxNode> elements); 1986public SyntaxNode TupleTypeExpression(params SyntaxNode[] elements) 1987=> TupleTypeExpression((IEnumerable<SyntaxNode>)elements); 1992public SyntaxNode TupleTypeExpression(IEnumerable<ITypeSymbol> elementTypes, IEnumerable<string>? elementNames = null) 2016public abstract SyntaxNode TupleElementExpression(SyntaxNode type, string? name = null); 2021public SyntaxNode TupleElementExpression(ITypeSymbol type, string? name = null) 2028public abstract SyntaxNode AssignmentStatement(SyntaxNode left, SyntaxNode right); 2033public abstract SyntaxNode ValueEqualsExpression(SyntaxNode left, SyntaxNode right); 2038public abstract SyntaxNode ReferenceEqualsExpression(SyntaxNode left, SyntaxNode right); 2043public abstract SyntaxNode ValueNotEqualsExpression(SyntaxNode left, SyntaxNode right); 2048public abstract SyntaxNode ReferenceNotEqualsExpression(SyntaxNode left, SyntaxNode right); 2053public abstract SyntaxNode LessThanExpression(SyntaxNode left, SyntaxNode right); 2058public abstract SyntaxNode LessThanOrEqualExpression(SyntaxNode left, SyntaxNode right); 2063public abstract SyntaxNode GreaterThanExpression(SyntaxNode left, SyntaxNode right); 2068public abstract SyntaxNode GreaterThanOrEqualExpression(SyntaxNode left, SyntaxNode right); 2073public abstract SyntaxNode NegateExpression(SyntaxNode expression); 2078public abstract SyntaxNode AddExpression(SyntaxNode left, SyntaxNode right); 2083public abstract SyntaxNode SubtractExpression(SyntaxNode left, SyntaxNode right); 2088public abstract SyntaxNode MultiplyExpression(SyntaxNode left, SyntaxNode right); 2093public abstract SyntaxNode DivideExpression(SyntaxNode left, SyntaxNode right); 2098public abstract SyntaxNode ModuloExpression(SyntaxNode left, SyntaxNode right); 2103public abstract SyntaxNode BitwiseAndExpression(SyntaxNode left, SyntaxNode right); 2108public abstract SyntaxNode BitwiseOrExpression(SyntaxNode left, SyntaxNode right); 2113public abstract SyntaxNode BitwiseNotExpression(SyntaxNode operand); 2118public abstract SyntaxNode LogicalAndExpression(SyntaxNode left, SyntaxNode right); 2123public abstract SyntaxNode LogicalOrExpression(SyntaxNode left, SyntaxNode right); 2128public abstract SyntaxNode LogicalNotExpression(SyntaxNode expression); 2133public abstract SyntaxNode ConditionalExpression(SyntaxNode condition, SyntaxNode whenTrue, SyntaxNode whenFalse); 2138/// cref="ElementBindingExpression(IEnumerable{SyntaxNode})"/> to generate the <paramref 2141public abstract SyntaxNode ConditionalAccessExpression(SyntaxNode expression, SyntaxNode whenNotNull); 2146public abstract SyntaxNode MemberBindingExpression(SyntaxNode name); 2151public abstract SyntaxNode ElementBindingExpression(IEnumerable<SyntaxNode> arguments); 2156public SyntaxNode ElementBindingExpression(params SyntaxNode[] arguments) 2157=> ElementBindingExpression((IEnumerable<SyntaxNode>)arguments); 2162public abstract SyntaxNode CoalesceExpression(SyntaxNode left, SyntaxNode right); 2167public virtual SyntaxNode MemberAccessExpression(SyntaxNode? expression, SyntaxNode memberName) 2173internal abstract SyntaxNode MemberAccessExpressionWorker(SyntaxNode? expression, SyntaxNode memberName); 2175internal SyntaxNode RefExpression(SyntaxNode expression) 2181public SyntaxNode MemberAccessExpression(SyntaxNode? expression, string memberName) 2187public abstract SyntaxNode ArrayCreationExpression(SyntaxNode elementType, SyntaxNode size); 2192public abstract SyntaxNode ArrayCreationExpression(SyntaxNode elementType, IEnumerable<SyntaxNode> elements); 2197public abstract SyntaxNode ObjectCreationExpression(SyntaxNode namedType, IEnumerable<SyntaxNode> arguments); 2199internal abstract SyntaxNode ObjectCreationExpression( 2200SyntaxNode namedType, SyntaxToken openParen, SeparatedSyntaxList<SyntaxNode> arguments, SyntaxToken closeParen); 2205public SyntaxNode ObjectCreationExpression(ITypeSymbol type, IEnumerable<SyntaxNode> arguments) 2211public SyntaxNode ObjectCreationExpression(SyntaxNode type, params SyntaxNode[] arguments) 2212=> ObjectCreationExpression(type, (IEnumerable<SyntaxNode>)arguments); 2217public SyntaxNode ObjectCreationExpression(ITypeSymbol type, params SyntaxNode[] arguments) 2218=> ObjectCreationExpression(type, (IEnumerable<SyntaxNode>)arguments); 2223public abstract SyntaxNode InvocationExpression(SyntaxNode expression, IEnumerable<SyntaxNode> arguments); 2228public SyntaxNode InvocationExpression(SyntaxNode expression, params SyntaxNode[] arguments) 2229=> InvocationExpression(expression, (IEnumerable<SyntaxNode>)arguments); 2234public abstract SyntaxNode Argument(string? name, RefKind refKind, SyntaxNode expression); 2239public SyntaxNode Argument(RefKind refKind, SyntaxNode expression) 2245public SyntaxNode Argument(SyntaxNode expression) 2251public abstract SyntaxNode ElementAccessExpression(SyntaxNode expression, IEnumerable<SyntaxNode> arguments); 2256public SyntaxNode ElementAccessExpression(SyntaxNode expression, params SyntaxNode[] arguments) 2257=> ElementAccessExpression(expression, (IEnumerable<SyntaxNode>)arguments); 2262public abstract SyntaxNode TypeOfExpression(SyntaxNode type); 2267public abstract SyntaxNode IsTypeExpression(SyntaxNode expression, SyntaxNode type); 2272public SyntaxNode IsTypeExpression(SyntaxNode expression, ITypeSymbol type) 2278public abstract SyntaxNode TryCastExpression(SyntaxNode expression, SyntaxNode type); 2283public SyntaxNode TryCastExpression(SyntaxNode expression, ITypeSymbol type) 2289public abstract SyntaxNode CastExpression(SyntaxNode type, SyntaxNode expression); 2294public SyntaxNode CastExpression(ITypeSymbol type, SyntaxNode expression) 2300public abstract SyntaxNode ConvertExpression(SyntaxNode type, SyntaxNode expression); 2305public SyntaxNode ConvertExpression(ITypeSymbol type, SyntaxNode expression) 2311public abstract SyntaxNode ValueReturningLambdaExpression(IEnumerable<SyntaxNode>? lambdaParameters, SyntaxNode expression); 2316public abstract SyntaxNode VoidReturningLambdaExpression(IEnumerable<SyntaxNode>? lambdaParameters, SyntaxNode expression); 2321public abstract SyntaxNode ValueReturningLambdaExpression(IEnumerable<SyntaxNode>? lambdaParameters, IEnumerable<SyntaxNode> statements); 2326public abstract SyntaxNode VoidReturningLambdaExpression(IEnumerable<SyntaxNode>? lambdaParameters, IEnumerable<SyntaxNode> statements); 2331public SyntaxNode ValueReturningLambdaExpression(string parameterName, SyntaxNode expression) 2337public SyntaxNode VoidReturningLambdaExpression(string parameterName, SyntaxNode expression) 2343public SyntaxNode ValueReturningLambdaExpression(string parameterName, IEnumerable<SyntaxNode> statements) 2349public SyntaxNode VoidReturningLambdaExpression(string parameterName, IEnumerable<SyntaxNode> statements) 2355public SyntaxNode ValueReturningLambdaExpression(SyntaxNode expression) 2356=> ValueReturningLambdaExpression((IEnumerable<SyntaxNode>?)null, expression); 2361public SyntaxNode VoidReturningLambdaExpression(SyntaxNode expression) 2362=> VoidReturningLambdaExpression((IEnumerable<SyntaxNode>?)null, expression); 2367public SyntaxNode ValueReturningLambdaExpression(IEnumerable<SyntaxNode> statements) 2368=> ValueReturningLambdaExpression((IEnumerable<SyntaxNode>?)null, statements); 2373public SyntaxNode VoidReturningLambdaExpression(IEnumerable<SyntaxNode> statements) 2374=> VoidReturningLambdaExpression((IEnumerable<SyntaxNode>?)null, statements); 2379public abstract SyntaxNode LambdaParameter(string identifier, SyntaxNode? type = null); 2384public SyntaxNode LambdaParameter(string identifier, ITypeSymbol type) 2390public abstract SyntaxNode AwaitExpression(SyntaxNode expression); 2395internal SyntaxNode AddParentheses(SyntaxNode expression, bool includeElasticTrivia = true, bool addSimplifierAnnotation = true) 2401public abstract SyntaxNode NameOfExpression(SyntaxNode expression); 2406public abstract SyntaxNode TupleExpression(IEnumerable<SyntaxNode> arguments); 2411internal abstract SyntaxNode ParseExpression(string stringToParse); 2413internal abstract SyntaxTrivia Trivia(SyntaxNode node); 2415internal abstract SyntaxNode DocumentationCommentTrivia(IEnumerable<SyntaxNode> nodes, SyntaxTriviaList trailingTrivia, string endOfLineString); 2417internal abstract SyntaxNode? DocumentationCommentTriviaWithUpdatedContent(SyntaxTrivia trivia, IEnumerable<SyntaxNode> content);
ExtensionManager\IExtensionManagerExtensions.cs (1)
90public static Func<SyntaxNode, ImmutableArray<TExtension>> CreateNodeExtensionGetter<TExtension>(
ExternalAccess\Pythia\Api\PythiaDocumentExtensions.cs (1)
13public static Task<SemanticModel> GetSemanticModelForNodeAsync(this Document document, SyntaxNode? node, CancellationToken cancellationToken)
FindSymbols\FindLiterals\FindLiteralsSearchEngine.cs (3)
141var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 151ISyntaxFactsService syntaxFacts, SyntaxNode node, 157if (child.AsNode(out var childNode))
FindSymbols\FindReferences\Finders\AbstractMemberScopedReferenceFinder.cs (1)
113var syntax = declaration.GetSyntax(cancellationToken);
FindSymbols\FindReferences\Finders\AbstractMethodOrPropertyOrEventSymbolReferenceFinder.cs (1)
16FindReferencesDocumentState state, IPropertySymbol property, SyntaxNode node, CancellationToken cancellationToken)
FindSymbols\FindReferences\Finders\AbstractReferenceFinder.cs (15)
54ISymbol searchSymbol, FindReferencesDocumentState state, SyntaxNode node, CancellationToken cancellationToken) 218SyntaxNode node, 227var directive = node.GetRequiredParent(); 368SyntaxNode node, FindReferencesDocumentState state, Action<FinderLocation, TData> processResult, TData processResultData); 403SyntaxNode node, FindReferencesDocumentState state, Action<FinderLocation, TData> processResult, TData processResultData) 442SyntaxNode node, FindReferencesDocumentState state, Action<FinderLocation, TData> processResult, TData processResultData) 485SyntaxNode node, FindReferencesDocumentState state, Action<FinderLocation, TData> processResult, TData processResultData) 523SyntaxNode node, FindReferencesDocumentState state, Action<FinderLocation, TData> processResult, TData processResultData) 554SyntaxNode node, FindReferencesDocumentState state, Action<FinderLocation, TData> processResult, TData processResultData) 598SyntaxNode node, 606var topNameNode = node; 627else if (node.FirstAncestorOrSelf<SyntaxNode, ISyntaxFactsService>((node, syntaxFacts) => syntaxFacts.IsUsingOrExternOrImport(node), syntaxFacts) != null) 731private static bool IsNodeOrAnyAncestorLeftSideOfDot(SyntaxNode node, ISyntaxFactsService syntaxFacts) 749SyntaxNode node, FindReferencesDocumentState state) 766void TryAddAdditionalProperty(SyntaxNode? node, string key)
FindSymbols\FindReferences\Finders\AbstractReferenceFinder_GlobalSuppressions.cs (3)
184var attributeArgument = token.Parent?.Parent; 190var attributeNode = attributeArgument!.Parent?.Parent; 204SyntaxNode root,
FindSymbols\FindReferences\Finders\ExplicitConversionSymbolReferenceFinder.cs (1)
82var node = token.GetRequiredParent();
FindSymbols\FindReferences\Finders\FinderLocation.cs (4)
7internal readonly struct FinderLocation(SyntaxNode node, ReferenceLocation location) 14public readonly SyntaxNode Node = node; 21/// cref="SyntaxNode.GetLocation"/>. Instead, this location is where we want to navigate 29public void Deconstruct(out SyntaxNode node, out ReferenceLocation location)
FindSymbols\FindReferences\Finders\ParameterSymbolReferenceFinder.cs (8)
97var parameterNode = parameter.DeclaringSyntaxReferences.Select(r => r.GetSyntax(cancellationToken)).FirstOrDefault(); 108var lambdaNode = parameter.ContainingSymbol.DeclaringSyntaxReferences.Select(r => r.GetSyntax(cancellationToken)).First(); 114var container = GetContainer(semanticModel, parameterNode, syntaxFacts); 131SyntaxNode container, 148var lambdaNode = symbol.ContainingSymbol.DeclaringSyntaxReferences.Select(r => r.GetSyntax(cancellationToken)).First(); 169private static SyntaxNode? GetContainer(SemanticModel semanticModel, SyntaxNode parameterNode, ISyntaxFactsService syntaxFactsService) 171for (var current = parameterNode; current != null; current = current.Parent)
FindSymbols\FindReferences\Finders\PropertySymbolReferenceFinder.cs (12)
89var constructorSyntax = constructor.DeclaringSyntaxReferences[0].GetSyntax(cancellationToken); 232private static (bool matched, CandidateReason reason, SyntaxNode indexerReference) ComputeIndexerInformation( 235SyntaxNode node, 260private static (bool matched, CandidateReason reason, SyntaxNode indexerReference) ComputeIndexerMemberCRefInformation( 261IPropertySymbol symbol, FindReferencesDocumentState state, SyntaxNode node, CancellationToken cancellationToken) 269private static (bool matched, CandidateReason reason, SyntaxNode indexerReference) ComputeConditionalAccessInformation( 270IPropertySymbol symbol, SyntaxNode node, FindReferencesDocumentState state, CancellationToken cancellationToken) 274syntaxFacts.GetPartsOfConditionalAccessExpression(node, out _, out var indexerReference); 288private static (bool matched, CandidateReason reason, SyntaxNode? indexerReference) ComputeElementAccessInformation( 289IPropertySymbol symbol, SyntaxNode node, FindReferencesDocumentState state, CancellationToken cancellationToken) 305private static (bool matched, CandidateReason reason, SyntaxNode indexerReference) ComputeImplicitElementAccessInformation( 306IPropertySymbol symbol, SyntaxNode node, FindReferencesDocumentState state, CancellationToken cancellationToken)
FindSymbols\FindReferences\FindReferenceCache.cs (7)
41var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 54public readonly SyntaxNode Root; 66private readonly ConcurrentDictionary<SyntaxNode, SymbolInfo> _symbolInfoCache = []; 74Document document, SourceText text, SemanticModel semanticModel, SemanticModel nullableEnabledSemanticModel, SyntaxNode root, SyntaxTreeIndex syntaxTreeIndex) 92public SymbolInfo GetSymbolInfo(SyntaxNode node, CancellationToken cancellationToken) 164if (current.AsNode(out var currentNode)) 226foreach (var constructor in syntaxFacts.GetConstructors(this.Root, cancellationToken))
FindSymbols\FindReferences\FindReferencesDocumentState.cs (1)
25public SyntaxNode Root => this.Cache.Root;
FindSymbols\Shared\AbstractSyntaxIndex.cs (4)
19protected delegate TIndex IndexCreator(ProjectState project, SyntaxNode root, Checksum checksum, CancellationToken cancellationToken); 125var root = await syntaxTree.GetRootAsync(cancellationToken).ConfigureAwait(false); 145private static bool ContainsIfDirective(SyntaxNode node, int ifDirectiveKind) 152if (child.AsNode(out var childNode))
FindSymbols\SymbolFinder.cs (3)
266var originalRoot = await location.SyntaxTree.GetRootAsync(cancellationToken).ConfigureAwait(false); 275var linkedSyntaxRoot = await linkedDocument.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 279var linkedNode = linkedSyntaxRoot.FindNode(location.Span, getInnermostNodeForTie: true);
FindSymbols\SyntaxTree\SyntaxTreeIndex_Create.cs (16)
41ProjectState project, SyntaxNode root, Checksum checksum, CancellationToken _) 87var node = current.AsNode(); 213private static bool IsGlobalSuppressMessageAttribute(ISyntaxFactsService syntaxFacts, SyntaxNode node) 218var name = syntaxFacts.GetNameOfAttribute(node); 221syntaxFacts.GetPartsOfQualifiedName(name, out _, out _, out var right); 239SyntaxNode node) 256foreach (var attributeList in attributeLists) 258foreach (var attribute in syntaxFacts.GetAttributesOfAttributeList(attributeList)) 260syntaxFacts.GetPartsOfAttribute(attribute, out var attributeName, out var argumentList); 268var versionArg = syntaxFacts.GetExpressionOfAttributeArgument(arguments[0]); 269var dataArg = syntaxFacts.GetExpressionOfAttributeArgument(arguments[1]); 284syntaxFacts.GetPartsOfQualifiedName(attributeName, out _, out _, out var right); 308SyntaxNode node) 313syntaxFacts.GetPartsOfUsingAliasDirective(node, out var globalToken, out var alias, out var usingTarget); 318syntaxFacts.GetPartsOfQualifiedName(usingTarget, out _, out _, out var right);
FindSymbols\TopLevelSyntaxTree\DeclaredSymbolInfo.cs (2)
223var root = semanticModel.SyntaxTree.GetRoot(cancellationToken); 226var node = root.FindNode(this.Span);
FindSymbols\TopLevelSyntaxTree\IDeclaredSymbolInfoFactoryService.cs (1)
16void AddDeclaredSymbolInfos(ProjectState project, SyntaxNode root, ArrayBuilder<DeclaredSymbolInfo> declaredSymbolInfos, Dictionary<string, ArrayBuilder<int>> extensionMethodInfo, CancellationToken cancellationToken);
FindSymbols\TopLevelSyntaxTree\TopLevelSyntaxTreeIndex_Create.cs (1)
16ProjectState project, SyntaxNode root, Checksum checksum, CancellationToken cancellationToken)
Formatting\Formatter.cs (35)
94var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 115var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 132var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 151public static SyntaxNode Format(SyntaxNode node, SyntaxAnnotation annotation, Workspace workspace, OptionSet? options = null, CancellationToken cancellationToken = default) 154internal static SyntaxNode Format(SyntaxNode node, SyntaxAnnotation annotation, SolutionServices services, SyntaxFormattingOptions options, CancellationToken cancellationToken) 157private static SyntaxNode Format(SyntaxNode node, SyntaxAnnotation annotation, Workspace workspace, OptionSet? options, ImmutableArray<AbstractFormattingRule> rules, CancellationToken cancellationToken) 177internal static SyntaxNode Format(SyntaxNode node, SyntaxAnnotation annotation, SolutionServices services, SyntaxFormattingOptions options, ImmutableArray<AbstractFormattingRule> rules, CancellationToken cancellationToken) 188public static SyntaxNode Format(SyntaxNode node, Workspace workspace, OptionSet? options = null, CancellationToken cancellationToken = default) 191internal static SyntaxNode Format(SyntaxNode node, SolutionServices services, SyntaxFormattingOptions options, CancellationToken cancellationToken) 203public static SyntaxNode Format(SyntaxNode node, TextSpan span, Workspace workspace, OptionSet? options = null, CancellationToken cancellationToken = default) 206internal static SyntaxNode Format(SyntaxNode node, TextSpan span, SolutionServices services, SyntaxFormattingOptions options, CancellationToken cancellationToken) 218public static SyntaxNode Format(SyntaxNode node, IEnumerable<TextSpan>? spans, Workspace workspace, OptionSet? options = null, CancellationToken cancellationToken = default) 221private static SyntaxNode Format(SyntaxNode node, IEnumerable<TextSpan>? spans, Workspace workspace, OptionSet? options, ImmutableArray<AbstractFormattingRule> rules, CancellationToken cancellationToken) 227internal static SyntaxNode Format(SyntaxNode node, IEnumerable<TextSpan>? spans, SolutionServices services, SyntaxFormattingOptions options, ImmutableArray<AbstractFormattingRule> rules, CancellationToken cancellationToken) 230private static IFormattingResult? GetFormattingResult(SyntaxNode node, IEnumerable<TextSpan>? spans, Workspace workspace, OptionSet? options, ImmutableArray<AbstractFormattingRule> rules, CancellationToken cancellationToken) 254internal static IFormattingResult GetFormattingResult(SyntaxNode node, IEnumerable<TextSpan>? spans, SolutionServices services, SyntaxFormattingOptions options, ImmutableArray<AbstractFormattingRule> rules, CancellationToken cancellationToken) 268public static IList<TextChange> GetFormattedTextChanges(SyntaxNode node, Workspace workspace, OptionSet? options = null, CancellationToken cancellationToken = default) 271internal static IList<TextChange> GetFormattedTextChanges(SyntaxNode node, SolutionServices services, SyntaxFormattingOptions options, CancellationToken cancellationToken) 283public static IList<TextChange> GetFormattedTextChanges(SyntaxNode node, TextSpan span, Workspace workspace, OptionSet? options = null, CancellationToken cancellationToken = default) 286internal static IList<TextChange> GetFormattedTextChanges(SyntaxNode node, TextSpan span, SolutionServices services, SyntaxFormattingOptions options, CancellationToken cancellationToken = default) 298public static IList<TextChange> GetFormattedTextChanges(SyntaxNode node, IEnumerable<TextSpan>? spans, Workspace workspace, OptionSet? options = null, CancellationToken cancellationToken = default) 301internal static IList<TextChange> GetFormattedTextChanges(SyntaxNode node, IEnumerable<TextSpan>? spans, SolutionServices services, SyntaxFormattingOptions options, CancellationToken cancellationToken = default) 304private static IList<TextChange> GetFormattedTextChanges(SyntaxNode node, IEnumerable<TextSpan>? spans, Workspace workspace, OptionSet? options, ImmutableArray<AbstractFormattingRule> rules, CancellationToken cancellationToken) 312internal static IList<TextChange> GetFormattedTextChanges(SyntaxNode node, IEnumerable<TextSpan>? spans, SolutionServices services, SyntaxFormattingOptions options, ImmutableArray<AbstractFormattingRule> rules, CancellationToken cancellationToken = default)
LanguageServices\DeclaredSymbolFactoryService\AbstractDeclaredSymbolInfoFactoryService.cs (10)
25where TCompilationUnitSyntax : SyntaxNode 26where TUsingDirectiveSyntax : SyntaxNode 31where TMemberDeclarationSyntax : SyntaxNode 32where TNameSyntax : SyntaxNode 68SyntaxNode container, TTypeDeclarationSyntax typeDeclaration, StringTable stringTable, string containerDisplayName, string fullyQualifiedContainerName); 70SyntaxNode container, TEnumDeclarationSyntax enumDeclaration, StringTable stringTable, string containerDisplayName, string fullyQualifiedContainerName); 72SyntaxNode container, TMemberDeclarationSyntax memberDeclaration, StringTable stringTable, ArrayBuilder<DeclaredSymbolInfo> declaredSymbolInfos, string containerDisplayName, string fullyQualifiedContainerName); 76SyntaxNode container, TMemberDeclarationSyntax memberDeclaration, StringTable stringTable, ArrayBuilder<DeclaredSymbolInfo> declaredSymbolInfos, string containerDisplayName, string fullyQualifiedContainerName, CancellationToken cancellationToken); 154SyntaxNode root, 175SyntaxNode container,
LanguageServices\FixAllSpanMappingService\AbstractFixAllSpanMappingService.cs (6)
34var decl = await GetContainingMemberOrTypeDeclarationAsync(document, fixAllInContainingMember, span, cancellationToken).ConfigureAwait(false); 54var root = await syntaxRef.SyntaxTree.GetRootAsync(cancellationToken).ConfigureAwait(false); 71private static async Task<SyntaxNode?> GetContainingMemberOrTypeDeclarationAsync( 77var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 80var startContainer = fixAllInContainingMember 93var endContainer = fixAllInContainingMember
ObsoleteSymbol\AbstractObsoleteSymbolService.cs (7)
36var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 61using var _ = ArrayBuilder<SyntaxNode>.GetInstance(out var stack); 70while (stack.TryPop(out var current)) 78if (child.AsNode(out var childNode)) 92static void ExtractStructureFromTrivia(ArrayBuilder<SyntaxNode> stack, SyntaxTriviaList triviaList) 109SyntaxToken ProcessNode(SemanticModel semanticModel, SyntaxNode node) 113syntaxFacts.GetPartsOfUsingAliasDirective(node, out _, out var aliasToken, out var name);
ReassignedVariable\AbstractReassignedVariableService.cs (21)
27where TParameterSyntax : SyntaxNode 28where TVariableSyntax : SyntaxNode 29where TSingleVariableDesignationSyntax : SyntaxNode 30where TIdentifierNameSyntax : SyntaxNode 32protected abstract SyntaxNode GetParentScope(SyntaxNode localDeclaration); 33protected abstract SyntaxNode GetMemberBlock(SyntaxNode methodOrPropertyDeclaration); 35protected abstract bool HasInitializer(SyntaxNode variable); 46var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 63using var _ = ArrayBuilder<SyntaxNode>.GetInstance(out var stack); 74var current = stack.Last(); 83if (child.AsNode(out var childNode)) 103void ProcessNode(SemanticModel semanticModel, SyntaxNode node) 204var declaration = syntaxReference.GetSyntax(cancellationToken); 226var methodOrPropertyDeclaration = methodOrProperty.DeclaringSyntaxReferences.First().GetSyntax(cancellationToken); 271var localDeclaration = local.DeclaringSyntaxReferences 295SyntaxNode parentScope) 298using var _ = ArrayBuilder<SyntaxNode>.GetInstance(out var stack); 303var current = stack.Last(); 308if (child.AsNode(out var childNode))
Recommendations\AbstractRecommendationService.cs (1)
21where TAnonymousFunctionSyntax : SyntaxNode
Recommendations\AbstractRecommendationServiceRunner.cs (6)
44public abstract bool TryGetExplicitTypeOfLambdaParameter(SyntaxNode lambdaSyntax, int ordinalInLambda, [NotNullWhen(returnValue: true)] out ITypeSymbol explicitLambdaParameterType); 90var invocationExpression = lambdaSyntax.Parent.Parent.Parent; 94var expressionOfInvocationExpression = syntaxFactsService.GetExpressionOfInvocationExpression(invocationExpression); 134private ImmutableArray<ITypeSymbol> SubstituteTypeParameters(ImmutableArray<ITypeSymbol> parameterTypeSymbols, SyntaxNode invocationExpression) 272where TNamespaceDeclarationSyntax : SyntaxNode 332protected static bool IsNonIntersectingNamespace(ISymbol recommendationSymbol, SyntaxNode declarationSyntax)
Rename\ConflictEngine\ConflictResolver.cs (3)
130private static ImmutableArray<ISymbol> SymbolsForEnclosingInvocationExpressionWorker(SyntaxNode invocationExpression, SemanticModel semanticModel, CancellationToken cancellationToken) 138private static SyntaxNode? GetExpansionTargetForLocationPerLanguage(SyntaxToken tokenOrNode, Document document) 141var complexifiedTarget = renameRewriterService.GetExpansionTargetForLocation(tokenOrNode);
Rename\ConflictEngine\ConflictResolver.Session.cs (9)
327var syntaxRoot = await newDocument.GetRequiredSyntaxRootAsync(_cancellationToken).ConfigureAwait(false); 353var syntaxRoot = await newDocument.GetRequiredSyntaxRootAsync(_cancellationToken).ConfigureAwait(false); 356var baseRoot = await baseDocument.GetRequiredSyntaxRootAsync(_cancellationToken).ConfigureAwait(false); 423var complexifiedTarget = GetExpansionTargetForLocationPerLanguage(baseToken, baseDocument); 445var syntaxRoot = await newDocument.GetRequiredSyntaxRootAsync(_cancellationToken).ConfigureAwait(false); 503SyntaxNode syntaxRoot) 662var invocationReferencedSymbols = SymbolsForEnclosingInvocationExpressionWorker((SyntaxNode)tokenOrNode!, newDocumentSemanticModel, _cancellationToken); 794var originalSyntaxRoot = await semanticModel.SyntaxTree.GetRootAsync(_cancellationToken).ConfigureAwait(false); 837var newRoot = renameRewriterLanguageService.AnnotateAndRename(parameters);
Rename\ConflictEngine\MutableConflictResolution.cs (2)
74var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 78var newRoot = root.ReplaceSyntax(
Rename\ConflictEngine\RenamedSpansTracker.cs (2)
174var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 178.Select(x => Tuple.Create(renameAnnotations.GetAnnotations<RenameNodeSimplificationAnnotation>(x).First(), (SyntaxNode)x!));
Rename\IRenameRewriterLanguageService.cs (4)
26SyntaxNode AnnotateAndRename(RenameRewriterParameters parameters); 120SyntaxNode? GetExpansionTargetForLocation(SyntaxToken token); 125public abstract SyntaxNode AnnotateAndRename(RenameRewriterParameters parameters); 129public abstract SyntaxNode? GetExpansionTargetForLocation(SyntaxToken token);
Rename\Renamer.RenameSymbolDocumentAction.cs (3)
69private static async Task<SyntaxNode?> GetMatchingTypeDeclarationAsync(Document document, CancellationToken cancellationToken) 71var syntaxRoot = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 99var matchingDeclaration = await GetMatchingTypeDeclarationAsync(document, cancellationToken).ConfigureAwait(false);
Rename\RenameRewriterParameters.cs (2)
17SyntaxNode syntaxRoot, 48internal readonly SyntaxNode SyntaxRoot = syntaxRoot;
Rename\SymbolicRenameLocations.ReferenceProcessing.cs (2)
366var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 384var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
SemanticModelReuse\AbstractSemanticModelReuseLanguageService.cs (15)
19where TMemberDeclarationSyntax : SyntaxNode 21where TAccessorDeclarationSyntax : SyntaxNode 27public abstract SyntaxNode? TryGetContainingMethodBodyForSpeculation(SyntaxNode node); 29protected abstract SemanticModel? TryGetSpeculativeSemanticModelWorker(SemanticModel previousSemanticModel, SyntaxNode previousBodyNode, SyntaxNode currentBodyNode); 42public async Task<SemanticModel?> TryGetSpeculativeSemanticModelAsync(SemanticModel previousSemanticModel, SyntaxNode currentBodyNode, CancellationToken cancellationToken) 56var previousRoot = await previousSemanticModel.SyntaxTree.GetRootAsync(cancellationToken).ConfigureAwait(false); 57var currentRoot = await currentBodyNode.SyntaxTree.GetRootAsync(cancellationToken).ConfigureAwait(false); 58var previousBodyNode = GetPreviousBodyNode(previousRoot, currentRoot, currentBodyNode); 80protected SyntaxNode GetPreviousBodyNode(SyntaxNode previousRoot, SyntaxNode currentRoot, SyntaxNode currentBodyNode) 88var previousContainer = GetPreviousBodyNode(previousRoot, currentRoot, currentContainer);
SemanticModelReuse\ISemanticModelReuseLanguageService.cs (3)
22SyntaxNode? TryGetContainingMethodBodyForSpeculation(SyntaxNode node); 36Task<SemanticModel?> TryGetSpeculativeSemanticModelAsync(SemanticModel previousSemanticModel, SyntaxNode currentBodyNode, CancellationToken cancellationToken);
SemanticModelReuse\SemanticModelWorkspaceServiceFactory.SemanticModelWorkspaceService.cs (2)
15internal readonly struct SemanticModelReuseInfo(SemanticModel previousNonSpeculativeSemanticModel, SemanticModel currentSemanticModel, SyntaxNode bodyNode, VersionStamp topLevelSementicVersion) 31public readonly SyntaxNode BodyNode = bodyNode;
Shared\Extensions\SemanticModelExtensions.cs (4)
19public static SemanticMap GetSemanticMap(this SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken) 93var tokenParent = token.Parent; 97var usingStatement = token.Parent; 112var bindableParent = syntaxFacts.TryGetBindableParent(token);
Shared\Extensions\SyntaxGeneratorExtensions.cs (7)
54SyntaxNode? getBody; 55SyntaxNode? setBody; 60var statement = codeFactory.CreateThrowNotImplementedStatement(compilation); 179private static SyntaxNode WrapWithRefIfNecessary(SyntaxGenerator codeFactory, IPropertySymbol overriddenProperty, SyntaxNode body) 249var statement = codeFactory.CreateThrowNotImplementedStatement(compilation); 261var body = codeFactory.InvocationExpression(
Shared\Utilities\SemanticMap.cs (2)
15private readonly Dictionary<SyntaxNode, SymbolInfo> _expressionToInfoMap = []; 23internal static SemanticMap From(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken)
Shared\Utilities\SemanticMap.Walker.cs (2)
15public void Visit(SyntaxNode node) 19if (child.AsNode(out var childNode))
Simplification\Simplifier.cs (15)
62public static async Task<TNode> ExpandAsync<TNode>(TNode node, Document document, Func<SyntaxNode, bool>? expandInsideNode = null, bool expandParameter = false, CancellationToken cancellationToken = default) where TNode : SyntaxNode 81public static TNode Expand<TNode>(TNode node, SemanticModel semanticModel, Workspace workspace, Func<SyntaxNode, bool>? expandInsideNode = null, bool expandParameter = false, CancellationToken cancellationToken = default) where TNode : SyntaxNode 92internal static TNode Expand<TNode>(TNode node, SemanticModel semanticModel, SolutionServices services, Func<SyntaxNode, bool>? expandInsideNode = null, bool expandParameter = false, CancellationToken cancellationToken = default) where TNode : SyntaxNode 103var result = services.GetRequiredLanguageService<ISimplificationService>(node.Language) 112public static async Task<SyntaxToken> ExpandAsync(SyntaxToken token, Document document, Func<SyntaxNode, bool>? expandInsideNode = null, CancellationToken cancellationToken = default) 126public static SyntaxToken Expand(SyntaxToken token, SemanticModel semanticModel, Workspace workspace, Func<SyntaxNode, bool>? expandInsideNode = null, CancellationToken cancellationToken = default) 137internal static SyntaxToken Expand(SyntaxToken token, SemanticModel semanticModel, SolutionServices services, Func<SyntaxNode, bool>? expandInsideNode = null, CancellationToken cancellationToken = default) 159var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 167var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 187var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 195var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 248var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
src\Compilers\Core\Portable\SourceGeneration\GeneratedCodeUtilities.cs (3)
55internal static bool IsGeneratedCode(string? filePath, SyntaxNode root, Func<SyntaxTrivia, bool> isComment) 88private static bool BeginsWithAutoGeneratedComment(SyntaxNode root, Func<SyntaxTrivia, bool> isComment) 120var root = tree.GetRoot(cancellationToken);
src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (2)
22var root = tree.GetRoot(); 25SyntaxNode? node = null;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\AnalysisContextExtensions.cs (10)
150public static SyntaxNode GetAnalysisRoot(this SyntaxTreeAnalysisContext context, bool findInTrivia, bool getInnermostNodeForTie = false) 156public static SyntaxNode GetAnalysisRoot(this SemanticModelAnalysisContext context, bool findInTrivia, bool getInnermostNodeForTie = false) 164public static SyntaxNode GetAnalysisRoot(this SymbolStartAnalysisContext context, bool findInTrivia, bool getInnermostNodeForTie = false) 176public static SyntaxNode GetAnalysisRoot(this SymbolAnalysisContext context, bool findInTrivia, bool getInnermostNodeForTie = false) 186public static SyntaxNode GetAnalysisRoot(this OperationBlockStartAnalysisContext context, IOperation operationBlock, bool findInTrivia, bool getInnermostNodeForTie = false) 192public static SyntaxNode GetAnalysisRoot(this OperationBlockAnalysisContext context, IOperation operationBlock, bool findInTrivia, bool getInnermostNodeForTie = false) 198public static SyntaxNode GetAnalysisRoot(this OperationAnalysisContext context, bool findInTrivia, bool getInnermostNodeForTie = false) 204public static SyntaxNode GetAnalysisRoot(this SyntaxNodeAnalysisContext context, bool findInTrivia, bool getInnermostNodeForTie = false) 210public static SyntaxNode GetAnalysisRoot<TSyntaxKind>(this CodeBlockStartAnalysisContext<TSyntaxKind> context, bool findInTrivia, bool getInnermostNodeForTie = false) where TSyntaxKind : struct 216public static SyntaxNode GetAnalysisRoot(this CodeBlockAnalysisContext context, bool findInTrivia, bool getInnermostNodeForTie = false)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DirectiveInfo.cs (1)
14where TDirectiveTriviaSyntax : SyntaxNode
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\IParameterSymbolExtensions.cs (3)
37var parameterSyntax = parameter.DeclaringSyntaxReferences[0].GetSyntax(cancellationToken); 38var constructorSyntax = constructor.DeclaringSyntaxReferences[0].GetSyntax(cancellationToken); 68var constructorSyntax = constructorReference.GetSyntax(cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (1)
593var declarationSyntax = symbol.DeclaringSyntaxReferences.Select(r => r.GetSyntax()).FirstOrDefault();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\LocationExtensions.cs (3)
22public static SyntaxNode FindNode(this Location location, CancellationToken cancellationToken) 25public static SyntaxNode FindNode(this Location location, bool getInnermostNodeForTie, CancellationToken cancellationToken) 28public static SyntaxNode FindNode(this Location location, bool findInsideTrivia, bool getInnermostNodeForTie, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticEquivalence.cs (8)
17public static bool AreEquivalent(SemanticModel semanticModel, SyntaxNode node1, SyntaxNode node2) 23SyntaxNode node1, 24SyntaxNode node2, 25Func<SyntaxNode, bool> predicate = null) 53SyntaxNode node1, 54SyntaxNode node2, 55Func<SyntaxNode, bool> predicate)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (18)
35public static DataFlowAnalysis AnalyzeRequiredDataFlow(this SemanticModel semanticModel, SyntaxNode statementOrExpression) 38public static DataFlowAnalysis AnalyzeRequiredDataFlow(this SemanticModel semanticModel, SyntaxNode firstStatement, SyntaxNode lastStatement) 41public static ControlFlowAnalysis AnalyzeRequiredControlFlow(this SemanticModel semanticModel, SyntaxNode statement) 44public static ControlFlowAnalysis AnalyzeRequiredControlFlow(this SemanticModel semanticModel, SyntaxNode firstStatement, SyntaxNode lastStatement) 47public static ISymbol GetRequiredDeclaredSymbol(this SemanticModel semanticModel, SyntaxNode declaration, CancellationToken cancellationToken) 53public static IOperation GetRequiredOperation(this SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken) 94this SemanticModel semanticModel, SyntaxNode? container, CancellationToken cancellationToken, Func<SyntaxNode, bool>? descendInto = null) 116this SemanticModel semanticModel, SyntaxNode? container, CancellationToken cancellationToken, Func<SyntaxNode, bool>? filter = null) 128SemanticModel semanticModel, SyntaxNode node, 129HashSet<ISymbol> symbols, CancellationToken cancellationToken, Func<SyntaxNode, bool>? descendInto = null) 140if (child.AsNode(out var childNode) && 147static bool ShouldDescendInto(SyntaxNode node, Func<SyntaxNode, bool>? filter) 233SyntaxNode expression,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (111)
23public static SyntaxNode GetRequiredParent(this SyntaxNode node) 26public static IEnumerable<SyntaxNodeOrToken> DepthFirstTraversal(this SyntaxNode node) 29public static IEnumerable<SyntaxNode> DepthFirstTraversalNodes(this SyntaxNode node) 32public static IEnumerable<SyntaxNode> GetAncestors(this SyntaxNode node) 34var current = node.Parent; 44public static IEnumerable<TNode> GetAncestors<TNode>(this SyntaxNode node) 45where TNode : SyntaxNode 47var current = node.Parent; 59public static TNode? GetAncestor<TNode>(this SyntaxNode node) 60where TNode : SyntaxNode 62var current = node.Parent; 76public static TNode? GetAncestorOrThis<TNode>(this SyntaxNode? node) 77where TNode : SyntaxNode 82public static IEnumerable<TNode> GetAncestorsOrThis<TNode>(this SyntaxNode? node) 83where TNode : SyntaxNode 85var current = node; 97public static bool HasAncestor<TNode>(this SyntaxNode node) 98where TNode : SyntaxNode 104this SyntaxNode node, TextSpan searchSpan, Func<SyntaxNode, bool> predicate) 105where TSyntaxNode : SyntaxNode 109var nodes = new LinkedList<SyntaxNode>(); 114var currentNode = nodes.First!.Value; 129public static bool CheckParent<T>([NotNullWhen(returnValue: true)] this SyntaxNode? node, Func<T, bool> valueChecker) where T : SyntaxNode 145public static bool IsChildNode<TParent>(this SyntaxNode node, Func<TParent, SyntaxNode?> childGetter) 146where TParent : SyntaxNode 154var ancestorNode = childGetter(ancestor); 162public static bool IsFoundUnder<TParent>(this SyntaxNode node, Func<TParent, SyntaxNode?> childGetter) 163where TParent : SyntaxNode 171var child = childGetter(ancestor); 174return node.GetAncestorsOrThis<SyntaxNode>().Contains(child); 177public static SyntaxNode GetCommonRoot(this SyntaxNode node1, SyntaxNode node2) 183using var _ = PooledHashSet<SyntaxNode>.GetInstance(out var set); 184set.AddRange(node2.GetAncestorsOrThis<SyntaxNode>()); 186foreach (var ancestor in node1.AncestorsAndSelf()) 195public static int Width(this SyntaxNode node) 198public static int FullWidth(this SyntaxNode node) 201public static SyntaxNode? FindInnermostCommonNode(this IEnumerable<SyntaxNode> nodes, Func<SyntaxNode, bool> predicate) 204public static SyntaxNode? FindInnermostCommonNode(this IEnumerable<SyntaxNode> nodes) 214using var _1 = ArrayBuilder<SyntaxNode>.GetInstance(out var commonAncestorsStack); 215using var _2 = PooledHashSet<SyntaxNode>.GetInstance(out var commonAncestorsSet); 218foreach (var node in nodes) 239var commonAncestor = FindCommonAncestor(node, commonAncestorsSet); 281static SyntaxNode? FindCommonAncestor(SyntaxNode node, HashSet<SyntaxNode> commonAncestorsSet) 293public static TSyntaxNode? FindInnermostCommonNode<TSyntaxNode>(this IEnumerable<SyntaxNode> nodes) where TSyntaxNode : SyntaxNode 296public static TextSpan GetContainedSpan(this IEnumerable<SyntaxNode> nodes) 302foreach (var node in nodes) 312public static bool OverlapsHiddenPosition(this SyntaxNode node, CancellationToken cancellationToken) 315public static bool OverlapsHiddenPosition(this SyntaxNode node, TextSpan span, CancellationToken cancellationToken) 318public static bool OverlapsHiddenPosition(this SyntaxNode declaration, SyntaxNode startNode, SyntaxNode endNode, CancellationToken cancellationToken) 327public static IEnumerable<T> GetAnnotatedNodes<T>(this SyntaxNode node, SyntaxAnnotation syntaxAnnotation) where T : SyntaxNode 341IEnumerable<SyntaxNode> nodes, 342Func<SyntaxNode, SyntaxNode, CancellationToken, Task<SyntaxNode>> computeReplacementAsync, 343CancellationToken cancellationToken) where TRootNode : SyntaxNode 365CancellationToken cancellationToken) where TRootNode : SyntaxNode 378CancellationToken cancellationToken) where TRoot : SyntaxNode 389IEnumerable<SyntaxNode>? nodes, 390Func<SyntaxNode, SyntaxNode, CancellationToken, Task<SyntaxNode>>? computeReplacementNodeAsync, 396where TRoot : SyntaxNode 403var nodeReplacements = new Dictionary<SyntaxNode, SyntaxNode>(); 441var original = (SyntaxNode?)retryAnnotations.GetAnnotations(currentNode).SingleOrDefault() ?? currentNode; 472if (rewritten != original || !nodeReplacements.TryGetValue(original, out var replaced)) 598SyntaxNode root, 614this SyntaxNode root, 653this SyntaxNode root, 690params SyntaxTrivia[] trivia) where T : SyntaxNode 702SyntaxTriviaList trivia) where T : SyntaxNode 714IEnumerable<SyntaxTrivia> trivia) where T : SyntaxNode 724params SyntaxTrivia[] trivia) where T : SyntaxNode 736SyntaxTriviaList trivia) where T : SyntaxNode 748IEnumerable<SyntaxTrivia> trivia) where T : SyntaxNode 759IEnumerable<SyntaxTrivia> trailingTrivia) where T : SyntaxNode 784public static SyntaxNode FindNode(this SyntaxNode root, TextSpan? span, bool findInTrivia, bool getInnermostNodeForTie) 792public static SyntaxNode? GetParent(this SyntaxNode node, bool ascendOutOfTrivia) 794var parent = node.Parent; 806public static TNode? FirstAncestorOrSelfUntil<TNode>(this SyntaxNode? node, Func<SyntaxNode, bool> predicate) 807where TNode : SyntaxNode 809for (var current = node; current != null; current = current.GetParent(ascendOutOfTrivia: true)) 826SyntaxNode root, 829where TDirectiveTriviaSyntax : SyntaxNode 835where TDirectiveTriviaSyntax : SyntaxNode 855SyntaxNode root, 946public static ValueAncestorsAndSelfEnumerable ValueAncestorsAndSelf(this SyntaxNode syntaxNode, bool ascendOutOfTrivia = true) 949public readonly struct ValueAncestorsAndSelfEnumerable(SyntaxNode syntaxNode, bool ascendOutOfTrivia) 954public struct Enumerator(SyntaxNode syntaxNode, bool ascendOutOfTrivia) 956public SyntaxNode Current { get; private set; } = null!;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeOrTokenExtensions.cs (4)
14public static bool AsNode(this SyntaxNodeOrToken nodeOrToken, [NotNullWhen(true)] out SyntaxNode? node) 44public static IEnumerable<SyntaxNode> DepthFirstTraversalNodes(this SyntaxNodeOrToken node) 48if (t.AsNode(out var childNode)) 60=> nodeOrToken.AsNode(out var node) ? node.WithAppendedTrailingTrivia(trivia) : nodeOrToken.AsToken().WithAppendedTrailingTrivia(trivia);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTokenExtensions.cs (12)
15public static SyntaxNode? GetAncestor(this SyntaxToken token, Func<SyntaxNode, bool>? predicate) 16=> token.GetAncestor<SyntaxNode>(predicate); 18public static T? GetAncestor<T>(this SyntaxToken token, Func<T, bool>? predicate = null) where T : SyntaxNode 21public static T GetRequiredAncestor<T>(this SyntaxToken token, Func<T, bool>? predicate = null) where T : SyntaxNode 25where T : SyntaxNode 32public static IEnumerable<SyntaxNode> GetAncestors(this SyntaxToken token, Func<SyntaxNode, bool> predicate) 39public static SyntaxNode? GetCommonRoot(this SyntaxToken token1, SyntaxToken token2) 53public static bool CheckParent<T>(this SyntaxToken token, Func<T, bool> valueChecker) where T : SyntaxNode 69public static SyntaxToken FindTokenFromEnd(this SyntaxNode root, int position, bool includeZeroWidth = true, bool findInsideTrivia = false) 164public static SyntaxNode GetRequiredParent(this SyntaxToken token)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTreeExtensions.cs (6)
76var root = await syntaxTree.GetRootAsync(cancellationToken).ConfigureAwait(false); 122var root = syntaxTree.GetRoot(cancellationToken); 133var root = syntaxTree.GetRoot(cancellationToken); 170var root = syntaxTree.GetRoot(cancellationToken); 249public static SyntaxNode FindNode(this SyntaxTree syntaxTree, TextSpan? span, bool findInTrivia, bool getInnermostNodeForTie, CancellationToken cancellationToken) 251var root = syntaxTree.GetRoot(cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\AbstractSyntaxFormatting.cs (3)
28protected abstract IFormattingResult CreateAggregatedFormattingResult(SyntaxNode node, IList<AbstractFormattingResult> results, TextSpanMutableIntervalTree? formattingSpans = null); 30protected abstract AbstractFormattingResult Format(SyntaxNode node, SyntaxFormattingOptions options, ImmutableArray<AbstractFormattingRule> rules, SyntaxToken startToken, SyntaxToken endToken, CancellationToken cancellationToken); 32public IFormattingResult GetFormattingResult(SyntaxNode node, IEnumerable<TextSpan>? spans, SyntaxFormattingOptions options, ImmutableArray<AbstractFormattingRule> rules, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\BottomUpBaseIndentationFinder.cs (11)
109SyntaxNode root, 136SyntaxNode root, 185SyntaxNode root, List<IndentBlockOperation> list, int position) 229private static IEnumerable<SyntaxNode> GetParentNodes(SyntaxToken token) 231var current = token.Parent; 249var startNode = token.Parent; 252var currentNode = startNode; 278private IndentBlockOperation? GetIndentationDataFor(SyntaxNode root, SyntaxToken token, int position) 280var startNode = token.Parent; 285var currentNode = startNode; 311private static IEnumerable<IndentBlockOperation> GetIndentBlockOperationsFromSmallestSpan(SyntaxNode root, List<IndentBlockOperation> list, int position)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (1)
79var rootNode = this.TreeData.Root;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.InitialContextFinder.cs (7)
28private readonly SyntaxNode _rootNode; 33SyntaxNode rootNode) 70var node = startToken.GetCommonRoot(endToken)!.GetParentWithBiggerSpan(); 71var previous = (SyntaxNode?)null; 145var startNode = token.Parent; 152var currentIndentationNode = startNode;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractAggregatedFormattingResult.cs (7)
19protected readonly SyntaxNode Node; 25private readonly CancellableLazy<SyntaxNode> _lazyNode; 28SyntaxNode node, 40_lazyNode = new CancellableLazy<SyntaxNode>(CreateFormattedRoot); 46protected abstract SyntaxNode Rewriter(Dictionary<ValueTuple<SyntaxToken, SyntaxToken>, TriviaData> changeMap, CancellationToken cancellationToken); 64public SyntaxNode GetFormattedRoot(CancellationToken cancellationToken) 99private SyntaxNode CreateFormattedRoot(CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.cs (6)
40private readonly SyntaxNode _commonRoot; 173foreach (var node in _commonRoot.DescendantNodesAndSelf(this.SpanToFormat)) 189private static void AddOperations<T>(SegmentedList<T> operations, List<T> scratch, SyntaxNode node, Action<List<T>, SyntaxNode> addOperations) 203private static void AddOperations<T>(SegmentedList<T> operations, ArrayBuilder<T> scratch, SyntaxNode node, Action<ArrayBuilder<T>, SyntaxNode> addOperations)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormattingResult.cs (5)
21private readonly CancellableLazy<SyntaxNode> _lazyNode; 38_lazyNode = new CancellableLazy<SyntaxNode>(CreateFormattedRoot); 44protected abstract SyntaxNode Rewriter(Dictionary<ValueTuple<SyntaxToken, SyntaxToken>, TriviaData> map, CancellationToken cancellationToken); 51public SyntaxNode GetFormattedRoot(CancellationToken cancellationToken) 88private SyntaxNode CreateFormattedRoot(CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\ChainedFormattingRules.cs (4)
47public void AddSuppressOperations(ArrayBuilder<SuppressOperation> list, SyntaxNode currentNode) 53public void AddAnchorIndentationOperations(List<AnchorIndentationOperation> list, SyntaxNode currentNode) 59public void AddIndentBlockOperations(List<IndentBlockOperation> list, SyntaxNode currentNode) 65public void AddAlignTokensOperations(List<AlignTokensOperation> list, SyntaxNode currentNode)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TokenData.cs (2)
83var commonRoot = this.Token.GetCommonRoot(other.Token); 100static SyntaxNodeOrToken GetAncestorUnderRoot(SyntaxNodeOrToken start, SyntaxNode root)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.cs (3)
18public static TreeData Create(SyntaxNode root) 39public TreeData(SyntaxNode root) 51public SyntaxNode Root { get; }
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.Debug.cs (1)
12private sealed class Debug(SyntaxNode root, SourceText text) : NodeAndText(root, text)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.Node.cs (1)
15public Node(SyntaxNode root)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.NodeAndText.cs (1)
17public NodeAndText(SyntaxNode root, SourceText text)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.StructuredTrivia.cs (3)
26var root = trivia.GetStructure()!; 50var root = _trivia.GetStructure()!; 56var parent = _trivia.Token.Parent;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (7)
22public static SyntaxNode GetParentWithBiggerSpan(this SyntaxNode node) 268internal static IEnumerable<TextSpan> GetAnnotatedSpans(SyntaxNode node, SyntaxAnnotation annotation) 278static IEnumerable<TextSpan> EnumerateAnnotatedSpans(SyntaxNode node, SyntaxAnnotation annotation) 282var (firstToken, lastToken) = nodeOrToken.AsNode(out var childNode) 342this IndentBlockOperation operation, IHeaderFacts headerFacts, SyntaxNode root, SyntaxToken indentationAnchor) 363if (headerFacts.IsOnIfStatementHeader(root, operation.BaseToken.SpanStart, out var conditionStatement)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\IFormattingResult.cs (1)
18SyntaxNode GetFormattedRoot(CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\ISyntaxFormatting.cs (1)
20IFormattingResult GetFormattingResult(SyntaxNode node, IEnumerable<TextSpan>? spans, SyntaxFormattingOptions options, ImmutableArray<AbstractFormattingRule> rules, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\AbstractFormattingRule.cs (4)
23public virtual void AddSuppressOperations(ArrayBuilder<SuppressOperation> list, SyntaxNode node, in NextSuppressOperationAction nextOperation) 29public virtual void AddAnchorIndentationOperations(List<AnchorIndentationOperation> list, SyntaxNode node, in NextAnchorIndentationOperationAction nextOperation) 35public virtual void AddIndentBlockOperations(List<IndentBlockOperation> list, SyntaxNode node, in NextIndentBlockOperationAction nextOperation) 41public virtual void AddAlignTokensOperations(List<AlignTokensOperation> list, SyntaxNode node, in NextAlignTokensOperationAction nextOperation)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\BaseIndentationFormattingRule.cs (7)
19private readonly SyntaxNode? _commonNode; 22public BaseIndentationFormattingRule(SyntaxNode root, TextSpan span, int baseIndentation, AbstractFormattingRule? vbHelperFormattingRule = null) 31public override void AddIndentBlockOperations(List<IndentBlockOperation> list, SyntaxNode node, in NextIndentBlockOperationAction nextOperation) 54private void AddNextIndentBlockOperations(List<IndentBlockOperation> list, SyntaxNode node, in NextIndentBlockOperationAction nextOperation) 133private static void SetInnermostNodeForSpan(SyntaxNode root, ref TextSpan span, out SyntaxToken token1, out SyntaxToken token2, out SyntaxNode? commonNode) 149private static void GetTokens(SyntaxNode root, TextSpan span, out SyntaxToken token1, out SyntaxToken token2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\CompatAbstractFormattingRule.cs (8)
17public sealed override void AddSuppressOperations(ArrayBuilder<SuppressOperation> list, SyntaxNode node, in NextSuppressOperationAction nextOperation) 25public sealed override void AddAnchorIndentationOperations(List<AnchorIndentationOperation> list, SyntaxNode node, in NextAnchorIndentationOperationAction nextOperation) 33public sealed override void AddIndentBlockOperations(List<IndentBlockOperation> list, SyntaxNode node, in NextIndentBlockOperationAction nextOperation) 41public sealed override void AddAlignTokensOperations(List<AlignTokensOperation> list, SyntaxNode node, in NextAlignTokensOperationAction nextOperation) 72public virtual void AddSuppressOperationsSlow(ArrayBuilder<SuppressOperation> list, SyntaxNode node, ref NextSuppressOperationAction nextOperation) 78public virtual void AddAnchorIndentationOperationsSlow(List<AnchorIndentationOperation> list, SyntaxNode node, ref NextAnchorIndentationOperationAction nextOperation) 84public virtual void AddIndentBlockOperationsSlow(List<IndentBlockOperation> list, SyntaxNode node, ref NextIndentBlockOperationAction nextOperation) 90public virtual void AddAlignTokensOperationsSlow(List<AlignTokensOperation> list, SyntaxNode node, ref NextAlignTokensOperationAction nextOperation)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\NextAlignTokensOperationAction.cs (1)
15SyntaxNode node,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\NextAnchorIndentationOperationAction.cs (1)
15SyntaxNode node,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\NextIndentBlockOperationAction.cs (1)
15SyntaxNode node,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\NextSuppressOperationAction.cs (1)
16SyntaxNode node,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\FormattingOperations.cs (3)
147internal static IEnumerable<AnchorIndentationOperation> GetAnchorIndentationOperations(IEnumerable<AbstractFormattingRule> formattingRules, SyntaxNode node, SyntaxFormattingOptions options) 159internal static IEnumerable<IndentBlockOperation> GetIndentBlockOperations(IEnumerable<AbstractFormattingRule> formattingRules, SyntaxNode node, SyntaxFormattingOptions options) 171internal static IEnumerable<AlignTokensOperation> GetAlignTokensOperations(IEnumerable<AbstractFormattingRule> formattingRules, SyntaxNode node, SyntaxFormattingOptions options)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Helpers\RemoveUnnecessaryImports\AbstractUnnecessaryImportsProvider.cs (4)
18where TSyntaxNode : SyntaxNode 21SemanticModel model, Func<SyntaxNode, bool>? predicate, CancellationToken cancellationToken); 27SemanticModel model, TextSpan? span, Func<SyntaxNode, bool>? predicate, CancellationToken cancellationToken) 32var node = model.SyntaxTree.FindNode(span, findInTrivia: false, getInnermostNodeForTie: false, cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Helpers\RemoveUnnecessaryImports\IUnnecessaryImportsProvider.cs (2)
13where TSyntaxNode : SyntaxNode 20Func<SyntaxNode, bool>? predicate,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Indentation\AbstractIndentation.cs (1)
13where TSyntaxRoot : SyntaxNode, ICompilationUnitSyntax
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\BlockFacts\AbstractBlockFacts.cs (9)
12public abstract bool IsScopeBlock([NotNullWhen(true)] SyntaxNode? node); 13public abstract bool IsExecutableBlock([NotNullWhen(true)] SyntaxNode? node); 14public abstract IReadOnlyList<SyntaxNode> GetExecutableBlockStatements(SyntaxNode? node); 15public abstract SyntaxNode? FindInnermostCommonExecutableBlock(IEnumerable<SyntaxNode> nodes); 16public abstract bool IsStatementContainer([NotNullWhen(true)] SyntaxNode? node); 17public abstract IReadOnlyList<SyntaxNode> GetStatementContainerStatements(SyntaxNode? node);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\BlockFacts\IBlockFacts.cs (9)
22bool IsScopeBlock([NotNullWhen(true)] SyntaxNode? node); 28bool IsExecutableBlock([NotNullWhen(true)] SyntaxNode? node); 30IReadOnlyList<SyntaxNode> GetExecutableBlockStatements(SyntaxNode? node); 31SyntaxNode? FindInnermostCommonExecutableBlock(IEnumerable<SyntaxNode> nodes); 37bool IsStatementContainer([NotNullWhen(true)] SyntaxNode? node); 39IReadOnlyList<SyntaxNode> GetStatementContainerStatements(SyntaxNode? node);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\BlockFacts\IBlockFactsExtensions.cs (3)
13public static SyntaxNode? GetStatementContainer(this IBlockFacts blockFacts, SyntaxNode node) 15for (var current = node; current is not null; current = current.Parent)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\FileBannerFacts\AbstractFileBannerFacts.cs (10)
61public string GetBannerText(SyntaxNode? documentationCommentTriviaSyntax, int bannerLength, CancellationToken cancellationToken) 64public ImmutableArray<SyntaxTrivia> GetLeadingBlankLines(SyntaxNode node) 65=> GetLeadingBlankLines<SyntaxNode>(node); 68where TSyntaxNode : SyntaxNode 75where TSyntaxNode : SyntaxNode 82where TSyntaxNode : SyntaxNode 95where TSyntaxNode : SyntaxNode 103where TSyntaxNode : SyntaxNode 110where TSyntaxNode : SyntaxNode 164public ImmutableArray<SyntaxTrivia> GetFileBanner(SyntaxNode root)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\FileBannerFacts\IFileBannerFacts.cs (8)
12ImmutableArray<SyntaxTrivia> GetFileBanner(SyntaxNode root); 14string GetBannerText(SyntaxNode? documentationCommentTriviaSyntax, int maxBannerLength, CancellationToken cancellationToken); 16ImmutableArray<SyntaxTrivia> GetLeadingBlankLines(SyntaxNode node); 18TSyntaxNode GetNodeWithoutLeadingBlankLines<TSyntaxNode>(TSyntaxNode node) where TSyntaxNode : SyntaxNode; 20TSyntaxNode node, out ImmutableArray<SyntaxTrivia> strippedTrivia) where TSyntaxNode : SyntaxNode; 22ImmutableArray<SyntaxTrivia> GetLeadingBannerAndPreprocessorDirectives<TSyntaxNode>(TSyntaxNode node) where TSyntaxNode : SyntaxNode; 24TSyntaxNode GetNodeWithoutLeadingBannerAndPreprocessorDirectives<TSyntaxNode>(TSyntaxNode node) where TSyntaxNode : SyntaxNode; 25TSyntaxNode GetNodeWithoutLeadingBannerAndPreprocessorDirectives<TSyntaxNode>(TSyntaxNode node, out ImmutableArray<SyntaxTrivia> strippedTrivia) where TSyntaxNode : SyntaxNode;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\FileBannerFacts\IFileBannerFactsExtensions.cs (1)
13this IFileBannerFacts bannerService, SyntaxNode node)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\HeaderFacts\AbstractHeaderFacts.cs (28)
23public abstract bool IsOnTypeHeader(SyntaxNode root, int position, bool fullHeader, [NotNullWhen(true)] out SyntaxNode? typeDeclaration); 24public abstract bool IsOnPropertyDeclarationHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? propertyDeclaration); 25public abstract bool IsOnParameterHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? parameter); 26public abstract bool IsOnMethodHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? method); 27public abstract bool IsOnLocalFunctionHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? localFunction); 28public abstract bool IsOnLocalDeclarationHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? localDeclaration); 29public abstract bool IsOnIfStatementHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? ifStatement); 30public abstract bool IsOnWhileStatementHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? whileStatement); 31public abstract bool IsOnForeachHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? foreachStatement); 33public bool IsOnHeader(SyntaxNode root, int position, SyntaxNode ownerOfHeader, SyntaxNodeOrToken lastTokenOrNodeOfHeader) 34=> IsOnHeader(root, position, ownerOfHeader, lastTokenOrNodeOfHeader, ImmutableArray<SyntaxNode>.Empty); 37SyntaxNode root, 39SyntaxNode ownerOfHeader, 42where THoleSyntax : SyntaxNode 71protected TNode? TryGetAncestorForLocation<TNode>(SyntaxNode root, int position) where TNode : SyntaxNode 89protected int GetStartOfNodeExcludingAttributes(SyntaxNode root, SyntaxNode node)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\HeaderFacts\IHeaderFacts.cs (18)
16bool IsOnTypeHeader(SyntaxNode root, int position, bool fullHeader, [NotNullWhen(true)] out SyntaxNode? typeDeclaration); 18bool IsOnPropertyDeclarationHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? propertyDeclaration); 19bool IsOnParameterHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? parameter); 20bool IsOnMethodHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? method); 21bool IsOnLocalFunctionHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? localFunction); 22bool IsOnLocalDeclarationHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? localDeclaration); 23bool IsOnIfStatementHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? ifStatement); 24bool IsOnWhileStatementHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? whileStatement); 25bool IsOnForeachHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? foreachStatement);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\HeaderFacts\IHeaderFactsExtensions.cs (2)
14public static bool IsOnTypeHeader(this IHeaderFacts headerFacts, SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? typeDeclaration)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\Precedence\IPrecedenceService.cs (4)
23int GetOperatorPrecedence(SyntaxNode expression); 29where TExpressionSyntax : SyntaxNode 32int IPrecedenceService.GetOperatorPrecedence(SyntaxNode expression) 44public static PrecedenceKind GetPrecedenceKind(this IPrecedenceService service, SyntaxNode expression)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SelectedMembers\AbstractSelectedMembers.cs (12)
25where TMemberDeclarationSyntax : SyntaxNode 29where TVariableSyntax : SyntaxNode 32protected abstract ImmutableArray<(SyntaxNode declarator, SyntaxToken identifier)> GetDeclaratorsAndIdentifiers(TMemberDeclarationSyntax member); 34public Task<ImmutableArray<SyntaxNode>> GetSelectedFieldsAndPropertiesAsync( 38public Task<ImmutableArray<SyntaxNode>> GetSelectedMembersAsync( 42private async Task<ImmutableArray<SyntaxNode>> GetSelectedMembersAsync( 47var root = await tree.GetRootAsync(cancellationToken).ConfigureAwait(false); 77private ImmutableArray<SyntaxNode> GetMembersInSpan( 78SyntaxNode root, SourceText text, TextSpan textSpan, 88using var _ = ArrayBuilder<SyntaxNode>.GetInstance(out var selectedMembers); 165SourceText text, SyntaxNode root, SyntaxNode member, int position)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFacts.cs (23)
53bool IsWrittenTo(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 60bool IsOnlyWrittenTo(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 61bool IsInOutContext(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 62bool IsInRefContext(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 63bool IsInInContext(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 65bool CanReplaceWithRValue(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? expression, CancellationToken cancellationToken); 74bool TryGetSpeculativeSemanticModel(SemanticModel oldSemanticModel, SyntaxNode oldNode, SyntaxNode newNode, [NotNullWhen(true)] out SemanticModel? speculativeModel); 81ForEachSymbols GetForEachSymbols(SemanticModel semanticModel, SyntaxNode forEachStatement); 82SymbolInfo GetCollectionInitializerSymbolInfo(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken); 84IMethodSymbol? GetGetAwaiterMethod(SemanticModel semanticModel, SyntaxNode node); 86ImmutableArray<IMethodSymbol> GetDeconstructionAssignmentMethods(SemanticModel semanticModel, SyntaxNode node); 88ImmutableArray<IMethodSymbol> GetDeconstructionForEachMethods(SemanticModel semanticModel, SyntaxNode node); 92IEnumerable<ISymbol> GetDeclaredSymbols(SemanticModel semanticModel, SyntaxNode memberDeclaration, CancellationToken cancellationToken); 94IParameterSymbol? FindParameterForArgument(SemanticModel semanticModel, SyntaxNode argument, bool allowUncertainCandidates, bool allowParams, CancellationToken cancellationToken); 95IParameterSymbol? FindParameterForAttributeArgument(SemanticModel semanticModel, SyntaxNode argument, bool allowUncertainCandidates, bool allowParams, CancellationToken cancellationToken); 97ISymbol? FindFieldOrPropertyForArgument(SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken); 98ISymbol? FindFieldOrPropertyForAttributeArgument(SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken); 100ImmutableArray<ISymbol> GetBestOrAllSymbols(SemanticModel semanticModel, SyntaxNode? node, SyntaxToken token, CancellationToken cancellationToken); 102bool IsInsideNameOfExpression(SemanticModel semanticModel, [NotNullWhen(true)] SyntaxNode? node, CancellationToken cancellationToken); 109bool IsInExpressionTree(SemanticModel semanticModel, SyntaxNode node, [NotNullWhen(true)] INamedTypeSymbol? expressionType, CancellationToken cancellationToken); 111string GenerateNameForExpression(SemanticModel semanticModel, SyntaxNode expression, bool capitalize, CancellationToken cancellationToken); 122IPreprocessingSymbol? GetPreprocessingSymbol(SemanticModel semanticModel, SyntaxNode node);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFactsExtensions.cs (5)
18where TBinaryExpressionSyntax : SyntaxNode 46semanticFacts.SyntaxFacts.GetPartsOfBinaryExpression(parentBinary, out var parentBinaryLeft, out var parentBinaryRight); 121public static IParameterSymbol? FindParameterForArgument(this ISemanticFacts semanticFacts, SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken) 124public static IParameterSymbol? FindParameterForAttributeArgument(this ISemanticFacts semanticFacts, SemanticModel semanticModel, SyntaxNode argument, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\AbstractDocumentationCommentService.cs (8)
26where TDocumentationCommentTriviaSyntax : SyntaxNode 27where TXmlNodeSyntax : SyntaxNode 28where TXmlAttributeSyntax : SyntaxNode 29where TCrefSyntax : SyntaxNode 100foreach (var node in summaryElement.ChildNodes()) 106private void HandleNode(SyntaxNode node, StringBuilder sb) 160protected abstract SyntaxNode GetName(TXmlElementSyntax xmlElement); 190public string GetBannerText(SyntaxNode documentationCommentTriviaSyntax, int maxBannerLength, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\IAccessibilityFacts.cs (2)
14bool CanHaveAccessibility(SyntaxNode declaration, bool ignoreDeclarationModifiers = false); 15Accessibility GetAccessibility(SyntaxNode declaration);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\IDocumentationCommentService.cs (1)
13string GetBannerText(SyntaxNode documentationCommentTriviaSyntax, int bannerLength, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFacts.cs (294)
116bool IsPredefinedType([NotNullWhen(true)] SyntaxNode? node); 117bool IsPredefinedType([NotNullWhen(true)] SyntaxNode? node, PredefinedType type); 166bool IsUsingOrExternOrImport([NotNullWhen(true)] SyntaxNode? node); 167bool IsGlobalAssemblyAttribute([NotNullWhen(true)] SyntaxNode? node); 168bool IsGlobalModuleAttribute([NotNullWhen(true)] SyntaxNode? node); 169bool IsDeclaration([NotNullWhen(true)] SyntaxNode? node); 170bool IsTypeDeclaration(SyntaxNode node); 172bool IsUsingAliasDirective([NotNullWhen(true)] SyntaxNode? node); 177bool IsPragmaDirective(SyntaxTrivia trivia, out bool isDisable, out bool isActive, out SeparatedSyntaxList<SyntaxNode> errorCodes); 181bool IsDocumentationComment(SyntaxNode node); 188bool TryGetExternalSourceInfo([NotNullWhen(true)] SyntaxNode? directive, out ExternalSourceInfo info); 190bool IsDeclarationExpression([NotNullWhen(true)] SyntaxNode? node); 192bool IsConversionExpression([NotNullWhen(true)] SyntaxNode? node); 193bool IsCastExpression([NotNullWhen(true)] SyntaxNode? node); 195bool IsExpressionOfForeach([NotNullWhen(true)] SyntaxNode? node); 196SyntaxNode GetExpressionOfForeachStatement(SyntaxNode statement); 198void GetPartsOfTupleExpression<TArgumentSyntax>(SyntaxNode node, 199out SyntaxToken openParen, out SeparatedSyntaxList<TArgumentSyntax> arguments, out SyntaxToken closeParen) where TArgumentSyntax : SyntaxNode; 201bool IsVerbatimInterpolatedStringExpression([NotNullWhen(true)] SyntaxNode? node); 204bool IsLeftSideOfAssignment([NotNullWhen(true)] SyntaxNode? node); 206bool IsAnyAssignmentStatement([NotNullWhen(true)] SyntaxNode? statement); 207bool IsSimpleAssignmentStatement([NotNullWhen(true)] SyntaxNode? statement); 208void GetPartsOfAssignmentStatement(SyntaxNode statement, out SyntaxNode left, out SyntaxToken operatorToken, out SyntaxNode right); 209void GetPartsOfAssignmentExpressionOrStatement(SyntaxNode statement, out SyntaxNode left, out SyntaxToken operatorToken, out SyntaxNode right); 212bool IsLeftSideOfAnyAssignment([NotNullWhen(true)] SyntaxNode? node); 214bool IsLeftSideOfCompoundAssignment([NotNullWhen(true)] SyntaxNode? node); 215SyntaxNode GetRightHandSideOfAssignment(SyntaxNode node); 217bool IsInferredAnonymousObjectMemberDeclarator([NotNullWhen(true)] SyntaxNode? node); 218bool IsOperandOfIncrementExpression([NotNullWhen(true)] SyntaxNode? node); 219bool IsOperandOfIncrementOrDecrementExpression([NotNullWhen(true)] SyntaxNode? node); 221bool IsLeftSideOfDot([NotNullWhen(true)] SyntaxNode? node); 222SyntaxNode? GetRightSideOfDot(SyntaxNode? node); 236SyntaxNode? GetLeftSideOfDot(SyntaxNode? node, bool allowImplicitTarget = false); 238bool IsLeftSideOfExplicitInterfaceSpecifier([NotNullWhen(true)] SyntaxNode? node); 240bool IsNameOfSimpleMemberAccessExpression([NotNullWhen(true)] SyntaxNode? node); 241bool IsNameOfAnyMemberAccessExpression([NotNullWhen(true)] SyntaxNode? node); 242bool IsNameOfMemberBindingExpression([NotNullWhen(true)] SyntaxNode? node); 251SyntaxNode? GetStandaloneExpression(SyntaxNode? node); 260SyntaxNode? GetRootConditionalAccessExpression(SyntaxNode? node); 269SyntaxNode? GetExpressionOfMemberAccessExpression(SyntaxNode node, bool allowImplicitTarget = false); 271SyntaxNode? GetTargetOfMemberBinding(SyntaxNode? node); 273SyntaxNode GetNameOfMemberBindingExpression(SyntaxNode node); 275bool IsPointerMemberAccessExpression([NotNullWhen(true)] SyntaxNode? node); 277bool IsNamedArgument([NotNullWhen(true)] SyntaxNode? node); 278bool IsNameOfNamedArgument([NotNullWhen(true)] SyntaxNode? node); 279SyntaxNode? GetParameterList(SyntaxNode node); 280bool IsParameterList([NotNullWhen(true)] SyntaxNode? node); 284void GetPartsOfElementAccessExpression(SyntaxNode node, out SyntaxNode expression, out SyntaxNode argumentList); 286SyntaxNode GetExpressionOfArgument(SyntaxNode node); 287SyntaxNode GetExpressionOfAttributeArgument(SyntaxNode node); 288SyntaxNode GetExpressionOfInterpolation(SyntaxNode node); 290bool IsElementBindingExpression([NotNullWhen(true)] SyntaxNode? node); 291bool IsMemberBindingExpression([NotNullWhen(true)] SyntaxNode? node); 292bool IsPostfixUnaryExpression([NotNullWhen(true)] SyntaxNode? node); 294SyntaxToken GetIdentifierOfSimpleName(SyntaxNode node); 295SyntaxToken GetIdentifierOfTypeDeclaration(SyntaxNode node); 296SyntaxToken GetIdentifierOfVariableDeclarator(SyntaxNode node); 297SyntaxNode GetTypeOfVariableDeclarator(SyntaxNode node); 303bool IsSimpleArgument([NotNullWhen(true)] SyntaxNode? node); 304bool IsArgument([NotNullWhen(true)] SyntaxNode? node); 305bool IsAttributeArgument([NotNullWhen(true)] SyntaxNode? node); 306RefKind GetRefKindOfArgument(SyntaxNode node); 308void GetNameAndArityOfSimpleName(SyntaxNode node, out string name, out int arity); 309bool LooksGeneric(SyntaxNode simpleName); 311SeparatedSyntaxList<SyntaxNode> GetTypeArgumentsOfGenericName(SyntaxNode? genericName); 313SyntaxList<SyntaxNode> GetContentsOfInterpolatedString(SyntaxNode interpolatedString); 315SeparatedSyntaxList<SyntaxNode> GetArgumentsOfObjectCreationExpression(SyntaxNode node); 316SeparatedSyntaxList<SyntaxNode> GetArgumentsOfArgumentList(SyntaxNode node); 317SeparatedSyntaxList<SyntaxNode> GetArgumentsOfAttributeArgumentList(SyntaxNode node); 319bool IsUsingDirectiveName([NotNullWhen(true)] SyntaxNode? node); 322SyntaxList<SyntaxNode> GetAttributeLists(SyntaxNode? node); 323SeparatedSyntaxList<SyntaxNode> GetAttributesOfAttributeList(SyntaxNode node); 325bool IsAttributeNamedArgumentIdentifier([NotNullWhen(true)] SyntaxNode? node); 326bool IsMemberInitializerNamedAssignmentIdentifier([NotNullWhen(true)] SyntaxNode? node, [NotNullWhen(true)] out SyntaxNode? initializedInstance); 327bool IsAnyInitializerExpression([NotNullWhen(true)] SyntaxNode? node, [NotNullWhen(true)] out SyntaxNode? creationExpression); 329bool IsDirective([NotNullWhen(true)] SyntaxNode? node); 330bool IsStatement([NotNullWhen(true)] SyntaxNode? node); 331bool IsExecutableStatement([NotNullWhen(true)] SyntaxNode? node); 332bool IsGlobalStatement([NotNullWhen(true)] SyntaxNode? node); 333SyntaxNode GetStatementOfGlobalStatement(SyntaxNode node); 334bool AreStatementsInSameContainer(SyntaxNode firstStatement, SyntaxNode secondStatement); 336bool IsDeconstructionAssignment([NotNullWhen(true)] SyntaxNode? node); 337bool IsDeconstructionForEachStatement([NotNullWhen(true)] SyntaxNode? node); 351bool IsMethodBody([NotNullWhen(true)] SyntaxNode? node); 353bool IsDeclaratorOfLocalDeclarationStatement(SyntaxNode declarator, SyntaxNode localDeclarationStatement); 354SeparatedSyntaxList<SyntaxNode> GetVariablesOfLocalDeclarationStatement(SyntaxNode node); 355SyntaxNode? GetInitializerOfVariableDeclarator(SyntaxNode node); 356SyntaxNode? GetInitializerOfPropertyDeclaration(SyntaxNode node); 361bool IsElementAccessExpression([NotNullWhen(true)] SyntaxNode? node); 379bool IsInStaticContext(SyntaxNode node); 380bool IsUnsafeContext(SyntaxNode node); 382bool IsInNamespaceOrTypeContext([NotNullWhen(true)] SyntaxNode? node); 384bool IsBaseTypeList([NotNullWhen(true)] SyntaxNode? node); 386bool IsInConstantContext([NotNullWhen(true)] SyntaxNode? node); 387bool IsInConstructor(SyntaxNode node); 388bool IsMethodLevelMember([NotNullWhen(true)] SyntaxNode? node); 389bool IsTopLevelNodeWithMembers([NotNullWhen(true)] SyntaxNode? node); 392bool AreEquivalent(SyntaxNode? node1, SyntaxNode? node2); 394string GetDisplayName(SyntaxNode? node, DisplayNameOptions options, string? rootNamespace = null); 397SyntaxNode? GetContainingTypeDeclaration(SyntaxNode root, int position); 398SyntaxNode? GetContainingMemberDeclaration(SyntaxNode root, int position, bool useFullSpan = true); 399SyntaxNode? GetContainingMethodDeclaration(SyntaxNode root, int position, bool useFullSpan = true); 400SyntaxNode? GetContainingVariableDeclaratorOfFieldDeclaration(SyntaxNode? node); 404SyntaxNode? ConvertToSingleLine(SyntaxNode? node, bool useElasticTrivia = false); 407PooledObject<List<SyntaxNode>> GetTopLevelAndMethodLevelMembers(SyntaxNode? root); 409PooledObject<List<SyntaxNode>> GetMethodLevelMembers(SyntaxNode? root); 410SyntaxList<SyntaxNode> GetMembersOfTypeDeclaration(SyntaxNode typeDeclaration); 413bool ContainsInMemberBody([NotNullWhen(true)] SyntaxNode? node, TextSpan span); 418/// Given a <see cref="SyntaxNode"/>, return the <see cref="TextSpan"/> representing the span of the member body 424TextSpan GetMemberBodySpanForSpeculativeBinding(SyntaxNode node); 432SyntaxNode? TryGetBindableParent(SyntaxToken token); 435IEnumerable<SyntaxNode> GetConstructors(SyntaxNode? root, CancellationToken cancellationToken); 438/// Given a <see cref="SyntaxNode"/>, that represents and argument return the string representation of 442string GetNameForArgument(SyntaxNode? argument); 445/// Given a <see cref="SyntaxNode"/>, that represents an attribute argument return the string representation of 449string GetNameForAttributeArgument(SyntaxNode? argument); 451bool IsNameOfSubpattern([NotNullWhen(true)] SyntaxNode? node); 452bool IsPropertyPatternClause(SyntaxNode node); 454bool IsAnyPattern([NotNullWhen(true)] SyntaxNode? node); 455bool IsBinaryPattern([NotNullWhen(true)] SyntaxNode? node); 456bool IsUnaryPattern([NotNullWhen(true)] SyntaxNode? node); 458SyntaxNode GetExpressionOfConstantPattern(SyntaxNode node); 459SyntaxNode GetTypeOfTypePattern(SyntaxNode node); 461void GetPartsOfParenthesizedPattern(SyntaxNode node, out SyntaxToken openParen, out SyntaxNode pattern, out SyntaxToken closeParen); 462void GetPartsOfBinaryPattern(SyntaxNode node, out SyntaxNode left, out SyntaxToken operatorToken, out SyntaxNode right); 463void GetPartsOfDeclarationPattern(SyntaxNode node, out SyntaxNode type, out SyntaxNode designation); 464void GetPartsOfRecursivePattern(SyntaxNode node, out SyntaxNode? type, out SyntaxNode? positionalPart, out SyntaxNode? propertyPart, out SyntaxNode? designation); 465void GetPartsOfRelationalPattern(SyntaxNode node, out SyntaxToken operatorToken, out SyntaxNode expression); 466void GetPartsOfUnaryPattern(SyntaxNode node, out SyntaxToken operatorToken, out SyntaxNode pattern); 470SyntaxTokenList GetModifiers(SyntaxNode? node); 474SyntaxNode? WithModifiers(SyntaxNode? node, SyntaxTokenList modifiers); 477Location GetDeconstructionReferenceLocation(SyntaxNode node); 482bool IsParameterNameXmlElementSyntax([NotNullWhen(true)] SyntaxNode? node); 484SyntaxList<SyntaxNode> GetContentFromDocumentationCommentTriviaSyntax(SyntaxTrivia trivia); 490bool IsAnonymousFunctionExpression([NotNullWhen(true)] SyntaxNode? node); 491bool IsBaseNamespaceDeclaration([NotNullWhen(true)] SyntaxNode? node); 492bool IsBinaryExpression([NotNullWhen(true)] SyntaxNode? node); 493bool IsLiteralExpression([NotNullWhen(true)] SyntaxNode? node); 494bool IsMemberAccessExpression([NotNullWhen(true)] SyntaxNode? node); 495bool IsMethodDeclaration([NotNullWhen(true)] SyntaxNode? node); 496bool IsSimpleName([NotNullWhen(true)] SyntaxNode? node); 497bool IsAnyName([NotNullWhen(true)] SyntaxNode? node); 498bool IsAnyType([NotNullWhen(true)] SyntaxNode? node); 500bool IsNamedMemberInitializer([NotNullWhen(true)] SyntaxNode? node); 501bool IsElementAccessInitializer([NotNullWhen(true)] SyntaxNode? node); 503bool IsObjectMemberInitializer([NotNullWhen(true)] SyntaxNode? node); 504bool IsObjectCollectionInitializer([NotNullWhen(true)] SyntaxNode? node); 510void GetPartsOfAnyIsTypeExpression(SyntaxNode node, out SyntaxNode expression, out SyntaxNode type); 511void GetPartsOfArgumentList(SyntaxNode node, out SyntaxToken openParenToken, out SeparatedSyntaxList<SyntaxNode> arguments, out SyntaxToken closeParenToken); 512void GetPartsOfAttribute(SyntaxNode node, out SyntaxNode name, out SyntaxNode? argumentList); 513void GetPartsOfBaseNamespaceDeclaration(SyntaxNode node, out SyntaxNode name, out SyntaxList<SyntaxNode> imports, out SyntaxList<SyntaxNode> members); 514void GetPartsOfBaseObjectCreationExpression(SyntaxNode node, out SyntaxNode? argumentList, out SyntaxNode? initializer); 515void GetPartsOfBinaryExpression(SyntaxNode node, out SyntaxNode left, out SyntaxToken operatorToken, out SyntaxNode right); 516void GetPartsOfCastExpression(SyntaxNode node, out SyntaxNode type, out SyntaxNode expression); 517void GetPartsOfCompilationUnit(SyntaxNode node, out SyntaxList<SyntaxNode> imports, out SyntaxList<SyntaxNode> attributeLists, out SyntaxList<SyntaxNode> members); 518void GetPartsOfConditionalAccessExpression(SyntaxNode node, out SyntaxNode expression, out SyntaxToken operatorToken, out SyntaxNode whenNotNull); 519void GetPartsOfConditionalExpression(SyntaxNode node, out SyntaxNode condition, out SyntaxNode whenTrue, out SyntaxNode whenFalse); 520void GetPartsOfGenericName(SyntaxNode node, out SyntaxToken identifier, out SeparatedSyntaxList<SyntaxNode> typeArguments); 521void GetPartsOfInterpolationExpression(SyntaxNode node, out SyntaxToken stringStartToken, out SyntaxList<SyntaxNode> contents, out SyntaxToken stringEndToken); 522void GetPartsOfInvocationExpression(SyntaxNode node, out SyntaxNode expression, out SyntaxNode? argumentList); 523void GetPartsOfIsPatternExpression(SyntaxNode node, out SyntaxNode left, out SyntaxToken isToken, out SyntaxNode right); 524void GetPartsOfMemberAccessExpression(SyntaxNode node, out SyntaxNode expression, out SyntaxToken operatorToken, out SyntaxNode name); 525void GetPartsOfNamedMemberInitializer(SyntaxNode node, out SyntaxNode name, out SyntaxNode expression); 526void GetPartsOfObjectCreationExpression(SyntaxNode node, out SyntaxToken keyword, out SyntaxNode type, out SyntaxNode? argumentList, out SyntaxNode? initializer); 527void GetPartsOfImplicitObjectCreationExpression(SyntaxNode node, out SyntaxToken keyword, out SyntaxNode argumentList, out SyntaxNode? initializer); 528void GetPartsOfParameter(SyntaxNode node, out SyntaxToken identifier, out SyntaxNode? @default); 529void GetPartsOfParenthesizedExpression(SyntaxNode node, out SyntaxToken openParen, out SyntaxNode expression, out SyntaxToken closeParen); 530void GetPartsOfPrefixUnaryExpression(SyntaxNode node, out SyntaxToken operatorToken, out SyntaxNode operand); 531void GetPartsOfQualifiedName(SyntaxNode node, out SyntaxNode left, out SyntaxToken dotToken, out SyntaxNode right); 532void GetPartsOfUsingAliasDirective(SyntaxNode node, out SyntaxToken globalKeyword, out SyntaxToken alias, out SyntaxNode name); 542SyntaxNode GetArgumentListOfImplicitElementAccess(SyntaxNode node); 544SyntaxNode GetExpressionOfAwaitExpression(SyntaxNode node); 545SyntaxNode GetExpressionOfExpressionStatement(SyntaxNode node); 546SyntaxNode GetExpressionOfRefExpression(SyntaxNode node); 547SyntaxNode? GetExpressionOfReturnStatement(SyntaxNode node); 548SyntaxNode GetExpressionOfThrowExpression(SyntaxNode node); 549SyntaxNode? GetExpressionOfThrowStatement(SyntaxNode node); 551bool IsEqualsValueOfPropertyDeclaration([NotNullWhen(true)] SyntaxNode? node); 552SyntaxNode GetValueOfEqualsValueClause(SyntaxNode node); 554SeparatedSyntaxList<SyntaxNode> GetInitializersOfObjectMemberInitializer(SyntaxNode node); 555SeparatedSyntaxList<SyntaxNode> GetExpressionsOfObjectCollectionInitializer(SyntaxNode node); 557SyntaxToken GetTokenOfLiteralExpression(SyntaxNode node);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFactsExtensions.cs (199)
23public static bool IsMemberInitializerNamedAssignmentIdentifier(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 26public static bool IsOnSingleLine(this ISyntaxFacts syntaxFacts, SyntaxNode node, bool fullSpan) 62var currentNode = currentNodeOrToken.AsNode()!; 160this ISyntaxFacts syntaxFacts, ImmutableArray<SyntaxNode> nodes, CancellationToken cancellationToken) 166foreach (var node in nodes) 178public static bool ContainsInterleavedDirective(this ISyntaxFacts syntaxFacts, SyntaxNode node, CancellationToken cancellationToken) 182this ISyntaxFacts syntaxFacts, TextSpan span, SyntaxNode node, CancellationToken cancellationToken) 193public static bool SpansPreprocessorDirective(this ISyntaxFacts syntaxFacts, IEnumerable<SyntaxNode> nodes) 286public static SyntaxNode? WalkDownParentheses(this ISyntaxFacts syntaxFacts, SyntaxNode? node) 290syntaxFacts.GetPartsOfParenthesizedExpression(node, out _, out var child, out _); 298public static SyntaxNode? WalkUpParentheses(this ISyntaxFacts syntaxFacts, SyntaxNode? node) 307this ISyntaxFacts syntaxFacts, SyntaxNode statement, 308out SyntaxNode left, out SyntaxNode right) 313public static SyntaxNode GetExpressionOfInvocationExpression( 314this ISyntaxFacts syntaxFacts, SyntaxNode node) 316syntaxFacts.GetPartsOfInvocationExpression(node, out var expression, out _); 320public static SyntaxNode Unparenthesize( 321this ISyntaxFacts syntaxFacts, SyntaxNode node) 324SyntaxNode operand; 348var resultNode = operand 383public static bool SpansPreprocessorDirective(this ISyntaxFacts service, SyntaxNode node) 386public static bool SpansPreprocessorDirective(this ISyntaxFacts service, params SyntaxNode[] nodes) 387=> service.SpansPreprocessorDirective((IEnumerable<SyntaxNode>)nodes); 392public static void GetPartsOfBinaryExpression(this ISyntaxFacts syntaxFacts, SyntaxNode node, out SyntaxNode left, out SyntaxNode right) 395public static SyntaxNode GetPatternOfParenthesizedPattern(this ISyntaxFacts syntaxFacts, SyntaxNode node) 397syntaxFacts.GetPartsOfParenthesizedPattern(node, out _, out var pattern, out _); 401public static SyntaxToken GetOperatorTokenOfBinaryExpression(this ISyntaxFacts syntaxFacts, SyntaxNode node) 407public static bool IsAnonymousOrLocalFunction(this ISyntaxFacts syntaxFacts, SyntaxNode node) 411public static SyntaxNode? GetExpressionOfElementAccessExpression(this ISyntaxFacts syntaxFacts, SyntaxNode node) 413syntaxFacts.GetPartsOfElementAccessExpression(node, out var expression, out _); 417public static SyntaxNode? GetArgumentListOfElementAccessExpression(this ISyntaxFacts syntaxFacts, SyntaxNode node) 419syntaxFacts.GetPartsOfElementAccessExpression(node, out _, out var argumentList); 423public static SyntaxNode GetExpressionOfConditionalAccessExpression(this ISyntaxFacts syntaxFacts, SyntaxNode node) 425syntaxFacts.GetPartsOfConditionalAccessExpression(node, out var expression, out _); 429public static SyntaxToken GetOperatorTokenOfMemberAccessExpression(this ISyntaxFacts syntaxFacts, SyntaxNode node) 435public static void GetPartsOfMemberAccessExpression(this ISyntaxFacts syntaxFacts, SyntaxNode node, out SyntaxNode expression, out SyntaxNode name) 438public static void GetPartsOfConditionalAccessExpression(this ISyntaxFacts syntaxFacts, SyntaxNode node, out SyntaxNode expression, out SyntaxNode whenNotNull) 441public static TextSpan GetSpanWithoutAttributes(this ISyntaxFacts syntaxFacts, SyntaxNode root, SyntaxNode node) 468/// Similar to <see cref="ISyntaxFacts.GetStandaloneExpression(SyntaxNode)"/>, this gets the containing 478public static SyntaxNode GetRootStandaloneExpression(this ISyntaxFacts syntaxFacts, SyntaxNode node) 481var standalone = syntaxFacts.GetStandaloneExpression(node); 489public static SyntaxNode? GetArgumentListOfInvocationExpression(this ISyntaxFacts syntaxFacts, SyntaxNode node) 491syntaxFacts.GetPartsOfInvocationExpression(node, out _, out var argumentList); 495public static SeparatedSyntaxList<SyntaxNode> GetArgumentsOfInvocationExpression(this ISyntaxFacts syntaxFacts, SyntaxNode node) 497var argumentList = syntaxFacts.GetArgumentListOfInvocationExpression(node); 501public static SyntaxNode? GetArgumentListOfBaseObjectCreationExpression(this ISyntaxFacts syntaxFacts, SyntaxNode node) 503syntaxFacts.GetPartsOfBaseObjectCreationExpression(node, out var argumentList, out _); 507public static SyntaxNode? GetDefaultOfParameter(this ISyntaxFacts syntaxFacts, SyntaxNode node) 509syntaxFacts.GetPartsOfParameter(node, out _, out var @default); 513public static SyntaxNode GetExpressionOfParenthesizedExpression(this ISyntaxFacts syntaxFacts, SyntaxNode node) 515syntaxFacts.GetPartsOfParenthesizedExpression(node, out _, out var expression, out _); 519public static SyntaxToken GetIdentifierOfGenericName(this ISyntaxFacts syntaxFacts, SyntaxNode node) 525public static SyntaxToken GetIdentifierOfIdentifierName(this ISyntaxFacts syntaxFacts, SyntaxNode node) 528public static SyntaxToken GetIdentifierOfParameter(this ISyntaxFacts syntaxFacts, SyntaxNode node) 534public static SyntaxList<SyntaxNode> GetImportsOfBaseNamespaceDeclaration(this ISyntaxFacts syntaxFacts, SyntaxNode node) 540public static SyntaxList<SyntaxNode> GetImportsOfCompilationUnit(this ISyntaxFacts syntaxFacts, SyntaxNode node) 546public static SyntaxNode? GetInitializerOfBaseObjectCreationExpression(this ISyntaxFacts syntaxFacts, SyntaxNode node) 548syntaxFacts.GetPartsOfBaseObjectCreationExpression(node, out _, out var initializer); 552public static SyntaxList<SyntaxNode> GetMembersOfBaseNamespaceDeclaration(this ISyntaxFacts syntaxFacts, SyntaxNode node) 558public static SyntaxList<SyntaxNode> GetMembersOfCompilationUnit(this ISyntaxFacts syntaxFacts, SyntaxNode node) 564public static SyntaxNode GetNameOfAttribute(this ISyntaxFacts syntaxFacts, SyntaxNode node) 566syntaxFacts.GetPartsOfAttribute(node, out var name, out _); 570public static SyntaxNode GetNameOfBaseNamespaceDeclaration(this ISyntaxFacts syntaxFacts, SyntaxNode node) 572syntaxFacts.GetPartsOfBaseNamespaceDeclaration(node, out var name, out _, out _); 576public static SyntaxNode GetNameOfMemberAccessExpression(this ISyntaxFacts syntaxFacts, SyntaxNode node) 578syntaxFacts.GetPartsOfMemberAccessExpression(node, out _, out var name); 582public static SyntaxNode GetOperandOfPrefixUnaryExpression(this ISyntaxFacts syntaxFacts, SyntaxNode node) 584syntaxFacts.GetPartsOfPrefixUnaryExpression(node, out _, out var operand); 588public static SyntaxToken GetOperatorTokenOfPrefixUnaryExpression(this ISyntaxFacts syntaxFacts, SyntaxNode node) 594public static SeparatedSyntaxList<SyntaxNode> GetTypeArgumentsOfGenericName(this ISyntaxFacts syntaxFacts, SyntaxNode node) 600public static SyntaxNode GetTypeOfObjectCreationExpression(this ISyntaxFacts syntaxFacts, SyntaxNode node) 602syntaxFacts.GetPartsOfObjectCreationExpression(node, out _, out var type, out _, out _); 610public static bool IsExpressionOfAwaitExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 612var parent = node?.Parent; 619public static bool IsExpressionOfInvocationExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 621var parent = node?.Parent; 625syntaxFacts.GetPartsOfInvocationExpression(parent, out var expression, out _); 629public static bool IsExpressionOfMemberAccessExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 631var parent = node?.Parent; 635syntaxFacts.GetPartsOfMemberAccessExpression(parent, out var expression, out _); 639public static bool IsNameOfAttribute(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 644syntaxFacts.GetPartsOfAttribute(node.Parent, out var name, out _); 648public static bool IsRightOfQualifiedName(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 650var parent = node?.Parent; 654syntaxFacts.GetPartsOfQualifiedName(parent, out _, out _, out var right); 658public static bool IsTypeOfObjectCreationExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 660var parent = node?.Parent; 664syntaxFacts.GetPartsOfObjectCreationExpression(parent, out _, out var type, out _, out _); 695public static bool IsSkippedTokensTrivia(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 735public static bool IsGenericName(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 738public static bool IsIdentifierName(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 741public static bool IsQualifiedName(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 748public static bool IsTupleType(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 755public static bool IsCharacterLiteralExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 758public static bool IsDefaultLiteralExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 761public static bool IsFalseLiteralExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 764public static bool IsNumericLiteralExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 767public static bool IsNullLiteralExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 770public static bool IsStringLiteralExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 773public static bool IsTrueLiteralExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 780public static bool IsArrayCreationExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 783public static bool IsAwaitExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 786public static bool IsBaseExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 789public static bool IsConditionalExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 792public static bool IsConditionalAccessExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 795public static bool IsImplicitArrayCreationExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 798public static bool IsImplicitObjectCreationExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 801public static bool IsIndexExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 804public static bool IsInterpolatedStringExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 807public static bool IsInterpolation(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 810public static bool IsInterpolatedStringText(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 813public static bool IsInvocationExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 816public static bool IsIsTypeExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 819public static bool IsIsNotTypeExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 822public static bool IsIsPatternExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 825public static bool IsLogicalAndExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 828public static bool IsLogicalOrExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 831public static bool IsLogicalNotExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 834public static bool IsObjectCreationExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 837public static bool IsParenthesizedExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 840public static bool IsQueryExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 843public static bool IsRangeExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 846public static bool IsRefExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 849public static bool IsSimpleMemberAccessExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 852public static bool IsThisExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 855public static bool IsThrowExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 858public static bool IsTupleExpression(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 861public static bool ContainsGlobalStatement(this ISyntaxFacts syntaxFacts, SyntaxNode node) 868public static bool IsAndPattern(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 871public static bool IsConstantPattern(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 874public static bool IsDeclarationPattern(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 877public static bool IsListPattern(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 880public static bool IsNotPattern(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 883public static bool IsOrPattern(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 886public static bool IsParenthesizedPattern(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 889public static bool IsRecursivePattern(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 892public static bool IsRelationalPattern(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 895public static bool IsTypePattern(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 898public static bool IsVarPattern(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 905public static bool IsExpressionStatement(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 908public static bool IsForEachStatement(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 911public static bool IsForStatement(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 914public static bool IsIfStatement(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 917public static bool IsLocalDeclarationStatement(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 920public static bool IsLocalFunctionStatement(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 923public static bool IsLockStatement(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 926public static bool IsReturnStatement(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 929public static bool IsThrowStatement(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 932public static bool IsUsingStatement(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 935public static bool IsWhileStatement(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 938public static bool IsYieldReturnStatement(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 945public static bool IsAttribute(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 948public static bool IsClassDeclaration(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 951public static bool IsConstructorDeclaration(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 954public static bool IsEnumDeclaration(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 957public static bool IsGlobalAttribute(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 960public static bool IsInterfaceDeclaration(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 963public static bool IsParameter(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 966public static bool IsTypeConstraint(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 969public static bool IsVariableDeclarator(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 972public static bool IsFieldDeclaration(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 975public static bool IsPropertyDeclaration(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 978public static bool IsStructDeclaration(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 981public static bool IsTypeArgumentList(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 988public static bool IsElseClause(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 990public static bool IsEqualsValueClause(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 997public static bool IsImplicitElementAccess(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node) 1000public static bool IsIndexerMemberCref(this ISyntaxFacts syntaxFacts, [NotNullWhen(true)] SyntaxNode? node)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AliasSymbolKey.cs (2)
59SemanticModel semanticModel, SyntaxNode syntaxNode, string name, ISymbol target, 84if (child.AsNode(out var childNode))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AnonymousFunctionOrDelegateSymbolKey.cs (1)
55var node = root.FindNode(location.SourceSpan, getInnermostNodeForTie: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.BodyLevelSymbolKey.cs (6)
83var containerDeclaration = TryGetContainerDeclaration(container, syntaxTree, cancellationToken); 101private static SyntaxNode? TryGetContainerDeclaration(ISymbol container, SyntaxTree? syntaxTree, CancellationToken cancellationToken) 183var containerDeclaration = GetContainerDeclaration(firstSourceTree); 203SyntaxNode? GetContainerDeclaration(SyntaxTree? syntaxTree) 256SemanticModel semanticModel, SyntaxNode containerDeclaration, SymbolKind kind, string localName, CancellationToken cancellationToken) 262foreach (var node in containerDeclaration.DescendantNodes())
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (1)
727var node = location.FindNode(findInsideTrivia: true, getInnermostNodeForTie: true, CancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (39)
35where TExpressionSyntax : SyntaxNode 37where TAttributeSyntax : SyntaxNode 38where TArgumentSyntax : SyntaxNode 39where TForEachStatementSyntax : SyntaxNode 40where TThrowStatementSyntax : SyntaxNode 49private SyntaxNode? _lazySemanticRootOfOriginalExpression; 51private SyntaxNode? _lazySemanticRootOfReplacedExpression; 97protected abstract SyntaxNode GetSemanticRootForSpeculation(TExpressionSyntax expression); 98protected abstract SemanticModel CreateSpeculativeSemanticModel(SyntaxNode originalNode, SyntaxNode nodeToSpeculate, SemanticModel semanticModel); 101protected abstract bool ExpressionMightReferenceMember([NotNullWhen(true)] SyntaxNode? node); 116protected abstract bool ReplacementChangesSemanticsForNodeLanguageSpecific(SyntaxNode currentOriginalNode, SyntaxNode currentReplacedNode, SyntaxNode? previousOriginalNode, SyntaxNode? previousReplacedNode); 118protected abstract bool IsParenthesizedExpression([NotNullWhen(true)] SyntaxNode? node); 130SyntaxNode ISpeculationAnalyzer.OriginalExpression => OriginalExpression; 137public SyntaxNode SemanticRootOfOriginalExpression 170SyntaxNode ISpeculationAnalyzer.ReplacedExpression => ReplacedExpression; 177public SyntaxNode SemanticRootOfReplacedExpression 200protected virtual SyntaxNode GetSemanticRootOfReplacedExpression(SyntaxNode semanticRootOfOriginalExpression, TExpressionSyntax annotatedReplacedExpression) 223protected abstract void ValidateSpeculativeSemanticModel(SemanticModel speculativeSemanticModel, SyntaxNode nodeToSpeculate); 230var nodeToSpeculate = this.SemanticRootOfReplacedExpression; 316protected bool SymbolsAreCompatible(SyntaxNode originalNode, SyntaxNode newNode, bool requireNonNullSymbols = false) 518protected bool ReplacementChangesSemantics(SyntaxNode currentOriginalNode, SyntaxNode currentReplacedNode, SyntaxNode originalRoot, bool skipVerificationForCurrentNode) 526SyntaxNode? previousOriginalNode = null, previousReplacedNode = null; 571private bool ReplacementChangesSemanticsForNode(SyntaxNode currentOriginalNode, SyntaxNode currentReplacedNode, SyntaxNode? previousOriginalNode, SyntaxNode? previousReplacedNode) 688var originalExpressionOfMemberAccess = syntaxFacts.GetExpressionOfMemberAccessExpression(originalExpression); 731private bool ReplacementBreaksSystemObjectMethodResolution(SyntaxNode currentOriginalNode, SyntaxNode currentReplacedNode, [NotNullWhen(true)] SyntaxNode? previousOriginalNode, [NotNullWhen(true)] SyntaxNode? previousReplacedNode)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AnnotationTable.cs (17)
75public TSyntaxNode WithAdditionalAnnotations<TSyntaxNode>(TSyntaxNode node, params TAnnotation[] annotations) where TSyntaxNode : SyntaxNode 87public TSyntaxNode WithoutAnnotations<TSyntaxNode>(TSyntaxNode node, params TAnnotation[] annotations) where TSyntaxNode : SyntaxNode 111public IEnumerable<TAnnotation> GetAnnotations(SyntaxNode node) 123public IEnumerable<TSpecificAnnotation> GetAnnotations<TSpecificAnnotation>(SyntaxNode node) where TSpecificAnnotation : TAnnotation 135public bool HasAnnotations(SyntaxNode node) 147public bool HasAnnotations<TSpecificAnnotation>(SyntaxNode node) where TSpecificAnnotation : TAnnotation 159public bool HasAnnotation(SyntaxNode node, TAnnotation annotation) 171public IEnumerable<SyntaxNodeOrToken> GetAnnotatedNodesAndTokens(SyntaxNode node) 174public IEnumerable<SyntaxNode> GetAnnotatedNodes(SyntaxNode node) 177public IEnumerable<SyntaxToken> GetAnnotatedTokens(SyntaxNode node) 180public IEnumerable<SyntaxTrivia> GetAnnotatedTrivia(SyntaxNode node) 183public IEnumerable<SyntaxNodeOrToken> GetAnnotatedNodesAndTokens<TSpecificAnnotation>(SyntaxNode node) where TSpecificAnnotation : TAnnotation 186public IEnumerable<SyntaxNode> GetAnnotatedNodes<TSpecificAnnotation>(SyntaxNode node) where TSpecificAnnotation : TAnnotation 189public IEnumerable<SyntaxToken> GetAnnotatedTokens<TSpecificAnnotation>(SyntaxNode node) where TSpecificAnnotation : TAnnotation 192public IEnumerable<SyntaxTrivia> GetAnnotatedTrivia<TSpecificAnnotation>(SyntaxNode node) where TSpecificAnnotation : TAnnotation
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (8)
46public static IEnumerable<(SyntaxToken, SyntaxToken)> ConvertToTokenPairs(this SyntaxNode root, IReadOnlyList<TextSpan> spans) 82public static ValueTuple<SyntaxToken, SyntaxToken> ConvertToTokenPair(this SyntaxNode root, TextSpan textSpan) 128public static bool IsInvalidTokenRange(this SyntaxNode root, SyntaxToken startToken, SyntaxToken endToken) 279var parentNode = GetParentThatContainsGivenSpan(token.Parent, backwardPosition, forward: false); 310var parentNode = GetParentThatContainsGivenSpan(token.Parent, forwardPosition, forward: true); 321private static SyntaxNode? GetParentThatContainsGivenSpan(SyntaxNode? node, int position, bool forward) 358public static TextSpan GetFormattingSpan(SyntaxNode root, TextSpan span)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\ISpeculationAnalyzer.cs (2)
13SyntaxNode OriginalExpression { get; } 19SyntaxNode ReplacedExpression { get; }
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SyntaxPath.cs (5)
56var parent = nodeOrToken.Parent; 91public bool TryResolve(SyntaxNode? root, out SyntaxNodeOrToken nodeOrToken) 137where TNode : SyntaxNode 142public bool TryResolve<TNode>(SyntaxNode? root, [NotNullWhen(true)] out TNode? node) 143where TNode : SyntaxNode
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\ForkingSyntaxEditorBasedCodeFixProvider.cs (3)
27where TDiagnosticNode : SyntaxNode 63var originalRoot = editor.OriginalRoot; 96var changedRoot = subEditor.GetChangedRoot();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\SyntaxEditorBasedCodeFixProvider.cs (2)
74var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 79var newRoot = editor.GetChangedRoot();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (83)
48public TDeclarationNode AddEvent<TDeclarationNode>(TDeclarationNode destination, IEventSymbol @event, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode 51public TDeclarationNode AddField<TDeclarationNode>(TDeclarationNode destination, IFieldSymbol field, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode 54public TDeclarationNode AddMethod<TDeclarationNode>(TDeclarationNode destination, IMethodSymbol method, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode 57public TDeclarationNode AddProperty<TDeclarationNode>(TDeclarationNode destination, IPropertySymbol property, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode 60public TDeclarationNode AddNamedType<TDeclarationNode>(TDeclarationNode destination, INamedTypeSymbol namedType, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode 63public TDeclarationNode AddNamespace<TDeclarationNode>(TDeclarationNode destination, INamespaceSymbol @namespace, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode 67where TDeclarationNode : SyntaxNode 70private static TNode WithAnnotations<TNode>(TNode node, CodeGenerationContextInfo info) where TNode : SyntaxNode 77public SyntaxNode CreateEventDeclaration(IEventSymbol @event, CodeGenerationDestination destination, CodeGenerationContextInfo info, CancellationToken cancellationToken) 80public SyntaxNode CreateFieldDeclaration(IFieldSymbol field, CodeGenerationDestination destination, CodeGenerationContextInfo info, CancellationToken cancellationToken) 83public SyntaxNode? CreateMethodDeclaration(IMethodSymbol method, CodeGenerationDestination destination, CodeGenerationContextInfo info, CancellationToken cancellationToken) 86public SyntaxNode CreatePropertyDeclaration(IPropertySymbol property, CodeGenerationDestination destination, CodeGenerationContextInfo info, CancellationToken cancellationToken) 89public SyntaxNode CreateNamedTypeDeclaration(INamedTypeSymbol namedType, CodeGenerationDestination destination, CodeGenerationContextInfo info, CancellationToken cancellationToken) 92public SyntaxNode CreateNamespaceDeclaration(INamespaceSymbol @namespace, CodeGenerationDestination destination, CodeGenerationContextInfo info, CancellationToken cancellationToken) 95public TDeclarationNode AddParameters<TDeclarationNode>(TDeclarationNode destination, IEnumerable<IParameterSymbol> parameters, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode 98public TDeclarationNode AddAttributes<TDeclarationNode>(TDeclarationNode destination, IEnumerable<AttributeData> attributes, SyntaxToken? target, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode 101public TDeclarationNode RemoveAttribute<TDeclarationNode>(TDeclarationNode destination, SyntaxNode attributeToRemove, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode 104public TDeclarationNode RemoveAttribute<TDeclarationNode>(TDeclarationNode destination, AttributeData attributeToRemove, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode 107public TDeclarationNode UpdateDeclarationModifiers<TDeclarationNode>(TDeclarationNode declaration, IEnumerable<SyntaxToken> newModifiers, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode 110public TDeclarationNode UpdateDeclarationAccessibility<TDeclarationNode>(TDeclarationNode declaration, Accessibility newAccessibility, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode 113public TDeclarationNode UpdateDeclarationType<TDeclarationNode>(TDeclarationNode declaration, ITypeSymbol newType, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode 116public TDeclarationNode UpdateDeclarationMembers<TDeclarationNode>(TDeclarationNode declaration, IList<ISymbol> newMembers, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode 119public TDeclarationNode AddStatements<TDeclarationNode>(TDeclarationNode destination, IEnumerable<SyntaxNode> statements, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode 124protected abstract TDeclarationNode AddEvent<TDeclarationNode>(TDeclarationNode destination, IEventSymbol @event, TCodeGenerationContextInfo info, IList<bool>? availableIndices, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 125protected abstract TDeclarationNode AddField<TDeclarationNode>(TDeclarationNode destination, IFieldSymbol field, TCodeGenerationContextInfo info, IList<bool>? availableIndices, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 126protected abstract TDeclarationNode AddMethod<TDeclarationNode>(TDeclarationNode destination, IMethodSymbol method, TCodeGenerationContextInfo info, IList<bool>? availableIndices, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 127protected abstract TDeclarationNode AddProperty<TDeclarationNode>(TDeclarationNode destination, IPropertySymbol property, TCodeGenerationContextInfo info, IList<bool>? availableIndices, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 128protected abstract TDeclarationNode AddNamedType<TDeclarationNode>(TDeclarationNode destination, INamedTypeSymbol namedType, TCodeGenerationContextInfo info, IList<bool>? availableIndices, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 129protected abstract TDeclarationNode AddNamespace<TDeclarationNode>(TDeclarationNode destination, INamespaceSymbol @namespace, TCodeGenerationContextInfo info, IList<bool>? availableIndices, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 130protected abstract TDeclarationNode AddMembers<TDeclarationNode>(TDeclarationNode destination, IEnumerable<SyntaxNode> members) where TDeclarationNode : SyntaxNode; 132public abstract TDeclarationNode AddParameters<TDeclarationNode>(TDeclarationNode destinationMember, IEnumerable<IParameterSymbol> parameters, TCodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 133public abstract TDeclarationNode AddAttributes<TDeclarationNode>(TDeclarationNode destination, IEnumerable<AttributeData> attributes, SyntaxToken? target, TCodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 134public abstract TDeclarationNode RemoveAttribute<TDeclarationNode>(TDeclarationNode destination, SyntaxNode attributeToRemove, TCodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 135public abstract TDeclarationNode RemoveAttribute<TDeclarationNode>(TDeclarationNode destination, AttributeData attributeToRemove, TCodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 136public abstract TDeclarationNode AddStatements<TDeclarationNode>(TDeclarationNode destinationMember, IEnumerable<SyntaxNode> statements, TCodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 138public abstract TDeclarationNode UpdateDeclarationModifiers<TDeclarationNode>(TDeclarationNode declaration, IEnumerable<SyntaxToken> newModifiers, TCodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 139public abstract TDeclarationNode UpdateDeclarationAccessibility<TDeclarationNode>(TDeclarationNode declaration, Accessibility newAccessibility, TCodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 140public abstract TDeclarationNode UpdateDeclarationType<TDeclarationNode>(TDeclarationNode declaration, ITypeSymbol newType, TCodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 141public abstract TDeclarationNode UpdateDeclarationMembers<TDeclarationNode>(TDeclarationNode declaration, IList<ISymbol> newMembers, TCodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 143public abstract CodeGenerationDestination GetDestination(SyntaxNode node); 144public abstract SyntaxNode CreateEventDeclaration(IEventSymbol @event, CodeGenerationDestination destination, TCodeGenerationContextInfo info, CancellationToken cancellationToken); 145public abstract SyntaxNode CreateFieldDeclaration(IFieldSymbol field, CodeGenerationDestination destination, TCodeGenerationContextInfo info, CancellationToken cancellationToken); 148public abstract SyntaxNode? CreateMethodDeclaration(IMethodSymbol method, CodeGenerationDestination destination, TCodeGenerationContextInfo info, CancellationToken cancellationToken); 150public abstract SyntaxNode CreatePropertyDeclaration(IPropertySymbol property, CodeGenerationDestination destination, TCodeGenerationContextInfo info, CancellationToken cancellationToken); 151public abstract SyntaxNode CreateNamedTypeDeclaration(INamedTypeSymbol namedType, CodeGenerationDestination destination, TCodeGenerationContextInfo info, CancellationToken cancellationToken); 152public abstract SyntaxNode CreateNamespaceDeclaration(INamespaceSymbol @namespace, CodeGenerationDestination destination, TCodeGenerationContextInfo info, CancellationToken cancellationToken); 157protected static void CheckDeclarationNode<TDeclarationNode>(SyntaxNode destination) where TDeclarationNode : SyntaxNode 172protected static void CheckDeclarationNode<TDeclarationNode1, TDeclarationNode2>(SyntaxNode destination) 173where TDeclarationNode1 : SyntaxNode 174where TDeclarationNode2 : SyntaxNode 191protected static void CheckDeclarationNode<TDeclarationNode1, TDeclarationNode2, TDeclarationNode3>(SyntaxNode destination) 192where TDeclarationNode1 : SyntaxNode 193where TDeclarationNode2 : SyntaxNode 194where TDeclarationNode3 : SyntaxNode 212protected static void CheckDeclarationNode<TDeclarationNode1, TDeclarationNode2, TDeclarationNode3, TDeclarationNode4>(SyntaxNode destination) 213where TDeclarationNode1 : SyntaxNode 214where TDeclarationNode2 : SyntaxNode 215where TDeclarationNode3 : SyntaxNode 216where TDeclarationNode4 : SyntaxNode 233Func<SyntaxNode, TCodeGenerationContextInfo, IList<bool>?, CancellationToken, SyntaxNode> declarationTransform, 248var transformedDeclaration = declarationTransform(destinationDeclaration, info, availableIndices, cancellationToken); 250var root = await destinationTree.GetRootAsync(cancellationToken).ConfigureAwait(false); 251var currentRoot = root.ReplaceNode(destinationDeclaration, transformedDeclaration); 276where TDeclarationNode : SyntaxNode 298where TDeclarationSyntax : SyntaxNode 300var newMembers = new List<SyntaxNode>(); 305var newMember = GetNewMember(info, codeGenerationDestination, member, cancellationToken); 330where TDeclarationSyntax : SyntaxNode 343private SyntaxNode? GetNewMember(TCodeGenerationContextInfo info, CodeGenerationDestination codeGenerationDestination, ISymbol member, CancellationToken cancellationToken) 360CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode 380protected abstract IComparer<SyntaxNode> GetMemberComparer(); 482protected static void CheckLocation(SyntaxNode destinationMember, [NotNull] Location? location) 501SyntaxNode attributeList, 521SyntaxNode attributeToRemove, 527var root = attributeToRemove.SyntaxTree.GetRoot(); 536where T : SyntaxNode
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (16)
19protected abstract IList<bool>? GetAvailableInsertionIndices(SyntaxNode destination, CancellationToken cancellationToken); 21private IList<bool>? GetAvailableInsertionIndices<TDeclarationNode>(TDeclarationNode destination, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode 22=> GetAvailableInsertionIndices((SyntaxNode)destination, cancellationToken); 30protected static SyntaxToken GetEndToken(SyntaxNode node) 46protected static TextSpan GetSpan(SyntaxNode node) 54public bool CanAddTo(SyntaxNode destination, Solution solution, CancellationToken cancellationToken) 57private bool CanAddTo(SyntaxNode? destination, Solution solution, CancellationToken cancellationToken, 126public async Task<SyntaxNode?> FindMostRelevantNameSpaceOrTypeDeclarationAsync( 136private async Task<(SyntaxNode? declaration, IList<bool>? availableIndices)> FindMostRelevantDeclarationAsync( 142var declaration = (SyntaxNode?)null; 149var fallbackDeclaration = (SyntaxNode?)null; 215private static async Task<SyntaxNode?> SelectFirstOrDefaultAsync(IEnumerable<SyntaxReference> references, Func<SyntaxNode, bool> predicate, CancellationToken cancellationToken) 219var node = await r.GetSyntaxAsync(cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractFlagsEnumGenerator.cs (8)
15protected abstract SyntaxNode CreateExplicitlyCastedLiteralValue(SyntaxGenerator generator, INamedTypeSymbol enumType, SpecialType underlyingSpecialType, object constantValue); 18public SyntaxNode CreateEnumConstantValue(SyntaxGenerator generator, INamedTypeSymbol enumType, object constantValue) 63private SyntaxNode CreateFlagsEnumConstantValue(SyntaxGenerator generator, INamedTypeSymbol enumType, object constantValue) 73private SyntaxNode CreateFlagsEnumConstantValue( 106SyntaxNode? finalNode = null; 110var node = CreateMemberAccessExpression(generator, field.field, enumType, underlyingSpecialType); 140private SyntaxNode CreateMemberAccessExpression( 188private SyntaxNode CreateNonFlagsEnumConstantValue(SyntaxGenerator generator, INamedTypeSymbol enumType, object constantValue)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (9)
19public static SyntaxNode? GenerateThrowStatement( 33var exceptionCreationExpression = factory.ObjectCreationExpression(exceptionType, arguments: []); 38public static TSyntaxNode? AddAnnotationsTo<TSyntaxNode>(ISymbol symbol, TSyntaxNode? syntax) where TSyntaxNode : SyntaxNode 43public static TSyntaxNode AddFormatterAndCodeGeneratorAnnotationsTo<TSyntaxNode>(TSyntaxNode node) where TSyntaxNode : SyntaxNode 172public static T RemoveLeadingDirectiveTrivia<T>(T node) where T : SyntaxNode 179where T : SyntaxNode 197where TDeclaration : SyntaxNode 302where TDeclarationSyntax : SyntaxNode 327where TDeclarationSyntax : SyntaxNode
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (16)
60SyntaxNode? initializer = null) 113SyntaxNode? initializer = null) 129ImmutableArray<SyntaxNode> statements = default, 130ImmutableArray<SyntaxNode> baseConstructorArguments = default, 131ImmutableArray<SyntaxNode> thisConstructorArguments = default, 144ImmutableArray<SyntaxNode> statements = default) 162ImmutableArray<SyntaxNode> statements = default, 163ImmutableArray<SyntaxNode> handlesExpressions = default, 183ImmutableArray<SyntaxNode> statements = default, 184ImmutableArray<SyntaxNode> handlesExpressions = default, 202ImmutableArray<SyntaxNode> statements = default, 228ImmutableArray<SyntaxNode> statements = default, 256ImmutableArray<SyntaxNode> statements = default, 365ImmutableArray<SyntaxNode> statements = default) 389ImmutableArray<SyntaxNode> statements) 522ImmutableArray<SyntaxNode> statements = default,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\ICodeGenerationService.cs (26)
23SyntaxNode CreateEventDeclaration(IEventSymbol @event, CodeGenerationDestination destination, CodeGenerationContextInfo info, CancellationToken cancellationToken); 28SyntaxNode CreateFieldDeclaration(IFieldSymbol field, CodeGenerationDestination destination, CodeGenerationContextInfo info, CancellationToken cancellationToken); 34SyntaxNode? CreateMethodDeclaration(IMethodSymbol method, CodeGenerationDestination destination, CodeGenerationContextInfo info, CancellationToken cancellationToken); 39SyntaxNode CreatePropertyDeclaration(IPropertySymbol property, CodeGenerationDestination destination, CodeGenerationContextInfo info, CancellationToken cancellationToken); 44SyntaxNode CreateNamedTypeDeclaration(INamedTypeSymbol namedType, CodeGenerationDestination destination, CodeGenerationContextInfo info, CancellationToken cancellationToken); 49SyntaxNode CreateNamespaceDeclaration(INamespaceSymbol @namespace, CodeGenerationDestination destination, CodeGenerationContextInfo info, CancellationToken cancellationToken); 54TDeclarationNode AddEvent<TDeclarationNode>(TDeclarationNode destination, IEventSymbol @event, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 59TDeclarationNode AddField<TDeclarationNode>(TDeclarationNode destination, IFieldSymbol field, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 64TDeclarationNode AddMethod<TDeclarationNode>(TDeclarationNode destination, IMethodSymbol method, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 69TDeclarationNode AddProperty<TDeclarationNode>(TDeclarationNode destination, IPropertySymbol property, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 74TDeclarationNode AddNamedType<TDeclarationNode>(TDeclarationNode destination, INamedTypeSymbol namedType, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 79TDeclarationNode AddNamespace<TDeclarationNode>(TDeclarationNode destination, INamespaceSymbol @namespace, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 84TDeclarationNode AddMembers<TDeclarationNode>(TDeclarationNode destination, IEnumerable<ISymbol> members, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 89TDeclarationNode AddParameters<TDeclarationNode>(TDeclarationNode destination, IEnumerable<IParameterSymbol> parameters, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 94TDeclarationNode AddAttributes<TDeclarationNode>(TDeclarationNode destination, IEnumerable<AttributeData> attributes, SyntaxToken? target, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 99TDeclarationNode RemoveAttribute<TDeclarationNode>(TDeclarationNode destination, SyntaxNode attributeToRemove, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 104TDeclarationNode RemoveAttribute<TDeclarationNode>(TDeclarationNode destination, AttributeData attributeToRemove, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 109TDeclarationNode UpdateDeclarationModifiers<TDeclarationNode>(TDeclarationNode declaration, IEnumerable<SyntaxToken> newModifiers, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 114TDeclarationNode UpdateDeclarationAccessibility<TDeclarationNode>(TDeclarationNode declaration, Accessibility newAccessibility, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 119TDeclarationNode UpdateDeclarationType<TDeclarationNode>(TDeclarationNode declaration, ITypeSymbol newType, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 124TDeclarationNode UpdateDeclarationMembers<TDeclarationNode>(TDeclarationNode declaration, IList<ISymbol> newMembers, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 129TDeclarationNode AddStatements<TDeclarationNode>(TDeclarationNode destination, IEnumerable<SyntaxNode> statements, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode; 184bool CanAddTo(SyntaxNode destination, Solution solution, CancellationToken cancellationToken); 192Task<SyntaxNode?> FindMostRelevantNameSpaceOrTypeDeclarationAsync(Solution solution, INamespaceOrTypeSymbol namespaceOrType, Location? location, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationConstructorInfo.cs (15)
17private readonly ImmutableArray<SyntaxNode> _baseConstructorArguments; 18private readonly ImmutableArray<SyntaxNode> _thisConstructorArguments; 19private readonly ImmutableArray<SyntaxNode> _statements; 25ImmutableArray<SyntaxNode> statements, 26ImmutableArray<SyntaxNode> baseConstructorArguments, 27ImmutableArray<SyntaxNode> thisConstructorArguments) 42ImmutableArray<SyntaxNode> statements, 43ImmutableArray<SyntaxNode> baseConstructorArguments, 44ImmutableArray<SyntaxNode> thisConstructorArguments) 56public static ImmutableArray<SyntaxNode> GetThisConstructorArgumentsOpt(IMethodSymbol constructor) 59public static ImmutableArray<SyntaxNode> GetBaseConstructorArgumentsOpt(IMethodSymbol constructor) 62public static ImmutableArray<SyntaxNode> GetStatements(IMethodSymbol constructor) 74private static ImmutableArray<SyntaxNode> GetThisConstructorArgumentsOpt(CodeGenerationConstructorInfo? info) 77private static ImmutableArray<SyntaxNode> GetBaseConstructorArgumentsOpt(CodeGenerationConstructorInfo? info) 80private static ImmutableArray<SyntaxNode> GetStatements(CodeGenerationConstructorInfo? info)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationDestructorInfo.cs (5)
17private readonly ImmutableArray<SyntaxNode> _statements; 21ImmutableArray<SyntaxNode> statements) 30ImmutableArray<SyntaxNode> statements) 42public static ImmutableArray<SyntaxNode> GetStatements(IMethodSymbol destructor) 48private static ImmutableArray<SyntaxNode> GetStatements(CodeGenerationDestructorInfo info)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationFieldInfo.cs (5)
17private readonly SyntaxNode _initializer; 22SyntaxNode initializer) 33SyntaxNode initializer) 57private static SyntaxNode GetInitializer(CodeGenerationFieldInfo info) 60public static SyntaxNode GetInitializer(IFieldSymbol field)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationMethodInfo.cs (10)
20private readonly ImmutableArray<SyntaxNode> _statements; 21private readonly ImmutableArray<SyntaxNode> _handlesExpressions; 28ImmutableArray<SyntaxNode> statements, 29ImmutableArray<SyntaxNode> handlesExpressions) 45ImmutableArray<SyntaxNode> statements, 46ImmutableArray<SyntaxNode> handlesExpressions) 58public static ImmutableArray<SyntaxNode> GetStatements(IMethodSymbol method) 61public static ImmutableArray<SyntaxNode> GetHandlesExpressions(IMethodSymbol method) 76private static ImmutableArray<SyntaxNode> GetStatements(CodeGenerationMethodInfo info) 79private static ImmutableArray<SyntaxNode> GetHandlesExpressions(CodeGenerationMethodInfo info)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationPropertyInfo.cs (5)
17private readonly SyntaxNode _initializer; 22SyntaxNode initializer) 33SyntaxNode initializer) 45public static SyntaxNode GetInitializer(CodeGenerationPropertyInfo info) 48public static SyntaxNode GetInitializer(IPropertySymbol property)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationSymbol.cs (1)
148public static ImmutableArray<SyntaxNode> DeclaringSyntaxNodes
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeRefactorings\AbstractRefactoringHelpersService.cs (62)
18where TExpressionSyntax : SyntaxNode 19where TArgumentSyntax : SyntaxNode 20where TExpressionStatementSyntax : SyntaxNode 24public abstract bool IsBetweenTypeMembers(SourceText sourceText, SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? typeDeclaration); 26private static void AddNode<TSyntaxNode>(bool allowEmptyNodes, ref TemporaryArray<TSyntaxNode> result, TSyntaxNode node) where TSyntaxNode : SyntaxNode 35ParsedDocument document, TextSpan selectionRaw, bool allowEmptyNodes, int maxCount, ref TemporaryArray<TSyntaxNode> result, CancellationToken cancellationToken) where TSyntaxNode : SyntaxNode 42var root = document.Root; 137private static bool IsWantedTypeExpressionLike<TSyntaxNode>() where TSyntaxNode : SyntaxNode 157SyntaxNode root, 268CancellationToken cancellationToken) where TSyntaxNode : SyntaxNode 275var leftNode = tokenToLeft.Parent; 302SyntaxNode root, 307CancellationToken cancellationToken) where TSyntaxNode : SyntaxNode 313var rightNode = tokenToRightOrIn.Parent; 347SyntaxNode root, 352CancellationToken cancellationToken) where TSyntaxNode : SyntaxNode 354var selectionNode = root.FindNode(selectionTrimmed, getInnermostNodeForTie: true); 355var prevNode = selectionNode; 393protected virtual IEnumerable<SyntaxNode> ExtractNodesSimple(SyntaxNode? node, ISyntaxFactsService syntaxFacts) 411var localDeclarationStatement = syntaxFacts.IsLocalDeclarationStatement(node) ? node : node.Parent!; 421var declaredVariable = variables.First(); 427var initializer = syntaxFacts.GetInitializerOfVariableDeclarator(declaredVariable); 430var value = syntaxFacts.GetValueOfEqualsValueClause(initializer); 443var initializer = syntaxFacts.GetInitializerOfVariableDeclarator(node); 446var value = syntaxFacts.GetValueOfEqualsValueClause(initializer); 458syntaxFacts.GetPartsOfAssignmentExpressionOrStatement(node, out _, out _, out var rightSide); 480protected virtual IEnumerable<SyntaxNode> ExtractNodesInHeader(SyntaxNode root, int location, IHeaderFactsService headerFacts) 483if (headerFacts.IsOnPropertyDeclarationHeader(root, location, out var propertyDeclaration)) 487if (headerFacts.IsOnParameterHeader(root, location, out var parameter)) 491if (headerFacts.IsOnMethodHeader(root, location, out var method)) 495if (headerFacts.IsOnLocalFunctionHeader(root, location, out var localFunction)) 499if (headerFacts.IsOnLocalDeclarationHeader(root, location, out var localDeclaration)) 503if (headerFacts.IsOnIfStatementHeader(root, location, out var ifStatement)) 507if (headerFacts.IsOnForeachHeader(root, location, out var foreachStatement)) 510if (headerFacts.IsOnTypeHeader(root, location, out var typeDeclaration)) 520CancellationToken cancellationToken) where TSyntaxNode : SyntaxNode 524var root = document.Root; 531var ancestor = token.Parent; 559IEnumerable<SyntaxNode> nodes, bool allowEmptyNodes, int maxCount, ref TemporaryArray<TSyntaxNode> result, CancellationToken cancellationToken) where TSyntaxNode : SyntaxNode 561foreach (var node in nodes) 573public bool IsOnTypeHeader(SyntaxNode root, int position, bool fullHeader, [NotNullWhen(true)] out SyntaxNode? typeDeclaration) 576public bool IsOnPropertyDeclarationHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? propertyDeclaration) 579public bool IsOnParameterHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? parameter) 582public bool IsOnMethodHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? method) 585public bool IsOnLocalFunctionHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? localFunction) 588public bool IsOnLocalDeclarationHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? localDeclaration) 591public bool IsOnIfStatementHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? ifStatement) 594public bool IsOnWhileStatementHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? whileStatement) 597public bool IsOnForeachHeader(SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? foreachStatement)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeRefactorings\CodeRefactoringHelpers.cs (3)
41public static bool IsNodeUnderselected(SyntaxNode? node, TextSpan selection) 84var beginningNode = node.FindToken(node.Span.Start).Parent; 85var endNode = node.FindToken(node.Span.End - 1).Parent;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeRefactorings\IRefactoringHelpersService.cs (4)
25bool IsBetweenTypeMembers(SourceText sourceText, SyntaxNode root, int position, [NotNullWhen(true)] out SyntaxNode? typeDeclaration); 51/// name="selection"/>. The trimmed version is then used to determine relevant <see cref="SyntaxNode"/>. It also 57ParsedDocument document, TextSpan selection, bool allowEmptyNodes, int maxCount, ref TemporaryArray<TSyntaxNode> result, CancellationToken cancellationToken) where TSyntaxNode : SyntaxNode;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\AddParameterEditor.cs (10)
20SyntaxNode declaration, 22SyntaxNode parameterDeclaration, 54var firstParameter = existingParameters[0]; 66var nextParameter = existingParameters[insertionIndex]; 91var nextParameter = existingParameters[insertionIndex]; 108var nextParameter = existingParameters[insertionIndex]; 122ISyntaxFacts syntaxFacts, SyntaxNode node, bool includeLeadingNewLine) 152IReadOnlyList<SyntaxNode> parameters, CancellationToken cancellationToken) 162var lastParameter = parameters[i - 1]; 163var thisParameter = parameters[i];
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (22)
39var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 66bool OverlapsWithSpan(SyntaxNode n) => spansTree.HasIntervalThatOverlapsWith(n.FullSpan.Start, n.FullSpan.Length); 69protected abstract INamespaceSymbol? GetExplicitNamespaceSymbol(SyntaxNode node, SemanticModel model); 73SyntaxNode container, 91SyntaxNode container, 96private static SyntaxNode GenerateNamespaceImportDeclaration(INamespaceSymbol namespaceSymbol, SyntaxGenerator generator) 107IEnumerable<SyntaxNode> syntaxNodes, 113using var _1 = ArrayBuilder<SyntaxNode>.GetInstance(out var importsToAdd); 114using var _2 = ArrayBuilder<SyntaxNode>.GetInstance(out var nodesToSimplify); 116var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 135var namespaceSyntax = GenerateNamespaceImportDeclaration(namespaceSymbol, generator); 155var first = root.DescendantNodesAndSelf().First(x => x.HasAnnotation(annotation)); 156var last = root.DescendantNodesAndSelf().Last(x => x.HasAnnotation(annotation)); 158var context = first.GetCommonRoot(last); 168IEnumerable<SyntaxNode> syntaxNodes, 174using var _ = PooledDictionary<INamespaceSymbol, SyntaxNode>.GetInstance(out var importToSyntax); 184SyntaxNode? first = null, last = null; 187foreach (var annotatedNode in annotatedNodes) 215var namespaceSyntax = GenerateNamespaceImportDeclaration(namespaceSymbol, generator); 230var context = first.GetCommonRoot(last); 233var importContainer = addImportsService.GetImportContainer(root, context, importToSyntax.First().Value, options); 254private static bool IsInsideNamespace(SyntaxNode node, INamespaceSymbol symbol, SemanticModel model, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (7)
79public static async ValueTask<SyntaxNode> GetRequiredSyntaxRootAsync(this Document document, CancellationToken cancellationToken) 81if (document.TryGetSyntaxRoot(out var root)) 89public static SyntaxNode GetRequiredSyntaxRootSynchronously(this Document document, CancellationToken cancellationToken) 91var root = document.GetSyntaxRootSynchronously(cancellationToken); 137var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 139var node = token.Parent!.AncestorsAndSelf().First(a => a.FullSpan.Contains(span)); 158public static ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(this Document document, SyntaxNode? node, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ITypeInferenceServiceExtensions.cs (5)
15public static ImmutableArray<ITypeSymbol> InferTypes(this ITypeInferenceService service, SemanticModel semanticModel, SyntaxNode expression, CancellationToken cancellationToken) 24public static ImmutableArray<TypeInferenceInfo> GetTypeInferenceInfo(this ITypeInferenceService service, SemanticModel semanticModel, SyntaxNode expression, CancellationToken cancellationToken) 30SyntaxNode expression, 56SyntaxNode expression, 68SyntaxNode expression,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxEditorExtensions.cs (29)
31Func<SemanticModel, SyntaxNode, TType, TNode, SyntaxNode> updateRoot, 32CancellationToken cancellationToken) where TNode : SyntaxNode 54Func<SemanticModel, SyntaxNode, TType, TNode, SyntaxNode> updateRoot, 55CancellationToken cancellationToken) where TNode : SyntaxNode 76Func<SemanticModel, SyntaxNode, TNode, SyntaxNode> updateRoot, 77CancellationToken cancellationToken) where TNode : SyntaxNode 98Func<SemanticModel, SyntaxNode, TType, TNode, SyntaxNode> updateRoot, 99CancellationToken cancellationToken) where TNode : SyntaxNode 120Func<SemanticModel, SyntaxNode, TNode, SyntaxNode> updateRoot, 121CancellationToken cancellationToken) where TNode : SyntaxNode 154Func<ISyntaxFactsService, SyntaxNode, SyntaxNode> getSemanticBoundary, 156Func<SemanticModel, SyntaxNode, TType, TNode, SyntaxNode> updateRoot, 157CancellationToken cancellationToken) where TNode : SyntaxNode 170var originalRoot = editor.OriginalRoot; 173var currentRoot = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 183var replacementRoot = updateRoot(semanticModel, currentRoot, instance, currentNode); 195private static SyntaxNode GetExpressionSemanticBoundary(ISyntaxFactsService syntaxFacts, SyntaxNode node) 202return node.FirstAncestorOrSelf<SyntaxNode, ISyntaxFactsService>( 210private static SyntaxNode GetMethodBodySemanticBoundary(ISyntaxFactsService syntaxFacts, SyntaxNode node) 212return node.FirstAncestorOrSelf<SyntaxNode, ISyntaxFactsService>(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions.cs (47)
30public static SyntaxNode CreateThrowNotImplementedStatement( 37public static SyntaxNode CreateThrowNotImplementedExpression( 44private static SyntaxNode CreateNewNotImplementedException(SyntaxGenerator codeDefinitionFactory, Compilation compilation) 46var notImplementedExceptionTypeSyntax = compilation.NotImplementedExceptionType() is INamedTypeSymbol symbol 55public static ImmutableArray<SyntaxNode> CreateThrowNotImplementedStatementBlock( 59public static ImmutableArray<SyntaxNode> CreateArguments( 66private static SyntaxNode CreateArgument( 73public static SyntaxNode GetDefaultEqualityComparer( 80var typeExpression = equalityComparerType == null 95public static SyntaxNode IsPatternExpression(this SyntaxGeneratorInternal generator, SyntaxNode expression, SyntaxNode pattern) 102public static SyntaxNode GenerateDelegateThroughMemberStatement( 105var through = generator.MemberAccessExpression( 111var invocationExpression = generator.InvocationExpression(through, generator.CreateArguments(method.Parameters)); 117public static SyntaxNode CreateDelegateThroughExpression( 120var name = generator.IdentifierName(throughMember.Name); 121var through = throughMember.IsStatic 167var explicitImplementationCast = generator.CastExpression( 182static SyntaxNode GenerateContainerName(SyntaxGenerator factory, ISymbol throughMember) 191public static ImmutableArray<SyntaxNode> GetGetAccessorStatements( 197var throughExpression = CreateDelegateThroughExpression(generator, property, throughMember); 198var expression = property.IsIndexer 215public static ImmutableArray<SyntaxNode> GetSetAccessorStatements( 221var throughExpression = CreateDelegateThroughExpression(generator, property, throughMember); 222var expression = property.IsIndexer 315public static ImmutableArray<SyntaxNode> CreateAssignmentStatements( 325var nullCheckStatements = ArrayBuilder<SyntaxNode>.GetInstance(); 326var assignStatements = ArrayBuilder<SyntaxNode>.GetInstance(); 338var assignExpression = factory.AssignmentStatement( 341var statement = factory.ExpressionStatement(assignExpression); 351var fieldAccess = factory.MemberAccessExpression(factory.ThisExpression(), factory.IdentifierName(fieldName)) 371SyntaxNode fieldAccess, 374ArrayBuilder<SyntaxNode> nullCheckStatements, 375ArrayBuilder<SyntaxNode> assignStatements) 406public static SyntaxNode CreateAssignWithNullCheckStatement( 407this SyntaxGenerator factory, Compilation compilation, IParameterSymbol parameter, SyntaxNode fieldAccess) 416public static SyntaxNode CreateThrowArgumentNullExpression(this SyntaxGenerator factory, Compilation compilation, IParameterSymbol parameter) 419private static SyntaxNode CreateNewArgumentNullException(SyntaxGenerator factory, Compilation compilation, IParameterSymbol parameter) 428public static SyntaxNode CreateNullCheckAndThrowStatement( 434var condition = factory.CreateNullCheckExpression(generatorInternal, semanticModel, parameter.Name); 435var throwStatement = factory.CreateThrowArgumentNullExceptionStatement(semanticModel.Compilation, parameter); 440public static SyntaxNode CreateNullCheckExpression( 443var identifier = factory.IdentifierName(identifierName); 444var nullExpr = factory.NullLiteralExpression(); 445var condition = generatorInternal.SupportsPatterns(semanticModel.SyntaxTree.Options) 451public static SyntaxNode CreateThrowArgumentNullExceptionStatement(this SyntaxGenerator factory, Compilation compilation, IParameterSymbol parameter)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (21)
49public static IMethodSymbol CreateEqualsMethod(this Compilation compilation, ImmutableArray<SyntaxNode> statements) 109private static ImmutableArray<SyntaxNode> CreateEqualsMethodStatements( 127using var statements = TemporaryArray<SyntaxNode>.Empty; 136var localNameExpression = factory.IdentifierName(localName); 137var objNameExpression = factory.IdentifierName(ObjName); 141using var _2 = ArrayBuilder<SyntaxNode>.GetInstance(out var expressions); 159var ifStatement = factory.IfStatement( 170var localDeclaration = factory.SimpleLocalDeclarationStatement(generatorInternal, 182var localDeclaration = factory.SimpleLocalDeclarationStatement(generatorInternal, 220ImmutableArray<ISymbol> members, SyntaxNode localNameExpression, 221ArrayBuilder<SyntaxNode> expressions) 231var symbolNameExpression = factory.IdentifierName(member.Name); 232var thisSymbol = factory.MemberAccessExpression(factory.ThisExpression(), symbolNameExpression) 234var otherSymbol = factory.MemberAccessExpression(localNameExpression, symbolNameExpression); 271private static ImmutableArray<SyntaxNode> CreateIEquatableEqualsMethodStatements( 279var statements = ArrayBuilder<SyntaxNode>.GetInstance(); 281var otherNameExpression = factory.IdentifierName(OtherName); 285using var _ = ArrayBuilder<SyntaxNode>.GetInstance(out var expressions); 323SyntaxGenerator factory, SyntaxGeneratorInternal generatorInternal, Compilation compilation, ParseOptions parseOptions, SyntaxNode otherNameExpression, ArrayBuilder<SyntaxNode> expressions) 325var nullLiteral = factory.NullLiteralExpression();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateGetHashCodeMethod.cs (20)
17public static ImmutableArray<SyntaxNode> GetGetHashCodeComponents( 25var result = ArrayBuilder<SyntaxNode>.GetInstance(); 41public static ImmutableArray<SyntaxNode> CreateGetHashCodeStatementsUsingSystemHashCode( 43INamedTypeSymbol hashCodeType, ImmutableArray<SyntaxNode> memberReferences) 47var statement = factory.ReturnStatement( 55var statements = ArrayBuilder<SyntaxNode>.GetInstance(); 59var localReference = factory.IdentifierName(hashName); 60foreach (var member in memberReferences) 79public static ImmutableArray<SyntaxNode> CreateGetHashCodeMethodStatements( 128var statements = ArrayBuilder<SyntaxNode>.GetInstance(); 139var hashCodeNameExpression = factory.IdentifierName(HashCodeName); 142var permuteValue = CreateLiteralExpression(factory, hashFactor); 143foreach (var component in components) 146var rightSide = 178private static SyntaxNode SimpleLocalDeclarationStatement( 180string name, SyntaxNode initializer) 187private static SyntaxNode CreateLiteralExpression(SyntaxGenerator factory, int value) 217private static SyntaxNode GetMemberForGetHashCode( 224var getHashCodeNameExpression = factory.IdentifierName(GetHashCodeName); 225var thisSymbol = factory.MemberAccessExpression(factory.ThisExpression(),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_Negate.cs (58)
35public static SyntaxNode Negate( 38SyntaxNode expression, 45public static SyntaxNode Negate( 48SyntaxNode expressionOrPattern, 56public static SyntaxNode Negate( 59SyntaxNode expressionOrPattern, 116syntaxFacts.GetPartsOfAnyIsTypeExpression(expressionOrPattern, out var expression, out var type); 126syntaxFacts.GetPartsOfAnyIsTypeExpression(expressionOrPattern, out var expression, out var type); 140private static SyntaxNode GetNegationOfBinaryExpression( 141SyntaxNode expressionNode, 148syntaxFacts.GetPartsOfBinaryExpression(expressionNode, out var leftOperand, out var operatorToken, out var rightOperand); 176var newBinaryExpressionSyntax = negatedKind is BinaryOperatorKind.Equals or BinaryOperatorKind.NotEquals 194SyntaxNode innerPattern; 203var typeExpression = generatorInternal.Type(isTypeOperation.TypeOperand, typeContext: false); 232private static SyntaxNode GetNegationOfBinaryPattern( 233SyntaxNode pattern, 245syntaxFacts.GetPartsOfBinaryPattern(pattern, out var left, out var operatorToken, out var right); 247var newLeft = generator.Negate(generatorInternal, left, semanticModel, cancellationToken); 248var newRight = generator.Negate(generatorInternal, right, semanticModel, cancellationToken); 250var newPattern = 262private static SyntaxNode GetNegationOfIsPatternExpression(SyntaxNode isExpression, SyntaxGenerator generator, SyntaxGeneratorInternal generatorInternal, SemanticModel semanticModel, CancellationToken cancellationToken) 267syntaxFacts.GetPartsOfIsPatternExpression(isExpression, out var left, out var isToken, out var pattern); 269SyntaxNode? negatedPattern = null; 291var type = syntaxFacts.GetTypeOfTypePattern(negatedPattern); 304private static SyntaxNode GetNegationOfRelationalPattern( 305SyntaxNode expressionNode, 316syntaxFacts.GetPartsOfRelationalPattern(expressionNode, out var operatorToken, out var expression); 331private static bool IsLegalPattern(ISyntaxFacts syntaxFacts, SyntaxNode pattern, bool designatorsLegal) 336syntaxFacts.GetPartsOfBinaryPattern(pattern, out var left, out _, out var right); 346syntaxFacts.GetPartsOfUnaryPattern(pattern, out _, out var subPattern); 358syntaxFacts.GetPartsOfParenthesizedPattern(pattern, out _, out var subPattern, out _); 364syntaxFacts.GetPartsOfDeclarationPattern(pattern, out _, out var designator); 370syntaxFacts.GetPartsOfRecursivePattern(pattern, out _, out _, out _, out var designator); 380private static SyntaxNode NegateRelational( 383SyntaxNode leftOperand, 385SyntaxNode rightOperand) 471private static SyntaxNode GetNegationOfLiteralExpression( 472SyntaxNode expression, 477SyntaxNode newLiteralExpression; 495private static SyntaxNode GetNegationOfConstantPattern( 496SyntaxNode pattern, 508var expression = syntaxFacts.GetExpressionOfConstantPattern(pattern); 520private static SyntaxNode GetNegationOfLogicalNotExpression( 521SyntaxNode expression, 525var operand = syntaxFacts.GetOperandOfPrefixUnaryExpression(expression); 531private static SyntaxNode GetNegationOfUnaryPattern( 532SyntaxNode pattern, 548private static SyntaxNode GetNegationOfNotPattern( 549SyntaxNode pattern, 556syntaxFacts.GetPartsOfUnaryPattern(pattern, out var opToken, out var subPattern); 562var type = syntaxFacts.GetTypeOfTypePattern(subPattern);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Indentation\AbstractIndentationService.cs (1)
17where TSyntaxRoot : SyntaxNode, ICompilationUnitSyntax
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Indentation\IIndentationService.cs (1)
53var newRoot = document.Root.ReplaceToken(token, newToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\AddImports\AbstractAddImportsService.cs (64)
20where TCompilationUnitSyntax : SyntaxNode 21where TNamespaceDeclarationSyntax : SyntaxNode 22where TUsingOrAliasSyntax : SyntaxNode 23where TExternSyntax : SyntaxNode 30protected abstract SyntaxNode? GetAlias(TUsingOrAliasSyntax usingOrAlias); 31protected abstract ImmutableArray<SyntaxNode> GetGlobalImports(Compilation compilation, SyntaxGenerator generator); 32protected abstract SyntaxList<TUsingOrAliasSyntax> GetUsingsAndAliases(SyntaxNode node); 33protected abstract SyntaxList<TExternSyntax> GetExterns(SyntaxNode node); 48private bool HasAliases(SyntaxNode node) => GetUsingsAndAliases(node).Any(IsAlias); 49private bool HasUsings(SyntaxNode node) => GetUsingsAndAliases(node).Any(IsSimpleUsing); 50private bool HasStaticUsings(SyntaxNode node) => GetUsingsAndAliases(node).Any(IsStaticUsing); 51private bool HasExterns(SyntaxNode node) => GetExterns(node).Any(); 52private bool HasAnyImports(SyntaxNode node) => GetUsingsAndAliases(node).Any() || GetExterns(node).Any(); 56SyntaxNode root, 57SyntaxNode? contextLocation, 58SyntaxNode import, 66private static ImmutableArray<SyntaxNode> GetAllContainers(SyntaxNode root, SyntaxNode? contextLocation) 70var applicableContainer = GetFirstApplicableContainer(contextLocation); 71return applicableContainer.GetAncestorsOrThis<SyntaxNode>().ToImmutableArray(); 75SyntaxNode import, ImmutableArray<SyntaxNode> containers, ImmutableArray<SyntaxNode> globalImports) 77foreach (var node in containers) 90foreach (var node in globalImports) 101protected abstract bool IsEquivalentImport(SyntaxNode a, SyntaxNode b); 103public SyntaxNode GetImportContainer(SyntaxNode root, SyntaxNode? contextLocation, SyntaxNode import, AddImportPlacementOptions options) 107out var externContainer, out var usingContainer, out var staticUsingContainer, out var aliasContainer); 130public SyntaxNode AddImports( 132SyntaxNode root, 133SyntaxNode? contextLocation, 134IEnumerable<SyntaxNode> newImports, 151out var externContainer, out var usingContainer, out var aliasContainer, out var staticUsingContainer); 153var newRoot = Rewrite( 161protected abstract SyntaxNode Rewrite( 163SyntaxNode externContainer, SyntaxNode usingContainer, SyntaxNode staticUsingContainer, SyntaxNode aliasContainer, 164AddImportPlacementOptions options, SyntaxNode root, CancellationToken cancellationToken); 166private void GetContainers(SyntaxNode root, SyntaxNode contextLocation, AddImportPlacementOptions options, out SyntaxNode externContainer, out SyntaxNode usingContainer, out SyntaxNode staticUsingContainer, out SyntaxNode aliasContainer) 168var applicableContainer = GetFirstApplicableContainer(contextLocation); 169var contextSpine = applicableContainer.GetAncestorsOrThis<SyntaxNode>().ToImmutableArray(); 174var fallbackNode = contextSpine.FirstOrDefault(HasAnyImports); 194private static SyntaxNode? GetFirstApplicableContainer(SyntaxNode contextNode) 198var node = usingDirective != null ? usingDirective.Parent! : contextNode; 200(SyntaxNode?)node.GetAncestorOrThis<TCompilationUnitSyntax>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\AddImports\AddImportHelpers.cs (2)
20where TRootSyntax : SyntaxNode 21where TImportDirectiveSyntax : SyntaxNode
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\AddImports\IAddImportsService.cs (15)
29bool HasExistingImport(Compilation compilation, SyntaxNode root, SyntaxNode? contextLocation, SyntaxNode import, SyntaxGenerator generator); 35SyntaxNode GetImportContainer(SyntaxNode root, SyntaxNode? contextLocation, SyntaxNode import, AddImportPlacementOptions options); 37SyntaxNode AddImports( 38Compilation compilation, SyntaxNode root, SyntaxNode? contextLocation, 39IEnumerable<SyntaxNode> newImports, SyntaxGenerator generator, AddImportPlacementOptions options, CancellationToken cancellationToken); 44public static SyntaxNode AddImport( 45this IAddImportsService service, Compilation compilation, SyntaxNode root, 46SyntaxNode contextLocation, SyntaxNode newImport, SyntaxGenerator generator, AddImportPlacementOptions options,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.cs (20)
26where TStatementSyntax : SyntaxNode 28where TVariableDeclaratorSyntax : SyntaxNode 30protected abstract bool IsMeaningfulBlock(SyntaxNode node); 31protected abstract bool CanMoveToBlock(ILocalSymbol localSymbol, SyntaxNode currentBlock, SyntaxNode destinationBlock); 32protected abstract SyntaxNode GetVariableDeclaratorSymbolNode(TVariableDeclaratorSyntax variableDeclarator); 35protected abstract Task<bool> TypesAreCompatibleAsync(Document document, ILocalSymbol localSymbol, TLocalDeclarationStatementSyntax declarationStatement, SyntaxNode right, CancellationToken cancellationToken); 37public async Task<bool> CanMoveDeclarationNearReferenceAsync(Document document, SyntaxNode node, CancellationToken cancellationToken) 43private async Task<State> ComputeStateAsync(Document document, SyntaxNode node, CancellationToken cancellationToken) 74Document document, SyntaxNode localDeclarationStatement, CancellationToken cancellationToken) 82var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 112var newRoot = editor.GetChangedRoot(); 149var originalNextStatement = state.OutermostBlockStatements[statementIndex + 1]; 185var blocks = state.InnermostBlock.GetAncestorsOrThis<SyntaxNode>(); 186foreach (var block in blocks) 209var initializer = syntaxFacts.GetInitializerOfVariableDeclarator(state.VariableDeclarator); 216syntaxFacts.GetPartsOfAssignmentStatement(firstStatement, out var left, out var right); 241out var _, out var operatorToken, out var right);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (5)
30public SyntaxNode OutermostBlock { get; private set; } 31public SyntaxNode InnermostBlock { get; private set; } 32public IReadOnlyList<SyntaxNode> OutermostBlockStatements { get; private set; } 33public IReadOnlyList<SyntaxNode> InnermostBlockStatements { get; private set; } 104var syntaxRoot = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\IMoveDeclarationNearReferenceService.cs (2)
19Task<bool> CanMoveDeclarationNearReferenceAsync(Document document, SyntaxNode localDeclarationStatement, CancellationToken cancellationToken); 26Task<Document> MoveDeclarationNearReferenceAsync(Document document, SyntaxNode localDeclarationStatement, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsService.cs (3)
19IEqualityComparer<T> where T : SyntaxNode 26public abstract Task<Document> RemoveUnnecessaryImportsAsync(Document fromDocument, Func<SyntaxNode, bool>? predicate, CancellationToken cancellationToken); 29Document document, Func<SyntaxNode, bool> predicate, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\RemoveUnnecessaryImports\IRemoveUnnecessaryImportsService.cs (1)
16Task<Document> RemoveUnnecessaryImportsAsync(Document fromDocument, Func<SyntaxNode, bool>? predicate, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\ReplaceDiscardDeclarationsWithAssignments\IReplaceDiscardDeclarationsWithAssignmentsService.cs (2)
32Task<SyntaxNode> ReplaceAsync(Document document, SyntaxNode memberDeclaration, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SemanticsFactsService\AbstractSemanticFactsService.cs (36)
40SemanticModel semanticModel, SyntaxNode location, SyntaxNode containerOpt, 48SemanticModel semanticModel, SyntaxNode location, SyntaxNode containerOpt, 56SemanticModel semanticModel, SyntaxNode location, SyntaxNode containerOpt, 64SemanticModel semanticModel, SyntaxNode location, SyntaxNode containerOpt, 73SyntaxNode location, SyntaxNode containerOpt, 77var container = containerOpt ?? location.AncestorsAndSelf().FirstOrDefault( 91protected virtual IEnumerable<ISymbol> GetCollidableSymbols(SemanticModel semanticModel, SyntaxNode location, SyntaxNode container, CancellationToken cancellationToken) 179public bool IsWrittenTo(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken) 182public bool IsOnlyWrittenTo(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken) 185public bool IsInOutContext(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken) 188public bool IsInRefContext(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken) 191public bool IsInInContext(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken) 194public bool CanReplaceWithRValue(SemanticModel semanticModel, SyntaxNode expression, CancellationToken cancellationToken) 203public bool TryGetSpeculativeSemanticModel(SemanticModel oldSemanticModel, SyntaxNode oldNode, SyntaxNode newNode, out SemanticModel speculativeModel) 209public ForEachSymbols GetForEachSymbols(SemanticModel semanticModel, SyntaxNode forEachStatement) 212public SymbolInfo GetCollectionInitializerSymbolInfo(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken) 215public IMethodSymbol GetGetAwaiterMethod(SemanticModel semanticModel, SyntaxNode node) 218public ImmutableArray<IMethodSymbol> GetDeconstructionAssignmentMethods(SemanticModel semanticModel, SyntaxNode node) 221public ImmutableArray<IMethodSymbol> GetDeconstructionForEachMethods(SemanticModel semanticModel, SyntaxNode node) 227public IEnumerable<ISymbol> GetDeclaredSymbols(SemanticModel semanticModel, SyntaxNode memberDeclaration, CancellationToken cancellationToken) 230public IParameterSymbol FindParameterForArgument(SemanticModel semanticModel, SyntaxNode argumentNode, bool allowUncertainCandidates, bool allowParams, CancellationToken cancellationToken) 233public IParameterSymbol FindParameterForAttributeArgument(SemanticModel semanticModel, SyntaxNode argumentNode, bool allowUncertainCandidates, bool allowParams, CancellationToken cancellationToken) 236public ISymbol FindFieldOrPropertyForArgument(SemanticModel semanticModel, SyntaxNode argumentNode, CancellationToken cancellationToken) 239public ISymbol FindFieldOrPropertyForAttributeArgument(SemanticModel semanticModel, SyntaxNode argumentNode, CancellationToken cancellationToken) 242public ImmutableArray<ISymbol> GetBestOrAllSymbols(SemanticModel semanticModel, SyntaxNode node, SyntaxToken token, CancellationToken cancellationToken) 245public bool IsInsideNameOfExpression(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken) 251public bool IsInExpressionTree(SemanticModel semanticModel, SyntaxNode node, INamedTypeSymbol expressionTypeOpt, CancellationToken cancellationToken) 254public string GenerateNameForExpression(SemanticModel semanticModel, SyntaxNode expression, bool capitalize, CancellationToken cancellationToken) 257public IPreprocessingSymbol GetPreprocessingSymbol(SemanticModel semanticModel, SyntaxNode node)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SemanticsFactsService\ISemanticFactsService.cs (12)
27SemanticModel semanticModel, SyntaxNode location, 28SyntaxNode? container, string baseName, CancellationToken cancellationToken); 31SemanticModel semanticModel, SyntaxNode location, 32SyntaxNode? container, string baseName, IEnumerable<string> usedNames, CancellationToken cancellationToken); 34SyntaxToken GenerateUniqueName(SemanticModel semanticModel, SyntaxNode location, SyntaxNode? container, string baseName, 38SemanticModel semanticModel, SyntaxNode location, 39SyntaxNode? container, string baseName, CancellationToken cancellationToken); 42SemanticModel semanticModel, SyntaxNode location, 43SyntaxNode? container, string baseName, IEnumerable<string> usedNames, CancellationToken cancellationToken); 47CommonConversion ClassifyConversion(SemanticModel semanticModel, SyntaxNode expression, ITypeSymbol destination); 49IMethodSymbol? TryGetDisposeMethod(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SyntaxFactsService\ISyntaxFactsService.cs (4)
20Task<ImmutableArray<SyntaxNode>> GetSelectedFieldsAndPropertiesAsync(SyntaxTree syntaxTree, TextSpan textSpan, bool allowPartialSelection, CancellationToken cancellationToken); 28SyntaxNode root, TContextNode contextNode, 29out SyntaxNode newRoot, out TContextNode newContextNode) where TContextNode : SyntaxNode;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SyntaxGeneratorInternalExtensions\SyntaxGeneratorInternal.cs (68)
36public abstract SyntaxNode LocalDeclarationStatement( 37SyntaxNode? type, SyntaxToken identifier, SyntaxNode? initializer = null, bool isConst = false); 42public SyntaxNode LocalDeclarationStatement(SyntaxToken name, SyntaxNode initializer) 45public abstract SyntaxNode WithInitializer(SyntaxNode variableDeclarator, SyntaxNode initializer); 47public abstract SyntaxNode EqualsValueClause(SyntaxToken operatorToken, SyntaxNode value); 51public abstract SyntaxNode ConditionalAccessExpression(SyntaxNode expression, SyntaxNode whenNotNull); 53public abstract SyntaxNode MemberBindingExpression(SyntaxNode name); 55public abstract SyntaxNode RefExpression(SyntaxNode expression); 60public abstract SyntaxNode AddParentheses(SyntaxNode expression, bool includeElasticTrivia = true, bool addSimplifierAnnotation = true); 66public abstract SyntaxNode YieldReturnStatement(SyntaxNode expression); 71/// <see cref="LocalDeclarationStatement(SyntaxNode, SyntaxToken, SyntaxNode, bool)"/>. 77public abstract SyntaxNode InterpolatedStringText(SyntaxToken textToken); 78public abstract SyntaxNode Interpolation(SyntaxNode syntaxNode); 79public abstract SyntaxNode InterpolatedStringExpression(SyntaxToken startToken, IEnumerable<SyntaxNode> content, SyntaxToken endToken); 80public abstract SyntaxNode InterpolationAlignmentClause(SyntaxNode alignment); 81public abstract SyntaxNode InterpolationFormatClause(string format); 82public abstract SyntaxNode TypeParameterList(IEnumerable<string> typeParameterNames); 99public abstract SyntaxNode Type(ITypeSymbol typeSymbol, bool typeContext); 101public abstract SyntaxNode NegateEquality(SyntaxGenerator generator, SyntaxNode binaryExpression, SyntaxNode left, BinaryOperatorKind negatedKind, SyntaxNode right); 103public abstract SyntaxNode IsNotTypeExpression(SyntaxNode expression, SyntaxNode type); 108public abstract SyntaxNode IsPatternExpression(SyntaxNode expression, SyntaxToken isToken, SyntaxNode pattern); 110public abstract SyntaxNode AndPattern(SyntaxNode left, SyntaxNode right); 111public abstract SyntaxNode ConstantPattern(SyntaxNode expression); 112public abstract SyntaxNode DeclarationPattern(INamedTypeSymbol type, string name); 113public abstract SyntaxNode GreaterThanRelationalPattern(SyntaxNode expression); 114public abstract SyntaxNode GreaterThanEqualsRelationalPattern(SyntaxNode expression); 115public abstract SyntaxNode LessThanRelationalPattern(SyntaxNode expression); 116public abstract SyntaxNode LessThanEqualsRelationalPattern(SyntaxNode expression); 117public abstract SyntaxNode NotPattern(SyntaxNode pattern); 118public abstract SyntaxNode OrPattern(SyntaxNode left, SyntaxNode right); 119public abstract SyntaxNode ParenthesizedPattern(SyntaxNode pattern); 120public abstract SyntaxNode TypePattern(SyntaxNode type); 121public abstract SyntaxNode UnaryPattern(SyntaxToken operatorToken, SyntaxNode pattern);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\AbstractTypeInferenceService.AbstractTypeInferrer.cs (6)
24private readonly HashSet<SyntaxNode> _seenExpressionInferType = []; 25private readonly HashSet<SyntaxNode> _seenExpressionGetType = []; 37protected abstract IEnumerable<TypeInferenceInfo> InferTypesWorker_DoNotCallDirectly(SyntaxNode expression); 38protected abstract IEnumerable<TypeInferenceInfo> GetTypes_DoNotCallDirectly(SyntaxNode expression, bool objectAsDefault); 49public ImmutableArray<TypeInferenceInfo> InferTypes(SyntaxNode expression, bool filterUnusable = true) 63protected IEnumerable<TypeInferenceInfo> GetTypes(SyntaxNode expression, bool objectAsDefault = false)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\AbstractTypeInferenceService.cs (2)
94SemanticModel semanticModel, SyntaxNode expression, 114SemanticModel semanticModel, SyntaxNode expression,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\ITypeInferenceService.cs (2)
29ImmutableArray<ITypeSymbol> InferTypes(SemanticModel semanticModel, SyntaxNode expression, string nameOpt, CancellationToken cancellationToken); 33ImmutableArray<TypeInferenceInfo> GetTypeInferenceInfo(SemanticModel semanticModel, SyntaxNode expression, string nameOpt, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (31)
26where TCompilationUnitSyntax : SyntaxNode 27where TExpressionSyntax : SyntaxNode 28where TStatementSyntax : SyntaxNode 29where TCrefSyntax : SyntaxNode 31protected static readonly Func<SyntaxNode, bool> s_containsAnnotations = n => n.ContainsAnnotations; 39protected abstract ImmutableArray<NodeOrTokenToReduce> GetNodesAndTokensToReduce(SyntaxNode root, Func<SyntaxNodeOrToken, bool> isNodeOrTokenOutsideSimplifySpans); 40protected abstract SemanticModel GetSpeculativeSemanticModel(ref SyntaxNode nodeToSpeculate, SemanticModel originalSemanticModel, SyntaxNode originalNode); 41protected abstract bool NodeRequiresNonSpeculativeSemanticModel(SyntaxNode node); 42protected abstract void AddImportDeclarations(TCompilationUnitSyntax root, ArrayBuilder<SyntaxNode> importDeclarations); 47protected virtual SyntaxNode TransformReducedNode(SyntaxNode reducedNode, SyntaxNode originalNode) 50public abstract SyntaxNode Expand(SyntaxNode node, SemanticModel semanticModel, SyntaxAnnotation? annotationForReplacedAliasIdentifier, Func<SyntaxNode, bool>? expandInsideNode, bool expandParameter, CancellationToken cancellationToken); 51public abstract SyntaxToken Expand(SyntaxToken token, SemanticModel semanticModel, Func<SyntaxNode, bool>? expandInsideNode, CancellationToken cancellationToken); 76var root = await semanticModel.SyntaxTree.GetRootAsync(cancellationToken).ConfigureAwait(false); 137var reducedNodesMap = new ConcurrentDictionary<SyntaxNode, SyntaxNode>(); 174SyntaxNode root, 178ConcurrentDictionary<SyntaxNode, SyntaxNode> reducedNodesMap, 240var replacedParent = isNode 251var currentNode = currentNodeOrToken.AsNode()!; 256var newRoot = root.ReplaceNode(nodeOrToken.AsNode()!, currentNode.WithAdditionalAnnotations(marker)); 299using var _ = ArrayBuilder<SyntaxNode>.GetInstance(out var importDeclarations); 314var root = await model.SyntaxTree.GetRootAsync(cancellationToken).ConfigureAwait(false); 316var unusedImports = new HashSet<SyntaxNode>(); 325var newRoot = gen.RemoveNodes(root, unusedImports); 334protected abstract void GetUnusedNamespaceImports(SemanticModel model, HashSet<SyntaxNode> namespaceImports, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\ISimplificationService.cs (4)
16SyntaxNode Expand( 17SyntaxNode node, 20Func<SyntaxNode, bool>? expandInsideNode, 27Func<SyntaxNode, bool>? expandInsideNode,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\SimplificationHelpers.cs (4)
18public static TNode CopyAnnotations<TNode>(SyntaxNode from, TNode to) where TNode : SyntaxNode 64public static ISymbol? GetOriginalSymbolInfo(SemanticModel semanticModel, SyntaxNode expression) 100public static bool IsNamespaceOrTypeOrThisParameter(SyntaxNode expression, SemanticModel semanticModel)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\Simplifiers\AbstractMemberAccessExpressionSimplifier.cs (1)
18where TExpressionSyntax : SyntaxNode
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\Simplifiers\AbstractSimplifier.cs (2)
12where TSyntax : SyntaxNode 13where TSimplifiedSyntax : SyntaxNode
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\ParsedDocument.cs (5)
28internal readonly record struct ParsedDocument(DocumentId Id, SourceText Text, SyntaxNode Root, HostLanguageServices HostLanguageServices) 38var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 46var root = document.GetRequiredSyntaxRootSynchronously(cancellationToken); 53var root = SyntaxTree.WithChangedText(text).GetRoot(cancellationToken); 57public ParsedDocument WithChangedRoot(SyntaxNode root, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\SemanticDocument.cs (3)
12internal sealed class SemanticDocument(Document document, SourceText text, SyntaxNode root, SemanticModel semanticModel) 20var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 25public new async ValueTask<SemanticDocument> WithSyntaxRootAsync(SyntaxNode root, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\SyntacticDocument.cs (4)
16public readonly SyntaxNode Root; 18protected SyntacticDocument(Document document, SourceText text, SyntaxNode root) 31var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 35public ValueTask<SyntacticDocument> WithSyntaxRootAsync(SyntaxNode root, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\WorkspaceServices\SemanticModelReuse\ISemanticModelReuseWorkspaceService.cs (2)
19/// Don't call this directly. use <see cref="DocumentExtensions.ReuseExistingSpeculativeModelAsync(Document, SyntaxNode, CancellationToken)"/> (or an overload). 21ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(Document document, SyntaxNode node, CancellationToken cancellationToken);
Utilities\WorkspacePathUtilities.cs (1)
26public static bool TypeNameMatchesDocumentName(Document document, SyntaxNode typeDeclaration, ISyntaxFacts syntaxFacts)
Workspace\Host\SyntaxTreeFactory\AbstractSyntaxTreeFactoryService.cs (1)
20public abstract SyntaxTree CreateSyntaxTree(string filePath, ParseOptions options, SourceText text, Encoding encoding, SourceHashAlgorithm checksumAlgorithm, SyntaxNode root);
Workspace\Host\SyntaxTreeFactory\ISyntaxTreeFactoryService.cs (1)
30SyntaxTree CreateSyntaxTree(string? filePath, ParseOptions options, SourceText? text, Encoding? encoding, SourceHashAlgorithm checksumAlgorithm, SyntaxNode root);
Workspace\Solution\Document.cs (5)
213public bool TryGetSyntaxRoot([NotNullWhen(returnValue: true)] out SyntaxNode? root) 223/// The returned <see cref="SyntaxNode"/> will be <see langword="null"/> if <see 227public async Task<SyntaxNode?> GetSyntaxRootAsync(CancellationToken cancellationToken = default) 243internal SyntaxNode? GetSyntaxRootSynchronously(CancellationToken cancellationToken) 397public Document WithSyntaxRoot(SyntaxNode root)
Workspace\Solution\DocumentState.cs (3)
488internal DocumentState UpdateTree(SyntaxNode newRoot, PreservationMode mode) 532SyntaxNode newRoot, 555private VersionStamp GetNewTreeVersionForUpdatedTree(SyntaxNode newRoot, VersionStamp newTextVersion, PreservationMode mode)
Workspace\Solution\DocumentState_LinkedFileReuse.cs (1)
132SyntaxNode siblingRoot,
Workspace\Solution\Project.cs (1)
699public Document AddDocument(string name, SyntaxNode syntaxRoot, IEnumerable<string>? folders = null, string? filePath = null)
Workspace\Solution\Solution.cs (4)
964/// document instance defined by its name and root <see cref="SyntaxNode"/>. 966public Solution AddDocument(DocumentId documentId, string name, SyntaxNode syntaxRoot, IEnumerable<string>? folders = null, string? filePath = null, bool isGenerated = false, PreservationMode preservationMode = PreservationMode.PreserveValue) 1366public Solution WithDocumentSyntaxRoot(DocumentId documentId, SyntaxNode root, PreservationMode mode = PreservationMode.PreserveValue) 1370internal Solution WithDocumentSyntaxRoots(ImmutableArray<(DocumentId documentId, SyntaxNode root)> syntaxRoots, PreservationMode mode = PreservationMode.PreserveValue)
Workspace\Solution\SolutionCompilationState.cs (3)
949/// <inheritdoc cref="Solution.WithDocumentSyntaxRoots(ImmutableArray{ValueTuple{DocumentId, SyntaxNode}}, PreservationMode)"/> 950public SolutionCompilationState WithDocumentSyntaxRoots(ImmutableArray<(DocumentId documentId, SyntaxNode root)> syntaxRoots, PreservationMode mode) 952return UpdateDocumentsInMultipleProjects<DocumentState, SyntaxNode, PreservationMode>(
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (6)
VisualStudioMSBuildWorkspaceTests.cs (6)
62var type = tree.GetRoot().DescendantTokens().First(t => t.ToString() == "class").Parent; 339var root = await d1.GetSyntaxRootAsync(); 342var newRoot = root.ReplaceNode(decl, newDecl); 440var type = tree.GetRoot().DescendantTokens().First(t => t.ToString() == "class").Parent; 2848var type = tree.GetRoot().DescendantTokens().First(t => t.ToString() == "class").Parent; 2906var root = await document.GetSyntaxRootAsync();
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (6)
Formatting\FormattingTestBase.cs (6)
64protected abstract SyntaxNode ParseCompilation(string text, ParseOptions? parseOptions); 67SolutionServices services, string expected, SyntaxNode root, IEnumerable<TextSpan> spans, SyntaxFormattingOptions options, bool treeCompare = true, ParseOptions? parseOptions = null) 69var newRootNode = Formatter.Format(root, spans, services, options, rules: default, CancellationToken.None); 74var newRootNodeFromString = ParseCompilation(expected, parseOptions); 83private static async Task AssertFormatAsync(SolutionServices services, string expected, SyntaxNode root, ImmutableArray<TextSpan> spans, SyntaxFormattingOptions options, SourceText sourceText) 93var resultRoot = await root.SyntaxTree.WithChangedText(resultText).GetRootAsync();
Microsoft.CodeAnalysis.Workspaces.UnitTests (143)
BatchFixAllProviderTests.cs (1)
125var root = await tree.GetRootAsync(cancellationToken);
CodeCleanup\CodeCleanupTests.cs (18)
59var root = await document.GetSyntaxRootAsync(); 69var root = await document.GetSyntaxRootAsync(); 113var root = await document.GetSyntaxRootAsync(); 124var root = await document.GetSyntaxRootAsync(); 176var root = await document.GetSyntaxRootAsync(cancellationToken); 195var root = await document.GetSyntaxRootAsync(cancellationToken); 196var @class = root.GetMember(0); 197var classWithMember = @class.AddCSharpMember(CreateCSharpMethod(), 0); 216var root = await document.GetSyntaxRootAsync(cancellationToken); 217var @class = root.GetMember(0).GetMember(0); 218var classWithMember = @class.AddCSharpMember(CreateCSharpMethod(), 0); 237var root = await document.GetSyntaxRootAsync(cancellationToken); 238var @class = root.GetMember(0).GetMember(0); 239var classWithMember = @class.RemoveCSharpMember(0); 301var root = await document.GetSyntaxRootAsync(); 308var newRoot = await newDocument.GetSyntaxRootAsync(); 348var root = await document.GetSyntaxRootAsync(cancellationToken); 349var member = root.GetMember(0).GetMember(0).GetMember(0);
CodeCleanup\Extensions.cs (9)
18public static TextSpan GetCodeCleanupSpan(this SyntaxNode node) 26public static T GetMember<T>(this Document document, int index) where T : SyntaxNode 29public static T GetMember<T>(this T node, int index) where T : SyntaxNode 35public static T RemoveCSharpMember<T>(this T node, int index) where T : SyntaxNode 43public static T AddCSharpMember<T>(this T node, CSharp.Syntax.MemberDeclarationSyntax member, int index) where T : SyntaxNode 51public static IEnumerable<M> RemoveMember<M>(this SyntaxNode node, int index) where M : SyntaxNode 61public static IEnumerable<M> AddMember<M>(this SyntaxNode node, M member, int index) 62where M : SyntaxNode
CodeCleanup\MockCodeCleanupProvider.cs (4)
24public Func<SyntaxNode, ImmutableArray<TextSpan>, SyntaxFormattingOptions, SolutionServices, SyntaxNode>? CleanupNodeImpl { get; set; } 31public Task<SyntaxNode> CleanupAsync(SyntaxNode root, ImmutableArray<TextSpan> spans, SyntaxFormattingOptions options, SolutionServices services, CancellationToken cancellationToken)
CommandLineProject\CommandLineProjectWorkspaceTests.cs (1)
45var tree = await gooDoc.GetSyntaxRootAsync();
Editing\SyntaxEditorTests.cs (24)
25private void VerifySyntax<TSyntax>(SyntaxNode node, string expectedText) where TSyntax : SyntaxNode 30var formatted = Formatter.Format(node, EmptyWorkspace.Services.SolutionServices, options, CancellationToken.None); 35private SyntaxEditor GetEditor(SyntaxNode root) 51var fieldX = editor.Generator.GetMembers(cls)[0]; 53var newRoot = editor.GetChangedRoot(); 77var fieldX = editor.Generator.GetMembers(cls)[0]; 79var newRoot = editor.GetChangedRoot(); 102var fieldX = editor.Generator.GetMembers(cls)[0]; 104var newRoot = editor.GetChangedRoot(); 129var fieldX = editor.Generator.GetMembers(cls)[0]; 131var newRoot = editor.GetChangedRoot(); 156var fieldX = editor.Generator.GetMembers(cls)[0]; 158var newRoot = editor.GetChangedRoot(); 160var currentFieldX = newRoot.GetCurrentNode(fieldX); 177var fieldX = editor.Generator.GetMembers(cls)[0]; 181var newRoot = editor.GetChangedRoot(); 229var attribute = syntaxGenerator.Attribute("Example", args); 231var newRoot = editor.GetChangedRoot(); 273var attribute = syntaxGenerator.Attribute("Example", args); 275var newRoot = editor.GetChangedRoot(); 312var methodX = editor.Generator.GetMembers(cls)[0]; 316var attribute = syntaxGenerator.Attribute("Example", args); 318var newRoot = editor.GetChangedRoot();
FindReferencesTests.cs (4)
183SyntaxNode declareMethod = tree.GetRoot().DescendantNodes().OfType<Microsoft.CodeAnalysis.VisualBasic.Syntax.DeclareStatementSyntax>().FirstOrDefault(); 184SyntaxNode normalMethod = tree.GetRoot().DescendantNodes().OfType<Microsoft.CodeAnalysis.VisualBasic.Syntax.MethodStatementSyntax>().ToList()[1]; 287SyntaxNode declareMethod = methodlist.ElementAt(0); 288SyntaxNode normalMethod = methodlist.ElementAt(2);
FormattingTests.cs (1)
86var formattedRoot = Formatter.Format(tree.GetRoot(), workspace.Services.SolutionServices, options, CancellationToken.None);
Simplifier\SimplifierTests.cs (2)
38await Assert.ThrowsAsync<ArgumentNullException>("node", () => Simplifier.ExpandAsync<SyntaxNode>(node: null!, document: null!)); 49Assert.Throws<ArgumentNullException>("node", () => Simplifier.Expand<SyntaxNode>(node: null!, semanticModel: null!, services: null!));
SolutionTests\SolutionTests.cs (27)
307var root = tree.GetRoot(); 310Assert.True(newSolution1.GetDocument(documentId)!.TryGetSyntaxRoot(out var actualRoot)); 2483var root = CSharp.SyntaxFactory.ParseSyntaxTree(SourceText.From("class C {}", encoding: null, SourceHashAlgorithm.Sha1)).GetRoot(); 3145var root = await document.GetSyntaxRootAsync(); 3188var root = tree.GetRoot(); 3191var annotatedRoot = root.WithAdditionalAnnotations(annotation); 3196var root2 = tree2.GetRoot(); 3230var syntaxRoot = await document.GetSyntaxRootAsync(CancellationToken.None); 3232SyntaxNode newSyntaxRoot; 3432var tree = CSharp.SyntaxFactory.ParseSyntaxTree("public class C {}").GetRoot(CancellationToken.None); 3441var docTree = doc.GetSyntaxRootAsync().Result; 3462var docRoot = await doc.GetSyntaxRootAsync(); 3588private static ObjectReference<SyntaxNode> GetObservedSyntaxTreeRoot(Solution solution, DocumentId documentId) 3590var observedTree = solution.GetDocument(documentId).GetSyntaxRootAsync().Result; 3591return new ObjectReference<SyntaxNode>(observedTree); 3614private static ObjectReference<SyntaxNode> GetObservedSyntaxTreeRootAsync(Solution solution, DocumentId documentId) 3616var observedTree = solution.GetDocument(documentId).GetSyntaxRootAsync().Result; 3617return new ObjectReference<SyntaxNode>(observedTree); 3687var root = tree.GetRoot(); 3693var newRoot = doc.GetSyntaxRootAsync().Result.WithAdditionalAnnotations(SyntaxAnnotation.ElasticAnnotation); 3704var root2 = tree2.GetRoot(); 3792var newRoot = (language == LanguageNames.CSharp) ? CS.SyntaxFactory.ParseCompilationUnit(""" 3797""") : (SyntaxNode)VB.SyntaxFactory.ParseCompilationUnit(""" 3996var root = doc.GetSyntaxRootAsync().Result; 3997var newRoot = root.WithLeadingTrivia(root.GetLeadingTrivia().Add(CS.SyntaxFactory.Whitespace(" "))); 5436var root = await doc.GetSyntaxRootAsync(); 5437var newRoot = root.WithAdditionalAnnotations(new SyntaxAnnotation());
SymbolKeyTests.cs (7)
1274var root = tree.GetRoot(); 1494SemanticModel model, Func<SyntaxNode, bool> predicate = null) 1502SemanticModel model, SyntaxNode node, 1503List<ISymbol> list, Func<SyntaxNode, bool> predicate) 1555var node = declaringLocation.GetSyntax(); 1569private static void GetInteriorSymbols(SemanticModel model, SyntaxNode root, List<ISymbol> symbols) 1571foreach (var token in root.DescendantNodes())
SyntaxNodeTests.cs (10)
30var root = tree.GetRoot(); 36return Task.FromResult<SyntaxNode>(decl.WithIdentifier(SyntaxFactory.Identifier("Y"))); 51var root = tree.GetRoot(); 61return Task.FromResult<SyntaxNode>(classDecl.WithIdentifier(SyntaxFactory.Identifier(id.LeadingTrivia, id.ToString() + "1", id.TrailingTrivia))); 67return Task.FromResult<SyntaxNode>(varDecl.WithIdentifier(SyntaxFactory.Identifier(id.LeadingTrivia, id.ToString() + "1", id.TrailingTrivia))); 94var root = await doc.GetSyntaxRootAsync(); 99var trackedRoot = root.TrackNodes(classDecl, methodDecl); 103var cgenField = gen.FieldDeclaration("X", gen.TypeExpression(SpecialType.System_Int32), Accessibility.Private); 106var classDeclWithField = gen.InsertMembers(currentClassDecl, 0, [cgenField]); 119var root2 = await doc.GetSyntaxRootAsync();
SyntaxPathTests.cs (31)
24Assert.True(path.TryResolve(node, out SyntaxNode recovered)); 34Assert.False(path.TryResolve(SyntaxFactory.ParseExpression("Goo()"), out SyntaxNode _)); 43Assert.True(path.TryResolve(node, out SyntaxNode recovered)); 54Assert.False(path.TryResolve(root2, out SyntaxNode _)); 64Assert.False(path.TryResolve(root2, out SyntaxNode _)); 81var root = tree.GetRoot(); 83Assert.True(path.TryResolve(tree, CancellationToken.None, out SyntaxNode node)); 97Assert.True(path.TryResolve(newTree, CancellationToken.None, out SyntaxNode node)); 106var root = tree.GetRoot(); 111Assert.True(path.TryResolve(newTree, CancellationToken.None, out SyntaxNode node)); 120var root = tree.GetRoot(); 124Assert.True(path.TryResolve(tree, CancellationToken.None, out SyntaxNode node)); 159Assert.True(path1.TryResolve(tree, CancellationToken.None, out SyntaxNode n1)); 160Assert.True(path2.TryResolve(tree, CancellationToken.None, out SyntaxNode n2)); 161Assert.True(path3.TryResolve(tree, CancellationToken.None, out SyntaxNode n3)); 193Assert.True(path1.TryResolve(tree, CancellationToken.None, out SyntaxNode n1)); 194Assert.True(path2.TryResolve(tree, CancellationToken.None, out SyntaxNode n2)); 228Assert.True(path1.TryResolve(tree, CancellationToken.None, out SyntaxNode n1)); 229Assert.True(path2.TryResolve(tree, CancellationToken.None, out SyntaxNode n2)); 258Assert.True(path1.TryResolve(tree, CancellationToken.None, out SyntaxNode n1)); 259Assert.False(path2.TryResolve(tree, CancellationToken.None, out SyntaxNode _)); 288Assert.True(path1.TryResolve(tree, CancellationToken.None, out SyntaxNode n1)); 289Assert.False(path2.TryResolve(tree, CancellationToken.None, out SyntaxNode _)); 290Assert.False(path3.TryResolve(tree, CancellationToken.None, out SyntaxNode _)); 317Assert.True(path1.TryResolve(tree, CancellationToken.None, out SyntaxNode n1)); 318Assert.True(path2.TryResolve(tree, CancellationToken.None, out SyntaxNode n2)); 346Assert.True(path1.TryResolve(tree, CancellationToken.None, out SyntaxNode n1)); 347Assert.True(path2.TryResolve(tree, CancellationToken.None, out SyntaxNode n2)); 385Assert.True(path1.TryResolve(tree, CancellationToken.None, out SyntaxNode n1)); 386Assert.True(path2.TryResolve(tree, CancellationToken.None, out SyntaxNode n2)); 404Assert.True(path.TryResolve(newTree, CancellationToken.None, out SyntaxNode node));
UtilityTest\FormattingRangeHelperTests.cs (2)
19var root = SyntaxFactory.ParseSyntaxTree("{Foo();}").GetRoot(); 29var root = SyntaxFactory.ParseSyntaxTree("{Fizz();\nBuzz();}").GetRoot();
WorkspaceTests\AdhocWorkspaceTests.cs (2)
344var root = await doc.GetSyntaxRootAsync(); 345var newRoot = root.WithAdditionalAnnotations(new SyntaxAnnotation());
Microsoft.DotNet.GenFacades (10)
NotSupportedAssemblyGenerator.cs (10)
88SyntaxNode root = rewriter.Visit(syntaxTree.GetRoot()); 113public override SyntaxNode VisitMethodDeclaration(MethodDeclarationSyntax node) 133public override SyntaxNode VisitPropertyDeclaration(PropertyDeclarationSyntax node) 141public override SyntaxNode VisitEventDeclaration(EventDeclarationSyntax node) 149public override SyntaxNode VisitClassDeclaration(ClassDeclarationSyntax node) 157public override SyntaxNode VisitConstructorDeclaration(ConstructorDeclarationSyntax node) 163public override SyntaxNode VisitDestructorDeclaration(DestructorDeclarationSyntax node) 169public override SyntaxNode VisitAccessorDeclaration(AccessorDeclarationSyntax node) 180public override SyntaxNode VisitOperatorDeclaration(OperatorDeclarationSyntax node) 189public override SyntaxNode VisitConversionOperatorDeclaration(ConversionOperatorDeclarationSyntax node)
Microsoft.Extensions.Logging.Generators (2)
LoggerMessageGenerator.Parser.cs (1)
502SyntaxNode? potentialNamespaceParent = classDec.Parent;
LoggerMessageGenerator.Roslyn3.11.cs (1)
64private static bool IsSyntaxTargetForGeneration(SyntaxNode node) =>
Microsoft.Extensions.Options.SourceGeneration (1)
TypeDeclarationSyntaxReceiver.cs (1)
23public void OnVisitSyntaxNode(SyntaxNode syntaxNode)
Microsoft.Gen.ComplianceReports (10)
src\Generators\Shared\GeneratorUtilities.cs (9)
46Action<Compilation, IEnumerable<SyntaxNode>, SourceProductionContext> process) => Initialize(context, fullyQualifiedAttributeNames, x => x, process); 52Func<SyntaxNode, SyntaxNode?> transform, 53Action<Compilation, IEnumerable<SyntaxNode>, SourceProductionContext> process) 86static bool Predicate(SyntaxNode node, HashSet<string> shortAttributeNames) 105static SyntaxNode? Filter(GeneratorSyntaxContext context, HashSet<string> fullyQualifiedAttributeNames, Func<SyntaxNode, SyntaxNode?> transform, CancellationToken cancellationToken) 113var node = attributeSyntax.Parent?.Parent;
src\Generators\Shared\TypeDeclarationSyntaxReceiver.cs (1)
28public void OnVisitSyntaxNode(SyntaxNode syntaxNode)
Microsoft.Gen.ContextualOptions (13)
ContextReceiver.cs (1)
26public void OnVisitSyntaxNode(SyntaxNode syntaxNode)
ContextualOptionsGenerator.cs (3)
18IncrementalValuesProvider<SyntaxNode> typeDeclarations = context.SyntaxProvider 24IncrementalValueProvider<(Compilation, ImmutableArray<SyntaxNode>)> compilationAndTypes = 30private static void HandleAnnotatedTypes(Compilation compilation, IEnumerable<SyntaxNode> nodes, SourceProductionContext context)
src\Generators\Shared\GeneratorUtilities.cs (9)
46Action<Compilation, IEnumerable<SyntaxNode>, SourceProductionContext> process) => Initialize(context, fullyQualifiedAttributeNames, x => x, process); 52Func<SyntaxNode, SyntaxNode?> transform, 53Action<Compilation, IEnumerable<SyntaxNode>, SourceProductionContext> process) 86static bool Predicate(SyntaxNode node, HashSet<string> shortAttributeNames) 105static SyntaxNode? Filter(GeneratorSyntaxContext context, HashSet<string> fullyQualifiedAttributeNames, Func<SyntaxNode, SyntaxNode?> transform, CancellationToken cancellationToken) 113var node = attributeSyntax.Parent?.Parent;
Microsoft.Gen.Logging (13)
Parsing\Parser.cs (1)
289SyntaxNode? potentialNamespaceParent = typeDec.Parent;
Parsing\Parser.LogProperties.cs (1)
75var syntax = property.DeclaringSyntaxReferences[0].GetSyntax(token);
src\Generators\Shared\ClassDeclarationSyntaxReceiver.cs (1)
28public void OnVisitSyntaxNode(SyntaxNode syntaxNode)
src\Generators\Shared\GeneratorUtilities.cs (9)
46Action<Compilation, IEnumerable<SyntaxNode>, SourceProductionContext> process) => Initialize(context, fullyQualifiedAttributeNames, x => x, process); 52Func<SyntaxNode, SyntaxNode?> transform, 53Action<Compilation, IEnumerable<SyntaxNode>, SourceProductionContext> process) 86static bool Predicate(SyntaxNode node, HashSet<string> shortAttributeNames) 105static SyntaxNode? Filter(GeneratorSyntaxContext context, HashSet<string> fullyQualifiedAttributeNames, Func<SyntaxNode, SyntaxNode?> transform, CancellationToken cancellationToken) 113var node = attributeSyntax.Parent?.Parent;
src\Generators\Shared\TypeDeclarationSyntaxReceiver.cs (1)
28public void OnVisitSyntaxNode(SyntaxNode syntaxNode)
Microsoft.Gen.Metrics (13)
MetricsGenerator.cs (1)
31private static void HandleAnnotatedTypes(Compilation compilation, IEnumerable<SyntaxNode> nodes, SourceProductionContext context)
Parser.cs (1)
107SyntaxNode? potentialNamespaceParent = typeDeclaration.Parent;
src\Generators\Shared\ClassDeclarationSyntaxReceiver.cs (1)
28public void OnVisitSyntaxNode(SyntaxNode syntaxNode)
src\Generators\Shared\GeneratorUtilities.cs (9)
46Action<Compilation, IEnumerable<SyntaxNode>, SourceProductionContext> process) => Initialize(context, fullyQualifiedAttributeNames, x => x, process); 52Func<SyntaxNode, SyntaxNode?> transform, 53Action<Compilation, IEnumerable<SyntaxNode>, SourceProductionContext> process) 86static bool Predicate(SyntaxNode node, HashSet<string> shortAttributeNames) 105static SyntaxNode? Filter(GeneratorSyntaxContext context, HashSet<string> fullyQualifiedAttributeNames, Func<SyntaxNode, SyntaxNode?> transform, CancellationToken cancellationToken) 113var node = attributeSyntax.Parent?.Parent;
src\Generators\Shared\TypeDeclarationSyntaxReceiver.cs (1)
28public void OnVisitSyntaxNode(SyntaxNode syntaxNode)
Microsoft.Gen.MetricsReports (11)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (1)
107SyntaxNode? potentialNamespaceParent = typeDeclaration.Parent;
src\Generators\Shared\ClassDeclarationSyntaxReceiver.cs (1)
28public void OnVisitSyntaxNode(SyntaxNode syntaxNode)
src\Generators\Shared\GeneratorUtilities.cs (9)
46Action<Compilation, IEnumerable<SyntaxNode>, SourceProductionContext> process) => Initialize(context, fullyQualifiedAttributeNames, x => x, process); 52Func<SyntaxNode, SyntaxNode?> transform, 53Action<Compilation, IEnumerable<SyntaxNode>, SourceProductionContext> process) 86static bool Predicate(SyntaxNode node, HashSet<string> shortAttributeNames) 105static SyntaxNode? Filter(GeneratorSyntaxContext context, HashSet<string> fullyQualifiedAttributeNames, Func<SyntaxNode, SyntaxNode?> transform, CancellationToken cancellationToken) 113var node = attributeSyntax.Parent?.Parent;
Microsoft.Interop.ComInterfaceGenerator (30)
Analyzers\AddGeneratedComClassFixer.cs (4)
24private static Task AddGeneratedComClassAsync(DocumentEditor editor, SyntaxNode node) 28var attribute = gen.Attribute(gen.TypeExpression(editor.SemanticModel.Compilation.GetBestTypeByMetadataName(TypeNames.GeneratedComClassAttribute)).WithAdditionalAnnotations(Simplifier.AddImportsAnnotation)); 29var updatedNode = gen.AddAttributes(node, attribute); 43protected override Func<DocumentEditor, CancellationToken, Task> CreateFixForSelectedOptions(SyntaxNode node, ImmutableDictionary<string, Option> selectedOptions)
Analyzers\AddMarshalAsToElementFixer.cs (3)
26SyntaxNode? root = await doc.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 30SyntaxNode node = root.FindNode(context.Span); 51SyntaxNode marshalAsAttribute = gen.Attribute(
Analyzers\ConvertComImportToGeneratedComInterfaceFixer.cs (6)
35protected override Func<DocumentEditor, CancellationToken, Task> CreateFixForSelectedOptions(SyntaxNode node, ImmutableDictionary<string, Option> selectedOptions) 72private static async Task ConvertComImportToGeneratedComInterfaceAsync(DocumentEditor editor, SyntaxNode node, bool mayRequireAdditionalWork, bool addStringMarshalling, CancellationToken ct) 78var generatedComInterfaceAttribute = gen.Attribute(gen.TypeExpression(comp.GetTypeByMetadataName(TypeNames.GeneratedComInterfaceAttribute)).WithAdditionalAnnotations(Simplifier.AddImportsAnnotation)); 99var comImportAttribute = await declaringType.GetAttributes().First(attr => attr.AttributeClass.Equals(comImportAttributeType, SymbolEqualityComparer.Default)).ApplicationSyntaxReference.GetSyntaxAsync(ct).ConfigureAwait(false); 103foreach (var member in gen.GetMembers(node)) 126var generatedDeclaration = member;
ComMethodInfo.cs (1)
126var declaringSyntax = declaringSyntaxReference.GetSyntax(ct);
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (15)
27protected virtual IEnumerable<ConvertToSourceGeneratedInteropFix> CreateAllFixesForDiagnosticOptions(SyntaxNode node, ImmutableDictionary<string, Option> options) 33protected abstract Func<DocumentEditor, CancellationToken, Task> CreateFixForSelectedOptions(SyntaxNode node, ImmutableDictionary<string, Option> selectedOptions); 121SyntaxNode? root = await doc.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 125SyntaxNode node = root.FindNode(context.Span); 200SyntaxNode root = await diagnostic.Location.SourceTree.GetRootAsync(ct).ConfigureAwait(false); 202SyntaxNode node = root.FindNode(diagnostic.Location.SourceSpan); 232protected static void MakeNodeParentsPartial(DocumentEditor editor, SyntaxNode syntax) 234for (SyntaxNode? node = syntax.Parent; node is not null; node = node.Parent) 240protected static SyntaxNode AddExplicitDefaultBoolMarshalling(SyntaxGenerator generator, IMethodSymbol methodSymbol, SyntaxNode generatedDeclaration, string unmanagedTypeMemberIdentifier) 247SyntaxNode generatedParameterSyntax = generator.GetParameters(generatedDeclaration)[parameter.Ordinal]; 263static SyntaxNode GenerateMarshalAsUnmanagedTypeBoolAttribute(SyntaxGenerator generator, string unmanagedTypeMemberIdentifier) 271protected static SyntaxNode AddHResultStructAsErrorMarshalling(SyntaxGenerator generator, IMethodSymbol methodSymbol, SyntaxNode generatedDeclaration) 292static SyntaxNode GeneratedMarshalAsUnmanagedTypeErrorAttribute(SyntaxGenerator generator)
VtableIndexStubGenerator.cs (1)
404for (SyntaxNode? parentNode = methodSyntax.Parent; parentNode is TypeDeclarationSyntax typeDecl; parentNode = parentNode.Parent)
Microsoft.Interop.JavaScript.JSImportGenerator (2)
JSExportGenerator.cs (1)
348for (SyntaxNode? parentNode = methodSyntax.Parent; parentNode is TypeDeclarationSyntax typeDecl; parentNode = parentNode.Parent)
JSImportGenerator.cs (1)
227for (SyntaxNode? parentNode = methodSyntax.Parent; parentNode is TypeDeclarationSyntax typeDecl; parentNode = parentNode.Parent)
Microsoft.Interop.LibraryImportGenerator (55)
Analyzers\AddDisableRuntimeMarshallingAttributeFixer.cs (1)
60var syntaxRoot = await assemblyInfo.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
Analyzers\ConvertToLibraryImportFixer.cs (24)
76protected override IEnumerable<ConvertToSourceGeneratedInteropFix> CreateAllFixesForDiagnosticOptions(SyntaxNode node, ImmutableDictionary<string, Option> options) 129protected override Func<DocumentEditor, CancellationToken, Task> CreateFixForSelectedOptions(SyntaxNode node, ImmutableDictionary<string, Option> selectedOptions) 162SyntaxNode methodSyntax, 172SyntaxNode generatedDeclaration = await ConvertMethodDeclarationToLibraryImport( 196private static async Task<SyntaxNode> ConvertMethodDeclarationToLibraryImport( 197SyntaxNode methodSyntax, 219SyntaxNode libraryImportSyntax = GetLibraryImportAttribute( 226out SyntaxNode? unmanagedCallConvAttributeMaybe); 236SyntaxNode generatedDeclaration = generator.ReplaceNode(methodSyntax, dllImportSyntax, libraryImportSyntax); 277SyntaxNode root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); 293SyntaxNode? referenceNode = root.FindNode(location.Location.SourceSpan); 399SyntaxNode WrapInvocationWithHRExceptionThrow(SyntaxNode node, SyntaxGenerator generator) 411private static SyntaxNode GetLibraryImportAttribute( 418out SyntaxNode? unmanagedCallConvAttributeMaybe) 426SyntaxNode libraryImportSyntax = generator.ReplaceNode(dllImportSyntax, 432List<SyntaxNode> argumentsToAdd = new List<SyntaxNode>(); 433List<SyntaxNode> argumentsToRemove = new List<SyntaxNode>(); 434foreach (SyntaxNode argument in generator.GetAttributeArguments(libraryImportSyntax)) 552private static SyntaxNode SortDllImportAttributeArguments(AttributeSyntax attribute, SyntaxGenerator generator) 575out SyntaxNode? unmanagedCallConvAttribute) 615SyntaxNode argumentValue = ShouldUseCollectionExpression(editor.OriginalDocument, documentSyntaxTree)
Analyzers\CustomMarshallerAttributeFixer.cs (15)
42SyntaxNode root = await diagnostic.Location.SourceTree.GetRootAsync(fixAllContext.CancellationToken).ConfigureAwait(false); 44SyntaxNode node = root.FindNode(diagnostic.Location.SourceSpan); 112SyntaxNode? root = await doc.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 116SyntaxNode node = root.FindNode(context.Span); 154private static async Task<Solution> AddMissingMembers(Document doc, SyntaxNode node, HashSet<string> missingMemberNames, CancellationToken ct) 188SyntaxNode declaringSyntax, 204private static void AddMissingMembersToStatelessMarshaller(DocumentEditor editor, SyntaxNode declaringSyntax, INamedTypeSymbol marshallerType, ITypeSymbol managedType, HashSet<string> missingMemberNames, bool isLinearCollectionMarshaller) 214Lazy<SyntaxNode> unmanagedTypeSyntax = new(CreateUnmanagedTypeSyntax, isThreadSafe: false); 217List<SyntaxNode> newMembers = new(); 350SyntaxNode CreateUnmanagedTypeSyntax() 400private static void AddMissingMembersToStatefulMarshaller(DocumentEditor editor, SyntaxNode declaringSyntax, INamedTypeSymbol marshallerType, ITypeSymbol managedType, HashSet<string> missingMemberNames, bool isLinearCollectionMarshaller) 410Lazy<SyntaxNode> unmanagedTypeSyntax = new(CreateUnmanagedTypeSyntax, isThreadSafe: false); 413List<SyntaxNode> newMembers = new(); 525SyntaxNode CreateUnmanagedTypeSyntax() 567private static SyntaxNode DefaultMethodStatement(SyntaxGenerator generator, Compilation compilation)
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (15)
27protected virtual IEnumerable<ConvertToSourceGeneratedInteropFix> CreateAllFixesForDiagnosticOptions(SyntaxNode node, ImmutableDictionary<string, Option> options) 33protected abstract Func<DocumentEditor, CancellationToken, Task> CreateFixForSelectedOptions(SyntaxNode node, ImmutableDictionary<string, Option> selectedOptions); 121SyntaxNode? root = await doc.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 125SyntaxNode node = root.FindNode(context.Span); 200SyntaxNode root = await diagnostic.Location.SourceTree.GetRootAsync(ct).ConfigureAwait(false); 202SyntaxNode node = root.FindNode(diagnostic.Location.SourceSpan); 232protected static void MakeNodeParentsPartial(DocumentEditor editor, SyntaxNode syntax) 234for (SyntaxNode? node = syntax.Parent; node is not null; node = node.Parent) 240protected static SyntaxNode AddExplicitDefaultBoolMarshalling(SyntaxGenerator generator, IMethodSymbol methodSymbol, SyntaxNode generatedDeclaration, string unmanagedTypeMemberIdentifier) 247SyntaxNode generatedParameterSyntax = generator.GetParameters(generatedDeclaration)[parameter.Ordinal]; 263static SyntaxNode GenerateMarshalAsUnmanagedTypeBoolAttribute(SyntaxGenerator generator, string unmanagedTypeMemberIdentifier) 271protected static SyntaxNode AddHResultStructAsErrorMarshalling(SyntaxGenerator generator, IMethodSymbol methodSymbol, SyntaxNode generatedDeclaration) 292static SyntaxNode GeneratedMarshalAsUnmanagedTypeErrorAttribute(SyntaxGenerator generator)
Microsoft.Interop.SourceGeneration (10)
ContainingSyntaxContext.cs (2)
53for (SyntaxNode? parent = memberDeclaration.Parent; parent is TypeDeclarationSyntax typeDeclaration; parent = parent.Parent) 69for (SyntaxNode? parent = memberDeclaration.FirstAncestorOrSelf<BaseNamespaceDeclarationSyntax>(); parent is BaseNamespaceDeclarationSyntax ns; parent = parent.Parent)
IncrementalGeneratorInitializationContextExtensions.cs (1)
70where TNode : SyntaxNode
IncrementalValuesProviderExtensions.cs (1)
45where TNode : SyntaxNode
SyntaxEquivalentComparer.cs (4)
9public sealed class SyntaxEquivalentComparer : IEqualityComparer<SyntaxNode>, IEqualityComparer<SyntaxToken> 13public bool Equals(SyntaxNode x, SyntaxNode y) 32public int GetHashCode(SyntaxNode obj)
SyntaxEquivalentNode.cs (1)
12where T : SyntaxNode
SyntaxExtensions.cs (1)
122for (SyntaxNode? parentNode = syntax; parentNode is TypeDeclarationSyntax typeDecl; parentNode = parentNode.Parent)
Microsoft.ML.CodeGenerator (1)
Utils.cs (1)
188var syntaxNode = tree.GetRoot();
Microsoft.ML.InternalCodeAnalyzer (16)
BestFriendAnalyzer.cs (1)
66foreach (var node in model.SyntaxTree.GetRoot().DescendantNodes(n => !n.IsKind(SyntaxKind.UsingDirective)))
ContractsCheckAnalyzer.cs (1)
162private static bool HasModelLoadContext(SyntaxNode node)
ContractsCheckNameofFixProvider.cs (9)
39var root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 75foreach (var node in sameNameNodes) 77SyntaxNode candidate = node; 107SyntaxNode temp = nameArg; 171var root = await tree.GetRootAsync(cancellationToken); 172var newRoot = root.ReplaceNode(nameArg.Expression, nameofExp); 176private async Task<Document> ExpressionReplaceAsync(Document document, SyntaxNode exp, ArgumentSyntax nameArg, CancellationToken cancellationToken) 182var root = await tree.GetRootAsync(cancellationToken); 183var newRoot = root.ReplaceNode(nameArg.Expression, newNameofExp);
InstanceInitializerAnalyzer.cs (1)
71var syntax = syntaxRefs[0].GetSyntax();
NameFixProvider.cs (2)
59var root = await context.Document.GetSyntaxRootAsync(context.CancellationToken); 103SyntaxNode identifier, string name, Func<string, string> renamer, CancellationToken cancellationToken)
RelaxTestNamingSuppressor.cs (2)
41var root = tree.GetRoot(context.CancellationToken); 42var node = root.FindNode(diagnostic.Location.SourceSpan, getInnermostNodeForTie: true);
Microsoft.VisualStudio.LanguageServices (35)
ChangeSignature\ChangeSignatureViewModelFactoryService.cs (1)
20public abstract SyntaxNode GetTypeNode(string typeName);
ChangeSignature\IChangeSignatureViewModelFactoryService.cs (1)
17SyntaxNode GetTypeNode(string typeName);
CodeCleanup\AbstractCodeCleanUpFixer.cs (1)
215var changedRoots = await ProducerConsumer<(DocumentId documentId, SyntaxNode newRoot)>.RunParallelAsync(
CodeLens\CodeLensCallbackListener.cs (1)
141private async Task<(DocumentId?, SyntaxNode?)> GetDocumentIdAndNodeAsync(
CodeLens\RemoteCodeLensReferencesService.cs (5)
42public async Task<ReferenceCount?> GetReferenceCountAsync(Solution solution, DocumentId documentId, SyntaxNode? syntaxNode, int maxSearchResults, 67public async Task<ImmutableArray<ReferenceLocationDescriptor>?> FindReferenceLocationsAsync(Solution solution, DocumentId documentId, SyntaxNode? syntaxNode, 88public async Task<ImmutableArray<ReferenceMethodDescriptor>?> FindReferenceMethodsAsync(Solution solution, DocumentId documentId, SyntaxNode? syntaxNode, 113public async Task<string?> GetFullyQualifiedNameAsync(Solution solution, DocumentId documentId, SyntaxNode? syntaxNode, 253private static async Task<ImmutableArray<ReferenceLocationDescriptor>?> FindReferenceLocationsWorkerAsync(Solution solution, DocumentId documentId, SyntaxNode syntaxNode,
Extensions\DocumentExtensions.cs (1)
36var directive = trivia.GetStructure();
Implementation\AbstractEditorFactory.cs (1)
352var formattedRoot = Formatter.Format(rootToFormat, workspace.Services.SolutionServices, cleanupOptions.FormattingOptions, cancellationToken);
Implementation\ICodeModelNavigationPointService.cs (2)
19VirtualTreePoint? GetStartPoint(SyntaxNode node, LineFormattingOptions options, EnvDTE.vsCMPart? part = null); 24VirtualTreePoint? GetEndPoint(SyntaxNode node, LineFormattingOptions options, EnvDTE.vsCMPart? part = null);
LanguageService\AbstractLanguageService`2.IVsLanguageBlock.cs (1)
80var syntaxRoot = document.GetSyntaxRootSynchronously(cancellationToken);
LanguageService\AbstractLanguageService`2.IVsLanguageTextOps.cs (2)
58var root = documentSyntax.Root; 89private static RoslynTextSpan GetFormattingSpan(SyntaxNode root, int start, int end)
Progression\GraphNodeIdCreation.cs (2)
523var currentNode = await reference.GetSyntaxAsync(cancellationToken).ConfigureAwait(false); 541foreach (var node in currentNode.DescendantNodes())
Progression\GraphQueries\CallsGraphQuery.cs (1)
49foreach (var syntaxNode in (await reference.GetSyntaxAsync(cancellationToken).ConfigureAwait(false)).DescendantNodes())
Progression\IProgressionLanguageService.cs (2)
16IEnumerable<SyntaxNode> GetTopLevelNodesFromDocument(SyntaxNode root, CancellationToken cancellationToken);
Progression\SymbolContainment.cs (3)
19public static async Task<IEnumerable<SyntaxNode>> GetContainedSyntaxNodesAsync(Document document, CancellationToken cancellationToken) 26var root = await syntaxTree.GetRootAsync(cancellationToken).ConfigureAwait(false); 36foreach (var syntaxNode in syntaxNodes)
PullMemberUp\SymbolDependentsBuilder.cs (1)
61foreach (var syntax in syntaxes)
Venus\ContainedDocument.cs (5)
796var root = document.GetSyntaxRootSynchronously(CancellationToken.None); 824public BaseIndentationFormattingRule GetBaseIndentationRule(SyntaxNode root, SourceText text, List<TextSpan> spans, int spanIndex) 832var current = root.FindToken(visibleTextSpan.Start).Parent; 884private int GetBaseIndentation(SyntaxNode root, SourceText text, TextSpan span) 949private int GetAdditionalIndentation(SyntaxNode root, SourceText text, TextSpan span, int hostIndentationSize)
Venus\ContainedLanguageCodeSupport.cs (4)
66var typeNode = type.DeclaringSyntaxReferences.Where(r => r.SyntaxTree == tree).Select(r => r.GetSyntax(cancellationToken)).First(); 211var destinationType = syntaxFacts.GetContainingTypeDeclaration(targetSyntaxTree.GetRoot(cancellationToken), position); 224var newRoot = targetSyntaxTree.GetRoot(cancellationToken).ReplaceNode(destinationType, newType); 270var memberNode = member.DeclaringSyntaxReferences.Select(r => r.GetSyntax(cancellationToken)).FirstOrDefault();
Workspace\VisualStudioFormattingRuleFactoryServiceFactory.cs (1)
55var root = document.Root;
Microsoft.VisualStudio.LanguageServices.CSharp (261)
ChangeSignature\CSharpChangeSignatureViewModelFactoryService.cs (1)
57public override SyntaxNode GetTypeNode(string typeName) => SyntaxFactory.ParseTypeName(typeName);
CodeModel\CSharpCodeModelService.CodeModelEventCollector.cs (26)
32private static IReadOnlyList<MemberDeclarationSyntax> GetValidMembers(SyntaxNode node) 53(SyntaxNode)null, 61SyntaxNode newNodeParent, 76SyntaxNode newNodeParent, 205private bool CompareParameters(ParameterSyntax oldParameter, ParameterSyntax newParameter, SyntaxNode newNodeParent, CodeModelEventQueue eventQueue) 231SyntaxNode newNodeParent, 273SyntaxNode newNodeParent, 300SyntaxNode newNodeParent, 353SyntaxNode newNodeParent, 370SyntaxNode newNodeParent, 412SyntaxNode newNodeParent, 474SyntaxNode newNodeParent, 511SyntaxNode newNodeParent, 653SyntaxNode newNodeParent, 844protected override void CollectCore(SyntaxNode oldRoot, SyntaxNode newRoot, CodeModelEventQueue eventQueue) 847protected override void EnqueueAddEvent(SyntaxNode node, SyntaxNode parent, CodeModelEventQueue eventQueue) 883protected override void EnqueueChangeEvent(SyntaxNode node, SyntaxNode parent, CodeModelEventType eventType, CodeModelEventQueue eventQueue) 919private static void ChangeEventQueueForAttributes(AttributeSyntax attribute, SyntaxNode parent, CodeModelEventType eventType, CodeModelEventQueue eventQueue) 934protected override void EnqueueRemoveEvent(SyntaxNode node, SyntaxNode parent, CodeModelEventQueue eventQueue) 970private static void AddEventToEventQueueForAttributes(AttributeSyntax attribute, SyntaxNode parent, Action<SyntaxNode, SyntaxNode> enqueueAddOrRemoveEvent)
CodeModel\CSharpCodeModelService.cs (221)
89private static bool IsNameableNode(SyntaxNode node) 122public override EnvDTE.vsCMElement GetElementKind(SyntaxNode node) 135public override bool MatchesScope(SyntaxNode node, EnvDTE.vsCMElement scope) 278public override IEnumerable<SyntaxNode> GetOptionNodes(SyntaxNode parent) 282public override IEnumerable<SyntaxNode> GetImportNodes(SyntaxNode parent) 290private static IEnumerable<SyntaxNode> GetAttributeNodes(SyntaxList<AttributeListSyntax> attributeDeclarationList) 301public override IEnumerable<SyntaxNode> GetAttributeNodes(SyntaxNode parent) 348public override IEnumerable<SyntaxNode> GetAttributeArgumentNodes(SyntaxNode parent) 361public override IEnumerable<SyntaxNode> GetInheritsNodes(SyntaxNode parent) 367public override IEnumerable<SyntaxNode> GetImplementsNodes(SyntaxNode parent) 373private static bool IsContainerNode(SyntaxNode container) 378private static bool IsNamespaceOrTypeDeclaration(SyntaxNode node) 383private static IEnumerable<MemberDeclarationSyntax> GetChildMemberNodes(SyntaxNode container) 424private static bool NodeIsSupported(bool test, SyntaxNode node) 431/// <param name="container">The <see cref="SyntaxNode"/> from which to retrieve members.</param> 441public override IEnumerable<SyntaxNode> GetMemberNodes(SyntaxNode container, bool includeSelf, bool recursive, bool logicalFields, bool onlySupportedNodes) 447private IEnumerable<SyntaxNode> GetMemberNodesWorker(SyntaxNode container, bool includeSelf, bool recursive, bool logicalFields, bool onlySupportedNodes) 488foreach (var innerMember in GetMemberNodes(member, includeSelf: false, recursive: true, logicalFields: logicalFields, onlySupportedNodes: onlySupportedNodes)) 510/// Do not use this method directly! Instead, go through <see cref="FileCodeModel.GetOrCreateCodeElement{T}(SyntaxNode)"/> 515SyntaxNode node) 590public override EnvDTE.CodeElement CreateUnknownCodeElement(CodeModelState state, FileCodeModel fileCodeModel, SyntaxNode node) 772public override bool IsParameterNode(SyntaxNode node) 775public override bool IsAttributeNode(SyntaxNode node) 778public override bool IsAttributeArgumentNode(SyntaxNode node) 781public override bool IsOptionNode(SyntaxNode node) 787public override bool IsImportNode(SyntaxNode node) 794public override string GetName(SyntaxNode node) 857public override SyntaxNode GetNodeWithName(SyntaxNode node) 869public override SyntaxNode SetName(SyntaxNode node, string name) 926private static SyntaxNode SetNameOfClassOrStruct(SyntaxNode node, SyntaxToken newIdentifier) 954public override string GetFullName(SyntaxNode node, SemanticModel semanticModel) 1046public override EnvDTE.vsCMAccess GetAccess(SyntaxNode node) 1048var member = GetNodeWithModifiers(node); 1087public override SyntaxNode GetNodeWithModifiers(SyntaxNode node) 1094public override SyntaxNode GetNodeWithType(SyntaxNode node) 1103public override SyntaxNode GetNodeWithInitializer(SyntaxNode node) 1106private EnvDTE.vsCMAccess GetDefaultAccessibility(SyntaxNode node) 1154public override SyntaxNode SetAccess(SyntaxNode node, EnvDTE.vsCMAccess newAccess) 1243public override string GetComment(SyntaxNode node) 1269public override SyntaxNode SetComment(SyntaxNode node, string value) 1343public override string GetDocComment(SyntaxNode node) 1390public override SyntaxNode SetDocComment(SyntaxNode node, string value) 1450public override IEnumerable<SyntaxNode> GetParameterNodes(SyntaxNode parentNode) 1468public override bool IsExpressionBodiedProperty(SyntaxNode node) 1471public override bool TryGetAutoPropertyExpressionBody(SyntaxNode parentNode, [NotNullWhen(true)] out SyntaxNode? accessorNode) 1477public override bool IsAccessorNode(SyntaxNode node) 1491public override MethodKind GetAccessorKind(SyntaxNode node) 1511public override bool TryGetAccessorNode(SyntaxNode parentNode, MethodKind kind, [NotNullWhen(true)] out SyntaxNode? accessorNode) 1534public override bool TryGetParameterNode(SyntaxNode parentNode, string name, [NotNullWhen(true)] out SyntaxNode? parameterNode) 1549public override bool TryGetImportNode(SyntaxNode parentNode, string dottedName, [NotNullWhen(true)] out SyntaxNode? importNode) 1564public override bool TryGetOptionNode(SyntaxNode parentNode, string name, int ordinal, out SyntaxNode optionNode) 1570public override bool TryGetInheritsNode(SyntaxNode parentNode, string name, int ordinal, out SyntaxNode inheritsNode) 1576public override bool TryGetImplementsNode(SyntaxNode parentNode, string name, int ordinal, out SyntaxNode implementsNode) 1582public override bool TryGetAttributeNode(SyntaxNode parentNode, string name, int ordinal, [NotNullWhen(true)] out SyntaxNode? attributeNode) 1602public override bool TryGetAttributeArgumentNode(SyntaxNode attributeNode, int index, [NotNullWhen(true)] out SyntaxNode? attributeArgumentNode) 1618public override void GetOptionNameAndOrdinal(SyntaxNode parentNode, SyntaxNode optionNode, out string name, out int ordinal) 1624public override void GetInheritsNamespaceAndOrdinal(SyntaxNode parentNode, SyntaxNode inheritsNode, out string namespaceName, out int ordinal) 1630public override void GetImplementsNamespaceAndOrdinal(SyntaxNode parentNode, SyntaxNode implementsNode, out string namespaceName, out int ordinal) 1636public override void GetAttributeNameAndOrdinal(SyntaxNode parentNode, SyntaxNode attributeNode, out string name, out int ordinal) 1657public override void GetAttributeArgumentParentAndIndex(SyntaxNode attributeArgumentNode, out SyntaxNode attributeNode, out int index) 1668public override SyntaxNode GetAttributeTargetNode(SyntaxNode attributeNode) 1676public override string GetAttributeTarget(SyntaxNode attributeNode) 1690public override SyntaxNode SetAttributeTarget(SyntaxNode attributeNode, string target) 1707public override string GetAttributeValue(SyntaxNode attributeNode) 1721public override SyntaxNode SetAttributeValue(SyntaxNode attributeNode, string value) 1739public override SyntaxNode GetNodeWithAttributes(SyntaxNode node) 1746public override SyntaxNode GetEffectiveParentForAttribute(SyntaxNode node) 1763public override SyntaxNode CreateAttributeNode(string name, string value, string? target = null) 1777public override SyntaxNode CreateAttributeArgumentNode(string name, string value) 1792public override SyntaxNode CreateImportNode(string name, string? alias = null) 1807public override SyntaxNode CreateParameterNode(string name, string type) 1810public override string GetAttributeArgumentValue(SyntaxNode attributeArgumentNode) 1817public override string GetImportAlias(SyntaxNode importNode) 1829public override string GetImportNamespaceOrType(SyntaxNode importNode) 1839public override void GetImportParentAndName(SyntaxNode importNode, out SyntaxNode? namespaceNode, out string name) 1855public override string GetParameterName(SyntaxNode node) 1865public override EnvDTE80.vsCMParameterKind GetParameterKind(SyntaxNode node) 1898public override SyntaxNode SetParameterKind(SyntaxNode node, EnvDTE80.vsCMParameterKind kind) 1976public override EnvDTE.vsCMFunction ValidateFunctionKind(SyntaxNode containerNode, EnvDTE.vsCMFunction kind, string name) 2007public override bool GetCanOverride(SyntaxNode memberNode) 2026public override SyntaxNode SetCanOverride(SyntaxNode memberNode, bool value) 2059public override EnvDTE80.vsCMClassKind GetClassKind(SyntaxNode typeNode, INamedTypeSymbol typeSymbol) 2071public override SyntaxNode SetClassKind(SyntaxNode typeNode, EnvDTE80.vsCMClassKind kind) 2090public override EnvDTE80.vsCMConstKind GetConstKind(SyntaxNode variableNode) 2122public override SyntaxNode SetConstKind(SyntaxNode variableNode, EnvDTE80.vsCMConstKind kind) 2155public override EnvDTE80.vsCMDataTypeKind GetDataTypeKind(SyntaxNode typeNode, INamedTypeSymbol symbol) 2167public override SyntaxNode SetDataTypeKind(SyntaxNode typeNode, EnvDTE80.vsCMDataTypeKind kind) 2218public override EnvDTE80.vsCMInheritanceKind GetInheritanceKind(SyntaxNode typeNode, INamedTypeSymbol typeSymbol) 2245public override bool GetMustImplement(SyntaxNode memberNode) 2264public override SyntaxNode SetMustImplement(SyntaxNode memberNode, bool value) 2381public override SyntaxNode SetInheritanceKind(SyntaxNode typeNode, EnvDTE80.vsCMInheritanceKind kind) 2414public override EnvDTE80.vsCMOverrideKind GetOverrideKind(SyntaxNode memberNode) 2455public override SyntaxNode SetOverrideKind(SyntaxNode memberNode, EnvDTE80.vsCMOverrideKind kind) 2513public override bool GetIsAbstract(SyntaxNode memberNode, ISymbol symbol) 2522public override SyntaxNode SetIsAbstract(SyntaxNode memberNode, bool value) 2545public override bool GetIsConstant(SyntaxNode variableNode) 2564public override SyntaxNode SetIsConstant(SyntaxNode variableNode, bool value) 2602public override bool GetIsDefault(SyntaxNode propertyNode) 2614public override SyntaxNode SetIsDefault(SyntaxNode propertyNode, bool value) 2620public override bool GetIsGeneric(SyntaxNode memberNode) 2632public override bool GetIsPropertyStyleEvent(SyntaxNode eventNode) 2640public override bool GetIsShared(SyntaxNode memberNode, ISymbol symbol) 2653public override SyntaxNode SetIsShared(SyntaxNode memberNode, bool value) 2676public override EnvDTE80.vsCMPropertyKind GetReadWrite(SyntaxNode memberNode) 2715public override SyntaxNode SetType(SyntaxNode node, ITypeSymbol? typeSymbol) 2835private static Document DeleteMember(Document document, SyntaxNode node) 2882public override Document Delete(Document document, SyntaxNode node) 2893public override string GetMethodXml(SyntaxNode node, SemanticModel semanticModel) 2903public override string? GetInitExpression(SyntaxNode node) 2921public override SyntaxNode AddInitExpression(SyntaxNode node, string value) 2982public override CodeGenerationDestination GetDestination(SyntaxNode node) 3063public override SyntaxNode CreateReturnDefaultValueStatement(ITypeSymbol type) 3070protected override int GetAttributeIndexInContainer(SyntaxNode containerNode, Func<SyntaxNode, bool> predicate) 3100protected override int GetAttributeArgumentIndexInContainer(SyntaxNode containerNode, Func<SyntaxNode, bool> predicate) 3115protected override int GetImportIndexInContainer(SyntaxNode containerNode, Func<SyntaxNode, bool> predicate) 3130protected override int GetParameterIndexInContainer(SyntaxNode containerNode, Func<SyntaxNode, bool> predicate) 3145protected override int GetMemberIndexInContainer(SyntaxNode containerNode, Func<SyntaxNode, bool> predicate) 3174protected override SyntaxNode GetFieldFromVariableNode(SyntaxNode node) 3181protected override SyntaxNode GetVariableFromFieldNode(SyntaxNode finalNode) 3189protected override SyntaxNode GetAttributeFromAttributeDeclarationNode(SyntaxNode node) 3196protected override TextSpan GetSpanToFormat(SyntaxNode root, TextSpan span) 3216protected SyntaxNode InsertMemberNodeIntoContainerCore(int index, SyntaxNode member, SyntaxNode container) 3259private static MemberDeclarationSyntax GetMember(SyntaxNode container, int index) 3281private static SyntaxNode EnsureAfterEndRegion(int index, SyntaxNode container) 3286var newContainer = container; 3310protected override SyntaxNode InsertMemberNodeIntoContainer(int index, SyntaxNode member, SyntaxNode container) 3312var newContainer = InsertMemberNodeIntoContainerCore(index, member, container); 3319protected override SyntaxNode InsertAttributeArgumentIntoContainer(int index, SyntaxNode attributeArgument, SyntaxNode container) 3343protected override SyntaxNode InsertAttributeListIntoContainer(int index, SyntaxNode list, SyntaxNode container) 3457protected override SyntaxNode InsertImportIntoContainer(int index, SyntaxNode importNode, SyntaxNode container) 3470protected override SyntaxNode InsertParameterIntoContainer(int index, SyntaxNode parameter, SyntaxNode container) 3491protected override bool IsCodeModelNode(SyntaxNode node) 3520public override bool IsNamespace(SyntaxNode node) 3523public override bool IsType(SyntaxNode node) 3601public override object GetFunctionExtender(string name, SyntaxNode node, ISymbol symbol) 3641public override object GetPropertyExtender(string name, SyntaxNode node, ISymbol symbol) 3681protected override bool AddBlankLineToMethodBody(SyntaxNode node, SyntaxNode newNode) 3707public override bool IsValidBaseType(SyntaxNode node, ITypeSymbol typeSymbol) 3721public override SyntaxNode AddBase(SyntaxNode node, ITypeSymbol typeSymbol, SemanticModel semanticModel, int? position) 3754public override SyntaxNode RemoveBase(SyntaxNode node, ITypeSymbol typeSymbol, SemanticModel semanticModel) 3804public override bool IsValidInterfaceType(SyntaxNode node, ITypeSymbol typeSymbol) 3814public override SyntaxNode AddImplementedInterface(SyntaxNode node, ITypeSymbol typeSymbol, SemanticModel semanticModel, int? position) 3849public override SyntaxNode RemoveImplementedInterface(SyntaxNode node, ITypeSymbol typeSymbol, SemanticModel semanticModel)
CodeModel\CSharpCodeModelService.NodeLocator.cs (2)
33protected override VirtualTreePoint? GetStartPoint(SourceText text, LineFormattingOptions options, SyntaxNode node, EnvDTE.vsCMPart part) 84protected override VirtualTreePoint? GetEndPoint(SourceText text, LineFormattingOptions options, SyntaxNode node, EnvDTE.vsCMPart part)
CodeModel\CSharpCodeModelService.NodeNameGenerator.cs (2)
23protected override bool IsNameableNode(SyntaxNode node) 156protected override void AppendNodeName(StringBuilder builder, SyntaxNode node)
CodeModel\CSharpCodeModelService_Prototype.cs (1)
22public override string GetPrototype(SyntaxNode node, ISymbol symbol, PrototypeFlags flags)
CodeModel\SyntaxListExtensions.cs (2)
15where TNode : SyntaxNode 21where TNode : SyntaxNode
CodeModel\SyntaxNodeExtensions.cs (2)
14public static bool TryGetAttributeLists(this SyntaxNode node, out SyntaxList<AttributeListSyntax> attributeLists) 61public static SyntaxToken GetFirstTokenAfterAttributes(this SyntaxNode node)
Progression\CSharpProgressionLanguageService.cs (3)
51public IEnumerable<SyntaxNode> GetTopLevelNodesFromDocument(SyntaxNode root, CancellationToken cancellationToken) 56using var _ = ArrayBuilder<SyntaxNode>.GetInstance(out var nodes);
Snippets\CSharpSnippetExpansionLanguageHelper.cs (1)
116SyntaxNode contextLocation, XElement snippetNode, XElement importsNode)
Microsoft.VisualStudio.LanguageServices.VisualBasic (281)
ChangeSignature\VisualBasicChangeSignatureViewModelFactoryService.vb (1)
50Public Overrides Function GetTypeNode(typeName As String) As SyntaxNode
CodeModel\SyntaxListExtensions.vb (2)
15Public Function AsReadOnlyList(Of TNode As SyntaxNode)(list As SyntaxList(Of TNode)) As IReadOnlyList(Of TNode) 20Public Function AsReadOnlyList(Of TNode As SyntaxNode)(list As SeparatedSyntaxList(Of TNode)) As IReadOnlyList(Of TNode)
CodeModel\VisualBasicCodeModelService.CodeModelEventCollector.vb (33)
31Dim parent As SyntaxNode = Nothing 149Private Shared Function GetValidMembers(node As SyntaxNode) As IReadOnlyList(Of DeclarationStatementSyntax) 168Private Function CompareOptions(oldOption As OptionStatementSyntax, newOption As OptionStatementSyntax, newNodeParent As SyntaxNode, eventQueue As CodeModelEventQueue) As Boolean 179Private Function CompareImportsClauses(oldImportsClause As ImportsClauseSyntax, newImportsClause As ImportsClauseSyntax, newNodeParent As SyntaxNode, eventQueue As CodeModelEventQueue) As Boolean 189Private Function CompareAttributes(oldAttribute As AttributeSyntax, newAttribute As AttributeSyntax, newNodeParent As SyntaxNode, eventQueue As CodeModelEventQueue) As Boolean 226Private Function CompareArgumentLists(oldArgumentList As ArgumentListSyntax, newArgumentList As ArgumentListSyntax, newNodeParent As SyntaxNode, eventQueue As CodeModelEventQueue) As Boolean 239Private Function CompareArguments(oldArgument As ArgumentSyntax, newArgument As ArgumentSyntax, newNodeParent As SyntaxNode, eventQueue As CodeModelEventQueue) As Boolean 280Private Function CompareNamespacesOrTypes(oldNamespaceOrType As DeclarationStatementSyntax, newNamespaceOrType As DeclarationStatementSyntax, newNodeParent As SyntaxNode, eventQueue As CodeModelEventQueue) As Boolean 315Private Function CompareNamespaces(oldNamespace As NamespaceBlockSyntax, newNamespace As NamespaceBlockSyntax, newNodeParent As SyntaxNode, eventQueue As CodeModelEventQueue) As Boolean 353Private Function CompareTypeDeclarations(oldType As DeclarationStatementSyntax, newType As DeclarationStatementSyntax, newNodeParent As SyntaxNode, eventQueue As CodeModelEventQueue) As Boolean 389Private Function CompareTypes(oldType As TypeBlockSyntax, newType As TypeBlockSyntax, newNodeParent As SyntaxNode, eventQueue As CodeModelEventQueue) As Boolean 452Private Function CompareEnums(oldEnum As EnumBlockSyntax, newEnum As EnumBlockSyntax, newNodeParent As SyntaxNode, eventQueue As CodeModelEventQueue) As Boolean 536Private Function CompareMemberDeclarations(oldMember As DeclarationStatementSyntax, newMember As DeclarationStatementSyntax, newNodeParent As SyntaxNode, eventQueue As CodeModelEventQueue) As Boolean 594Private Function CompareMethods(oldMethod As MethodBaseSyntax, newMethod As MethodBaseSyntax, newNodeParent As SyntaxNode, eventQueue As CodeModelEventQueue) As Boolean 655Private Function CompareProperties(oldProperty As PropertyStatementSyntax, newProperty As PropertyStatementSyntax, newNodeParent As SyntaxNode, eventQueue As CodeModelEventQueue) As Boolean 716Private Function CompareEvents(oldEvent As EventStatementSyntax, newEvent As EventStatementSyntax, newNodeParent As SyntaxNode, eventQueue As CodeModelEventQueue) As Boolean 777Private Function CompareFields(oldField As FieldDeclarationSyntax, newField As FieldDeclarationSyntax, newNodeParent As SyntaxNode, eventQueue As CodeModelEventQueue) As Boolean 807Private Function CompareModifiedIdentifiers(oldModifiedIdentifier As ModifiedIdentifierSyntax, newModifiedIdentifier As ModifiedIdentifierSyntax, newNodeParent As SyntaxNode, eventQueue As CodeModelEventQueue) As Boolean 843Private Function CompareEnumMembers(oldEnumMember As EnumMemberDeclarationSyntax, newEnumMember As EnumMemberDeclarationSyntax, newNodeParent As SyntaxNode, eventQueue As CodeModelEventQueue) As Boolean 874Private Function CompareParameterLists(oldParameterList As ParameterListSyntax, newParameterList As ParameterListSyntax, newNodeParent As SyntaxNode, eventQueue As CodeModelEventQueue) As Boolean 887Private Function CompareParameters(oldParameter As ParameterSyntax, newParameter As ParameterSyntax, newNodeParent As SyntaxNode, eventQueue As CodeModelEventQueue) As Boolean 939Private Function CompareInherits(oldInherits As InheritsStatementSyntax, newInherits As InheritsStatementSyntax, newNodeParent As SyntaxNode, eventQueue As CodeModelEventQueue) As Boolean 943Private Function CompareImplements(oldImplements As ImplementsStatementSyntax, newImplements As ImplementsStatementSyntax, newNodeParent As SyntaxNode, eventQueue As CodeModelEventQueue) As Boolean 1103Protected Overrides Sub CollectCore(oldRoot As SyntaxNode, newRoot As SyntaxNode, eventQueue As CodeModelEventQueue) 1107Private Shared Function GetValidParentNode(node As SyntaxNode) As SyntaxNode 1141Protected Overrides Sub EnqueueAddEvent(node As SyntaxNode, parent As SyntaxNode, eventQueue As CodeModelEventQueue) 1173Protected Overrides Sub EnqueueChangeEvent(node As SyntaxNode, parent As SyntaxNode, eventType As CodeModelEventType, eventQueue As CodeModelEventQueue) 1205Protected Overrides Sub EnqueueRemoveEvent(node As SyntaxNode, parent As SyntaxNode, eventQueue As CodeModelEventQueue)
CodeModel\VisualBasicCodeModelService.NodeLocator.vb (2)
38Protected Overrides Function GetStartPoint(text As SourceText, options As LineFormattingOptions, node As SyntaxNode, part As EnvDTE.vsCMPart) As VirtualTreePoint? 128Protected Overrides Function GetEndPoint(text As SourceText, options As LineFormattingOptions, node As SyntaxNode, part As EnvDTE.vsCMPart) As VirtualTreePoint?
CodeModel\VisualBasicCodeModelService.NodeNameGenerator.vb (2)
20Protected Overrides Function IsNameableNode(node As SyntaxNode) As Boolean 122Protected Overrides Sub AppendNodeName(builder As StringBuilder, node As SyntaxNode)
CodeModel\VisualBasicCodeModelService.vb (230)
97Private Shared Function IsNameableNode(node As SyntaxNode) As Boolean 153Public Overrides Function GetElementKind(node As SyntaxNode) As EnvDTE.vsCMElement 165Public Overrides Function MatchesScope(node As SyntaxNode, scope As EnvDTE.vsCMElement) As Boolean 315Public Overrides Function GetOptionNodes(parent As SyntaxNode) As IEnumerable(Of SyntaxNode) 320Return SpecializedCollections.EmptyEnumerable(Of SyntaxNode)() 323Private Overloads Shared Function GetImportNodes(parent As CompilationUnitSyntax) As IEnumerable(Of SyntaxNode) 324Dim result = New List(Of SyntaxNode) 338Public Overrides Function GetImportNodes(parent As SyntaxNode) As IEnumerable(Of SyntaxNode) 343Return SpecializedCollections.EmptyEnumerable(Of SyntaxNode)() 346Private Overloads Shared Function GetAttributeNodes(attributesBlockList As SyntaxList(Of AttributeListSyntax)) As IEnumerable(Of SyntaxNode) 347Dim result = New List(Of SyntaxNode) 358Private Overloads Shared Function GetAttributeNodes(attributesStatementList As SyntaxList(Of AttributesStatementSyntax)) As IEnumerable(Of SyntaxNode) 359Dim result = New List(Of SyntaxNode) 372Public Overrides Function GetAttributeNodes(node As SyntaxNode) As IEnumerable(Of SyntaxNode) 406Return SpecializedCollections.EmptyEnumerable(Of SyntaxNode)() 409Public Overrides Function GetAttributeArgumentNodes(parent As SyntaxNode) As IEnumerable(Of SyntaxNode) 414Return SpecializedCollections.EmptyEnumerable(Of SyntaxNode)() 420Return SpecializedCollections.EmptyEnumerable(Of SyntaxNode)() 423Public Overrides Function GetInheritsNodes(parent As SyntaxNode) As IEnumerable(Of SyntaxNode) 430Return SpecializedCollections.EmptyEnumerable(Of SyntaxNode)() 433Public Overrides Function GetImplementsNodes(parent As SyntaxNode) As IEnumerable(Of SyntaxNode) 440Return SpecializedCollections.EmptyEnumerable(Of SyntaxNode)() 443Private Shared Function IsContainerNode(container As SyntaxNode) As Boolean 450Private Shared Function IsNamespaceOrTypeDeclaration(node As SyntaxNode) As Boolean 457Private Shared Iterator Function GetChildMemberNodes(container As SyntaxNode) As IEnumerable(Of DeclarationStatementSyntax) 485Private Shared Function NodeIsSupported(test As Boolean, node As SyntaxNode) As Boolean 493''' <param name="container">The <see cref="SyntaxNode"/> from which to retrieve members.</param> 503Public Overrides Iterator Function GetMemberNodes(container As SyntaxNode, includeSelf As Boolean, recursive As Boolean, logicalFields As Boolean, onlySupportedNodes As Boolean) As IEnumerable(Of SyntaxNode) 560''' Do not use this method directly! Instead, go through <see cref="FileCodeModel.GetOrCreateCodeElement(Of T)(SyntaxNode)"/> 565node As SyntaxNode 635Public Overrides Function CreateUnknownCodeElement(state As CodeModelState, fileCodeModel As FileCodeModel, node As SyntaxNode) As EnvDTE.CodeElement 827Public Overrides Function IsParameterNode(node As SyntaxNode) As Boolean 831Public Overrides Function IsAttributeNode(node As SyntaxNode) As Boolean 835Public Overrides Function IsAttributeArgumentNode(node As SyntaxNode) As Boolean 840Public Overrides Function IsOptionNode(node As SyntaxNode) As Boolean 844Public Overrides Function IsImportNode(node As SyntaxNode) As Boolean 854Private Shared Function GetNormalizedName(node As SyntaxNode) As String 878Public Overrides Function GetName(node As SyntaxNode) As String 883Debug.Assert(TypeOf node Is SyntaxNode) 953Public Overrides Function SetName(node As SyntaxNode, name As String) As SyntaxNode 1009Public Overrides Function GetNodeWithName(node As SyntaxNode) As SyntaxNode 1062Public Overrides Function GetFullName(node As SyntaxNode, semanticModel As SemanticModel) As String 1074Public Overrides Function IsExpressionBodiedProperty(node As SyntaxNode) As Boolean 1078Public Overrides Function TryGetAutoPropertyExpressionBody(parentNode As SyntaxNode, ByRef accessorNode As SyntaxNode) As Boolean 1082Public Overrides Function IsAccessorNode(node As SyntaxNode) As Boolean 1096Public Overrides Function GetAccessorKind(node As SyntaxNode) As MethodKind 1130Private Shared Function GetAccessors(node As SyntaxNode) As SyntaxList(Of AccessorBlockSyntax) 1141Public Overrides Function TryGetAccessorNode(parentNode As SyntaxNode, kind As MethodKind, ByRef accessorNode As SyntaxNode) As Boolean 1154Public Overrides Function TryGetParameterNode(parentNode As SyntaxNode, name As String, ByRef parameterNode As SyntaxNode) As Boolean 1173Public Overloads Overrides Function GetParameterNodes(parent As SyntaxNode) As IEnumerable(Of SyntaxNode) 1185Public Overrides Function TryGetImportNode(parentNode As SyntaxNode, dottedName As String, ByRef importNode As SyntaxNode) As Boolean 1197Public Overrides Function TryGetOptionNode(parentNode As SyntaxNode, name As String, ordinal As Integer, ByRef optionNode As SyntaxNode) As Boolean 1213Public Overrides Function TryGetInheritsNode(parentNode As SyntaxNode, name As String, ordinal As Integer, ByRef inheritsNode As SyntaxNode) As Boolean 1229Public Overrides Function TryGetImplementsNode(parentNode As SyntaxNode, name As String, ordinal As Integer, ByRef implementsNode As SyntaxNode) As Boolean 1245Public Overrides Function TryGetAttributeNode(parentNode As SyntaxNode, name As String, ordinal As Integer, ByRef attributeNode As SyntaxNode) As Boolean 1261Public Overrides Function TryGetAttributeArgumentNode(attributeNode As SyntaxNode, index As Integer, ByRef attributeArgumentNode As SyntaxNode) As Boolean 1276Private Shared Function DeleteMember(document As Document, node As SyntaxNode) As Document 1306Public Overrides Function Delete(document As Document, node As SyntaxNode) As Document 1459Public Overrides Function GetAccess(node As SyntaxNode) As EnvDTE.vsCMAccess 1494Public Overrides Function GetNodeWithModifiers(node As SyntaxNode) As SyntaxNode 1500Public Overrides Function GetNodeWithType(node As SyntaxNode) As SyntaxNode 1506Public Overrides Function GetNodeWithInitializer(node As SyntaxNode) As SyntaxNode 1512Public Overrides Function SetAccess(node As SyntaxNode, newAccess As EnvDTE.vsCMAccess) As SyntaxNode 1570Private Overloads Shared Function GetDefaultAccessibility(node As SyntaxNode) As EnvDTE.vsCMAccess 1588Protected Overrides Function GetAttributeIndexInContainer(containerNode As SyntaxNode, predicate As Func(Of SyntaxNode, Boolean)) As Integer 1614Protected Overrides Function GetAttributeArgumentIndexInContainer(containerNode As SyntaxNode, predicate As Func(Of SyntaxNode, Boolean)) As Integer 1629Protected Overrides Function GetImportIndexInContainer(containerNode As SyntaxNode, predicate As Func(Of SyntaxNode, Boolean)) As Integer 1655Protected Overrides Function GetParameterIndexInContainer(containerNode As SyntaxNode, predicate As Func(Of SyntaxNode, Boolean)) As Integer 1667Protected Overrides Function GetMemberIndexInContainer(containerNode As SyntaxNode, predicate As Func(Of SyntaxNode, Boolean)) As Integer 1706Public Overrides Sub GetOptionNameAndOrdinal(parentNode As SyntaxNode, optionNode As SyntaxNode, ByRef name As String, ByRef ordinal As Integer) 1723Public Overrides Sub GetInheritsNamespaceAndOrdinal(parentNode As SyntaxNode, inheritsNode As SyntaxNode, ByRef namespaceName As String, ByRef ordinal As Integer) 1740Public Overrides Sub GetImplementsNamespaceAndOrdinal(parentNode As SyntaxNode, implementsNode As SyntaxNode, ByRef namespaceName As String, ByRef ordinal As Integer) 1757Public Overrides Sub GetAttributeNameAndOrdinal(parentNode As SyntaxNode, attributeNode As SyntaxNode, ByRef name As String, ByRef ordinal As Integer) 1774Public Overrides Function GetAttributeTargetNode(attributeNode As SyntaxNode) As SyntaxNode 1782Public Overrides Function GetAttributeTarget(attributeNode As SyntaxNode) As String 1792Public Overrides Function SetAttributeTarget(attributeNode As SyntaxNode, value As String) As SyntaxNode 1819Public Overrides Function GetAttributeValue(attributeNode As SyntaxNode) As String 1831Public Overrides Function SetAttributeValue(attributeNode As SyntaxNode, value As String) As SyntaxNode 1845Public Overrides Function GetNodeWithAttributes(node As SyntaxNode) As SyntaxNode 1851Public Overrides Function GetEffectiveParentForAttribute(node As SyntaxNode) As SyntaxNode 1861Public Overrides Sub GetAttributeArgumentParentAndIndex(attributeArgumentNode As SyntaxNode, ByRef attributeNode As SyntaxNode, ByRef index As Integer) 1871Public Overrides Function CreateAttributeNode(name As String, value As String, Optional target As String = Nothing) As SyntaxNode 1892Public Overrides Function CreateAttributeArgumentNode(name As String, value As String) As SyntaxNode 1902Public Overrides Function CreateImportNode(name As String, Optional [alias] As String = Nothing) As SyntaxNode 1915Public Overrides Function CreateParameterNode(name As String, type As String) As SyntaxNode 1919Public Overrides Function GetAttributeArgumentValue(attributeArgumentNode As SyntaxNode) As String 1928Public Overrides Function GetImportAlias(node As SyntaxNode) As String 1941Public Overrides Function GetImportNamespaceOrType(node As SyntaxNode) As String 1950Public Overrides Sub GetImportParentAndName(node As SyntaxNode, ByRef parentNode As SyntaxNode, ByRef name As String) 1961Public Overrides Function GetParameterName(node As SyntaxNode) As String 1977Public Overrides Function GetParameterFullName(node As SyntaxNode) As String 1986Public Overrides Function GetParameterKind(node As SyntaxNode) As EnvDTE80.vsCMParameterKind 2014Public Overrides Function SetParameterKind(node As SyntaxNode, kind As EnvDTE80.vsCMParameterKind) As SyntaxNode 2085Public Overrides Function ValidateFunctionKind(containerNode As SyntaxNode, kind As EnvDTE.vsCMFunction, name As String) As EnvDTE.vsCMFunction 2105Public Overrides Function GetCanOverride(memberNode As SyntaxNode) As Boolean 2138Public Overrides Function SetCanOverride(memberNode As SyntaxNode, value As Boolean) As SyntaxNode 2144Public Overrides Function GetClassKind(typeNode As SyntaxNode, typeSymbol As INamedTypeSymbol) As EnvDTE80.vsCMClassKind 2171Public Overrides Function SetClassKind(typeNode As SyntaxNode, kind As EnvDTE80.vsCMClassKind) As SyntaxNode 2223Public Overrides Function GetComment(node As SyntaxNode) As String 2247Public Overrides Function SetComment(node As SyntaxNode, value As String) As SyntaxNode 2299Public Overrides Function GetConstKind(variableNode As SyntaxNode) As EnvDTE80.vsCMConstKind 2328Public Overrides Function SetConstKind(variableNode As SyntaxNode, kind As EnvDTE80.vsCMConstKind) As SyntaxNode 2358Public Overrides Function GetDataTypeKind(typeNode As SyntaxNode, symbol As INamedTypeSymbol) As EnvDTE80.vsCMDataTypeKind 2387Public Overrides Function SetDataTypeKind(typeNode As SyntaxNode, kind As EnvDTE80.vsCMDataTypeKind) As SyntaxNode 2471Public Overrides Function GetDocComment(node As SyntaxNode) As String 2499Public Overrides Function SetDocComment(node As SyntaxNode, value As String) As SyntaxNode 2571Public Overrides Function GetInheritanceKind(typeNode As SyntaxNode, typeSymbol As INamedTypeSymbol) As EnvDTE80.vsCMInheritanceKind 2606Public Overrides Function SetInheritanceKind(typeNode As SyntaxNode, kind As EnvDTE80.vsCMInheritanceKind) As SyntaxNode 2645Public Overrides Function GetMustImplement(memberNode As SyntaxNode) As Boolean 2662Public Overrides Function SetMustImplement(memberNode As SyntaxNode, value As Boolean) As SyntaxNode 2668Public Overrides Function GetOverrideKind(memberNode As SyntaxNode) As EnvDTE80.vsCMOverrideKind 2711Public Overrides Function SetOverrideKind(memberNode As SyntaxNode, kind As EnvDTE80.vsCMOverrideKind) As SyntaxNode 2804Public Overrides Function GetIsAbstract(memberNode As SyntaxNode, symbol As ISymbol) As Boolean 2808Public Overrides Function SetIsAbstract(memberNode As SyntaxNode, value As Boolean) As SyntaxNode 2838Public Overrides Function GetIsConstant(variableNode As SyntaxNode) As Boolean 2854Public Overrides Function SetIsConstant(variableNode As SyntaxNode, value As Boolean) As SyntaxNode 2860Public Overrides Function GetIsDefault(propertyNode As SyntaxNode) As Boolean 2876Public Overrides Function SetIsDefault(propertyNode As SyntaxNode, value As Boolean) As SyntaxNode 2892Public Overrides Function GetIsGeneric(node As SyntaxNode) As Boolean 2898Public Overrides Function GetIsPropertyStyleEvent(eventNode As SyntaxNode) As Boolean 2905Public Overrides Function GetIsShared(memberNode As SyntaxNode, symbol As ISymbol) As Boolean 2911Public Overrides Function SetIsShared(memberNode As SyntaxNode, value As Boolean) As SyntaxNode 2947Public Overrides Function GetReadWrite(memberNode As SyntaxNode) As EnvDTE80.vsCMPropertyKind 3417Public Overrides Function SetType(node As SyntaxNode, typeSymbol As ITypeSymbol) As SyntaxNode 3498Public Overrides Function GetInitExpression(node As SyntaxNode) As String 3525Public Overrides Function AddInitExpression(node As SyntaxNode, value As String) As SyntaxNode 3604Public Overrides Function GetDestination(containerNode As SyntaxNode) As CodeGenerationDestination 3677Public Overrides Function CreateReturnDefaultValueStatement(type As ITypeSymbol) As SyntaxNode 3683Protected Overrides Function IsCodeModelNode(node As SyntaxNode) As Boolean 3712Protected Overrides Function GetFieldFromVariableNode(variableNode As SyntaxNode) As SyntaxNode 3718Protected Overrides Function GetVariableFromFieldNode(fieldNode As SyntaxNode) As SyntaxNode 3725Protected Overrides Function GetAttributeFromAttributeDeclarationNode(node As SyntaxNode) As SyntaxNode 3731Protected Overrides Function GetSpanToFormat(root As SyntaxNode, span As TextSpan) As TextSpan 3738Protected Overrides Function InsertMemberNodeIntoContainer(index As Integer, member As SyntaxNode, container As SyntaxNode) As SyntaxNode 3774Protected Overrides Function InsertAttributeArgumentIntoContainer(index As Integer, attributeArgument As SyntaxNode, container As SyntaxNode) As SyntaxNode 3811Protected Overrides Function InsertAttributeListIntoContainer(index As Integer, list As SyntaxNode, container As SyntaxNode) As SyntaxNode 3919Protected Overrides Function InsertImportIntoContainer(index As Integer, importNode As SyntaxNode, container As SyntaxNode) As SyntaxNode 3946Protected Overrides Function InsertParameterIntoContainer(index As Integer, parameter As SyntaxNode, container As SyntaxNode) As SyntaxNode 3980Public Overrides Function IsNamespace(node As SyntaxNode) As Boolean 3984Public Overrides Function IsType(node As SyntaxNode) As Boolean 3989Public Overrides Function GetMethodXml(node As SyntaxNode, semanticModel As SemanticModel) As String 3998Private Shared Function GetMethodStatement(method As SyntaxNode) As MethodStatementSyntax 4058Public Overrides Function AddHandlesClause(document As Document, eventName As String, method As SyntaxNode, cancellationToken As CancellationToken) As Document 4086Public Overrides Function RemoveHandlesClause(document As Document, eventName As String, method As SyntaxNode, cancellationToken As CancellationToken) As Document 4142Public Overloads Overrides Function GetHandledEventNames(method As SyntaxNode, semanticModel As SemanticModel) As IList(Of String) 4148Public Overrides Function HandlesEvent(eventName As String, method As SyntaxNode, semanticModel As SemanticModel) As Boolean 4165Public Overrides Function GetFunctionExtender(name As String, node As SyntaxNode, symbol As ISymbol) As Object 4190Public Overrides Function GetPropertyExtender(name As String, node As SyntaxNode, symbol As ISymbol) As Object 4238Protected Overrides Function AddBlankLineToMethodBody(node As SyntaxNode, newNode As SyntaxNode) As Boolean 4239Return TypeOf node Is SyntaxNode AndAlso 4241TypeOf newNode Is SyntaxNode AndAlso 4245Public Overrides Function IsValidBaseType(node As SyntaxNode, typeSymbol As ITypeSymbol) As Boolean 4255Public Overrides Function AddBase(node As SyntaxNode, typeSymbol As ITypeSymbol, semanticModel As SemanticModel, position As Integer?) As SyntaxNode 4281Public Overrides Function RemoveBase(node As SyntaxNode, typeSymbol As ITypeSymbol, semanticModel As SemanticModel) As SyntaxNode 4313Public Overrides Function IsValidInterfaceType(node As SyntaxNode, typeSymbol As ITypeSymbol) As Boolean 4321Public Overrides Function AddImplementedInterface(node As SyntaxNode, typeSymbol As ITypeSymbol, semanticModel As SemanticModel, position As Integer?) As SyntaxNode 4353Public Overrides Function RemoveImplementedInterface(node As SyntaxNode, typeSymbol As ITypeSymbol, semanticModel As SemanticModel) As SyntaxNode
CodeModel\VisualBasicCodeModelService_Prototype.vb (1)
31Public Overrides Function GetPrototype(node As SyntaxNode, symbol As ISymbol, flags As PrototypeFlags) As String
Help\VisualBasicHelpContextService.Visitor.vb (2)
41Public Overrides Sub Visit(node As SyntaxNode) 52Public Overrides Sub DefaultVisit(node As SyntaxNode)
LanguageService\VisualBasicDebuggerIntelliSenseContext.vb (1)
90Private Shared Function IsRightSideOfLocalDeclaration(containingNode As SyntaxNode) As Boolean
Progression\VisualBasicProgressionLanguageService.vb (4)
24Public Function GetTopLevelNodesFromDocument(root As SyntaxNode, cancellationToken As CancellationToken) As IEnumerable(Of SyntaxNode) Implements IProgressionLanguageService.GetTopLevelNodesFromDocument 26Dim nodes = New Stack(Of SyntaxNode)() 28Dim result = New List(Of SyntaxNode)
Venus\ContainedLanguageStaticEventBinding.vb (1)
133Private Function GetMemberBlockOrBegin(member As ISymbol) As SyntaxNode
Venus\VisualBasicContainedLanguage.vb (2)
160Public Overrides Sub AddIndentBlockOperationsSlow(list As List(Of IndentBlockOperation), node As SyntaxNode, ByRef nextOperation As NextIndentBlockOperationAction) 190Private Shared Function IsEndHelperPattern(node As SyntaxNode) As Boolean
Microsoft.VisualStudio.LanguageServices.Xaml (1)
Features\OrganizeImports\XamlRemoveUnnecessaryImportsService.cs (1)
32Document document, Func<SyntaxNode, bool>? predicate, CancellationToken cancellationToken)
Mvc.Api.Analyzers.Test (3)
ActualApiResponseMetadataFactoryTest.cs (3)
77var methodSyntax = syntaxTree.GetRoot().FindNode(method.Locations[0].SourceSpan); 394var methodSyntax = syntaxTree.GetRoot().FindNode(method.Locations[0].SourceSpan); 413var methodSyntax = syntaxTree.GetRoot().FindNode(method.Locations[0].SourceSpan);
Roslyn.Test.PdbUtilities (8)
EditAndContinue\EditAndContinueTest.cs (6)
34protected abstract Func<SyntaxNode, SyntaxNode> GetEquivalentNodesMap(ISymbol left, ISymbol right); 94var unmappedNodes = new List<SyntaxNode>(); 178List<SyntaxNode> unmappedNodes) 189Func<SyntaxNode, SyntaxNode?>? syntaxMap;
EditAndContinue\SemanticEditDescription.cs (2)
14Func<SyntaxNode, RuntimeRudeEdit?>? rudeEdits = null, 20public readonly Func<SyntaxNode, RuntimeRudeEdit?>? RudeEdits = rudeEdits;
System.Private.CoreLib.Generators (5)
IntrinsicsInSystemPrivateCoreLibAnalyzer.cs (5)
290var propertyDefiningSyntax = symbolInfo.Symbol.DeclaringSyntaxReferences[0].GetSyntax(); 567SyntaxNode? previousNode = null; 570foreach (var ancestorNode in ancestorNodes) 596bool HandleConditionalCase(ExpressionSyntax condition, SyntaxNode? syntaxOnPositiveCondition, SyntaxNode? syntaxOnNegativeCondition)
System.Text.Json.SourceGeneration (1)
JsonSourceGenerator.Roslyn3.11.cs (1)
111private static bool IsSyntaxTargetForGeneration(SyntaxNode node) => node is ClassDeclarationSyntax { AttributeLists.Count: > 0, BaseList.Types.Count: > 0 };
System.Text.RegularExpressions.Generator (20)
RegexGenerator.Parser.cs (1)
252static Location GetComparableLocation(SyntaxNode syntax)
UpgradeToGeneratedRegexAnalyzer.cs (2)
111SyntaxNode? syntaxNodeForDiagnostic = invocationOperation.Syntax; 143SyntaxNode? syntaxNodeForDiagnostic = operation.Syntax;
UpgradeToGeneratedRegexCodeFixer.cs (17)
45SyntaxNode? root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); 51SyntaxNode nodeToFix = root.FindNode(context.Span, getInnermostNodeForTie: true); 75private static async Task<Document> ConvertToSourceGenerator(Document document, SyntaxNode root, SyntaxNode nodeToFix, CancellationToken cancellationToken) 102SyntaxNode? typeDeclarationOrCompilationUnit = nodeToFix.Ancestors().OfType<TypeDeclarationSyntax>().FirstOrDefault(); 152SyntaxNode newTypeDeclarationOrCompilationUnit = typeDeclarationOrCompilationUnit; 160SyntaxNode replacement = generator.InvocationExpression(generator.IdentifierName(methodName)); 165IEnumerable<SyntaxNode> arguments = operationArguments 179SyntaxNode? patternValue = GetNode(operationArguments, generator, UpgradeToGeneratedRegexAnalyzer.PatternArgumentName); 180SyntaxNode? regexOptionsValue = GetNode(operationArguments, generator, UpgradeToGeneratedRegexAnalyzer.OptionsArgumentName); 195SyntaxNode? cultureNameValue = null; 223SyntaxNode attributes = generator.Attribute(generator.TypeExpression(generatedRegexAttributeSymbol), attributeArguments: (patternValue, regexOptionsValue, cultureNameValue) switch 228_ => Array.Empty<SyntaxNode>(), 276static SyntaxNode? GetNode(ImmutableArray<IArgumentOperation> arguments, SyntaxGenerator generator, string parameterName) 328static SyntaxNode WithTrivia(SyntaxNode method, SyntaxNode nodeToFix)
System.Windows.Forms.Analyzers.CodeFixes.CSharp (2)
System\Windows\Forms\CSharp\CodeFixes\AddDesignerSerializationVisibility\AddDesignerSerializationVisibilityCodeFixProvider.cs (2)
33SyntaxNode root = (await context 78SyntaxNode root = (await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false))!;
System.Windows.Forms.Analyzers.CodeFixes.VisualBasic (2)
AddDesignerSerializationVisibility\AddDesignerSerializationVisibilityCodeFixProvider.vb (2)
39Dim root As SyntaxNode = Await context. 107Dim root As SyntaxNode = Await document.
System.Windows.Forms.Analyzers.CSharp (2)
System\Windows\Forms\CSharp\Generators\ApplicationConfiguration\ApplicationConfigurationGenerator.cs (2)
58private static string? GetUserProjectNamespace(SyntaxNode node) 108public static bool IsSupportedSyntaxNode(SyntaxNode syntaxNode) =>
System.Windows.Forms.PrivateSourceGenerators (4)
System\Windows\Forms\SourceGenerators\EnumValidationGenerator.cs (4)
40IncrementalValuesProvider<SyntaxNode> argumentsToValidate = context.SyntaxProvider.CreateSyntaxProvider( 72return (SyntaxNode)argumentToValidate; 198private static IEnumerable<EnumValidationInfo> GetEnumValidationInfo(Compilation compilation, ImmutableArray<SyntaxNode> argumentsToValidate, CancellationToken cancellationToken) 209foreach (SyntaxNode argument in argumentsToValidate)