mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-17 23:56:05 +02:00
Lost changes
This commit is contained in:
parent
e6c4a95ccd
commit
8e9d7ed4c4
56 changed files with 1579 additions and 794 deletions
|
@ -29,12 +29,8 @@ namespace IDE
|
|||
public int32 mUpdateCnt;
|
||||
public Project mHotProject;
|
||||
public Workspace.Options mWorkspaceOptions;
|
||||
public Dictionary<Project, String> mImpLibMap = new .() ~
|
||||
{
|
||||
for (let val in _.Values)
|
||||
delete val;
|
||||
delete _;
|
||||
};
|
||||
public Dictionary<Project, String> mImpLibMap = new .() ~ DeleteDictionaryAndValues!(_);
|
||||
public Dictionary<Project, String> mTargetPathMap = new .() ~ DeleteDictionaryAndValues!(_);
|
||||
public ScriptManager.Context mScriptContext = new .() ~ _.ReleaseLastRef();
|
||||
public ScriptManager mScriptManager ~ delete _;
|
||||
|
||||
|
@ -122,7 +118,7 @@ namespace IDE
|
|||
|
||||
bool didCommands = false;
|
||||
|
||||
let targetName = scope String("Project ", project.mProjectName);
|
||||
//let targetName = scope String("Project ", project.mProjectName);
|
||||
|
||||
//Console.WriteLine("Executing custom command {0} {1} {2}", highestDateTime, targetDateTime, forceRebuild);
|
||||
for (let origCustomCmd in cmdList)
|
||||
|
@ -163,19 +159,13 @@ namespace IDE
|
|||
didCommands = true;
|
||||
}
|
||||
|
||||
mScriptManager.QueueCommands(customCmd, scope String()..AppendF("project {}", project.mProjectName), .NoLines);
|
||||
let scriptCmd = new IDEApp.ScriptCmd();
|
||||
scriptCmd.mCmd = new String(customCmd);
|
||||
scriptCmd.mPath = new $"project {project.mProjectName}";
|
||||
gApp.mExecutionQueue.Add(scriptCmd);
|
||||
continue;
|
||||
}
|
||||
|
||||
let targetCompleteCmd = new IDEApp.TargetCompletedCmd(project);
|
||||
if (didCommands)
|
||||
{
|
||||
mScriptManager.QueueCommands(scope String()..AppendF("%targetComplete {}", project.mProjectName), targetName, .NoLines);
|
||||
targetCompleteCmd.mIsReady = false;
|
||||
project.mNeedsTargetRebuild = true;
|
||||
}
|
||||
gApp.mExecutionQueue.Add(targetCompleteCmd);
|
||||
|
||||
return didCommands ? .HadCommands : .NoCommands;
|
||||
}
|
||||
|
||||
|
@ -874,9 +864,9 @@ namespace IDE
|
|||
minRTModName.Insert(0, "_");
|
||||
|
||||
if (!is64Bit)
|
||||
linkLine.Append("-libpath:\"", gApp.mInstallDir, "lib\\x86\" ", gApp.mInstallDir, "lib\\x86\\msvcrt.lib Beef", IDEApp.sRTVersionStr,"MinRT32", minRTModName, ".lib ");
|
||||
linkLine.Append("-libpath:\"", gApp.mInstallDir, "lib\\x86\" \"", gApp.mInstallDir, "lib\\x86\\msvcrt.lib\" Beef", IDEApp.sRTVersionStr,"MinRT32", minRTModName, ".lib ");
|
||||
else
|
||||
linkLine.Append("-libpath:\"", gApp.mInstallDir, "lib\\x64\" ", gApp.mInstallDir, "lib\\x64\\msvcrt.lib Beef", IDEApp.sRTVersionStr,"MinRT64", minRTModName, ".lib ");
|
||||
linkLine.Append("-libpath:\"", gApp.mInstallDir, "lib\\x64\" \"", gApp.mInstallDir, "lib\\x64\\msvcrt.lib\" Beef", IDEApp.sRTVersionStr,"MinRT64", minRTModName, ".lib ");
|
||||
linkLine.Append("ntdll.lib user32.lib kernel32.lib gdi32.lib winmm.lib shell32.lib ole32.lib rpcrt4.lib version.lib comdlg32.lib -ignore:4049 -ignore:4217 ");
|
||||
}
|
||||
|
||||
|
@ -1062,17 +1052,8 @@ namespace IDE
|
|||
|
||||
IDEUtils.AppendWithOptionalQuotes(linkLine, resOutPath);
|
||||
}
|
||||
|
||||
let binPath = (!is64Bit) ? gApp.mSettings.mVSSettings.mBin32Path : gApp.mSettings.mVSSettings.mBin64Path;
|
||||
if (binPath.IsWhiteSpace)
|
||||
{
|
||||
gApp.OutputErrorLine("Visual Studio tool path not configured. Check Visual Studio configuration in File\\Preferences\\Settings.");
|
||||
return false;
|
||||
}
|
||||
|
||||
String linkerPath = scope String();
|
||||
linkerPath.Append(binPath);
|
||||
linkerPath.Append("/link.exe");
|
||||
if (workspaceOptions.mToolsetType == .LLVM)
|
||||
{
|
||||
linkerPath.Clear();
|
||||
|
@ -1097,6 +1078,17 @@ namespace IDE
|
|||
if ((mPlatformType == .Windows) && (!is64Bit))
|
||||
linkLine.Append(" /safeseh:no");
|
||||
}
|
||||
else
|
||||
{
|
||||
let binPath = (!is64Bit) ? gApp.mSettings.mVSSettings.mBin32Path : gApp.mSettings.mVSSettings.mBin64Path;
|
||||
if (binPath.IsWhiteSpace)
|
||||
{
|
||||
gApp.OutputErrorLine("Visual Studio tool path not configured. Check Visual Studio configuration in File\\Preferences\\Settings.");
|
||||
return false;
|
||||
}
|
||||
linkerPath.Append(binPath);
|
||||
linkerPath.Append("/link.exe");
|
||||
}
|
||||
|
||||
if (options.mBuildOptions.mBeefLibType != .DynamicDebug)
|
||||
{
|
||||
|
@ -1216,6 +1208,8 @@ namespace IDE
|
|||
}
|
||||
}
|
||||
|
||||
mTargetPathMap[project] = new String(targetPath);
|
||||
|
||||
if (hotProject == null)
|
||||
{
|
||||
switch (QueueProjectCustomBuildCommands(project, targetPath, compileKind.WantsRunAfter ? options.mBuildOptions.mBuildCommandsOnRun : options.mBuildOptions.mBuildCommandsOnCompile, options.mBuildOptions.mPreBuildCmds))
|
||||
|
@ -1226,22 +1220,9 @@ namespace IDE
|
|||
completedCompileCmd.mFailed = true;
|
||||
}
|
||||
}
|
||||
|
||||
void DoPostBuild()
|
||||
{
|
||||
switch (QueueProjectCustomBuildCommands(project, targetPath, compileKind.WantsRunAfter ? options.mBuildOptions.mBuildCommandsOnRun : options.mBuildOptions.mBuildCommandsOnCompile, options.mBuildOptions.mPostBuildCmds))
|
||||
{
|
||||
case .NoCommands:
|
||||
case .HadCommands:
|
||||
case .Failed:
|
||||
completedCompileCmd.mFailed = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (project.mGeneralOptions.mTargetType == .CustomBuild)
|
||||
{
|
||||
if (hotProject == null)
|
||||
DoPostBuild();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1402,8 +1383,32 @@ namespace IDE
|
|||
return false;
|
||||
}
|
||||
|
||||
DoPostBuild();
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool QueueProjectPostBuild(Project project, Project hotProject, IDEApp.BuildCompletedCmd completedCompileCmd, List<String> hotFileNames, CompileKind compileKind)
|
||||
{
|
||||
if (hotProject != null)
|
||||
return true;
|
||||
|
||||
Project.Options options = gApp.GetCurProjectOptions(project);
|
||||
if (options == null)
|
||||
return true;
|
||||
|
||||
String targetPath = null;
|
||||
mTargetPathMap.TryGetValue(project, out targetPath);
|
||||
if (targetPath == null)
|
||||
return false;
|
||||
|
||||
switch (QueueProjectCustomBuildCommands(project, targetPath, compileKind.WantsRunAfter ? options.mBuildOptions.mBuildCommandsOnRun : options.mBuildOptions.mBuildCommandsOnCompile, options.mBuildOptions.mPostBuildCmds))
|
||||
{
|
||||
case .NoCommands:
|
||||
case .HadCommands:
|
||||
case .Failed:
|
||||
completedCompileCmd.mFailed = true;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -96,7 +96,8 @@ namespace IDE.Debugger
|
|||
MemoryAddress = 0x40,
|
||||
MemoryWatch = 0x80,
|
||||
Symbol = 0x100,
|
||||
StepIntoCall = 0x200
|
||||
StepIntoCall = 0x200,
|
||||
RawStr = 0x400,
|
||||
}
|
||||
|
||||
[Reflect]
|
||||
|
|
|
@ -436,6 +436,12 @@ namespace IDE
|
|||
}
|
||||
}
|
||||
|
||||
public class ScriptCmd : ExecutionCmd
|
||||
{
|
||||
public String mCmd ~ delete _;
|
||||
public String mPath ~ delete _;
|
||||
}
|
||||
|
||||
public enum ArgsFileKind
|
||||
{
|
||||
None,
|
||||
|
@ -7447,83 +7453,103 @@ namespace IDE
|
|||
return;
|
||||
}
|
||||
}
|
||||
|
||||
var keyState = scope KeyState();
|
||||
keyState.mKeyCode = evt.mKeyCode;
|
||||
keyState.mKeyFlags = evt.mKeyFlags;
|
||||
|
||||
var curKeyMap = mCommands.mKeyMap;
|
||||
bool hadChordState = mKeyChordState != null;
|
||||
if (mKeyChordState != null)
|
||||
curKeyMap = mKeyChordState.mCommandMap;
|
||||
DeleteAndNullify!(mKeyChordState);
|
||||
|
||||
KeyState matchedKey;
|
||||
IDECommandBase commandBase;
|
||||
if (curKeyMap.mMap.TryGet(keyState, out matchedKey, out commandBase))
|
||||
|
||||
if ((mKeyChordState != null) && (evt.mKeyCode.IsModifier))
|
||||
{
|
||||
if (var commandMap = commandBase as CommandMap)
|
||||
{
|
||||
mKeyChordState = new .();
|
||||
mKeyChordState.mCommandMap = commandMap;
|
||||
mKeyChordState.mKeyState = matchedKey;
|
||||
evt.mHandled = true;
|
||||
return;
|
||||
}
|
||||
else if (var command = commandBase as IDECommand)
|
||||
{
|
||||
bool foundMatch = false;
|
||||
if (useFlags != .None)
|
||||
{
|
||||
var checkCommand = command;
|
||||
while (checkCommand != null)
|
||||
{
|
||||
bool matches = checkCommand.mContextFlags == .None;
|
||||
if (checkCommand.mContextFlags.HasFlag(.Editor))
|
||||
matches |= useFlags.HasFlag(.Editor);
|
||||
if (checkCommand.mContextFlags.HasFlag(.MainWindow))
|
||||
matches |= useFlags.HasFlag(.MainWindow);
|
||||
if (checkCommand.mContextFlags.HasFlag(.WorkWindow))
|
||||
matches |= useFlags.HasFlag(.WorkWindow);
|
||||
|
||||
if (matches)
|
||||
{
|
||||
checkCommand.mAction();
|
||||
foundMatch = true;
|
||||
}
|
||||
checkCommand = checkCommand.mNext;
|
||||
}
|
||||
}
|
||||
|
||||
if (!foundMatch)
|
||||
{
|
||||
var checkCommand = command;
|
||||
while (checkCommand != null)
|
||||
{
|
||||
if (checkCommand.mContextFlags == .None)
|
||||
{
|
||||
checkCommand.mAction();
|
||||
foundMatch = true;
|
||||
}
|
||||
checkCommand = checkCommand.mNext;
|
||||
}
|
||||
}
|
||||
|
||||
if (foundMatch)
|
||||
{
|
||||
evt.mHandled = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
// Ignore
|
||||
}
|
||||
else
|
||||
{
|
||||
// Not found
|
||||
if (hadChordState)
|
||||
var keyState = scope KeyState();
|
||||
keyState.mKeyCode = evt.mKeyCode;
|
||||
keyState.mKeyFlags = evt.mKeyFlags;
|
||||
|
||||
var curKeyMap = mCommands.mKeyMap;
|
||||
|
||||
bool hadChordState = mKeyChordState != null;
|
||||
if (mKeyChordState != null)
|
||||
curKeyMap = mKeyChordState.mCommandMap;
|
||||
var prevKeyChordState = mKeyChordState;
|
||||
defer delete prevKeyChordState;
|
||||
mKeyChordState = null;
|
||||
|
||||
KeyState matchedKey;
|
||||
IDECommandBase commandBase;
|
||||
|
||||
bool hadMatch = curKeyMap.mMap.TryGet(keyState, out matchedKey, out commandBase);
|
||||
if ((!hadMatch) && (prevKeyChordState != null))
|
||||
{
|
||||
Beep(.Error);
|
||||
evt.mHandled = true;
|
||||
return;
|
||||
// If we have a "Ctrl+A, Ctrl+B" style sequence then also try to match that against "Ctrl+A, B"
|
||||
KeyState rawKeyState = keyState;
|
||||
rawKeyState.mKeyFlags &= ~prevKeyChordState.mKeyState.mKeyFlags;
|
||||
hadMatch = curKeyMap.mMap.TryGet(rawKeyState, out matchedKey, out commandBase);
|
||||
}
|
||||
|
||||
if (hadMatch)
|
||||
{
|
||||
if (var commandMap = commandBase as CommandMap)
|
||||
{
|
||||
mKeyChordState = new .();
|
||||
mKeyChordState.mCommandMap = commandMap;
|
||||
mKeyChordState.mKeyState = matchedKey;
|
||||
evt.mHandled = true;
|
||||
return;
|
||||
}
|
||||
else if (var command = commandBase as IDECommand)
|
||||
{
|
||||
bool foundMatch = false;
|
||||
if (useFlags != .None)
|
||||
{
|
||||
var checkCommand = command;
|
||||
while (checkCommand != null)
|
||||
{
|
||||
bool matches = checkCommand.mContextFlags == .None;
|
||||
if (checkCommand.mContextFlags.HasFlag(.Editor))
|
||||
matches |= useFlags.HasFlag(.Editor);
|
||||
if (checkCommand.mContextFlags.HasFlag(.MainWindow))
|
||||
matches |= useFlags.HasFlag(.MainWindow);
|
||||
if (checkCommand.mContextFlags.HasFlag(.WorkWindow))
|
||||
matches |= useFlags.HasFlag(.WorkWindow);
|
||||
|
||||
if (matches)
|
||||
{
|
||||
checkCommand.mAction();
|
||||
foundMatch = true;
|
||||
}
|
||||
checkCommand = checkCommand.mNext;
|
||||
}
|
||||
}
|
||||
|
||||
if (!foundMatch)
|
||||
{
|
||||
var checkCommand = command;
|
||||
while (checkCommand != null)
|
||||
{
|
||||
if (checkCommand.mContextFlags == .None)
|
||||
{
|
||||
checkCommand.mAction();
|
||||
foundMatch = true;
|
||||
}
|
||||
checkCommand = checkCommand.mNext;
|
||||
}
|
||||
}
|
||||
|
||||
if (foundMatch)
|
||||
{
|
||||
evt.mHandled = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Not found
|
||||
if (hadChordState)
|
||||
{
|
||||
Beep(.Error);
|
||||
evt.mHandled = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -8256,6 +8282,21 @@ namespace IDE
|
|||
}
|
||||
}
|
||||
|
||||
if (let scriptCmd = next as ScriptCmd)
|
||||
{
|
||||
if (mBuildContext?.mScriptManager != null)
|
||||
{
|
||||
if (scriptCmd.mCmd != null)
|
||||
{
|
||||
mBuildContext.mScriptManager.QueueCommands(scriptCmd.mCmd, scriptCmd.mPath, .NoLines);
|
||||
DeleteAndNullify!(scriptCmd.mCmd);
|
||||
}
|
||||
|
||||
if (mBuildContext.mScriptManager.HasQueuedCommands)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
defer delete next;
|
||||
mExecutionQueue.RemoveAt(0);
|
||||
|
||||
|
@ -8411,6 +8452,11 @@ namespace IDE
|
|||
if (gApp.mDebugger.mIsRunning)
|
||||
mProfilePanel.StartProfiling(profileCmd.mThreadId, profileCmd.mDesc, profileCmd.mSampleRate);
|
||||
}
|
||||
else if (var scriptCmd = next as ScriptCmd)
|
||||
{
|
||||
// Already handled
|
||||
(void)scriptCmd;
|
||||
}
|
||||
else
|
||||
{
|
||||
Runtime.FatalError("Unknown command");
|
||||
|
@ -9163,7 +9209,8 @@ namespace IDE
|
|||
|
||||
public bool DoResolveConfigString(String platformName, Workspace.Options workspaceOptions, Project project, Project.Options options, StringView configString, String error, String result)
|
||||
{
|
||||
int i = result.Length;
|
||||
int startIdx = result.Length;
|
||||
int i = startIdx;
|
||||
result.Append(configString);
|
||||
|
||||
bool hadError = false;
|
||||
|
@ -9258,6 +9305,28 @@ namespace IDE
|
|||
cmdErr = "Invalid number of arguments";
|
||||
case "Var":
|
||||
break ReplaceBlock;
|
||||
case "Arguments",
|
||||
"BuildDir",
|
||||
"LinkFlags",
|
||||
"ProjectDir",
|
||||
"ProjectName",
|
||||
"TargetDir",
|
||||
"TargetPath",
|
||||
"WorkingDir":
|
||||
var selProject = mWorkspace.FindProject(args[0]);
|
||||
if (selProject != null)
|
||||
{
|
||||
Workspace.Options selWorkspaceOptions = gApp.GetCurWorkspaceOptions();
|
||||
Project.Options selOptions = gApp.GetCurProjectOptions(selProject);
|
||||
String selConfigString = scope $"$({cmd})";
|
||||
replaceStr.Clear();
|
||||
newString = scope:ReplaceBlock .();
|
||||
DoResolveConfigString(platformName, selWorkspaceOptions, selProject, selOptions, selConfigString, error, newString);
|
||||
}
|
||||
else
|
||||
cmdErr = "Unable to find project";
|
||||
default:
|
||||
cmdErr = "Invalid command";
|
||||
}
|
||||
|
||||
if (newString == null)
|
||||
|
@ -10251,6 +10320,12 @@ namespace IDE
|
|||
success = false;
|
||||
}
|
||||
|
||||
for (var project in orderedProjectList)
|
||||
{
|
||||
if (!mBuildContext.QueueProjectPostBuild(project, hotProject, completedCompileCmd, hotFileNames, compileKind))
|
||||
success = false;
|
||||
}
|
||||
|
||||
if (hotFileNames.Count > 0)
|
||||
{
|
||||
// Why were we rehupping BEFORE hotLoad?
|
||||
|
@ -10430,6 +10505,36 @@ namespace IDE
|
|||
#endif
|
||||
}
|
||||
|
||||
public bool IsVisualStudioRequired
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Workspace.PlatformType.GetFromName(mPlatformName) != .Windows)
|
||||
return false;
|
||||
var workspaceOptions = GetCurWorkspaceOptions();
|
||||
if (workspaceOptions.mToolsetType != .LLVM)
|
||||
return true;
|
||||
|
||||
for (var project in mWorkspace.mProjects)
|
||||
{
|
||||
if ((project.mGeneralOptions.mTargetType != .BeefConsoleApplication) &&
|
||||
(project.mGeneralOptions.mTargetType != .BeefGUIApplication) &&
|
||||
(project.mGeneralOptions.mTargetType != .BeefApplication_DynamicLib) &&
|
||||
(project.mGeneralOptions.mTargetType != .BeefApplication_StaticLib))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var options = GetCurProjectOptions(project);
|
||||
if (options == null)
|
||||
continue;
|
||||
if (options.mBuildOptions.mCLibType != .SystemMSVCRT)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
protected bool Compile(CompileKind compileKind = .Normal, Project hotProject = null)
|
||||
{
|
||||
Debug.Assert(mBuildContext == null);
|
||||
|
@ -10604,7 +10709,7 @@ namespace IDE
|
|||
}
|
||||
}
|
||||
|
||||
if (Workspace.PlatformType.GetFromName(mPlatformName) == .Windows)
|
||||
if ((Workspace.PlatformType.GetFromName(mPlatformName) == .Windows) && (IsVisualStudioRequired))
|
||||
{
|
||||
if (!mSettings.mVSSettings.IsConfigured())
|
||||
mSettings.mVSSettings.SetDefaults();
|
||||
|
@ -10788,8 +10893,8 @@ namespace IDE
|
|||
|
||||
//options.mDebugOptions.mCommand
|
||||
|
||||
String launchPath = scope String();
|
||||
ResolveConfigString(mPlatformName, workspaceOptions, project, options, options.mDebugOptions.mCommand, "debug command", launchPath);
|
||||
String launchPathRel = scope String();
|
||||
ResolveConfigString(mPlatformName, workspaceOptions, project, options, options.mDebugOptions.mCommand, "debug command", launchPathRel);
|
||||
String arguments = scope String();
|
||||
ResolveConfigString(mPlatformName, workspaceOptions, project, options, "$(Arguments)", "debug command arguments", arguments);
|
||||
String workingDirRel = scope String();
|
||||
|
@ -10797,6 +10902,9 @@ namespace IDE
|
|||
var workingDir = scope String();
|
||||
Path.GetAbsolutePath(workingDirRel, project.mProjectDir, workingDir);
|
||||
|
||||
String launchPath = scope String();
|
||||
Path.GetAbsolutePath(launchPathRel, workingDir, launchPath);
|
||||
|
||||
String targetPath = scope .();
|
||||
ResolveConfigString(mPlatformName, workspaceOptions, project, options, "$(TargetPath)", "Target path", targetPath);
|
||||
|
||||
|
|
|
@ -1007,7 +1007,7 @@ namespace IDE
|
|||
if (!gApp.[Friend]mExecutionQueue.IsEmpty)
|
||||
{
|
||||
var nextCmd = gApp.mExecutionQueue[0];
|
||||
if (!(nextCmd is IDEApp.TargetCompletedCmd))
|
||||
if (!(nextCmd is IDEApp.ScriptCmd))
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue