diff --git a/BeefLibs/Beefy2D/src/utils/StructuredData.bf b/BeefLibs/Beefy2D/src/utils/StructuredData.bf index 91a39191..0417c93a 100644 --- a/BeefLibs/Beefy2D/src/utils/StructuredData.bf +++ b/BeefLibs/Beefy2D/src/utils/StructuredData.bf @@ -410,6 +410,7 @@ namespace Beefy.utils result = Enum.Parse((StringView)obj); else return; + if (result case .Ok(var parsedVal)) val = parsedVal; } diff --git a/IDE/dist/BeefConfig.toml b/IDE/dist/BeefConfig.toml index 3c0cdd01..5f8a0629 100644 --- a/IDE/dist/BeefConfig.toml +++ b/IDE/dist/BeefConfig.toml @@ -1,19 +1,6 @@ +Version = 1 +UnversionedLibDirs = ["../../BeefLibs"] + [Registry.minlib] Version = "1.0.0" Location = { Path = "../mintest/minlib" } - -[Registry.corlib] -Version = "1.0.0" -Location = { Path = "../../BeefLibs/corlib" } - -[Registry.Beefy2D] -Version = "1.0.0" -Location = { Path = "../../BeefLibs/Beefy2D" } - -[Registry.SDL2] -Version = "1.0.0" -Location = { Path = "../../BeefLibs/SDL2" } - -[Registry.MiniZ] -Version = "1.0.0" -Location = { Path = "../../BeefLibs/MiniZ" } \ No newline at end of file diff --git a/IDE/dist/BeefConfig_host.toml b/IDE/dist/BeefConfig_host.toml index d71d1571..969a8a12 100644 --- a/IDE/dist/BeefConfig_host.toml +++ b/IDE/dist/BeefConfig_host.toml @@ -1,8 +1,6 @@ +Version = 1 +UnversionedLibDirs = ["../../../BeefLibs"] + [Registry.minlib] Version = "1.0.0" Location = { Path = "../../mintest/minlib" } - -[Registry.corlib] -Version = "1.0.0" -Location = { Path = "../../../BeefLibs/corlib" } - diff --git a/IDE/dist/BeefConfig_install.toml b/IDE/dist/BeefConfig_install.toml index 852ecba7..08bf99ac 100644 --- a/IDE/dist/BeefConfig_install.toml +++ b/IDE/dist/BeefConfig_install.toml @@ -1,15 +1,2 @@ -[Registry.corlib] -Version = "1.0.0" -Location = { Path = "../BeefLibs/corlib" } - -[Registry.SDL2] -Version = "1.0.0" -Location = { Path = "../BeefLibs/SDL2" } - -[Registry.MiniZ] -Version = "1.0.0" -Location = { Path = "../BeefLibs/MiniZ" } - -[Registry.Beefy2D] -Version = "1.0.0" -Location = { Path = "../BeefLibs/Beefy2D" } \ No newline at end of file +Version = 1 +UnversionedLibDirs = ["../BeefLibs"] diff --git a/IDE/src/BeefConfig.bf b/IDE/src/BeefConfig.bf index 3cb74ff0..89ae68f7 100644 --- a/IDE/src/BeefConfig.bf +++ b/IDE/src/BeefConfig.bf @@ -63,7 +63,7 @@ namespace IDE regEntry.mLocation.Parse(data).IgnoreError(); } - for (data.Enumerate("LibDirs")) + for (data.Enumerate("UnversionedLibDirs")) { String dirStr = scope .(); data.GetCurString(dirStr); @@ -74,6 +74,39 @@ namespace IDE libDir.mPath = new String(dirStr); libDir.mConfigFile = configFile; mLibDirectories.Add(libDir); + + String absPath = scope .(); + Path.GetAbsolutePath(libDir.mPath, configFile.mConfigDir, absPath); + + for (var entry in Directory.EnumerateDirectories(absPath)) + { + String projName = scope .(); + entry.GetFileName(projName); + + String filePath = scope .(); + entry.GetFilePath(filePath); + + String projFilePath = scope .(); + projFilePath.Concat(filePath, "/BeefProj.toml"); + + if (File.Exists(projFilePath)) + { + RegistryEntry regEntry = new RegistryEntry(); + regEntry.mProjName = new String(projName); + mRegistry.Add(regEntry); + + regEntry.mConfigFile = configFile; + + var verString = scope String(); + data.GetString("Version", verString); + regEntry.mVersion = new SemVer(); + regEntry.mVersion.Parse("0.0.0"); + + regEntry.mLocation = new VerSpecRecord(); + using (data.Open("Location")) + regEntry.mLocation.SetPath(filePath); + } + } } } @@ -82,6 +115,11 @@ namespace IDE return .Ok; } + public void Refresh() + { + Load().IgnoreError(); + } + public void QueuePaths(StringView topLevelDir) { let dir = scope String(topLevelDir); @@ -96,7 +134,7 @@ namespace IDE if (File.Exists(path)) { if (mConfigPathQueue.Contains(path)) - break; // We have this and everthing under it already + break; // We have this and everything under it already mConfigPathQueue.Add(new String(path)); } @@ -116,6 +154,9 @@ namespace IDE public Result Load() { + ClearAndDeleteItems(mRegistry); + ClearAndDeleteItems(mConfigFiles); + for (int i = mConfigPathQueue.Count - 1; i >= 0; i--) { let path = mConfigPathQueue[i]; diff --git a/IDE/src/IDEApp.bf b/IDE/src/IDEApp.bf index 85eb6778..c9f59491 100644 --- a/IDE/src/IDEApp.bf +++ b/IDE/src/IDEApp.bf @@ -2225,6 +2225,8 @@ namespace IDE if (StructuredLoad(data, workspaceFileName) case .Err(let err)) { + mBeefConfig.Refresh(); + switch (err) { case .FormatError(int lineNum): diff --git a/IDE/src/ScriptManager.bf b/IDE/src/ScriptManager.bf index 36b84eed..9e416e5c 100644 --- a/IDE/src/ScriptManager.bf +++ b/IDE/src/ScriptManager.bf @@ -1762,6 +1762,30 @@ namespace IDE } } + [IDECommand] + public void AssertIsAtColumn(String fileName, int column) + { + String filePath = scope String(); + FixSrcPath(fileName, filePath); + + var sourceViewPanel = GetActiveSourceViewPanel(); + if (sourceViewPanel == null) + return; + + if (!Path.Equals(filePath, sourceViewPanel.mFilePath)) + { + ScriptManager.sActiveManager.Fail("Expected source file '{0}', got '{1}'", filePath, sourceViewPanel.mFilePath); + return; + } + + let atColumn = sourceViewPanel.mEditWidget.mEditWidgetContent.CursorLineAndColumn.mColumn + 1; + if (atColumn != column) + { + ScriptManager.sActiveManager.Fail("Expected column '{0}', got '{1}'", column, atColumn); + return; + } + } + [IDECommand] public void GotoTextSkip(String findText, int skipIdx) { diff --git a/IDE/src/ui/ProjectPanel.bf b/IDE/src/ui/ProjectPanel.bf index 3f56e554..9fcb90e7 100644 --- a/IDE/src/ui/ProjectPanel.bf +++ b/IDE/src/ui/ProjectPanel.bf @@ -1291,7 +1291,7 @@ namespace IDE.ui projectsReferenced.Add(selectedProjectItem.mProject); folderCount++; } - else if (selectedProjectItem is ProjectItem) + else { projectsReferenced.Add(selectedProjectItem.mProject); fileCount++; @@ -1749,6 +1749,8 @@ namespace IDE.ui void ImportProject() { #if !CLI + gApp.mBeefConfig.Refresh(); + var fileDialog = scope OpenFileDialog(); fileDialog.ShowReadOnly = false; fileDialog.Title = "Import Project";