142 references to FilePath
dotnet-format (21)
Analyzers\AnalyzerFormatter.cs (3)
136formattablePaths.Add(document.FilePath!); 306if (!project.Documents.Any(d => d.FilePath is not null && formattablePaths.Contains(d.FilePath)))
Analyzers\Extensions.cs (2)
48if (document.FilePath is null || !formattablePaths.Contains(document.FilePath))
Analyzers\SolutionCodeFixApplier.cs (1)
112return projectDiagnostics.Where(diagnostic => diagnostic.Location.SourceTree?.FilePath == document.FilePath).ToImmutableArray();
CodeFormatter.cs (9)
53logger.LogDebug(Resources.Project_0_is_using_configuration_from_1, project.Name, configDocument.FilePath); 90logger.LogInformation(Resources.Formatted_code_file_0, documentWithError!.FilePath); 208if (document?.FilePath is null || 209addedFilePaths.Contains(document.FilePath)) 214addedFilePaths.Add(document.FilePath); 217(formatOptions.FileMatcher.HasMatches(document.FilePath) && File.Exists(document.FilePath)); 237Debug.WriteLine($"Including generated file '{document.FilePath}'."); 262Debug.WriteLine($"Including source generated file '{generatedDocument.FilePath}'.");
FormattedFile.cs (1)
20FilePath = document.FilePath;
Formatters\DocumentFormatter.cs (1)
139if (document?.FilePath is null)
Formatters\OrganizeImportsFormatter.cs (1)
58logger.LogWarning(Resources.Unable_to_organize_imports_for_0_The_document_is_too_complex, Path.GetFileName(document.FilePath));
Logging\MSBuildIssueFormatter.cs (1)
9=> $"{document.FilePath ?? document.Name}({lineNumber},{charNumber}): {severity} {issueId}: {message} [{document.Project.FilePath}]";
Workspaces\FolderWorkspace.cs (2)
55if (document?.FilePath != null && text.Encoding != null) 57SaveDocumentText(documentId, document.FilePath, text, text.Encoding);
GenerateDocumentationAndConfigFiles (4)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (1)
106document.FilePath is string filePath &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ProjectExtensions.cs (3)
58var analyzerConfigDirectory = PathUtilities.GetDirectoryName(analyzerConfigDocument.FilePath)!; 69return bestAnalyzerConfigDocument.FilePath; 91return project.AnalyzerConfigDocuments.FirstOrDefault(d => d.FilePath == analyzerConfigPath);
Microsoft.CodeAnalysis.Analyzers (5)
MetaAnalyzers\Fixers\DefineDiagnosticDescriptorArgumentsCorrectlyFix.cs (1)
149additionalDocuments.FirstOrDefault(a => string.Equals(a.FilePath, path, StringComparison.Ordinal)) is { } additionalDocument)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (1)
106document.FilePath is string filePath &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ProjectExtensions.cs (3)
58var analyzerConfigDirectory = PathUtilities.GetDirectoryName(analyzerConfigDocument.FilePath)!; 69return bestAnalyzerConfigDocument.FilePath; 91return project.AnalyzerConfigDocuments.FirstOrDefault(d => d.FilePath == analyzerConfigPath);
Microsoft.CodeAnalysis.CodeStyle.Fixes (5)
src\roslyn\src\Analyzers\Core\CodeFixes\FileHeaders\AbstractFileHeaderCodeFixProvider.cs (1)
75var expectedFileHeader = fileHeaderTemplate.Replace("{fileName}", Path.GetFileName(document.FilePath));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (1)
106document.FilePath is string filePath &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ProjectExtensions.cs (3)
58var analyzerConfigDirectory = PathUtilities.GetDirectoryName(analyzerConfigDocument.FilePath)!; 69return bestAnalyzerConfigDocument.FilePath; 91return project.AnalyzerConfigDocuments.FirstOrDefault(d => d.FilePath == analyzerConfigPath);
Microsoft.CodeAnalysis.CSharp.Features (2)
Completion\CompletionProviders\FileBasedPrograms\IncludeAppDirectiveCompletionProvider.cs (1)
50var documentDirectory = PathUtilities.GetDirectoryName(context.Document.FilePath);
Completion\CompletionProviders\FileBasedPrograms\ProjectAppDirectiveCompletionProvider.cs (1)
48var documentDirectory = PathUtilities.GetDirectoryName(context.Document.FilePath);
Microsoft.CodeAnalysis.Features (67)
AddFileBanner\AbstractAddFileBannerCodeRefactoringProvider.cs (3)
83destinationDocument: document, document.FilePath, sourceDocument: siblingDocument, cancellationToken), 102var fileName = IOUtilities.PerformIO(() => Path.GetFileName(document.FilePath)); 111var fileName = IOUtilities.PerformIO(() => Path.GetFileName(document.FilePath));
AddFileBanner\AddFileBannerHelpers.cs (1)
54var sourceName = IOUtilities.PerformIO(() => Path.GetFileName(sourceDocument.FilePath));
CodeFixes\Configuration\ConfigurationUpdater.cs (1)
421var editorConfigDirectory = PathUtilities.GetDirectoryName(editorConfigDocument.FilePath);
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.AbstractGlobalSuppressMessageCodeAction.cs (1)
78var filePath = document.FilePath;
CodeLens\CodeLensReferencesService.cs (2)
154document.FilePath, 367return !string.IsNullOrEmpty(fullName) ? new ReferenceMethodDescriptor(fullName, document.FilePath, document.Project.OutputFilePath) : null;
CodeRefactorings\CodeRefactoringService.cs (1)
93if (FileNameUtilities.GetExtension(document.FilePath) is string documentExtension && documentExtension.Length > 0)
CodeRefactorings\MoveType\AbstractMoveTypeService.Editor.cs (1)
56=> PathUtilities.GetDirectoryName(SemanticDocument.Document.FilePath) is { } dir
CodeRefactorings\MoveType\AbstractMoveTypeService.MoveTypeEditor.cs (1)
244updatedDocument = await AddFileBannerHelpers.CopyBannerAsync(updatedDocument, sourceDocument.FilePath, sourceDocument, this.CancellationToken).ConfigureAwait(false);
CodeRefactorings\SyncNamespace\AbstractChangeNamespaceService.cs (4)
462RoslynDebug.AssertNotNull(refLocation.Document.FilePath); 463RoslynDebug.AssertNotNull(document.FilePath); 464Debug.Assert(!PathUtilities.PathsEqual(refLocation.Document.FilePath, document.FilePath));
CodeRefactorings\SyncNamespace\AbstractSyncNamespaceCodeRefactoringProvider.State.cs (1)
153var absoluteDirectoryPath = PathUtilities.GetDirectoryName(document.FilePath);
Common\AbstractProjectExtensionProvider.cs (2)
104if (document.FilePath != null && 106Array.IndexOf(extensionInfo.DocumentExtensions, PathUtilities.GetExtension(document.FilePath)) < 0)
Completion\Providers\Scripting\AbstractDirectivePathCompletionProvider.cs (1)
189var result = PathUtilities.GetDirectoryName(document.FilePath);
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (2)
525var filePath = newDocument?.FilePath ?? oldDocument!.FilePath;
EditAndContinue\CommittedSolution.cs (7)
231Contract.ThrowIfNull(document.FilePath); 292filePath: document.FilePath, 327Contract.ThrowIfNull(document.FilePath); 335document.FilePath, 477Contract.ThrowIfNull(document.FilePath); 492var result = TryReadSourceFileChecksumFromPdb(debuggingSession.SessionLog, debugInfoReader, document.FilePath, out checksum, out checksumAlgorithm); 502debuggingSession.SessionLog.Write($"Unable to determine default defaultEncoding for '{document.FilePath}': {e.Message}");
EditAndContinue\DebuggingSession.cs (5)
722Contract.ThrowIfNull(document.FilePath); 727documentIndicesByMappedPath.MultiAdd(document.FilePath, (documentId.ProjectId, i)); 855Contract.ThrowIfNull(mappedDocument.FilePath); 868if (!baseActiveStatements.DocumentPathMap.TryGetValue(mappedDocument.FilePath, out var oldMappedDocumentActiveStatements)) 874var newDocumentActiveStatementSpans = await activeStatementSpanProvider(mappedDocument.Id, mappedDocument.FilePath, cancellationToken).ConfigureAwait(false);
EditAndContinue\EditAndContinueDocumentAnalysesCache.cs (4)
119if (oldDocument.FilePath == null || newDocument.FilePath == null) 131var newMappedDocumentSpans = await newActiveStatementSpanProvider(newDocument.Id, newDocument.FilePath, cancellationToken).ConfigureAwait(false); 151newMappedDocumentSpans = await newActiveStatementSpanProvider((newDocument.FilePath == mappedFilePath) ? newDocument.Id : null, mappedFilePath, cancellationToken).ConfigureAwait(false);
EditAndContinue\EditSession.cs (6)
634diagnostics.Add(Diagnostic.Create(descriptor, Location.Create(newDocument.FilePath!, textSpan: default, lineSpan: default), [newDocument.FilePath])); 678Contract.ThrowIfNull(document.FilePath); 684Location.Create(document.FilePath, textSpan: default, lineSpan: default), 1115var path = changedDocument.FilePath; 1242var staleDocumentPath = staleDocument.FilePath;
EditAndContinue\PdbMatchingSourceTextProvider.cs (3)
89Contract.ThrowIfNull(oldDocument.FilePath); 100if (_isActive && oldSolutionVersion >= _baselineSolutionContentVersion && !_documentsWithChangedLoaderByPath.ContainsKey(oldDocument.FilePath)) 102_documentsWithChangedLoaderByPath.Add(oldDocument.FilePath, (oldDocument.DocumentState, oldSolutionVersion));
EditAndContinue\TraceLog.cs (7)
63Debug.Assert(document.FilePath != null); 67var documentDir = PathUtilities.GetDirectoryName(document.FilePath)!; 68var extension = PathUtilities.GetExtension(document.FilePath); 69var fileName = PathUtilities.GetFileName(document.FilePath, includeExtension: false); 109Debug.Assert(document.FilePath != null); 128if (oldDocument?.FilePath != null) 133if (newDocument?.FilePath != null)
ExternalAccess\VSTypeScript\VSTypeScriptTaskListService.cs (1)
41var location = Location.Create(document.FilePath!, textSpan, text.Lines.GetLinePositionSpan(textSpan));
MetadataAsSource\DecompilationMetadataAsSourceFileProvider.cs (2)
302if (document.FilePath is not null && _generatedFilenameToInformation.TryGetValue(document.FilePath, out var documentIdInfo))
MetadataAsSource\MetadataAsSourceFileService.cs (1)
259Contract.ThrowIfNull(document.FilePath);
Navigation\INavigableItem.cs (1)
57document.FilePath,
PdbSourceDocument\PdbSourceDocumentMetadataAsSourceFileProvider.cs (6)
279var firstDocument = navigateProject.Documents.First(d => d.FilePath?.Equals(firstDocumentFilePath, StringComparison.OrdinalIgnoreCase) ?? false); 286var sourceDescription = sourceFileInfos.FirstOrDefault(sfi => sfi!.FilePath?.Equals(navigateDocument.FilePath, StringComparison.OrdinalIgnoreCase) ?? false)?.SourceDescription ?? FeaturesResources.from_metadata; 292var documentTooltip = navigateDocument.FilePath + Environment.NewLine + dllPath; 294return new MetadataAsSourceFile(navigateDocument.FilePath!, navigateLocation, documentName, documentTooltip); 379if (document.FilePath is not null && 380_fileToDocumentInfoMap.TryGetValue(document.FilePath, out var info))
Shared\Utilities\ExtractTypeHelpers.cs (1)
61var newDocumentPath = PathUtilities.CombinePaths(PathUtilities.GetDirectoryName(hintDocument.FilePath), fileName);
src\roslyn\src\Analyzers\Core\CodeFixes\FileHeaders\AbstractFileHeaderCodeFixProvider.cs (1)
75var expectedFileHeader = fileHeaderTemplate.Replace("{fileName}", Path.GetFileName(document.FilePath));
SyncNamespaces\AbstractSyncNamespacesService.cs (1)
172.WhereAsArray(diagnostic => diagnostic.Location.SourceTree?.FilePath == document.FilePath);
Microsoft.CodeAnalysis.Workspaces (23)
Classification\SemanticClassificationCacheUtilities.cs (1)
24var documentKey = new DocumentKey(projectKey, document.Id, document.FilePath, document.Name);
Diagnostics\DiagnosticData.cs (2)
177originalLineInfo = new FileLinePositionSpan(document?.FilePath ?? "", span: default); 218document = project.Documents.FirstOrDefault(d => d.FilePath == diagnostic.Location.GetLineSpan().Path);
Diagnostics\DocumentAnalysisScope.cs (1)
53var filePath = TextDocument.FilePath ?? TextDocument.Name;
Diagnostics\Extensions.cs (2)
66if (textDocument.FilePath is null) 70return Location.Create(textDocument.FilePath, span, text.Lines.GetLinePositionSpan(span));
Diagnostics\FileContentLoadAnalyzer.cs (3)
36? textDocument.FilePath is null ? Location.None : Location.Create(textDocument.FilePath, textSpan: default, lineSpan: default) 39var filePath = textDocument.FilePath;
LinkedFileDiffMerging\LinkedFileDiffMergingSession.cs (1)
35var filePath = newDocument.FilePath;
Rename\ConflictEngine\MutableConflictResolution.cs (2)
102if (File.Exists(document.FilePath)) 104var directory = Directory.GetParent(document.FilePath)?.FullName;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ProjectExtensions.cs (3)
58var analyzerConfigDirectory = PathUtilities.GetDirectoryName(analyzerConfigDocument.FilePath)!; 69return bestAnalyzerConfigDocument.FilePath; 91return project.AnalyzerConfigDocuments.FirstOrDefault(d => d.FilePath == analyzerConfigPath);
Workspace\AdhocWorkspace.cs (3)
169var loader = TextLoader.From(TextAndVersion.Create(text, version, doc.FilePath)); 197var loader = TextLoader.From(TextAndVersion.Create(text, version, doc.FilePath)); 225var loader = TextLoader.From(TextAndVersion.Create(text, version, doc.FilePath));
Workspace\Solution\Document.cs (1)
519/// share the same <see cref="TextDocument.FilePath" />. This <see cref="DocumentId"/> is excluded from the
Workspace\Solution\Solution.cs (1)
1714/// <see cref="TextDocument.FilePath"/> that matches the given file path. This may return IDs for any type of document
Workspace\Workspace.cs (2)
2038=> CreateDocumentInfoWithoutText(doc).WithTextLoader(TextLoader.From(TextAndVersion.Create(doc.GetTextSynchronously(CancellationToken.None), VersionStamp.Create(), doc.FilePath))); 2047filePath: doc.FilePath,
Workspace\Workspace_Editor.cs (1)
597var newTextAndVersion = TextAndVersion.Create(newText, version, oldDocument.FilePath);
Microsoft.CodeAnalysis.Workspaces.MSBuild (9)
MSBuild\MSBuildWorkspace.cs (9)
400if (document.FilePath is null) 407this.SaveDocumentText(documentId, document.FilePath, text, encoding ?? new UTF8Encoding(encoderShouldEmitUTF8Identifier: false)); 418if (document.FilePath is null) 425this.SaveDocumentText(documentId, document.FilePath, text, encoding ?? new UTF8Encoding(encoderShouldEmitUTF8Identifier: false)); 439if (document.FilePath is null) 444using var stream = new FileStream(document.FilePath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); 523if (document?.FilePath is not null) 525_applyChangesProjectFile.RemoveDocumentAsync(document.FilePath, CancellationToken.None).Wait(); 526this.DeleteDocumentFile(document.Id, document.FilePath);
Microsoft.DotNet.HotReload.Utils.Generator (1)
DocResolver.cs (1)
30var key = doc.FilePath;
Microsoft.DotNet.HotReload.Watch (1)
HotReload\CompilationHandler.cs (1)
1065Logger.LogDebug(" {Kind}: {FilePath} [{Checksum}]", kind, document.FilePath, Convert.ToBase64String(text.GetChecksum().ToArray()));
Roslyn.Diagnostics.Analyzers (4)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (1)
106document.FilePath is string filePath &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ProjectExtensions.cs (3)
58var analyzerConfigDirectory = PathUtilities.GetDirectoryName(analyzerConfigDocument.FilePath)!; 69return bestAnalyzerConfigDocument.FilePath; 91return project.AnalyzerConfigDocuments.FirstOrDefault(d => d.FilePath == analyzerConfigPath);