diff --git a/IDE/src/ui/ErrorsPanel.bf b/IDE/src/ui/ErrorsPanel.bf index f64e2724..be5f5fbb 100644 --- a/IDE/src/ui/ErrorsPanel.bf +++ b/IDE/src/ui/ErrorsPanel.bf @@ -136,17 +136,15 @@ namespace IDE.ui ClearAndDeleteItems(mResolveErrors); mResolveErrors.Capacity = mResolveErrors.Count; } - + var bfl = scope:: List(); for (int32 errorIdx = 0; errorIdx < errorCount; errorIdx++) { BfPassInstance.BfError bfError = new BfPassInstance.BfError(); passInstance.GetErrorData(errorIdx, bfError, true); + if (bfError.mFilePath == null) + bfError.mFilePath = new String(""); //for sort below - if (bfError.mIsWarning) - mWarningCount++; - else - mErrorCount++; - + bfl.Add(bfError); for (int32 moreInfoIdx < bfError.mMoreInfoCount) { BfPassInstance.BfError moreInfo = new BfPassInstance.BfError(); @@ -155,12 +153,26 @@ namespace IDE.ui bfError.mMoreInfo = new List(); bfError.mMoreInfo.Add(moreInfo); } + } + + function int(int lhs, int rhs) ascLambda = (lhs, rhs) => lhs <=> rhs; + bfl.Sort(scope (lhs, rhs) => ascLambda(lhs.mFilePath.GetHashCode()+lhs.mSrcStart, rhs.mFilePath.GetHashCode()+rhs.mSrcStart)); + + for (int32 errorIdx = 0; errorIdx < bfl.Count; errorIdx++) + { + var bfError = bfl[errorIdx]; + + if (bfError.mIsWarning) + { + mWarningCount++; + } + else + mErrorCount++; if (passKind == .Parse) { if (bfError.mFilePath == null) bfError.mFilePath = new String(""); - bool added = mParseErrors.TryAdd(bfError.mFilePath, var keyPtr, var valuePtr); if (added) { @@ -170,7 +182,7 @@ namespace IDE.ui (*valuePtr).Add(bfError); } else - mResolveErrors.Add(bfError); + mResolveErrors.Add(bfError); mDataId++; } @@ -354,7 +366,7 @@ namespace IDE.ui public override void Update() { base.Update(); - + if (!mVisible) { // Very dirty @@ -369,7 +381,8 @@ namespace IDE.ui else mDirtyTicks++; - ProcessErrors(); + if(mDirtyTicks==0) + ProcessErrors(); } public void SetNeedsResolveAll() @@ -379,7 +392,8 @@ namespace IDE.ui public void ShowErrorNext() { - ProcessErrors(); + if(mDirtyTicks==0) + ProcessErrors(); bool foundFocused = false; let root = mErrorLV.GetRoot();