6 instantiations of DocumentInfo
Microsoft.CodeAnalysis.ExternalAccess.Razor (1)
Microsoft.CodeAnalysis.Remote.Workspaces (1)
Microsoft.CodeAnalysis.Workspaces (4)
354 references to DocumentInfo
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (2)
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (1)
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (10)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (43)
SolutionCrawler\WorkCoordinatorTests.cs (22)
101DocumentInfo.Create(DocumentId.CreateNewId(projectId), "D1")
221documents: new List<DocumentInfo>
223DocumentInfo.Create(DocumentId.CreateNewId(projectId), "D1"),
224DocumentInfo.Create(DocumentId.CreateNewId(projectId), "D2")
565var info = DocumentInfo.Create(DocumentId.CreateNewId(project.Id), "D6");
626var info = solution.Projects[0].Documents[0];
652var info = solution.Projects[0].Documents[0];
736var ncfile = DocumentInfo.Create(DocumentId.CreateNewId(project.Id), "D6");
779var analyzerConfigFile = DocumentInfo.Create(DocumentId.CreateNewId(project.Id), ".editorconfig", filePath: analyzerConfigDocFilePath);
1303var info = DocumentInfo.Create(DocumentId.CreateNewId(id), "D6");
1418workspace.OnDocumentAdded(DocumentInfo.Create(DocumentId.CreateNewId(solution.Projects[0].Id), "D6"));
1625documents: new[] { DocumentInfo.Create(DocumentId.CreateNewId(projectId1), "D1") }),
1627documents: new[] { DocumentInfo.Create(DocumentId.CreateNewId(projectId2), "D2") },
1630documents: new[] { DocumentInfo.Create(DocumentId.CreateNewId(projectId3), "D3") },
1633documents: new[] { DocumentInfo.Create(DocumentId.CreateNewId(projectId4), "D4") }),
1635documents: new[] { DocumentInfo.Create(DocumentId.CreateNewId(projectId5), "D5") },
1657private static IEnumerable<DocumentInfo> GetDocuments(ProjectId projectId, int count)
1661yield return DocumentInfo.Create(DocumentId.CreateNewId(projectId), $"D{i + 1}");
Microsoft.CodeAnalysis.ExternalAccess.Razor (7)
Microsoft.CodeAnalysis.Features (13)
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (4)
Microsoft.CodeAnalysis.LanguageServerIndexFormat.Generator (2)
Microsoft.CodeAnalysis.Remote.ServiceHub (7)
Microsoft.CodeAnalysis.Remote.Workspaces (4)
Microsoft.CodeAnalysis.Workspaces (109)
Workspace\ProjectSystem\ProjectSystemProject.BatchingDocumentCollection.cs (14)
54private readonly ImmutableArray<DocumentInfo>.Builder _documentsAddedInBatch = ImmutableArray.CreateBuilder<DocumentInfo>();
67private readonly Action<Workspace, DocumentInfo> _documentAddAction;
74Action<Workspace, DocumentInfo> documentAddAction,
96var documentInfo = DocumentInfo.Create(
146var documentInfo = DocumentInfo.Create(
197var documentInfo = CreateDocumentInfoFromFileInfo(fileInfo, folders.NullToEmpty());
484var documentInfo = new DocumentInfo(attributes, fileInfo.TextLoader, fileInfo.DocumentServiceProvider);
535Func<Solution, ImmutableArray<DocumentInfo>, Solution> addDocuments,
546foreach (var documentInfo in _documentsAddedInBatch)
576private DocumentInfo CreateDocumentInfoFromFileInfo(DynamicFileInfo fileInfo, ImmutableArray<string> folders)
586return DocumentInfo.Create(
Workspace\Solution\ProjectInfo.cs (20)
123public IReadOnlyList<DocumentInfo> Documents { get; }
143public IReadOnlyList<DocumentInfo> AdditionalDocuments { get; }
148public IReadOnlyList<DocumentInfo> AnalyzerConfigDocuments { get; }
159IReadOnlyList<DocumentInfo> documents,
163IReadOnlyList<DocumentInfo> additionalDocuments,
164IReadOnlyList<DocumentInfo> analyzerConfigDocuments,
193IEnumerable<DocumentInfo>? documents,
197IEnumerable<DocumentInfo>? additionalDocuments,
221IEnumerable<DocumentInfo>? documents = null,
225IEnumerable<DocumentInfo>? additionalDocuments = null,
254analyzerConfigDocuments: SpecializedCollections.EmptyBoxedImmutableArray<DocumentInfo>(),
262IEnumerable<DocumentInfo>? documents = null,
266IEnumerable<DocumentInfo>? additionalDocuments = null,
267IEnumerable<DocumentInfo>? analyzerConfigDocuments = null,
287IReadOnlyList<DocumentInfo>? documents = null,
291IReadOnlyList<DocumentInfo>? additionalDocuments = null,
292IReadOnlyList<DocumentInfo>? analyzerConfigDocuments = null,
372public ProjectInfo WithDocuments(IEnumerable<DocumentInfo>? documents)
375public ProjectInfo WithAdditionalDocuments(IEnumerable<DocumentInfo>? additionalDocuments)
378public ProjectInfo WithAnalyzerConfigDocuments(IEnumerable<DocumentInfo>? analyzerConfigDocuments)
Workspace\Solution\Solution.cs (11)
1052=> AddDocument(DocumentInfo.Create(
1078return AddDocument(DocumentInfo.Create(
1090public Solution AddDocument(DocumentInfo documentInfo)
1098public Solution AddDocuments(ImmutableArray<DocumentInfo> documentInfos)
1137var info = CreateDocumentInfo(documentId, name, text, folders, filePath);
1141public Solution AddAdditionalDocument(DocumentInfo documentInfo)
1144public Solution AddAdditionalDocuments(ImmutableArray<DocumentInfo> documentInfos)
1179var info = CreateDocumentInfo(documentId, name, text, folders, filePath);
1183private DocumentInfo CreateDocumentInfo(DocumentId documentId, string name, SourceText text, IEnumerable<string>? folders, string? filePath)
1189return DocumentInfo.Create(
1204public Solution AddAnalyzerConfigDocuments(ImmutableArray<DocumentInfo> documentInfos)
Microsoft.CodeAnalysis.Workspaces.MSBuild (8)
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (2)
Microsoft.CodeAnalysis.Workspaces.UnitTests (113)
SolutionTests\DocumentInfoTests.cs (19)
26Assert.Throws<ArgumentNullException>(() => DocumentInfo.Create(id: null, "doc"));
27Assert.Throws<ArgumentNullException>(() => DocumentInfo.Create(documentId, name: null));
29Assert.Throws<ArgumentNullException>(() => DocumentInfo.Create(documentId, "doc", folders: new[] { "folder", null }));
38var info = DocumentInfo.Create(
57var info = DocumentInfo.Create(
76var info1 = DocumentInfo.Create(documentId, "doc", folders: new[] { "folder" });
79var info2 = DocumentInfo.Create(documentId, "doc");
82var info3 = DocumentInfo.Create(documentId, "doc", folders: new string[0]);
85var info4 = DocumentInfo.Create(documentId, "doc", folders: ImmutableArray<string>.Empty);
98var info = DocumentInfo.Create(DocumentId.CreateNewId(ProjectId.CreateNewId()), "doc_name", filePath: path, sourceCodeKind: kind);
108var instance = DocumentInfo.Create(DocumentId.CreateNewId(ProjectId.CreateNewId()), "doc");
SolutionTests\ProjectInfoTests.cs (22)
29documents: new DocumentInfo[] { null }));
37var documentInfo = DocumentInfo.Create(DocumentId.CreateNewId(pid), "doc");
42additionalDocuments: new DocumentInfo[] { null }));
73var documentInfo = DocumentInfo.Create(DocumentId.CreateNewId(ProjectId.CreateNewId()), "doc");
76Assert.Same(documentInfo, ((ImmutableArray<DocumentInfo>)info1.Documents).Single());
79Assert.True(((ImmutableArray<DocumentInfo>)info2.Documents).IsEmpty);
81var info3 = ProjectInfo.Create(ProjectId.CreateNewId(), version, "proj", "assembly", "C#", documents: new DocumentInfo[0]);
82Assert.True(((ImmutableArray<DocumentInfo>)info3.Documents).IsEmpty);
84var info4 = ProjectInfo.Create(ProjectId.CreateNewId(), version, "proj", "assembly", "C#", documents: ImmutableArray<DocumentInfo>.Empty);
85Assert.True(((ImmutableArray<DocumentInfo>)info4.Documents).IsEmpty);
92var documentInfo = DocumentInfo.Create(DocumentId.CreateNewId(ProjectId.CreateNewId()), "doc");
95Assert.Same(documentInfo, ((ImmutableArray<DocumentInfo>)info1.AdditionalDocuments).Single());
98Assert.True(((ImmutableArray<DocumentInfo>)info2.AdditionalDocuments).IsEmpty);
100var info3 = ProjectInfo.Create(ProjectId.CreateNewId(), version, "proj", "assembly", "C#", additionalDocuments: new DocumentInfo[0]);
101Assert.True(((ImmutableArray<DocumentInfo>)info3.AdditionalDocuments).IsEmpty);
103var info4 = ProjectInfo.Create(ProjectId.CreateNewId(), version, "proj", "assembly", "C#", additionalDocuments: ImmutableArray<DocumentInfo>.Empty);
104Assert.True(((ImmutableArray<DocumentInfo>)info4.AdditionalDocuments).IsEmpty);
182var documentInfo = DocumentInfo.Create(DocumentId.CreateNewId(projectId), "doc");
SolutionTests\SolutionTests.cs (36)
1120solution = solution.AddDocument(DocumentInfo.Create(documentAId, "a.cs", loader: textLoaderA, filePath: "a.cs"));
1123solution = solution.AddDocument(DocumentInfo.Create(fileDocumentId, "d.cs", loader: new FileTextLoader(fileD.Path, defaultEncoding: null), filePath: fileD.Path));
1964var documentInfo1 = DocumentInfo.Create(DocumentId.CreateNewId(projectId), "file1.cs");
1965var documentInfo2 = DocumentInfo.Create(DocumentId.CreateNewId(projectId), "file2.cs");
1988var documentInfo1 = DocumentInfo.Create(DocumentId.CreateNewId(projectId1), "file1.cs");
1989var documentInfo2 = DocumentInfo.Create(DocumentId.CreateNewId(projectId2), "file2.cs");
2015var documentInfo1 = DocumentInfo.Create(DocumentId.CreateNewId(projectId1), "file1.cs");
2016var documentInfo2 = DocumentInfo.Create(DocumentId.CreateNewId(projectId2), "file2.cs");
2040var documentInfo1 = DocumentInfo.Create(DocumentId.CreateNewId(projectId), "file1.cs");
2041var documentInfo2 = DocumentInfo.Create(DocumentId.CreateNewId(projectId), "file2.cs");
2061var documentInfo1 = DocumentInfo.Create(DocumentId.CreateNewId(projectId1), "file1.cs");
2062var documentInfo2 = DocumentInfo.Create(DocumentId.CreateNewId(projectId2), "file2.cs");
2083var documentInfo1 = DocumentInfo.Create(DocumentId.CreateNewId(projectId1), "file1.cs");
2102var documentInfo1 = DocumentInfo.Create(DocumentId.CreateNewId(projectId1), "file1.txt");
2121var documentInfo1 = DocumentInfo.Create(DocumentId.CreateNewId(projectId1), ".editorconfig");
3931DocumentInfo.Create(
3965DocumentInfo.Create(
4007DocumentInfo.Create(
4055DocumentInfo.Create(
4101DocumentInfo.Create(
4172.WithAnalyzerConfigDocuments(new[] { DocumentInfo.Create(editorConfigDocumentId, ".editorconfig", filePath: editorConfigFilePath) });
4294var docInfo = DocumentInfo.Create(DocumentId.CreateNewId(pid), "c.cs", loader: TextLoader.From(TextAndVersion.Create(text, version)));
WorkspaceTests\AdhocWorkspaceTests.cs (12)
62var info = DocumentInfo.Create(DocumentId.CreateNewId(project.Id), "code.cs");
155var docInfo = DocumentInfo.Create(
218var docInfo = DocumentInfo.Create(DocumentId.CreateNewId(pid), "c.cs", loader: TextLoader.From(TextAndVersion.Create(text, version)));
252var docInfo = DocumentInfo.Create(DocumentId.CreateNewId(pid), "c.cs", loader: TextLoader.From(TextAndVersion.Create(text, version)));
287var docInfo = DocumentInfo.Create(
346var docInfo = DocumentInfo.Create(DocumentId.CreateNewId(pid), "c.cs", loader: TextLoader.From(TextAndVersion.Create(text, version)));
Microsoft.VisualStudio.LanguageServices (15)
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (1)
Microsoft.VisualStudio.LanguageServices.LiveShare (3)
Microsoft.VisualStudio.LanguageServices.UnitTests (2)
Roslyn.VisualStudio.Next.UnitTests (8)