449 references to FilePath
AnalyzerRunner (3)
DiagnosticAnalyzerRunner.cs (3)
116if (!_options.TestDocumentMatch(document.FilePath)) 122Console.WriteLine($"{document.FilePath ?? document.Name}: {currentDocumentPerformance.EditsPerSecond:0.00} ({currentDocumentPerformance.AllocatedBytesPerEdit} bytes)"); 142Console.WriteLine($" {document.FilePath ?? document.Name}: {pair.Value.EditsPerSecond:0.00} ({pair.Value.AllocatedBytesPerEdit} bytes)");
GenerateDocumentationAndConfigFiles (3)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ProjectExtensions.cs (3)
73var analyzerConfigDirectory = PathUtilities.GetDirectoryName(analyzerConfigDocument.FilePath)!; 84return bestAnalyzerConfigDocument.FilePath; 106return project.AnalyzerConfigDocuments.FirstOrDefault(d => d.FilePath == analyzerConfigPath);
Microsoft.CodeAnalysis.Analyzers (4)
MetaAnalyzers\Fixers\DefineDiagnosticDescriptorArgumentsCorrectlyFix.cs (1)
149additionalDocuments.FirstOrDefault(a => string.Equals(a.FilePath, path, StringComparison.Ordinal)) is { } additionalDocument)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ProjectExtensions.cs (3)
73var analyzerConfigDirectory = PathUtilities.GetDirectoryName(analyzerConfigDocument.FilePath)!; 84return bestAnalyzerConfigDocument.FilePath; 106return project.AnalyzerConfigDocuments.FirstOrDefault(d => d.FilePath == analyzerConfigPath);
Microsoft.CodeAnalysis.BannedApiAnalyzers (3)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ProjectExtensions.cs (3)
73var analyzerConfigDirectory = PathUtilities.GetDirectoryName(analyzerConfigDocument.FilePath)!; 84return bestAnalyzerConfigDocument.FilePath; 106return project.AnalyzerConfigDocuments.FirstOrDefault(d => d.FilePath == analyzerConfigPath);
Microsoft.CodeAnalysis.CodeStyle.Fixes (4)
src\Analyzers\Core\CodeFixes\FileHeaders\AbstractFileHeaderCodeFixProvider.cs (1)
77var expectedFileHeader = fileHeaderTemplate.Replace("{fileName}", Path.GetFileName(document.FilePath));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ProjectExtensions.cs (3)
73var analyzerConfigDirectory = PathUtilities.GetDirectoryName(analyzerConfigDocument.FilePath)!; 84return bestAnalyzerConfigDocument.FilePath; 106return project.AnalyzerConfigDocuments.FirstOrDefault(d => d.FilePath == analyzerConfigPath);
Microsoft.CodeAnalysis.CSharp.EditorFeatures (5)
InlineRename\CSharpEditorInlineRenameService.cs (5)
63var filePath = renameDefinition.Document.FilePath; 72if (renameDefinition.Document.FilePath is not null) 74AddSpanOfInterest(documentText, renameDefinition.Document.FilePath, renameDefinition.SourceSpan, containingStatementOrDeclarationSpan, definitions); 87if (renameLocation.Document.FilePath is not null) 89AddSpanOfInterest(documentText, renameLocation.Document.FilePath, renameLocation.TextSpan, containingStatementOrDeclarationSpan, references);
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (21)
CodeActions\ApplyChangesOperationTests.cs (10)
78var document1 = solution.Projects.Single().Documents.Single(d => d.FilePath!.Contains("Program1")); 83var document2 = solution.Projects.Single().Documents.Single(d => d.FilePath!.Contains("Program2")); 108var document1 = solution.Projects.Single().Documents.Single(d => d.FilePath!.Contains("Program1")); 113var document2 = solution.Projects.Single().Documents.Single(d => d.FilePath!.Contains("Program2")); 138var document1 = solution.Projects.Single().Documents.Single(d => d.FilePath!.Contains("Program1")); 143var document1 = solution.Projects.Single().Documents.Single(d => d.FilePath!.Contains("Program1")); 168var document1 = solution.Projects.Single().Documents.Single(d => d.FilePath!.Contains("Program1")); 173var document1 = solution.Projects.Single().Documents.Single(d => d.FilePath!.Contains("Program1")); 198var document1 = solution.Projects.Single().Documents.Single(d => d.FilePath!.Contains("Program1")); 203var document2 = solution.Projects.Single().Documents.Single(d => d.FilePath!.Contains("Program2"));
EditAndContinue\ActiveStatementTrackingServiceTests.cs (4)
86], spans1[document1.FilePath].Select(s => $"{s.Span}: {s.Flags}")); 88var spans2 = await trackingSession.GetSpansAsync(solution, document1.Id, document1.FilePath, CancellationToken.None); 91var spans3 = await trackingSession.GetSpansAsync(solution, document2.Id, document2.FilePath, CancellationToken.None); 113], spans5[document1.FilePath].Select(s => $"{s.Span}: {s.Flags}"));
EditorConfigSettings\Updater\SettingsUpdaterTests.cs (3)
68var result = SettingsUpdateHelper.TryUpdateAnalyzerConfigDocument(sourcetext, analyzerConfigDocument.FilePath!, options); 77var result = SettingsUpdateHelper.TryUpdateAnalyzerConfigDocument(sourcetext, analyzerConfigDocument.FilePath!, options); 348var editorconfig = solution.Projects.SelectMany(p => p.AnalyzerConfigDocuments.Where(a => a.FilePath == EditorconfigPath)).Single();
NavigateTo\NavigateToSearcherTests.cs (4)
409var firstDocument = project.Documents.Single(d => d.FilePath!.Contains("file1")); 410var secondDocument = project.Documents.Single(d => d.FilePath!.Contains("file2")); 469var firstDocument = project.Documents.Single(d => d.FilePath!.Contains("file1")); 470var secondDocument = project.Documents.Single(d => d.FilePath!.Contains("file2"));
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (2)
EditAndContinue\CSharpEditAndContinueAnalyzerTests.cs (2)
315KeyValuePair.Create(newDocument.FilePath, ImmutableArray.Create( 319new SourceFileSpan(newDocument.FilePath, oldStatementSpan),
Microsoft.CodeAnalysis.EditorFeatures (12)
EditAndContinue\ActiveStatementTrackingService.cs (5)
149if (e.Document.FilePath != null) 153_trackingSpans.Remove(e.Document.FilePath); 349if (document.FilePath == null) 367var hasExistingSpans = _trackingSpans.TryGetValue(document.FilePath, out var oldSpans); 376return _trackingSpans[document.FilePath] = hasExistingSpans
EditAndContinue\PdbMatchingSourceTextProvider.cs (3)
81Contract.ThrowIfNull(oldDocument.FilePath); 92if (_isActive && oldSolutionVersion >= _baselineSolutionVersion && !_documentsWithChangedLoaderByPath.ContainsKey(oldDocument.FilePath)) 94_documentsWithChangedLoaderByPath.Add(oldDocument.FilePath, (oldDocument.DocumentState, oldSolutionVersion));
EditorConfigSettings\Updater\SettingsUpdaterBase.cs (1)
77.FirstOrDefault(d => d.FilePath == EditorconfigPath);
InlineRename\UI\Adornment\RenameFlyoutViewModel.cs (2)
405var fileCount = renameLocations.GroupBy(s => s.Document.FilePath).Count(); 406var referenceCount = renameLocations.Select(loc => (loc.Document.FilePath, loc.TextSpan)).Distinct().Count();
Structure\AbstractStructureTaggerProvider.cs (1)
75masWorkspace.FileService.ShouldCollapseOnOpen(openDocument.FilePath, options))
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (1)
Workspaces\NoCompilationDocumentDiagnosticAnalyzer.cs (1)
26Diagnostic.Create(Descriptor, Location.Create(document.FilePath, default, default))));
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (17)
Diagnostics\DiagnosticAnalyzerServiceTests.cs (1)
403d => d.Id == analyzer.Descriptor.Id && d.DataLocation.UnmappedFileSpan.Path == additionalDoc.FilePath);
Diagnostics\DiagnosticDataTests.cs (4)
167location: new DiagnosticDataLocation(new FileLinePositionSpan(document.FilePath, span: default), document.Id), 202location: new DiagnosticDataLocation(new FileLinePositionSpan(document.FilePath, span: default), document.Id), 239new(document.FilePath, new(3, 10), new(3, 11)), documentId); 300location: new DiagnosticDataLocation(new FileLinePositionSpan(firstDocument.FilePath, span: default), firstDocument.Id),
EditAndContinue\EditAndContinueLanguageServiceTests.cs (8)
224$"Error ENC1001: {document.FilePath}(0, 1, 0, 2): {string.Format(FeaturesResources.ErrorReadingFile, "doc", "error 1")}", 228$"Error CS0005: {document.FilePath}(0, 1, 0, 2): Emit Error", 229$"Warning CS0004: {document.FilePath}(0, 1, 0, 2): Emit Warning", 236$"RestartRequired ENC1001: {document.FilePath}(0, 1, 0, 2): {string.Format(FeaturesResources.ErrorReadingFile, "doc", "error 1")}", 239$"RestartRequired ENC0033: {document.FilePath}(0, 2, 0, 3): {string.Format(FeaturesResources.Deleting_0_requires_restarting_the_application, "x")}", 241$"Error CS0005: {document.FilePath}(0, 1, 0, 2): Emit Error", 242$"Warning CS0004: {document.FilePath}(0, 1, 0, 2): Emit Warning", 245$"Error CS0001: {document.FilePath}(0, 1, 0, 2): Syntax error",
InheritanceMargin\InheritanceMarginTests.cs (2)
171Assert.Equal(expectedDocumentSpans[i].Document.FilePath, docSpan.Value.Document.FilePath);
StackTraceExplorer\StackTraceExplorerTests.cs (2)
960Assert.Equal(@"C:/path/to/Component.razor", document.FilePath); 999Assert.Equal(@"C:/path/to/Component.razor", document.FilePath);
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (4)
CodeDefinitionWindow\CrossLanguageCodeDefinitionWindowTests.vb (1)
116document.FilePath,
FindReferences\FindReferencesTests.vb (1)
478Return $"{document.Project.Name}: {document.FilePath}"
GoToDefinition\GoToDefinitionTestsBase.vb (1)
118actualLocations.Add(New FilePathAndSpan(docSpan.Document.FilePath, docSpan.SourceSpan))
GoToHelpers\GoToHelpers.vb (1)
37actualDefinitions.Add(New FilePathAndSpan(sourceSpan.Document.FilePath, sourceSpan.SourceSpan))
Microsoft.CodeAnalysis.ExternalAccess.FSharp (3)
Internal\Editor\FSharpSmartIndentProvider.cs (2)
77if (document?.FilePath == null) 92result = _provider._service.GetDesiredIndentation(document.Project.LanguageServices, text, document.Id, document.FilePath, line.LineNumber, fsharpOptions);
TaskList\FSharpTaskListService.cs (1)
46var span = new FileLinePositionSpan(document.FilePath!, text.Lines.GetLinePositionSpan(d.Span));
Microsoft.CodeAnalysis.ExternalAccess.Xaml (3)
Internal\LocationService.cs (2)
35if (document.FilePath is null) 42return new FileLinePositionSpan(document.FilePath, linePosSpan);
Internal\XamlDiagnosticSource.cs (1)
23string IDiagnosticSource.ToDisplayString() => $"{this.GetType().Name}: {document.FilePath ?? document.Name} in {document.Project.Name}";
Microsoft.CodeAnalysis.Features (61)
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)
160document.FilePath, 256return !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)
245updatedDocument = 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 (6)
246Contract.ThrowIfNull(document.FilePath); 307filePath: document.FilePath, 342Contract.ThrowIfNull(document.FilePath); 347? await TryGetMatchingSourceTextAsync(_debuggingSession.SessionLog, sourceText, document.FilePath, currentDocument, _debuggingSession.SourceTextProvider, requiredChecksum, checksumAlgorithm, cancellationToken).ConfigureAwait(false) 515Contract.ThrowIfNull(document.FilePath); 528return TryReadSourceFileChecksumFromPdb(_debuggingSession.SessionLog, debugInfoReader, document.FilePath, out requiredChecksum, out checksumAlgorithm);
EditAndContinue\DebuggingSession.cs (5)
753Contract.ThrowIfNull(document.FilePath); 758documentIndicesByMappedPath.MultiAdd(document.FilePath, (documentId.ProjectId, i)); 883Contract.ThrowIfNull(mappedDocument.FilePath); 896if (!baseActiveStatements.DocumentPathMap.TryGetValue(mappedDocument.FilePath, out var oldMappedDocumentActiveStatements)) 902var 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 (3)
568diagnostics.Add(Diagnostic.Create(descriptor, Location.Create(newDocument.FilePath!, textSpan: default, lineSpan: default), [newDocument.FilePath])); 863var path = changedDocument.FilePath;
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\MetadataAsSourceFileService.cs (1)
250Contract.ThrowIfNull(document.FilePath);
Navigation\INavigableItem.cs (1)
57document.FilePath,
PdbSourceDocument\PdbSourceDocumentMetadataAsSourceFileProvider.cs (6)
288var firstDocument = navigateProject.Documents.First(d => d.FilePath?.Equals(firstDocumentFilePath, StringComparison.OrdinalIgnoreCase) ?? false); 295var sourceDescription = sourceFileInfos.FirstOrDefault(sfi => sfi!.FilePath?.Equals(navigateDocument.FilePath, StringComparison.OrdinalIgnoreCase) ?? false)?.SourceDescription ?? FeaturesResources.from_metadata; 301var documentTooltip = navigateDocument.FilePath + Environment.NewLine + dllPath; 303return new MetadataAsSourceFile(navigateDocument.FilePath!, navigateLocation, documentName, documentTooltip); 432if (document.FilePath is not null && 433_fileToDocumentInfoMap.TryGetValue(document.FilePath, out var info))
Shared\Utilities\ExtractTypeHelpers.cs (1)
61var newDocumentPath = PathUtilities.CombinePaths(PathUtilities.GetDirectoryName(hintDocument.FilePath), fileName);
src\Analyzers\Core\CodeFixes\FileHeaders\AbstractFileHeaderCodeFixProvider.cs (1)
77var expectedFileHeader = fileHeaderTemplate.Replace("{fileName}", Path.GetFileName(document.FilePath));
SyncNamespaces\AbstractSyncNamespacesService.cs (1)
172.Where(diagnostic => diagnostic.Location.SourceTree?.FilePath == document.FilePath)
Workspace\CompileTimeSolutionProvider.cs (3)
192var generatedDocumentPaths = BuildGeneratedDocumentPaths(designTimeProjectDirectoryName, designTimeDocument.FilePath!, generatedDocumentPathPrefix); 195return sourceGeneratedDocuments.SingleOrDefault(d => d.FilePath != null && generatedDocumentPaths.Contains(d.FilePath));
Microsoft.CodeAnalysis.Features.Test.Utilities (1)
EditAndContinue\EditAndContinueWorkspaceTestBase.cs (1)
324project.Documents.Select(d => (d.GetTextSynchronously(CancellationToken.None), d.FilePath ?? throw ExceptionUtilities.UnexpectedValue(null))),
Microsoft.CodeAnalysis.Features.UnitTests (91)
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (39)
190$"{document1.Project.FilePath}: (0,0)-(0,0): Warning ENC1008: {string.Format(FeaturesResources.Changing_source_file_0_in_a_stale_project_has_no_effect_until_the_project_is_rebuit, document1.FilePath)}" 602[$"proj: {document2.FilePath}: (0,0)-(0,0): Error ENC1006: {string.Format(FeaturesResources.UnableToReadSourceFileOrPdb, sourceFile.Path)}"], 650[$"test: {document1.FilePath}: (0,0)-(0,0): Error ENC1006: {string.Format(FeaturesResources.UnableToReadSourceFileOrPdb, sourceFile.Path)}"], 960[$"proj: {document2.FilePath}: (5,0)-(5,32): Error ENC2016: {string.Format(FeaturesResources.EditAndContinueDisallowedByProject, document2.Project.Name, "*message*")}"], 1051[$"{document2.FilePath}: (0,18)-(0,19): Error ENC0110: {string.Format(FeaturesResources.Changing_the_signature_of_0_requires_restarting_the_application_because_it_is_not_supported_by_the_runtime, FeaturesResources.method)}"], 1111document.FilePath, 1194[$"{generatedDocument.FilePath}: (0,17)-(0,18): Error ENC0110: {string.Format(FeaturesResources.Changing_the_signature_of_0_requires_restarting_the_application_because_it_is_not_supported_by_the_runtime, FeaturesResources.method)}"], 1272[$"{document2.FilePath}: (0,11)-(0,22): Error ENC0110: {string.Format(FeaturesResources.Changing_the_signature_of_0_requires_restarting_the_application_because_it_is_not_supported_by_the_runtime, FeaturesResources.method)}"], 1343[$"{document1.FilePath}: (0,45)-(0,69): Error ENC0023: {string.Format(FeaturesResources.Adding_an_abstract_0_or_overriding_an_inherited_0_requires_restarting_the_application, FeaturesResources.method)}"], 1386[$"{document2.FilePath}: (0,24)-(0,25): Error ENC0110: {string.Format(FeaturesResources.Changing_the_signature_of_0_requires_restarting_the_application_because_it_is_not_supported_by_the_runtime, FeaturesResources.method)}"], 1400[$"{document2.FilePath}: (0,24)-(0,25): Error ENC0110: {string.Format(FeaturesResources.Changing_the_signature_of_0_requires_restarting_the_application_because_it_is_not_supported_by_the_runtime, FeaturesResources.method)}"], 1424var sourceFilePath = document.FilePath; 1461[$"{document.FilePath}: (0,31)-(0,55): Error ENC0023: {string.Format(FeaturesResources.Adding_an_abstract_0_or_overriding_an_inherited_0_requires_restarting_the_application, FeaturesResources.method)}"], 1603AssertEx.Equal([$"{document2.FilePath}: (0,30)-(0,32): Error CS0266: {string.Format(CSharpResources.ERR_NoImplicitConvCast, "long", "int")}"], InspectDiagnostics(emitDiagnostics)); 1765Assert.False(await EditSession.HasChangesAsync(oldSolution, solution, generatedDocument.FilePath, CancellationToken.None)); 2253AssertEx.Equal([$"{document2.FilePath}: (0,0)-(0,54): Error CS8055: {string.Format(CSharpResources.ERR_EncodinglessSyntaxTree)}"], InspectDiagnostics(emitDiagnostics)); 2270AssertEx.Equal([$"{document2.FilePath}: (0,0)-(0,54): Error CS8055: {string.Format(CSharpResources.ERR_EncodinglessSyntaxTree)}"], InspectDiagnostics(emitDiagnostics)); 2925[$"{documentB.FilePath}: (4,4)-(4,12): Error ENC0023: {string.Format(FeaturesResources.Adding_an_abstract_0_or_overriding_an_inherited_0_requires_restarting_the_application, FeaturesResources.method)}"], 3016[$"{documentB.FilePath}: (2,4)-(2,14): Warning ENC0118: {string.Format(FeaturesResources.Changing_0_might_not_have_any_effect_until_the_application_is_restarted, FeaturesResources.static_constructor)}"], 3876var documentPath = document1.FilePath; 3956var documentFilePath = document1.FilePath; 4090solution = p.Solution.AddDocument(linkedDocId, doc.Name, text, filePath: doc.FilePath); 4110$"2: {doc1.FilePath}: (2,32)-(2,52) flags=[MethodUpToDate, NonLeafFrame]", 4111$"1: {doc1.FilePath}: (3,29)-(3,49) flags=[MethodUpToDate, NonLeafFrame]" 4112], documentMap[doc1.FilePath].Select(InspectActiveStatement)); 4116$"0: {doc2.FilePath}: (0,39)-(0,59) flags=[LeafFrame, MethodUpToDate]", 4117], documentMap[doc2.FilePath].Select(InspectActiveStatement)); 4215$"0: {document.FilePath}: (9,18)-(9,22) flags=[LeafFrame, MethodUpToDate]", 4216], baseActiveStatementMap.DocumentPathMap[document.FilePath].Select(InspectActiveStatement)); 4222Assert.Equal(document.FilePath, activeStatement1.FilePath); 4293filePaths: [generatedDocument1.FilePath], 4393[$"{document.FilePath}: (9,8)-(9,13): Error ENC0063: {string.Format(FeaturesResources.Updating_a_0_around_an_active_statement_requires_restarting_the_application, CSharpFeaturesResources.catch_clause)}"], 4489$"0x06000002 v1 | AS {document.FilePath}: (4,41)-(4,42) => (4,41)-(4,42)", 4490$"0x06000003 v1 | AS {document.FilePath}: (9,14)-(9,18) => (10,14)-(10,18)", 4510$"0x06000002 v1 | AS {document.FilePath}: (4,41)-(4,42) => (4,41)-(4,42)", 4511$"0x06000003 v1 | AS {document.FilePath}: (9,14)-(9,18) => (10,14)-(10,18)", 4546$"0x06000002 v1 | AS {document.FilePath}: (4,41)-(4,42) => (4,41)-(4,42)", 4664$"0x06000002 v1 | AS {document.FilePath}: (3,41)-(3,42) => (3,41)-(3,42)", 4665$"0x06000003 v1 | AS {document.FilePath}: (7,14)-(7,18) => (9,14)-(9,18)",
EditAndContinue\EditSessionActiveStatementsTests.cs (52)
196$"0: {document1.FilePath}: (9,14)-(9,35) flags=[LeafFrame, MethodUpToDate] mvid=11111111-1111-1111-1111-111111111111 0x06000001 v1 IL_0001", 197$"1: {document1.FilePath}: (4,32)-(4,37) flags=[MethodUpToDate, NonLeafFrame] mvid=11111111-1111-1111-1111-111111111111 0x06000002 v1 IL_0001", 198$"2: {document2.FilePath}: (21,14)-(21,24) flags=[MethodUpToDate, NonLeafFrame] mvid=22222222-2222-2222-2222-222222222222 0x06000003 v1 IL_0001", // [|Test1.M1()|] in F2 199$"3: {document2.FilePath}: (8,20)-(8,25) flags=[MethodUpToDate, NonLeafFrame] mvid=22222222-2222-2222-2222-222222222222 0x06000004 v1 IL_0002", // [|F2();|] in M2 200$"4: {document2.FilePath}: (26,20)-(26,25) flags=[MethodUpToDate, NonLeafFrame] mvid=22222222-2222-2222-2222-222222222222 0x06000005 v1 IL_0003", // [|M2();|] in Main 211$"1: {document1.FilePath}: (4,32)-(4,37) flags=[MethodUpToDate, NonLeafFrame]", 212$"0: {document1.FilePath}: (9,14)-(9,35) flags=[LeafFrame, MethodUpToDate]" 213], baseActiveStatementsMap.DocumentPathMap[document1.FilePath].Select(InspectActiveStatement)); 217$"3: {document2.FilePath}: (8,20)-(8,25) flags=[MethodUpToDate, NonLeafFrame]", // [|F2();|] in M2 218$"2: {document2.FilePath}: (21,14)-(21,24) flags=[MethodUpToDate, NonLeafFrame]", // [|Test1.M1()|] in F2 219$"4: {document2.FilePath}: (26,20)-(26,25) flags=[MethodUpToDate, NonLeafFrame]" // [|M2();|] in Main 220], baseActiveStatementsMap.DocumentPathMap[document2.FilePath].Select(InspectActiveStatement)); 239$"[{document1.FilePath}: (4,8)-(4,46)]", 246$"[{document2.FilePath}: (14,8)-(16,9), {document2.FilePath}: (10,10)-(12,11)]", 248$"[{document2.FilePath}: (26,35)-(26,46)]", 285$"0x06000004 v1 | AS {document2.FilePath}: (8,20)-(8,25) => (9,20)-(9,25)", 286$"0x06000004 v1 | ER {document2.FilePath}: (14,8)-(16,9) => (15,8)-(17,9)", 287$"0x06000004 v1 | ER {document2.FilePath}: (10,10)-(12,11) => (11,10)-(13,11)", 288$"0x06000003 v1 | AS {document2.FilePath}: (21,14)-(21,24) => (21,14)-(21,24)", 289$"0x06000005 v1 | AS {document2.FilePath}: (26,20)-(26,25) => (26,20)-(26,25)" 361$"0: {document.FilePath}: (6,18)-(6,23) flags=[MethodUpToDate, NonLeafFrame] mvid=11111111-1111-1111-1111-111111111111 0x06000001 v1 IL_0000 '<AS:0>F2();</AS:0>'", 362$"1: {document.FilePath}: (18,14)-(18,36) flags=[LeafFrame, MethodUpToDate] mvid=11111111-1111-1111-1111-111111111111 0x06000002 v1 IL_0000 '<AS:1>throw new Exception();</AS:1>'" 373$"[{document.FilePath}: (8,8)-(12,9) 'catch (Exception) {{']", 398$"0x06000001 v1 | AS {document.FilePath}: (6,18)-(6,23) => (6,18)-(6,23)", 399$"0x06000001 v1 | ER {document.FilePath}: (8,8)-(12,9) => (8,8)-(12,9)", 400$"0x06000002 v1 | AS {document.FilePath}: (18,14)-(18,36) => (18,14)-(18,36)", 542$"0: {document.FilePath}: (6,18)-(6,22) flags=[MethodUpToDate, NonLeafFrame] mvid=11111111-1111-1111-1111-111111111111 0x06000001 v2 IL_0000 '<AS:0>M();</AS:0>'", 543$"1: {document.FilePath}: (20,18)-(20,22) flags=[MethodUpToDate, NonLeafFrame] mvid=11111111-1111-1111-1111-111111111111 0x06000002 v2 IL_0000 '<AS:1>M();</AS:1>'", 544$"2: {document.FilePath}: (29,22)-(29,26) flags=[NonLeafFrame] mvid=11111111-1111-1111-1111-111111111111 0x06000003 v1 IL_0000 '{{ <AS:2>M();</AS:2>'", 545$"3: {document.FilePath}: (53,22)-(53,26) flags=[NonLeafFrame] mvid=11111111-1111-1111-1111-111111111111 0x06000004 v1 IL_0000 '<AS:3>M();</AS:3>'" 556$"[{document.FilePath}: (8,16)-(10,9) '<ER:0.0>catch']", 557$"[{document.FilePath}: (18,16)-(21,9) '<ER:1.0>catch']", 558$"[{document.FilePath}: (38,16)-(40,9) '<ER:2.1>catch', {document.FilePath}: (34,20)-(36,13) '<ER:2.0>finally']", 559$"[{document.FilePath}: (56,16)-(58,9) '<ER:3.1>catch', {document.FilePath}: (51,20)-(54,13) '<ER:3.0>catch']", 598$"0x06000001 v2 | AS {document.FilePath}: (6,18)-(6,22) => (6,18)-(6,22)", 599$"0x06000002 v2 | ER {document.FilePath}: (18,16)-(21,9) => (17,16)-(20,9)", 600$"0x06000002 v2 | AS {document.FilePath}: (20,18)-(20,22) => (19,18)-(19,22)", 601$"0x06000003 v1 | AS {document.FilePath}: (30,22)-(30,26) => (29,22)-(29,26)", // AS:2 moved -1 in first edit, 0 in second 602$"0x06000003 v1 | ER {document.FilePath}: (32,20)-(34,13) => (34,20)-(36,13)", // ER:2.0 moved +2 in first edit, 0 in second 603$"0x06000003 v1 | ER {document.FilePath}: (36,16)-(38,9) => (38,16)-(40,9)", // ER:2.0 moved +2 in first edit, 0 in second 604$"0x06000004 v1 | ER {document.FilePath}: (50,20)-(53,13) => (53,20)-(56,13)", // ER:3.0 moved +1 in first edit, +2 in second 605$"0x06000004 v1 | AS {document.FilePath}: (52,22)-(52,26) => (55,22)-(55,26)", // AS:3 moved +1 in first edit, +2 in second 606$"0x06000004 v1 | ER {document.FilePath}: (55,16)-(57,9) => (58,16)-(60,9)", // ER:3.1 moved +1 in first edit, +2 in second 682$"1: {document.FilePath}: (6,18)-(6,22) flags=[LeafFrame, MethodUpToDate, NonLeafFrame]", 683$"0: {document.FilePath}: (15,14)-(15,18) flags=[PartiallyExecuted, NonUserCode, MethodUpToDate, NonLeafFrame]", 684], baseActiveStatementMap.DocumentPathMap[document.FilePath].Select(InspectActiveStatement)); 691Assert.Equal(document.FilePath, s.FilePath); 696Assert.Equal(document.FilePath, s.FilePath); 707$"[{document.FilePath}: (8,8)-(10,9)]",
Microsoft.CodeAnalysis.LanguageServer (3)
FileBasedPrograms\FileBasedProgramsProjectSystem.cs (2)
86Contract.ThrowIfNull(primordialDoc.FilePath); 91await BeginLoadingProjectWithPrimordialAsync(primordialDoc.FilePath, _workspaceFactory.MiscellaneousFilesWorkspaceProjectFactory, primordialProjectId: primordialDoc.Project.Id, doDesignTimeBuild);
HostWorkspace\LanguageServerWorkspace.cs (1)
108if (textDocument is { FilePath: { } filePath })
Microsoft.CodeAnalysis.LanguageServer.Protocol (24)
Extensions\Extensions.cs (4)
28Contract.ThrowIfNull(document.FilePath); 31: ProtocolConversions.CreateAbsoluteDocumentUri(document.FilePath); 40Contract.ThrowIfNull(document.FilePath); 43var directoryName = Path.GetDirectoryName(document.FilePath);
Extensions\ProtocolConversions.cs (1)
473Debug.Assert(document.FilePath != null);
Features\EditAndContinue\EditAndContinueDiagnosticSource_OpenDocument.cs (2)
70Debug.Assert(designTimeDocument.FilePath != null); 75var location = new DiagnosticDataLocation(new FileLinePositionSpan(designTimeDocument.FilePath, span));
Handler\CodeActions\CodeActionResolveHelper.cs (1)
241if (newTextDoc.FilePath != null)
Handler\Diagnostics\DiagnosticSourceProviders\WorkspaceDiagnosticSourceHelpers.cs (3)
64(document.FilePath?.EndsWith("__virtual.js") == true || document.FilePath?.EndsWith(".razor") == true || document.FilePath?.EndsWith(".cshtml") == true))
Handler\Diagnostics\DiagnosticSources\AbstractDocumentDiagnosticSource.cs (2)
28=> !string.IsNullOrEmpty(Document.FilePath) 32public string ToDisplayString() => $"{this.GetType().Name}: {Document.FilePath ?? Document.Name} in {Document.Project.Name}";
Handler\References\FindUsagesLSPContext.cs (1)
153if (!_referenceLocations.Add((document.FilePath, reference.SourceSpan.SourceSpan)))
Handler\RelatedDocuments\RelatedDocumentsHandler.cs (3)
49context.TraceDebug($"Processing: {document.FilePath}"); 54context.TraceDebug($"Ignoring document '{document.FilePath}' because it does not support related documents"); 77FilePaths = [.. relatedDocumentIds.Select(id => solution.GetRequiredDocument(id).FilePath).WhereNotNull()],
Handler\Rename\RenameHandler.cs (1)
80.GroupBy(docId => renamedSolution.GetRequiredDocument(docId).FilePath, StringComparer.OrdinalIgnoreCase).Select(group => group.First())
Handler\SemanticTokens\SemanticTokensRefreshQueue.cs (1)
82if (DisallowsAdditionalDocumentChangedRefreshes(document.FilePath))
Handler\SpellCheck\AbstractSpellCheckingHandler.cs (4)
91context.TraceDebug($"Processing: {document.FilePath}"); 96context.TraceDebug($"Ignoring document '{document.FilePath}' because it does not support spell checking"); 110context.TraceDebug($"Spans were changed for document: {document.FilePath}"); 119context.TraceDebug($"Spans were unchanged for document: {document.FilePath}");
Workspaces\LspWorkspaceManager.cs (1)
261_logger.LogDebug($"{document.FilePath} found in workspace {workspaceKind}");
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (21)
CodeActions\CodeActionResolveTests.cs (2)
432Assert.Contains(Path.Combine("dir1", "dir2", "dir3"), existingDocument.FilePath); 434Path.Combine(Path.GetDirectoryName(existingDocument.FilePath)!, "BCD.cs"));
Diagnostics\AbstractPullDiagnosticTestsBase.cs (1)
382Diagnostic.Create(Descriptor, Location.Create(document.FilePath!, default, default))));
Diagnostics\DiagnosticsPullCacheTests.cs (1)
126new DiagnosticDataLocation(new FileLinePositionSpan(context.Document!.FilePath!, new Text.LinePosition(0, 0), new Text.LinePosition(0, 0))))]);
Diagnostics\PullDiagnosticTests.cs (1)
956var loweredUri = ProtocolConversions.CreateAbsoluteDocumentUri(document.FilePath!.ToLowerInvariant());
Miscellaneous\LspMiscellaneousFilesWorkspaceTests.cs (1)
177Assert.Contains(documentPath, testLspServer.GetCurrentSolution().Projects.Single().Documents.Select(d => d.FilePath));
RelatedDocuments\RelatedDocumentsTests.cs (3)
98Assert.Equal(project.Documents.Last().FilePath, results[0].FilePaths!.Single()); 133AssertEx.SetEqual([.. project.Documents.Skip(1).Select(d => d.FilePath)], results.SelectMany(r => r.FilePaths!)); 164FilePaths = [project.Documents.Last().FilePath!],
UriTests.cs (5)
57Assert.Equal(filePath, document.FilePath); 83Assert.Equal(looseFileUri.UriString, document.FilePath); 115Assert.Equal(documentFilePath, document.FilePath); 126Assert.Equal(documentFilePath, document.FilePath); 307Assert.Equal(looseFileUri.UriString, document.FilePath);
Workspaces\LspWorkspaceManagerTests.cs (7)
61var firstDocumentUri = testLspServer.GetCurrentSolution().Projects.First().Documents.Single(d => d.FilePath!.Contains("test1")).GetURI(); 62var secondDocumentUri = testLspServer.GetCurrentSolution().Projects.First().Documents.Single(d => d.FilePath!.Contains("test2")).GetURI(); 113var firstDocumentUri = testLspServer.GetCurrentSolution().Projects.First().Documents.Single(d => d.FilePath!.Contains("test1")).GetURI(); 115var secondDocument = testLspServer.GetCurrentSolution().Projects.First().Documents.Single(d => d.FilePath!.Contains("test2")); 151var documentUri = testLspServer.GetCurrentSolution().Projects.First().Documents.Single(d => d.FilePath!.Contains("test1")).GetURI(); 175var documentUri = testLspServer.GetCurrentSolution().Projects.First().Documents.Single(d => d.FilePath!.Contains("test1")).GetURI(); 217var documentUri = testLspServer.GetCurrentSolution().Projects.First().Documents.Single(d => d.FilePath!.Contains("test1")).GetURI();
Microsoft.CodeAnalysis.LanguageServer.UnitTests (2)
WorkspaceProjectFactoryServiceTests.cs (2)
53Assert.Equal(sourceFilePath, document.FilePath); 57Assert.Equal(additionalFilePath, additionalDocument.FilePath);
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (3)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ProjectExtensions.cs (3)
73var analyzerConfigDirectory = PathUtilities.GetDirectoryName(analyzerConfigDocument.FilePath)!; 84return bestAnalyzerConfigDocument.FilePath; 106return project.AnalyzerConfigDocuments.FirstOrDefault(d => d.FilePath == analyzerConfigPath);
Microsoft.CodeAnalysis.PublicApiAnalyzers.CodeFixes (4)
DeclarePublicApiFix.cs (2)
76if (additional.FilePath == null) 82var file = new PublicApiFile(additional.FilePath, isPublic);
NullableEnablePublicApiFix.cs (2)
96shippedDocument.FilePath != null && !uniqueShippedDocuments.Add(shippedDocument.FilePath))
Microsoft.CodeAnalysis.Remote.ServiceHub (1)
Host\RemoteWorkspace.SolutionCreator.cs (1)
553var loader = serializableSourceText.ToTextLoader(document.FilePath);
Microsoft.CodeAnalysis.VisualBasic.Features.UnitTests (2)
EditAndContinue\VisualBasicEditAndContinueAnalyzerTests.vb (2)
483KeyValuePair.Create(newDocument.FilePath, ImmutableArray.Create( 487New SourceFileSpan(newDocument.FilePath, oldStatementSpan),
Microsoft.CodeAnalysis.Workspaces (23)
Classification\SemanticClassificationCacheUtilities.cs (1)
24var documentKey = new DocumentKey(projectKey, document.Id, document.FilePath, document.Name);
CodeFixes\CodeFix.cs (1)
70var document = Project.Documents.FirstOrDefault(d => d.FilePath == diagnostic.Location.GetLineSpan().Path);
Diagnostics\DiagnosticData.cs (1)
171originalLineInfo = new FileLinePositionSpan(document?.FilePath ?? "", span: default);
Diagnostics\DocumentAnalysisScope.cs (1)
58var filePath = TextDocument.FilePath ?? TextDocument.Name;
Diagnostics\Extensions.cs (2)
67if (textDocument.FilePath is null) 71return 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)
105if (File.Exists(document.FilePath)) 107var directory = Directory.GetParent(document.FilePath)?.FullName;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ProjectExtensions.cs (3)
73var analyzerConfigDirectory = PathUtilities.GetDirectoryName(analyzerConfigDocument.FilePath)!; 84return bestAnalyzerConfigDocument.FilePath; 106return 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)
1688/// <see cref="TextDocument.FilePath"/> that matches the given file path. This may return IDs for any type of document
Workspace\Workspace.cs (2)
2072=> CreateDocumentInfoWithoutText(doc).WithTextLoader(TextLoader.From(TextAndVersion.Create(doc.GetTextSynchronously(CancellationToken.None), VersionStamp.Create(), doc.FilePath))); 2081filePath: doc.FilePath,
Workspace\Workspace_Editor.cs (1)
597var newTextAndVersion = TextAndVersion.Create(newText, version, oldDocument.FilePath);
Microsoft.CodeAnalysis.Workspaces.MSBuild (9)
MSBuild\MSBuildWorkspace.cs (9)
393if (document.FilePath is null) 400this.SaveDocumentText(documentId, document.FilePath, text, encoding ?? new UTF8Encoding(encoderShouldEmitUTF8Identifier: false)); 411if (document.FilePath is null) 418this.SaveDocumentText(documentId, document.FilePath, text, encoding ?? new UTF8Encoding(encoderShouldEmitUTF8Identifier: false)); 432if (document.FilePath is null) 437using var stream = new FileStream(document.FilePath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); 516if (document?.FilePath is not null) 518_applyChangesProjectFile.RemoveDocumentAsync(document.FilePath, CancellationToken.None).Wait(); 519this.DeleteDocumentFile(document.Id, document.FilePath);
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (12)
VisualStudioMSBuildWorkspaceTests.cs (12)
963var doc = solution.Projects.First().Documents.First(d => d.FilePath == sourceFile); 997var doc = solution.Projects.First().Documents.First(d => d.FilePath == sourceFile); 1983Assert.Contains("OtherStuff", fooDoc.FilePath); 1984Assert.True(File.Exists(fooDoc.FilePath)); 1985var text = File.ReadAllText(fooDoc.FilePath); 2013var textOnDisk = File.ReadAllText(document2.FilePath); 2055var textOnDisk = File.ReadAllText(document2.FilePath); 2084Assert.False(File.Exists(document.FilePath)); 2114var textOnDisk = File.ReadAllText(document.FilePath); 2141var textOnDisk = File.ReadAllText(document.FilePath); 2167var textOnDisk = File.ReadAllText(document2.FilePath); 3232var analyzerConfigDocument = Assert.Single(project.AnalyzerConfigDocuments, d => d.FilePath == expectedEditorConfigPath);
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
Workspaces\TestHostDocument.cs (1)
45_id = sourceGeneratedDocuments.Single(d => d.FilePath == this.FilePath).Id;
Microsoft.CodeAnalysis.Workspaces.UnitTests (29)
CommandLineProject\CommandLineProjectWorkspaceTests.cs (3)
40Assert.Equal(tempFile.Path, gooDoc.FilePath); 68Assert.Equal(@"C:\ProjectDirectory\goo.cs", gooDoc.FilePath); 73Assert.Equal(@"C:\ProjectDirectory\subdir\bar.cs", barDoc.FilePath);
SolutionTests\SolutionTests.cs (17)
228Assert.Equal(path, newSolution1.GetRequiredDocument(documentId).FilePath); 235Assert.Equal("", newSolution3.GetRequiredDocument(documentId).FilePath); 239Assert.Null(newSolution4.GetRequiredDocument(documentId).FilePath); 1232Assert.Equal(newDocumentInfo1.FilePath, newDocument1.FilePath); 1241Assert.Equal(newDocumentInfo3.FilePath, newDocument3.FilePath); 1253Assert.Equal(newAddDocumentInfo1.FilePath, newAddDocument1.FilePath); 1262Assert.Equal(newAddDocumentInfo3.FilePath, newAddDocument3.FilePath); 1274Assert.Equal(newConfigDocumentInfo1.FilePath, newConfigDocument1.FilePath); 1283Assert.Equal(newConfigDocumentInfo3.FilePath, newConfigDocument3.FilePath); 1661var tree = compilation.SyntaxTrees.Single(t => t.FilePath == document.FilePath); 2403Assert.Equal(filePath, document.FilePath); 2431Assert.Equal(filePath, document.FilePath); 2454var newSolution = origSolution.AddDocument(newDocumentId, document.Name, sourceText, filePath: document.FilePath!); 2483Assert.Equal(filePath, document2.FilePath); 2522Assert.Equal(filePath, document2.FilePath); 3300Assert.Equal(OldFilePath, oldDocument.FilePath); 3308Assert.Equal(NewFilePath, newDocument.FilePath);
SolutionTests\SolutionWithSourceGeneratorTests.cs (1)
817.AddDocument(originalDocument1.Name, await originalDocument1.GetTextAsync().ConfigureAwait(false), filePath: originalDocument1.FilePath);
WorkspaceTests\AdhocWorkspaceTests.cs (6)
483Assert.Null(originalDoc.FilePath); 487Assert.Equal(newPath, changedDoc.FilePath); 502Assert.Equal(newPath, appliedDoc.FilePath); 548Assert.Null(originalDoc.FilePath); 558Assert.Equal(newPath, changedDoc.FilePath); 567Assert.Equal(newPath, appliedDoc.FilePath);
WorkspaceTests\WorkspaceTests.cs (2)
74Assert.Null(originalDoc.FilePath); 78Assert.Equal(newPath, changedDoc.FilePath);
Microsoft.VisualStudio.LanguageServices (29)
DocumentOutline\DocumentOutlineViewModel.cs (2)
416var filePath = _textBuffer.GetRelatedDocuments().FirstOrDefault(static d => d.FilePath is not null)?.FilePath;
EditorConfigSettings\SettingsEditorFactory.cs (1)
71if (!workspace.CurrentSolution.Projects.Any(p => p.AnalyzerConfigDocuments.Any(editorconfig => StringComparer.OrdinalIgnoreCase.Equals(editorconfig.FilePath, filePath))))
Extensions\VisualStudioWorkspaceImplExtensions.cs (2)
71if (hierarchy != null && !RoslynString.IsNullOrEmpty(document?.FilePath)) 73var itemId = hierarchy.TryGetItemId(document.FilePath);
FindReferences\Contexts\AbstractTableDataSourceFindUsagesContext.cs (1)
457document.FilePath,
FindReferences\Entries\AbstractDocumentSpanEntry.cs (2)
86return new MappedSpanResult(documentSpan.Document.FilePath!, sourceText.Lines.GetLinePositionSpan(documentSpan.SourceSpan), documentSpan.SourceSpan); 94return new MappedSpanResult(documentSpan.Document.FilePath!, sourceText.Lines.GetLinePositionSpan(documentSpan.SourceSpan), documentSpan.SourceSpan);
GenerateType\GenerateTypeDialogViewModel.cs (2)
259if (!TryGetImplicitFilePath(_document.FilePath, ServicesVSResources.DocumentPath_is_illegal, out implicitFilePath)) 357if (this.SelectedProject.Documents.Where(n => n != null).Where(n => n.FilePath == FullFilePath).Any() ||
LanguageService\AbstractLanguageService`2.cs (3)
167collapseAllImplementations = masWorkspace.FileService.ShouldCollapseOnOpen(openDocument.FilePath, options); 185if (runningDocumentTable4.IsMonikerValid(openDocument.FilePath)) 187var cookie = runningDocumentTable4.GetDocumentCookie(openDocument.FilePath);
MoveStaticMembers\VisualStudioMoveStaticMembersOptionsService.cs (1)
174.Where(l => l.IsInSource && (currentType.Name != t.Name || GetFile(l) != currentDocument.FilePath))
Preview\TopLevelChange.cs (3)
156solution = solution.AddDocument(oldDocument.Id, oldDocument.Name, oldText, oldDocument.Folders, oldDocument.FilePath); 160solution = solution.AddAnalyzerConfigDocument(oldDocument.Id, oldDocument.Name, SourceText.From(oldText), oldDocument.Folders, oldDocument.FilePath); 164solution = solution.AddAdditionalDocument(oldDocument.Id, oldDocument.Name, oldText, oldDocument.Folders, oldDocument.FilePath);
ProjectSystem\VisualStudioWorkspace.cs (1)
48=> CurrentSolution.GetTextDocument(documentId)?.FilePath;
ProjectSystem\VisualStudioWorkspaceImpl.cs (6)
297return _projectCodeModelFactory.Value.GetOrCreateFileCodeModel(documentId.ProjectId, document.FilePath!); 1077OpenDocumentFromPath(document.FilePath, document.Project.Id, activate); 1266if (document.FilePath == null) 1272var projectItemForDocument = dteProject.FindItemByPath(document.FilePath, StringComparer.OrdinalIgnoreCase); 1324if (document.FilePath != updatedInfo.FilePath) 1327$"This Workspace does not support changing a document's {nameof(document.FilePath)}.");
ValueTracking\ValueTrackedTreeItemViewModel.cs (1)
106var fileName = document.FilePath ?? document.Name;
Venus\ContainedDocument.cs (3)
186if (document.FilePath != null && hierarchy.TryGetItemId(document.FilePath) == itemidInsertionPoint) 205return hierarchy.TryGetItemId(_workspace.CurrentSolution.GetDocument(document.Id).FilePath);
Venus\ContainedDocument.DocumentServiceProvider.cs (1)
117result = new MappedSpanResult(document.FilePath, primarySnapshotSpan.ToLinePositionSpan(), primarySpan.ToTextSpan());
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (24)
Interactive\Commands\ResetInteractiveTests.cs (1)
52var document = project.Documents.FirstOrDefault(d => d.FilePath == "ResetInteractiveTestsDocument");
ProjectSystemShim\CPS\SourceFileHandlingTests.cs (23)
38Assert.True(GetCurrentDocuments().Any(s => s.FilePath == sourceFileFullPath)); 56Assert.True(GetCurrentAdditionalDocuments().Any(s => s.FilePath == additionalFileFullPath)); 106Assert.Equal(documents[0].FilePath, sourceFileFullPath5, StringComparer.OrdinalIgnoreCase); 107Assert.Equal(documents[1].FilePath, sourceFileFullPath4, StringComparer.OrdinalIgnoreCase); 108Assert.Equal(documents[2].FilePath, sourceFileFullPath3, StringComparer.OrdinalIgnoreCase); 109Assert.Equal(documents[3].FilePath, sourceFileFullPath2, StringComparer.OrdinalIgnoreCase); 110Assert.Equal(documents[4].FilePath, sourceFileFullPath1, StringComparer.OrdinalIgnoreCase); 150Assert.Equal(documents[0].FilePath, sourceFileFullPath5, StringComparer.OrdinalIgnoreCase); 151Assert.Equal(documents[1].FilePath, sourceFileFullPath3, StringComparer.OrdinalIgnoreCase); 152Assert.Equal(documents[2].FilePath, sourceFileFullPath1, StringComparer.OrdinalIgnoreCase); 202Assert.Equal(documents[0].FilePath, sourceFileFullPath5, StringComparer.OrdinalIgnoreCase); 203Assert.Equal(documents[1].FilePath, sourceFileFullPath4, StringComparer.OrdinalIgnoreCase); 204Assert.Equal(documents[2].FilePath, sourceFileFullPath3, StringComparer.OrdinalIgnoreCase); 205Assert.Equal(documents[3].FilePath, sourceFileFullPath2, StringComparer.OrdinalIgnoreCase); 206Assert.Equal(documents[4].FilePath, sourceFileFullPath1, StringComparer.OrdinalIgnoreCase); 241Assert.Equal(documents[0].FilePath, sourceFileFullPath5, StringComparer.OrdinalIgnoreCase); 242Assert.Equal(documents[1].FilePath, sourceFileFullPath4, StringComparer.OrdinalIgnoreCase); 243Assert.Equal(documents[2].FilePath, sourceFileFullPath3, StringComparer.OrdinalIgnoreCase); 244Assert.Equal(documents[3].FilePath, sourceFileFullPath2, StringComparer.OrdinalIgnoreCase); 245Assert.Equal(documents[4].FilePath, sourceFileFullPath1, StringComparer.OrdinalIgnoreCase); 283Assert.Equal(documents[0].FilePath, sourceFileFullPath2, StringComparer.OrdinalIgnoreCase); 284Assert.Equal(documents[1].FilePath, sourceFileFullPath1, StringComparer.OrdinalIgnoreCase); 391Assert.Equal(documents[0].FilePath, sourceFileFullPath1, StringComparer.OrdinalIgnoreCase);
Microsoft.VisualStudio.LanguageServices.LiveShare (10)
Client\RemoteLanguageServiceWorkspace.cs (8)
302text = SourceText.From(File.ReadAllText(document.FilePath)); 387if (doc != null && doc.FilePath != null) 399await _session.DownloadFileAsync(_session.ConvertLocalPathToSharedUri(doc.FilePath), CancellationToken.None).ConfigureAwait(true); 404if (ErrorHandler.Succeeded(svc.OpenDocumentViaProject(doc.FilePath, 421if (_openTextBufferProvider.IsFileOpen(doc.FilePath) && _openTextBufferProvider.TryGetBufferFromFilePath(doc.FilePath, out var buffer)) 423NotifyOnDocumentOpened(doc.FilePath, buffer); 498using var invisibleEditor = new InvisibleEditor(_serviceProvider, document.FilePath!, hierarchy: null,
ProjectsHandler.cs (2)
31var uri = new Uri(sourceFile.FilePath); 46SourceFiles = [.. project.Documents.Select(d => requestContext.ProtocolConverter.ToProtocolUri(new Uri(d.FilePath)))],
Microsoft.VisualStudio.LanguageServices.UnitTests (2)
Venus\DocumentService_IntegrationTests.vb (2)
284results.Add(New MappedSpanResult(mappedDocument.FilePath, lineSpan, mappedSpan)) 288results.Add(New MappedSpanResult(mappedDocument.FilePath, lineSpan, mappedSpan))
Microsoft.VisualStudio.LanguageServices.Xaml (3)
Implementation\XamlProjectService.cs (3)
198var filePath = e.Document.FilePath; 205if (document?.FilePath != null) 208project?.RemoveSourceFile(document.FilePath);
Roslyn.Diagnostics.Analyzers (3)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ProjectExtensions.cs (3)
73var analyzerConfigDirectory = PathUtilities.GetDirectoryName(analyzerConfigDocument.FilePath)!; 84return bestAnalyzerConfigDocument.FilePath; 106return project.AnalyzerConfigDocuments.FirstOrDefault(d => d.FilePath == analyzerConfigPath);
Roslyn.VisualStudio.DiagnosticsWindow (3)
Panels\WorkspacePanel.xaml.cs (3)
83where document.FilePath != null 94using var fileStream = File.OpenRead(document.FilePath); 102output.AppendLine($"{document.FilePath}: {BitConverter.ToString([.. snapshotChecksum])} : {BitConverter.ToString([.. fileChecksum])}");
Text.Analyzers (3)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ProjectExtensions.cs (3)
73var analyzerConfigDirectory = PathUtilities.GetDirectoryName(analyzerConfigDocument.FilePath)!; 84return bestAnalyzerConfigDocument.FilePath; 106return project.AnalyzerConfigDocuments.FirstOrDefault(d => d.FilePath == analyzerConfigPath);