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)
4827switch (context.CodeBlock) 4838switch (context.CodeBlock) 4849switch (context.CodeBlock) 4860switch (context.CodeBlock) 5040switch (context.CodeBlock) 5051switch (context.CodeBlock) 5062switch (context.CodeBlock) 5073switch (context.CodeBlock) 5846switch (context.CodeBlock) 5857switch (context.CodeBlock) 5996switch (context.CodeBlock) 6007switch (context.CodeBlock) 6018switch (context.CodeBlock)
Semantics\RecordTests.cs (8)
27335switch (context.CodeBlock) 27346switch (context.CodeBlock) 27357switch (context.CodeBlock) 27368switch (context.CodeBlock) 27548switch (context.CodeBlock) 27559switch (context.CodeBlock) 27570switch (context.CodeBlock) 27581switch (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)
6572switch (context.CodeBlock) 6583switch (context.CodeBlock) 6722switch (context.CodeBlock) 6733switch (context.CodeBlock) 6744switch (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)
1700Assert.NotNull(context.CodeBlock) 1702context.ReportDiagnostic(Diagnostic.Create(Descriptor, context.CodeBlock.GetLocation)) 1724context.ReportDiagnostic(Diagnostic.Create(Descriptor, context.CodeBlock.GetLocation)) 1827context.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);