1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-15 06:44:10 +02:00

Work on deferred projects

This commit is contained in:
Brian Fiete 2021-03-02 06:29:53 -08:00
parent 97d9a4508d
commit 8393f7abde
3 changed files with 21 additions and 4 deletions

View file

@ -2456,6 +2456,8 @@ namespace IDE
void FlushDeferredLoadProjects(bool addToUI = false) void FlushDeferredLoadProjects(bool addToUI = false)
{ {
bool hasDeferredProjects = false;
while (true) while (true)
{ {
bool hadLoad = false; bool hadLoad = false;
@ -2469,6 +2471,7 @@ namespace IDE
var projectPath = project.mProjectPath; var projectPath = project.mProjectPath;
if (project.mDeferState == .Pending) if (project.mDeferState == .Pending)
{ {
hasDeferredProjects = true;
project.mDeferState = .Searching; project.mDeferState = .Searching;
} }
else if (!project.Load(projectPath)) else if (!project.Load(projectPath))
@ -2486,6 +2489,11 @@ namespace IDE
if (!hadLoad) if (!hadLoad)
break; break;
} }
if (hasDeferredProjects)
mWorkspace.mProjectLoadState = .Preparing;
else
mWorkspace.mProjectLoadState = .Loaded;
} }
protected void LoadWorkspace(BeefVerb verb) protected void LoadWorkspace(BeefVerb verb)
@ -4115,9 +4123,14 @@ namespace IDE
void Compile() void Compile()
{ {
CompilerLog("IDEApp.Compile"); CompilerLog("IDEApp.Compile");
for (let project in gApp.mWorkspace.mProjects) for (let project in gApp.mWorkspace.mProjects)
{ {
if (project.mDeferState != .None)
{
OutputErrorLine($"Project '{project.mProjectName}' is still loading.");
return;
}
if (project.mFailed) if (project.mFailed)
{ {
OutputErrorLine("Project '{}' is not loaded. Retry loading by right clicking on the project in the Workspace panel and selecting 'Retry Load'", project.mProjectName); OutputErrorLine("Project '{}' is not loaded. Retry loading by right clicking on the project in the Workspace panel and selecting 'Retry Load'", project.mProjectName);
@ -8292,7 +8305,7 @@ namespace IDE
DeleteAndNullify!(scriptCmd.mCmd); DeleteAndNullify!(scriptCmd.mCmd);
} }
if (mBuildContext.mScriptManager.HasQueuedCommands) if ((mBuildContext.mScriptManager.HasQueuedCommands) && (!mBuildContext.mScriptManager.mFailed))
return; return;
} }
} }

View file

@ -506,7 +506,7 @@ namespace IDE.ui
if ((projectSource != null) && (gApp.IsProjectSourceEnabled(projectSource))) if ((projectSource != null) && (gApp.IsProjectSourceEnabled(projectSource)))
{ {
var resolveCompiler = gApp.GetProjectCompilerForFile(projectSource.mName); var resolveCompiler = gApp.GetProjectCompilerForFile(projectSource.mName);
if (resolveCompiler != null) if ((resolveCompiler != null) && (gApp.mWorkspace.mProjectLoadState == .Loaded))
{ {
resolveCompiler.QueueProjectSource(projectSource, .None, false); resolveCompiler.QueueProjectSource(projectSource, .None, false);
resolveCompiler.QueueDeferredResolveAll(); resolveCompiler.QueueDeferredResolveAll();
@ -2227,6 +2227,8 @@ namespace IDE.ui
//handled = true; //handled = true;
isFailedLoad = true; isFailedLoad = true;
} }
else if (project.mDeferState != .None)
isFailedLoad = true;
} }
} }
} }
@ -2456,7 +2458,6 @@ namespace IDE.ui
menu.AddItem(); menu.AddItem();
} }
//menu.AddItem();
if (!isFailedLoad) if (!isFailedLoad)
{ {
item = menu.AddItem("New Folder"); item = menu.AddItem("New Folder");

View file

@ -1176,6 +1176,9 @@ namespace IDE.ui
resolveParams.mParser = bfSystem.FindParser(projectSource); resolveParams.mParser = bfSystem.FindParser(projectSource);
//if (mCurParser != null) //if (mCurParser != null)
{ {
if (gApp.mWorkspace.mProjectLoadState != .Loaded)
return false;
if (!isHi) if (!isHi)
Debug.Assert(!mIsPerformingBackgroundClassify); Debug.Assert(!mIsPerformingBackgroundClassify);