コード例 #1
0
        internal static ProjectFileInfo CreateNoBuild(string filePath, ProjectLoader loader)
        {
            var id      = ProjectId.CreateNewId(debugName: filePath);
            var project = loader.EvaluateProjectFile(filePath);
            var data    = ProjectData.Create(project);

            return(new ProjectFileInfo(id, filePath, data));
        }
コード例 #2
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);
        }
コード例 #3
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);
        }