161 references to Name
AnalyzerRunner (2)
DiagnosticAnalyzerRunner.cs (2)
122
Console.WriteLine($"{document.FilePath ?? document.
Name
}: {currentDocumentPerformance.EditsPerSecond:0.00} ({currentDocumentPerformance.AllocatedBytesPerEdit} bytes)");
142
Console.WriteLine($" {document.FilePath ?? document.
Name
}: {pair.Value.EditsPerSecond:0.00} ({pair.Value.AllocatedBytesPerEdit} bytes)");
Microsoft.Analyzers.Extra (1)
CallAnalysis\Fixers\LegacyLoggingFixer.FixDetails.cs (1)
172
if (string.Equals(doc.
Name
, targetName, StringComparison.OrdinalIgnoreCase))
Microsoft.Analyzers.Extra.Tests (2)
Resources\RoslynTestUtils.cs (2)
78
if (doc.
Name
== name)
530
return diagnostics.Where(d => d.Location.SourceTree!.FilePath.EndsWith(document.
Name
));
Microsoft.Analyzers.Local.Tests (2)
Resources\RoslynTestUtils.cs (2)
78
if (doc.
Name
== name)
531
return diagnostics.Where(d => d.Location.SourceTree!.FilePath.EndsWith(document.
Name
));
Microsoft.CodeAnalysis.CodeStyle.Fixes (6)
src\Analyzers\Core\CodeFixes\MatchFolderAndNamespace\AbstractChangeNamespaceToMatchFolderCodeFixProvider.cs (1)
59
documentWithInvalidFolders.
Name
,
src\Analyzers\Core\CodeFixes\MatchFolderAndNamespace\AbstractChangeNamespaceToMatchFolderCodeFixProvider.CustomFixAllProvider.cs (1)
89
using var _ = progressTracker.ItemCompletedScope(document.
Name
);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixesAndRefactorings\FixAllHelper.cs (1)
21
FixAllScope.Document => string.Format(WorkspaceExtensionsResources.Fix_all_0_in_1, title, triggerDocument.
Name
),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (3)
44
return semanticModel ?? throw new InvalidOperationException(string.Format(WorkspaceExtensionsResources.SyntaxTree_is_required_to_accomplish_the_task_but_is_not_supported_by_document_0, document.
Name
));
68
return syntaxTree ?? throw new InvalidOperationException(string.Format(WorkspaceExtensionsResources.SyntaxTree_is_required_to_accomplish_the_task_but_is_not_supported_by_document_0, document.
Name
));
85
return root ?? throw new InvalidOperationException(string.Format(WorkspaceExtensionsResources.SyntaxTree_is_required_to_accomplish_the_task_but_is_not_supported_by_document_0, document.
Name
));
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (6)
EditAndContinue\ActiveStatementTrackingServiceTests.cs (2)
65
var document1 = project.Documents.Single(d => d.
Name
== "1.cs");
66
var document2 = project.Documents.Single(d => d.
Name
== "2.cs");
Workspaces\WorkspaceTests_EditorFeatures.cs (4)
1255
Assert.Equal("original.config", workspace.CurrentSolution.GetProject(project1.Id).AdditionalDocuments.Single().
Name
);
1291
Assert.Equal("original.config", workspace.CurrentSolution.GetProject(project1.Id).AnalyzerConfigDocuments.Single().
Name
);
1321
Assert.Equal("original.config", workspace.CurrentSolution.GetProject(project1.Id).AdditionalDocuments.Single().
Name
);
1349
Assert.Equal("original.config", workspace.CurrentSolution.GetProject(project1.Id).AnalyzerConfigDocuments.Single().
Name
);
Microsoft.CodeAnalysis.EditorFeatures (5)
InlineRename\InlineRenameSession.OpenTextBufferManager.cs (1)
542
using (Logger.LogBlock(FunctionId.Workspace_Document_GetTextChanges, newDocument.
Name
, cancellationToken))
Preview\AbstractPreviewFactoryService.cs (3)
258
document.
Name
, document.Project.Name);
330
document.
Name
, document.Project.Name);
666
buffer, Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString(), document.
Name
));
RenameTracking\RenameTrackingTaggerProvider.cs (1)
81
document.
Name
,
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (3)
Diagnostics\GenerateType\GenerateTypeTestState.cs (1)
57
ExistingDocument = ProjectToBeModified.Documents.FirstOrDefault(doc => doc.
Name
.Equals(existingFileName));
LanguageServer\AbstractLanguageServerProtocolTests.cs (1)
88
if (document.
Name
== GeneratedFileName)
Rename\RenamerTests.cs (1)
93
Assert.Equal(endDocument.DocumentName, updatedDocument.
Name
);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (6)
CodeRefactorings\CodeRefactoringServiceTest.cs (4)
171
var txtAdditionalDocument = project.AdditionalDocuments.Single(t => t.
Name
== "test.txt");
186
var logAdditionalDocument = project.AdditionalDocuments.Single(t => t.
Name
== "test.log");
210
var editorConfig = project.AnalyzerConfigDocuments.Single(t => t.
Name
== ".editorconfig");
225
var globalConfig = project.AnalyzerConfigDocuments.Single(t => t.
Name
== ".globalconfig");
Diagnostics\DiagnosticDataTests.cs (2)
145
new(additionalDocument.
Name
, new(0, 0), new(0, 1)), additionalDocument.Id);
239
new(secondDocument.
Name
, new(0, 0), new(0, 1)), secondDocument.Id);
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (2)
Rename\RenameTestHelpers.vb (2)
86
Dim expectedName = Path.ChangeExtension(newIdentifierName, Path.GetExtension(document.
Name
))
87
Assert.Equal(expectedName, document.
Name
)
Microsoft.CodeAnalysis.Features (10)
CodeRefactorings\MoveType\AbstractMoveTypeService.MoveTypeEditor.cs (1)
114
Debug.Assert(document.
Name
!= FileName,
CodeRefactorings\SyncNamespace\AbstractSyncNamespaceCodeRefactoringProvider.MoveFileCodeAction.cs (2)
41
var newDocumentId = DocumentId.CreateNewId(document.Project.Id, document.
Name
);
46
solution = solution.AddDocument(newDocumentId, document.
Name
, text, folders: _newfolders);
EditAndContinue\CommittedSolution.cs (2)
272
name: document.
Name
,
275
loader: TextLoader.From(TextAndVersion.Create(sourceText, sourceTextVersion, document.
Name
)),
NavigateTo\RoslynNavigateToItem.cs (2)
129
(true, true) => string.Format(FeaturesResources._0_dash_1, itemDocument.
Name
, combinedProjectName),
130
(true, false) => string.Format(FeaturesResources.in_0_1_2, item.DeclaredSymbolInfo.ContainerDisplayName, itemDocument.
Name
, combinedProjectName),
Navigation\INavigableItem.cs (1)
56
document.
Name
,
src\Analyzers\Core\CodeFixes\MatchFolderAndNamespace\AbstractChangeNamespaceToMatchFolderCodeFixProvider.cs (1)
59
documentWithInvalidFolders.
Name
,
StackTraceExplorer\StackTraceExplorerService.cs (1)
101
else if (document.
Name
== documentName)
Microsoft.CodeAnalysis.Features.UnitTests (6)
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (2)
146
], matchingDocuments.Select(e => (solution.GetDocument(e.id).
Name
, e.state)).OrderBy(e => e.Name).Select(e => e.ToString()));
1446
var documentC = projectC.Documents.Single(d => d.
Name
== "C.cs");
EditAndContinue\EditSessionActiveStatementsTests.cs (2)
178
var document1 = project.Documents.Single(d => d.
Name
== "test1.cs");
179
var document2 = project.Documents.Single(d => d.
Name
== "test2.cs");
EditAndContinue\UnitTestingHotReloadServiceTests.cs (1)
60
], matchingDocuments.Select(e => (solution.GetDocument(e.id).
Name
, e.state)).OrderBy(e => e.Name).Select(e => e.ToString()));
EditAndContinue\WatchHotReloadServiceTests.cs (1)
72
], matchingDocuments.Select(e => (solution.GetDocument(e.id).
Name
, e.state)).OrderBy(e => e.Name).Select(e => e.ToString()));
Microsoft.CodeAnalysis.LanguageServer.Protocol (8)
Extensions\Extensions.cs (4)
41
Contract.ThrowIfNull(document.
Name
);
46
var path = Path.Combine(directoryName, document.
Name
);
52
Contract.ThrowIfNull(document.
Name
);
57
var path = Path.Combine([projectDirectoryName, .. document.Folders, document.
Name
]);
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.cs (1)
93
=> $"document open: ({document.FilePath ?? document.
Name
})";
Handler\CodeActions\CodeActionResolveHelper.cs (3)
241
Contract.Fail($"Can't find uri for document: {newTextDoc.
Name
}.");
302
if (oldTextDoc.
Name
!= newTextDoc.
Name
)
Microsoft.CodeAnalysis.Workspaces (23)
Classification\SemanticClassificationCacheUtilities.cs (1)
24
var documentKey = new DocumentKey(projectKey, document.Id, document.FilePath, document.
Name
);
Diagnostics\DocumentAnalysisScope.cs (1)
58
var filePath = TextDocument.FilePath ?? TextDocument.
Name
;
FindSymbols\ReferenceLocation.cs (1)
149
=> string.Format("{0}: {1}", this.Document.
Name
, this.Location);
Rename\ConflictEngine\MutableConflictResolution.cs (2)
95
var extension = Path.GetExtension(document.
Name
);
111
if (newName.Equals(document.
Name
, StringComparison.OrdinalIgnoreCase))
Rename\Renamer.cs (3)
112
return new RenameDocumentActionSet([], document.Id, document.
Name
, [.. document.Folders], options);
117
if (newDocumentName != null && !newDocumentName.Equals(document.
Name
))
129
newDocumentName ??= document.
Name
;
Rename\Renamer.RenameDocumentActionSet.cs (1)
141
return project.Documents.FirstOrDefault(d => d.
Name
== _documentName && d.Folders.SequenceEqual(_documentFolders))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixesAndRefactorings\FixAllHelper.cs (1)
21
FixAllScope.Document => string.Format(WorkspaceExtensionsResources.Fix_all_0_in_1, title, triggerDocument.
Name
),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (6)
44
return semanticModel ?? throw new InvalidOperationException(string.Format(WorkspaceExtensionsResources.SyntaxTree_is_required_to_accomplish_the_task_but_is_not_supported_by_document_0, document.
Name
));
57
return semanticModel ?? throw new InvalidOperationException(string.Format(WorkspaceExtensionsResources.SyntaxTree_is_required_to_accomplish_the_task_but_is_not_supported_by_document_0, document.
Name
));
68
return syntaxTree ?? throw new InvalidOperationException(string.Format(WorkspaceExtensionsResources.SyntaxTree_is_required_to_accomplish_the_task_but_is_not_supported_by_document_0, document.
Name
));
75
return syntaxTree ?? throw new InvalidOperationException(string.Format(WorkspaceExtensionsResources.SyntaxTree_is_required_to_accomplish_the_task_but_is_not_supported_by_document_0, document.
Name
));
85
return root ?? throw new InvalidOperationException(string.Format(WorkspaceExtensionsResources.SyntaxTree_is_required_to_accomplish_the_task_but_is_not_supported_by_document_0, document.
Name
));
92
return root ?? throw new InvalidOperationException(string.Format(WorkspaceExtensionsResources.SyntaxTree_is_required_to_accomplish_the_task_but_is_not_supported_by_document_0, document.
Name
));
Utilities\WorkspacePathUtilities.cs (2)
39
if (document.
Name
is null)
44
return IOUtilities.PerformIO(() => Path.GetFileNameWithoutExtension(document.
Name
));
Workspace\Solution\Document.cs (3)
303
return semanticModel ?? throw new InvalidOperationException(string.Format(WorkspaceExtensionsResources.SyntaxTree_is_required_to_accomplish_the_task_but_is_not_supported_by_document_0, this.
Name
));
426
using (Logger.LogBlock(FunctionId.Workspace_Document_GetTextChanges, this.
Name
, cancellationToken))
538
=> this.
Name
;
Workspace\Workspace.cs (2)
2016
doc.
Name
,
2544
var name = document != null ? document.
Name
: "<Document" + documentId.Id + ">";
Microsoft.CodeAnalysis.Workspaces.MSBuild (2)
MSBuild\MSBuildWorkspace.cs (2)
393
var message = string.Format(WorkspaceMSBuildResources.Path_for_document_0_was_null, document.
Name
);
411
var message = string.Format(WorkspaceMSBuildResources.Path_for_additional_document_0_was_null, document.
Name
);
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (39)
NetCoreTests.cs (7)
90
var document = project.Documents.First(d => d.
Name
== "Program.cs");
115
var document = libraryProject.Documents.First(d => d.
Name
== "Class1.cs");
155
var document = project.Documents.First(d => d.
Name
== "Program.cs");
215
var document = project.Documents.First(d => d.
Name
== "Program.cs");
327
document = project.Documents.First(d => d.
Name
== "Program.cs");
331
document = project.Documents.First(d => d.
Name
== "Class1.cs");
506
var document = project.Documents.First(d => d.
Name
== "Program.vb");
VisualStudioMSBuildWorkspaceTests.cs (32)
767
Assert.Contains(documents, d => d.
Name
== "App.xaml.cs");
768
Assert.Contains(documents, d => d.
Name
== "MainWindow.xaml.cs");
771
Assert.DoesNotContain(documents, d => d.
Name
.EndsWith(".xaml", StringComparison.OrdinalIgnoreCase));
774
Assert.Contains(documents, d => d.
Name
== "App.g.cs");
775
Assert.Contains(documents, d => d.
Name
== "MainWindow.g.cs");
843
var documents = project.Documents.Where(d => d.
Name
== "CSharpClass.cs").ToList();
1993
var fooDoc = documents.Single(d => d.
Name
== "Foo.cs");
2022
var document2 = documents.Single(d => d.
Name
== "Bar.cs");
2041
var documentB = documentsB.Single(d => d.
Name
== "Bar.cs");
2054
var document = project.Documents.Single(d => d.
Name
== "CSharpClass.cs");
2065
var document2 = documents.Single(d => d.
Name
== "CSharpClass.cs");
2088
var document = project.Documents.Single(d => d.
Name
== "CSharpClass.cs");
2096
Assert.DoesNotContain(project2.Documents, d => d.
Name
== "CSharpClass.cs");
2115
var document = documents.Single(d => d.
Name
.Contains("CSharpClass"));
2142
var document = documents.Single(d => d.
Name
.Contains("ValidAdditionalFile"));
2209
var xaml = workspace.CurrentSolution.GetProject(csProjectId).AdditionalDocuments.FirstOrDefault(d => d.
Name
== "XamlFile.xaml");
2352
Assert.Equal("XamlFile.xaml", doc.
Name
);
2370
var document = project.Documents.Single(d => d.
Name
== "CSharpClass.cs");
2374
var additionalDocument = project.AdditionalDocuments.Single(a => a.
Name
== "XamlFile.xaml");
2393
var adoc = proj.AdditionalDocuments.First(a => a.
Name
== "XamlFile.xaml");
2793
var document = project.Documents.First(d => d.
Name
== "class1.cs");
2812
var document = project.Documents.First(d => d.
Name
== "class1.cs");
2831
var document = project.Documents.First(d => d.
Name
== "class1.cs");
2880
var document = project.Documents.First(d => d.
Name
== "class1.cs");
3109
Assert.Contains(proj.Documents, d => d.
Name
== "AssemblyInfo.cs");
3197
Assert.Contains(project.AdditionalDocuments, doc => doc.
Name
== "COM1");
3198
Assert.Contains(project.AdditionalDocuments, doc => doc.
Name
== "TEST::");
3245
Assert.Equal(".editorconfig", analyzerConfigDocument.
Name
);
3308
var document = project.Documents.First(d => d.
Name
== "class1.cs");
3327
var document = project.Documents.Single(d => d.
Name
== "MyClass.cs");
3340
var linkedDocument = project.Documents.Single(d => d.
Name
== "Foo.cs");
3353
var linkedDocument = project.Documents.Single(d => d.
Name
== "MyClass.cs");
Microsoft.CodeAnalysis.Workspaces.UnitTests (16)
CommandLineProject\CommandLineProjectWorkspaceTests.cs (3)
38
var gooDoc = project.Documents.First(d => d.
Name
== "CSharpClass.cs");
66
var gooDoc = project.Documents.First(d => d.
Name
== "goo.cs");
70
var barDoc = project.Documents.First(d => d.
Name
== "bar.cs");
SolutionTests\SolutionTests.cs (1)
179
Assert.Equal(name, newSolution1.GetDocument(documentId)!.
Name
);
SolutionTests\SolutionWithSourceGeneratorTests.cs (2)
467
project = project.Documents.Single(d => d.
Name
== "RegularDocument.cs").WithFrozenPartialSemantics(CancellationToken.None).Project;
816
.AddDocument(originalDocument1.
Name
, await originalDocument1.GetTextAsync().ConfigureAwait(false), filePath: originalDocument1.FilePath);
WorkspaceTests\AdhocWorkspaceTests.cs (8)
63
Assert.Equal(info.Name, doc.
Name
);
75
Assert.Equal(name, doc.
Name
);
181
Assert.Equal("MyDoc.cs", doc.
Name
);
416
Assert.Equal("TestDocument", originalDoc.
Name
);
420
Assert.Equal(newName, changedDoc.
Name
);
435
Assert.Equal(newName, appliedDoc.
Name
);
546
Assert.Equal("TestDocument", originalDoc.
Name
);
563
Assert.Equal(newName, appliedDoc.
Name
);
WorkspaceTests\WorkspaceTests.cs (2)
39
Assert.Equal("TestDocument", originalDoc.
Name
);
43
Assert.Equal(newName, changedDoc.
Name
);
Microsoft.Gen.ComplianceReports.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
102
if (doc.
Name
== name)
Microsoft.Gen.ContextualOptions.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
102
if (doc.
Name
== name)
Microsoft.Gen.Logging.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
102
if (doc.
Name
== name)
Microsoft.Gen.Metrics.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
102
if (doc.
Name
== name)
Microsoft.Gen.MetricsReports.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
102
if (doc.
Name
== name)
Microsoft.Interop.LibraryImportGenerator (1)
Analyzers\AddDisableRuntimeMarshallingAttributeFixer.cs (1)
74
return document.
Name
== AssemblyInfoFileName
Microsoft.ML.InternalCodeAnalyzer (2)
NameFixProvider.cs (2)
64
string docName = context.Document.
Name
;
66
&& context.Document.
Name
.StartsWith(originalName, StringComparison.OrdinalIgnoreCase))
Microsoft.VisualStudio.LanguageServices (11)
GenerateType\GenerateTypeDialogViewModel.cs (4)
378
this.SelectedProject.Documents.Where(n => n.
Name
!= null && n.Folders.Count > 0 && n.
Name
== this.FileName && this.Folders.SequenceEqual(n.Folders)).Any()) ||
818
Name = document.
Name
;
822
Name = string.Join("\\", document.Folders) + "\\" + document.
Name
;
Preview\FileChange.cs (3)
152
pbstrText = ServicesVSResources.bracket_plus_bracket + _right.
Name
;
156
pbstrText = ServicesVSResources.bracket_bracket + _left.
Name
;
160
pbstrText = _right.
Name
;
Preview\TopLevelChange.cs (3)
157
solution = solution.AddDocument(oldDocument.Id, oldDocument.
Name
, oldText, oldDocument.Folders, oldDocument.FilePath);
161
solution = solution.AddAnalyzerConfigDocument(oldDocument.Id, oldDocument.
Name
, SourceText.From(oldText), oldDocument.Folders, oldDocument.FilePath);
165
solution = solution.AddAdditionalDocument(oldDocument.Id, oldDocument.
Name
, oldText, oldDocument.Folders, oldDocument.FilePath);
ProjectSystem\VisualStudioWorkspaceImpl.AbstractRemoveDocumentUndoUnit.cs (1)
47
var documentName = document?.
Name
?? "";
Microsoft.VisualStudio.LanguageServices.Xaml (1)
Features\DocumentSpan.cs (1)
26
return $"{Document.
Name
} [{TextSpan.Start}...{TextSpan.End}]";
Roslyn.VisualStudio.Next.UnitTests (2)
Services\ServiceHubServicesTests.cs (2)
1637
var document = project.Documents.First(d => string.Equals(d.
Name
, documentName, StringComparison.OrdinalIgnoreCase));
1646
documentName => project.Documents.First(d => string.Equals(d.
Name
, documentName, StringComparison.OrdinalIgnoreCase)));