185 references to IsInSource
ILLink.RoslynAnalyzer (3)
DynamicallyAccessedMembersAnalyzer.cs (3)
189 (Location[]? sourceLocation, Dictionary<string, string?>? DAMArgs) = (!attributableSymbolLocation.IsInSource 211 (Location[]? sourceLocation, Dictionary<string, string?>? DAMArgs) = (!attributableSymbolLocation.IsInSource 235 (Location[]? sourceLocation, Dictionary<string, string?>? DAMArgs) = (!attributableSymbolLocation.IsInSource
Microsoft.AspNetCore.Components.Analyzers.Tests (1)
Verifiers\DiagnosticVerifier.cs (1)
258Assert.True(location.IsInSource,
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (1)
Verifiers\DiagnosticVerifier.cs (1)
258Assert.True(location.IsInSource,
Microsoft.CodeAnalysis (9)
Diagnostic\Location.cs (2)
59/// If <see cref="IsInSource"/> returns False this method returns an empty <see cref="TextSpan"/> which starts at position 0. 98if (IsInSource)
DiagnosticAnalyzer\AnalysisScope.cs (1)
300if (diagnostic.Location.IsInSource)
DiagnosticAnalyzer\AnalyzerDriver.cs (1)
1247if (!location.IsInSource)
DiagnosticAnalyzer\AnalyzerExecutor.AnalyzerDiagnosticReporter.cs (1)
126if (diagnostic.Location.IsInSource)
DiagnosticAnalyzer\AnalyzerExecutor.cs (1)
1404if (diagnostic.Location.IsInSource)
DiagnosticAnalyzer\DiagnosticAnalysisContextHelpers.cs (1)
90if (!location.IsInSource)
DiagnosticAnalyzer\SuppressMessageAttributeState.cs (1)
161if (location.IsInSource)
Symbols\ISymbolExtensions.cs (1)
113if (location.IsInSource)
Microsoft.CodeAnalysis.CodeStyle (9)
src\Analyzers\Core\Analyzers\Helpers\HashCodeAnalyzer\HashCodeAnalyzer.cs (1)
70if (!method.Locations[0].IsInSource)
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (1)
554Debug.Assert(diagnostic.Location.IsInSource);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (1)
607=> symbol.Locations.Any() && symbol.Locations.All(location => location.IsInSource);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\LocationExtensions.cs (3)
33if (!loc.IsInSource) 44Debug.Assert(loc1.IsInSource && loc2.IsInSource);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.BodyLevelSymbolKey.cs (2)
29if (location.IsInSource) 66Contract.ThrowIfFalse(locations.All(loc => loc.IsInSource));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (1)
261if (location.IsInSource)
Microsoft.CodeAnalysis.CodeStyle.Fixes (4)
src\Analyzers\Core\CodeFixes\GenerateMember\AbstractGenerateMemberService.cs (1)
52return locations.Any(static loc => loc.IsInSource);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (1)
489if (!location.IsInSource)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (1)
150if (location != null && location.IsInSource)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationContext.cs (1)
170if (location != null && !location.IsInSource)
Microsoft.CodeAnalysis.CSharp (19)
Binder\Binder_Symbols.cs (4)
1893if (la.IsInSource != lb.IsInSource) return la.IsInSource ? 1 : -1; 1895if (!la.IsInSource) return containerResult;
Compilation\CSharpCompilation.cs (2)
4523Debug.Assert(loc1.IsInSource); 4524Debug.Assert(loc2.IsInSource);
Compilation\SyntaxTreeSemanticModel.cs (1)
1813if (loc.IsInSource && loc.SourceTree == this.SyntaxTree && declarationSpan.Contains(loc.SourceSpan))
Compiler\DocumentationCommentCompiler.IncludeElementExpander.cs (3)
367if (location.IsInSource) 407if (location.IsInSource) 436if (location.IsInSource)
Emitter\Model\PEModuleBuilder.cs (1)
476if (loc.IsInSource && (result == null || compilation.CompareSourceLocations(result, loc) > 0))
SymbolDisplay\SymbolDisplayVisitor_Minimal.cs (1)
245if (location.IsInSource && location.SourceTree == SemanticModelOpt.SyntaxTree)
Symbols\AnonymousTypes\AnonymousTypeManager.Templates.cs (2)
100if (location.IsInSource) 188Debug.Assert(typeDescr.Location.IsInSource); // AnonymousDelegateTemplateSymbol requires a location in source for ordering.
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.TypeOrDelegateTemplateSymbol.cs (1)
93Debug.Assert(location.IsInSource);
Symbols\NamespaceOrTypeSymbol.cs (1)
227if (loc.IsInSource && loc.SourceTree == syntax.SyntaxTree && syntax.Span.Contains(loc.SourceSpan))
Symbols\Source\SourceModuleSymbol.cs (1)
338if (!location.IsInSource)
Symbols\Symbol.cs (2)
454if (loc.IsInSource && loc.SourceTree == tree && declarationSpan.Contains(loc.SourceSpan)) 506if (location == null || !location.IsInSource)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (2)
src\Analyzers\CSharp\CodeFixes\Nullable\CSharpDeclareAsNullableCodeFixProvider.cs (1)
194else if (symbol is IFieldSymbol { CorrespondingTupleField: IFieldSymbol { Locations: [{ IsInSource: true } location] } })
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationHelpers.cs (1)
202var contextTree = contextLocation != null && contextLocation.IsInSource
Microsoft.CodeAnalysis.CSharp.Features (2)
Debugging\BreakpointResolver.cs (1)
35var location = method.Locations.First(loc => loc.IsInSource);
src\Analyzers\CSharp\CodeFixes\Nullable\CSharpDeclareAsNullableCodeFixProvider.cs (1)
194else if (symbol is IFieldSymbol { CorrespondingTupleField: IFieldSymbol { Locations: [{ IsInSource: true } location] } })
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (1)
SourceGeneration\GeneratorDriverTests.cs (1)
141Assert.True(generatedClass.Locations.Single().IsInSource);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (15)
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (12)
4802Assert.True(type.Locations.Single().IsInSource); 4825Assert.True(type.Locations.Single().IsInSource); 4848Assert.True(type.Locations.Single().IsInSource); 4871Assert.True(type.Locations.Single().IsInSource); 4894Assert.True(type.Locations.Single().IsInSource); 4917Assert.True(element.Locations.Single().IsInSource); 4940Assert.True(element.Locations.Single().IsInSource); 4963Assert.True(element.Locations.Single().IsInSource); 4998Assert.True(element.Locations.Single().IsInSource); 5044Assert.True(element.Locations.Single().IsInSource); 5093Assert.True(element.Locations.Single().IsInSource); 5116Assert.True(element.Locations.Single().IsInSource);
Symbols\AnonymousTypesSymbolTests.cs (2)
1646Assert.True(sym.Symbol.Locations[0].IsInSource); 1655Assert.True(m.Locations[0].IsInSource);
Symbols\CovariantReturnTests.cs (1)
673var attributeExpected = isCovariant && !method.Locations[0].IsInSource;
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (4)
Syntax\SyntaxNodeTests.cs (4)
2078Assert.True(nodeLocation.IsInSource); 2083Assert.True(tokenLocation.IsInSource); 2088Assert.True(triviaLocation.IsInSource); 2094Assert.True(spanLocation.IsInSource);
Microsoft.CodeAnalysis.CSharp.Workspaces (3)
Rename\CSharpRenameRewriterLanguageService.cs (2)
146_renamableDeclarationLocation = _renamedSymbol.Locations.FirstOrDefault(loc => loc.IsInSource && loc.SourceTree == _semanticModel.SyntaxTree); 975if (location.IsInSource && reverseMappedLocations.TryGetValue(location, out var conflictingLocation))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationHelpers.cs (1)
202var contextTree = contextLocation != null && contextLocation.IsInSource
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (3)
MetadataAsSource\AbstractMetadataAsSourceTests.cs (1)
113Assert.False(generatedSymbol.Locations.Where(loc => loc.IsInSource).IsEmpty());
SymbolFinder\DependentTypeFinderTests.cs (2)
584Assert.Single(delegates.Where(i => i.Locations.Any(loc => loc.IsInSource))); // We should find a single source delegate 614Assert.Single(enums.Where(i => i.Locations.Any(loc => loc.IsInSource))); // We should find a single source type
Microsoft.CodeAnalysis.EditorFeatures.Wpf (2)
Peek\DefinitionPeekableItem.cs (1)
83var sourceLocations = symbol.Locations.Where(l => l.IsInSource).ToList();
Peek\PeekableItemFactory.cs (1)
89if (firstLocation.IsInSource || _metadataAsSourceFileService.IsNavigableMetadataSymbol(symbol))
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (2)
FindReferences\FindReferencesTests.vb (2)
466Return loc.IsInSource AndAlso Not loc.SourceTree.IsHiddenPosition(loc.SourceSpan.Start) 468Return loc.IsInSource
Microsoft.CodeAnalysis.Features (30)
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.cs (1)
212if (diagnostic.Location.IsInSource && documentOpt != null)
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.GlobalSuppressMessageFixAllCodeAction.cs (1)
181Contract.ThrowIfFalse(!diagnostic.Location.IsInSource);
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.PragmaWarningBatchFixAllProvider.cs (1)
34foreach (var diagnostic in diagnostics.Where(d => d.Location.IsInSource && !d.IsSuppressed))
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction.BatchFixer.cs (2)
43foreach (var diagnostic in diagnostics.Where(d => d.Location.IsInSource && d.IsSuppressed)) 89foreach (var diagnostic in diagnostics.Where(d => !d.Location.IsInSource && d.IsSuppressed))
CodeLens\CodeLensFindReferenceProgress.cs (2)
126!reference.Location.IsInSource || 127!definition.Locations.Any(static loc => loc.IsInSource);
CodeLens\LocationComparer.cs (3)
19if (x != null && x.IsInSource && y != null && y.IsInSource) 30if (obj != null && obj.IsInSource)
Debugging\AbstractBreakpointResolver.cs (2)
80var location = methodSymbol.Locations.First(loc => loc.IsInSource); 269if ((methodOrProperty.Language == _language) && methodOrProperty.Locations.Any(static location => location.IsInSource))
DocumentHighlighting\AbstractDocumentHighlightsService.cs (3)
220if (symbol.Locations.First().IsInSource) 234if (location.IsInSource) 304if (location != null && location.IsInSource)
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingSemanticChangeProcessor.cs (1)
181Debug.Assert(location.IsInSource);
ExtractMethod\MethodExtractor.VariableSymbol.cs (5)
223Contract.ThrowIfFalse(_localSymbol.Locations[0].IsInSource); 224Contract.ThrowIfFalse(other._localSymbol.Locations[0].IsInSource); 244Contract.ThrowIfFalse(_localSymbol.Locations[0].IsInSource); 335Contract.ThrowIfFalse(locationLeft.IsInSource); 336Contract.ThrowIfFalse(locationRight.IsInSource);
FindUsages\AbstractFindUsagesService_FindImplementations.cs (1)
127if (location.IsInSource && !seenLocations.Add((location.SourceTree.FilePath, location.SourceSpan)))
FindUsages\DefinitionItemFactory.cs (2)
236if (location.IsInSource && 292Debug.Assert(location.IsInSource);
InheritanceMargin\AbstractInheritanceMarginService_Helpers.cs (1)
736if (location.IsInSource && location.IsVisibleSourceLocation() && solution.GetDocument(location.SourceTree) is { } document)
Navigation\NavigableItemFactory.cs (1)
64: locations.Where(loc => loc.IsInSource);
src\Analyzers\Core\Analyzers\Helpers\HashCodeAnalyzer\HashCodeAnalyzer.cs (1)
70if (!method.Locations[0].IsInSource)
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (1)
554Debug.Assert(diagnostic.Location.IsInSource);
src\Analyzers\Core\CodeFixes\GenerateMember\AbstractGenerateMemberService.cs (1)
52return locations.Any(static loc => loc.IsInSource);
ValueTracking\ValueTracker.FindReferencesProgress.cs (1)
44if (!location.Location.IsInSource)
Microsoft.CodeAnalysis.Test.Utilities (3)
Diagnostics\DiagnosticDescription.cs (2)
158if (_location.IsInSource) 539if (l.IsInSource)
Diagnostics\DiagnosticExtensions.cs (1)
446=> e.Location.IsInSource ? $"{e.Severity} {e.Id}: {e.GetMessage(CultureInfo.CurrentCulture)}" :
Microsoft.CodeAnalysis.VisualBasic (19)
Binding\Binder_Expressions.vb (2)
3023declarationLocation.IsInSource AndAlso 3024referenceLocation IsNot Nothing AndAlso referenceLocation.IsInSource AndAlso
CommandLine\CommandLineDiagnosticFormatter.vb (1)
131If diagnostic.Location.IsInSource Then
Emit\PEModuleBuilder.vb (1)
301If loc.IsInSource AndAlso (result Is Nothing OrElse compilation.CompareSourceLocations(result, loc) > 0) Then
Symbols\AnonymousTypes\AnonymousTypeManager_Templates.vb (1)
35If location.IsInSource Then
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousTypeOrDelegateTemplateSymbol.vb (1)
337Debug.Assert(newLocation.IsInSource)
Symbols\LexicalSortKey.vb (2)
181Debug.Assert(first.IsInSource OrElse first.IsEmbeddedOrMyTemplateLocation()) 182Debug.Assert(second.IsInSource OrElse second.IsEmbeddedOrMyTemplateLocation())
Symbols\MethodSymbolExtensions.vb (1)
51If location.IsInSource AndAlso location.SourceTree Is syntaxTree AndAlso parameter.Span.Contains(location.SourceSpan) Then
Symbols\NamedTypeSymbolExtensions.vb (3)
30If methodLoc.IsInSource AndAlso methodLoc.SourceTree Is tree AndAlso methodLoc.SourceSpan = nameSpan Then 40If methodLoc.IsInSource AndAlso methodLoc.SourceTree Is tree AndAlso methodLoc.SourceSpan = nameSpan Then 61If methodLoc.IsInSource AndAlso
Symbols\Source\OverrideHidingHelper.vb (2)
450Debug.Assert(hidingMember.Locations(0).IsInSource) 469Debug.Assert(hidingMember.Locations(0).IsInSource)
Symbols\Source\SourceMemberContainerTypeSymbol.vb (1)
1359Debug.Assert(firstLocation.IsInSource)
Symbols\Source\SourceModuleSymbol.vb (1)
1024If loc.IsInSource Then
Symbols\Source\SourceNamedTypeSymbol.vb (1)
540If location.IsInSource AndAlso Not DirectCast(location.SourceTree, VisualBasicSyntaxTree).IsEmbeddedSyntaxTree Then
Symbols\Source\SourceTypeParameterSymbol.vb (1)
129Debug.Assert(loc.IsInSource)
Symbols\Symbol.vb (1)
372If location.IsInSource AndAlso location.SourceTree IsNot Nothing Then
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (8)
CompilationTestUtils.vb (8)
1006If e.Location.IsInSource Then 1039If Not (loc1.IsInSource Or loc1.IsInMetadata) Then 1040If Not (loc2.IsInSource Or loc2.IsInMetadata) Then 1048ElseIf Not (loc2.IsInSource Or loc2.IsInMetadata) Then 1050ElseIf loc1.IsInSource AndAlso loc2.IsInSource Then 1073ElseIf loc1.IsInSource Then 1075ElseIf loc2.IsInSource Then
Microsoft.CodeAnalysis.Workspaces (33)
CodeFixes\CodeFix.cs (1)
62if (diagnostic.Location.IsInSource)
CodeFixes\FixAllOccurrences\BatchFixAllProvider.cs (1)
118.Where(d => d.Location.IsInSource)
Diagnostics\DiagnosticData.cs (1)
264if (location.IsInSource)
FindSymbols\FindReferences\DependentTypeFinder.cs (1)
43private static readonly Func<Location, bool> s_isInSource = static loc => loc.IsInSource;
FindSymbols\FindReferences\Finders\AbstractMemberScopedReferenceFinder.cs (1)
38if (location == null || !location.IsInSource)
FindSymbols\FindReferences\MetadataUnifyingEquivalenceComparer.cs (1)
51=> symbol.Locations.Any(static l => l.IsInSource);
FindSymbols\SymbolFinder.cs (1)
201=> symbol != null && symbol.Locations.Any(static loc => loc.IsInSource);
Rename\ConflictEngine\ConflictResolver.cs (6)
101var renameSymbolDeclarationLocation = renameLocations.Symbol.Locations.Where(loc => loc.IsInSource).FirstOrDefault(); 172return conflictResolution.ReplacementTextValid && renamedSymbol != null && renamedSymbol.Locations.Any(static loc => loc.IsInSource); 331if (newLocation.IsInSource) 369if (location != null && location.IsInSource) 412.OrderBy(l => l.IsInSource ? solution.GetDocumentId(l.SourceTree)!.Id : Guid.Empty) 413.ThenBy(l => l.IsInSource ? l.SourceSpan.Start : int.MaxValue);
Rename\RenameUtilities.cs (1)
91var documentsOfRenameSymbolDeclaration = symbol.Locations.Where(l => l.IsInSource).Select(l => solution.GetRequiredDocument(l.SourceTree!));
Rename\SymbolicRenameLocations.ReferenceProcessing.cs (5)
68referencedSymbol.Locations.Any(static loc => loc.IsInSource)) 190if (location.IsInSource) 198if (referencedSymbol.Kind == SymbolKind.NamedType && referencedSymbol.Locations.All(l => l.IsInSource)) 215if (location.IsInSource) 233RoslynDebug.Assert(location.IsInSource);
Shared\Extensions\IFindReferencesResultExtensions.cs (1)
82if (definition.Locations.Any(static loc => loc.IsInSource))
Shared\Extensions\ISymbolExtensions.cs (2)
76if (!includingSourceSymbols && symbol.Locations.All(loc => loc.IsInSource)) 659(s.IsNamespace() || s.Locations.Any(static loc => loc.IsInSource) || !s.HasUnsupportedMetadata) &&
Shared\Extensions\ITypeSymbolExtensions.cs (1)
158typeSymbol.Locations.Any(static location => location.IsInSource)) ||
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (1)
607=> symbol.Locations.Any() && symbol.Locations.All(location => location.IsInSource);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\LocationExtensions.cs (3)
33if (!loc.IsInSource) 44Debug.Assert(loc1.IsInSource && loc2.IsInSource);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.BodyLevelSymbolKey.cs (2)
29if (location.IsInSource) 66Contract.ThrowIfFalse(locations.All(loc => loc.IsInSource));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (1)
261if (location.IsInSource)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (1)
489if (!location.IsInSource)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (1)
150if (location != null && location.IsInSource)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationContext.cs (1)
170if (location != null && !location.IsInSource)
Microsoft.Interop.SourceGeneration (6)
DiagnosticExtensions.cs (6)
74if (location.IsInSource) 99location: location.IsInSource ? location : Location.None, 111location: location.IsInSource ? location : Location.None, 178if (location.IsInSource) 203location: location.IsInSource ? location : Location.None, 215location: location.IsInSource ? location : Location.None,
Microsoft.VisualStudio.LanguageServices (6)
Library\ObjectBrowser\AbstractListItemFactory.cs (3)
133|| symbol.Locations.Any(static l => l.IsInSource || l.IsInMetadata); 148if (symbol.Locations.Any(static l => l.IsInSource)) 573if (typeMember.Locations.Any(static l => l.IsInSource))
Progression\GraphBuilder.cs (1)
215preferredLocation = newSymbol.Locations.Where(loc => loc.IsInSource).FirstOrDefault();
Progression\GraphQueries\IsUsedByGraphQuery.cs (1)
35.Where(l => l != null && l.IsInSource);
Workspace\VisualStudioSymbolNavigationService.cs (1)
60var sourceLocations = symbol.Locations.Where(loc => loc.IsInSource);