mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-14 22:34:09 +02:00
Fixed some errors panel issues
This commit is contained in:
parent
7fa004db4b
commit
b068aa8d29
7 changed files with 103 additions and 65 deletions
|
@ -11586,7 +11586,7 @@ namespace IDE
|
|||
if ((mBuildContext == null) && (!IsCompiling))
|
||||
DeleteAndNullify!(mLaunchData);
|
||||
|
||||
mErrorsPanel?.CheckResolveAll();
|
||||
mErrorsPanel?.UpdateAlways();
|
||||
}
|
||||
|
||||
public void ShowPassOutput(BfPassInstance bfPassInstance)
|
||||
|
|
|
@ -288,6 +288,11 @@ namespace IDE
|
|||
{
|
||||
return IDEApp.IsBeefFile(mPath);
|
||||
}
|
||||
}
|
||||
|
||||
public this()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public ~this()
|
||||
|
|
|
@ -969,8 +969,9 @@ namespace IDE
|
|||
/*if (gApp.AreTestsRunning())
|
||||
checkRunState = false;*/
|
||||
|
||||
if (checkRunState)
|
||||
{
|
||||
if (!checkRunState)
|
||||
return true;
|
||||
|
||||
var runState = gApp.mDebugger.GetRunState();
|
||||
if (runState == .Terminating)
|
||||
{
|
||||
|
@ -1010,9 +1011,6 @@ namespace IDE
|
|||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
[IDECommand]
|
||||
public void WaitForPaused()
|
||||
{
|
||||
|
|
|
@ -47,7 +47,9 @@ namespace IDE.ui
|
|||
public ErrorsListView mErrorLV;
|
||||
|
||||
public bool mNeedsResolveAll;
|
||||
public bool mErrorsDirty;
|
||||
public int mDataId;
|
||||
public int mErrorListId;
|
||||
public int mErrorRefreshId;
|
||||
public Monitor mMonitor = new .() ~ delete _;
|
||||
public Dictionary<String, List<BfPassInstance.BfError>> mParseErrors = new .() ~ delete _;
|
||||
public List<BfPassInstance.BfError> mResolveErrors = new .() ~ DeleteContainerAndItems!(_);
|
||||
|
@ -121,7 +123,7 @@ namespace IDE.ui
|
|||
if (passKind != .Parse)
|
||||
{
|
||||
if (!mResolveErrors.IsEmpty)
|
||||
mErrorsDirty = true;
|
||||
mDataId++;
|
||||
|
||||
for (let error in mResolveErrors)
|
||||
{
|
||||
|
@ -170,7 +172,7 @@ namespace IDE.ui
|
|||
else
|
||||
mResolveErrors.Add(bfError);
|
||||
|
||||
mErrorsDirty = true;
|
||||
mDataId++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -198,7 +200,7 @@ namespace IDE.ui
|
|||
{
|
||||
delete kv.key;
|
||||
DeleteErrorList(kv.value);
|
||||
mErrorsDirty = true;
|
||||
mDataId++;
|
||||
}
|
||||
mParseErrors.Clear();
|
||||
}
|
||||
|
@ -208,7 +210,7 @@ namespace IDE.ui
|
|||
{
|
||||
delete key;
|
||||
DeleteErrorList(list);
|
||||
mErrorsDirty = true;
|
||||
mDataId++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -220,7 +222,7 @@ namespace IDE.ui
|
|||
{
|
||||
ClearParserErrors(null);
|
||||
ClearAndDeleteItems(mResolveErrors);
|
||||
mErrorsDirty = true;
|
||||
mDataId++;
|
||||
mErrorCount = 0;
|
||||
mWarningCount = 0;
|
||||
}
|
||||
|
@ -230,7 +232,7 @@ namespace IDE.ui
|
|||
{
|
||||
using (mMonitor.Enter())
|
||||
{
|
||||
if (mErrorsDirty)
|
||||
if (mDataId != mErrorListId)
|
||||
{
|
||||
let root = mErrorLV.GetRoot();
|
||||
|
||||
|
@ -315,13 +317,20 @@ namespace IDE.ui
|
|||
while (root.GetChildCount() > idx)
|
||||
root.RemoveChildItemAt(root.GetChildCount() - 1);
|
||||
|
||||
mErrorsDirty = false;
|
||||
mErrorListId = mDataId;
|
||||
MarkDirty();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void CheckResolveAll()
|
||||
public void UpdateAlways()
|
||||
{
|
||||
if (mErrorRefreshId != mDataId)
|
||||
{
|
||||
gApp.MarkDirty();
|
||||
mErrorRefreshId = mDataId;
|
||||
}
|
||||
|
||||
let compiler = gApp.mBfResolveCompiler;
|
||||
if ((mNeedsResolveAll) && (!compiler.IsPerformingBackgroundOperation()))
|
||||
{
|
||||
|
|
|
@ -161,6 +161,9 @@ namespace IDE.ui
|
|||
{
|
||||
String path = scope .();
|
||||
mDirectoryEdit.GetText(path);
|
||||
path.Trim();
|
||||
if ((path.EndsWith('\\')) || (path.EndsWith('/')))
|
||||
path.RemoveFromEnd(1);
|
||||
|
||||
String projName = scope .();
|
||||
Path.GetFileName(path, projName);
|
||||
|
|
|
@ -1103,7 +1103,7 @@ namespace IDE.ui
|
|||
app.RemoveProject(project);
|
||||
}
|
||||
|
||||
void ProjectItemUnregister(ProjectItem projectItem)
|
||||
void ProjectItemUnregister(ProjectItem projectItem, bool isDeleting)
|
||||
{
|
||||
var projectSource = projectItem as ProjectSource;
|
||||
if (projectSource != null)
|
||||
|
@ -1136,14 +1136,20 @@ namespace IDE.ui
|
|||
var sourceViewPanel = tab.mContent as SourceViewPanel;
|
||||
if ((sourceViewPanel != null) && (sourceViewPanel.mProjectSource == projectSource))
|
||||
{
|
||||
if (isDeleting)
|
||||
sourceViewPanel.DetachFromProjectItem();
|
||||
else
|
||||
sourceViewPanel.QueueFullRefresh(true);
|
||||
}
|
||||
});
|
||||
|
||||
if (isProjectEnabled)
|
||||
{
|
||||
if (isDeleting)
|
||||
{
|
||||
gApp.mBfResolveHelper.ProjectSourceRemoved(projectSource);
|
||||
gApp.mWorkspace.ProjectSourceRemoved(projectSource);
|
||||
}
|
||||
gApp.RefreshVisibleViews();
|
||||
}
|
||||
}
|
||||
|
@ -1192,7 +1198,7 @@ namespace IDE.ui
|
|||
if (projectItem == null)
|
||||
return;
|
||||
|
||||
ProjectItemUnregister(projectItem);
|
||||
ProjectItemUnregister(projectItem, forceRemove);
|
||||
|
||||
bool doReleaseRef = false;
|
||||
bool didRemove = false;
|
||||
|
@ -1227,16 +1233,31 @@ namespace IDE.ui
|
|||
}
|
||||
else
|
||||
{
|
||||
/*if (projectItem.mParentFolder.mIncludeKind == .Ignore)
|
||||
projectItem.mIncludeKind = .Auto;
|
||||
else
|
||||
projectItem.mIncludeKind = .Ignore;*/
|
||||
// Mark item as ignored - note, this was removed at some point. Why? Did this trigger some bug?
|
||||
ProjectItem.IncludeKind includeKind = .Ignore;
|
||||
if (projectItem.mParentFolder.mIncludeKind == .Ignore)
|
||||
includeKind = .Auto;
|
||||
|
||||
if (projectItem.mIncludeKind != includeKind)
|
||||
{
|
||||
projectItem.mIncludeKind = includeKind;
|
||||
projectItem.mProject.SetChanged();
|
||||
}
|
||||
|
||||
if (let projectSource = projectItem as ProjectSource)
|
||||
{
|
||||
String path = scope .();
|
||||
projectSource.GetFullImportPath(path);
|
||||
gApp.mErrorsPanel.ClearParserErrors(path);
|
||||
}
|
||||
}
|
||||
|
||||
if ((didRemove) || (!mShowIgnored))
|
||||
{
|
||||
listItem.mParentItem.RemoveChildItem(listItem);
|
||||
using (gApp.mMonitor.Enter())
|
||||
projectItem.Dispose();
|
||||
}
|
||||
|
||||
if (doReleaseRef)
|
||||
projectItem.ReleaseRef();
|
||||
|
|
|
@ -577,7 +577,8 @@ namespace IDE.ui
|
|||
{
|
||||
if (mProjectSource == null)
|
||||
return null;
|
||||
|
||||
if (mProjectSource.IsIgnored())
|
||||
return null;
|
||||
if (!gApp.IsProjectSourceEnabled(mProjectSource))
|
||||
return null;
|
||||
|
||||
|
@ -1831,6 +1832,7 @@ namespace IDE.ui
|
|||
((resolveType == .Classify) || (resolveType == .ClassifyFullRefresh)))
|
||||
{
|
||||
gApp.mErrorsPanel.ClearParserErrors(mFilePath);
|
||||
if (!isFastClassify)
|
||||
gApp.mErrorsPanel.ProcessPassInstance(passInstance, .Parse);
|
||||
}
|
||||
|
||||
|
@ -1910,7 +1912,7 @@ namespace IDE.ui
|
|||
{
|
||||
//bool isAutocomplete = (resolveType == ResolveType.Autocomplete) || (resolveType == ResolveType.Autocomplete_HighPri);
|
||||
//if (isAutocomplete)
|
||||
if ((!isBackground) && (resolveType == ResolveType.Autocomplete))
|
||||
if ((!isFastClassify) && (!isBackground) && (resolveType == ResolveType.Autocomplete))
|
||||
InjectErrors(passInstance, mEditWidget.mEditWidgetContent.mData.mText, mEditWidget.mEditWidgetContent.mData.mTextIdData.GetPrepared(), true);
|
||||
//IDEApp.sApp.ShowPassOutput(passInstance);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue