1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-07-04 23:36:00 +02:00

Fixed some tooltips, added Link Dependencies, more int-ness

This commit is contained in:
Brian Fiete 2019-12-21 05:48:44 -08:00
parent 939c818581
commit d0e8332150
30 changed files with 180 additions and 432 deletions

View file

@ -25,7 +25,7 @@ OtherLinkFlags = ""
TargetDirectory = "$(WorkspaceDir)/dist"
TargetName = "BeefIDE_d"
OtherLinkFlags = "$(LinkFlags) Comdlg32.lib kernel32.lib user32.lib advapi32.lib shell32.lib IDEHelper64_d.lib"
DebugCommandArguments = "-workspace=C:\\Beef\\IDEHelper\\Tests"
DebugCommandArguments = "-workspace=C:\\Proj\\CycloBuddy"
DebugWorkingDirectory = "c:\\Beef\\IDE\\Tests\\EmptyTest"
EnvironmentVars = ["_NO_DEBUG_HEAP=1"]
@ -49,7 +49,7 @@ OtherLinkFlags = ""
TargetDirectory = "$(WorkspaceDir)/dist"
TargetName = "BeefIDE_d2"
OtherLinkFlags = "$(LinkFlags) Comdlg32.lib kernel32.lib user32.lib advapi32.lib shell32.lib IDEHelper64_d.lib BeefySysLib64_d.lib wsock32.lib"
DebugCommandArguments = "-proddir=C:\\Beef\\IDE\\mintest"
DebugCommandArguments = "-proddir=C:\\Beef\\IDEHelper\\Tests"
DebugWorkingDirectory = "$(ProjectDir)\\dist"
EnvironmentVars = ["_NO_DEBUG_HEAP=1"]

View file

@ -1,2 +1,2 @@
using System;
using System.Diagnostics;

View file

@ -229,7 +229,7 @@ namespace Hey.Dude.Bro
PrintF("Hey\n");
Test2(1, 2, 3, 4);
//Test2(1, 2, 3, 4);
/*IHashable ih = (int32)TypeCode.Boolean;
let hashCode = ih.GetHashCode();*/

View file

@ -6,342 +6,12 @@ using System.Collections.Generic;
using System.Diagnostics;
using System.Threading;
//#define A
//#define B
struct StructA
{
public int mA;
public static StructA operator+(StructA lhs, float rhs)
{
StructA newVal = .();
newVal.mA = lhs.mA + (int)rhs;
return newVal;
}
}
struct StructB
{
public int mA;
public static bool operator==(StructA lhs, StructB rhs)
{
return lhs.mA == rhs.mA;
}
}
struct StructC
{
public int mA;
public static operator StructD(StructC val)
{
StructD conv;
conv.mA = val.mA;
return conv;
}
}
struct StructD
{
public int mA;
public static operator StructD(StructC val)
{
StructC conv;
conv.mA = val.mA;
return conv;
}
}
struct StructE
{
public int mA;
public static operator StructD(StructE val)
{
StructC conv;
conv.mA = val.mA;
return conv;
}
}
class ClassA
{
public int mA;
}
struct StructK
{
}
struct StructL : StructK
{
public int mA;
}
struct Checker
{
public static int CheckIt(int* iPtr, int len)
{
int acc = 0;
for (int i < len)
{
acc += iPtr[i];
}
return acc;
}
public static int CheckItSpan(int* iPtr, int len)
{
Span<int> span = .(iPtr, len);
int acc = 0;
for (int i < len)
{
acc += span[i];
}
return acc;
}
public static int CheckItSpanOpt(int* iPtr, int len)
{
OptSpan<int> span = .(iPtr, len);
int acc = 0;
for (int i < len)
{
acc += span[i];
}
return acc;
}
}
struct Blurg
{
static int GetHash<T>(T val) where T : IHashable
{
return val.GetHashCode();
}
public static int32 LongCall(
int abcdefghijklmnopqrstuvwxyz0,
int abcdefghijklmnopqrstuvwxyz1,
int abcdefghijklmnopqrstuvwxyz2,
int abcdefghijklmnopqrstuvwxyz3,
int abcdefghijklmnopqrstuvwxyz4,
int abcdefghijklmnopqrstuvwxyz5,
int abcdefghijklmnopqrstuvwxyz6,
int abcdefghijklmnopqrstuvwxyz7,
int abcdefghijklmnopqrstuvwxyz8,
int abcdefghijklmnopqrstuvwxyz9
)
{
return 0;
}
static mixin ScopedAlloc(int size, int align)
{
//(void*)scope:mixin [Align(align)] uint8[size]* { ? }
}
public static void TestAlloc()
{
int i = 1;
if (i == 1)
{
int size = 128;
scope:: int[size]*;
}
}
struct StructA
{
public int[10] mA;
public this()
{
mA = default;
void* v = &this;
}
}
enum EnumA
{
case None;
case A(StructA sa);
}
enum EnumB
{
case A;
case B(int a, int b);
}
/*[DisableChecks]
public static float GetSum<TCount>(float[TCount] vals) where TCount : const int
{
float total = 0;
for (int i < vals.Count)
total += vals[i];
return total;
}
public static void Max<T, TFunc>(T lhs, T rhs, TFunc func) where TFunc : delegate int(T lhs, T rhs)
{
}*/
public struct Base
{
int32 mA;
int64 mB;
}
public struct Derived : Base
{
int8 mC;
public int GetC()
{
return mC + 10000;
}
}
//static int[] gArr = new .(1, 2, 3, 4, 5, );
[Checked]
public static int32 GetVal()
{
return 1;
}
[Unchecked]
public static int32 GetVal()
{
return 2;
}
public static int32 GetVal2()
{
return 3;
}
public static void Test()
{
//Test_Start
Derived dr = .();
dr.GetC();
Int iVal = (.)123;
int q = 999;
//Test_End
}
public static void Test2(int aa, int bb, int cc)
{
//Test_Start
Derived dr2 = .();
Int iVal2 = (.)123;
int q2 = 999;
String str = scope .();
//Test_End
}
public static void Recurse(int a)
{
int b = 234;
//Recurse_C
int c = 345;
if (a == 10)
return;
Recurse(a + 1);
int d = 100 + a;
}
public static void Test3()
{
//BreakpointTester_Test
int a = 0;
int b = 0;
while (a < 20)
{
//BreakpointTester_LoopA
a++;
}
//BreakpointTester_Recurse
Recurse(0);
}
public static void Test4()
{
//Test_Start
Derived dr = .();
Int iVal = (.)123;
int q = 999;
//Test_End
}
//[DisableObjectAccessChecks]
public static void Hey2()
{
String str = "Hey";
//int len = str.[Friend, DisableObjectAccessChecks]PrivateLength;
int len = str.[DisableObjectAccessChecks]Length;
//int len = str.[Friend]GetLength();
}
public static mixin Florf(int a, int b)
{
}
class Zangles
{
public static int GetMe()
{
return 99;
}
}
public static int sA = 123;
/*public static void Test<T>(T val)
{
}*/
public static void Test<T, T2>(T val) where T : Span<T2>
{
}
public static int32 Hey()
{
Span<uint8> valSpan = .();
StringView sv = "Hey";
Span<char8> span = sv;
Test(sv);
return (int32)123;
}
}

View file

@ -764,8 +764,17 @@ namespace IDE
String cacheStr = scope String();
void AddBuildFileDependency(StringView filePath)
void AddBuildFileDependency(StringView filePath, bool resolveString = false)
{
var filePath;
if ((resolveString) && (filePath.Contains('$')))
{
String resolvedFilePath = scope:: String();
gApp.ResolveConfigString(gApp.mPlatformName, workspaceOptions, project, options, filePath, "link flags", resolvedFilePath);
filePath = resolvedFilePath;
}
int64 fileTime = 0;
if (!filePath.IsEmpty)
fileTime = File.GetLastWriteTime(filePath).GetValueOrDefault().ToFileTime();
@ -783,6 +792,8 @@ namespace IDE
cacheStr.AppendF("Copyright\t{}\n", project.mWindowsOptions.mCopyright);
cacheStr.AppendF("FileVersion\t{}\n", project.mWindowsOptions.mFileVersion);
cacheStr.AppendF("ProductVersion\t{}\n", project.mWindowsOptions.mProductVersion);
for (var linkDep in options.mBuildOptions.mLinkDependencies)
AddBuildFileDependency(linkDep, true);
String prevCacheStr = scope .();
gApp.mBfBuildCompiler.GetBuildValue(projectBuildDir, "Link", prevCacheStr);

View file

@ -5798,7 +5798,7 @@ namespace IDE
return sourceViewPanel;
}
int32 GetRecentFilesIdx(String filePath)
int GetRecentFilesIdx(String filePath)
{
return mRecentlyDisplayedFiles.FindIndex(scope (item) => Path.Equals(item, filePath));
}
@ -6006,7 +6006,7 @@ namespace IDE
if (tabbedView == null)
return;
int32 recentFileIdx = -1;
int recentFileIdx = -1;
if (sourceViewPanel != null)
{
sourceViewPanel.Dispose();

View file

@ -1012,6 +1012,8 @@ namespace IDE
[Reflect]
public BuildCommandTrigger mBuildCommandsOnRun = .Always;
[Reflect]
public List<String> mLinkDependencies = new List<String>() ~ DeleteContainerAndItems!(_);
[Reflect]
public List<String> mPreBuildCmds = new List<String>() ~ DeleteContainerAndItems!(_);
[Reflect]
public List<String> mPostBuildCmds = new List<String>() ~ DeleteContainerAndItems!(_);
@ -1130,6 +1132,7 @@ namespace IDE
Set!(newOptions.mBuildOptions.mTargetName, mBuildOptions.mTargetName);
Set!(newOptions.mBuildOptions.mOtherLinkFlags, mBuildOptions.mOtherLinkFlags);
Set!(newOptions.mBuildOptions.mCLibType, mBuildOptions.mCLibType);
Set!(newOptions.mBuildOptions.mLinkDependencies, mBuildOptions.mLinkDependencies);
Set!(newOptions.mBuildOptions.mPreBuildCmds, mBuildOptions.mPreBuildCmds);
Set!(newOptions.mBuildOptions.mPostBuildCmds, mBuildOptions.mPostBuildCmds);
@ -1518,6 +1521,7 @@ namespace IDE
data.ConditionalAdd("StackSize", options.mBuildOptions.mStackSize, 0);
data.ConditionalAdd("BuildCommandsOnCompile", options.mBuildOptions.mBuildCommandsOnCompile, .Always);
data.ConditionalAdd("BuildCommandsOnRun", options.mBuildOptions.mBuildCommandsOnRun, .Always);
WriteStrings("LinkDependencies", options.mBuildOptions.mLinkDependencies);
WriteStrings("PreBuildCmds", options.mBuildOptions.mPreBuildCmds);
WriteStrings("PostBuildCmds", options.mBuildOptions.mPostBuildCmds);
@ -1839,6 +1843,7 @@ namespace IDE
options.mBuildOptions.mStackSize = data.GetInt("StackSize");
options.mBuildOptions.mBuildCommandsOnCompile = data.GetEnum<BuildCommandTrigger>("BuildCommandsOnCompile", .Always);
options.mBuildOptions.mBuildCommandsOnRun = data.GetEnum<BuildCommandTrigger>("BuildCommandsOnRun", .Always);
ReadStrings("LinkDependencies", options.mBuildOptions.mLinkDependencies);
ReadStrings("PreBuildCmds", options.mBuildOptions.mPreBuildCmds);
ReadStrings("PostBuildCmds", options.mBuildOptions.mPostBuildCmds);

View file

@ -585,6 +585,7 @@ namespace IDE.ui
case 'H':
{
mSourceHash = SourceHash.Create(.(line, 2));
addLineData = false;
}
case 'T':
{

View file

@ -680,6 +680,7 @@ namespace IDE.ui
(listViewItem, propEntry) = AddPropertiesItem(root, "C Library", "mBuildOptions.mCLibType");
(listViewItem, propEntry) = AddPropertiesItem(root, "Beef Library", "mBuildOptions.mBeefLibType");
(listViewItem, propEntry) = AddPropertiesItem(root, "Stack Size", "mBuildOptions.mStackSize");
(listViewItem, propEntry) = AddPropertiesItem(root, "Link Dependencies", "mBuildOptions.mLinkDependencies");
(listViewItem, propEntry) = AddPropertiesItem(root, "Prebuild Commands", "mBuildOptions.mPreBuildCmds");
(listViewItem, propEntry) = AddPropertiesItem(root, "Postbuild Commands", "mBuildOptions.mPostBuildCmds");
(listViewItem, propEntry) = AddPropertiesItem(root, "Build Commands on Compile", "mBuildOptions.mBuildCommandsOnCompile");
@ -752,7 +753,7 @@ namespace IDE.ui
}
else
{
int32 idx = mProject.mDependencies.FindIndex(scope (dep) => dep.mProjectName == listViewItem.mLabel);
int idx = mProject.mDependencies.FindIndex(scope (dep) => dep.mProjectName == listViewItem.mLabel);
if (idx != -1)
{
delete mProject.mDependencies[idx];

View file

@ -133,6 +133,13 @@ namespace IDE.ui
PopupCallStackPanel();
}
}
public override bool WantsTooltip(float mouseX, float mouseY)
{
if ((mColumnIdx == 2) && (mouseX >= mListView.mParent.mWidth - LabelX - GS!(34)))
return false;
return base.WantsTooltip(mouseX, mouseY);
}
}
public class ThreadListView : DarkListView
@ -357,7 +364,7 @@ namespace IDE.ui
}
#unwarn
int32 selectedIdx = mListView.GetRoot().GetIndexOfChild(item);
int selectedIdx = mListView.GetRoot().GetIndexOfChild(item);
int32 threadId = int32.Parse(item.mLabel);
gApp.mDebugger.SetActiveThread(threadId);

View file

@ -1718,7 +1718,7 @@ namespace IDE.ui
CompactChildExpression(source, compactEvalStr);
var rootItem = mListView.GetRoot();
int32 idx = rootItem.mChildItems.IndexOf(target);
int idx = rootItem.mChildItems.IndexOf(target);
if (theEvent.mDragTargetDir > 0)
idx += theEvent.mDragTargetDir;
var listViewItem = (WatchListViewItem)rootItem.CreateChildItemAtIndex(idx);
@ -2864,7 +2864,7 @@ namespace IDE.ui
var selectedItem = selectedItems[itemIdx];
if ((selectedItem != null) && (selectedItem.mLabel.Length > 0) && (selectedItem.mParentItem == root))
{
int32 idx = root.mChildItems.IndexOf(selectedItem);
int idx = root.mChildItems.IndexOf(selectedItem);
root.RemoveChildItem(selectedItem);
if (idx < root.mChildItems.Count)
root.SelectItemExclusively(root.mChildItems[idx]);