Esempio n. 1
0
        public (ProjectFileInfo projectFileInfo, ImmutableArray <MSBuildDiagnostic> diagnostics) Reload(ProjectLoader loader)
        {
            var(projectInstance, diagnostics) = loader.BuildProject(FilePath);
            if (projectInstance == null)
            {
                return(null, diagnostics);
            }

            var data            = ProjectData.Create(projectInstance);
            var projectFileInfo = new ProjectFileInfo(Id, FilePath, data);

            return(projectFileInfo, diagnostics);
        }
Esempio n. 2
0
        public static (ProjectFileInfo projectFileInfo, ImmutableArray <MSBuildDiagnostic> diagnostics) Load(string filePath, ProjectLoader loader)
        {
            if (!File.Exists(filePath))
            {
                return(null, ImmutableArray <MSBuildDiagnostic> .Empty);
            }

            var(projectInstance, diagnostics) = loader.BuildProject(filePath);
            if (projectInstance == null)
            {
                return(null, diagnostics);
            }

            var id              = ProjectId.CreateNewId(debugName: filePath);
            var data            = ProjectData.Create(projectInstance);
            var projectFileInfo = new ProjectFileInfo(id, filePath, data);

            return(projectFileInfo, diagnostics);
        }