72 references to CodeBlock
Microsoft.CodeAnalysis (1)
DiagnosticAnalyzer\DiagnosticAnalysisContext.cs (1)
1169/// Indicates if the <see cref="CodeBlock"/> is generated code.
Microsoft.CodeAnalysis.CodeStyle (7)
src\Analyzers\Core\Analyzers\SimplifyTypeNames\SimplifyTypeNamesDiagnosticAnalyzerBase.cs (6)
105/// <param name="codeBlock">The syntax node provided via <see cref="CodeBlockAnalysisContext.CodeBlock"/>.</param> 226if (_analyzer.IsIgnoredCodeBlock(context.CodeBlock)) 229var (completed, intervalTree) = _codeBlockIntervals.GetOrAdd(context.CodeBlock.SyntaxTree, _ => (new StrongBox<bool>(false), new TextSpanMutableIntervalTree())); 234if (!TryProceedWithInterval(addIfAvailable: false, context.CodeBlock.FullSpan, completed, intervalTree)) 241if (!TryProceedWithInterval(addIfAvailable: root == context.CodeBlock, context.CodeBlock.FullSpan, completed, intervalTree))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\AnalysisContextExtensions.cs (1)
217=> context.CodeBlock.FindNode(context.FilterSpan, findInTrivia, getInnermostNodeForTie);
Microsoft.CodeAnalysis.CSharp.CodeStyle (6)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveUnnecessaryNullableDirectiveDiagnosticAnalyzer.cs (6)
53/// <param name="codeBlock">The syntax node provided via <see cref="CodeBlockAnalysisContext.CodeBlock"/>.</param> 85simplifier.Visit(context.CodeBlock); 272|| IsIgnoredCodeBlock(context.CodeBlock)) 283var syntaxTreeState = GetOrCreateSyntaxTreeState(context.CodeBlock.SyntaxTree, defaultCompleted: false, context.SemanticModel, context.CancellationToken); 284if (!syntaxTreeState.TryProceedWithInterval(context.CodeBlock.FullSpan)) 290syntaxTreeState.TryReportNullableImpactingSpans(context.CodeBlock.FullSpan, nullableImpactingSpans);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (23)
Diagnostics\GetDiagnosticsTests.cs (2)
971blockEndContext.ReportDiagnostic(CodeAnalysis.Diagnostic.Create(DescriptorForBlockEnd, blockEndContext.CodeBlock.GetLocation())); 973if (blockEndContext.CodeBlock is BasePropertyDeclarationSyntax)
Semantics\PrimaryConstructorTests.cs (13)
4828switch (context.CodeBlock) 4839switch (context.CodeBlock) 4850switch (context.CodeBlock) 4861switch (context.CodeBlock) 5041switch (context.CodeBlock) 5052switch (context.CodeBlock) 5063switch (context.CodeBlock) 5074switch (context.CodeBlock) 5847switch (context.CodeBlock) 5858switch (context.CodeBlock) 5997switch (context.CodeBlock) 6008switch (context.CodeBlock) 6019switch (context.CodeBlock)
Semantics\RecordTests.cs (8)
27405switch (context.CodeBlock) 27416switch (context.CodeBlock) 27427switch (context.CodeBlock) 27438switch (context.CodeBlock) 27618switch (context.CodeBlock) 27629switch (context.CodeBlock) 27640switch (context.CodeBlock) 27651switch (context.CodeBlock)
Microsoft.CodeAnalysis.CSharp.Features (7)
Diagnostics\Analyzers\CSharpSimplifyTypeNamesDiagnosticAnalyzer.cs (1)
53Debug.Assert(context.CodeBlock.DescendantNodesAndSelf().Contains(root));
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveUnnecessaryNullableDirectiveDiagnosticAnalyzer.cs (6)
53/// <param name="codeBlock">The syntax node provided via <see cref="CodeBlockAnalysisContext.CodeBlock"/>.</param> 85simplifier.Visit(context.CodeBlock); 272|| IsIgnoredCodeBlock(context.CodeBlock)) 283var syntaxTreeState = GetOrCreateSyntaxTreeState(context.CodeBlock.SyntaxTree, defaultCompleted: false, context.SemanticModel, context.CancellationToken); 284if (!syntaxTreeState.TryProceedWithInterval(context.CodeBlock.FullSpan)) 290syntaxTreeState.TryReportNullableImpactingSpans(context.CodeBlock.FullSpan, nullableImpactingSpans);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (8)
Semantics\RecordStructTests.cs (5)
6644switch (context.CodeBlock) 6655switch (context.CodeBlock) 6794switch (context.CodeBlock) 6805switch (context.CodeBlock) 6816switch (context.CodeBlock)
Semantics\TopLevelStatementsTests.cs (3)
6917Assert.Equal(SyntaxKind.CompilationUnit, context.CodeBlock.Kind()); 6919switch (context.CodeBlock.ToString()) 6933var unit = (CompilationUnitSyntax)context.CodeBlock;
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (4)
Diagnostics\DiagnosticServiceTests.vb (4)
1696Assert.NotNull(context.CodeBlock) 1698context.ReportDiagnostic(Diagnostic.Create(Descriptor, context.CodeBlock.GetLocation)) 1720context.ReportDiagnostic(Diagnostic.Create(Descriptor, context.CodeBlock.GetLocation)) 1823context.ReportDiagnostic(CodeAnalysis.Diagnostic.Create(Descriptor1, context.CodeBlock.GetLocation()))
Microsoft.CodeAnalysis.Features (6)
src\Analyzers\Core\Analyzers\SimplifyTypeNames\SimplifyTypeNamesDiagnosticAnalyzerBase.cs (6)
105/// <param name="codeBlock">The syntax node provided via <see cref="CodeBlockAnalysisContext.CodeBlock"/>.</param> 226if (_analyzer.IsIgnoredCodeBlock(context.CodeBlock)) 229var (completed, intervalTree) = _codeBlockIntervals.GetOrAdd(context.CodeBlock.SyntaxTree, _ => (new StrongBox<bool>(false), new TextSpanMutableIntervalTree())); 234if (!TryProceedWithInterval(addIfAvailable: false, context.CodeBlock.FullSpan, completed, intervalTree)) 241if (!TryProceedWithInterval(addIfAvailable: root == context.CodeBlock, context.CodeBlock.FullSpan, completed, intervalTree))
Microsoft.CodeAnalysis.Test.Utilities (3)
Diagnostics\CommonDiagnosticAnalyzers.cs (2)
2801ReportDiagnostics("RegisterCodeBlockAction", codeBlockContext.CodeBlock.SyntaxTree, codeBlockContext.OwningSymbol, codeBlockContext.ReportDiagnostic)); 2812ReportDiagnostics("RegisterCodeBlockEndAction", codeBlockEndContext.CodeBlock.SyntaxTree, codeBlockEndContext.OwningSymbol, codeBlockEndContext.ReportDiagnostic));
Diagnostics\TestDiagnosticAnalyzer.cs (1)
55OnAbstractMember("CodeBlock", context.CodeBlock, context.OwningSymbol);
Microsoft.CodeAnalysis.UnitTests (1)
Diagnostics\AnalysisContextInfoTests.cs (1)
72c.RegisterCodeBlockAction(b => ThrowIfMatch(nameof(c.RegisterCodeBlockAction), new AnalysisContextInfo(b.SemanticModel.Compilation, b.OwningSymbol, b.CodeBlock)));
Microsoft.CodeAnalysis.VisualBasic.Features (1)
Diagnostics\Analyzers\VisualBasicSimplifyTypeNamesDiagnosticAnalyzer.vb (1)
39Debug.Assert(context.CodeBlock.DescendantNodesAndSelf().Contains(root))
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (4)
Diagnostics\GetDiagnosticsTests.vb (4)
632context.ReportDiagnostic(CodeAnalysis.Diagnostic.Create(DescriptorForBlockEnd, context.CodeBlock.GetLocation())) 634If TryCast(context.CodeBlock, PropertyBlockSyntax) IsNot Nothing OrElse 635TryCast(context.CodeBlock, EventBlockSyntax) IsNot Nothing Then 636Throw New Exception($"Unexpected topmost node for code block '{context.CodeBlock.Kind()}'")
Microsoft.CodeAnalysis.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\AnalysisContextExtensions.cs (1)
217=> context.CodeBlock.FindNode(context.FilterSpan, findInTrivia, getInnermostNodeForTie);