summaryrefslogtreecommitdiff
path: root/modules/mono
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-01-03 21:32:41 +0100
committerGitHub <noreply@github.com>2019-01-03 21:32:41 +0100
commit1808241d168cffe20b05f25882173dca1706265d (patch)
tree584c7fe5bda6e1177c631a6d96d209183c18c8d4 /modules/mono
parentbea0a579b754a778057a25ce902cdd90615f6f0c (diff)
parentab7f102b145a04c6d21387124984cb14086a314e (diff)
Merge pull request #24688 from Supatier/add-additional-vscode-name
Add code-oss, vscode-oss, and visual-studio-code-oss to vscode path
Diffstat (limited to 'modules/mono')
-rw-r--r--modules/mono/editor/godotsharp_editor.cpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/modules/mono/editor/godotsharp_editor.cpp b/modules/mono/editor/godotsharp_editor.cpp
index 1aa3b2dd8b..cee4405826 100644
--- a/modules/mono/editor/godotsharp_editor.cpp
+++ b/modules/mono/editor/godotsharp_editor.cpp
@@ -248,16 +248,19 @@ Error GodotSharpEditor::open_in_external_editor(const Ref<Script> &p_script, int
static String vscode_path;
if (vscode_path.empty() || !FileAccess::exists(vscode_path)) {
+ static List<String> vscode_name;
+ vscode_name.push_back("code");
+ vscode_name.push_back("code-oss");
+ vscode_name.push_back("vscode");
+ vscode_name.push_back("vscode-oss");
+ vscode_name.push_back("visual-studio-code");
+ vscode_name.push_back("visual-studio-code-oss");
// Try to search it again if it wasn't found last time or if it was removed from its location
- vscode_path = path_which("code");
- }
- if (vscode_path.empty() || !FileAccess::exists(vscode_path)) {
- // On some Linux distro the executable has the name vscode
- vscode_path = path_which("vscode");
- }
- if (vscode_path.empty() || !FileAccess::exists(vscode_path)) {
- // Executable name when installing VSCode directly from MS on Linux
- vscode_path = path_which("visual-studio-code");
+ for (int i = 0; i < vscode_name.size(); i++) {
+ vscode_path = path_which(vscode_name[i]);
+ if (!vscode_path.empty() || FileAccess::exists(vscode_path))
+ break;
+ }
}
List<String> args;