mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-19 00:20:25 +02:00
Initial const eval feature release
This commit is contained in:
parent
be929c3626
commit
ff1f8aff3f
27 changed files with 887 additions and 178 deletions
|
@ -11781,6 +11781,9 @@ namespace IDE
|
|||
bool didClean = false;
|
||||
if (mWantsBeefClean)
|
||||
{
|
||||
mBfBuildCompiler?.CancelBackground();
|
||||
mBfResolveCompiler?.CancelBackground();
|
||||
|
||||
if ((!mBfBuildCompiler.HasQueuedCommands()) &&
|
||||
((mBfResolveCompiler == null) || (!mBfResolveCompiler.HasQueuedCommands())))
|
||||
{
|
||||
|
@ -11857,6 +11860,9 @@ namespace IDE
|
|||
|
||||
if (mWantsClean)
|
||||
{
|
||||
mBfBuildCompiler?.CancelBackground();
|
||||
mBfResolveCompiler?.CancelBackground();
|
||||
|
||||
if ((!mBfBuildCompiler.HasQueuedCommands()) && (!mBfResolveCompiler.HasQueuedCommands())
|
||||
#if IDE_C_SUPPORT
|
||||
&& (!mDepClang.HasQueuedCommands()) && (!mResolveClang.HasQueuedCommands())
|
||||
|
|
|
@ -1027,6 +1027,18 @@ namespace IDE.ui
|
|||
doBackground = true;
|
||||
}
|
||||
|
||||
// If there's a long-running const eval then cancel that first
|
||||
if (!mDeferredResolveResults.IsEmpty)
|
||||
{
|
||||
for (var result in mDeferredResolveResults)
|
||||
{
|
||||
if (result.mResolveType == .ClassifyFullRefresh)
|
||||
{
|
||||
bfCompiler.RequestCancelBackground();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (mIsClang)
|
||||
{
|
||||
#if !IDE_C_SUPPORT
|
||||
|
|
|
@ -26,6 +26,9 @@ namespace IDE.ui
|
|||
public int mDirtyDelay;
|
||||
public int mStatusBoxUpdateCnt = -1;
|
||||
|
||||
public int32 mResolveStuckTicks;
|
||||
public float mResolveLastPct = -1;
|
||||
|
||||
public this()
|
||||
{
|
||||
mConfigComboBox = new DarkComboBox();
|
||||
|
@ -225,8 +228,19 @@ namespace IDE.ui
|
|||
#endif
|
||||
)
|
||||
{
|
||||
float completionPct = gApp.mBfResolveCompiler.GetCompletionPercentage();
|
||||
if (completionPct != mResolveLastPct)
|
||||
{
|
||||
mResolveStuckTicks = 0;
|
||||
mResolveLastPct = completionPct;
|
||||
}
|
||||
else
|
||||
mResolveStuckTicks++;
|
||||
|
||||
MarkDirtyEx();
|
||||
}
|
||||
else
|
||||
mResolveStuckTicks = 0;
|
||||
}
|
||||
|
||||
public override void Draw(Graphics g)
|
||||
|
@ -380,6 +394,10 @@ namespace IDE.ui
|
|||
{
|
||||
DrawStatusBox("Custom Build Commands...", gApp.mBuildContext.mUpdateCnt);
|
||||
}
|
||||
else if (mResolveStuckTicks > 300)
|
||||
{
|
||||
DrawStatusBox("Const Evaluation");
|
||||
}
|
||||
else
|
||||
mStatusBoxUpdateCnt = -1;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue