4 instantiations of DocumentInfo
Microsoft.CodeAnalysis.Workspaces (4)
Workspace\ProjectSystem\ProjectSystemProject.BatchingDocumentCollection.cs (1)
511var documentInfo = new DocumentInfo(documentToReload.State.Attributes, fileInfo.TextLoader, fileInfo.DocumentServiceProvider);
Workspace\Solution\DocumentInfo.cs (2)
85return new DocumentInfo( 114return new DocumentInfo(newAttributes, newLoader, newDocumentServiceProvider);
Workspace\Workspace.cs (1)
1644new DocumentInfo(newDoc.DocumentState.Attributes, loader: null, documentServiceProvider: newDoc.State.DocumentServiceProvider));
145 references to DocumentInfo
dotnet-format (3)
Workspaces\FolderWorkspace_ProjectLoader.cs (3)
44static IEnumerable<DocumentInfo> LoadDocuments(ProjectId projectId, ImmutableArray<string> filePaths) 46var documents = new DocumentInfo[filePaths.Length]; 49documents[index] = DocumentInfo.Create(
Microsoft.CodeAnalysis.ExternalAccess.HotReload (2)
Api\HotReloadMSBuildWorkspace.cs (2)
135ImmutableArray<DocumentInfo> MapDocuments(ProjectId mappedProjectId, IReadOnlyList<DocumentInfo> documents)
Microsoft.CodeAnalysis.Features (16)
CodeFixes\Configuration\ConfigurationUpdater.cs (2)
331var documentInfo = DocumentInfo.Create(
EditAndContinue\CommittedSolution.cs (1)
286_solution = _solution.AddDocument(DocumentInfo.Create(
GenerateType\AbstractGenerateTypeService.Editor.cs (1)
351DocumentInfo.Create(
MetadataAsSource\DecompilationMetadataAsSourceFileProvider.cs (4)
355var assemblyInfoDocument = DocumentInfo.Create( 365var generatedDocument = DocumentInfo.Create(
PdbSourceDocument\PdbSourceDocumentMetadataAsSourceFileProvider.cs (6)
262foreach (var documentInfo in documentInfos) 328private ImmutableArray<DocumentInfo> CreateDocumentInfos( 331using var _ = ArrayBuilder<DocumentInfo>.GetInstance(out var documents); 349var documentInfo = DocumentInfo.Create( 436internal record struct SourceDocumentInfo(DocumentId DocumentId, Encoding Encoding, SourceHashAlgorithm ChecksumAlgorithm, ProjectId SourceProjectId, Workspace SourceWorkspace, DocumentInfo DocumentInfo);
Workspace\MiscellaneousFileUtilities.cs (2)
75var documentInfo = DocumentInfo.Create(
Microsoft.CodeAnalysis.Workspaces (116)
Serialization\SerializationExtensions.cs (1)
23DocumentInfo.DocumentAttributes => WellKnownSynchronizationKind.DocumentAttributes,
Serialization\SerializerService.cs (2)
103((DocumentInfo.DocumentAttributes)value).WriteTo(writer); 248WellKnownSynchronizationKind.DocumentAttributes => DocumentInfo.DocumentAttributes.ReadFrom(reader),
Workspace\AdhocWorkspace.cs (2)
128return AddDocument(DocumentInfo.Create(id, name, loader: loader)); 134public Document AddDocument(DocumentInfo documentInfo)
Workspace\CommandLineProject.cs (4)
145IList<DocumentInfo> CreateDocuments(ImmutableArray<CommandLineSourceFile> files) 147var documents = new List<DocumentInfo>(); 163var doc = DocumentInfo.Create(
Workspace\ProjectSystem\ProjectSystemProject.BatchingDocumentCollection.cs (16)
54private readonly ImmutableArray<DocumentInfo>.Builder _documentsAddedInBatch = ImmutableArray.CreateBuilder<DocumentInfo>(); 67private readonly Action<Workspace, DocumentInfo> _documentAddAction; 86Action<Workspace, DocumentInfo> documentAddAction, 108var documentInfo = DocumentInfo.Create( 158var documentInfo = DocumentInfo.Create( 209var documentInfo = CreateDocumentInfoFromFileInfo(fileInfo, folders.NullToEmpty()); 511var documentInfo = new DocumentInfo(documentToReload.State.Attributes, fileInfo.TextLoader, fileInfo.DocumentServiceProvider); 565Func<Solution, ImmutableArray<DocumentInfo>, Solution> addDocuments, 580Func<Solution, ImmutableArray<DocumentInfo>, Solution> addDocuments, 585ImmutableArray<DocumentInfo> documentsAddedInBatch, 598foreach (var documentInfo in documentsAddedInBatch) 634private DocumentInfo CreateDocumentInfoFromFileInfo(DynamicFileInfo fileInfo, ImmutableArray<string> folders) 644return DocumentInfo.Create(
Workspace\Solution\AdditionalDocumentState.cs (3)
18DocumentInfo.DocumentAttributes attributes, 28DocumentInfo documentInfo, 34protected override TextDocumentState UpdateAttributes(DocumentInfo.DocumentAttributes newAttributes)
Workspace\Solution\AnalyzerConfigDocumentState.cs (3)
20DocumentInfo.DocumentAttributes attributes, 34DocumentInfo documentInfo, 40protected override TextDocumentState UpdateAttributes(DocumentInfo.DocumentAttributes newAttributes)
Workspace\Solution\DocumentInfo.cs (11)
64/// Create a new instance of a <see cref="DocumentInfo"/>. 76public static DocumentInfo Create( 98private DocumentInfo With( 117public DocumentInfo WithId(DocumentId id) 120public DocumentInfo WithName(string name) 123public DocumentInfo WithFolders(IEnumerable<string>? folders) 126public DocumentInfo WithSourceCodeKind(SourceCodeKind kind) 129public DocumentInfo WithFilePath(string? filePath) 132public DocumentInfo WithTextLoader(TextLoader? loader) 135internal DocumentInfo WithDesignTimeOnly(bool designTimeOnly) 138internal DocumentInfo WithDocumentServiceProvider(IDocumentServiceProvider? provider)
Workspace\Solution\DocumentState.cs (5)
40DocumentInfo.DocumentAttributes attributes, 56DocumentInfo info, 399protected override TextDocumentState UpdateAttributes(DocumentInfo.DocumentAttributes newAttributes) 441public new DocumentState WithAttributes(DocumentInfo.DocumentAttributes newAttributes) 534DocumentInfo.DocumentAttributes attributes,
Workspace\Solution\DocumentState_LinkedFileReuse.cs (1)
101DocumentInfo.DocumentAttributes attributes,
Workspace\Solution\ProjectInfo.cs (20)
125public IReadOnlyList<DocumentInfo> Documents { get; } 145public IReadOnlyList<DocumentInfo> AdditionalDocuments { get; } 150public IReadOnlyList<DocumentInfo> AnalyzerConfigDocuments { get; } 161IReadOnlyList<DocumentInfo> documents, 165IReadOnlyList<DocumentInfo> additionalDocuments, 166IReadOnlyList<DocumentInfo> analyzerConfigDocuments, 195IEnumerable<DocumentInfo>? documents, 199IEnumerable<DocumentInfo>? additionalDocuments, 223IEnumerable<DocumentInfo>? documents = null, 227IEnumerable<DocumentInfo>? additionalDocuments = null, 256analyzerConfigDocuments: SpecializedCollections.EmptyBoxedImmutableArray<DocumentInfo>(), 264IEnumerable<DocumentInfo>? documents = null, 268IEnumerable<DocumentInfo>? additionalDocuments = null, 269IEnumerable<DocumentInfo>? analyzerConfigDocuments = null, 289IReadOnlyList<DocumentInfo>? documents = null, 293IReadOnlyList<DocumentInfo>? additionalDocuments = null, 294IReadOnlyList<DocumentInfo>? analyzerConfigDocuments = null, 377public ProjectInfo WithDocuments(IEnumerable<DocumentInfo>? documents) 380public ProjectInfo WithAdditionalDocuments(IEnumerable<DocumentInfo>? additionalDocuments) 383public ProjectInfo WithAnalyzerConfigDocuments(IEnumerable<DocumentInfo>? analyzerConfigDocuments)
Workspace\Solution\ProjectState.cs (2)
294internal DocumentState CreateDocument(DocumentInfo documentInfo, ParseOptions? parseOptions, LoadTextOptions loadTextOptions) 306internal TDocumentState CreateDocument<TDocumentState>(DocumentInfo documentInfo)
Workspace\Solution\Solution.cs (11)
1035=> AddDocument(DocumentInfo.Create( 1061return AddDocument(DocumentInfo.Create( 1073public Solution AddDocument(DocumentInfo documentInfo) 1081public Solution AddDocuments(ImmutableArray<DocumentInfo> documentInfos) 1112var info = CreateDocumentInfo(documentId, name, text, folders, filePath); 1116public Solution AddAdditionalDocument(DocumentInfo documentInfo) 1119public Solution AddAdditionalDocuments(ImmutableArray<DocumentInfo> documentInfos) 1146var info = CreateDocumentInfo(documentId, name, text, folders, filePath); 1150private DocumentInfo CreateDocumentInfo(DocumentId documentId, string name, SourceText text, IEnumerable<string>? folders, string? filePath) 1156return DocumentInfo.Create( 1171public Solution AddAnalyzerConfigDocuments(ImmutableArray<DocumentInfo> documentInfos)
Workspace\Solution\SolutionCompilationState.cs (7)
623using var _1 = ArrayBuilder<DocumentInfo>.GetInstance(out var addedDocumentInfos); 632void UpdateDocuments<TDocumentState>(IReadOnlyList<DocumentInfo> newDocumentInfos) 642foreach (var newDocumentInfo in newDocumentInfos) 794Func<DocumentInfo.DocumentAttributes, TArg, DocumentInfo.DocumentAttributes> updateAttributes) 1775/// Core helper that takes a set of <see cref="DocumentInfo" />s and does the application of the appropriate documents to each project. 1779ImmutableArray<DocumentInfo> documentInfos)
Workspace\Solution\SolutionState.cs (2)
973Func<DocumentInfo.DocumentAttributes, TArg, DocumentInfo.DocumentAttributes> updateAttributes)
Workspace\Solution\SourceGeneratedDocumentState.cs (3)
115new DocumentInfo.DocumentAttributes( 136DocumentInfo.DocumentAttributes attributes, 162protected override TextDocumentState UpdateAttributes(DocumentInfo.DocumentAttributes newAttributes)
Workspace\Solution\TextDocumentState.cs (5)
20public readonly DocumentInfo.DocumentAttributes Attributes; 30DocumentInfo.DocumentAttributes attributes, 53public TextDocumentState WithDocumentInfo(DocumentInfo info) 58public TextDocumentState WithAttributes(DocumentInfo.DocumentAttributes newAttributes) 67protected abstract TextDocumentState UpdateAttributes(DocumentInfo.DocumentAttributes newAttributes);
Workspace\Solution\TextDocumentStates.cs (2)
75public TextDocumentStates(IEnumerable<DocumentInfo> infos, Func<DocumentInfo, TState> stateConstructor)
Workspace\Workspace.cs (16)
1036protected internal void OnDocumentAdded(DocumentInfo documentInfo) 1046protected internal void OnDocumentsAdded(ImmutableArray<DocumentInfo> documentInfos) 1063protected internal void OnDocumentReloaded(DocumentInfo newDocumentInfo) 1100protected internal void OnDocumentInfoChanged(DocumentId documentId, DocumentInfo newInfo) 1359protected internal void OnAdditionalDocumentAdded(DocumentInfo documentInfo) 1397protected internal void OnAnalyzerConfigDocumentAdded(DocumentInfo documentInfo) 1937var info = CreateDocumentInfoWithoutText(document); 1946var info = CreateDocumentInfoWithoutText(document); 1955var info = CreateDocumentInfoWithoutText(document); 2037private static DocumentInfo CreateDocumentInfoWithText(TextDocument doc) 2040internal static DocumentInfo CreateDocumentInfoWithoutText(TextDocument doc) 2041=> DocumentInfo.Create( 2202protected virtual void ApplyDocumentAdded(DocumentInfo info, SourceText text) 2235protected virtual void ApplyDocumentInfoChanged(DocumentId id, DocumentInfo info) 2246protected virtual void ApplyAdditionalDocumentAdded(DocumentInfo info, SourceText text) 2279protected virtual void ApplyAnalyzerConfigDocumentAdded(DocumentInfo info, SourceText text)
Microsoft.CodeAnalysis.Workspaces.MSBuild (8)
MSBuild\MSBuildProjectLoader.Worker.cs (6)
346private ImmutableArray<DocumentInfo> CreateDocumentInfos(IReadOnlyList<DocumentFileInfo> documentFileInfos, ProjectId projectId, Encoding? encoding) 348var results = new FixedSizeArrayBuilder<DocumentInfo>(documentFileInfos.Count); 354var documentInfo = DocumentInfo.Create( 389private void CheckForDuplicateDocuments(ImmutableArray<DocumentInfo> documents, string? projectFilePath, ProjectId projectId) 392foreach (var doc in documents)
MSBuild\MSBuildWorkspace.cs (2)
458protected override void ApplyDocumentAdded(DocumentInfo info, SourceText text) 479var newDocumentInfo = info.WithName(fileName)