1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-19 00:20:25 +02:00

Fixed some IDE issues

Fixed some issues related to creating new projects and workspace
Added 'Refresh' option to project
Fixed auto-include refresh
Fixed folder rename
Fixed EOF issue involving DbgModule string table
This commit is contained in:
Brian Fiete 2019-09-05 08:18:24 -07:00
parent 8a02874b51
commit 0ce6e44523
14 changed files with 374 additions and 163 deletions

View file

@ -84,7 +84,19 @@ namespace IDE
void FileChanged(String filePath, String newPath, WatcherChangeTypes changeType)
{
if (changeType == .Renamed)
bool isDirectory = filePath.EndsWith(Path.DirectorySeparatorChar);
var newPath;
if (isDirectory)
{
if (newPath.EndsWith(Path.DirectorySeparatorChar))
{
newPath = scope:: String();
newPath.Append(@newPath, 0, @newPath.Length - 1);
}
}
if ((changeType == .Renamed) && (!isDirectory))
{
// ALWAYS interpret 'file rename' notifications as a delete of filePath and a create of newPath
// A manual rename in the IDE will have manually processed the rename before we get here, so
@ -258,7 +270,7 @@ namespace IDE
if (newName != null)
{
var newFullPath = new String();
Path.GetDirectoryPath(fullPath, newFullPath);
newFullPath.Append(fileSystemWatcher.Directory);
newFullPath.Append(Path.DirectorySeparatorChar);
newFullPath.Append(newName);
queuedFileChange.mNewFileName = newFullPath;
@ -363,7 +375,19 @@ namespace IDE
CheckFileCreated(newName);
}
else
QueueFileChanged(fileSystemWatcher, oldName, newName, .Renamed);
{
var newFilePath = scope String();
GetPath(newName, newFilePath);
if (Directory.Exists(newFilePath))
{
let dirOldName = scope String()..Concat(oldName, Path.DirectorySeparatorChar);
let dirNewName = scope String()..Concat(newName, Path.DirectorySeparatorChar);
QueueFileChanged(fileSystemWatcher, dirOldName, dirNewName, .Renamed);
}
else
QueueFileChanged(fileSystemWatcher, oldName, newName, .Renamed);
}
}
});
fileSystemWatcher.OnError.Add(new () => QueueFileChanged(fileSystemWatcher, null, null, .Failed));