Add code-oss, vscode-oss, and visual-studio-code-oss to vscode path

This commit is contained in:
supatier 2019-01-01 06:31:34 +07:00
parent 89560c2138
commit ab7f102b14

View File

@ -248,16 +248,19 @@ Error GodotSharpEditor::open_in_external_editor(const Ref<Script> &p_script, int
static String vscode_path; static String vscode_path;
if (vscode_path.empty() || !FileAccess::exists(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 // 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"); for (int i = 0; i < vscode_name.size(); i++) {
} vscode_path = path_which(vscode_name[i]);
if (vscode_path.empty() || !FileAccess::exists(vscode_path)) { if (!vscode_path.empty() || FileAccess::exists(vscode_path))
// On some Linux distro the executable has the name vscode break;
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; List<String> args;