2 overrides of GetLocation
Microsoft.CodeAnalysis.CSharp (1)
Syntax\CSharpSyntaxTree.cs (1)
758public override Location GetLocation(TextSpan span)
Microsoft.CodeAnalysis.VisualBasic (1)
Syntax\VisualBasicSyntaxTree.vb (1)
491Public Overrides Function GetLocation(span As TextSpan) As Location
105 references to GetLocation
Microsoft.CodeAnalysis (4)
Syntax\SyntaxNode.cs (1)
675return this.SyntaxTree.GetLocation(this.Span);
Syntax\SyntaxReference.cs (1)
52return this.SyntaxTree.GetLocation(this.Span);
Syntax\SyntaxToken.cs (1)
648: tree.GetLocation(Span);
Syntax\SyntaxTrivia.cs (1)
412return this.SyntaxTree!.GetLocation(this.Span);
Microsoft.CodeAnalysis.CodeStyle (11)
src\Analyzers\Core\Analyzers\OrderModifiers\AbstractOrderModifiersDiagnosticAnalyzer.cs (1)
82context.Tree.GetLocation(TextSpan.FromBounds(modifiers.First().SpanStart, modifiers.Last().Span.End)),
src\Analyzers\Core\Analyzers\RemoveUnnecessaryCast\AbstractRemoveUnnecessaryCastDiagnosticAnalyzer.cs (1)
73node.SyntaxTree.GetLocation(GetFadeSpan(node)),
src\Analyzers\Core\Analyzers\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsDiagnosticAnalyzer.cs (2)
204yield return Diagnostic.Create(descriptor, tree.GetLocation(span)); 217yield return Diagnostic.Create(s_fixableIdDescriptor, tree.GetLocation(span));
src\Analyzers\Core\Analyzers\SimplifyInterpolation\AbstractSimplifyInterpolationHelpers.cs (1)
50.SelectAsArray(interpolation.Syntax.SyntaxTree.GetLocation);
src\Analyzers\Core\Analyzers\SimplifyTypeNames\SimplifyTypeNamesDiagnosticAnalyzerBase.cs (1)
167var diagnostic = DiagnosticHelper.Create(descriptor, tree.GetLocation(issueSpan), notificationOption, analyzerOptions, additionalLocations: null, builder.ToImmutable());
src\Analyzers\Core\Analyzers\UseCollectionInitializer\UseCollectionInitializerHelpers.cs (4)
36syntaxTree.GetLocation(TextSpan.FromBounds(match.SpanStart, arguments[0].SpanStart)), 37syntaxTree.GetLocation(TextSpan.FromBounds(arguments.Last().FullSpan.End, match.Span.End))); 48syntaxTree.GetLocation(TextSpan.FromBounds(match.SpanStart, expression.SpanStart)), 49syntaxTree.GetLocation(TextSpan.FromBounds(expression.FullSpan.End, match.Span.End)));
src\Analyzers\Core\Analyzers\UseObjectInitializer\AbstractUseObjectInitializerDiagnosticAnalyzer.cs (1)
157locations.Add(syntaxTree.GetLocation(TextSpan.FromBounds(match.Initializer.FullSpan.End, match.Statement.Span.End)));
Microsoft.CodeAnalysis.CSharp (4)
Binder\Binder_Expressions.cs (1)
9140location = expr.Syntax.SyntaxTree.GetLocation(TextSpan.FromBounds(expr.Syntax.SpanStart, conditional.OperatorToken.Span.End));
Compilation\CSharpCompilation.cs (2)
2649diagnostics.Add(code, infoTree.GetLocation(infoSpan)); 2957var location = syntaxTree.GetLocation(TextSpan.FromBounds(0, 0));
Symbols\Source\SourceFieldSymbol.cs (1)
217=> _syntaxReference.SyntaxTree.GetLocation(_locationSpan);
Microsoft.CodeAnalysis.CSharp.CodeStyle (17)
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 (1)
58: declaration.SyntaxTree.GetLocation(TextSpan.FromBounds(declaration.SpanStart, declaration.Name.Span.End));
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (3)
233syntaxTree.GetLocation(startReportSpan), 237additionalUnnecessaryLocations: [syntaxTree.GetLocation(startReportSpan), syntaxTree.GetLocation(endReportSpan)]));
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\UseCollectionExpression\CSharpUseCollectionExpressionForArrayDiagnosticAnalyzer.cs (1)
218syntaxTree.GetLocation(TextSpan.FromBounds(
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForCreateDiagnosticAnalyzer.cs (1)
61syntaxTree.GetLocation(TextSpan.FromBounds(
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForNewDiagnosticAnalyzer.cs (1)
86syntaxTree.GetLocation(TextSpan.FromBounds(
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForStackAllocDiagnosticAnalyzer.cs (2)
70syntaxTree.GetLocation(TextSpan.FromBounds( 110syntaxTree.GetLocation(TextSpan.FromBounds(
src\Analyzers\CSharp\Analyzers\UseDefaultLiteral\CSharpUseDefaultLiteralDiagnosticAnalyzer.cs (1)
57additionalUnnecessaryLocations: [defaultExpression.SyntaxTree.GetLocation(fadeSpan)]));
src\Analyzers\CSharp\Analyzers\UseImplicitOrExplicitType\CSharpTypeStyleDiagnosticAnalyzerBase.cs (1)
68=> DiagnosticHelper.Create(descriptor, declaration.SyntaxTree.GetLocation(diagnosticSpan), notificationOption, analyzerOptions, additionalLocations: null, properties: null);
src\Analyzers\CSharp\Analyzers\UseInferredMemberName\CSharpUseInferredMemberNameDiagnosticAnalyzer.cs (2)
63additionalUnnecessaryLocations: [syntaxTree.GetLocation(fadeSpan)])); 89additionalUnnecessaryLocations: [context.Node.SyntaxTree.GetLocation(fadeSpan)]));
src\Analyzers\CSharp\Analyzers\UseUnboundGenericTypeInNameOf\CSharpUseUnboundGenericTypeInNameOfDiagnosticAnalyzer.cs (1)
80additionalUnnecessaryLocations: [invocation.SyntaxTree.GetLocation(
Microsoft.CodeAnalysis.CSharp.Features (19)
GenerateType\CSharpGenerateTypeService.cs (2)
589? semanticModel.SyntaxTree.GetLocation(new TextSpan(lastMember.Span.End, 0)) 590: semanticModel.SyntaxTree.GetLocation(new TextSpan());
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 (1)
58: declaration.SyntaxTree.GetLocation(TextSpan.FromBounds(declaration.SpanStart, declaration.Name.Span.End));
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (3)
233syntaxTree.GetLocation(startReportSpan), 237additionalUnnecessaryLocations: [syntaxTree.GetLocation(startReportSpan), syntaxTree.GetLocation(endReportSpan)]));
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\UseCollectionExpression\CSharpUseCollectionExpressionForArrayDiagnosticAnalyzer.cs (1)
218syntaxTree.GetLocation(TextSpan.FromBounds(
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForCreateDiagnosticAnalyzer.cs (1)
61syntaxTree.GetLocation(TextSpan.FromBounds(
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForNewDiagnosticAnalyzer.cs (1)
86syntaxTree.GetLocation(TextSpan.FromBounds(
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForStackAllocDiagnosticAnalyzer.cs (2)
70syntaxTree.GetLocation(TextSpan.FromBounds( 110syntaxTree.GetLocation(TextSpan.FromBounds(
src\Analyzers\CSharp\Analyzers\UseDefaultLiteral\CSharpUseDefaultLiteralDiagnosticAnalyzer.cs (1)
57additionalUnnecessaryLocations: [defaultExpression.SyntaxTree.GetLocation(fadeSpan)]));
src\Analyzers\CSharp\Analyzers\UseImplicitOrExplicitType\CSharpTypeStyleDiagnosticAnalyzerBase.cs (1)
68=> DiagnosticHelper.Create(descriptor, declaration.SyntaxTree.GetLocation(diagnosticSpan), notificationOption, analyzerOptions, additionalLocations: null, properties: null);
src\Analyzers\CSharp\Analyzers\UseInferredMemberName\CSharpUseInferredMemberNameDiagnosticAnalyzer.cs (2)
63additionalUnnecessaryLocations: [syntaxTree.GetLocation(fadeSpan)])); 89additionalUnnecessaryLocations: [context.Node.SyntaxTree.GetLocation(fadeSpan)]));
src\Analyzers\CSharp\Analyzers\UseUnboundGenericTypeInNameOf\CSharpUseUnboundGenericTypeInNameOfDiagnosticAnalyzer.cs (1)
80additionalUnnecessaryLocations: [invocation.SyntaxTree.GetLocation(
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (1)
Syntax\SyntaxNodeTests.cs (1)
2093var spanLocation = tree.GetLocation(textSpan);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (2)
CodeFixes\CodeFixServiceTests.cs (2)
563c.ReportDiagnostic(Diagnostic.Create(descriptor, c.Tree.GetLocation(TextSpan.FromBounds(0, 0)))); 615context.ReportDiagnostic(Diagnostic.Create(s_descriptor, tree.GetLocation(new TextSpan(0, 1))));
Microsoft.CodeAnalysis.EditorFeatures.Wpf (1)
Peek\PeekHelpers.cs (1)
70return identifierLocation.SourceTree.GetLocation(node.Span).GetMappedLineSpan().Span;
Microsoft.CodeAnalysis.Features (15)
EditAndContinue\RudeEditDiagnostic.cs (1)
44return Diagnostic.Create(descriptor, tree.GetLocation(Span), Arguments);
EncapsulateField\AbstractEncapsulateFieldService.cs (1)
329contextLocation: fieldDeclaration.SyntaxTree.GetLocation(fieldDeclaration.Span)));
GenerateOverrides\GenerateOverridesWithDialogCodeAction.cs (2)
63? syntaxTree.GetLocation(_textSpan) 77contextLocation: syntaxTree.GetLocation(_textSpan))),
GenerateType\AbstractGenerateTypeService.Editor.cs (1)
297new CodeGenerationContext(newSemanticModel.SyntaxTree.GetLocation(new TextSpan()))),
src\Analyzers\Core\Analyzers\OrderModifiers\AbstractOrderModifiersDiagnosticAnalyzer.cs (1)
82context.Tree.GetLocation(TextSpan.FromBounds(modifiers.First().SpanStart, modifiers.Last().Span.End)),
src\Analyzers\Core\Analyzers\RemoveUnnecessaryCast\AbstractRemoveUnnecessaryCastDiagnosticAnalyzer.cs (1)
73node.SyntaxTree.GetLocation(GetFadeSpan(node)),
src\Analyzers\Core\Analyzers\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsDiagnosticAnalyzer.cs (2)
204yield return Diagnostic.Create(descriptor, tree.GetLocation(span)); 217yield return Diagnostic.Create(s_fixableIdDescriptor, tree.GetLocation(span));
src\Analyzers\Core\Analyzers\SimplifyTypeNames\SimplifyTypeNamesDiagnosticAnalyzerBase.cs (1)
167var diagnostic = DiagnosticHelper.Create(descriptor, tree.GetLocation(issueSpan), notificationOption, analyzerOptions, additionalLocations: null, builder.ToImmutable());
src\Analyzers\Core\Analyzers\UseCollectionInitializer\UseCollectionInitializerHelpers.cs (4)
36syntaxTree.GetLocation(TextSpan.FromBounds(match.SpanStart, arguments[0].SpanStart)), 37syntaxTree.GetLocation(TextSpan.FromBounds(arguments.Last().FullSpan.End, match.Span.End))); 48syntaxTree.GetLocation(TextSpan.FromBounds(match.SpanStart, expression.SpanStart)), 49syntaxTree.GetLocation(TextSpan.FromBounds(expression.FullSpan.End, match.Span.End)));
src\Analyzers\Core\Analyzers\UseObjectInitializer\AbstractUseObjectInitializerDiagnosticAnalyzer.cs (1)
157locations.Add(syntaxTree.GetLocation(TextSpan.FromBounds(match.Initializer.FullSpan.End, match.Statement.Span.End)));
Microsoft.CodeAnalysis.VisualBasic (10)
Binding\Binder.vb (1)
660Return Me.SyntaxTree.GetLocation(span)
Binding\Binder_Utils.vb (1)
72Dim location = Me.SyntaxTree.GetLocation(New TextSpan(startLoc, endLoc - startLoc))
Compilation\VisualBasicCompilation.vb (4)
1719diagnostics.Add(ERRID.HDN_UnusedImportStatement, infoTree.GetLocation(info.StatementSpan)) 1741diagnostics.Add(ERRID.HDN_UnusedImportStatement, infoTree.GetLocation(info.StatementSpan)) 1744diagnostics.Add(ERRID.HDN_UnusedImportClause, infoTree.GetLocation(clauseSpan)) 2179Dim location = tree.GetLocation(TextSpan.FromBounds(0, 0))
Symbols\Source\SourceMethodSymbol.vb (2)
180Dim location = binder.SyntaxTree.GetLocation(New TextSpan(startLoc, endLoc - startLoc)) 855Return syntaxTree.GetLocation(GetMethodLocationFromSyntax(syntaxNode))
Syntax\VisualBasicSyntaxNode.vb (2)
275Return New VBDiagnostic(errorInfo, If(tree Is Nothing, New SourceLocation(tree, nodeOrToken.Span), tree.GetLocation(nodeOrToken.Span))) 282Return New VBDiagnostic(errorInfo, If(tree Is Nothing, New SourceLocation(tree, nodeOrToken.Span), tree.GetLocation(nodeOrToken.Span)))
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (3)
src\Analyzers\VisualBasic\Analyzers\UseInferredMemberName\VisualBasicUseInferredMemberNameDiagnosticAnalyzer.vb (3)
62additionalUnnecessaryLocations:=ImmutableArray.Create(syntaxTree.GetLocation(fadeSpan)))) 82syntaxTree.GetLocation(fadeSpan), 86additionalUnnecessaryLocations:=ImmutableArray.Create(syntaxTree.GetLocation(fadeSpan))))
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures (1)
NavigationBar\VisualBasicEditorNavigationBarItemService_CodeGeneration.vb (1)
53Dim contextLocation = syntaxTree.GetLocation(New TextSpan(0, 0))
Microsoft.CodeAnalysis.VisualBasic.Features (5)
GenerateType\VisualBasicGenerateTypeService.vb (2)
451semanticModel.SyntaxTree.GetLocation(New TextSpan()), 452semanticModel.SyntaxTree.GetLocation(New TextSpan(lastMember.Span.End, 0)))
src\Analyzers\VisualBasic\Analyzers\UseInferredMemberName\VisualBasicUseInferredMemberNameDiagnosticAnalyzer.vb (3)
62additionalUnnecessaryLocations:=ImmutableArray.Create(syntaxTree.GetLocation(fadeSpan)))) 82syntaxTree.GetLocation(fadeSpan), 86additionalUnnecessaryLocations:=ImmutableArray.Create(syntaxTree.GetLocation(fadeSpan))))
Microsoft.CodeAnalysis.Workspaces (2)
Diagnostics\Extensions.cs (1)
60return tree.GetLocation(span);
Rename\SymbolicRenameLocations.ReferenceProcessing.cs (1)
423var matchLocation = tree.GetLocation(matchTextSpan);
Microsoft.Interop.SourceGeneration (6)
DiagnosticExtensions.cs (4)
36? syntaxReference.SyntaxTree.GetLocation(syntaxReference.Span) 50? syntaxReference.SyntaxTree.GetLocation(syntaxReference.Span) 140? syntaxReference.SyntaxTree.GetLocation(syntaxReference.Span) 154? syntaxReference.SyntaxTree.GetLocation(syntaxReference.Span)
TypePositionInfo.cs (2)
130outAttributeLocation = attr.ApplicationSyntaxReference.SyntaxTree.GetLocation(attr.ApplicationSyntaxReference.Span); 135inAttributeLocation = attr.ApplicationSyntaxReference.SyntaxTree.GetLocation(attr.ApplicationSyntaxReference.Span);
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (1)
EditorConfigSettings\DataProvider\DataProviderTests.MockAnalyzerReference.cs (1)
111c.ReportDiagnostic(Diagnostic.Create(descriptor, c.Tree.GetLocation(TextSpan.FromBounds(0, 0))));
Roslyn.VisualStudio.Next.UnitTests (2)
Services\VisualStudioDiagnosticAnalyzerExecutorTests.cs (2)
276c.ReportDiagnostic(Diagnostic.Create(_supportedDiagnostics[0], c.Tree.GetLocation(TextSpan.FromBounds(0, 1)))); 294c.ReportDiagnostic(Diagnostic.Create(_supportedDiagnostics[0], c.Tree.GetLocation(TextSpan.FromBounds(0, 1))));
System.Text.Json.SourceGeneration (1)
Helpers\RoslynExtensions.cs (1)
34return reference?.SyntaxTree.GetLocation(reference.Span);