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