11 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.Symbol.UnitTests (1)
DeclarationTests.cs (1)
945public override string FilePath
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (1)
Syntax\Mocks\MockCSharpSyntaxTree.cs (1)
20public override string FilePath { get; }
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.Test.Utilities (1)
ParserTestUtilities.vb (1)
493Public Overrides ReadOnly Property FilePath As String
Microsoft.CodeAnalysis.VisualBasic.Workspaces (1)
Workspace\LanguageServices\VisualBasicSyntaxTreeFactoryService.ParsedSyntaxTree.vb (1)
23Public Overrides ReadOnly Property FilePath As String
305 references to FilePath
AnalyzerRunner (1)
DiagnosticAnalyzerRunner.cs (1)
205.ThenBy(tuple => tuple.Item2.Location.SourceTree?.FilePath, StringComparer.OrdinalIgnoreCase)
BuildValidator (1)
CompilationDiff.cs (1)
305var sourceFilePath = Path.Combine(sourcesPath, Path.GetFileName(tree.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);
IdeCoreBenchmarks (1)
IncrementalSourceGeneratorBenchmarks.cs (1)
158var syntaxTree = compilation.SyntaxTrees.Single(t => t.FilePath.Contains("AbstractCaseCorrectionService"));
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.AspNetCore.Components.Analyzers.Tests (1)
Verifiers\DiagnosticVerifier.cs (1)
261string resultMethodName = diagnostics[i].Location.SourceTree.FilePath.EndsWith(".cs", StringComparison.Ordinal) ? "GetCSharpResultAt" : "GetBasicResultAt";
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (1)
Verifiers\DiagnosticVerifier.cs (1)
261string resultMethodName = diagnostics[i].Location.SourceTree.FilePath.EndsWith(".cs", StringComparison.Ordinal) ? "GetCSharpResultAt" : "GetBasicResultAt";
Microsoft.AspNetCore.Http.Extensions.Tests (2)
RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (2)
142var newSyntaxTree = CSharpSyntaxTree.Create(syntaxRootNode, options: ParseOptions, encoding: encoding, path: syntaxTree.FilePath); 146embeddedTexts.Add(EmbeddedText.FromSource(syntaxTree.FilePath, sourceText));
Microsoft.AspNetCore.Http.Microbenchmarks (2)
src\Http\Http.Extensions\test\RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (2)
142var newSyntaxTree = CSharpSyntaxTree.Create(syntaxRootNode, options: ParseOptions, encoding: encoding, path: syntaxTree.FilePath); 146embeddedTexts.Add(EmbeddedText.FromSource(syntaxTree.FilePath, sourceText));
Microsoft.AspNetCore.Http.RequestDelegateGenerator (2)
src\Shared\RoslynUtils\SyntaxTreeExtensions.cs (2)
13resolver?.NormalizePath(tree.FilePath, baseFilePath: null) ?? tree.FilePath;
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)
438if (!EmbeddedSourcePaths.Contains(tree.FilePath)) 444if (embeddedTreeMap.ContainsKey(tree.FilePath)) 450embeddedTreeMap.Add(tree.FilePath, tree); 806/// <param name="generatedFilesBaseDirectory">The base directory for the <see cref="SyntaxTree.FilePath"/> of generated files.</param> 1161Debug.Assert(!string.IsNullOrWhiteSpace(tree.FilePath)); 1167embeddedTextBuilder.Add(EmbeddedText.FromSource(tree.FilePath, sourceText)); 1170analyzerOptionsBuilder.Add(analyzerConfigSet!.GetOptionsForSourcePath(tree.FilePath)); 1176var path = tree.FilePath;
Compilation\Compilation.cs (3)
2497if (!string.IsNullOrEmpty(tree.FilePath) && tree.GetText().Encoding == null) 2533if (!string.IsNullOrEmpty(tree.FilePath)) 2537string normalizedPath = documentsBuilder.NormalizeDebugDocumentPath(tree.FilePath, basePath: null);
Compilation\DeterministicKey.cs (1)
38=> _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)
1792if (documentsBuilder.TryGetDebugDocument(tree.FilePath, basePath: null) is { } doc && !_documentIndex.ContainsKey(doc))
ReferenceManager\CommonReferenceManager.Resolution.cs (4)
814if (localBoundReferenceDirectives != null && localBoundReferenceDirectives.ContainsKey((referenceDirective.Location.SourceTree.FilePath, referenceDirective.File))) 834localBoundReferenceDirectives.Add((referenceDirective.Location.SourceTree.FilePath, referenceDirective.File), boundReference); 871string? basePath = (tree != null && tree.FilePath.Length > 0) ? tree.FilePath : null;
SourceGeneration\GeneratedCodeUtilities.cs (1)
51return IsGeneratedCodeFile(tree.FilePath) ||
SourceGeneration\GeneratorDriverState.cs (1)
79/// The base directory for the <see cref="SyntaxTree.FilePath"/> of generated files.
Syntax\SyntaxTree.cs (6)
230/// otherwise it's <see cref="FilePath"/>. 292return resolver.NormalizePath(mappedSpan.Path, baseFilePath: mappedSpan.HasMappedPath ? FilePath : null) ?? mappedSpan.Path; 303return FilePath; 306return resolver.NormalizePath(FilePath, baseFilePath: null) ?? FilePath; 393/// 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.CodeStyle (8)
src\Analyzers\Core\Analyzers\FileHeaders\AbstractFileHeaderDiagnosticAnalyzer.cs (1)
75var expectedFileHeader = fileHeaderTemplate.Replace("{fileName}", Path.GetFileName(tree.FilePath));
src\Analyzers\Core\Analyzers\MatchFolderAndNamespace\AbstractMatchFolderAndNamespaceDiagnosticAnalyzer.cs (2)
141if (!PathUtilities.IsChildPath(projectDir, namespaceDeclaration.SyntaxTree.FilePath)) 150PathUtilities.GetDirectoryName(namespaceDeclaration.SyntaxTree.FilePath)!);
src\Compilers\Core\Portable\SourceGeneration\GeneratedCodeUtilities.cs (1)
51return IsGeneratedCodeFile(tree.FilePath) ||
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AliasSymbolKey.cs (1)
22visitor.WriteString(symbol.DeclaringSyntaxReferences.FirstOrDefault()?.SyntaxTree.FilePath ?? "");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.NamedTypeSymbolKey.cs (2)
23? symbol.DeclaringSyntaxReferences[0].SyntaxTree.FilePath 182type.DeclaringSyntaxReferences[0].SyntaxTree.FilePath != filePath)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (1)
263WriteString(location.SourceTree.FilePath);
Microsoft.CodeAnalysis.CodeStyle.Fixes (5)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (4)
203afterSourceTree.FilePath == declarationList.FirstOrDefault()?.SyntaxTree.FilePath) 219beforeSourceTree.FilePath == declarationList.FirstOrDefault()?.SyntaxTree.FilePath)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ProjectExtensions.cs (1)
58var diagnosticFilePath = PathUtilities.GetDirectoryName(diagnostic?.Location.SourceTree?.FilePath ?? project.FilePath);
Microsoft.CodeAnalysis.CSharp (27)
CommandLine\CSharpCompiler.cs (2)
262string entryPointFileName = PathUtilities.GetFileName(entryPoint.GetFirstLocation().SourceTree!.FilePath); 359string? resolvedPath = resolver.ResolveReference(path, tree.FilePath);
Compilation\CSharpCompilation.cs (8)
1047throw new KeyNotFoundException($"Syntax tree not found with file path: {tree.FilePath}"); 1074var path = resolver?.NormalizePath(tree.FilePath, baseFilePath: null) ?? tree.FilePath; 1126var path = FileUtilities.GetNormalizedPathOrOriginalPath(tree.FilePath, basePath: null); 3556if (!paths.Add(tree.FilePath)) 3558_duplicatePaths.Add(tree.FilePath); 3593var filePath = location.SourceTree?.FilePath; 3797var normalizedPath = documentsBuilder.NormalizeDebugDocumentPath(path, basePath: tree.FilePath);
Compilation\CSharpSemanticModel.cs (1)
5225var path = tree.FilePath;
Compilation\SyntaxAndDeclarationManager.cs (4)
226resolvedFilePath = resolver.ResolveReference(path, baseFilePath: tree.FilePath); 247loadedSyntaxTreeMapBuilder.Add(loadedTree.FilePath, loadedTree); 343loadedSyntaxTreeMap = loadedSyntaxTreeMap.Remove(tree.FilePath); 671return loadedSyntaxTreeMap.TryGetValue(tree.FilePath, out loadedTree) && (tree == loadedTree);
Emitter\Model\PEModuleBuilder.cs (1)
454Cci.DebugSourceDocument doc = DebugDocumentsBuilder.TryGetDebugDocument(span.Path, basePath: location.SourceTree.FilePath);
Lowering\Instrumentation\CodeCoverageInstrumenter.cs (1)
487path = syntax.SyntaxTree.FilePath;
Symbols\Source\SourceMethodSymbolWithAttributes.cs (5)
1106DeclaringCompilation.AddInterception(matchingTree.FilePath, position, attributeLocation, this); 1211var normalizedPath = FileUtilities.GetNormalizedPathOrOriginalPath(attributeFilePath, basePath: SyntaxTree.FilePath); 1244var recommendedPath = PathUtilities.IsAbsolute(SyntaxTree.FilePath) 1245? PathUtilities.GetRelativePath(PathUtilities.GetDirectoryName(SyntaxTree.FilePath), suffixMatch.FilePath) 1319DeclaringCompilation.AddInterception(matchingTree.FilePath, referencedToken.Position, attributeLocation, this);
Syntax\CSharpSyntaxTree.cs (5)
579FilePath, 647=> new(FilePath, GetLinePosition(span.Start, cancellationToken), GetLinePosition(span.End, cancellationToken)); 658/// otherwise it's <see cref="SyntaxTree.FilePath"/>. 666=> GetDirectiveMap().TranslateSpan(GetText(cancellationToken), this.FilePath, span); 688=> GetDirectiveMap().TranslateSpanAndVisibility(GetText(), FilePath, span, out isHiddenPosition);
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (3)
PDB\PDBEmbeddedSourceTests.cs (3)
47EmbeddedText.FromSource(tree1.FilePath, tree1.GetText()), 48EmbeddedText.FromSource(tree2.FilePath, tree2.GetText()) 109embeddedTexts: new[] { EmbeddedText.FromSource(tree.FilePath, tree.GetText()) });
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (7)
Diagnostics\DiagnosticAnalyzerTests.cs (5)
1015string.Format(CodeAnalysisResources.InvalidDiagnosticLocationReported, AnalyzerWithInvalidDiagnosticLocation.Descriptor.Id, treeInAnotherCompilation.FilePath), "diagnostic").Message; 1108string.Format(CodeAnalysisResources.InvalidDiagnosticSpanReported, AnalyzerWithInvalidDiagnosticSpan.Descriptor.Id, badSpan, treeInAnotherCompilation.FilePath), "diagnostic").Message; 1585diagnosticArgument = tree.FilePath; 1591AddExpectedNonLocalDiagnostic(builder, GeneratedCodeAnalyzer.Summary, "PartialType(IsGeneratedCode:False)", $"{compilation.SyntaxTrees[0].FilePath}(IsGeneratedCode:False)"); 1708var files = compilation.SyntaxTrees.Select(t => t.FilePath).ToImmutableArray();
Diagnostics\GetDiagnosticsTests.cs (2)
186Assert.True(completedCompilationUnits.Contains(tree1.FilePath)); 238Assert.True(completedCompilationUnits.Contains(tree1.FilePath));
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (57)
Semantics\InterceptorsTests.cs (1)
7193Assert.Equal("", tree.FilePath);
SourceGeneration\GeneratorDriverTests.cs (1)
535var filePaths = outputCompilation.SyntaxTrees.Skip(1).Select(t => t.FilePath).ToArray();
SourceGeneration\SyntaxAwareGeneratorTests.cs (55)
870Assert.EndsWith("fieldA.cs", results.GeneratedTrees[0].FilePath); 871Assert.EndsWith("fieldB.cs", results.GeneratedTrees[1].FilePath); 872Assert.EndsWith("fieldC.cs", results.GeneratedTrees[2].FilePath); 916Assert.EndsWith("fieldA.cs", results.GeneratedTrees[0].FilePath); 917Assert.EndsWith("classC.cs", results.GeneratedTrees[1].FilePath); 918Assert.EndsWith("classD.cs", results.GeneratedTrees[2].FilePath); 962Assert.EndsWith("fieldA.cs", results.GeneratedTrees[0].FilePath); 963Assert.EndsWith("fieldB.cs", results.GeneratedTrees[1].FilePath); 964Assert.EndsWith("fieldC.cs", results.GeneratedTrees[2].FilePath); 973Assert.EndsWith("fieldA.cs", results.GeneratedTrees[0].FilePath); 974Assert.EndsWith("fieldB.cs", results.GeneratedTrees[1].FilePath); 975Assert.EndsWith("fieldC.cs", results.GeneratedTrees[2].FilePath); 984Assert.EndsWith("fieldA.cs", results.GeneratedTrees[0].FilePath); 985Assert.EndsWith("fieldB.cs", results.GeneratedTrees[1].FilePath); 986Assert.EndsWith("fieldC.cs", results.GeneratedTrees[2].FilePath); 1029Assert.EndsWith("fieldA.cs", results.GeneratedTrees[0].FilePath); 1030Assert.EndsWith("fieldB.cs", results.GeneratedTrees[1].FilePath); 1031Assert.EndsWith("fieldC.cs", results.GeneratedTrees[2].FilePath); 1047Assert.EndsWith("fieldA.cs", results.GeneratedTrees[0].FilePath); 1048Assert.EndsWith("fieldB.cs", results.GeneratedTrees[1].FilePath); 1049Assert.EndsWith("fieldC.cs", results.GeneratedTrees[2].FilePath); 1050Assert.EndsWith("fieldD.cs", results.GeneratedTrees[3].FilePath); 1051Assert.EndsWith("fieldE.cs", results.GeneratedTrees[4].FilePath); 1104Assert.EndsWith("fieldA.cs", results.GeneratedTrees[0].FilePath); 1105Assert.EndsWith("fieldB.cs", results.GeneratedTrees[1].FilePath); 1106Assert.EndsWith("fieldC.cs", results.GeneratedTrees[2].FilePath); 1107Assert.EndsWith("fieldD.cs", results.GeneratedTrees[3].FilePath); 1108Assert.EndsWith("fieldE.cs", results.GeneratedTrees[4].FilePath); 1128Assert.EndsWith("fieldA.cs", results.GeneratedTrees[0].FilePath); 1129Assert.EndsWith("fieldB.cs", results.GeneratedTrees[1].FilePath); 1130Assert.EndsWith("fieldC.cs", results.GeneratedTrees[2].FilePath); 1236Assert.EndsWith("fieldA.cs", results.GeneratedTrees[0].FilePath); 1237Assert.EndsWith("fieldB.cs", results.GeneratedTrees[1].FilePath); 1238Assert.EndsWith("fieldC.cs", results.GeneratedTrees[2].FilePath); 1265Assert.EndsWith("fieldD.cs", results.GeneratedTrees[0].FilePath); 1266Assert.EndsWith("fieldB.cs", results.GeneratedTrees[1].FilePath); 1267Assert.EndsWith("fieldC.cs", results.GeneratedTrees[2].FilePath); 1323Assert.EndsWith("fieldA.cs", results.GeneratedTrees[0].FilePath); 1324Assert.EndsWith("fieldB.cs", results.GeneratedTrees[1].FilePath); 1325Assert.EndsWith("fieldC.cs", results.GeneratedTrees[2].FilePath); 1336Assert.EndsWith("fieldA.cs", results.GeneratedTrees[0].FilePath); 1337Assert.EndsWith("fieldB.cs", results.GeneratedTrees[1].FilePath); 1338Assert.EndsWith("fieldC.cs", results.GeneratedTrees[2].FilePath); 1349Assert.EndsWith("fieldA.cs", results.GeneratedTrees[0].FilePath); 1350Assert.EndsWith("fieldB.cs", results.GeneratedTrees[1].FilePath); 1351Assert.EndsWith("fieldC.cs", results.GeneratedTrees[2].FilePath); 1411Assert.EndsWith("fieldA.cs", results.GeneratedTrees[0].FilePath); 1412Assert.EndsWith("fieldB.cs", results.GeneratedTrees[1].FilePath); 1413Assert.EndsWith("fieldC.cs", results.GeneratedTrees[2].FilePath); 1441Assert.EndsWith("fieldA.cs", results.GeneratedTrees[0].FilePath); 1442Assert.EndsWith("fieldB.cs", results.GeneratedTrees[1].FilePath); 1443Assert.EndsWith("fieldC.cs", results.GeneratedTrees[2].FilePath); 1474Assert.EndsWith("fieldA.cs", results.GeneratedTrees[0].FilePath); 1475Assert.EndsWith("fieldB.cs", results.GeneratedTrees[1].FilePath); 1476Assert.EndsWith("fieldC.cs", results.GeneratedTrees[2].FilePath);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (4)
Compilation\UsedAssembliesTests.cs (3)
164yield return (comp.ReplaceSyntaxTree(tree, CSharpTestBase.Parse(builder.ToString(), tree.FilePath, (CSharpParseOptions)tree.Options)), before, after); 192yield return (comp.ReplaceSyntaxTree(tree, CSharpTestBase.Parse(builder.ToString(), tree.FilePath, parseOptions)), before, after); 203yield return (comp.ReplaceSyntaxTree(tree, CSharpTestBase.Parse(builder.ToString(), tree.FilePath, parseOptions)).
DeclarationTests.cs (1)
947get { return _underlyingTree.FilePath; }
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (9)
Diagnostics\LocationsTests.cs (1)
57Assert.Equal(string.Format("[{0};{1}]", expectedPath, hasMappedPath ? syntaxTree.FilePath : null), actualDisplayPath);
IncrementalParsing\IncrementalParsingTests.cs (1)
3060var oldTree = SyntaxFactory.SyntaxTree(oldRoot, options: tempTree.Options, path: tempTree.FilePath);
Syntax\SyntaxTreeTests.cs (7)
291Assert.Equal("new.cs", newTree.FilePath); 307Assert.Equal("new.cs", newTree.FilePath); 320Assert.Equal("new.cs", newTree.FilePath); 328Assert.Equal(string.Empty, oldTree.WithFilePath(null).FilePath); 330Assert.Equal(string.Empty, oldTree.WithFilePath(null).FilePath); 331Assert.Equal(string.Empty, SyntaxFactory.ParseSyntaxTree("", path: null).FilePath); 332Assert.Equal(string.Empty, CSharpSyntaxTree.Create((CSharpSyntaxNode)oldTree.GetRoot()).FilePath);
Microsoft.CodeAnalysis.Features (13)
CodeFixes\Configuration\ConfigurationUpdater.cs (1)
435diagnosticFilePath = diagnosticSourceTree.FilePath.ToLowerInvariant();
CodeLens\CodeLensFindReferenceProgress.cs (1)
82_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));
EditAndContinue\ActiveStatementsMap.cs (2)
217var targetPath = mappedSection.HasMappedPath ? mappedSection.Path : oldTree.FilePath; 241if (DocumentPathMap.TryGetValue(oldTree.FilePath, out var activeStatements))
FindUsages\AbstractFindUsagesService_FindImplementations.cs (1)
127if (location.IsInSource && !seenLocations.Add((location.SourceTree.FilePath, location.SourceSpan)))
MoveStaticMembers\MoveStaticMembersOptions.cs (1)
45FileName = sourceLocation.SyntaxTree.FilePath;
src\Analyzers\Core\Analyzers\FileHeaders\AbstractFileHeaderDiagnosticAnalyzer.cs (1)
75var expectedFileHeader = fileHeaderTemplate.Replace("{fileName}", Path.GetFileName(tree.FilePath));
src\Analyzers\Core\Analyzers\MatchFolderAndNamespace\AbstractMatchFolderAndNamespaceDiagnosticAnalyzer.cs (2)
141if (!PathUtilities.IsChildPath(projectDir, namespaceDeclaration.SyntaxTree.FilePath)) 150PathUtilities.GetDirectoryName(namespaceDeclaration.SyntaxTree.FilePath)!);
SyncNamespaces\AbstractSyncNamespacesService.cs (1)
172.Where(diagnostic => diagnostic.Location.SourceTree?.FilePath == document.FilePath)
Microsoft.CodeAnalysis.Features.Test.Utilities (2)
EditAndContinue\EditAndContinueTestVerifier.cs (1)
478if (tree.FilePath != span.Path)
EditAndContinue\EditAndContinueWorkspaceTestBase.cs (1)
416var fileName = PathUtilities.GetFileName(syntaxTree.FilePath);
Microsoft.CodeAnalysis.LanguageServer.Protocol (2)
Features\Diagnostics\DocumentAnalysisExecutor_Helpers.cs (2)
347throw 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"); 353throw 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");
Microsoft.CodeAnalysis.Rebuild (1)
CompilationFactory.cs (1)
85.Select(st => (path: st.FilePath, text: st.GetText()))
Microsoft.CodeAnalysis.Rebuild.UnitTests (2)
CSharpRebuildTests.cs (1)
38.Select(x => compilationFactory.CreateSyntaxTree(x.FilePath, x.GetText()))
RoundTripUtil.cs (1)
71Assert.True(original.SyntaxTrees.All(x => !string.IsNullOrEmpty(x.FilePath)));
Microsoft.CodeAnalysis.Test.Utilities (12)
Compilation\IRuntimeEnvironment.cs (1)
252.Select(t => (filePath: t.FilePath, text: t.GetText()))
CompilationVerifier.cs (1)
647ILValidation.GetSequencePointMarkers(xmlMethod, id => _compilation.SyntaxTrees.Single(tree => tree.FilePath == documentMap[id]).GetText()) :
Diagnostics\CommonDiagnosticAnalyzers.cs (10)
108var filePath = GetUriForPath(tree.FilePath); 186var filePath = GetUriForPath(tree.FilePath); 263var filePath = GetUriForPath(tree.FilePath); 316var filePath = GetUriForPath(tree.FilePath); 1542sortedCallbackTreePaths.Add($"{treeContext.Tree.FilePath}(IsGeneratedCode:{treeContext.IsGeneratedCode})"); 1565sortedCallbackSemanticModelPaths.Add($"{context.SemanticModel.SyntaxTree.FilePath}(IsGeneratedCode:{context.IsGeneratedCode})")); 1665ReportDiagnosticsCore(addDiagnostic, tree.GetRoot().GetLastToken().GetLocation(), tree.FilePath); 1774var fileNameWithoutExtension = PathUtilities.GetFileName(tree.FilePath, includeExtension: false); 1823var diagnostic = Diagnostic.Create(descriptor, Location.None, treeContext.Tree.FilePath); 1827diagnostic = Diagnostic.Create(UniqueTextFileDescriptor, Location.None, treeContext.Tree.FilePath);
Microsoft.CodeAnalysis.VisualBasic (27)
CommandLine\VisualBasicCompiler.vb (1)
285Dim resolvedPath = resolver.ResolveReference(path, tree.FilePath)
Compilation\SemanticModel.vb (17)
3588Return String.Format("{0}: at {1}", Me.SyntaxTree.FilePath, position) 3592If node Is Nothing Then Return Me.SyntaxTree.FilePath 3593Return String.Format("{0}: {1} ({2})", Me.SyntaxTree.FilePath, node.Kind.ToString(), node.Position) 3597If node Is Nothing Then Return Me.SyntaxTree.FilePath 3598Return String.Format("{0}: {1} ({2}) at {3}", Me.SyntaxTree.FilePath, node.Kind.ToString(), node.Position, position) 3602If firstStatement Is Nothing OrElse lastStatement Is Nothing Then Return Me.SyntaxTree.FilePath 3603Return String.Format("{0}: {1} to {2}", Me.SyntaxTree.FilePath, firstStatement.Position, lastStatement.EndPosition) 3607If expression Is Nothing OrElse type Is Nothing Then Return Me.SyntaxTree.FilePath 3608Return String.Format("{0}: {1} ({2}) -> {3} {4}", Me.SyntaxTree.FilePath, expression.Kind.ToString(), expression.Position, type.TypeKind.ToString(), type.Name) 3612If expression Is Nothing OrElse type Is Nothing Then Return Me.SyntaxTree.FilePath 3613Return String.Format("{0}: {1} ({2}) -> {3} {4} at {5}", Me.SyntaxTree.FilePath, expression.Kind.ToString(), expression.Position, type.TypeKind.ToString(), type.Name, position) 3617If expression Is Nothing Then Return Me.SyntaxTree.FilePath 3618Return String.Format("{0}: {1} ({2}) at {3} ({4})", Me.SyntaxTree.FilePath, expression.Kind.ToString(), expression.Position, position, [option].ToString()) 3622Return String.Format("{0}: {1} at {2} ({3})", Me.SyntaxTree.FilePath, name, position, [option].ToString()) 3626If symbol Is Nothing Then Return Me.SyntaxTree.FilePath 3627Return String.Format("{0}: {1} {2} at {3}", Me.SyntaxTree.FilePath, symbol.Kind.ToString(), symbol.Name, position) 3631Return String.Format("{0} ({1})", Me.SyntaxTree.FilePath, stage.ToString())
Compilation\VisualBasicCompilation.vb (1)
2629Dim 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)
139FilePath, 435Return New FileLinePositionSpan(Me.FilePath, GetLinePosition(span.Start), GetLinePosition(span.End)) 449Return GetDirectiveMap().TranslateSpan(GetText(cancellationToken), FilePath, span) 458Return GetDirectiveMap().TranslateSpanAndVisibility(Me.GetText(), Me.FilePath, span, isHiddenPosition)
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (1)
Diagnostics\DiagnosticAnalyzerTests.vb (1)
929diagnosticArgument = tree.FilePath
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (15)
SymbolsTests\Source\SourceSymbolTests.vb (15)
340Assert.Equal("a.vb", locs(0).SourceTree.FilePath) 342Assert.Equal("b.vb", locs(1).SourceTree.FilePath) 349Assert.Equal("a.vb", locs(0).SourceTree.FilePath) 351Assert.Equal("b.vb", locs(1).SourceTree.FilePath) 358Assert.Equal("a.vb", locs(0).SourceTree.FilePath) 360Assert.Equal("b.vb", locs(1).SourceTree.FilePath) 366Assert.Equal("a.vb", locs(0).SourceTree.FilePath) 372Assert.Equal("a.vb", locs(0).SourceTree.FilePath) 378Assert.Equal("a.vb", locs(0).SourceTree.FilePath) 385Assert.Equal("a.vb", locs(0).SourceTree.FilePath) 387Assert.Equal("b.vb", locs(1).SourceTree.FilePath) 394Assert.Equal("a.vb", locs(0).SourceTree.FilePath) 396Assert.Equal("b.vb", locs(1).SourceTree.FilePath) 403Assert.Equal("a.vb", locs(0).SourceTree.FilePath) 405Assert.Equal("b.vb", locs(1).SourceTree.FilePath)
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (9)
IncrementalParser\IncrementalParser.vb (1)
1717Dim oldTree2 = VisualBasicSyntaxTree.Create(DirectCast(oldRoot2, VisualBasicSyntaxNode), DirectCast(tempTree2.Options, VisualBasicParseOptions), tempTree2.FilePath, Encoding.UTF8)
LocationTests.vb (1)
45Assert.Equal(String.Format("[{0};{1}]", expectedPath, If(hasMappedPath, syntaxTree.FilePath, Nothing)), actualDisplayPath)
Syntax\SyntaxTreeTests.vb (7)
156Assert.Equal(newTree.FilePath, "new.vb") 170Assert.Equal(newTree.FilePath, "new.vb") 182Assert.Equal(newTree.FilePath, "new.vb") 189Assert.Equal(String.Empty, oldTree.WithFilePath(Nothing).FilePath) 191Assert.Equal(String.Empty, oldTree.WithFilePath(Nothing).FilePath) 192Assert.Equal(String.Empty, SyntaxFactory.ParseSyntaxTree("", path:=Nothing).FilePath) 193Assert.Equal(String.Empty, VisualBasicSyntaxTree.Create(CType(oldTree.GetRoot, VisualBasicSyntaxNode), path:=Nothing).FilePath)
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (5)
BasicTestBase.vb (1)
825Dim syntaxNode As SyntaxNode = CompilationUtils.FindBindingText(Of TSyntaxNode)(compilation, tree.FilePath, which, prefixMatch:=True)
CompilationTestUtils.vb (4)
1055If sourceTree1.FilePath <> sourceTree2.FilePath Then Return comparer.Compare(sourceTree1.FilePath, sourceTree2.FilePath)
Microsoft.CodeAnalysis.Workspaces (20)
CodeFixes\FixAllOccurrences\BatchFixAllProvider.cs (1)
119.OrderBy(d => d.Location.SourceTree!.FilePath)
FindSymbols\ReferenceLocation.cs (2)
136var thisPath = this.Location.SourceTree?.FilePath; 137var otherPath = other.Location.SourceTree?.FilePath;
src\Compilers\Core\Portable\SourceGeneration\GeneratedCodeUtilities.cs (1)
51return IsGeneratedCodeFile(tree.FilePath) ||
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AliasSymbolKey.cs (1)
22visitor.WriteString(symbol.DeclaringSyntaxReferences.FirstOrDefault()?.SyntaxTree.FilePath ?? "");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.NamedTypeSymbolKey.cs (2)
23? symbol.DeclaringSyntaxReferences[0].SyntaxTree.FilePath 182type.DeclaringSyntaxReferences[0].SyntaxTree.FilePath != filePath)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (1)
263WriteString(location.SourceTree.FilePath);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (4)
203afterSourceTree.FilePath == declarationList.FirstOrDefault()?.SyntaxTree.FilePath) 219beforeSourceTree.FilePath == declarationList.FirstOrDefault()?.SyntaxTree.FilePath)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ProjectExtensions.cs (1)
58var diagnosticFilePath = PathUtilities.GetDirectoryName(diagnostic?.Location.SourceTree?.FilePath ?? project.FilePath);
Workspace\Solution\ProjectState.cs (4)
379return GetOptionsForSourcePath(cache, tree.FilePath); 451return GetOptionsForSourcePath(cache, tree.FilePath); 566.GetValue(cancellationToken).GetOptionsForSourcePath(tree.FilePath); 573.GetValue(cancellationToken).GetOptionsForSourcePath(tree.FilePath);
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker_Generators.cs (1)
331generatedSource.SyntaxTree.FilePath,
Workspace\Solution\SolutionCompilationState.SymbolToProjectId.cs (2)
90$"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}"); 101$"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.CodeAnalysis.Workspaces.MSBuild.UnitTests (3)
VisualStudioMSBuildWorkspaceTests.cs (3)
439Assert.Equal(expectedFileName, tree.FilePath); 460Assert.Equal(expectedFileName, tree.FilePath); 478Assert.Equal(expectedFileName, tree.FilePath);
Microsoft.CodeAnalysis.Workspaces.UnitTests (13)
SolutionTests\SolutionTests.cs (13)
3251Assert.Same(tree, tree.WithFilePath(tree.FilePath)); 3272Assert.Equal(OldFilePath, oldDocument.GetSyntaxTreeAsync().Result.FilePath); 3280Assert.Equal(NewFilePath, newDocument.GetSyntaxTreeAsync().Result.FilePath); 3782Assert.Equal("new path", tree2.FilePath); 3810Assert.Equal("old path", tree3.FilePath); 3821Assert.Equal("old path", tree4.FilePath); 4082Assert.Equal("DocumentToFreeze.cs", tree.FilePath); 4107Assert.Equal("DocumentToFreeze.cs", tree.FilePath); 4616Assert.Equal("test5.cs", syntaxTrees[0].FilePath, StringComparer.OrdinalIgnoreCase); 4617Assert.Equal("test4.cs", syntaxTrees[1].FilePath, StringComparer.OrdinalIgnoreCase); 4618Assert.Equal("test3.cs", syntaxTrees[2].FilePath, StringComparer.OrdinalIgnoreCase); 4619Assert.Equal("test2.cs", syntaxTrees[3].FilePath, StringComparer.OrdinalIgnoreCase); 4620Assert.Equal("test1.cs", syntaxTrees[4].FilePath, StringComparer.OrdinalIgnoreCase);
Microsoft.VisualStudio.LanguageServices (4)
CallHierarchy\CallHierarchyDetail.cs (1)
35File = location.SourceTree.FilePath;
MoveStaticMembers\VisualStudioMoveStaticMembersOptionsService.cs (1)
160private static string GetFile(Location loc) => loc.SourceTree!.FilePath;
Progression\GraphBuilder.cs (1)
236preferredLocation.SourceTree.FilePath,
Progression\GraphQueries\IsUsedByGraphQuery.cs (1)
57var filePath = location.SourceTree.FilePath;
System.Text.Json.SourceGeneration (1)
src\libraries\Common\src\SourceGenerators\DiagnosticInfo.cs (1)
34=> Location.Create(location.SourceTree?.FilePath ?? "", location.SourceSpan, location.GetLineSpan().Span);
System.Text.RegularExpressions.Generator (1)
RegexGenerator.Parser.cs (1)
255return Location.Create(location.SourceTree?.FilePath ?? string.Empty, location.SourceSpan, location.GetLineSpan().Span);