private SolutionState( BranchId branchId, int workspaceVersion, SolutionServices solutionServices, SolutionInfo solutionInfo, IEnumerable<ProjectId> projectIds, ImmutableDictionary<ProjectId, ProjectState> idToProjectStateMap, ImmutableDictionary<ProjectId, CompilationTracker> projectIdToTrackerMap, ImmutableDictionary<string, ImmutableArray<DocumentId>> linkedFilesMap, ProjectDependencyGraph dependencyGraph, Lazy<VersionStamp> lazyLatestProjectVersion) { _branchId = branchId; _workspaceVersion = workspaceVersion; _solutionServices = solutionServices; _solutionInfo = solutionInfo; _projectIds = projectIds.ToImmutableReadOnlyListOrEmpty(); _projectIdToProjectStateMap = idToProjectStateMap; _projectIdToTrackerMap = projectIdToTrackerMap; _linkedFilesMap = linkedFilesMap; _dependencyGraph = dependencyGraph; _lazyLatestProjectVersion = lazyLatestProjectVersion; // when solution state is changed, we re-calcuate its checksum _lazyChecksums = new AsyncLazy<SolutionStateChecksums>(ComputeChecksumsAsync, cacheResult: true); CheckInvariants(); }
public DocumentAttributes With( DocumentId id = null, string name = null, IEnumerable <string> folders = null, Optional <SourceCodeKind> sourceCodeKind = default, Optional <string> filePath = default, Optional <bool> isGenerated = default) { var newId = id ?? Id; var newName = name ?? Name; var newFolders = folders?.ToImmutableReadOnlyListOrEmpty() ?? Folders; var newSourceCodeKind = sourceCodeKind.HasValue ? sourceCodeKind.Value : SourceCodeKind; var newFilePath = filePath.HasValue ? filePath.Value : FilePath; var newIsGenerated = isGenerated.HasValue ? isGenerated.Value : IsGenerated; if (newId == Id && newName == Name && newFolders == Folders && newSourceCodeKind == SourceCodeKind && newFilePath == FilePath && newIsGenerated == IsGenerated) { return(this); } return(new DocumentAttributes(newId, newName, newFolders, newSourceCodeKind, newFilePath, newIsGenerated)); }
/// <summary> /// Create a new instance of a <see cref="DocumentInfo"/>. /// </summary> private DocumentInfo( DocumentId id, string name, IEnumerable<string> folders, SourceCodeKind sourceCodeKind, TextLoader loader, string filePath, bool isGenerated) { if (id == null) { throw new ArgumentNullException(nameof(id)); } if (name == null) { throw new ArgumentNullException(nameof(name)); } this.Id = id; this.Name = name; this.Folders = folders.ToImmutableReadOnlyListOrEmpty(); this.SourceCodeKind = sourceCodeKind; this.TextLoader = loader; this.FilePath = filePath; this.IsGenerated = isGenerated; }
private SolutionState( BranchId branchId, int workspaceVersion, SolutionServices solutionServices, SolutionId id, string filePath, IEnumerable<ProjectId> projectIds, ImmutableDictionary<ProjectId, ProjectState> idToProjectStateMap, ImmutableDictionary<ProjectId, CompilationTracker> projectIdToTrackerMap, ImmutableDictionary<string, ImmutableArray<DocumentId>> linkedFilesMap, ProjectDependencyGraph dependencyGraph, VersionStamp version, Lazy<VersionStamp> lazyLatestProjectVersion) { _branchId = branchId; _workspaceVersion = workspaceVersion; _id = id; _filePath = filePath; _solutionServices = solutionServices; _projectIds = projectIds.ToImmutableReadOnlyListOrEmpty(); _projectIdToProjectStateMap = idToProjectStateMap; _projectIdToTrackerMap = projectIdToTrackerMap; _linkedFilesMap = linkedFilesMap; _dependencyGraph = dependencyGraph; _version = version; _lazyLatestProjectVersion = lazyLatestProjectVersion; CheckInvariants(); }
private ProjectState( ProjectInfo projectInfo, HostLanguageServices languageServices, SolutionServices solutionServices, IEnumerable<DocumentId> documentIds, IEnumerable<DocumentId> additionalDocumentIds, ImmutableDictionary<DocumentId, DocumentState> documentStates, ImmutableDictionary<DocumentId, TextDocumentState> additionalDocumentStates, AsyncLazy<VersionStamp> lazyLatestDocumentVersion, AsyncLazy<VersionStamp> lazyLatestDocumentTopLevelChangeVersion, ValueSource<ProjectStateChecksums> lazyChecksums) { _projectInfo = projectInfo; _solutionServices = solutionServices; _languageServices = languageServices; _documentIds = documentIds.ToImmutableReadOnlyListOrEmpty(); _additionalDocumentIds = additionalDocumentIds.ToImmutableReadOnlyListOrEmpty(); _documentStates = documentStates; _additionalDocumentStates = additionalDocumentStates; _lazyLatestDocumentVersion = lazyLatestDocumentVersion; _lazyLatestDocumentTopLevelChangeVersion = lazyLatestDocumentTopLevelChangeVersion; // for now, let it re-calculate if anything changed. // TODO: optimize this so that we only re-calcuate checksums that are actually changed _lazyChecksums = new AsyncLazy<ProjectStateChecksums>(ComputeChecksumsAsync, cacheResult: true); }
private SolutionInfo( SolutionId id, VersionStamp version, string filePath, IEnumerable<ProjectInfo> projects) { this.Id = id; this.Version = version; this.FilePath = filePath; this.Projects = projects.ToImmutableReadOnlyListOrEmpty(); }
public ProjectFileInfo( string outputPath, string assemblyName, IEnumerable<string> commandLineArgs, IEnumerable<DocumentFileInfo> documents, IEnumerable<DocumentFileInfo> additionalDocuments, IEnumerable<ProjectFileReference> projectReferences) { this.OutputFilePath = outputPath; this.AssemblyName = assemblyName; this.CommandLineArgs = commandLineArgs.ToImmutableArrayOrEmpty(); this.Documents = documents.ToImmutableReadOnlyListOrEmpty(); this.AdditionalDocuments = additionalDocuments.ToImmutableArrayOrEmpty(); this.ProjectReferences = projectReferences.ToImmutableReadOnlyListOrEmpty(); }
private ProjectState( ProjectInfo projectInfo, HostLanguageServices languageServices, SolutionServices solutionServices, IEnumerable<DocumentId> documentIds, ImmutableDictionary<DocumentId, DocumentState> documentStates, AsyncLazy<VersionStamp> lazyLatestDocumentVersion, AsyncLazy<VersionStamp> lazyLatestDocumentTopLevelChangeVersion) { this.projectInfo = projectInfo; this.solutionServices = solutionServices; this.languageServices = languageServices; this.documentIds = documentIds.ToImmutableReadOnlyListOrEmpty(); this.documentStates = documentStates; this.lazyLatestDocumentVersion = lazyLatestDocumentVersion; this.lazyLatestDocumentTopLevelChangeVersion = lazyLatestDocumentTopLevelChangeVersion; }
public ProjectFileInfo( Guid guid, string outputPath, string assemblyName, CompilationOptions compilationOptions, ParseOptions parseOptions, IEnumerable<DocumentFileInfo> documents, IEnumerable<ProjectFileReference> projectReferences, IEnumerable<MetadataReference> metadataReferences, IEnumerable<AnalyzerReference> analyzerReferences) { this.Guid = guid; this.OutputFilePath = outputPath; this.AssemblyName = assemblyName; this.CompilationOptions = compilationOptions; this.ParseOptions = parseOptions; this.Documents = documents.ToImmutableReadOnlyListOrEmpty(); this.ProjectReferences = projectReferences.ToImmutableReadOnlyListOrEmpty(); this.MetadataReferences = metadataReferences.ToImmutableReadOnlyListOrEmpty(); this.AnalyzerReferences = analyzerReferences.ToImmutableReadOnlyListOrEmpty(); }
private ProjectState( ProjectInfo projectInfo, HostLanguageServices languageServices, SolutionServices solutionServices, IEnumerable<DocumentId> documentIds, IEnumerable<DocumentId> additionalDocumentIds, ImmutableDictionary<DocumentId, DocumentState> documentStates, ImmutableDictionary<DocumentId, TextDocumentState> additionalDocumentStates, AsyncLazy<VersionStamp> lazyLatestDocumentVersion, AsyncLazy<VersionStamp> lazyLatestDocumentTopLevelChangeVersion) { _projectInfo = projectInfo; _solutionServices = solutionServices; _languageServices = languageServices; _documentIds = documentIds.ToImmutableReadOnlyListOrEmpty(); _additionalDocumentIds = additionalDocumentIds.ToImmutableReadOnlyListOrEmpty(); _documentStates = documentStates; _additionalDocumentStates = additionalDocumentStates; _lazyLatestDocumentVersion = lazyLatestDocumentVersion; _lazyLatestDocumentTopLevelChangeVersion = lazyLatestDocumentTopLevelChangeVersion; _lazyChecksums = new AsyncLazy<ProjectStateChecksums>(ComputeChecksumsAsync, cacheResult: true); }
public ProjectInfo WithAnalyzerReferences(IEnumerable<AnalyzerReference> analyzerReferences) { return With(analyzerReferences: analyzerReferences.ToImmutableReadOnlyListOrEmpty()); }
public ProjectInfo WithAdditionalDocuments(IEnumerable<DocumentInfo> additionalDocuments) { return With(additionalDocuments: additionalDocuments.ToImmutableReadOnlyListOrEmpty()); }
private ProjectInfo( ProjectId id, VersionStamp version, string name, string assemblyName, string language, string filePath, string outputFilePath, CompilationOptions compilationOptions, ParseOptions parseOptions, IEnumerable<DocumentInfo> documents, IEnumerable<ProjectReference> projectReferences, IEnumerable<MetadataReference> metadataReferences, IEnumerable<AnalyzerReference> analyzerReferences, bool isSubmission, Type hostObjectType) { if (id == null) { throw new ArgumentNullException("id"); } if (name == null) { throw new ArgumentNullException("displayName"); } if (assemblyName == null) { throw new ArgumentNullException("assemblyName"); } if (language == null) { throw new ArgumentNullException("language"); } this.Id = id; this.Version = version; this.Name = name; this.AssemblyName = assemblyName; this.Language = language; this.FilePath = filePath; this.OutputFilePath = outputFilePath; this.CompilationOptions = compilationOptions; this.ParseOptions = parseOptions; this.Documents = documents.ToImmutableReadOnlyListOrEmpty(); this.ProjectReferences = projectReferences.ToImmutableReadOnlyListOrEmpty(); this.MetadataReferences = metadataReferences.ToImmutableReadOnlyListOrEmpty(); this.AnalyzerReferences = analyzerReferences.ToImmutableReadOnlyListOrEmpty(); this.IsSubmission = isSubmission; this.HostObjectType = hostObjectType; }
private SolutionInfo(SolutionAttributes attributes, IEnumerable <ProjectInfo> projects) { Attributes = attributes; Projects = projects.ToImmutableReadOnlyListOrEmpty(); }
public ProjectInfo WithAnalyzerReferences(IEnumerable <AnalyzerReference> analyzerReferences) { return(this.With(analyzerReferences: analyzerReferences.ToImmutableReadOnlyListOrEmpty())); }
public ProjectInfo WithProjectReferences(IEnumerable <ProjectReference> projectReferences) { return(With(projectReferences: projectReferences.ToImmutableReadOnlyListOrEmpty())); }
public ProjectInfo WithProjectReferences(IEnumerable<ProjectReference> projectReferences) { return With(projectReferences: projectReferences.ToImmutableReadOnlyListOrEmpty()); }
private SolutionInfo(SolutionAttributes attributes, IEnumerable<ProjectInfo> projects) { Attributes = attributes; Projects = projects.ToImmutableReadOnlyListOrEmpty(); }
public ProjectInfo WithDocuments(IEnumerable <DocumentInfo> documents) { return(With(documents: documents.ToImmutableReadOnlyListOrEmpty())); }
public DocumentInfo WithFolders(IEnumerable <string> folders) { return(this.With(folders: folders.ToImmutableReadOnlyListOrEmpty())); }
public ProjectInfo WithAdditionalDocuments(IEnumerable <DocumentInfo> additionalDocuments) { return(With(additionalDocuments: additionalDocuments.ToImmutableReadOnlyListOrEmpty())); }
public ProjectInfo WithAnalyzerConfigDocuments(IEnumerable <DocumentInfo> analyzerConfigDocuments) { return(With(analyzerConfigDocuments: analyzerConfigDocuments.ToImmutableReadOnlyListOrEmpty())); }
public ProjectInfo WithDocuments(IEnumerable<DocumentInfo> documents) { return With(documents: documents.ToImmutableReadOnlyListOrEmpty()); }
public DocumentAttributes( DocumentId id, string name, IEnumerable<string> folders, SourceCodeKind sourceCodeKind, string filePath, bool isGenerated) { if (id == null) { throw new ArgumentNullException(nameof(id)); } if (name == null) { throw new ArgumentNullException(nameof(name)); } Id = id; Name = name; Folders = folders.ToImmutableReadOnlyListOrEmpty(); SourceCodeKind = sourceCodeKind; FilePath = filePath; IsGenerated = isGenerated; }
public ProjectInfo WithMetadataReferences(IEnumerable<MetadataReference> metadataReferences) { return With(metadataReferences: metadataReferences.ToImmutableReadOnlyListOrEmpty()); }
public DocumentInfo WithFolders(IEnumerable<string> folders) { return this.With(folders: folders.ToImmutableReadOnlyListOrEmpty()); }
private ProjectInfo( ProjectAttributes attributes, CompilationOptions compilationOptions, ParseOptions parseOptions, IEnumerable<DocumentInfo> documents, IEnumerable<ProjectReference> projectReferences, IEnumerable<MetadataReference> metadataReferences, IEnumerable<AnalyzerReference> analyzerReferences, IEnumerable<DocumentInfo> additionalDocuments, Type hostObjectType) { Attributes = attributes; CompilationOptions = compilationOptions; ParseOptions = parseOptions; Documents = documents.ToImmutableReadOnlyListOrEmpty(); ProjectReferences = projectReferences.ToImmutableReadOnlyListOrEmpty(); MetadataReferences = metadataReferences.ToImmutableReadOnlyListOrEmpty(); AnalyzerReferences = analyzerReferences.ToImmutableReadOnlyListOrEmpty(); AdditionalDocuments = additionalDocuments.ToImmutableReadOnlyListOrEmpty(); HostObjectType = hostObjectType; }
public ProjectInfo WithMetadataReferences(IEnumerable <MetadataReference> metadataReferences) { return(With(metadataReferences: metadataReferences.ToImmutableReadOnlyListOrEmpty())); }