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