Compare commits
4 Commits
269e8963e8
...
zed_editor
| Author | SHA1 | Date | |
|---|---|---|---|
| 6e61233a7b | |||
| bf59455412 | |||
| a016b9d47b | |||
| 7bdc08f8be |
@@ -14,6 +14,9 @@
|
||||
|
||||
#if PLATFORM_WINDOWS
|
||||
#include "Engine/Platform/Win32/IncludeWindowsHeaders.h"
|
||||
#elif PLATFORM_MAC
|
||||
#include "Engine/Platform/Apple/AppleUtils.h"
|
||||
#include <AppKit/AppKit.h>
|
||||
#endif
|
||||
|
||||
namespace
|
||||
@@ -218,6 +221,15 @@ void RiderCodeEditor::FindEditors(Array<CodeEditor*>* output)
|
||||
#endif
|
||||
|
||||
#if PLATFORM_MAC
|
||||
// System installed app
|
||||
NSURL* AppURL = [[NSWorkspace sharedWorkspace]URLForApplicationWithBundleIdentifier:@"com.jetbrains.rider"];
|
||||
if (AppURL != nullptr)
|
||||
{
|
||||
const String path = AppleUtils::ToString((CFStringRef)[AppURL path]);
|
||||
SearchDirectory(&installations, path / TEXT("/Contents/Resources"));
|
||||
}
|
||||
|
||||
// JetBrains Toolbox installations
|
||||
String applicationSupportFolder;
|
||||
FileSystem::GetSpecialFolderPath(SpecialFolder::ProgramData, applicationSupportFolder);
|
||||
|
||||
@@ -232,6 +244,7 @@ void RiderCodeEditor::FindEditors(Array<CodeEditor*>* output)
|
||||
|
||||
// Check the local installer version
|
||||
SearchDirectory(&installations, TEXT("/Applications/Rider.app/Contents/Resources"));
|
||||
SearchDirectory(&installations, TEXT("/Applications/Rider EAP.app/Contents/Resources"));
|
||||
#endif
|
||||
|
||||
for (const String& directory : subDirectories)
|
||||
|
||||
@@ -51,7 +51,7 @@ void ZedEditor::FindEditors(Array<CodeEditor*>* output)
|
||||
}
|
||||
#elif PLATFORM_LINUX
|
||||
char buffer[128];
|
||||
FILE* pipe = popen("/bin/bash -c \"type -p code\"", "r");
|
||||
FILE* pipe = popen("/bin/bash -c \"type -p zed\"", "r");
|
||||
if (pipe)
|
||||
{
|
||||
StringAnsi pathAnsi;
|
||||
@@ -66,7 +66,7 @@ void ZedEditor::FindEditors(Array<CodeEditor*>* output)
|
||||
}
|
||||
}
|
||||
{
|
||||
const String path(TEXT("/usr/bin/code"));
|
||||
const String path(TEXT("/usr/bin/zed"));
|
||||
if (FileSystem::FileExists(path))
|
||||
{
|
||||
output->Add(New<VisualStudioCodeEditor>(path, false));
|
||||
@@ -77,22 +77,31 @@ void ZedEditor::FindEditors(Array<CodeEditor*>* output)
|
||||
// Detect Flatpak installations
|
||||
{
|
||||
CreateProcessSettings procSettings;
|
||||
procSettings.FileName = TEXT("/bin/bash -c \"flatpak list --app --columns=application | grep com.visualstudio.code -c\"");
|
||||
procSettings.FileName = TEXT("/bin/bash -c \"flatpak list --app --columns=application | grep dev.zed.Zed -c\"");
|
||||
procSettings.HiddenWindow = true;
|
||||
if (Platform::CreateProcess(procSettings) == 0)
|
||||
{
|
||||
const String runPath(TEXT("flatpak run com.visualstudio.code"));
|
||||
output->Add(New<VisualStudioCodeEditor>(runPath, false));
|
||||
const String runPath(TEXT("flatpak run dev.zed.Zed"));
|
||||
output->Add(New<VisualStudioCodeEditor>(runPath));
|
||||
return;
|
||||
}
|
||||
}
|
||||
#elif PLATFORM_MAC
|
||||
// Prefer the Zed CLI application over bundled app, as this handles opening files in existing instance better.
|
||||
// The bundle also contains the CLI application under Zed.app/Contents/MacOS/zed, but using this doesn't make any difference.
|
||||
const String cliPath(TEXT("/usr/local/bin/zed"));
|
||||
if (FileSystem::FileExists(cliPath))
|
||||
{
|
||||
output->Add(New<ZedEditor>(cliPath));
|
||||
return;;
|
||||
}
|
||||
|
||||
// System installed app
|
||||
NSURL* AppURL = [[NSWorkspace sharedWorkspace]URLForApplicationWithBundleIdentifier:@"com.microsoft.VSCode"];
|
||||
NSURL* AppURL = [[NSWorkspace sharedWorkspace]URLForApplicationWithBundleIdentifier:@"dev.zed.Zed"];
|
||||
if (AppURL != nullptr)
|
||||
{
|
||||
const String path = AppleUtils::ToString((CFStringRef)[AppURL path]);
|
||||
output->Add(New<VisualStudioCodeEditor>(path, false));
|
||||
output->Add(New<ZedEditor>(path));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -101,15 +110,15 @@ void ZedEditor::FindEditors(Array<CodeEditor*>* output)
|
||||
FileSystem::GetSpecialFolderPath(SpecialFolder::Documents, userFolder);
|
||||
String paths[3] =
|
||||
{
|
||||
TEXT("/Applications/Visual Studio Code.app"),
|
||||
userFolder + TEXT("/../Visual Studio Code.app"),
|
||||
userFolder + TEXT("/../Downloads/Visual Studio Code.app"),
|
||||
TEXT("/Applications/Zed.app"),
|
||||
userFolder + TEXT("/../Zed.app"),
|
||||
userFolder + TEXT("/../Downloads/Zed.app"),
|
||||
};
|
||||
for (const String& path : paths)
|
||||
{
|
||||
if (FileSystem::DirectoryExists(path))
|
||||
{
|
||||
output->Add(New<VisualStudioCodeEditor>(path, false));
|
||||
output->Add(New<ZedEditor>(path));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ namespace Flax.Build.Projects.VisualStudio
|
||||
vcProjectFileContent.AppendLine(" <Keyword>MakeFileProj</Keyword>");
|
||||
if (Version >= VisualStudioVersion.VisualStudio2022)
|
||||
vcProjectFileContent.AppendLine(" <ResolveNuGetPackages>false</ResolveNuGetPackages>");
|
||||
vcProjectFileContent.AppendLine(" <VCTargetsPath Condition=\"$(Configuration.Contains('Linux'))\">./</VCTargetsPath>");
|
||||
vcProjectFileContent.AppendLine(" <VCTargetsPath Condition=\"$(Configuration.Contains('Linux')) or $(Configuration.Contains('Mac'))\">./</VCTargetsPath>");
|
||||
vcProjectFileContent.AppendLine(" </PropertyGroup>");
|
||||
|
||||
// Default properties
|
||||
|
||||
Reference in New Issue
Block a user