open new file on create

This commit is contained in:
Matt Parker
2025-10-20 21:48:59 +10:00
parent 8ac96b3835
commit 0a913a8e26
5 changed files with 10 additions and 7 deletions

View File

@@ -73,12 +73,13 @@ public partial class NewCsharpFileDialog : ConfirmationDialog
_ = Task.GodotRun(async () =>
{
await _ideFileOperationsService.CreateCsFile(ParentNode, fileName);
var sharpIdeFile = await _ideFileOperationsService.CreateCsFile(ParentNode, fileName);
GodotGlobalEvents.Instance.FileExternallySelected.InvokeParallelFireAndForget(sharpIdeFile, null);
});
QueueFree();
}
private bool IsNameInvalid(string name)
private static bool IsNameInvalid(string name)
{
return string.IsNullOrWhiteSpace(name);
}

View File

@@ -43,7 +43,7 @@ public partial class SolutionExplorerPanel
}
else if (actionId is FileContextMenuOptions.Delete)
{
var confirmedTcs = new TaskCompletionSource<bool>();
var confirmedTcs = new TaskCompletionSource<bool>(TaskCreationOptions.RunContinuationsAsynchronously);
var confirmationDialog = new ConfirmationDialog();
confirmationDialog.Title = "Delete";
confirmationDialog.DialogText = $"Delete '{file.Name}' file?";

View File

@@ -45,7 +45,7 @@ public partial class SolutionExplorerPanel
}
else if (actionId is FolderContextMenuOptions.Delete)
{
var confirmedTcs = new TaskCompletionSource<bool>();
var confirmedTcs = new TaskCompletionSource<bool>(TaskCreationOptions.RunContinuationsAsynchronously);
var confirmationDialog = new ConfirmationDialog();
confirmationDialog.Title = "Delete";
confirmationDialog.DialogText = $"Delete '{folder.Name}' file?";