mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 04:22:20 +02:00
Added errors panel
This commit is contained in:
parent
aa0277485f
commit
9d1b85cceb
8 changed files with 234 additions and 90 deletions
|
@ -4,14 +4,22 @@ namespace System.IO
|
||||||
{
|
{
|
||||||
class FolderBrowserDialog : CommonDialog
|
class FolderBrowserDialog : CommonDialog
|
||||||
{
|
{
|
||||||
|
public enum FolderKind
|
||||||
|
{
|
||||||
|
Open,
|
||||||
|
Save
|
||||||
|
}
|
||||||
|
|
||||||
String mSelectedPath = new String() ~ delete _;
|
String mSelectedPath = new String() ~ delete _;
|
||||||
public bool ShowNewFolderButton;
|
public bool ShowNewFolderButton;
|
||||||
String mDescriptionText = new String() ~ delete _;
|
String mDescriptionText = new String() ~ delete _;
|
||||||
bool mSelectedPathNeedsCheck;
|
bool mSelectedPathNeedsCheck;
|
||||||
static FolderBrowserDialog sCurrentThis;
|
static FolderBrowserDialog sCurrentThis;
|
||||||
|
FolderKind mFolderKind;
|
||||||
|
|
||||||
public this()
|
public this(FolderKind kind = .Open)
|
||||||
{
|
{
|
||||||
|
mFolderKind = kind;
|
||||||
Reset();
|
Reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,6 +59,51 @@ namespace System.IO
|
||||||
|
|
||||||
protected Result<DialogResult> RunDialog_New(Windows.HWnd hWndOwner, FolderBrowserDialog.COM_IFileDialog* fileDialog)
|
protected Result<DialogResult> RunDialog_New(Windows.HWnd hWndOwner, FolderBrowserDialog.COM_IFileDialog* fileDialog)
|
||||||
{
|
{
|
||||||
|
//COM_IFileDialogEvents evts;
|
||||||
|
/*COM_IFileDialogEvents.VTable funcs;
|
||||||
|
funcs.QueryInterface = (self, riid, result) =>
|
||||||
|
{
|
||||||
|
return .E_FAIL;
|
||||||
|
};
|
||||||
|
funcs.AddRef = (self) =>
|
||||||
|
{
|
||||||
|
return .OK;
|
||||||
|
};
|
||||||
|
funcs.Release = (self) =>
|
||||||
|
{
|
||||||
|
return .OK;
|
||||||
|
};
|
||||||
|
funcs.OnFileOk = (self, fileDialog) =>
|
||||||
|
{
|
||||||
|
return .OK;
|
||||||
|
};
|
||||||
|
funcs.OnFolderChanging = (self, fileDialog, folder) =>
|
||||||
|
{
|
||||||
|
return .OK;
|
||||||
|
};
|
||||||
|
funcs.OnFolderChange = (self, fileDialog) =>
|
||||||
|
{
|
||||||
|
return .OK;
|
||||||
|
};
|
||||||
|
funcs.OnSelectionChange = (self, fileDialog) =>
|
||||||
|
{
|
||||||
|
return .OK;
|
||||||
|
};
|
||||||
|
funcs.OnShareViolation = (self, fileDialog, result) =>
|
||||||
|
{
|
||||||
|
return .OK;
|
||||||
|
};
|
||||||
|
funcs.OnTypeChange = (self, fileDialog) =>
|
||||||
|
{
|
||||||
|
return .OK;
|
||||||
|
};
|
||||||
|
funcs.OnOverwrite = (self, fileDialog, item, result) =>
|
||||||
|
{
|
||||||
|
return .OK;
|
||||||
|
};
|
||||||
|
evts.[Friend]mVT = &funcs;
|
||||||
|
fileDialog.VT.Advise(fileDialog, &evts, var adviseCookie);*/
|
||||||
|
|
||||||
if (!mSelectedPath.IsEmpty)
|
if (!mSelectedPath.IsEmpty)
|
||||||
{
|
{
|
||||||
COM_IShellItem* folderShellItem = null;
|
COM_IShellItem* folderShellItem = null;
|
||||||
|
@ -90,7 +143,11 @@ namespace System.IO
|
||||||
protected override Result<DialogResult> RunDialog(Windows.HWnd hWndOwner)
|
protected override Result<DialogResult> RunDialog(Windows.HWnd hWndOwner)
|
||||||
{
|
{
|
||||||
FolderBrowserDialog.COM_IFileDialog* fileDialog = null;
|
FolderBrowserDialog.COM_IFileDialog* fileDialog = null;
|
||||||
let hr = Windows.COM_IUnknown.CoCreateInstance(ref FolderBrowserDialog.COM_IFileDialog.sCLSID, null, .INPROC_SERVER, ref FolderBrowserDialog.COM_IFileDialog.sIID, (void**)&fileDialog);
|
Windows.COM_IUnknown.HResult hr;
|
||||||
|
//if (mFolderKind == .Open)
|
||||||
|
hr = Windows.COM_IUnknown.CoCreateInstance(ref FolderBrowserDialog.COM_IFileDialog.sCLSID, null, .INPROC_SERVER, ref FolderBrowserDialog.COM_IFileDialog.sIID, (void**)&fileDialog);
|
||||||
|
//else
|
||||||
|
//hr = Windows.COM_IUnknown.CoCreateInstance(ref FolderBrowserDialog.COM_FileSaveDialog.sCLSID, null, .INPROC_SERVER, ref FolderBrowserDialog.COM_FileSaveDialog.sIID, (void**)&fileDialog);
|
||||||
if (hr == 0)
|
if (hr == 0)
|
||||||
return RunDialog_New(hWndOwner, fileDialog);
|
return RunDialog_New(hWndOwner, fileDialog);
|
||||||
|
|
||||||
|
@ -163,9 +220,22 @@ namespace System.IO
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct COM_IFileDialogEvents
|
struct FDE_SHAREVIOLATION_RESPONSE;
|
||||||
{
|
struct FDE_OVERWRITE_RESPONSE;
|
||||||
|
|
||||||
|
struct COM_IFileDialogEvents : Windows.COM_IUnknown
|
||||||
|
{
|
||||||
|
public struct VTable : Windows.COM_IUnknown.VTable
|
||||||
|
{
|
||||||
|
public function HResult(COM_IFileDialogEvents* self, COM_IFileDialog* fileDialog) OnFileOk;
|
||||||
|
public function HResult(COM_IFileDialogEvents* self, COM_IFileDialog* fileDialog, COM_IShellItem* psiFolder) OnFolderChanging;
|
||||||
|
public function HResult(COM_IFileDialogEvents* self, COM_IFileDialog* fileDialog) OnFolderChange;
|
||||||
|
public function HResult(COM_IFileDialogEvents* self, COM_IFileDialog* fileDialog) OnSelectionChange;
|
||||||
|
public function HResult(COM_IFileDialogEvents* self, COM_IFileDialog* fileDialog, FDE_SHAREVIOLATION_RESPONSE* pResponse) OnShareViolation;
|
||||||
|
public function HResult(COM_IFileDialogEvents* self, COM_IFileDialog* fileDialog) OnTypeChange;
|
||||||
|
public function HResult(COM_IFileDialogEvents* self, COM_IFileDialog* fileDialog, COM_IShellItem* shellItem, FDE_OVERWRITE_RESPONSE* response) OnOverwrite;
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct COM_IShellItem : Windows.COM_IUnknown
|
struct COM_IShellItem : Windows.COM_IUnknown
|
||||||
|
@ -280,6 +350,12 @@ namespace System.IO
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public struct COM_FileSaveDialog : COM_IFileDialog
|
||||||
|
{
|
||||||
|
public static new Guid sIID = .(0x84bccd23, 0x5fde, 0x4cdb, 0xae, 0xa4, 0xaf, 0x64, 0xb8, 0x3d, 0x78, 0xab);
|
||||||
|
public static new Guid sCLSID = .(0xC0B4E2F3, 0xBA21, 0x4773, 0x8D, 0xBA, 0x33, 0x5E, 0xC9, 0x46, 0xEB, 0x8B);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
|
@ -633,6 +633,7 @@ namespace IDE
|
||||||
RemoveAndDelete!(mWatchPanel);
|
RemoveAndDelete!(mWatchPanel);
|
||||||
RemoveAndDelete!(mMemoryPanel);
|
RemoveAndDelete!(mMemoryPanel);
|
||||||
RemoveAndDelete!(mCallStackPanel);
|
RemoveAndDelete!(mCallStackPanel);
|
||||||
|
RemoveAndDelete!(mErrorsPanel);
|
||||||
RemoveAndDelete!(mBreakpointPanel);
|
RemoveAndDelete!(mBreakpointPanel);
|
||||||
RemoveAndDelete!(mModulePanel);
|
RemoveAndDelete!(mModulePanel);
|
||||||
RemoveAndDelete!(mThreadPanel);
|
RemoveAndDelete!(mThreadPanel);
|
||||||
|
@ -705,6 +706,26 @@ namespace IDE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WithStandardPanels(delegate void(Panel panel) dlg)
|
||||||
|
{
|
||||||
|
dlg(mProjectPanel);
|
||||||
|
dlg(mClassViewPanel);
|
||||||
|
dlg(mOutputPanel);
|
||||||
|
dlg(mImmediatePanel);
|
||||||
|
dlg(mFindResultsPanel);
|
||||||
|
dlg(mAutoWatchPanel);
|
||||||
|
dlg(mWatchPanel);
|
||||||
|
dlg(mMemoryPanel);
|
||||||
|
dlg(mCallStackPanel);
|
||||||
|
dlg(mErrorsPanel);
|
||||||
|
dlg(mBreakpointPanel);
|
||||||
|
dlg(mModulePanel);
|
||||||
|
dlg(mThreadPanel);
|
||||||
|
dlg(mProfilePanel);
|
||||||
|
dlg(mPropertiesPanel);
|
||||||
|
dlg(mAutoCompletePanel);
|
||||||
|
}
|
||||||
|
|
||||||
public override void ShutdownCompleted()
|
public override void ShutdownCompleted()
|
||||||
{
|
{
|
||||||
base.ShutdownCompleted();
|
base.ShutdownCompleted();
|
||||||
|
@ -804,7 +825,7 @@ namespace IDE
|
||||||
FinishShowingNewWorkspace();
|
FinishShowingNewWorkspace();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DoOpenWorkspace()
|
public void DoOpenWorkspace(bool isCreating = false)
|
||||||
{
|
{
|
||||||
#if !CLI
|
#if !CLI
|
||||||
if (mDeferredOpenFileName != null)
|
if (mDeferredOpenFileName != null)
|
||||||
|
@ -817,12 +838,13 @@ namespace IDE
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var folderDialog = scope FolderBrowserDialog();
|
var folderDialog = scope FolderBrowserDialog(isCreating ? .Save : .Open);
|
||||||
var initialDir = scope String();
|
var initialDir = scope String();
|
||||||
if (mInstallDir.Length > 0)
|
if (mInstallDir.Length > 0)
|
||||||
Path.GetDirectoryPath(.(mInstallDir, 0, mInstallDir.Length - 1), initialDir);
|
Path.GetDirectoryPath(.(mInstallDir, 0, mInstallDir.Length - 1), initialDir);
|
||||||
initialDir.Concat(Path.DirectorySeparatorChar, "Samples");
|
initialDir.Concat(Path.DirectorySeparatorChar, "Samples");
|
||||||
folderDialog.SelectedPath = initialDir;
|
folderDialog.SelectedPath = initialDir;
|
||||||
|
//folderDialog.
|
||||||
if (folderDialog.ShowDialog(GetActiveWindow()).GetValueOrDefault() == .OK)
|
if (folderDialog.ShowDialog(GetActiveWindow()).GetValueOrDefault() == .OK)
|
||||||
{
|
{
|
||||||
var selectedPath = scope String..AppendF(folderDialog.SelectedPath);
|
var selectedPath = scope String..AppendF(folderDialog.SelectedPath);
|
||||||
|
@ -1607,7 +1629,17 @@ namespace IDE
|
||||||
|
|
||||||
using (sd.CreateObject("MainWindow"))
|
using (sd.CreateObject("MainWindow"))
|
||||||
{
|
{
|
||||||
|
if (mMainWindow != null)
|
||||||
SerializeWindow(sd, mMainWindow);
|
SerializeWindow(sd, mMainWindow);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
sd.Add("X", mRequestedWindowRect.mX);
|
||||||
|
sd.Add("Y", mRequestedWindowRect.mY);
|
||||||
|
sd.Add("Width", mRequestedWindowRect.mWidth);
|
||||||
|
sd.Add("Height", mRequestedWindowRect.mHeight);
|
||||||
|
sd.Add("ShowKind", mRequestedShowKind);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
using (sd.CreateObject("MainDockingFrame"))
|
using (sd.CreateObject("MainDockingFrame"))
|
||||||
|
@ -2123,21 +2155,10 @@ namespace IDE
|
||||||
if (!mRunningTestScript)
|
if (!mRunningTestScript)
|
||||||
{
|
{
|
||||||
mActiveDocumentsTabbedView = null;
|
mActiveDocumentsTabbedView = null;
|
||||||
ResetPanel(mProjectPanel);
|
WithStandardPanels(scope (panel) =>
|
||||||
ResetPanel(mClassViewPanel);
|
{
|
||||||
ResetPanel(mOutputPanel);
|
ResetPanel(panel);
|
||||||
ResetPanel(mImmediatePanel);
|
});
|
||||||
ResetPanel(mFindResultsPanel);
|
|
||||||
ResetPanel(mAutoWatchPanel);
|
|
||||||
ResetPanel(mWatchPanel);
|
|
||||||
ResetPanel(mMemoryPanel);
|
|
||||||
ResetPanel(mCallStackPanel);
|
|
||||||
ResetPanel(mBreakpointPanel);
|
|
||||||
ResetPanel(mModulePanel);
|
|
||||||
ResetPanel(mThreadPanel);
|
|
||||||
ResetPanel(mProfilePanel);
|
|
||||||
ResetPanel(mPropertiesPanel);
|
|
||||||
ResetPanel(mAutoCompletePanel);
|
|
||||||
mMainFrame.Reset();
|
mMainFrame.Reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2158,6 +2179,8 @@ namespace IDE
|
||||||
delete mWorkspace;
|
delete mWorkspace;
|
||||||
mWorkspace = new Workspace();
|
mWorkspace = new Workspace();
|
||||||
|
|
||||||
|
mErrorsPanel.Clear();
|
||||||
|
|
||||||
OutputLine("Workspace closed.");
|
OutputLine("Workspace closed.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2332,9 +2355,9 @@ namespace IDE
|
||||||
}
|
}
|
||||||
|
|
||||||
//Directory.CreateDirectory(mWorkspace.mDir).IgnoreError();
|
//Directory.CreateDirectory(mWorkspace.mDir).IgnoreError();
|
||||||
|
//int lastSlashPos = mWorkspace.mDir.LastIndexOf(IDEUtils.cNativeSlash);
|
||||||
int lastSlashPos = mWorkspace.mDir.LastIndexOf(IDEUtils.cNativeSlash);
|
String projectName = mWorkspace.mName;
|
||||||
String projectName = scope String(mWorkspace.mDir, lastSlashPos + 1);
|
Debug.Assert(!projectName.IsWhiteSpace);
|
||||||
|
|
||||||
String projectPath = scope String(mWorkspace.mDir);
|
String projectPath = scope String(mWorkspace.mDir);
|
||||||
Utils.GetDirWithSlash(projectPath);
|
Utils.GetDirWithSlash(projectPath);
|
||||||
|
@ -3085,10 +3108,12 @@ namespace IDE
|
||||||
|
|
||||||
if (!mRunningTestScript)
|
if (!mRunningTestScript)
|
||||||
{
|
{
|
||||||
|
#if !CLI
|
||||||
if (!mWorkspace.IsDebugSession)
|
if (!mWorkspace.IsDebugSession)
|
||||||
success &= SaveWorkspaceUserData();
|
success &= SaveWorkspaceUserData();
|
||||||
if (mSettings.mLoadedSettings)
|
if (mSettings.mLoadedSettings)
|
||||||
mSettings.Save();
|
mSettings.Save();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
MarkDirty();
|
MarkDirty();
|
||||||
|
@ -6639,6 +6664,8 @@ namespace IDE
|
||||||
outStr = scope:: String(format);
|
outStr = scope:: String(format);
|
||||||
outStr.Replace("\r", "");
|
outStr.Replace("\r", "");
|
||||||
#if CLI
|
#if CLI
|
||||||
|
if (outStr.StartsWith("ERROR:"))
|
||||||
|
mFailed = true;
|
||||||
Console.WriteLine(outStr);
|
Console.WriteLine(outStr);
|
||||||
#else
|
#else
|
||||||
outStr.Append("\n");
|
outStr.Append("\n");
|
||||||
|
@ -9491,6 +9518,7 @@ namespace IDE
|
||||||
return;
|
return;
|
||||||
|
|
||||||
OnWatchedFileChanged(project.mRootFolder, .FileCreated, srcPath);
|
OnWatchedFileChanged(project.mRootFolder, .FileCreated, srcPath);
|
||||||
|
|
||||||
if (project.IsEmpty)
|
if (project.IsEmpty)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -9509,10 +9537,9 @@ namespace IDE
|
||||||
{
|
{
|
||||||
if (mWorkspace.mStartupProject.IsEmpty)
|
if (mWorkspace.mStartupProject.IsEmpty)
|
||||||
{
|
{
|
||||||
|
#if !CLI
|
||||||
DarkDialog dlg = new DarkDialog("Initialize Project?",
|
DarkDialog dlg = new DarkDialog("Initialize Project?",
|
||||||
"""
|
scope String("The project does not contain any source code. Do you want to auto-generate some startup code?", mWorkspace.mStartupProject.mProjectName)
|
||||||
This project does not contain any source code. Do you want to auto-generate some startup code?
|
|
||||||
"""
|
|
||||||
, DarkTheme.sDarkTheme.mIconError);
|
, DarkTheme.sDarkTheme.mIconError);
|
||||||
dlg.mWindowFlags |= .Modal;
|
dlg.mWindowFlags |= .Modal;
|
||||||
dlg.AddYesNoButtons(new (dlg) =>
|
dlg.AddYesNoButtons(new (dlg) =>
|
||||||
|
@ -9524,7 +9551,9 @@ namespace IDE
|
||||||
|
|
||||||
});
|
});
|
||||||
dlg.PopupWindow(GetActiveWindow());
|
dlg.PopupWindow(GetActiveWindow());
|
||||||
|
#else
|
||||||
|
OutputErrorLine("The project '{}' does not contain any source code. Run with '-generate' to auto-generate some startup code.", mWorkspace.mStartupProject.mProjectName);
|
||||||
|
#endif
|
||||||
OutputLine("Aborted - no startup project code found.");
|
OutputLine("Aborted - no startup project code found.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -11692,8 +11721,8 @@ namespace IDE
|
||||||
{
|
{
|
||||||
CompilerLog("IDEApp.OnWatchedFileChanged {} {} {}", projectItem.mName, changeType, newPath);
|
CompilerLog("IDEApp.OnWatchedFileChanged {} {} {}", projectItem.mName, changeType, newPath);
|
||||||
|
|
||||||
ProjectListViewItem listViewItem;
|
ProjectListViewItem listViewItem = null;
|
||||||
mProjectPanel.mProjectToListViewMap.TryGetValue(projectItem, out listViewItem);
|
mProjectPanel?.mProjectToListViewMap.TryGetValue(projectItem, out listViewItem);
|
||||||
|
|
||||||
String newName = null;
|
String newName = null;
|
||||||
if (newPath != null)
|
if (newPath != null)
|
||||||
|
@ -11708,6 +11737,7 @@ namespace IDE
|
||||||
{
|
{
|
||||||
let projectFileItem = projectItem as ProjectFileItem;
|
let projectFileItem = projectItem as ProjectFileItem;
|
||||||
|
|
||||||
|
if (listViewItem != null)
|
||||||
listViewItem.Label = newName;
|
listViewItem.Label = newName;
|
||||||
|
|
||||||
String oldPath = scope String();
|
String oldPath = scope String();
|
||||||
|
@ -11715,14 +11745,14 @@ namespace IDE
|
||||||
projectFileItem.Rename(newName);
|
projectFileItem.Rename(newName);
|
||||||
|
|
||||||
FileRenamed(projectFileItem, oldPath, newPath);
|
FileRenamed(projectFileItem, oldPath, newPath);
|
||||||
mProjectPanel.SortItem((ProjectListViewItem)listViewItem.mParentItem);
|
mProjectPanel?.SortItem((ProjectListViewItem)listViewItem.mParentItem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (changeType == .Deleted)
|
else if (changeType == .Deleted)
|
||||||
{
|
{
|
||||||
if (projectItem.mIncludeKind == .Auto)
|
if (projectItem.mIncludeKind == .Auto)
|
||||||
{
|
{
|
||||||
mProjectPanel.DoDeleteItem(listViewItem, null, true);
|
mProjectPanel?.DoDeleteItem(listViewItem, null, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (changeType == .FileCreated)
|
else if (changeType == .FileCreated)
|
||||||
|
@ -11742,11 +11772,14 @@ namespace IDE
|
||||||
projectFolder.AddChild(projectSource);
|
projectFolder.AddChild(projectSource);
|
||||||
projectFolder.MarkAsUnsorted();
|
projectFolder.MarkAsUnsorted();
|
||||||
|
|
||||||
|
if (mProjectPanel != null)
|
||||||
|
{
|
||||||
mProjectPanel.AddProjectItem(projectSource);
|
mProjectPanel.AddProjectItem(projectSource);
|
||||||
mProjectPanel.QueueSortItem(listViewItem);
|
mProjectPanel.QueueSortItem(listViewItem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if (changeType == .DirectoryCreated)
|
else if (changeType == .DirectoryCreated)
|
||||||
{
|
{
|
||||||
let projectFolder = projectItem as ProjectFolder;
|
let projectFolder = projectItem as ProjectFolder;
|
||||||
|
@ -11764,20 +11797,27 @@ namespace IDE
|
||||||
projectFolder.AddChild(newFolder);
|
projectFolder.AddChild(newFolder);
|
||||||
projectFolder.MarkAsUnsorted();
|
projectFolder.MarkAsUnsorted();
|
||||||
|
|
||||||
|
if (mProjectPanel != null)
|
||||||
|
{
|
||||||
mProjectPanel.AddProjectItem(newFolder);
|
mProjectPanel.AddProjectItem(newFolder);
|
||||||
mProjectPanel.QueueSortItem(listViewItem);
|
mProjectPanel.QueueSortItem(listViewItem);
|
||||||
|
}
|
||||||
|
|
||||||
newFolder.mAutoInclude = true;
|
newFolder.mAutoInclude = true;
|
||||||
|
if (mProjectPanel != null)
|
||||||
mProjectPanel.QueueRehupFolder(newFolder);
|
mProjectPanel.QueueRehupFolder(newFolder);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (changeType == .Failed)
|
else if (changeType == .Failed)
|
||||||
|
{
|
||||||
|
if (mProjectPanel != null)
|
||||||
{
|
{
|
||||||
if (let projectFolder = projectItem as ProjectFolder)
|
if (let projectFolder = projectItem as ProjectFolder)
|
||||||
mProjectPanel.QueueRehupFolder(projectFolder);
|
mProjectPanel.QueueRehupFolder(projectFolder);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void UpdateWorkspace()
|
void UpdateWorkspace()
|
||||||
{
|
{
|
||||||
|
@ -12091,7 +12131,7 @@ namespace IDE
|
||||||
DarkTheme.sDarkTheme.mIconWarning);
|
DarkTheme.sDarkTheme.mIconWarning);
|
||||||
dialog.mDefaultButton = dialog.AddButton("Yes", new (evt) =>
|
dialog.mDefaultButton = dialog.AddButton("Yes", new (evt) =>
|
||||||
{
|
{
|
||||||
DoOpenWorkspace();
|
DoOpenWorkspace(true);
|
||||||
});
|
});
|
||||||
dialog.AddButton("No", new (evt) =>
|
dialog.AddButton("No", new (evt) =>
|
||||||
{
|
{
|
||||||
|
@ -12107,7 +12147,7 @@ namespace IDE
|
||||||
DarkTheme.sDarkTheme.mIconWarning);
|
DarkTheme.sDarkTheme.mIconWarning);
|
||||||
dialog.mDefaultButton = dialog.AddButton("Yes", new (evt) =>
|
dialog.mDefaultButton = dialog.AddButton("Yes", new (evt) =>
|
||||||
{
|
{
|
||||||
DoOpenWorkspace();
|
DoOpenWorkspace(true);
|
||||||
});
|
});
|
||||||
dialog.AddButton("No", new (evt) =>
|
dialog.AddButton("No", new (evt) =>
|
||||||
{
|
{
|
||||||
|
@ -12118,7 +12158,7 @@ namespace IDE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DoOpenWorkspace();
|
DoOpenWorkspace(true);
|
||||||
if (mDeferredOpen != .None)
|
if (mDeferredOpen != .None)
|
||||||
mDeferredOpen = _;
|
mDeferredOpen = _;
|
||||||
case .Workspace:
|
case .Workspace:
|
||||||
|
|
|
@ -222,6 +222,18 @@ namespace IDE.ui
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Clear()
|
||||||
|
{
|
||||||
|
using (mMonitor.Enter())
|
||||||
|
{
|
||||||
|
ClearParserErrors(null);
|
||||||
|
ClearAndDeleteItems(mResolveErrors);
|
||||||
|
mErrorsDirty = true;
|
||||||
|
mErrorCount = 0;
|
||||||
|
mWarningCount = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ProcessErrors()
|
void ProcessErrors()
|
||||||
{
|
{
|
||||||
using (mMonitor.Enter())
|
using (mMonitor.Enter())
|
||||||
|
|
|
@ -22,7 +22,7 @@ namespace IDE.ui
|
||||||
"Library",
|
"Library",
|
||||||
"Dynamic Library",
|
"Dynamic Library",
|
||||||
"Custom Build");
|
"Custom Build");
|
||||||
public bool mDirChanged;
|
public bool mNameChanged;
|
||||||
public String mDirBase ~ delete _;
|
public String mDirBase ~ delete _;
|
||||||
|
|
||||||
public this()
|
public this()
|
||||||
|
@ -155,15 +155,16 @@ namespace IDE.ui
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdateProjectDir()
|
public void UpdateProjectName()
|
||||||
{
|
{
|
||||||
if ((!mDirChanged) && (!mDirBase.IsEmpty))
|
if (!mNameChanged)
|
||||||
{
|
{
|
||||||
String dirPath = scope .();
|
String path = scope .();
|
||||||
dirPath.Append(mDirBase);
|
mDirectoryEdit.GetText(path);
|
||||||
dirPath.Append(Path.DirectorySeparatorChar);
|
|
||||||
mNameEdit.GetText(dirPath);
|
String projName = scope .();
|
||||||
mDirectoryEdit.SetText(dirPath);
|
Path.GetFileName(path, projName);
|
||||||
|
mNameEdit.SetText(projName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -171,11 +172,6 @@ namespace IDE.ui
|
||||||
{
|
{
|
||||||
mDefaultButton = AddButton("Create", new (evt) => { if (!CreateProject()) evt.mCloseDialog = false; });
|
mDefaultButton = AddButton("Create", new (evt) => { if (!CreateProject()) evt.mCloseDialog = false; });
|
||||||
mEscButton = AddButton("Cancel", new (evt) => Close());
|
mEscButton = AddButton("Cancel", new (evt) => Close());
|
||||||
mNameEdit = AddEdit("");
|
|
||||||
mNameEdit.mOnContentChanged.Add(new (dlg) =>
|
|
||||||
{
|
|
||||||
UpdateProjectDir();
|
|
||||||
});
|
|
||||||
|
|
||||||
if (gApp.mWorkspace.IsInitialized)
|
if (gApp.mWorkspace.IsInitialized)
|
||||||
mDirBase = new String(gApp.mWorkspace.mDir);
|
mDirBase = new String(gApp.mWorkspace.mDir);
|
||||||
|
@ -185,10 +181,16 @@ namespace IDE.ui
|
||||||
AddEdit(mDirectoryEdit);
|
AddEdit(mDirectoryEdit);
|
||||||
mDirectoryEdit.mOnContentChanged.Add(new (dlg) =>
|
mDirectoryEdit.mOnContentChanged.Add(new (dlg) =>
|
||||||
{
|
{
|
||||||
if (mDirectoryEdit.mHasFocus)
|
UpdateProjectName();
|
||||||
mDirChanged = true;
|
|
||||||
});
|
});
|
||||||
UpdateProjectDir();
|
|
||||||
|
mNameEdit = AddEdit("");
|
||||||
|
mNameEdit.mOnContentChanged.Add(new (dlg) =>
|
||||||
|
{
|
||||||
|
if (mNameEdit.mHasFocus)
|
||||||
|
mNameChanged = true;
|
||||||
|
});
|
||||||
|
UpdateProjectName();
|
||||||
|
|
||||||
mTargetComboBox = new DarkComboBox();
|
mTargetComboBox = new DarkComboBox();
|
||||||
mTargetComboBox.Label = sApplicationTypeNames[0];
|
mTargetComboBox.Label = sApplicationTypeNames[0];
|
||||||
|
@ -211,7 +213,7 @@ namespace IDE.ui
|
||||||
public override void PopupWindow(WidgetWindow parentWindow, float offsetX = 0, float offsetY = 0)
|
public override void PopupWindow(WidgetWindow parentWindow, float offsetX = 0, float offsetY = 0)
|
||||||
{
|
{
|
||||||
base.PopupWindow(parentWindow, offsetX, offsetY);
|
base.PopupWindow(parentWindow, offsetX, offsetY);
|
||||||
mNameEdit.SetFocus();
|
mDirectoryEdit.SetFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void ResizeComponents()
|
public override void ResizeComponents()
|
||||||
|
@ -222,18 +224,18 @@ namespace IDE.ui
|
||||||
mTargetComboBox.Resize(GS!(16), curY - GS!(36), mWidth - GS!(16) * 2, GS!(28));
|
mTargetComboBox.Resize(GS!(16), curY - GS!(36), mWidth - GS!(16) * 2, GS!(28));
|
||||||
|
|
||||||
curY -= GS!(40);
|
curY -= GS!(40);
|
||||||
mDirectoryEdit.Resize(GS!(16), curY - GS!(36), mWidth - GS!(16) * 2, GS!(24));
|
mNameEdit.Resize(GS!(16), curY - GS!(36), mWidth - GS!(16) * 2, GS!(24));
|
||||||
|
|
||||||
curY -= GS!(50);
|
curY -= GS!(50);
|
||||||
mNameEdit.Resize(GS!(16), curY - GS!(36), mWidth - GS!(16) * 2, GS!(24));
|
mDirectoryEdit.Resize(GS!(16), curY - GS!(36), mWidth - GS!(16) * 2, GS!(24));
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Draw(Graphics g)
|
public override void Draw(Graphics g)
|
||||||
{
|
{
|
||||||
base.Draw(g);
|
base.Draw(g);
|
||||||
|
|
||||||
g.DrawString("Project Name", mNameEdit.mX, mNameEdit.mY - GS!(20));
|
|
||||||
g.DrawString("Project Directory", mDirectoryEdit.mX, mDirectoryEdit.mY - GS!(20));
|
g.DrawString("Project Directory", mDirectoryEdit.mX, mDirectoryEdit.mY - GS!(20));
|
||||||
|
g.DrawString("Project Name", mNameEdit.mX, mNameEdit.mY - GS!(20));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2248,7 +2248,7 @@ BeMCOperand BeMCContext::GetOperand(BeValue* value, bool allowMetaResult, bool a
|
||||||
mcOperand.mKind = BeMCOperandKind_Immediate_i64;
|
mcOperand.mKind = BeMCOperandKind_Immediate_i64;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
NotImpl();
|
Fail("Unhandled constant type");
|
||||||
}
|
}
|
||||||
mcOperand.mImmediate = constant->mInt64;
|
mcOperand.mImmediate = constant->mInt64;
|
||||||
return mcOperand;
|
return mcOperand;
|
||||||
|
@ -3585,7 +3585,7 @@ void BeMCContext::CreatePhiAssign(BeMCBlock* mcBlock, const BeMCOperand& testVal
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
NotImpl();
|
SoftFail("Unhandled CreatePhiAssign value");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4026,7 +4026,7 @@ bool BeMCContext::CouldBeReg(const BeMCOperand& operand)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BeMCContext::CheckForce(BeMCVRegInfo * vregInfo)
|
bool BeMCContext::CheckForce(BeMCVRegInfo* vregInfo)
|
||||||
{
|
{
|
||||||
if (!vregInfo->mIsRetVal)
|
if (!vregInfo->mIsRetVal)
|
||||||
{
|
{
|
||||||
|
@ -6080,7 +6080,7 @@ void BeMCContext::EmitModRM_XMM_IMM(int rx, BeMCOperand & imm)
|
||||||
sym = mCOFFObject->GetCOMDAT(name, data, 16, 16);
|
sym = mCOFFObject->GetCOMDAT(name, data, 16, 16);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
NotImpl();
|
SoftFail("Unhandled value type in EmitModRM_XMM_IMM");
|
||||||
|
|
||||||
BeMCRelocation reloc;
|
BeMCRelocation reloc;
|
||||||
reloc.mKind = BeMCRelocationKind_REL32;
|
reloc.mKind = BeMCRelocationKind_REL32;
|
||||||
|
@ -9993,6 +9993,14 @@ bool BeMCContext::DoLegalization()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case BeMCInstKind_DefPhi:
|
||||||
|
{
|
||||||
|
// This is from a PHI whose value was not used
|
||||||
|
RemoveInst(mcBlock, instIdx);
|
||||||
|
instIdx--;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((pendingInitKind != BfIRInitType_NotNeeded) && (pendingInitKind != BfIRInitType_NotNeeded_AliveOnDecl))
|
if ((pendingInitKind != BfIRInitType_NotNeeded) && (pendingInitKind != BfIRInitType_NotNeeded_AliveOnDecl))
|
||||||
|
@ -13860,7 +13868,8 @@ void BeMCContext::DoCodeEmission()
|
||||||
//mOut.Write((uint8)0xC3);
|
//mOut.Write((uint8)0xC3);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
NotImpl();
|
SoftFail("Unhandled instruction in DoCodeEmission", inst->mDbgLoc);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14747,7 +14756,7 @@ void BeMCContext::Generate(BeFunction* function)
|
||||||
mDbgPreferredRegs[32] = X64Reg_R8;*/
|
mDbgPreferredRegs[32] = X64Reg_R8;*/
|
||||||
|
|
||||||
//mDbgPreferredRegs[8] = X64Reg_RAX;
|
//mDbgPreferredRegs[8] = X64Reg_RAX;
|
||||||
//mDebugging = function->mName ==
|
//mDebugging = function->mName == "?Do@ClassA@bf@@QEAAXXZ";
|
||||||
//"?ColorizeCodeString@IDEUtils@IDE@bf@@SAXPEAVString@System@3@W4CodeKind@123@@Z";
|
//"?ColorizeCodeString@IDEUtils@IDE@bf@@SAXPEAVString@System@3@W4CodeKind@123@@Z";
|
||||||
//"?Main@Program@bf@@CAHPEAV?$Array1@PEAVString@System@bf@@@System@2@@Z";
|
//"?Main@Program@bf@@CAHPEAV?$Array1@PEAVString@System@bf@@@System@2@@Z";
|
||||||
|
|
||||||
|
@ -15674,7 +15683,7 @@ void BeMCContext::Generate(BeFunction* function)
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
SoftFail("Invalid GEP");
|
SoftFail("Invalid GEP", inst->mDbgLoc);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -16350,7 +16359,7 @@ void BeMCContext::Generate(BeFunction* function)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
NotImpl();
|
Fail("Unhandled BeInst type");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6890,11 +6890,14 @@ BfTypedValue BfModule::FlushNullConditional(BfTypedValue result, bool ignoreNull
|
||||||
if (nullableTypedValue)
|
if (nullableTypedValue)
|
||||||
{
|
{
|
||||||
auto elementType = nullableType->GetUnderlyingType();
|
auto elementType = nullableType->GetUnderlyingType();
|
||||||
if (elementType->IsValuelessType())
|
if (elementType->IsVar())
|
||||||
|
{
|
||||||
|
// Do nothing
|
||||||
|
}
|
||||||
|
else if (elementType->IsValuelessType())
|
||||||
{
|
{
|
||||||
BfIRValue ptrValue = mBfIRBuilder->CreateInBoundsGEP(nullableTypedValue.mValue, 0, 1); // mHasValue
|
BfIRValue ptrValue = mBfIRBuilder->CreateInBoundsGEP(nullableTypedValue.mValue, 0, 1); // mHasValue
|
||||||
mBfIRBuilder->CreateStore(GetConstValue(1, GetPrimitiveType(BfTypeCode_Boolean)), ptrValue);
|
mBfIRBuilder->CreateStore(GetConstValue(1, GetPrimitiveType(BfTypeCode_Boolean)), ptrValue);
|
||||||
result = nullableTypedValue;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -6902,8 +6905,8 @@ BfTypedValue BfModule::FlushNullConditional(BfTypedValue result, bool ignoreNull
|
||||||
mBfIRBuilder->CreateStore(result.mValue, ptrValue);
|
mBfIRBuilder->CreateStore(result.mValue, ptrValue);
|
||||||
ptrValue = mBfIRBuilder->CreateInBoundsGEP(nullableTypedValue.mValue, 0, 2); // mHasValue
|
ptrValue = mBfIRBuilder->CreateInBoundsGEP(nullableTypedValue.mValue, 0, 2); // mHasValue
|
||||||
mBfIRBuilder->CreateStore(GetConstValue(1, GetPrimitiveType(BfTypeCode_Boolean)), ptrValue);
|
mBfIRBuilder->CreateStore(GetConstValue(1, GetPrimitiveType(BfTypeCode_Boolean)), ptrValue);
|
||||||
result = nullableTypedValue;
|
|
||||||
}
|
}
|
||||||
|
result = nullableTypedValue;
|
||||||
}
|
}
|
||||||
mBfIRBuilder->CreateBr(pendingNullCond->mDoneBB);
|
mBfIRBuilder->CreateBr(pendingNullCond->mDoneBB);
|
||||||
|
|
||||||
|
|
|
@ -652,12 +652,13 @@ void BfModule::TypeFailed(BfTypeInstance* typeInstance)
|
||||||
{
|
{
|
||||||
BfLogSysM("TypeFailed: %p\n", typeInstance);
|
BfLogSysM("TypeFailed: %p\n", typeInstance);
|
||||||
typeInstance->mTypeFailed = true;
|
typeInstance->mTypeFailed = true;
|
||||||
// Punt on field types - just substitute System.Object where we have NULLs
|
// Punt on field types - just substitute 'var' where we have NULLs
|
||||||
for (auto& fieldInstance : typeInstance->mFieldInstances)
|
for (auto& fieldInstance : typeInstance->mFieldInstances)
|
||||||
{
|
{
|
||||||
if ((fieldInstance.mResolvedType == NULL) || (fieldInstance.mResolvedType->IsNull()))
|
if ((fieldInstance.mResolvedType == NULL) || (fieldInstance.mResolvedType->IsNull()))
|
||||||
{
|
{
|
||||||
fieldInstance.mResolvedType = mContext->mBfObjectType;
|
if (fieldInstance.mDataIdx >= 0)
|
||||||
|
fieldInstance.mResolvedType = GetPrimitiveType(BfTypeCode_Var);
|
||||||
}
|
}
|
||||||
if (fieldInstance.mOwner == NULL)
|
if (fieldInstance.mOwner == NULL)
|
||||||
fieldInstance.mOwner = typeInstance;
|
fieldInstance.mOwner = typeInstance;
|
||||||
|
@ -2268,6 +2269,8 @@ bool BfModule::DoPopulateType(BfType* resolvedTypeRef, BfPopulateType populateTy
|
||||||
if ((fieldInstance->mResolvedType != NULL) || (!fieldInstance->mFieldIncluded))
|
if ((fieldInstance->mResolvedType != NULL) || (!fieldInstance->mFieldIncluded))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
SetAndRestoreValue<BfFieldDef*> prevTypeRef(mContext->mCurTypeState->mCurFieldDef, field);
|
||||||
|
|
||||||
BfType* resolvedFieldType = NULL;
|
BfType* resolvedFieldType = NULL;
|
||||||
|
|
||||||
if (field->IsEnumCaseEntry())
|
if (field->IsEnumCaseEntry())
|
||||||
|
@ -2305,7 +2308,6 @@ bool BfModule::DoPopulateType(BfType* resolvedTypeRef, BfPopulateType populateTy
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SetAndRestoreValue<BfFieldDef*> prevTypeRef(mContext->mCurTypeState->mCurFieldDef, field);
|
|
||||||
resolvedFieldType = ResolveTypeRef(field->mTypeRef, BfPopulateType_Declaration, BfResolveTypeRefFlag_NoResolveGenericParam);
|
resolvedFieldType = ResolveTypeRef(field->mTypeRef, BfPopulateType_Declaration, BfResolveTypeRefFlag_NoResolveGenericParam);
|
||||||
if (resolvedFieldType == NULL)
|
if (resolvedFieldType == NULL)
|
||||||
{
|
{
|
||||||
|
|
|
@ -198,7 +198,7 @@ BfAstNode* BfReducer::Fail(const StringImpl& errorMsg, BfAstNode* refNode)
|
||||||
if (mPassInstance->HasLastFailedAt(refNode)) // No duplicate failures
|
if (mPassInstance->HasLastFailedAt(refNode)) // No duplicate failures
|
||||||
return NULL;
|
return NULL;
|
||||||
auto error = mPassInstance->Fail(errorMsg, refNode);
|
auto error = mPassInstance->Fail(errorMsg, refNode);
|
||||||
if (error != NULL)
|
if ((error != NULL) && (mSource != NULL))
|
||||||
error->mProject = mSource->mProject;
|
error->mProject = mSource->mProject;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -207,7 +207,7 @@ BfAstNode* BfReducer::FailAfter(const StringImpl& errorMsg, BfAstNode* prevNode)
|
||||||
{
|
{
|
||||||
mStmtHasError = true;
|
mStmtHasError = true;
|
||||||
auto error = mPassInstance->FailAfter(errorMsg, prevNode);
|
auto error = mPassInstance->FailAfter(errorMsg, prevNode);
|
||||||
if (error != NULL)
|
if ((error != NULL) && (mSource != NULL))
|
||||||
error->mProject = mSource->mProject;
|
error->mProject = mSource->mProject;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -4299,7 +4299,7 @@ BfAstNode* BfReducer::CreateStatement(BfAstNode* node, CreateStmtFlags createStm
|
||||||
return stmt;
|
return stmt;
|
||||||
|
|
||||||
auto error = mPassInstance->FailAfterAt("Semicolon expected", node->GetSourceData(), stmt->GetSrcEnd() - 1);
|
auto error = mPassInstance->FailAfterAt("Semicolon expected", node->GetSourceData(), stmt->GetSrcEnd() - 1);
|
||||||
if (error != NULL)
|
if ((error != NULL) && (mSource != NULL))
|
||||||
error->mProject = mSource->mProject;
|
error->mProject = mSource->mProject;
|
||||||
mPrevStmtHadError = true;
|
mPrevStmtHadError = true;
|
||||||
return stmt;
|
return stmt;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue