1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-29 21:05:59 +02:00

Lost changes

This commit is contained in:
Brian Fiete 2021-02-25 10:14:22 -08:00
parent e6c4a95ccd
commit 8e9d7ed4c4
56 changed files with 1579 additions and 794 deletions

View file

@ -876,16 +876,22 @@ namespace IDE.ui
{
base.Update();
if (gApp.mBfResolveCompiler == null)
return;
var focusedItem = (ClassViewListViewItem)mTypeLV.GetRoot().FindFocusedItem();
var focusedStr = scope String();
if (focusedItem != null)
GetName(focusedItem, focusedStr);
int32 compileRevision = gApp.mBfResolveCompiler.GetCompileRevision();
if (mLastCompileRevision != compileRevision)
if (gApp.mBfResolveCompiler != null)
{
mCompileRevisionDirtyDelay = 30;
mLastCompileRevision = compileRevision;
int32 compileRevision = gApp.mBfResolveCompiler.GetCompileRevision();
if (mLastCompileRevision != compileRevision)
{
mCompileRevisionDirtyDelay = 30;
mLastCompileRevision = compileRevision;
}
}
if ((mCompileRevisionDirtyDelay > 0) && (--mCompileRevisionDirtyDelay == 0))

View file

@ -266,7 +266,7 @@ namespace IDE.ui
IdSpan liveCharIdData;
String liveText = scope:: String();
app.FindProjectSourceContent(projectSource, out liveCharIdData, true, liveText, null);
defer(stack) liveCharIdData.Dispose();
defer:: liveCharIdData.Dispose();
var compileInstance = IDEApp.sApp.mWorkspace.GetProjectSourceCompileInstance(projectSource, mHotIdx);
if (compileInstance == null)

View file

@ -276,7 +276,15 @@ namespace IDE.ui
SetLabel(item, codeStr);
let descItem = item.GetSubItem(1);
String errStr = scope String(32)..Append(error.mError);
String errStr = scope String(32);
int maxLen = 4*1024;
if (error.mError.Length > maxLen)
{
errStr.Append(error.mError.Substring(0, maxLen));
errStr.Append("...");
}
else
errStr.Append(error.mError);
errStr.Replace('\n', ' ');
SetLabel(descItem, errStr);

View file

@ -718,6 +718,14 @@ namespace IDE.ui
var watch = useListViewItem.mWatchEntry;
String.NewOrSet!(watch.mName, displayString);
String.NewOrSet!(watch.mEvalStr, evalString);
if (watch.mEvalStr.StartsWith("!raw"))
{
for (int i < 4)
watch.mEvalStr[i] = ' ';
watch.mResultType = .RawText;
}
useListViewItem.mWatchEntry = watch;
if (!isLiteral)
useListViewItem.Label = displayString;
@ -730,7 +738,7 @@ namespace IDE.ui
String val = scope String();
if (evalString.StartsWith(":", StringComparison.Ordinal))
{
var showString = scope String(evalString, 1);
var showString = scope String(4096)..Append(evalString, 1);
bool isShowingDoc = showString.Contains('\x01');
if (!isShowingDoc)
{
@ -759,11 +767,13 @@ namespace IDE.ui
flags |= .AllowSideEffects | .AllowCalls;
if (gApp.mSettings.mDebuggerSettings.mAutoEvaluateProperties)
flags |= .AllowProperties;
if (watch.mResultType == .RawText)
flags |= .RawStr;
DebugManager.Language language = mLanguage;
if (parentWatchEntry != null)
language = parentWatchEntry.mLanguage;
gApp.DebugEvaluate(null, evalString, val, -1, language, flags);
gApp.DebugEvaluate(null, watch.mEvalStr, val, -1, language, flags);
}
if (val == "!pending")
{
@ -773,6 +783,13 @@ namespace IDE.ui
}
watch.mIsPending = false;
}
if (watch.mResultType == .RawText)
{
String.NewOrSet!(valueSubItem.mLabel, val);
return useListViewItem;
}
var vals = scope List<StringView>(val.Split('\n'));
//if (!vals[0].IsEmpty)

View file

@ -7,6 +7,7 @@ using Beefy.theme.dark;
using Beefy.gfx;
using System.Diagnostics;
using System.IO;
using IDE.Debugger;
namespace IDE.ui
{
@ -379,7 +380,11 @@ namespace IDE.ui
var subItemLabel = result.GetSubItem(1).mLabel;
if (subItemLabel == null)
subItemLabel = "";
mEditWidgetContent.AppendText(scope String(" ", subItemLabel, "\n"));
if (result.mWatchEntry.mResultType == .RawText)
mEditWidgetContent.AppendText(scope String(subItemLabel, "\n"));
else
mEditWidgetContent.AppendText(scope String(" ", subItemLabel, "\n"));
if (result.mWatchEntry.mWarnings != null)
{
@ -415,7 +420,11 @@ namespace IDE.ui
for (int32 i = startPos; i < mEditWidgetContent.mData.mTextLength; i++)
mEditWidgetContent.mData.mText[i].mDisplayTypeId = (uint8)SourceElementType.Error;
}
else
else if (result.mWatchEntry.mResultType == .RawText)
{
// No info button
}
else
{
mInfoButton.Resize(resultX - GS!(3), resultY - GS!(2), GS!(20), GS!(20));
mEditWidgetContent.AddWidget(mInfoButton);
@ -547,7 +556,16 @@ namespace IDE.ui
}
else
{
gApp.DebugEvaluate(null, cmdText, val, mEditWidgetContent.CursorTextPos - mEntryStartPos.mIndex - 2);
DebugManager.EvalExpressionFlags flags = .None;
if (cmdText.StartsWith("!raw"))
{
for (int i < 4)
cmdText[i] = ' ';
flags |= .RawStr;
}
gApp.DebugEvaluate(null, cmdText, val, mEditWidgetContent.CursorTextPos - mEntryStartPos.mIndex - 2, .NotSet, flags);
gApp.mIsImmediateDebugExprEval = true;
}
}
@ -570,7 +588,19 @@ namespace IDE.ui
}
var info = scope String()..Append(val, idx + ":autocomplete\n".Length);
if (!editWidgetContent.mAutoComplete.mIsDocumentationPass)
{
if ((cmdText.StartsWith("!")) && (!cmdText.Contains(' ')))
{
if ("!raw".Contains(cmdText))
info.Append("cmd\traw\n");
if ("!info".Contains(cmdText))
info.Append("cmd\tinfo\n");
if ("!step".Contains(cmdText))
info.Append("cmd\tstep\n");
}
editWidgetContent.mAutoComplete.SetInfo(info, true, mEntryStartPos.mIndex + 1);
}
}
else if (editWidgetContent.mAutoComplete != null)
editWidgetContent.mAutoComplete.Close();

View file

@ -284,26 +284,20 @@ namespace IDE.ui
s.AppendF("0x{:A}", (uint64)lockRange.mBaseOffset);
case RepType.Int8:
hasAltS = true;
(*(int8*)lockRange.mData.CArray()).ToString(s, (altIntBase == 10) ? "" : "X2", null);
if (altIntBase == 10)
((UInt64)*(uint8*)lockRange.mData.CArray()).ToString(altS, "", null);
(*(int8*)lockRange.mData.CArray()).ToString(s, (intBase == 10) ? "" : "X2", null);
((UInt64)*(uint8*)lockRange.mData.CArray()).ToString(altS, (altIntBase == 10) ? "" : "X2", null);
case RepType.Int16:
hasAltS = true;
(*(int16*)lockRange.mData.CArray()).ToString(s, (altIntBase == 10) ? "" : "X4", null);
if (altIntBase == 10)
((UInt64)*(uint16*)lockRange.mData.CArray()).ToString(altS, "", null);
(*(int16*)lockRange.mData.CArray()).ToString(s, (intBase == 10) ? "" : "X4", null);
((UInt64)*(uint16*)lockRange.mData.CArray()).ToString(altS, (altIntBase == 10) ? "" : "X4", null);
case RepType.Int32:
hasAltS = true;
(*(int32*)lockRange.mData.CArray()).ToString(s, (altIntBase == 10) ? "" : "X8", null);
if (altIntBase == 10)
((UInt64)*(uint32*)lockRange.mData.CArray()).ToString(altS, "", null);
(*(int32*)lockRange.mData.CArray()).ToString(s, (intBase == 10) ? "" : "X8", null);
((UInt64)*(uint32*)lockRange.mData.CArray()).ToString(altS, (altIntBase == 10) ? "" : "X8", null);
case RepType.Int64:
hasAltS = true;
(*(int64*)lockRange.mData.CArray()).ToString(s, (altIntBase == 10) ? "" : "X16", null);
if (altIntBase == 0x10)
s.Insert(8, '\'');
if (altIntBase == 10)
((UInt64)*(uint64*)lockRange.mData.CArray()).ToString(altS, "", null);
(*(int64*)lockRange.mData.CArray()).ToString(s, (intBase == 10) ? "" : "X16", null);
((UInt64)*(uint64*)lockRange.mData.CArray()).ToString(altS, (altIntBase == 10) ? "" : "X16", null);
case RepType.Float:
(*(float*)lockRange.mData.CArray()).ToString(s);
case RepType.Double:

View file

@ -187,9 +187,10 @@ namespace IDE.ui
{
base.FocusForKeyboard();
SetFocus();
if (mListView.GetRoot().FindFocusedItem() == null)
let root = mListView.GetRoot();
if (root.IsOpen && root.FindFocusedItem() == null)
{
mListView.GetRoot().GetChildAtIndex(0).Focused = true;
root.GetChildAtIndex(0).Focused = true;
}
}

View file

@ -1244,7 +1244,7 @@ namespace IDE.ui
{
var undoBatchStart = new UndoBatchStart("pasteText");
mData.mUndoManager.Add(undoBatchStart);
defer(stack) mData.mUndoManager.Add(undoBatchStart.mBatchEnd);
defer:: mData.mUndoManager.Add(undoBatchStart.mBatchEnd);
}
if (HasSelection())
@ -3644,7 +3644,7 @@ namespace IDE.ui
bool hadSuggestion = false;
List<String> suggestions = scope List<String>();
defer (scope) ClearAndDeleteItems(suggestions);
defer ClearAndDeleteItems(suggestions);
spellChecker.GetSuggestions(word, suggestions);
for (var suggestion in suggestions)
{
@ -3789,7 +3789,7 @@ namespace IDE.ui
else if (bfSystem != null)
{
parser = bfSystem.CreateEmptyParser(null);
defer(stack) delete parser;
defer:: delete parser;
var text = scope String();
mEditWidget.GetText(text);
parser.SetSource(text, mSourceViewPanel.mFilePath);

View file

@ -5073,7 +5073,11 @@ namespace IDE.ui
String showMouseoverString = null;
if (bestError.mError != null)
{
showMouseoverString = scope:: String(":", bestError.mError);
int maxLen = 16*1024;
if (bestError.mError.Length > maxLen)
showMouseoverString = scope:: String()..Concat(":", StringView(bestError.mError, 0, maxLen), "...");
else
showMouseoverString = scope:: String()..Concat(":", bestError.mError);
if (bestError.mMoreInfo != null)
{
@ -5676,7 +5680,8 @@ namespace IDE.ui
}
}
UpdateMouseover();
if (gApp.mIsUpdateBatchStart)
UpdateMouseover();
var compiler = ResolveCompiler;
var bfSystem = BfResolveSystem;

View file

@ -27,7 +27,8 @@ namespace IDE.ui
TypeClass = 0x80,
TypeValueType = 0x100,
Namespace = 0x200,
Text = 0x400
Text = 0x400,
RawText = 0x800
}
public class WatchEntry
@ -1740,6 +1741,7 @@ namespace IDE.ui
evt.mDragKind = .After;
dragTarget = (WatchListViewItem)dragTarget.mParentItem;
evt.mDragTarget = dragTarget;
return;
}
if ((dragTarget.mLabel == "") && (dragKind == .After))
dragKind = .Before;