mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-17 15:46:05 +02:00
Improvements to emit markers on emits only in specialized types
This commit is contained in:
parent
01112c54fe
commit
5271f5e2fd
14 changed files with 342 additions and 68 deletions
|
@ -221,6 +221,12 @@ namespace IDE.Compiler
|
|||
|
||||
class RefreshViewCommand : Command
|
||||
{
|
||||
public ViewRefreshKind mRefreshKind;
|
||||
|
||||
public this(ViewRefreshKind refreshKind)
|
||||
{
|
||||
mRefreshKind = refreshKind;
|
||||
}
|
||||
}
|
||||
|
||||
class SetWorkspaceOptionsCommand : Command
|
||||
|
@ -237,6 +243,7 @@ namespace IDE.Compiler
|
|||
|
||||
public void* mNativeBfCompiler;
|
||||
public bool mIsResolveOnly;
|
||||
public bool mWantsResolveAllCollapseRefresh;
|
||||
public BfSystem mBfSystem;
|
||||
bool mWantsRemoveOldData;
|
||||
public Dictionary<String, String> mRebuildWatchingFiles = new .() ~ delete _;
|
||||
|
@ -392,9 +399,9 @@ namespace IDE.Compiler
|
|||
QueueCommand(command);
|
||||
}
|
||||
|
||||
public void QueueRefreshViewCommand()
|
||||
public void QueueRefreshViewCommand(ViewRefreshKind viewRefreshKind = .FullRefresh)
|
||||
{
|
||||
QueueCommand(new RefreshViewCommand());
|
||||
QueueCommand(new RefreshViewCommand(viewRefreshKind));
|
||||
}
|
||||
|
||||
public void QueueSetWorkspaceOptions(Project hotProject, int32 hotIdx)
|
||||
|
@ -608,8 +615,31 @@ namespace IDE.Compiler
|
|||
|
||||
var resolvePassData = BfResolvePassData.Create(ResolveType.Classify);
|
||||
// If we get canceled then try again after waiting a couple updates
|
||||
if (!ClassifySource(passInstance, resolvePassData))
|
||||
|
||||
bool wantsCollapseRefresh = false;
|
||||
|
||||
if (ClassifySource(passInstance, resolvePassData))
|
||||
{
|
||||
Debug.WriteLine($"ClassifySource success {mWantsResolveAllCollapseRefresh} {resolvePassData.HadEmits}");
|
||||
|
||||
if (mWantsResolveAllCollapseRefresh)
|
||||
{
|
||||
mWantsResolveAllCollapseRefresh = false;
|
||||
wantsCollapseRefresh = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.WriteLine($"ClassifySource partial {resolvePassData.HadEmits}");
|
||||
QueueDeferredResolveAll();
|
||||
}
|
||||
|
||||
if (resolvePassData.HadEmits)
|
||||
wantsCollapseRefresh = true;
|
||||
|
||||
if (wantsCollapseRefresh)
|
||||
QueueRefreshViewCommand(.Collapse);
|
||||
|
||||
UpdateRebuildFileWatches();
|
||||
|
||||
delete resolvePassData;
|
||||
|
@ -632,7 +662,8 @@ namespace IDE.Compiler
|
|||
|
||||
if (command is RefreshViewCommand)
|
||||
{
|
||||
mWantsActiveViewRefresh = true;
|
||||
var refreshViewCommand = (RefreshViewCommand)command;
|
||||
mWantsActiveViewRefresh = Math.Max(mWantsActiveViewRefresh, refreshViewCommand.mRefreshKind);
|
||||
}
|
||||
|
||||
if (var dirChangedCommand = command as RebuildFileChangedCommand)
|
||||
|
|
|
@ -44,12 +44,16 @@ namespace IDE.Compiler
|
|||
[CallingConvention(.Stdcall), CLink]
|
||||
static extern void* BfResolvePassData_GetEmitEmbedData(void* bfResolvePassData, char8* typeName, out int32 srcLength, out int32 revision);
|
||||
|
||||
[CallingConvention(.Stdcall), CLink]
|
||||
static extern bool BfResolvePassData_GetHadEmits(void* bfResolvePassData);
|
||||
|
||||
//
|
||||
|
||||
//[CallingConvention(.Stdcall), CLink]
|
||||
//static extern void* BfParser_CreateResolvePassData(void* bfSystem, int32 resolveType);
|
||||
|
||||
public void* mNativeResolvePassData;
|
||||
public bool HadEmits => BfResolvePassData_GetHadEmits(mNativeResolvePassData);
|
||||
|
||||
public ~this()
|
||||
{
|
||||
|
|
|
@ -13,9 +13,16 @@ namespace IDE.Compiler
|
|||
{
|
||||
public abstract class CompilerBase : CommandQueueManager
|
||||
{
|
||||
public int32 mResolveAllWait;
|
||||
public enum ViewRefreshKind
|
||||
{
|
||||
None,
|
||||
Collapse,
|
||||
FullRefresh
|
||||
}
|
||||
|
||||
public int32 mResolveAllWait;
|
||||
protected List<String> mQueuedOutput = new List<String>() ~ DeleteContainerAndItems!(_);
|
||||
public bool mWantsActiveViewRefresh;
|
||||
public ViewRefreshKind mWantsActiveViewRefresh;
|
||||
|
||||
public volatile int32 mThreadYieldCount = 0; // Whether our thread wants to be yielded to, and for how many ticks
|
||||
|
||||
|
@ -157,10 +164,10 @@ namespace IDE.Compiler
|
|||
{
|
||||
CheckThreadDone();
|
||||
|
||||
if (mWantsActiveViewRefresh)
|
||||
if (mWantsActiveViewRefresh != .None)
|
||||
{
|
||||
IDEApp.sApp.RefreshVisibleViews();
|
||||
mWantsActiveViewRefresh = false;
|
||||
mWantsActiveViewRefresh = .None;
|
||||
}
|
||||
|
||||
if (mThreadYieldCount > 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue