751 references to SyntaxTree
ConfigurationSchemaGenerator (1)
RuntimeSource\Configuration.Binder\Specs\InterceptorInfo.cs (1)
179SyntaxTree operationSyntaxTree = invocation.Syntax.SyntaxTree;
Microsoft.Analyzers.Extra (2)
CallAnalysis\Fixers\LegacyLoggingFixer.cs (2)
281return (proj.Solution, cl, proj.GetDocument(cl.SyntaxTree)!); 628var semanticModel = comp.GetSemanticModel(targetClass.SyntaxTree);
Microsoft.AspNetCore.App.Analyzers (3)
Infrastructure\VirtualChars\CSharpVirtualCharService.cs (1)
199var parentSourceText = parentExpression.SyntaxTree.GetText();
RouteHandlers\RouteHandlerAnalyzer.cs (1)
128var methodOperation = syntaxNode.SyntaxTree == invocation.SemanticModel!.SyntaxTree
WebApplicationBuilder\WebApplicationBuilderAnalyzer.cs (1)
301location = Location.Create(operation.Syntax.SyntaxTree, targetSpan);
Microsoft.AspNetCore.Http.RequestDelegateGenerator (3)
StaticRouteHandlerModel\Endpoint.cs (2)
164var lineSpan = operation.Syntax.SyntaxTree.GetLineSpan(invocationNameSpan); 166var filePath = operation.Syntax.SyntaxTree.GetInterceptorFilePath(operation.SemanticModel?.Compilation.Options.SourceReferenceResolver);
StaticRouteHandlerModel\InvocationOperationExtensions.cs (1)
112var targetSemanticModel = semanticModel?.Compilation.GetSemanticModel(expr.SyntaxTree);
Microsoft.AspNetCore.SignalR.Client.SourceGenerator (5)
HubClientProxyGenerator.Parser.cs (3)
208var registerCallbackProviderSemanticModel = _compilation.GetSemanticModel(methodDeclarationSyntax.SyntaxTree); 251var argModel = _compilation.GetSemanticModel(argType.SyntaxTree); 260var argModel = _compilation.GetSemanticModel(als.Arguments[0].Expression.SyntaxTree);
HubServerProxyGenerator.Parser.cs (2)
197var getProxySemanticModel = _compilation.GetSemanticModel(methodDeclarationSyntax.SyntaxTree); 236var argumentModel = _compilation.GetSemanticModel(proxyType.SyntaxTree);
Microsoft.CodeAnalysis (35)
Diagnostic\SourceLocation.cs (1)
27: this(node.SyntaxTree, node.Span)
DiagnosticAnalyzer\AnalysisContextInfo.cs (3)
43this(compilation: compilation, operation: null, symbol: null, file: new SourceOrAdditionalFile(node.SyntaxTree), node) 48this(compilation: compilation, operation: operation, symbol: null, file: new SourceOrAdditionalFile(operation.Syntax.SyntaxTree), node: operation.Syntax) 53this(compilation: compilation, operation: null, symbol: symbol, file: new SourceOrAdditionalFile(node.SyntaxTree), node)
DiagnosticAnalyzer\AnalyzerExecutor.cs (7)
648Debug.Assert(!IsAnalyzerSuppressedForTree(syntaxNodeAction.Analyzer, node.SyntaxTree, cancellationToken)); 771IsAnalyzerSuppressedForTree(analyzer, declaredNode.SyntaxTree, cancellationToken)) 824GetControlFlowGraph, declaredNode.SyntaxTree, filterSpan, isGeneratedCode, cancellationToken); 886Debug.Assert(!IsAnalyzerSuppressedForTree(analyzer, declaredNode.SyntaxTree, cancellationToken)); 909AnalyzerOptions, addDiagnostic, isSupportedDiagnostic, GetControlFlowGraph, declaredNode.SyntaxTree, filterSpan, isGeneratedCode, cancellationToken); 1469_isGeneratedCodeLocation(node.SyntaxTree, node.Span, cancellationToken)) 1481_isGeneratedCodeLocation(operation.Syntax.SyntaxTree, operation.Syntax.Span, cancellationToken))
DiagnosticAnalyzer\DiagnosticAnalysisContext.cs (6)
1087FilterTree = codeBlock.SyntaxTree; 1201FilterTree = codeBlock.SyntaxTree; 1296filterTree: operationBlocks[0].Syntax.SyntaxTree, filterSpan: null, isGeneratedCode: false, cancellationToken) 1440filterTree: operationBlocks[0].Syntax.SyntaxTree, filterSpan: null, isGeneratedCode: false, cancellationToken) 1744FilterTree = node.SyntaxTree; 1853FilterTree = operation.Syntax.SyntaxTree;
Emit\EditAndContinue\EncVariableSlotAllocator.cs (1)
107return _mappedMethod.PreviousMethod.CalculateLocalSyntaxOffset(_lambdaSyntaxFacts.GetDeclaratorPosition(node), node.SyntaxTree);
Operations\OperationExtensions.cs (2)
51if (model is null || model.SyntaxTree != operation.Syntax.SyntaxTree) 53model = compilation.GetSemanticModel(operation.Syntax.SyntaxTree);
SourceGeneration\GeneratorSyntaxWalker.cs (2)
26&& model.Value.SyntaxTree == node.SyntaxTree); 30Debug.Assert(model.Value.SyntaxTree == child.SyntaxTree);
SourceGeneration\Nodes\SyntaxValueProvider_ForAttributeWithMetadataName.cs (2)
97Debug.Assert(syntaxNodes.All(n => n.SyntaxTree == syntaxTree)); 142var targetSyntaxTree = attributeTarget.SyntaxTree;
Syntax\SyntaxList.cs (1)
27protected override SyntaxTree SyntaxTreeCore => this.Parent!.SyntaxTree;
Syntax\SyntaxNode.cs (7)
75/// Returns <see cref="SyntaxTree"/> that owns the node. 353/// occurs when a <see cref="SyntaxTree"/> is incrementally parsed using <see cref="SyntaxTree.WithChangedText"/> 675return this.SyntaxTree.GetLocation(this.Span); 691var tree = this.SyntaxTree; 704return this.SyntaxTree.GetDiagnostics(this); 714return this.SyntaxTree.GetReference(this); 974SyntaxNode? cuRoot = node.SyntaxTree?.GetRoot();
Syntax\SyntaxNodeOrToken.cs (1)
823public SyntaxTree? SyntaxTree => _nodeOrParent?.SyntaxTree;
Syntax\SyntaxToken.cs (1)
637public SyntaxTree? SyntaxTree => Parent?.SyntaxTree;
Syntax\TranslationSyntaxReference.cs (1)
37Debug.Assert(node.SyntaxTree == _reference.SyntaxTree);
Microsoft.CodeAnalysis.CodeStyle (34)
src\Analyzers\Core\Analyzers\AbstractBuiltInCodeStyleDiagnosticAnalyzer_Core.cs (1)
94=> ShouldSkipAnalysis(context.Node.SyntaxTree, context.Options, context.Compilation.Options, notification, context.CancellationToken);
src\Analyzers\Core\Analyzers\MatchFolderAndNamespace\AbstractMatchFolderAndNamespaceDiagnosticAnalyzer.cs (3)
95var root = namespaceDeclaration.SyntaxTree.GetRoot(cancellationToken); 141if (!PathUtilities.IsChildPath(projectDir, namespaceDeclaration.SyntaxTree.FilePath)) 150PathUtilities.GetDirectoryName(namespaceDeclaration.SyntaxTree.FilePath)!);
src\Analyzers\Core\Analyzers\PopulateSwitch\AbstractPopulateSwitchDiagnosticAnalyzer.cs (1)
68if (switchBlock.SyntaxTree.OverlapsHiddenPosition(switchBlock.Span, context.CancellationToken))
src\Analyzers\Core\Analyzers\RemoveUnnecessaryCast\AbstractRemoveUnnecessaryCastDiagnosticAnalyzer.cs (1)
73node.SyntaxTree.GetLocation(GetFadeSpan(node)),
src\Analyzers\Core\Analyzers\RemoveUnnecessaryParentheses\AbstractRemoveUnnecessaryParenthesesDiagnosticAnalyzer.cs (2)
131var lines = parenthesizedExpression.SyntaxTree.GetText(cancellationToken).Lines; 135return Location.Create(parenthesizedExpression.SyntaxTree, TextSpan.FromBounds(parenthesizedExpressionLocation.SourceSpan.Start, textSpanEndPosition));
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (3)
99if (!symbolStartAnalyzer._compilationAnalyzer.TryGetOptions(firstBlock.Syntax.SyntaxTree, 116firstBlock.Syntax.SyntaxTree != filterTree) 126var root = firstBlock.Syntax.SyntaxTree.GetRoot(context.CancellationToken);
src\Analyzers\Core\Analyzers\SimplifyInterpolation\AbstractSimplifyInterpolationHelpers.cs (1)
50.SelectAsArray(interpolation.Syntax.SyntaxTree.GetLocation);
src\Analyzers\Core\Analyzers\SimplifyTypeNames\SimplifyTypeNamesDiagnosticAnalyzerBase.cs (1)
229var (completed, intervalTree) = _codeBlockIntervals.GetOrAdd(context.CodeBlock.SyntaxTree, _ => (new StrongBox<bool>(false), new TextSpanMutableIntervalTree()));
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (1)
212if (node is TPropertyDeclaration or TFieldDeclaration && context.ShouldAnalyzeSpan(node.Span, node.SyntaxTree))
src\Analyzers\Core\Analyzers\UseCollectionInitializer\AbstractUseCollectionInitializerAnalyzer.cs (1)
206if (!this.SyntaxFacts.SupportsIndexingInitializer(statement.SyntaxTree.Options))
src\Analyzers\Core\Analyzers\UseCollectionInitializer\UpdateExpressionState.cs (1)
433return @this.SyntaxFacts.SupportsCollectionExpressionNaturalType(ifStatement.SyntaxTree.Options)
src\Analyzers\Core\Analyzers\UseCollectionInitializer\UseCollectionInitializerHelpers.cs (1)
27var syntaxTree = match.SyntaxTree;
src\Analyzers\Core\Analyzers\UseCompoundAssignment\AbstractUseCompoundAssignmentDiagnosticAnalyzer.cs (1)
79var syntaxTree = assignment.SyntaxTree;
src\Analyzers\Core\Analyzers\UseConditionalExpression\UseConditionalExpressionHelpers.cs (1)
93if (!syntaxFacts.SupportsThrowExpression(anyThrow.Syntax.SyntaxTree.Options))
src\Analyzers\Core\Analyzers\UseObjectInitializer\AbstractUseObjectInitializerDiagnosticAnalyzer.cs (1)
140var syntaxTree = context.Node.SyntaxTree;
src\Analyzers\Core\Analyzers\UseSystemHashCode\UseSystemHashCodeDiagnosticAnalyzer.cs (1)
72var option = context.Options.GetAnalyzerOptions(operation.Syntax.SyntaxTree).PreferSystemHashCode;
src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (1)
353context.Node.SyntaxTree,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
316=> node.SyntaxTree.OverlapsHiddenPosition(span, cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTokenExtensions.cs (1)
95? ((ICompilationUnitSyntax)token.Parent!.SyntaxTree!.GetRoot(CancellationToken.None)).EndOfFileToken
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.cs (2)
21if (root.SyntaxTree == null || !root.SyntaxTree.TryGetText(out var text))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.StructuredTrivia.cs (6)
51if (root.SyntaxTree != null && root.SyntaxTree.GetText() != null) 53return root.SyntaxTree.GetText(); 57if (parent != null && parent.SyntaxTree != null && parent.SyntaxTree.GetText() != null) 59return parent.SyntaxTree.GetText();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\AbstractDocumentationCommentService.cs (1)
84var syntaxTree = documentationComment.SyntaxTree;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.BodyLevelSymbolKey.cs (1)
258Contract.ThrowIfTrue(semanticModel.SyntaxTree != containerDeclaration.SyntaxTree);
Microsoft.CodeAnalysis.CodeStyle.Fixes (13)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (4)
242var destinationTree = destinationDeclaration.SyntaxTree; 246var info = GetInfo(context.Context, codeGenOptions, destinationDeclaration.SyntaxTree.Options); 494if (location.SourceTree != destinationMember.SyntaxTree) 527var root = attributeToRemove.SyntaxTree.GetRoot();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (1)
66var syntaxTree = destination.SyntaxTree;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (2)
203afterSourceTree.FilePath == declarationList.FirstOrDefault()?.SyntaxTree.FilePath) 219beforeSourceTree.FilePath == declarationList.FirstOrDefault()?.SyntaxTree.FilePath)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\AddParameterEditor.cs (2)
25var sourceText = declaration.SyntaxTree.GetText(cancellationToken); 159var text = parameters[0].SyntaxTree.GetText(cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_Negate.cs (1)
559if (syntaxFacts.SupportsNotPattern(pattern.SyntaxTree.Options) &&
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\ParsedDocument.cs (2)
30public SyntaxTree SyntaxTree => Root.SyntaxTree; 59var text = root.SyntaxTree.GetText(cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\SyntacticDocument.cs (1)
26public SyntaxTree SyntaxTree => Root.SyntaxTree;
Microsoft.CodeAnalysis.CSharp (39)
Binder\Binder_Conversions.cs (1)
409Debug.Assert(syntax.SyntaxTree is object);
Binder\Binder_Expressions.cs (3)
2216return node.SyntaxTree == declarator.SyntaxTree; 3266(field = member as GlobalExpressionVariable)?.SyntaxTree == node.SyntaxTree && 9138location = expr.Syntax.SyntaxTree.GetLocation(TextSpan.FromBounds(expr.Syntax.SpanStart, conditional.OperatorToken.Span.End));
Binder\Binder_Symbols.cs (1)
2748=> CheckFeatureAvailability(syntax.SyntaxTree, feature, diagnostics, (location, syntax), static tuple => tuple.location ?? tuple.syntax.GetLocation());
Binder\ForEachLoopBinder.cs (2)
1454else if (result.CallsAreOmitted(syntax.SyntaxTree)) 1519if (result.CallsAreOmitted(syntax.SyntaxTree))
BoundTree\BoundNode.cs (1)
149return Syntax?.SyntaxTree;
CodeGen\CodeGenerator.cs (5)
176int syntaxOffset = _method.CalculateLocalSyntaxOffset(LambdaUtilities.GetDeclaratorPosition(bodySyntax), bodySyntax.SyntaxTree); 447EmitStepThroughSequencePoint(node.Syntax.SyntaxTree, span); 452EmitStepThroughSequencePoint(node.Syntax.SyntaxTree, node.Span); 481_builder.SetInitialDebugDocument(_methodBodySyntaxOpt.SyntaxTree); 493EmitSequencePoint(syntax.SyntaxTree, syntax.Span);
CodeGen\EmitStatement.cs (1)
1868int syntaxOffset = _method.CalculateLocalSyntaxOffset(LambdaUtilities.GetDeclaratorPosition(syntax), syntax.SyntaxTree);
Compilation\CSharpCompilation.cs (3)
244return IsNullableAnalysisEnabledIn((CSharpSyntaxTree)syntax.SyntaxTree, syntax.Span); 4568var comparison = CompareSyntaxTreeOrdering(loc1.SyntaxTree, loc2.SyntaxTree);
Compilation\CSharpCompilationExtensions.cs (1)
19return ((CSharpParseOptions?)syntax?.SyntaxTree.Options)?.IsFeatureEnabled(feature) == true;
Compilation\CSharpSemanticModel.cs (2)
1233return node.SyntaxTree == this.SyntaxTree; 5223var tree = nameSyntax.SyntaxTree;
Compilation\SpeculativeSemanticModelWithMemberModel.cs (1)
145if (node.SyntaxTree != SyntaxTree)
Compilation\SyntaxTreeSemanticModel.cs (2)
768Debug.Assert(speculativeSyntax.SyntaxTree != SyntaxTree); 773return ((CSharpSyntaxTree)speculativeSyntax.SyntaxTree).IsNullableAnalysisEnabled(speculativeSyntax.Span) ??
Compiler\DocumentationCommentCompiler.DocumentationCommentWalker.cs (1)
142bool diagnose = node.SyntaxTree.ReportDocumentationCommentDiagnostics();
Compiler\MethodCompiler.cs (1)
1128semanticModelWithCachedBoundNodes = (SyntaxTreeSemanticModel)cachingSemanticModelProvider.GetSemanticModel(syntax.SyntaxTree, _compilation);
Errors\MessageID.cs (2)
356syntax.SyntaxTree.Options, 384syntax.SyntaxTree.Options,
Lowering\ClosureConversion\ClosureConversion.Analysis.cs (1)
557int syntaxOffset = _topLevelMethod.CalculateLocalSyntaxOffset(LambdaUtilities.GetDeclaratorPosition(syntax), syntax.SyntaxTree);
Lowering\ClosureConversion\ClosureConversion.cs (1)
1506int syntaxOffset = _topLevelMethod.CalculateLocalSyntaxOffset(LambdaUtilities.GetDeclaratorPosition(lambdaOrLambdaBodySyntax), lambdaOrLambdaBodySyntax.SyntaxTree);
Lowering\Instrumentation\CodeCoverageInstrumenter.cs (2)
487path = syntax.SyntaxTree.FilePath; 495return AddAnalysisPoint(syntaxForSpan, syntaxForSpan.SyntaxTree.GetMappedLineSpan(alternateSpan), statementFactory);
Lowering\MethodToClassRewriter.cs (1)
738: base(containingType, methodBeingWrapped, syntax.SyntaxTree.GetReference(syntax), syntax.GetLocation(), name, DeclarationModifiers.Private,
Lowering\StateMachineRewriter\MethodToStateMachineRewriter.cs (2)
228int syntaxOffset = CurrentMethod.CalculateLocalSyntaxOffset(node.SpanStart, node.SyntaxTree); 541syntaxOffset = OriginalMethod.CalculateLocalSyntaxOffset(LambdaUtilities.GetDeclaratorPosition(awaitSyntaxOpt), awaitSyntaxOpt.SyntaxTree);
Lowering\StateMachineRewriter\StateMachineRewriter.cs (1)
197int syntaxOffset = method.CalculateLocalSyntaxOffset(LambdaUtilities.GetDeclaratorPosition(declaratorSyntax), declaratorSyntax.SyntaxTree);
Symbols\Source\SourceComplexParameterSymbol.cs (1)
304var binderFactory = compilation.GetBinderFactory(syntax.SyntaxTree);
Symbols\Source\SourceMethodSymbolWithAttributes.cs (1)
1179var interceptorsNamespaces = ((CSharpParseOptions)attributeSyntax.SyntaxTree.Options).InterceptorsNamespaces;
Syntax\SimpleSyntaxReference.cs (1)
26return _node.SyntaxTree;
Syntax\StructuredTriviaSyntax.cs (1)
17: base(green, position, parent == null ? null : parent.SyntaxTree)
Microsoft.CodeAnalysis.CSharp.CodeStyle (33)
src\Analyzers\CSharp\Analyzers\ConvertNamespace\ConvertNamespaceAnalysis.cs (1)
41=> CanOfferUseFileScoped(option, root, declaration, forAnalyzer, root.SyntaxTree.Options.LanguageVersion());
src\Analyzers\CSharp\Analyzers\ConvertNamespace\ConvertToBlockScopedNamespaceDiagnosticAnalyzer.cs (1)
55: declaration.SyntaxTree.GetLocation(TextSpan.FromBounds(declaration.SpanStart, declaration.SemicolonToken.Span.End));
src\Analyzers\CSharp\Analyzers\ConvertNamespace\ConvertToFileScopedNamespaceDiagnosticAnalyzer.cs (2)
35var syntaxTree = namespaceDeclaration.SyntaxTree; 58: declaration.SyntaxTree.GetLocation(TextSpan.FromBounds(declaration.SpanStart, declaration.Name.Span.End));
src\Analyzers\CSharp\Analyzers\ConvertProgram\ConvertProgramAnalysis_ProgramMain.cs (1)
71root.SyntaxTree,
src\Analyzers\CSharp\Analyzers\InlineDeclaration\CSharpInlineDeclarationDiagnosticAnalyzer.cs (1)
66var syntaxTree = context.Node.SyntaxTree;
src\Analyzers\CSharp\Analyzers\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessAnalyzer.cs (2)
52if (ifStatement.SyntaxTree.Options.LanguageVersion() < LanguageVersion.CSharp6) 175var tree = syntaxContext.Node.SyntaxTree;
src\Analyzers\CSharp\Analyzers\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyAnalyzer.cs (2)
71var options = context.GetCSharpAnalyzerOptions(declaration.SyntaxTree); 73if (!option.Value || ShouldSkipAnalysis(declaration.SyntaxTree, context.Options, context.Compilation.Options, option.Notification, cancellationToken))
src\Analyzers\CSharp\Analyzers\MakeStructReadOnly\CSharpMakeStructReadOnlyDiagnosticAnalyzer.cs (2)
95var options = context.GetCSharpAnalyzerOptions(typeDeclaration.SyntaxTree); 97if (!option.Value || ShouldSkipAnalysis(typeDeclaration.SyntaxTree, context.Options, context.Compilation.Options, option.Notification, cancellationToken))
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveUnnecessaryNullableDirectiveDiagnosticAnalyzer.cs (1)
283var syntaxTreeState = GetOrCreateSyntaxTreeState(context.CodeBlock.SyntaxTree, defaultCompleted: false, context.SemanticModel, context.CancellationToken);
src\Analyzers\CSharp\Analyzers\RemoveUnreachableCode\CSharpRemoveUnreachableCodeDiagnosticAnalyzer.cs (2)
117var firstStatementLocation = root.SyntaxTree.GetLocation(firstUnreachableStatement.FullSpan); 135var location = root.SyntaxTree.GetLocation(span);
src\Analyzers\CSharp\Analyzers\UseAutoProperty\CSharpUseAutoPropertyAnalyzer.cs (1)
165? location.SyntaxTree.GetRoot(cancellationToken)
src\Analyzers\CSharp\Analyzers\UseDefaultLiteral\CSharpUseDefaultLiteralDiagnosticAnalyzer.cs (2)
41var syntaxTree = context.Node.SyntaxTree; 57additionalUnnecessaryLocations: [defaultExpression.SyntaxTree.GetLocation(fadeSpan)]));
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyHelper`1.cs (1)
142var languageVersion = body.SyntaxTree.Options.LanguageVersion();
src\Analyzers\CSharp\Analyzers\UseExpressionBodyForLambda\UseExpressionBodyForLambdaDiagnosticAnalyzer.cs (1)
104=> Location.Create(declaration.SyntaxTree,
src\Analyzers\CSharp\Analyzers\UseExpressionBodyForLambda\UseExpressionBodyForLambdaHelpers.cs (1)
55var languageVersion = declaration.SyntaxTree.Options.LanguageVersion();
src\Analyzers\CSharp\Analyzers\UseImplicitObjectCreation\CSharpUseImplicitObjectCreationDiagnosticAnalyzer.cs (1)
41var syntaxTree = context.Node.SyntaxTree;
src\Analyzers\CSharp\Analyzers\UseImplicitOrExplicitType\CSharpTypeStyleDiagnosticAnalyzerBase.cs (1)
59=> DiagnosticHelper.Create(descriptor, declaration.SyntaxTree.GetLocation(diagnosticSpan), notificationOption, analyzerOptions, additionalLocations: null, properties: null);
src\Analyzers\CSharp\Analyzers\UseInferredMemberName\CSharpUseInferredMemberNameDiagnosticAnalyzer.cs (2)
44var syntaxTree = context.Node.SyntaxTree; 89additionalUnnecessaryLocations: [context.Node.SyntaxTree.GetLocation(fadeSpan)]));
src\Analyzers\CSharp\Analyzers\UsePatternCombinators\CSharpUsePatternCombinatorsDiagnosticAnalyzer.cs (1)
59var syntaxTree = expression.SyntaxTree;
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.cs (1)
57var syntaxTree = node.SyntaxTree;
src\Analyzers\CSharp\Analyzers\UsePrimaryConstructor\CSharpUsePrimaryConstructorDiagnosticAnalyzer.cs (1)
389var semanticModel = compilation.GetSemanticModel(primaryConstructorDeclaration.SyntaxTree);
src\Analyzers\CSharp\Analyzers\UseUnboundGenericTypeInNameOf\CSharpUseUnboundGenericTypeInNameOfDiagnosticAnalyzer.cs (1)
80additionalUnnecessaryLocations: [invocation.SyntaxTree.GetLocation(
src\Analyzers\CSharp\Analyzers\UseUtf8StringLiteral\UseUtf8StringLiteralDiagnosticAnalyzer.cs (1)
125var location = Location.Create(syntaxNode.SyntaxTree, span);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\EmbeddedLanguages\VirtualChars\CSharpVirtualCharService.cs (1)
188var parentSourceText = parentExpression.SyntaxTree.GetText();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (1)
24=> ((CSharpParseOptions)node.SyntaxTree.Options).LanguageVersion;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SuppressFormattingRule.cs (1)
331? ((CompilationUnitSyntax)structure.SyntaxTree.GetRoot(CancellationToken.None)).EndOfFileToken
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (13)
src\Analyzers\CSharp\CodeFixes\RemoveUnusedParametersAndValues\CSharpRemoveUnusedValuesCodeFixProvider.cs (1)
101parent.SyntaxTree.Options.LanguageVersion() >= LanguageVersion.CSharp9)
src\Analyzers\CSharp\CodeFixes\UseDefaultLiteral\CSharpUseDefaultLiteralCodeFixProvider.cs (1)
50var parseOptions = (CSharpParseOptions)originalRoot.SyntaxTree.Options;
src\Analyzers\CSharp\CodeFixes\UseIsNullCheck\CSharpUseIsNullCheckForCastAndEqualityOperatorCodeFixProvider.cs (1)
78if (SupportsIsNotPattern(binary.SyntaxTree.Options))
src\Analyzers\CSharp\CodeFixes\UseIsNullCheck\CSharpUseIsNullCheckForReferenceEqualsCodeFixProvider.cs (1)
41if (SupportsIsNotPattern(argument.SyntaxTree.Options))
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (1)
533foreach (var group in removedMembers.Values.GroupBy(n => n.memberNode.SyntaxTree))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationHelpers.cs (2)
75var syntaxTree = destination.SyntaxTree; 84var tree = node.SyntaxTree.WithRootAndOptions(node, syntaxTree.Options);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\CompilationUnitSyntaxExtensions.cs (3)
24if (!allowInHiddenRegions && contextNode.SyntaxTree.HasHiddenRegions()) 27var root = (CompilationUnitSyntax)contextNode.SyntaxTree.GetRoot(cancellationToken); 30if (contextNode.SyntaxTree.OverlapsHiddenPosition(span, cancellationToken))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Indentation\CSharpIndentationService.cs (1)
145var text = node.SyntaxTree.GetText();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\InitializeParameterHelpers.cs (2)
63var editingDocument = solution.GetRequiredDocument(propertyDeclaration.SyntaxTree); 83var editingDocument = solution.GetRequiredDocument(variableDeclarator.SyntaxTree);
Microsoft.CodeAnalysis.CSharp.EditorFeatures (2)
EventHookup\EventHookupCommandHandler_TabKeyCommand.cs (1)
307var codeGenOptions = codeGenerator.GetInfo(new CodeGenerationContext(afterThisLocation: eventHookupExpression.GetLocation()), options, root.SyntaxTree.Options);
GoToBase\CSharpGoToBaseService.cs (1)
32var document = solution.GetDocument(constructorDeclaration.SyntaxTree);
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (1)
SymbolKey\SymbolKeyTestBase.cs (1)
283var model = _compilation.GetSemanticModel(declarator.SyntaxTree);
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (3)
Emit\EditAndContinue\EditAndContinueTestBase.cs (1)
94Assert.Equal(s1.SyntaxTree, tree1);
PDB\PDBTests.cs (2)
135").SyntaxTree; 138").SyntaxTree;
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (50)
Semantics\OutVarTests.cs (19)
3467tree = initializer.SyntaxTree; 3508tree = initializer.SyntaxTree; 4007tree = statement.SyntaxTree; 5113tree = statement.SyntaxTree; 8807tree = statement.SyntaxTree; 9646tree = statement.SyntaxTree; 10214tree = statement.SyntaxTree; 10863tree = statement.SyntaxTree; 13343tree = statement.SyntaxTree; 13742tree = statement.SyntaxTree; 15263tree = statement.SyntaxTree; 16541tree = statement.SyntaxTree; 17100tree = statement.SyntaxTree; 17536tree = statement.SyntaxTree; 18812var tree = context.Node.SyntaxTree; 21302tree = statement.SyntaxTree; 32511var tree = node1.SyntaxTree; 34339syntaxTree = syntaxTree.GetCompilationUnitRoot().ReplaceNode(rankSpecifierOld, rankSpecifierNew).SyntaxTree; 34553syntaxTree = syntaxTree.GetCompilationUnitRoot().ReplaceNode(rankSpecifierOld, rankSpecifierNew).SyntaxTree;
Semantics\PatternMatchingTests_Scope.cs (13)
412tree = statement.SyntaxTree; 717tree = statement.SyntaxTree; 986tree = statement.SyntaxTree; 1290tree = statement.SyntaxTree; 5346tree = statement.SyntaxTree; 6476tree = statement.SyntaxTree; 6887tree = statement.SyntaxTree; 7216tree = statement.SyntaxTree; 7539tree = statement.SyntaxTree; 9645tree = statement.SyntaxTree; 10208tree = statement.SyntaxTree; 10724tree = statement.SyntaxTree; 12149tree = statement.SyntaxTree;
Semantics\PrimaryConstructorTests.cs (11)
2186var xxDecl = OutVarTests.GetOutVarDeclaration(speculativePrimaryInitializer.SyntaxTree, "xx"); 2187var xxRef = OutVarTests.GetReferences(speculativePrimaryInitializer.SyntaxTree, "xx").ToArray(); 3802Assert.Same(literal.SyntaxTree, context.ContainingSymbol.DeclaringSyntaxReferences.Single().SyntaxTree); 3828Assert.Same(equalsValue.SyntaxTree, context.ContainingSymbol.DeclaringSyntaxReferences.Single().SyntaxTree); 3846Assert.Same(initializer.SyntaxTree, context.ContainingSymbol.DeclaringSyntaxReferences.Single().SyntaxTree); 3877Assert.Same(baseType.SyntaxTree, context.ContainingSymbol.DeclaringSyntaxReferences.Single().SyntaxTree); 3904Assert.Same(@class.SyntaxTree, context.ContainingSymbol.DeclaringSyntaxReferences.Single().SyntaxTree); 5291Assert.Same(literal.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); 5309Assert.Same(equalsValue.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); 5327Assert.Same(initializer.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); 5356Assert.Same(record.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree);
Semantics\RecordTests.cs (7)
22343var xxDecl = OutVarTests.GetOutVarDeclaration(speculativePrimaryInitializer.SyntaxTree, "xx"); 22344var xxRef = OutVarTests.GetReferences(speculativePrimaryInitializer.SyntaxTree, "xx").ToArray(); 26287Assert.Same(literal.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); 26313Assert.Same(equalsValue.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); 26331Assert.Same(initializer.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); 26362Assert.Same(baseType.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); 26385Assert.Same(record.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree);
Microsoft.CodeAnalysis.CSharp.Features (54)
AddImport\CSharpAddImportFeatureService.cs (1)
605return (CompilationUnitSyntax)contextNode.SyntaxTree.GetRoot(cancellationToken);
CodeRefactorings\UseRecursivePatterns\UseRecursivePatternsCodeRefactoringProvider.cs (1)
384if (names.Length > 1 && names[0].SyntaxTree.Options.LanguageVersion() >= LanguageVersion.CSharp10)
Completion\CompletionProviders\OperatorsAndIndexer\UnnamedSymbolCompletionProvider.cs (1)
80if (CompletionUtilities.GetDotTokenLeftOfPosition(root.SyntaxTree, position, cancellationToken) is not SyntaxToken dotToken)
ConvertToRawString\ConvertInterpolatedStringToRawStringCodeRefactoringProvider.cs (3)
253var parsed = (InterpolatedStringExpressionSyntax)ParseExpression(indentedText.ToString(), options: stringExpression.SyntaxTree.Options); 507text ??= stringExpression.SyntaxTree.GetText(cancellationToken); 633var parsed = (InterpolatedStringExpressionSyntax)ParseExpression(builder.ToString(), options: stringExpression.SyntaxTree.Options);
ConvertToRawString\ConvertStringToRawStringCodeRefactoringProvider.cs (1)
192currentExpression.SyntaxTree.GetRoot(cancellationToken), cancellationToken);
Copilot\CSharpCopilotCodeFixProvider.cs (1)
108var memberDeclaration = SyntaxFactory.ParseMemberDeclaration(fix, options: method.SyntaxTree.Options);
EditAndContinue\DeclarationBody\InstanceConstructorDeclarationBody.cs (1)
32=> InitializerActiveStatement.SyntaxTree;
EditAndContinue\DeclarationBody\PropertyOrIndexerAccessorDeclarationBody.cs (1)
62=> RootNode.SyntaxTree;
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.cs (1)
172=> node.SyntaxTree.Options.LanguageVersion() < LanguageVersion.CSharp8;
FullyQualify\CSharpFullyQualifyService.cs (1)
51var syntaxTree = simpleName.SyntaxTree;
GenerateMember\GenerateVariable\CSharpGenerateVariableService.cs (1)
147identifierName.SyntaxTree.GetRoot(cancellationToken);
LanguageServices\CSharpSymbolDisplayService.SymbolDescriptionBuilder.cs (1)
240var semanticModel = GetSemanticModel(equalsValue.SyntaxTree);
LineSeparators\CSharpLineSeparatorService.cs (1)
321if (IsLegalSpanForLineSeparator(node.SyntaxTree, span, cancellationToken))
SignatureHelp\GenericNamePartiallyWrittenSignatureHelpProvider.cs (1)
27=> root.SyntaxTree.IsInPartiallyWrittenGeneric(position, cancellationToken, out genericIdentifier, out lessThanToken);
src\Analyzers\CSharp\Analyzers\ConvertNamespace\ConvertNamespaceAnalysis.cs (1)
41=> CanOfferUseFileScoped(option, root, declaration, forAnalyzer, root.SyntaxTree.Options.LanguageVersion());
src\Analyzers\CSharp\Analyzers\ConvertNamespace\ConvertToBlockScopedNamespaceDiagnosticAnalyzer.cs (1)
55: declaration.SyntaxTree.GetLocation(TextSpan.FromBounds(declaration.SpanStart, declaration.SemicolonToken.Span.End));
src\Analyzers\CSharp\Analyzers\ConvertNamespace\ConvertToFileScopedNamespaceDiagnosticAnalyzer.cs (2)
35var syntaxTree = namespaceDeclaration.SyntaxTree; 58: declaration.SyntaxTree.GetLocation(TextSpan.FromBounds(declaration.SpanStart, declaration.Name.Span.End));
src\Analyzers\CSharp\Analyzers\ConvertProgram\ConvertProgramAnalysis_ProgramMain.cs (1)
71root.SyntaxTree,
src\Analyzers\CSharp\Analyzers\InlineDeclaration\CSharpInlineDeclarationDiagnosticAnalyzer.cs (1)
66var syntaxTree = context.Node.SyntaxTree;
src\Analyzers\CSharp\Analyzers\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessAnalyzer.cs (2)
52if (ifStatement.SyntaxTree.Options.LanguageVersion() < LanguageVersion.CSharp6) 175var tree = syntaxContext.Node.SyntaxTree;
src\Analyzers\CSharp\Analyzers\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyAnalyzer.cs (2)
71var options = context.GetCSharpAnalyzerOptions(declaration.SyntaxTree); 73if (!option.Value || ShouldSkipAnalysis(declaration.SyntaxTree, context.Options, context.Compilation.Options, option.Notification, cancellationToken))
src\Analyzers\CSharp\Analyzers\MakeStructReadOnly\CSharpMakeStructReadOnlyDiagnosticAnalyzer.cs (2)
95var options = context.GetCSharpAnalyzerOptions(typeDeclaration.SyntaxTree); 97if (!option.Value || ShouldSkipAnalysis(typeDeclaration.SyntaxTree, context.Options, context.Compilation.Options, option.Notification, cancellationToken))
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveUnnecessaryNullableDirectiveDiagnosticAnalyzer.cs (1)
283var syntaxTreeState = GetOrCreateSyntaxTreeState(context.CodeBlock.SyntaxTree, defaultCompleted: false, context.SemanticModel, context.CancellationToken);
src\Analyzers\CSharp\Analyzers\RemoveUnreachableCode\CSharpRemoveUnreachableCodeDiagnosticAnalyzer.cs (2)
117var firstStatementLocation = root.SyntaxTree.GetLocation(firstUnreachableStatement.FullSpan); 135var location = root.SyntaxTree.GetLocation(span);
src\Analyzers\CSharp\Analyzers\UseAutoProperty\CSharpUseAutoPropertyAnalyzer.cs (1)
165? location.SyntaxTree.GetRoot(cancellationToken)
src\Analyzers\CSharp\Analyzers\UseDefaultLiteral\CSharpUseDefaultLiteralDiagnosticAnalyzer.cs (2)
41var syntaxTree = context.Node.SyntaxTree; 57additionalUnnecessaryLocations: [defaultExpression.SyntaxTree.GetLocation(fadeSpan)]));
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyHelper`1.cs (1)
142var languageVersion = body.SyntaxTree.Options.LanguageVersion();
src\Analyzers\CSharp\Analyzers\UseExpressionBodyForLambda\UseExpressionBodyForLambdaDiagnosticAnalyzer.cs (1)
104=> Location.Create(declaration.SyntaxTree,
src\Analyzers\CSharp\Analyzers\UseExpressionBodyForLambda\UseExpressionBodyForLambdaHelpers.cs (1)
55var languageVersion = declaration.SyntaxTree.Options.LanguageVersion();
src\Analyzers\CSharp\Analyzers\UseImplicitObjectCreation\CSharpUseImplicitObjectCreationDiagnosticAnalyzer.cs (1)
41var syntaxTree = context.Node.SyntaxTree;
src\Analyzers\CSharp\Analyzers\UseImplicitOrExplicitType\CSharpTypeStyleDiagnosticAnalyzerBase.cs (1)
59=> DiagnosticHelper.Create(descriptor, declaration.SyntaxTree.GetLocation(diagnosticSpan), notificationOption, analyzerOptions, additionalLocations: null, properties: null);
src\Analyzers\CSharp\Analyzers\UseInferredMemberName\CSharpUseInferredMemberNameDiagnosticAnalyzer.cs (2)
44var syntaxTree = context.Node.SyntaxTree; 89additionalUnnecessaryLocations: [context.Node.SyntaxTree.GetLocation(fadeSpan)]));
src\Analyzers\CSharp\Analyzers\UsePatternCombinators\CSharpUsePatternCombinatorsDiagnosticAnalyzer.cs (1)
59var syntaxTree = expression.SyntaxTree;
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.cs (1)
57var syntaxTree = node.SyntaxTree;
src\Analyzers\CSharp\Analyzers\UsePrimaryConstructor\CSharpUsePrimaryConstructorDiagnosticAnalyzer.cs (1)
389var semanticModel = compilation.GetSemanticModel(primaryConstructorDeclaration.SyntaxTree);
src\Analyzers\CSharp\Analyzers\UseUnboundGenericTypeInNameOf\CSharpUseUnboundGenericTypeInNameOfDiagnosticAnalyzer.cs (1)
80additionalUnnecessaryLocations: [invocation.SyntaxTree.GetLocation(
src\Analyzers\CSharp\Analyzers\UseUtf8StringLiteral\UseUtf8StringLiteralDiagnosticAnalyzer.cs (1)
125var location = Location.Create(syntaxNode.SyntaxTree, span);
src\Analyzers\CSharp\CodeFixes\RemoveUnusedParametersAndValues\CSharpRemoveUnusedValuesCodeFixProvider.cs (1)
101parent.SyntaxTree.Options.LanguageVersion() >= LanguageVersion.CSharp9)
src\Analyzers\CSharp\CodeFixes\UseDefaultLiteral\CSharpUseDefaultLiteralCodeFixProvider.cs (1)
50var parseOptions = (CSharpParseOptions)originalRoot.SyntaxTree.Options;
src\Analyzers\CSharp\CodeFixes\UseIsNullCheck\CSharpUseIsNullCheckForCastAndEqualityOperatorCodeFixProvider.cs (1)
78if (SupportsIsNotPattern(binary.SyntaxTree.Options))
src\Analyzers\CSharp\CodeFixes\UseIsNullCheck\CSharpUseIsNullCheckForReferenceEqualsCodeFixProvider.cs (1)
41if (SupportsIsNotPattern(argument.SyntaxTree.Options))
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (1)
533foreach (var group in removedMembers.Values.GroupBy(n => n.memberNode.SyntaxTree))
Structure\Providers\ArgumentListStructureProvider.cs (1)
36var text = node.SyntaxTree.GetText(cancellationToken);
Structure\Providers\IfDirectiveTriviaStructureProvider.cs (1)
40text ??= node.SyntaxTree.GetText(cancellationToken);
Structure\Providers\StringLiteralExpressionStructureProvider.cs (1)
49var sourceText = node.SyntaxTree.GetText(cancellationToken);
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (6)
IOperation\IOperationTests_IConversionExpression.cs (2)
176var typeInfo = compilation.GetSemanticModel(syntax.SyntaxTree).GetTypeInfo(initializerSyntax); 5380var semanticModel = compilation.GetSemanticModel(finalSyntax.SyntaxTree);
IOperation\IOperationTests_IVariableDeclaration.cs (4)
1218syntaxTree = syntaxTree.GetCompilationUnitRoot().ReplaceNode(rankSpecifierOld, rankSpecifierNew).SyntaxTree; 2304syntaxTree = syntaxTree.GetCompilationUnitRoot().ReplaceNode(rankSpecifierOld, rankSpecifierNew).SyntaxTree; 2365syntaxTree = syntaxTree.GetCompilationUnitRoot().ReplaceNode(rankSpecifierOld, rankSpecifierNew).SyntaxTree; 2833syntaxTree = syntaxTree.GetCompilationUnitRoot().ReplaceNode(rankSpecifierOld, rankSpecifierNew).SyntaxTree;
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (23)
Semantics\ReadOnlyStructsTests.cs (1)
1267var semanticModel = comp.GetSemanticModel(testMethodSyntax.SyntaxTree);
Semantics\RecordStructTests.cs (4)
5990Assert.Same(literal.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); 6008Assert.Same(equalsValue.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); 6026Assert.Same(initializer.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree); 6055Assert.Same(record.SyntaxTree, context.ContainingSymbol!.DeclaringSyntaxReferences.Single().SyntaxTree);
Semantics\ScriptSemanticsTests.cs (3)
1180var syntaxTree = compilationUnit.SyntaxTree; 1268var syntaxTree1 = compilationUnit.SyntaxTree; 1307var syntaxTree = compilationUnit.SyntaxTree;
Semantics\SyntaxTreeRootTests.cs (5)
89var tree = node.SyntaxTree; 90Assert.Equal(tree, node.SyntaxTree); 98var childTree = node.Operand.SyntaxTree; 99var parentTree = node.SyntaxTree; 108Assert.Equal(tree, tree.GetRoot().DescendantNodes().OfType<ClassDeclarationSyntax>().Single().SyntaxTree);
Semantics\TopLevelStatementsTests.cs (2)
6455Assert.Same(globalStatement.SyntaxTree, context.ContainingSymbol.DeclaringSyntaxReferences.Single().SyntaxTree); 6721Assert.Same(context.ContainingSymbol.DeclaringSyntaxReferences.Single().SyntaxTree, context.Operation.Syntax.SyntaxTree);
SourceGeneration\GeneratorDriverTests.cs (1)
2588Assert.True(compilation.SyntaxTrees.Contains(node.SyntaxTree));
SourceGeneration\GeneratorDriverTests_Attributes_FullyQualifiedName.cs (6)
192step => Assert.True(step.Outputs.Single().Value is CompilationUnitSyntax c && c.SyntaxTree == compilation.SyntaxTrees.Single())); 222step => Assert.True(step.Outputs.Single().Value is CompilationUnitSyntax c && c.SyntaxTree == compilation.SyntaxTrees.Single())); 249step => Assert.True(step.Outputs.Single().Value is CompilationUnitSyntax c && c.SyntaxTree == compilation.SyntaxTrees.First())); 276step => Assert.True(step.Outputs.Single().Value is CompilationUnitSyntax c && c.SyntaxTree == compilation.SyntaxTrees.Last())); 304step => Assert.True(step.Outputs.Single().Value is CompilationUnitSyntax c && c.SyntaxTree == compilation.SyntaxTrees.First()), 305step => Assert.True(step.Outputs.Single().Value is CompilationUnitSyntax c && c.SyntaxTree == compilation.SyntaxTrees.Last()));
SourceGeneration\SyntaxAwareGeneratorTests.cs (1)
295Assert.Equal(testReceiver.VisitedNodes[0].SemanticModel.SyntaxTree, testReceiver.VisitedNodes[0].Node.SyntaxTree);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (15)
Compilation\CompilationAPITests.cs (1)
787SyntaxTree withExpressionRootTree = SyntaxFactory.ParseExpression(s3).SyntaxTree;
DocumentationComments\CrefTests.cs (13)
2014var model = compilation.GetSemanticModel(crefSyntax.SyntaxTree); 2053var model = compilation.GetSemanticModel(crefSyntax.SyntaxTree); 2107var model = compilation.GetSemanticModel(crefSyntax.SyntaxTree); 5853var model = compilation.GetSemanticModel(cref.SyntaxTree); 5902var model = compilation.GetSemanticModel(cref.SyntaxTree); 5926var model = compilation.GetSemanticModel(cref.SyntaxTree); 5950var model = compilation.GetSemanticModel(cref.SyntaxTree); 5975var model = compilation.GetSemanticModel(cref.SyntaxTree); 5999var model = compilation.GetSemanticModel(cref.SyntaxTree); 6027var model = compilation.GetSemanticModel(cref.SyntaxTree); 6049var model = compilation.GetSemanticModel(typeParameterSyntax.SyntaxTree); 6073var model = compilation.GetSemanticModel(methodNameSyntax.SyntaxTree); 6635var binderFactory = compilation.GetBinderFactory(crefSyntax.SyntaxTree);
Symbols\Source\DeclaringSyntaxNodeTests.cs (1)
43SyntaxTree tree = node.SyntaxTree;
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (67)
Parsing\LocalFunctionParsingTests.cs (6)
1182file.SyntaxTree.GetDiagnostics().Verify(); 1247file.SyntaxTree.GetDiagnostics().Verify( 1291file.SyntaxTree.GetDiagnostics().Verify(); 1293Assert.Equal(0, file.SyntaxTree.Options.Features.Count); 1345Assert.Equal(0, file.SyntaxTree.Options.Features.Count); 1706file.SyntaxTree.GetDiagnostics().Verify();
Syntax\SyntaxDiffingTests.cs (4)
305var oldTree = root.SyntaxTree; 320var newTree = newRoot.SyntaxTree; 370var oldTree = root.SyntaxTree; 382var newTree = newRoot.SyntaxTree;
Syntax\SyntaxFactoryTests.cs (1)
53var text = SyntaxFactory.CompilationUnit().SyntaxTree.GetText();
Syntax\SyntaxNodeTests.cs (12)
3656var ChangesForDifferentTrees = FirstUsingClause.SyntaxTree.GetChanges(SecondUsingClause.SyntaxTree); 3667var ChangesFromTransform = ThirdUsingClause.SyntaxTree.GetChanges(newUsingClause.SyntaxTree); 3671SyntaxTree x = ThirdUsingClause.SyntaxTree; 3672SyntaxTree y = newUsingClause.SyntaxTree; 3706var ChangesForDifferentTrees = FirstUsingClause.SyntaxTree.GetChanges(SecondUsingClause.SyntaxTree); 3711Assert.Throws<ArgumentNullException>(() => FirstUsingClause.SyntaxTree.GetChanges(BlankTree)); 3739var ChangesForDifferentTrees = FirstUsingClause.SyntaxTree.GetChangedSpans(SecondUsingClause.SyntaxTree); 3744Assert.Throws<ArgumentNullException>(() => FirstUsingClause.SyntaxTree.GetChangedSpans(BlankTree));
Syntax\SyntaxRewriterTests.cs (43)
315Assert.NotNull(node.SyntaxTree); 316Assert.False(node.SyntaxTree.HasCompilationUnitRoot, "how did we get a CompilationUnit root?"); 317Assert.Same(node, node.SyntaxTree.GetRoot()); 324Assert.NotNull(node1.SyntaxTree); 325Assert.True(node1.SyntaxTree.HasCompilationUnitRoot, "how did we get a non-CompilationUnit root?"); 326Assert.Same(node1, node1.SyntaxTree.GetRoot()); 328Assert.NotNull(node2.SyntaxTree); 329Assert.False(node2.SyntaxTree.HasCompilationUnitRoot, "how did we get a CompilationUnit root?"); 330Assert.Same(node2, node2.SyntaxTree.GetRoot()); 338Assert.Same(tree, tree.GetCompilationUnitRoot().ReplaceToken(tokenT, tokenT).SyntaxTree); 340Assert.NotNull(newRoot.SyntaxTree); 341Assert.True(newRoot.SyntaxTree.HasCompilationUnitRoot, "how did we get a non-CompilationUnit root?"); 342Assert.Same(newRoot, newRoot.SyntaxTree.GetRoot()); 350Assert.Same(tree, tree.GetCompilationUnitRoot().ReplaceNode(typeName, typeName).SyntaxTree); 352Assert.NotNull(newRoot.SyntaxTree); 353Assert.True(newRoot.SyntaxTree.HasCompilationUnitRoot, "how did we get a non-CompilationUnit root?"); 354Assert.Same(newRoot, newRoot.SyntaxTree.GetRoot()); 367var newTree = newRoot.SyntaxTree; 386var newTree = newRoot.SyntaxTree; 406var newTree = newNode.SyntaxTree; 413var newTree2 = newNode2.SyntaxTree; 433var newTree = newRoot.SyntaxTree; 450var newTree = newRoot.SyntaxTree; 456var newTree2 = newRoot2.SyntaxTree; 477var newTree = newRoot.SyntaxTree; 483var newTree2 = newRoot2.SyntaxTree; 505var newTree = newRoot.SyntaxTree; 518var newTree = newRoot.SyntaxTree; 531var newTree = newRoot.SyntaxTree; 540Assert.NotNull(tree.GetCompilationUnitRoot().SyntaxTree); 543Assert.NotNull(rewrittenRoot.SyntaxTree); 544Assert.True(rewrittenRoot.SyntaxTree.HasCompilationUnitRoot, "how did we get a non-CompilationUnit root?"); 545Assert.Same(rewrittenRoot, rewrittenRoot.SyntaxTree.GetRoot()); 558Assert.NotNull(expr1.SyntaxTree); 559Assert.False(expr1.SyntaxTree.HasCompilationUnitRoot, "how did we get a CompilationUnit root?"); 560Assert.Same(ifStmt1, expr1.SyntaxTree.GetRoot()); 576Assert.NotNull(expr2.SyntaxTree); 577Assert.False(expr2.SyntaxTree.HasCompilationUnitRoot, "how did we get a CompilationUnit root?"); 578Assert.Same(ifStmt2, expr2.SyntaxTree.GetRoot()); 606Assert.Equal(tree1, expr1.SyntaxTree); 622Assert.NotNull(expr2.SyntaxTree); 623Assert.False(expr2.SyntaxTree.HasCompilationUnitRoot, "how did we get a CompilationUnit root?"); 624Assert.Same(ifStmt2, expr2.SyntaxTree.GetRoot());
Syntax\SyntaxTreeTests.cs (1)
88SyntaxTreeFactoryKind.SynthesizedSyntaxTree => SyntaxNode.CloneNodeAsRoot(root, syntaxTree: null).SyntaxTree,
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
CSharpTestBase.cs (1)
2100var model = compilation.GetSemanticModel(syntaxNode.SyntaxTree);
Microsoft.CodeAnalysis.CSharp.Workspaces (17)
FindSymbols\CSharpDeclaredSymbolInfoFactoryService.cs (1)
630if (((CSharpParseOptions)container.SyntaxTree.Options).Kind == SourceCodeKind.Script)
Rename\CSharpRenameRewriterLanguageService.cs (3)
290var speculativeTree = originalNode.SyntaxTree.GetRoot(_cancellationToken).ReplaceNode(originalNode, newNode); 305speculativeTree = originalNode.SyntaxTree.GetRoot(_cancellationToken).ReplaceNode(originalNode, newNode); 1243if (node.SyntaxTree == originalSemanticModel.SyntaxTree)
Simplification\Simplifiers\AbstractCSharpSimplifier.cs (1)
336if (!startNode.SyntaxTree.HasCompilationUnitRoot)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\EmbeddedLanguages\VirtualChars\CSharpVirtualCharService.cs (1)
188var parentSourceText = parentExpression.SyntaxTree.GetText();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (1)
24=> ((CSharpParseOptions)node.SyntaxTree.Options).LanguageVersion;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SuppressFormattingRule.cs (1)
331? ((CompilationUnitSyntax)structure.SyntaxTree.GetRoot(CancellationToken.None)).EndOfFileToken
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationHelpers.cs (2)
75var syntaxTree = destination.SyntaxTree; 84var tree = node.SyntaxTree.WithRootAndOptions(node, syntaxTree.Options);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\CompilationUnitSyntaxExtensions.cs (3)
24if (!allowInHiddenRegions && contextNode.SyntaxTree.HasHiddenRegions()) 27var root = (CompilationUnitSyntax)contextNode.SyntaxTree.GetRoot(cancellationToken); 30if (contextNode.SyntaxTree.OverlapsHiddenPosition(span, cancellationToken))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Indentation\CSharpIndentationService.cs (1)
145var text = node.SyntaxTree.GetText();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\InitializeParameterHelpers.cs (2)
63var editingDocument = solution.GetRequiredDocument(propertyDeclaration.SyntaxTree); 83var editingDocument = solution.GetRequiredDocument(variableDeclarator.SyntaxTree);
Workspace\LanguageServices\CSharpSyntaxTreeFactoryService.NodeSyntaxReference.cs (1)
22=> _node.SyntaxTree;
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (1)
KeywordHighlighting\AbstractKeywordHighlighterTests.cs (1)
64CheckSpans(root.SyntaxTree, expectedHighlightSpans, highlightSpans);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (6)
CodeGeneration\CodeGenerationTests.cs (5)
93var info = testContext.Service.GetInfo(context ?? CodeGenerationContext.Default, options, root.SyntaxTree.Options); 314var info = testContext.Service.GetInfo(context ?? CodeGenerationContext.Default, options, oldSyntax.SyntaxTree.Options); 329var info = testContext.Service.GetInfo(context ?? CodeGenerationContext.Default, options, oldMemberSyntax.SyntaxTree.Options); 540var info = codeGenerator.GetInfo(CodeGenerationContext.Default, options, oldNode.SyntaxTree.Options); 581var info = codeGenerator.GetInfo(new CodeGenerationContext(reuseSyntax: true), options, declarationNode.SyntaxTree.Options);
Utilities\SymbolEquivalenceComparerTests.cs (1)
1895var model = compilation.GetSemanticModel(invocation.SyntaxTree);
Microsoft.CodeAnalysis.Features (58)
AddImport\References\Reference.cs (1)
90var root = contextNode.SyntaxTree.GetRoot(cancellationToken);
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.PragmaHelpers.cs (2)
35var root = await nodeWithTokens.SyntaxTree.GetRootAsync(cancellationToken).ConfigureAwait(false); 222var root = nodeWithTokens.SyntaxTree.GetRoot();
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction_Attribute.cs (1)
64var documentWithAttribute = _project.GetDocument(attributeNode.SyntaxTree);
CodeLens\CodeLensFindReferenceProgress.cs (1)
82_queriedNode.SyntaxTree.FilePath.Equals(candidateSyntaxNode.SyntaxTree.FilePath,
Completion\Providers\AbstractPartialTypeCompletionProvider.cs (1)
107.Any(node => !(node.SyntaxTree == context.SyntaxTree && node.Span.IntersectsWith(context.Position)));
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.cs (1)
94analyzer = CreateAnalyzer(syntaxFactsService, ifStatement.SyntaxTree.Options);
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (6)
862newExceptionRegions[i] = GetExceptionRegions(ancestors, newStatement.SyntaxTree, cancellationToken).Spans; 1004newActiveStatements[activeStatementIndex] = GetActiveStatementWithSpan(oldActiveStatements[activeStatementIndex], topMatch.NewRoot.SyntaxTree, newSpan, diagnostics, cancellationToken); 1388newExceptionRegions[ordinal] = GetExceptionRegions(newAncestors, newStatementSyntax.SyntaxTree, cancellationToken).Spans; 1581return GetExceptionRegions(ancestors, root.SyntaxTree, cancellationToken); 2045var oldTree = topMatch.OldRoot.SyntaxTree; 2046var newTree = topMatch.NewRoot.SyntaxTree;
EditAndContinue\ActiveStatementsMap.cs (1)
182Debug.Assert(oldRoot.SyntaxTree == oldSyntaxTree);
EncapsulateField\AbstractEncapsulateFieldService.cs (1)
312.Select(n => (solution.GetRequiredDocument(n.SyntaxTree).Id, n.Span))
ExtractMethod\Extensions.cs (2)
64if (node.SyntaxTree == null) 69return node.SyntaxTree.Options.Kind != SourceCodeKind.Regular;
GenerateType\AbstractGenerateTypeService.cs (1)
147.Where(r => r.SyntaxTree == node.SyntaxTree)
InlineMethod\AbstractInlineMethodRefactoringProvider.cs (1)
341var calleeDocumentId = solution.GetDocumentId(calleeMethodNode.SyntaxTree);
LanguageServices\SymbolDisplayService\AbstractSymbolDisplayService.AbstractSymbolDescriptionBuilder.cs (1)
240var semanticModel = GetSemanticModel(syntax.SyntaxTree);
PullMemberUp\MembersPuller.cs (2)
123solution.GetDocumentId(declaration.SyntaxTree), 330solution.GetDocumentId(syntax.SyntaxTree),
ReplaceMethodWithProperty\ReplaceMethodWithPropertyCodeRefactoringProvider.cs (1)
461var document = originalSolution.GetDocument(syntax.SyntaxTree);
ReplacePropertyWithMethods\ReplacePropertyWithMethodsCodeRefactoringProvider.cs (1)
327var document = originalSolution.GetDocument(syntax.SyntaxTree);
Shared\Utilities\AnnotatedSymbolMapping.cs (3)
57var typeNodeRoot = await typeNode.SyntaxTree.GetRootAsync(cancellationToken).ConfigureAwait(false); 61currentRoots[typeNode.SyntaxTree] = typeNodeRoot.ReplaceNode(typeNode, typeNode.WithAdditionalAnnotations(typeNodeAnnotation)); 65documentIdToSymbolsMap.Add(solution.GetRequiredDocument(typeNode.SyntaxTree).Id, []);
SignatureHelp\CommonSignatureHelpUtilities.cs (3)
118!syntaxFacts.IsInNonUserCode(root.SyntaxTree, position, cancellationToken)) 131if (!syntaxFacts.IsInNonUserCode(root.SyntaxTree, position, cancellationToken) || 132syntaxFacts.IsEntirelyWithinStringOrCharOrNumericLiteral(root.SyntaxTree, position, cancellationToken))
Snippets\SnippetProviders\AbstractInlineStatementSnippetProvider.cs (2)
105var sourceText = parentNode.SyntaxTree.GetText(cancellationToken); 138var sourceText = parentNode.SyntaxTree.GetText(cancellationToken);
src\Analyzers\Core\Analyzers\AbstractBuiltInCodeStyleDiagnosticAnalyzer_Core.cs (1)
94=> ShouldSkipAnalysis(context.Node.SyntaxTree, context.Options, context.Compilation.Options, notification, context.CancellationToken);
src\Analyzers\Core\Analyzers\MatchFolderAndNamespace\AbstractMatchFolderAndNamespaceDiagnosticAnalyzer.cs (3)
95var root = namespaceDeclaration.SyntaxTree.GetRoot(cancellationToken); 141if (!PathUtilities.IsChildPath(projectDir, namespaceDeclaration.SyntaxTree.FilePath)) 150PathUtilities.GetDirectoryName(namespaceDeclaration.SyntaxTree.FilePath)!);
src\Analyzers\Core\Analyzers\PopulateSwitch\AbstractPopulateSwitchDiagnosticAnalyzer.cs (1)
68if (switchBlock.SyntaxTree.OverlapsHiddenPosition(switchBlock.Span, context.CancellationToken))
src\Analyzers\Core\Analyzers\RemoveUnnecessaryCast\AbstractRemoveUnnecessaryCastDiagnosticAnalyzer.cs (1)
73node.SyntaxTree.GetLocation(GetFadeSpan(node)),
src\Analyzers\Core\Analyzers\RemoveUnnecessaryParentheses\AbstractRemoveUnnecessaryParenthesesDiagnosticAnalyzer.cs (2)
131var lines = parenthesizedExpression.SyntaxTree.GetText(cancellationToken).Lines; 135return Location.Create(parenthesizedExpression.SyntaxTree, TextSpan.FromBounds(parenthesizedExpressionLocation.SourceSpan.Start, textSpanEndPosition));
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (3)
99if (!symbolStartAnalyzer._compilationAnalyzer.TryGetOptions(firstBlock.Syntax.SyntaxTree, 116firstBlock.Syntax.SyntaxTree != filterTree) 126var root = firstBlock.Syntax.SyntaxTree.GetRoot(context.CancellationToken);
src\Analyzers\Core\Analyzers\SimplifyInterpolation\AbstractSimplifyInterpolationHelpers.cs (1)
50.SelectAsArray(interpolation.Syntax.SyntaxTree.GetLocation);
src\Analyzers\Core\Analyzers\SimplifyTypeNames\SimplifyTypeNamesDiagnosticAnalyzerBase.cs (1)
229var (completed, intervalTree) = _codeBlockIntervals.GetOrAdd(context.CodeBlock.SyntaxTree, _ => (new StrongBox<bool>(false), new TextSpanMutableIntervalTree()));
src\Analyzers\Core\Analyzers\UseCollectionInitializer\AbstractUseCollectionInitializerAnalyzer.cs (1)
206if (!this.SyntaxFacts.SupportsIndexingInitializer(statement.SyntaxTree.Options))
src\Analyzers\Core\Analyzers\UseCollectionInitializer\UpdateExpressionState.cs (1)
433return @this.SyntaxFacts.SupportsCollectionExpressionNaturalType(ifStatement.SyntaxTree.Options)
src\Analyzers\Core\Analyzers\UseCollectionInitializer\UseCollectionInitializerHelpers.cs (1)
27var syntaxTree = match.SyntaxTree;
src\Analyzers\Core\Analyzers\UseCompoundAssignment\AbstractUseCompoundAssignmentDiagnosticAnalyzer.cs (1)
79var syntaxTree = assignment.SyntaxTree;
src\Analyzers\Core\Analyzers\UseConditionalExpression\UseConditionalExpressionHelpers.cs (1)
93if (!syntaxFacts.SupportsThrowExpression(anyThrow.Syntax.SyntaxTree.Options))
src\Analyzers\Core\Analyzers\UseObjectInitializer\AbstractUseObjectInitializerDiagnosticAnalyzer.cs (1)
140var syntaxTree = context.Node.SyntaxTree;
src\Analyzers\Core\Analyzers\UseSystemHashCode\UseSystemHashCodeDiagnosticAnalyzer.cs (1)
72var option = context.Options.GetAnalyzerOptions(operation.Syntax.SyntaxTree).PreferSystemHashCode;
src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (1)
353context.Node.SyntaxTree,
UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (4)
96var fieldDocument = currentSolution.GetRequiredDocument(field.DeclaringSyntaxReferences[0].GetSyntax(cancellationToken).SyntaxTree); 97var propertyDocument = currentSolution.GetRequiredDocument(property.DeclaringSyntaxReferences[0].GetSyntax(cancellationToken).SyntaxTree); 285var fieldDocument = originalSolution.GetRequiredDocument(declarator.SyntaxTree); 290var propertyDocument = originalSolution.GetRequiredDocument(property.SyntaxTree);
UseNamedArguments\AbstractUseNamedArgumentsCodeRefactoringProvider.cs (1)
108if (SupportsNonTrailingNamedArguments(root.SyntaxTree.Options) &&
Microsoft.CodeAnalysis.Features.Test.Utilities (1)
EditAndContinue\EditAndContinueTestVerifier.cs (1)
415var expected = expectedRuntimeRudeEdit?.GetMessage(newRoot.SyntaxTree);
Microsoft.CodeAnalysis.Features.UnitTests (1)
EditAndContinue\RudeEditDiagnosticTests.cs (1)
22var tree = SyntaxFactory.ParseCompilationUnit("class C { }").SyntaxTree;
Microsoft.CodeAnalysis.LanguageServer.Protocol (1)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.IncrementalMemberEditAnalyzer.cs (1)
261var tree = changedMember.SyntaxTree;
Microsoft.CodeAnalysis.Test.Utilities (12)
Compilation\CompilationExtensions.cs (2)
190SemanticModel model = compilation.GetSemanticModel(node.SyntaxTree); 367if (blockOperation.Syntax.SyntaxTree.Options.Kind != SourceCodeKind.Script)
Compilation\ControlFlowGraphVerifier.cs (1)
349var model = compilation.GetSemanticModel(graph.OriginalOperation.Syntax.SyntaxTree);
Diagnostics\CommonDiagnosticAnalyzers.cs (8)
2758ReportDiagnostics($"RegisterOperationAction({operationContext.Operation.Syntax}) in RegisterSymbolStartAction", operationContext.Operation.Syntax.SyntaxTree, operationContext.ContainingSymbol, operationContext.ReportDiagnostic), 2762ReportDiagnostics($"RegisterSyntaxNodeAction({syntaxNodeContext.Node}) in RegisterSymbolStartAction", syntaxNodeContext.Node.SyntaxTree, syntaxNodeContext.ContainingSymbol, syntaxNodeContext.ReportDiagnostic), 2772ReportDiagnostics($"RegisterOperationAction({operationContext.Operation.Syntax})", operationContext.Operation.Syntax.SyntaxTree, operationContext.ContainingSymbol, operationContext.ReportDiagnostic), 2785ReportDiagnostics($"RegisterOperationAction({operationContext.Operation.Syntax}) in RegisterOperationBlockStartAction", operationContext.Operation.Syntax.SyntaxTree, operationContext.ContainingSymbol, operationContext.ReportDiagnostic), 2795ReportDiagnostics($"RegisterSyntaxNodeAction({syntaxNodeContext.Node})", syntaxNodeContext.Node.SyntaxTree, syntaxNodeContext.ContainingSymbol, syntaxNodeContext.ReportDiagnostic), 2801ReportDiagnostics("RegisterCodeBlockAction", codeBlockContext.CodeBlock.SyntaxTree, codeBlockContext.OwningSymbol, codeBlockContext.ReportDiagnostic)); 2808ReportDiagnostics($"RegisterSyntaxNodeAction({syntaxNodeContext.Node}) in RegisterCodeBlockStartAction", syntaxNodeContext.Node.SyntaxTree, syntaxNodeContext.ContainingSymbol, syntaxNodeContext.ReportDiagnostic), 2812ReportDiagnostics("RegisterCodeBlockEndAction", codeBlockEndContext.CodeBlock.SyntaxTree, codeBlockEndContext.OwningSymbol, codeBlockEndContext.ReportDiagnostic));
MarkedSource\SourceWithMarkedNodes.cs (1)
50public SyntaxTree Tree => Root.SyntaxTree;
Microsoft.CodeAnalysis.VisualBasic (36)
Binding\Binder_Attributes.vb (3)
568If expression.Syntax.SyntaxTree IsNot Nothing AndAlso 569Me.Compilation.ContainsSyntaxTree(expression.Syntax.SyntaxTree) Then 594Debug.Assert(Not expression.Syntax.SyntaxTree.IsEmbeddedSyntaxTree)
Binding\Binder_Invocation.vb (8)
1300If node.SyntaxTree Is groupOpt.Syntax.SyntaxTree AndAlso node.Span.Contains(groupOpt.Syntax.Span) Then 1947If argument.Syntax.SyntaxTree Is diagnostic.Location.SourceTree AndAlso 2904DirectCast(argument.Syntax.SyntaxTree.Options, VisualBasicParseOptions).LanguageVersion, 3106callerInfoOpt.SyntaxTree IsNot Nothing AndAlso 3107Not callerInfoOpt.SyntaxTree.IsEmbeddedOrMyTemplateTree() AndAlso 3121callerInfoValue = ConstantValue.Create(callerInfoOpt.SyntaxTree.GetDisplayLineNumber(GetCallerLocation(callerInfoOpt))) 3152callerInfoValue = ConstantValue.Create(callerInfoOpt.SyntaxTree.GetDisplayPath(callerInfoOpt.Span, Me.Compilation.Options.SourceReferenceResolver))
Binding\Binder_Query.vb (2)
4664diagnosticLocationOpt:=Location.Create(node.SyntaxTree, operatorNameLocation)) 4716ReportDiagnostic(diagnostics, Location.Create(node.SyntaxTree, operatorNameLocation), ERRID.ERR_QueryOperatorNotFound, operatorName)
Binding\Binder_Statements.vb (1)
1966DirectCast(node.SyntaxTree.Options, VisualBasicParseOptions).LanguageVersion,
Binding\MemberSemanticModel.vb (1)
1192Return Root.SyntaxTree
BoundTree\BoundNode.vb (1)
100Return DirectCast(_syntax.SyntaxTree, VisualBasicSyntaxTree)
CodeGen\CodeGenerator.vb (1)
295EmitSequencePoint(syntax.SyntaxTree, syntax.Span)
Compilation\MethodCompiler.vb (1)
1287semanticModelWithCachedBoundNodes = CType(cachingSemanticModelProvider.GetSemanticModel(syntax.SyntaxTree, compilation), SyntaxTreeSemanticModel)
Lowering\Instrumentation\CodeCoverageInstrumenter.vb (2)
443path = syntax.SyntaxTree.FilePath 450Return AddAnalysisPoint(syntaxForSpan, syntaxForSpan.SyntaxTree.GetMappedLineSpan(alternateSpan), statementFactory)
Lowering\LambdaRewriter\LambdaRewriter.vb (2)
1009Dim syntaxOffset As Integer = _topLevelMethod.CalculateLocalSyntaxOffset(syntax.SpanStart, syntax.SyntaxTree) 1058Dim syntaxOffset As Integer = _topLevelMethod.CalculateLocalSyntaxOffset(lambdaOrLambdaBodySyntax.SpanStart, lambdaOrLambdaBodySyntax.SyntaxTree)
Lowering\StateMachineRewriter\StateMachineRewriter.StateMachineMethodToClassRewriter.vb (1)
182Dim syntaxOffset = CurrentMethod.CalculateLocalSyntaxOffset(node.SpanStart, node.SyntaxTree)
Lowering\StateMachineRewriter\StateMachineRewriter.vb (1)
300Dim syntaxOffset As Integer = Me.Method.CalculateLocalSyntaxOffset(declaratorSyntax.SpanStart, declaratorSyntax.SyntaxTree)
Symbols\ConstraintsHelper.vb (1)
469DirectCast(syntaxNode.SyntaxTree.Options, VisualBasicParseOptions).LanguageVersion,
Symbols\LexicalSortKey.vb (5)
213If first.SyntaxTree IsNot Nothing AndAlso first.SyntaxTree Is second.SyntaxTree Then 217Dim firstKey = New LexicalSortKey(first.SyntaxTree, first.SpanStart, compilation) 218Dim secondKey = New LexicalSortKey(second.SyntaxTree, second.SpanStart, compilation)
Symbols\Source\SourceNamedTypeSymbol.vb (1)
2341Dim sourceFile = ContainingSourceModule.TryGetSourceFile(list.Node.SyntaxTree)
Symbols\Source\SynthesizedMainTypeEntryPoint.vb (1)
53Dim binder As Binder = BinderBuilder.CreateBinderForType(container.ContainingSourceModule, syntaxNode.SyntaxTree, container)
Symbols\Symbol.vb (1)
920syntaxNode.SyntaxTree Is tree AndAlso
Symbols\Symbol_Attributes.vb (1)
361Dim syntaxTree = syntaxList.Node.SyntaxTree
Syntax\StructuredTriviaSyntax.vb (1)
21MyBase.New(green, startLocation, If(parent IsNot Nothing, parent.SyntaxTree, Nothing))
Syntax\VisualBasicSyntaxTree.vb (1)
210''' <para>NOTE: This method is only intended to be used from <see cref="SyntaxNode.SyntaxTree"/> property.</para>
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (3)
src\Analyzers\VisualBasic\Analyzers\UseInferredMemberName\VisualBasicUseInferredMemberNameDiagnosticAnalyzer.vb (2)
44Dim syntaxTree = context.Node.SyntaxTree 78Dim syntaxTree = context.Node.SyntaxTree
src\Analyzers\VisualBasic\Analyzers\UseIsNotExpression\VisualBasicUseIsNotDiagnosticAnalyzer.vb (1)
44Dim syntaxTree = node.SyntaxTree
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (3)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\CompilationUnitSyntaxExtensions.vb (2)
32Return Not contextNode.SyntaxTree.OverlapsHiddenPosition(TextSpan.FromBounds(start, [end]), cancellationToken) 39Return Not contextNode.SyntaxTree.OverlapsHiddenPosition(TextSpan.FromBounds(start, [end]), cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Indentation\SpecialFormattingOperation.vb (1)
125Dim sourceText = node.SyntaxTree.GetText()
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures (5)
EndConstructGeneration\EndConstructStatementVisitor.vb (1)
315directive.SyntaxTree.GetStartDirectives(_cancellationToken).
GoToBase\VisualBasicGoToBaseService.vb (1)
38Dim document = solution.GetDocument(constructorBlock.SyntaxTree)
Utilities\NavigationPointHelpers.vb (3)
57Return New VirtualTreePoint(beginStatement.SyntaxTree, text, nonWhitespaceOffset.Value) 68Return New VirtualTreePoint(beginStatement.SyntaxTree, text, line.End, targetColumn - totalLineSize) 70Return New VirtualTreePoint(beginStatement.SyntaxTree, text, line.GetLineOffsetFromColumn(targetColumn, indentSize) + line.Start)
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (3)
Emit\EditAndContinue\EditAndContinueTestBase.vb (1)
149Assert.Equal(s1.SyntaxTree, tree1)
PDB\PDBTests.vb (2)
78").SyntaxTree 84").SyntaxTree
Microsoft.CodeAnalysis.VisualBasic.Features (10)
CodeFixes\MoveToTopOfFile\MoveToTopOfFileCodeFixProvider.vb (1)
198Return root.SyntaxTree.IsHiddenPosition(destinationLine, cancellationToken)
EditAndContinue\DeclarationBody\FieldOrPropertyDeclarationBody.vb (1)
47Return InitializerActiveStatement.SyntaxTree
EditAndContinue\DeclarationBody\VisualBasicLambdaBody.vb (1)
24Return _node.SyntaxTree
FullyQualify\VisualBasicFullyQualifyService.vb (1)
69Dim tree = simpleName.SyntaxTree
Highlighting\KeywordHighlightingHelpers.vb (1)
88Dim text = node.SyntaxTree.GetText(cancellationToken)
LanguageServices\VisualBasicSymbolDisplayService.SymbolDescriptionBuilder.vb (1)
158Dim semanticModel = GetSemanticModel(equalsValue.SyntaxTree)
src\Analyzers\VisualBasic\Analyzers\UseInferredMemberName\VisualBasicUseInferredMemberNameDiagnosticAnalyzer.vb (2)
44Dim syntaxTree = context.Node.SyntaxTree 78Dim syntaxTree = context.Node.SyntaxTree
src\Analyzers\VisualBasic\Analyzers\UseIsNotExpression\VisualBasicUseIsNotDiagnosticAnalyzer.vb (1)
44Dim syntaxTree = node.SyntaxTree
Structure\Providers\XmlExpressionStructureProvider.vb (1)
26Dim syntaxTree = xmlExpression.SyntaxTree
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (9)
Compilation\CompilationAPITests.vb (1)
652Dim withExpressionRootTree = SyntaxFactory.ParseExpression("0").SyntaxTree
Semantics\SyntaxTreeRootTests.vb (4)
62Dim tree = node.SyntaxTree 63Assert.Equal(tree, node.SyntaxTree) 70Dim childTree = node.Operand.SyntaxTree 71Dim parentTree = node.SyntaxTree
SourceGeneration\GeneratorDriverTests_Attributes_FullyQualifiedName.vb (4)
201Sub(_step) Assert.True(DirectCast(_step.Outputs.Single().Value, CompilationUnitSyntax).SyntaxTree Is compilation.SyntaxTrees.First)) 230Sub(_step) Assert.True(DirectCast(_step.Outputs.Single().Value, CompilationUnitSyntax).SyntaxTree Is compilation.SyntaxTrees.First)) 256Sub(_step) Assert.True(DirectCast(_step.Outputs.Single().Value, CompilationUnitSyntax).SyntaxTree Is compilation.SyntaxTrees.First), 257Sub(_step) Assert.True(DirectCast(_step.Outputs.Single().Value, CompilationUnitSyntax).SyntaxTree Is compilation.SyntaxTrees.Last))
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (16)
Syntax\SyntaxFactoryTests.vb (1)
21Dim text = SyntaxFactory.CompilationUnit().SyntaxTree.GetText()
Syntax\SyntaxRewriterTests.vb (8)
478Dim tree = expression.SyntaxTree 536Dim newTree = newRoot.SyntaxTree 555Dim newTree = newRoot.SyntaxTree 602Dim newTree = newRoot.SyntaxTree 620Dim newTree = newRoot.SyntaxTree 626Dim newTree2 = newRoot2.SyntaxTree 688Dim newTree = newRoot.SyntaxTree 701Dim newTree = newRoot.SyntaxTree
TestSyntaxNodes.vb (7)
2874Dim ChangesForDifferentTrees = FirstImportsClause.SyntaxTree.GetChanges(SecondImportsClause.SyntaxTree) 2885Dim ChangesFromTransform = ThirdImportsClause.SyntaxTree.GetChanges(newImportsClause.SyntaxTree) 2889Dim x As SyntaxTree = ThirdImportsClause.SyntaxTree 2890Dim y As SyntaxTree = newImportsClause.SyntaxTree 2918Assert.Throws(Of ArgumentNullException)(Sub() FirstImportsClause.SyntaxTree.GetChanges(BlankTree))
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (3)
BasicTestBase.vb (2)
830Dim model = compilation.GetSemanticModel(syntaxNode.SyntaxTree) 922Dim semanticModel = compilation.GetSemanticModel(node.SyntaxTree)
CompilationTestUtils.vb (1)
606Dim tree = node.SyntaxTree
Microsoft.CodeAnalysis.VisualBasic.Workspaces (11)
FindSymbols\VisualBasicDeclaredSymbolInfoFactoryService.vb (1)
61Dim compilationUnit = typeBlock.SyntaxTree.GetCompilationUnitRoot()
Rename\VisualBasicRenameRewriterLanguageService.vb (3)
189Dim speculativeTree = originalNode.SyntaxTree.GetRoot(_cancellationToken).ReplaceNode(originalNode, newNode) 211speculativeTree = originalNode.SyntaxTree.GetRoot(_cancellationToken).ReplaceNode(originalNode, expandedNewNode) 1028If node.SyntaxTree Is originalSemanticModel.SyntaxTree Then
Simplification\Reducers\VisualBasicEscapingReducer.vb (1)
153Dim text = parent.SyntaxTree.GetText(cancellationToken)
Simplification\VisualBasicSimplificationService.Expander.vb (2)
49If expression.SyntaxTree IsNot oldExpression.SyntaxTree Then
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\CompilationUnitSyntaxExtensions.vb (2)
32Return Not contextNode.SyntaxTree.OverlapsHiddenPosition(TextSpan.FromBounds(start, [end]), cancellationToken) 39Return Not contextNode.SyntaxTree.OverlapsHiddenPosition(TextSpan.FromBounds(start, [end]), cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Indentation\SpecialFormattingOperation.vb (1)
125Dim sourceText = node.SyntaxTree.GetText()
Workspace\LanguageServices\VisualBasicSyntaxTreeFactoryService.NodeSyntaxReference.vb (1)
20Return _node.SyntaxTree
Microsoft.CodeAnalysis.Workspaces (50)
CodeCleanup\Providers\FormatCodeCleanupProvider.cs (3)
38return (root.SyntaxTree != null && root.SyntaxTree.TryGetText(out var oldText)) 39? root.SyntaxTree.WithChangedText(oldText.WithChanges(result.GetTextChanges(cancellationToken))).GetRootAsync(cancellationToken)
Differencing\AbstractSyntaxComparer.cs (2)
46=> oldNode.SyntaxTree == newNode.SyntaxTree;
Editing\SymbolEditor.cs (5)
287var doc = ChangedSolution.GetDocument(declaration.SyntaxTree); 376var doc = ChangedSolution.GetDocument(d.SyntaxTree); 411var declaration = this.GetDeclarations(currentSymbol).FirstOrDefault(d => memberDecls.Any(md => md.SyntaxTree == d.SyntaxTree && d.FullSpan.IntersectsWith(md.FullSpan))); 463var declsByDocId = this.GetDeclarations(currentSymbol).ToLookup(d => ChangedSolution.GetDocument(d.SyntaxTree).Id);
Editing\SymbolEditorExtensions.cs (1)
40var doc = editor.OriginalSolution.GetDocument(decl.SyntaxTree);
FindSymbols\FindReferences\Finders\AbstractMemberScopedReferenceFinder.cs (1)
114if (syntax.SyntaxTree != state.SyntaxTree)
FindSymbols\FindReferences\Finders\AbstractReferenceFinder_GlobalSuppressions.cs (1)
232var location = Location.Create(root.SyntaxTree, new TextSpan(positionOfReferenceInTree, length));
FindSymbols\FindReferences\Finders\ParameterSymbolReferenceFinder.cs (1)
100var document = solution.GetDocument(parameterNode.SyntaxTree);
ReassignedVariable\AbstractReassignedVariableService.cs (3)
51var semanticModel = GetSemanticModel(root.SyntaxTree); 227if (methodOrPropertyDeclaration.SyntaxTree != semanticModel.SyntaxTree) 273.Where(s => s.SyntaxTree == semanticModel.SyntaxTree)
Recommendations\AbstractRecommendationServiceRunner.cs (1)
353static (candidateLocation, declarationSyntax) => !(declarationSyntax.SyntaxTree == candidateLocation.SourceTree &&
Rename\SymbolicRenameLocations.ReferenceProcessing.cs (2)
376AddLocationsToRenameInStringsAndComments(document, root.SyntaxTree, renameText, 394AddLocationsToRenameInStringsAndComments(document, root.SyntaxTree, renameText,
SemanticModelReuse\AbstractSemanticModelReuseLanguageService.cs (2)
45var currentSyntaxTree = currentBodyNode.SyntaxTree; 57var currentRoot = await currentBodyNode.SyntaxTree.GetRootAsync(cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
316=> node.SyntaxTree.OverlapsHiddenPosition(span, cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTokenExtensions.cs (1)
95? ((ICompilationUnitSyntax)token.Parent!.SyntaxTree!.GetRoot(CancellationToken.None)).EndOfFileToken
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.cs (2)
21if (root.SyntaxTree == null || !root.SyntaxTree.TryGetText(out var text))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.StructuredTrivia.cs (6)
51if (root.SyntaxTree != null && root.SyntaxTree.GetText() != null) 53return root.SyntaxTree.GetText(); 57if (parent != null && parent.SyntaxTree != null && parent.SyntaxTree.GetText() != null) 59return parent.SyntaxTree.GetText();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\AbstractDocumentationCommentService.cs (1)
84var syntaxTree = documentationComment.SyntaxTree;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.BodyLevelSymbolKey.cs (1)
258Contract.ThrowIfTrue(semanticModel.SyntaxTree != containerDeclaration.SyntaxTree);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (4)
242var destinationTree = destinationDeclaration.SyntaxTree; 246var info = GetInfo(context.Context, codeGenOptions, destinationDeclaration.SyntaxTree.Options); 494if (location.SourceTree != destinationMember.SyntaxTree) 527var root = attributeToRemove.SyntaxTree.GetRoot();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (1)
66var syntaxTree = destination.SyntaxTree;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (2)
203afterSourceTree.FilePath == declarationList.FirstOrDefault()?.SyntaxTree.FilePath) 219beforeSourceTree.FilePath == declarationList.FirstOrDefault()?.SyntaxTree.FilePath)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\AddParameterEditor.cs (2)
25var sourceText = declaration.SyntaxTree.GetText(cancellationToken); 159var text = parameters[0].SyntaxTree.GetText(cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_Negate.cs (1)
559if (syntaxFacts.SupportsNotPattern(pattern.SyntaxTree.Options) &&
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\AbstractInitializerParameterService.cs (1)
206foreach (var group in accessors.GroupBy(node => node.SyntaxTree))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\ParsedDocument.cs (2)
30public SyntaxTree SyntaxTree => Root.SyntaxTree; 59var text = root.SyntaxTree.GetText(cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\SyntacticDocument.cs (1)
26public SyntaxTree SyntaxTree => Root.SyntaxTree;
Workspace\Solution\DocumentState.cs (1)
499var encoding = newRoot.SyntaxTree.Encoding;
Workspace\Solution\DocumentState_LinkedFileReuse.cs (1)
137var siblingTree = siblingRoot.SyntaxTree;
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
Formatting\FormattingTestBase.cs (1)
93var resultRoot = await root.SyntaxTree.WithChangedText(resultText).GetRootAsync();
Microsoft.CodeAnalysis.Workspaces.UnitTests (8)
SolutionTests\SolutionTests.cs (7)
2484Assert.Equal(SourceHashAlgorithm.Sha1, root.SyntaxTree.GetText().ChecksumAlgorithm); 2513Assert.Equal(SourceHashAlgorithm.Sha1, root.SyntaxTree.GetText().ChecksumAlgorithm); 3690Assert.Equal(tree, root.SyntaxTree); 3707Assert.Equal(tree2, root2.SyntaxTree); 3783Assert.Same(tree2, tree2.GetRoot().SyntaxTree); 3811Assert.Same(tree3, tree3.GetRoot().SyntaxTree); 3822Assert.Same(tree4, tree4.GetRoot().SyntaxTree);
SymbolKeyTests.cs (1)
1561var semanticModel = compilation.GetSemanticModel(node.SyntaxTree);
Microsoft.Extensions.Logging.Generators (1)
LoggerMessageGenerator.Parser.cs (1)
75foreach (IGrouping<SyntaxTree, ClassDeclarationSyntax> group in classes.GroupBy(x => x.SyntaxTree))
Microsoft.Extensions.Options.SourceGeneration (1)
Parser.cs (1)
50foreach (var group in classes.GroupBy(x => x.TypeSyntax.SyntaxTree))
Microsoft.Gen.ComplianceReports (2)
Parser.cs (2)
35IEnumerable<IGrouping<SyntaxTree, TypeDeclarationSyntax>> typesBySyntaxTree = classes.GroupBy(x => x.SyntaxTree); 43sm ??= _compilation.GetSemanticModel(typeSyntax.SyntaxTree);
Microsoft.Gen.ContextualOptions (2)
ContextReceiver.cs (1)
46.ToLookup(declaration => declaration.SyntaxTree)
ContextualOptionsGenerator.cs (1)
38.ToLookup(declaration => declaration.SyntaxTree)
Microsoft.Gen.Logging (1)
Parsing\Parser.cs (1)
51foreach (var group in types.GroupBy(x => x.SyntaxTree))
Microsoft.Gen.Metrics (2)
Parser.cs (2)
68foreach (var typeDeclarationGroup in types.GroupBy(x => x.SyntaxTree)) 84semanticModel ??= _compilation.GetSemanticModel(typeDeclaration.SyntaxTree);
Microsoft.Gen.MetricsReports (2)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (2)
68foreach (var typeDeclarationGroup in types.GroupBy(x => x.SyntaxTree)) 84semanticModel ??= _compilation.GetSemanticModel(typeDeclaration.SyntaxTree);
Microsoft.Interop.LibraryImportGenerator (1)
Analyzers\ConvertToLibraryImportFixer.cs (1)
492dllImportSyntax.SyntaxTree,
Microsoft.VisualStudio.LanguageServices (4)
Progression\GraphNodeIdCreation.cs (1)
534var document = solution.GetDocument(currentNode.SyntaxTree);
PullMemberUp\SymbolDependentsBuilder.cs (1)
63Visit(compilation.GetSemanticModel(syntax.SyntaxTree).GetOperation(syntax, _cancellationToken));
Venus\ContainedLanguageCodeSupport.cs (2)
222var info = codeGenerationService.GetInfo(new CodeGenerationContext(autoInsertionLocation: false), options.GenerationOptions, destinationType.SyntaxTree.Options); 273var memberNodeDocument = thisDocument.Project.Solution.GetDocument(memberNode.SyntaxTree);
Microsoft.VisualStudio.LanguageServices.CSharp (30)
CodeModel\CSharpCodeModelService.cs (3)
1274var text = memberDeclaration.SyntaxTree.GetText(CancellationToken.None); 1354var text = memberDeclaration.SyntaxTree.GetText(CancellationToken.None); 1412var text = memberDeclaration.SyntaxTree.GetText(CancellationToken.None);
CodeModel\CSharpCodeModelService.NodeLocator.cs (27)
239return new VirtualTreePoint(node.SyntaxTree, text, startPosition); 272return new VirtualTreePoint(node.SyntaxTree, text, startPosition); 302return new VirtualTreePoint(node.SyntaxTree, text, startPosition); 350return new VirtualTreePoint(node.SyntaxTree, text, startPosition); 429return new VirtualTreePoint(node.SyntaxTree, text, startPosition); 504return new VirtualTreePoint(node.SyntaxTree, text, startPosition); 553return new VirtualTreePoint(node.SyntaxTree, text, startPosition); 602return new VirtualTreePoint(node.SyntaxTree, text, startPosition); 642return new VirtualTreePoint(node.SyntaxTree, text, startPosition); 675return new VirtualTreePoint(node.SyntaxTree, text, startPosition); 716return new VirtualTreePoint(node.SyntaxTree, text, startPosition); 756return new VirtualTreePoint(node.SyntaxTree, text, startPosition); 796return new VirtualTreePoint(node.SyntaxTree, text, startPosition); 814return new VirtualTreePoint(node.SyntaxTree, text, endPosition); 847return new VirtualTreePoint(node.SyntaxTree, text, endPosition); 877return new VirtualTreePoint(node.SyntaxTree, text, endPosition); 918return new VirtualTreePoint(node.SyntaxTree, text, endPosition); 992return new VirtualTreePoint(node.SyntaxTree, text, endPosition); 1052return new VirtualTreePoint(node.SyntaxTree, text, endPosition); 1091return new VirtualTreePoint(node.SyntaxTree, text, endPosition); 1132return new VirtualTreePoint(node.SyntaxTree, text, endPosition); 1170return new VirtualTreePoint(fileScopedNamespace.SyntaxTree, text, fileScopedNamespace.Parent.Span.End); 1181return new VirtualTreePoint(node.SyntaxTree, text, endPosition); 1214return new VirtualTreePoint(node.SyntaxTree, text, endPosition); 1255return new VirtualTreePoint(node.SyntaxTree, text, endPosition); 1297return new VirtualTreePoint(node.SyntaxTree, text, endPosition); 1338return new VirtualTreePoint(node.SyntaxTree, text, endPosition);
Microsoft.VisualStudio.LanguageServices.VisualBasic (42)
CodeModel\VisualBasicCodeModelService.NodeLocator.vb (39)
249Return New VirtualTreePoint(attributes.First().SyntaxTree, text, startPosition) 281Return New VirtualTreePoint(attributes.Last().SyntaxTree, text, startPosition) 357Return New VirtualTreePoint(typeBlock.SyntaxTree, text, startPosition) 383Return New VirtualTreePoint(typeBlock.SyntaxTree, text, startPosition) 428Return New VirtualTreePoint(enumBlock.SyntaxTree, text, startPosition) 454Return New VirtualTreePoint(enumBlock.SyntaxTree, text, startPosition) 513Return New VirtualTreePoint(methodBlock.SyntaxTree, text, startPosition) 549Return New VirtualTreePoint(declareStatement.SyntaxTree, text, startPosition) 578Return New VirtualTreePoint(declareStatement.SyntaxTree, text, endPosition) 614Return New VirtualTreePoint(methodStatement.SyntaxTree, text, startPosition) 669Return New VirtualTreePoint(methodBlock.SyntaxTree, text, startPosition) 698Return New VirtualTreePoint(methodStatement.SyntaxTree, text, endPosition) 737Return New VirtualTreePoint(propertyStatement.SyntaxTree, text, startPosition) 782Return New VirtualTreePoint(propertyStatement.SyntaxTree, text, startPosition) 822Return New VirtualTreePoint(eventBlock.SyntaxTree, text, startPosition) 859Return New VirtualTreePoint(eventStatement.SyntaxTree, text, startPosition) 904Return New VirtualTreePoint(eventStatement.SyntaxTree, text, startPosition) 940Return New VirtualTreePoint(delegateStatement.SyntaxTree, text, startPosition) 969Return New VirtualTreePoint(delegateStatement.SyntaxTree, text, endPosition) 1035Return New VirtualTreePoint(namespaceBlock.SyntaxTree, text, startPosition) 1066Return New VirtualTreePoint(namespaceBlock.SyntaxTree, text, endPosition) 1098Return New VirtualTreePoint(variable.SyntaxTree, text, startPosition) 1123Return New VirtualTreePoint(enumMember.SyntaxTree, text, startPosition) 1150Return New VirtualTreePoint(variable.SyntaxTree, text, endPosition) 1174Return New VirtualTreePoint(enumMember.SyntaxTree, text, endPosition) 1204Return New VirtualTreePoint(parameter.SyntaxTree, text, startPosition) 1228Return New VirtualTreePoint(parameter.SyntaxTree, text, endPosition) 1254Return New VirtualTreePoint(importsStatement.SyntaxTree, text, startPosition) 1280Return New VirtualTreePoint(importsStatement.SyntaxTree, text, endPosition) 1306Return New VirtualTreePoint(optionStatement.SyntaxTree, text, startPosition) 1332Return New VirtualTreePoint(optionStatement.SyntaxTree, text, endPosition) 1358Return New VirtualTreePoint(inheritsStatement.SyntaxTree, text, startPosition) 1384Return New VirtualTreePoint(inheritsStatement.SyntaxTree, text, endPosition) 1410Return New VirtualTreePoint(implementsStatement.SyntaxTree, text, startPosition) 1436Return New VirtualTreePoint(implementsStatement.SyntaxTree, text, endPosition) 1465Return New VirtualTreePoint(attribute.SyntaxTree, text, startPosition) 1493Return New VirtualTreePoint(attribute.SyntaxTree, text, endPosition) 1528Return New VirtualTreePoint(argument.SyntaxTree, text, startPosition) 1562Return New VirtualTreePoint(argument.SyntaxTree, text, endPosition)
CodeModel\VisualBasicCodeModelService.vb (3)
2251Dim text = member.SyntaxTree.GetText(CancellationToken.None) 2480Dim text = member.SyntaxTree.GetText(CancellationToken.None) 2506Dim text = member.SyntaxTree.GetText(CancellationToken.None)
System.Private.CoreLib.Generators (2)
IntrinsicsInSystemPrivateCoreLibAnalyzer.cs (2)
296if (model.SyntaxTree != arrowExpression.SyntaxTree) 299model = model.Compilation.GetSemanticModel(arrowExpression.SyntaxTree);
System.Text.RegularExpressions.Generator (2)
UpgradeToGeneratedRegexCodeFixer.cs (2)
104typeDeclarationOrCompilationUnit ??= await nodeToFix.SyntaxTree.GetRootAsync(cancellationToken).ConfigureAwait(false); 149await nodeToFix.SyntaxTree.GetRootAsync(cancellationToken).ConfigureAwait(false);
System.Windows.Forms.PrivateSourceGenerators (1)
System\Windows\Forms\SourceGenerators\EnumValidationGenerator.cs (1)
216SemanticModel semanticModel = GetSemanticModel(compilation, argument.SyntaxTree);