1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 12:32:20 +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)
{
bool hasDeferredProjects = false;
while (true)
{
bool hadLoad = false;
@ -2469,6 +2471,7 @@ namespace IDE
var projectPath = project.mProjectPath;
if (project.mDeferState == .Pending)
{
hasDeferredProjects = true;
project.mDeferState = .Searching;
}
else if (!project.Load(projectPath))
@ -2486,6 +2489,11 @@ namespace IDE
if (!hadLoad)
break;
}
if (hasDeferredProjects)
mWorkspace.mProjectLoadState = .Preparing;
else
mWorkspace.mProjectLoadState = .Loaded;
}
protected void LoadWorkspace(BeefVerb verb)
@ -4115,9 +4123,14 @@ namespace IDE
void Compile()
{
CompilerLog("IDEApp.Compile");
for (let project in gApp.mWorkspace.mProjects)
{
if (project.mDeferState != .None)
{
OutputErrorLine($"Project '{project.mProjectName}' is still loading.");
return;
}
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);
@ -8292,7 +8305,7 @@ namespace IDE
DeleteAndNullify!(scriptCmd.mCmd);
}
if (mBuildContext.mScriptManager.HasQueuedCommands)
if ((mBuildContext.mScriptManager.HasQueuedCommands) && (!mBuildContext.mScriptManager.mFailed))
return;
}
}

View file

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

View file

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