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