8 overrides of FilePath
Microsoft.CodeAnalysis.CSharp (3)
Syntax\CSharpSyntaxTree.Dummy.cs (1)
63public override string FilePath
Syntax\CSharpSyntaxTree.LazySyntaxTree.cs (1)
39public override string FilePath
Syntax\CSharpSyntaxTree.ParsedSyntaxTree.cs (1)
57public override string FilePath
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
Workspace\LanguageServices\CSharpSyntaxTreeFactoryService.ParsedSyntaxTree.cs (1)
24public override string FilePath { get; }
Microsoft.CodeAnalysis.VisualBasic (3)
Syntax\VisualBasicSyntaxTree.DummySyntaxTree.vb (1)
61Public Overrides ReadOnly Property FilePath As String
Syntax\VisualBasicSyntaxTree.LazySyntaxTree.vb (1)
39Public Overrides ReadOnly Property FilePath As String
Syntax\VisualBasicSyntaxTree.ParsedSyntaxTree.vb (1)
63Public Overrides ReadOnly Property FilePath As String
Microsoft.CodeAnalysis.VisualBasic.Workspaces (1)
Workspace\LanguageServices\VisualBasicSyntaxTreeFactoryService.ParsedSyntaxTree.vb (1)
23Public Overrides ReadOnly Property FilePath As String
225 references to FilePath
ConfigurationSchemaGenerator (3)
RuntimeSource\Configuration.Binder\Specs\InterceptorInfo.cs (2)
193return sourceReferenceResolver?.NormalizePath(operationSyntaxTree.FilePath, baseFilePath: null) ?? operationSyntaxTree.FilePath;
RuntimeSource\SourceGenerators\DiagnosticInfo.cs (1)
34=> Location.Create(location.SourceTree?.FilePath ?? "", location.SourceSpan, location.GetLineSpan().Span);
dotnet-format (3)
Analyzers\AnalyzerRunner.cs (1)
88formattableDocumentPaths.Contains(diagnostic.Location.SourceTree.FilePath))
Analyzers\SolutionCodeFixApplier.cs (1)
112return projectDiagnostics.Where(diagnostic => diagnostic.Location.SourceTree?.FilePath == document.FilePath).ToImmutableArray();
Utilities\GeneratedCodeUtilities.cs (1)
24if (IsGeneratedCodeFileName(syntaxTree.FilePath))
GenerateDocumentationAndConfigFiles (11)
src\roslyn\src\Compilers\Core\Portable\SourceGeneration\GeneratedCodeUtilities.cs (1)
51return IsGeneratedCodeFile(tree.FilePath) ||
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AliasSymbolKey.cs (1)
22visitor.WriteString(symbol.DeclaringSyntaxReferences.FirstOrDefault()?.SyntaxTree.FilePath ?? "");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.NamedTypeSymbolKey.cs (2)
23visitor.WriteString(symbol.IsFileLocal ? symbol.DeclaringSyntaxReferences[0].SyntaxTree.FilePath : null); 183type.DeclaringSyntaxReferences[0].SyntaxTree.FilePath != filePath)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (1)
457if (tree.FilePath == filePath)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (1)
262WriteString(location.SourceTree.FilePath);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (4)
206afterSourceTree.FilePath == declarationList.FirstOrDefault()?.SyntaxTree.FilePath) 220beforeSourceTree.FilePath == declarationList.FirstOrDefault()?.SyntaxTree.FilePath)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ProjectExtensions.cs (1)
42var diagnosticFilePath = PathUtilities.GetDirectoryName(diagnostic?.Location.SourceTree?.FilePath ?? project.FilePath);
Microsoft.Analyzers.Extra.Tests (1)
Resources\RoslynTestUtils.cs (1)
530return diagnostics.Where(d => d.Location.SourceTree!.FilePath.EndsWith(document.Name));
Microsoft.Analyzers.Local.Tests (1)
Resources\RoslynTestUtils.cs (1)
531return diagnostics.Where(d => d.Location.SourceTree!.FilePath.EndsWith(document.Name));
Microsoft.CodeAnalysis (38)
CodeGen\SequencePointList.cs (3)
125lastDebugDocument = documentProvider(lastPath, basePath: lastPathIsMapped ? this._tree.FilePath : null); 151lastPath = currentTree.FilePath; 172lastDebugDocument = documentProvider(lastPath, basePath: lastPathIsMapped ? currentTree.FilePath : null);
CommandLine\CommonCompiler.cs (8)
427if (!EmbeddedSourcePaths.Contains(tree.FilePath)) 433if (embeddedTreeMap.ContainsKey(tree.FilePath)) 439embeddedTreeMap.Add(tree.FilePath, tree); 795/// <param name="generatedFilesBaseDirectory">The base directory for the <see cref="SyntaxTree.FilePath"/> of generated files.</param> 1166Debug.Assert(!string.IsNullOrWhiteSpace(tree.FilePath)); 1172embeddedTextBuilder.Add(EmbeddedText.FromSource(tree.FilePath, sourceText)); 1175analyzerOptionsBuilder.Add(analyzerConfigSet!.GetOptionsForSourcePath(tree.FilePath)); 1181var path = tree.FilePath;
Compilation\Compilation.cs (3)
2518if (!string.IsNullOrEmpty(tree.FilePath) && tree.GetText().Encoding == null) 2554if (!string.IsNullOrEmpty(tree.FilePath)) 2558string normalizedPath = documentsBuilder.NormalizeDebugDocumentPath(tree.FilePath, basePath: null);
Compilation\DeterministicKey.cs (1)
39=> _tree.FilePath;
Diagnostic\Location.cs (1)
100result += "(" + this.SourceTree?.FilePath + this.SourceSpan + ")";
DiagnosticAnalyzer\AnalysisContextInfo.cs (1)
97sb.AppendLine($"{nameof(SyntaxTree)}: {_file.Value.SourceTree.FilePath}");
DiagnosticAnalyzer\CompilationUnitCompletedEvent.cs (1)
37=> $"CompilationUnitCompletedEvent({CompilationUnit.FilePath}){FilterSpan}";
DiagnosticAnalyzer\DiagnosticAnalysisContextHelpers.cs (2)
99throw new ArgumentException(string.Format(CodeAnalysisResources.InvalidDiagnosticLocationReported, id, location.SourceTree.FilePath), "diagnostic"); 105throw new ArgumentException(string.Format(CodeAnalysisResources.InvalidDiagnosticSpanReported, id, location.SourceSpan, location.SourceTree.FilePath), "diagnostic");
EmbeddedText.cs (1)
37/// <remarks>See remarks of <see cref="SyntaxTree.FilePath"/></remarks>
PEWriter\MetadataWriter.cs (1)
1805if (documentsBuilder.TryGetDebugDocument(tree.FilePath, basePath: null) is { } doc && !_documentIndex.ContainsKey(doc))
ReferenceManager\CommonReferenceManager.Resolution.cs (4)
815if (localBoundReferenceDirectives != null && localBoundReferenceDirectives.ContainsKey((referenceDirective.Location.SourceTree.FilePath, referenceDirective.File))) 835localBoundReferenceDirectives.Add((referenceDirective.Location.SourceTree.FilePath, referenceDirective.File), boundReference); 872string? basePath = (tree != null && tree.FilePath.Length > 0) ? tree.FilePath : null;
SourceGeneration\GeneratedCodeUtilities.cs (1)
51return IsGeneratedCodeFile(tree.FilePath) ||
SourceGeneration\GeneratorDriverState.cs (1)
80/// The base directory for the <see cref="SyntaxTree.FilePath"/> of generated files.
Syntax\SyntaxTree.cs (6)
231/// otherwise it's <see cref="FilePath"/>. 293return resolver.NormalizePath(mappedSpan.Path, baseFilePath: mappedSpan.HasMappedPath ? FilePath : null) ?? mappedSpan.Path; 304return FilePath; 307return resolver.NormalizePath(FilePath, baseFilePath: null) ?? FilePath; 394/// Returns a new tree whose <see cref="FilePath"/> is the specified node and other properties are copied from the current tree.
Syntax\SyntaxTreeComparer.cs (3)
27return string.Equals(x.FilePath, y.FilePath, StringComparison.OrdinalIgnoreCase) && 33return Hash.Combine(obj.FilePath.GetHashCode(), SourceTextComparer.Instance.GetHashCode(obj.GetText()));
XmlFileResolver.cs (1)
44/// Path of the source file (<see cref="SyntaxTree.FilePath"/>) or XML document that contains the <paramref name="path"/>.
Microsoft.CodeAnalysis.Analyzers (11)
src\roslyn\src\Compilers\Core\Portable\SourceGeneration\GeneratedCodeUtilities.cs (1)
51return IsGeneratedCodeFile(tree.FilePath) ||
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AliasSymbolKey.cs (1)
22visitor.WriteString(symbol.DeclaringSyntaxReferences.FirstOrDefault()?.SyntaxTree.FilePath ?? "");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.NamedTypeSymbolKey.cs (2)
23visitor.WriteString(symbol.IsFileLocal ? symbol.DeclaringSyntaxReferences[0].SyntaxTree.FilePath : null); 183type.DeclaringSyntaxReferences[0].SyntaxTree.FilePath != filePath)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (1)
457if (tree.FilePath == filePath)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (1)
262WriteString(location.SourceTree.FilePath);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (4)
206afterSourceTree.FilePath == declarationList.FirstOrDefault()?.SyntaxTree.FilePath) 220beforeSourceTree.FilePath == declarationList.FirstOrDefault()?.SyntaxTree.FilePath)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ProjectExtensions.cs (1)
42var diagnosticFilePath = PathUtilities.GetDirectoryName(diagnostic?.Location.SourceTree?.FilePath ?? project.FilePath);
Microsoft.CodeAnalysis.AnalyzerUtilities (6)
src\roslyn\src\Compilers\Core\Portable\SourceGeneration\GeneratedCodeUtilities.cs (1)
51return IsGeneratedCodeFile(tree.FilePath) ||
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AliasSymbolKey.cs (1)
22visitor.WriteString(symbol.DeclaringSyntaxReferences.FirstOrDefault()?.SyntaxTree.FilePath ?? "");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.NamedTypeSymbolKey.cs (2)
23visitor.WriteString(symbol.IsFileLocal ? symbol.DeclaringSyntaxReferences[0].SyntaxTree.FilePath : null); 183type.DeclaringSyntaxReferences[0].SyntaxTree.FilePath != filePath)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (1)
457if (tree.FilePath == filePath)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (1)
262WriteString(location.SourceTree.FilePath);
Microsoft.CodeAnalysis.CodeStyle (9)
src\roslyn\src\Analyzers\Core\Analyzers\FileHeaders\AbstractFileHeaderDiagnosticAnalyzer.cs (1)
75var expectedFileHeader = fileHeaderTemplate.Replace("{fileName}", Path.GetFileName(tree.FilePath));
src\roslyn\src\Analyzers\Core\Analyzers\MatchFolderAndNamespace\AbstractMatchFolderAndNamespaceDiagnosticAnalyzer.cs (2)
141if (!PathUtilities.IsChildPath(projectDir, namespaceDeclaration.SyntaxTree.FilePath)) 150PathUtilities.GetDirectoryName(namespaceDeclaration.SyntaxTree.FilePath));
src\roslyn\src\Compilers\Core\Portable\SourceGeneration\GeneratedCodeUtilities.cs (1)
51return IsGeneratedCodeFile(tree.FilePath) ||
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AliasSymbolKey.cs (1)
22visitor.WriteString(symbol.DeclaringSyntaxReferences.FirstOrDefault()?.SyntaxTree.FilePath ?? "");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.NamedTypeSymbolKey.cs (2)
23visitor.WriteString(symbol.IsFileLocal ? symbol.DeclaringSyntaxReferences[0].SyntaxTree.FilePath : null); 183type.DeclaringSyntaxReferences[0].SyntaxTree.FilePath != filePath)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (1)
457if (tree.FilePath == filePath)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (1)
262WriteString(location.SourceTree.FilePath);
Microsoft.CodeAnalysis.CodeStyle.Fixes (7)
src\roslyn\src\Analyzers\Core\CodeFixes\UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (2)
495.Select(d => (d.SyntaxTree.FilePath, d.Span)) 576if (constructorSpans.Contains((node.SyntaxTree.FilePath, node.Span)))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (4)
206afterSourceTree.FilePath == declarationList.FirstOrDefault()?.SyntaxTree.FilePath) 220beforeSourceTree.FilePath == declarationList.FirstOrDefault()?.SyntaxTree.FilePath)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ProjectExtensions.cs (1)
42var diagnosticFilePath = PathUtilities.GetDirectoryName(diagnostic?.Location.SourceTree?.FilePath ?? project.FilePath);
Microsoft.CodeAnalysis.CSharp (33)
Binder\Binder_Symbols.cs (2)
2062arg0 = srcSymbol.GetFirstLocation().SourceTree.FilePath; 2216arg0 = first.GetFirstLocation().SourceTree.FilePath;
CommandLine\CSharpCompiler.cs (2)
262string entryPointFileName = PathUtilities.GetFileName(entryPoint.GetFirstLocation().SourceTree!.FilePath); 359string? resolvedPath = resolver.ResolveReference(path, tree.FilePath);
Compilation\CSharpCompilation.cs (10)
1130throw new KeyNotFoundException($"Syntax tree not found with file path: {tree.FilePath}"); 1157var path = resolver?.NormalizePath(tree.FilePath, baseFilePath: null) ?? tree.FilePath; 1209var path = FileUtilities.GetNormalizedPathOrOriginalPath(tree.FilePath, basePath: null); 1318RoslynDebug.Assert(directive.SyntaxTree.FilePath is object); 1321return ReferenceDirectiveMap.TryGetValue((directive.SyntaxTree.FilePath, directive.File.ValueText), out reference) ? reference : null; 3786if (!paths.Add(tree.FilePath)) 3788_duplicatePaths.Add(tree.FilePath); 3823var filePath = location.SourceTree?.FilePath; 4029var normalizedPath = documentsBuilder.NormalizeDebugDocumentPath(path, basePath: tree.FilePath);
Compilation\CSharpSemanticModel.cs (1)
5286var path = tree.FilePath;
Compilation\SyntaxAndDeclarationManager.cs (5)
226resolvedFilePath = resolver.ResolveReference(path, baseFilePath: tree.FilePath); 247loadedSyntaxTreeMapBuilder.Add(loadedTree.FilePath, loadedTree); 343loadedSyntaxTreeMap = loadedSyntaxTreeMap.Remove(tree.FilePath); 507loadedSyntaxTreeMapBuilder.Remove(tree.FilePath); 671return loadedSyntaxTreeMap.TryGetValue(tree.FilePath, out loadedTree) && (tree == loadedTree);
Emitter\Model\PEModuleBuilder.cs (1)
464Cci.DebugSourceDocument doc = DebugDocumentsBuilder.TryGetDebugDocument(span.Path, basePath: location.SourceTree.FilePath);
Lowering\Instrumentation\CodeCoverageInstrumenter.cs (1)
487path = syntax.SyntaxTree.FilePath;
Symbols\Source\SourceMethodSymbolWithAttributes.cs (6)
1204var normalizedPath = FileUtilities.GetNormalizedPathOrOriginalPath(attributeFilePath, basePath: SyntaxTree.FilePath); 1231=> tree.FilePath 1237var recommendedPath = PathUtilities.IsAbsolute(SyntaxTree.FilePath) 1238? PathUtilities.GetRelativePath(PathUtilities.GetDirectoryName(SyntaxTree.FilePath), suffixMatch.FilePath) 1239: suffixMatch.FilePath;
Syntax\CSharpSyntaxTree.cs (5)
580FilePath, 648=> new(FilePath, GetLinePosition(span.Start, cancellationToken), GetLinePosition(span.End, cancellationToken)); 659/// otherwise it's <see cref="SyntaxTree.FilePath"/>. 667=> GetDirectiveMap().TranslateSpan(GetText(cancellationToken), this.FilePath, span); 689=> GetDirectiveMap().TranslateSpanAndVisibility(GetText(), FilePath, span, out isHiddenPosition);
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryImports\CSharpRemoveUnnecessaryImportsDiagnosticAnalyzer.cs (1)
75tree.FilePath.IndexOf("Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator") == -1)
Microsoft.CodeAnalysis.CSharp.Features (3)
Diagnostics\Analyzers\FileBasedPrograms\FileLevelDirectiveDiagnosticAnalyzer.cs (1)
54new SourceFile(tree.FilePath, tree.GetText(cancellationToken)),
QuickInfo\CSharpSemanticQuickInfoProvider.cs (1)
351var symbolFilePaths = symbol.DeclaringSyntaxReferences.Select(reference => reference.SyntaxTree.FilePath);
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryImports\CSharpRemoveUnnecessaryImportsDiagnosticAnalyzer.cs (1)
75tree.FilePath.IndexOf("Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator") == -1)
Microsoft.CodeAnalysis.CSharp.NetAnalyzers (2)
Microsoft.NetCore.Analyzers\Usage\CSharpMissingShebangInFileBasedProgram.cs (2)
57if (!context.Tree.FilePath.Equals(entryPointFilePath, StringComparison.Ordinal)) 89var filePath = tree.FilePath;
Microsoft.CodeAnalysis.Features (23)
CodeFixes\Configuration\ConfigurationUpdater.cs (1)
435diagnosticFilePath = diagnosticSourceTree.FilePath.ToLowerInvariant();
CodeLens\CodeLensFindReferenceProgress.cs (2)
80_queriedNode.SyntaxTree.FilePath.Equals(candidateSyntaxNode.SyntaxTree.FilePath,
CodeLens\LocationComparer.cs (3)
22x.SourceTree.FilePath.Equals(y.SourceTree.FilePath, StringComparison.OrdinalIgnoreCase); 33StringComparer.OrdinalIgnoreCase.GetHashCode(obj.SourceTree.FilePath));
Diagnostics\Service\DocumentAnalysisExecutor_Helpers.cs (2)
154throw new ArgumentException(string.Format(FeaturesResources.Reported_diagnostic_0_has_a_source_location_in_file_1_which_is_not_part_of_the_compilation_being_analyzed, id, location.SourceTree.FilePath), "diagnostic"); 160throw new ArgumentException(string.Format(FeaturesResources.Reported_diagnostic_0_has_a_source_location_1_in_file_2_which_is_outside_of_the_given_file, id, location.SourceSpan, location.SourceTree.FilePath), "diagnostic");
EditAndContinue\ActiveStatementsMap.cs (2)
211var targetPath = mappedSection.HasMappedPath ? mappedSection.Path : oldTree.FilePath; 235if (DocumentPathMap.TryGetValue(oldTree.FilePath, out var activeStatements))
FindUsages\AbstractFindUsagesService_FindImplementations.cs (1)
133if (location.IsInSource && !seenLocations.Add((location.SourceTree.FilePath, location.SourceSpan)))
InheritanceMargin\AbstractInheritanceMarginService_Helpers.cs (5)
210=> syntaxTree1.FilePath != syntaxTree2.FilePath 211? StringComparer.OrdinalIgnoreCase.Compare(syntaxTree1.FilePath, syntaxTree2.FilePath) 276var filePath = groupSyntaxTree.FilePath;
MoveStaticMembers\MoveStaticMembersOptions.cs (1)
45FilePath = sourceLocation.SyntaxTree.FilePath;
src\roslyn\src\Analyzers\Core\Analyzers\FileHeaders\AbstractFileHeaderDiagnosticAnalyzer.cs (1)
75var expectedFileHeader = fileHeaderTemplate.Replace("{fileName}", Path.GetFileName(tree.FilePath));
src\roslyn\src\Analyzers\Core\Analyzers\MatchFolderAndNamespace\AbstractMatchFolderAndNamespaceDiagnosticAnalyzer.cs (2)
141if (!PathUtilities.IsChildPath(projectDir, namespaceDeclaration.SyntaxTree.FilePath)) 150PathUtilities.GetDirectoryName(namespaceDeclaration.SyntaxTree.FilePath));
src\roslyn\src\Analyzers\Core\CodeFixes\UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (2)
495.Select(d => (d.SyntaxTree.FilePath, d.Span)) 576if (constructorSpans.Contains((node.SyntaxTree.FilePath, node.Span)))
SyncNamespaces\AbstractSyncNamespacesService.cs (1)
172.WhereAsArray(diagnostic => diagnostic.Location.SourceTree?.FilePath == document.FilePath);
Microsoft.CodeAnalysis.Rebuild (1)
CompilationFactory.cs (1)
85.Select(st => (path: st.FilePath, text: st.GetText()))
Microsoft.CodeAnalysis.ResxSourceGenerator (6)
src\roslyn\src\Compilers\Core\Portable\SourceGeneration\GeneratedCodeUtilities.cs (1)
51return IsGeneratedCodeFile(tree.FilePath) ||
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AliasSymbolKey.cs (1)
22visitor.WriteString(symbol.DeclaringSyntaxReferences.FirstOrDefault()?.SyntaxTree.FilePath ?? "");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.NamedTypeSymbolKey.cs (2)
23visitor.WriteString(symbol.IsFileLocal ? symbol.DeclaringSyntaxReferences[0].SyntaxTree.FilePath : null); 183type.DeclaringSyntaxReferences[0].SyntaxTree.FilePath != filePath)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (1)
457if (tree.FilePath == filePath)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (1)
262WriteString(location.SourceTree.FilePath);
Microsoft.CodeAnalysis.VisualBasic (27)
CommandLine\VisualBasicCompiler.vb (1)
286Dim resolvedPath = resolver.ResolveReference(path, tree.FilePath)
Compilation\SemanticModel.vb (17)
3583Return String.Format("{0}: at {1}", Me.SyntaxTree.FilePath, position) 3587If node Is Nothing Then Return Me.SyntaxTree.FilePath 3588Return String.Format("{0}: {1} ({2})", Me.SyntaxTree.FilePath, node.Kind.ToString(), node.Position) 3592If node Is Nothing Then Return Me.SyntaxTree.FilePath 3593Return String.Format("{0}: {1} ({2}) at {3}", Me.SyntaxTree.FilePath, node.Kind.ToString(), node.Position, position) 3597If firstStatement Is Nothing OrElse lastStatement Is Nothing Then Return Me.SyntaxTree.FilePath 3598Return String.Format("{0}: {1} to {2}", Me.SyntaxTree.FilePath, firstStatement.Position, lastStatement.EndPosition) 3602If expression Is Nothing OrElse type Is Nothing Then Return Me.SyntaxTree.FilePath 3603Return String.Format("{0}: {1} ({2}) -> {3} {4}", Me.SyntaxTree.FilePath, expression.Kind.ToString(), expression.Position, type.TypeKind.ToString(), type.Name) 3607If expression Is Nothing OrElse type Is Nothing Then Return Me.SyntaxTree.FilePath 3608Return String.Format("{0}: {1} ({2}) -> {3} {4} at {5}", Me.SyntaxTree.FilePath, expression.Kind.ToString(), expression.Position, type.TypeKind.ToString(), type.Name, position) 3612If expression Is Nothing Then Return Me.SyntaxTree.FilePath 3613Return String.Format("{0}: {1} ({2}) at {3} ({4})", Me.SyntaxTree.FilePath, expression.Kind.ToString(), expression.Position, position, [option].ToString()) 3617Return String.Format("{0}: {1} at {2} ({3})", Me.SyntaxTree.FilePath, name, position, [option].ToString()) 3621If symbol Is Nothing Then Return Me.SyntaxTree.FilePath 3622Return String.Format("{0}: {1} {2} at {3}", Me.SyntaxTree.FilePath, symbol.Kind.ToString(), symbol.Name, position) 3626Return String.Format("{0} ({1})", Me.SyntaxTree.FilePath, stage.ToString())
Compilation\VisualBasicCompilation.vb (1)
2653Dim normalizedPath = documentsBuilder.NormalizeDebugDocumentPath(path, basePath:=tree.FilePath)
Emit\PEModuleBuilder.vb (1)
282Dim doc As Cci.DebugSourceDocument = DebugDocumentsBuilder.TryGetDebugDocument(span.Path, basePath:=location.SourceTree.FilePath)
Lowering\Instrumentation\CodeCoverageInstrumenter.vb (1)
443path = syntax.SyntaxTree.FilePath
Symbols\Source\SourceNamespaceSymbol.vb (2)
470declaration.SyntaxReference.SyntaxTree.FilePath IsNot Nothing Then 472Dim otherPath = declaration.SyntaxReference.SyntaxTree.FilePath
Syntax\VisualBasicSyntaxTree.vb (4)
142FilePath, 438Return New FileLinePositionSpan(Me.FilePath, GetLinePosition(span.Start), GetLinePosition(span.End)) 452Return GetDirectiveMap().TranslateSpan(GetText(cancellationToken), FilePath, span) 461Return GetDirectiveMap().TranslateSpanAndVisibility(Me.GetText(), Me.FilePath, span, isHiddenPosition)
Microsoft.CodeAnalysis.Workspaces (22)
CodeFixes\FixAllOccurrences\BatchFixAllProvider.cs (1)
118.OrderBy(d => d.Location.SourceTree!.FilePath)
FindSymbols\ReferenceLocation.cs (2)
136var thisPath = this.Location.SourceTree?.FilePath; 137var otherPath = other.Location.SourceTree?.FilePath;
Shared\Extensions\ProjectExtensions.cs (1)
38=> project.GetDocument(tree) ?? throw ISolutionExtensions.CreateDocumentNotFoundException(tree.FilePath);
src\roslyn\src\Compilers\Core\Portable\SourceGeneration\GeneratedCodeUtilities.cs (1)
51return IsGeneratedCodeFile(tree.FilePath) ||
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AliasSymbolKey.cs (1)
22visitor.WriteString(symbol.DeclaringSyntaxReferences.FirstOrDefault()?.SyntaxTree.FilePath ?? "");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.NamedTypeSymbolKey.cs (2)
23visitor.WriteString(symbol.IsFileLocal ? symbol.DeclaringSyntaxReferences[0].SyntaxTree.FilePath : null); 183type.DeclaringSyntaxReferences[0].SyntaxTree.FilePath != filePath)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (1)
457if (tree.FilePath == filePath)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (1)
262WriteString(location.SourceTree.FilePath);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (4)
206afterSourceTree.FilePath == declarationList.FirstOrDefault()?.SyntaxTree.FilePath) 220beforeSourceTree.FilePath == declarationList.FirstOrDefault()?.SyntaxTree.FilePath)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ProjectExtensions.cs (1)
42var diagnosticFilePath = PathUtilities.GetDirectoryName(diagnostic?.Location.SourceTree?.FilePath ?? project.FilePath);
Workspace\Solution\ProjectState.cs (4)
429return GetOptionsForSourcePath(cache, tree.FilePath); 475return GetOptionsForSourcePath(cache, tree.FilePath); 564.GetValue(cancellationToken).GetOptionsForSourcePath(tree.FilePath); 580.GetValue(cancellationToken).GetOptionsForSourcePath(tree.FilePath);
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker_Generators.cs (1)
390generatedSource.SyntaxTree.FilePath,
Workspace\Solution\SolutionCompilationState.SymbolToProjectId.cs (2)
91$"We should always be able to map a body symbol back to a document:\r\n{symbol.Kind}\r\n{symbol.Name}\r\n{syntaxTree.FilePath}\r\n{projectId}"); 102$"Syntax tree for a body symbol should map to the same project as the body symbol's assembly:\r\n{symbol.Kind}\r\n{symbol.Name}\r\n{syntaxTree.FilePath}\r\n{projectId}\r\n{documentId.ProjectId}");
Microsoft.Extensions.Logging.Generators (1)
LoggerMessageGenerator.Roslyn4.0.cs (1)
121if ((seen ??= new()).Add((diagnostic.Id, diagnostic.Location?.SourceSpan, diagnostic.Location?.SourceTree?.FilePath, diagnostic.GetMessage())))
Microsoft.Maui.Controls.BindingSourceGen (1)
BindingInvocationDescription.cs (1)
24 : new SourceCodeLocation(location.SourceTree.FilePath, location.SourceSpan, location.GetLineSpan().Span);
Roslyn.Diagnostics.Analyzers (11)
src\roslyn\src\Compilers\Core\Portable\SourceGeneration\GeneratedCodeUtilities.cs (1)
51return IsGeneratedCodeFile(tree.FilePath) ||
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AliasSymbolKey.cs (1)
22visitor.WriteString(symbol.DeclaringSyntaxReferences.FirstOrDefault()?.SyntaxTree.FilePath ?? "");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.NamedTypeSymbolKey.cs (2)
23visitor.WriteString(symbol.IsFileLocal ? symbol.DeclaringSyntaxReferences[0].SyntaxTree.FilePath : null); 183type.DeclaringSyntaxReferences[0].SyntaxTree.FilePath != filePath)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (1)
457if (tree.FilePath == filePath)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (1)
262WriteString(location.SourceTree.FilePath);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (4)
206afterSourceTree.FilePath == declarationList.FirstOrDefault()?.SyntaxTree.FilePath) 220beforeSourceTree.FilePath == declarationList.FirstOrDefault()?.SyntaxTree.FilePath)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ProjectExtensions.cs (1)
42var diagnosticFilePath = PathUtilities.GetDirectoryName(diagnostic?.Location.SourceTree?.FilePath ?? project.FilePath);
System.Text.Json.SourceGeneration (2)
JsonSourceGenerator.Parser.cs (2)
314string.Compare(attributeTree.FilePath, canonicalTree.FilePath, StringComparison.Ordinal) < 0)
System.Text.RegularExpressions.Generator (2)
UpgradeToGeneratedRegexCodeFixer.cs (2)
541callSites.Add((syntaxRef.SyntaxTree.FilePath ?? string.Empty, treeIndex, descendant.SpanStart)); 559string currentFilePath = nodeToFix.SyntaxTree.FilePath ?? string.Empty;