diff options
author | Supatier <atisuperati@gmail.com> | 2018-12-27 15:16:29 +0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-27 15:16:29 +0700 |
commit | b173eed8aaa39abbfa0a30513ae592f086c1f622 (patch) | |
tree | 6ddc1f91fd241490c2e6b38d95b38314410959ae | |
parent | e86418f7a92a498208c325446c9d7f654c48f359 (diff) |
Fix Godot unable to find VSCode binary
VSCode's executable name is not uniform and godot only search for "code".
-rw-r--r-- | modules/mono/editor/godotsharp_editor.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/modules/mono/editor/godotsharp_editor.cpp b/modules/mono/editor/godotsharp_editor.cpp index cce86efbf5..a1f4bb3c4c 100644 --- a/modules/mono/editor/godotsharp_editor.cpp +++ b/modules/mono/editor/godotsharp_editor.cpp @@ -251,6 +251,14 @@ Error GodotSharpEditor::open_in_external_editor(const Ref<Script> &p_script, int // 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"); + } List<String> args; |