|
@@ -177,7 +177,7 @@ namespace GodotTools
|
|
|
|
|
|
private static readonly string[] VsCodeNames =
|
|
private static readonly string[] VsCodeNames =
|
|
{
|
|
{
|
|
- "code", "code-oss", "vscode", "vscode-oss", "visual-studio-code", "visual-studio-code-oss"
|
|
|
|
|
|
+ "code", "code-oss", "vscode", "vscode-oss", "visual-studio-code", "visual-studio-code-oss", "codium"
|
|
};
|
|
};
|
|
|
|
|
|
[UsedImplicitly]
|
|
[UsedImplicitly]
|
|
@@ -330,7 +330,7 @@ namespace GodotTools
|
|
args.Add("-b");
|
|
args.Add("-b");
|
|
args.Add(vscodeBundleId);
|
|
args.Add(vscodeBundleId);
|
|
|
|
|
|
- // The reusing of existing windows made by the 'open' command might not choose a wubdiw that is
|
|
|
|
|
|
+ // The reusing of existing windows made by the 'open' command might not choose a window that is
|
|
// editing our folder. It's better to ask for a new window and let VSCode do the window management.
|
|
// editing our folder. It's better to ask for a new window and let VSCode do the window management.
|
|
args.Add("-n");
|
|
args.Add("-n");
|
|
|
|
|
|
@@ -339,6 +339,28 @@ namespace GodotTools
|
|
|
|
|
|
args.Add("--args");
|
|
args.Add("--args");
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ // Try VSCodium as a fallback if Visual Studio Code can't be found.
|
|
|
|
+ if (!macOSAppBundleInstalled)
|
|
|
|
+ {
|
|
|
|
+ const string VscodiumBundleId = "com.vscodium.codium";
|
|
|
|
+ macOSAppBundleInstalled = Internal.IsMacOSAppBundleInstalled(VscodiumBundleId);
|
|
|
|
+
|
|
|
|
+ if (macOSAppBundleInstalled)
|
|
|
|
+ {
|
|
|
|
+ args.Add("-b");
|
|
|
|
+ args.Add(VscodiumBundleId);
|
|
|
|
+
|
|
|
|
+ // The reusing of existing windows made by the 'open' command might not choose a window that is
|
|
|
|
+ // editing our folder. It's better to ask for a new window and let VSCode do the window management.
|
|
|
|
+ args.Add("-n");
|
|
|
|
+
|
|
|
|
+ // The open process must wait until the application finishes (which is instant in VSCode's case)
|
|
|
|
+ args.Add("--wait-apps");
|
|
|
|
+
|
|
|
|
+ args.Add("--args");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
args.Add(Path.GetDirectoryName(GodotSharpDirs.ProjectSlnPath)!);
|
|
args.Add(Path.GetDirectoryName(GodotSharpDirs.ProjectSlnPath)!);
|
|
@@ -361,7 +383,7 @@ namespace GodotTools
|
|
{
|
|
{
|
|
if (!macOSAppBundleInstalled && string.IsNullOrEmpty(_vsCodePath))
|
|
if (!macOSAppBundleInstalled && string.IsNullOrEmpty(_vsCodePath))
|
|
{
|
|
{
|
|
- GD.PushError("Cannot find code editor: VSCode");
|
|
|
|
|
|
+ GD.PushError("Cannot find code editor: Visual Studio Code or VSCodium");
|
|
return Error.FileNotFound;
|
|
return Error.FileNotFound;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -371,7 +393,7 @@ namespace GodotTools
|
|
{
|
|
{
|
|
if (string.IsNullOrEmpty(_vsCodePath))
|
|
if (string.IsNullOrEmpty(_vsCodePath))
|
|
{
|
|
{
|
|
- GD.PushError("Cannot find code editor: VSCode");
|
|
|
|
|
|
+ GD.PushError("Cannot find code editor: Visual Studio Code or VSCodium");
|
|
return Error.FileNotFound;
|
|
return Error.FileNotFound;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -384,7 +406,7 @@ namespace GodotTools
|
|
}
|
|
}
|
|
catch (Exception e)
|
|
catch (Exception e)
|
|
{
|
|
{
|
|
- GD.PushError($"Error when trying to run code editor: VSCode. Exception message: '{e.Message}'");
|
|
|
|
|
|
+ GD.PushError($"Error when trying to run code editor: Visual Studio Code or VSCodium. Exception message: '{e.Message}'");
|
|
}
|
|
}
|
|
|
|
|
|
break;
|
|
break;
|
|
@@ -550,7 +572,7 @@ namespace GodotTools
|
|
{
|
|
{
|
|
settingsHintStr += $",Visual Studio:{(int)ExternalEditorId.VisualStudio}" +
|
|
settingsHintStr += $",Visual Studio:{(int)ExternalEditorId.VisualStudio}" +
|
|
$",MonoDevelop:{(int)ExternalEditorId.MonoDevelop}" +
|
|
$",MonoDevelop:{(int)ExternalEditorId.MonoDevelop}" +
|
|
- $",Visual Studio Code:{(int)ExternalEditorId.VsCode}" +
|
|
|
|
|
|
+ $",Visual Studio Code and VSCodium:{(int)ExternalEditorId.VsCode}" +
|
|
$",JetBrains Rider and Fleet:{(int)ExternalEditorId.Rider}" +
|
|
$",JetBrains Rider and Fleet:{(int)ExternalEditorId.Rider}" +
|
|
$",Custom:{(int)ExternalEditorId.CustomEditor}";
|
|
$",Custom:{(int)ExternalEditorId.CustomEditor}";
|
|
}
|
|
}
|
|
@@ -558,14 +580,14 @@ namespace GodotTools
|
|
{
|
|
{
|
|
settingsHintStr += $",Visual Studio:{(int)ExternalEditorId.VisualStudioForMac}" +
|
|
settingsHintStr += $",Visual Studio:{(int)ExternalEditorId.VisualStudioForMac}" +
|
|
$",MonoDevelop:{(int)ExternalEditorId.MonoDevelop}" +
|
|
$",MonoDevelop:{(int)ExternalEditorId.MonoDevelop}" +
|
|
- $",Visual Studio Code:{(int)ExternalEditorId.VsCode}" +
|
|
|
|
|
|
+ $",Visual Studio Code and VSCodium:{(int)ExternalEditorId.VsCode}" +
|
|
$",JetBrains Rider and Fleet:{(int)ExternalEditorId.Rider}" +
|
|
$",JetBrains Rider and Fleet:{(int)ExternalEditorId.Rider}" +
|
|
$",Custom:{(int)ExternalEditorId.CustomEditor}";
|
|
$",Custom:{(int)ExternalEditorId.CustomEditor}";
|
|
}
|
|
}
|
|
else if (OS.IsUnixLike)
|
|
else if (OS.IsUnixLike)
|
|
{
|
|
{
|
|
settingsHintStr += $",MonoDevelop:{(int)ExternalEditorId.MonoDevelop}" +
|
|
settingsHintStr += $",MonoDevelop:{(int)ExternalEditorId.MonoDevelop}" +
|
|
- $",Visual Studio Code:{(int)ExternalEditorId.VsCode}" +
|
|
|
|
|
|
+ $",Visual Studio Code and VSCodium:{(int)ExternalEditorId.VsCode}" +
|
|
$",JetBrains Rider and Fleet:{(int)ExternalEditorId.Rider}" +
|
|
$",JetBrains Rider and Fleet:{(int)ExternalEditorId.Rider}" +
|
|
$",Custom:{(int)ExternalEditorId.CustomEditor}";
|
|
$",Custom:{(int)ExternalEditorId.CustomEditor}";
|
|
}
|
|
}
|