Browse Source

Improved instructions when rust installation is not found

merge-requests/404/merge
eidheim 5 years ago
parent
commit
81b3b670dc
  1. 2
      docs/language_servers.md
  2. 5
      src/notebook.cpp
  3. 3
      src/window.cpp

2
docs/language_servers.md

@ -69,7 +69,7 @@ ln -s `which pyls` /usr/local/bin/python-language-server
## Rust ## Rust
- Prerequisites: - Prerequisites:
- Rust - [Rust](https://www.rust-lang.org/tools/install)
Install language server, and create symbolic link to enable server in juCi++: Install language server, and create symbolic link to enable server in juCi++:

5
src/notebook.cpp

@ -204,8 +204,11 @@ bool Notebook::open(const boost::filesystem::path &file_path_, Position position
shown.emplace(language_id); shown.emplace(language_id);
} }
else if(language_id == "rust") { else if(language_id == "rust") {
Terminal::get().print("\e[33mWarning\e[m: could not find Rust language server.\n"); auto rust_installed = !filesystem::get_rust_sysroot_path().empty();
Terminal::get().print(std::string("\e[33mWarning\e[m: could not find Rust ") + (rust_installed ? "language server" : "installation") + ".\n");
Terminal::get().print("For installation instructions please visit: https://gitlab.com/cppit/jucipp/-/blob/master/docs/language_servers.md#rust.\n"); Terminal::get().print("For installation instructions please visit: https://gitlab.com/cppit/jucipp/-/blob/master/docs/language_servers.md#rust.\n");
if(!rust_installed)
Terminal::get().print("You will need to restart juCi++ after installing Rust.\n");
shown.emplace(language_id); shown.emplace(language_id);
} }
} }

3
src/window.cpp

@ -442,8 +442,9 @@ void Window::set_menu_actions() {
menu.add_action("file_new_project_rust", []() { menu.add_action("file_new_project_rust", []() {
auto sysroot = filesystem::get_rust_sysroot_path(); auto sysroot = filesystem::get_rust_sysroot_path();
if(sysroot.empty()) { if(sysroot.empty()) {
Terminal::get().print("\e[33mWarning\e[m: could not find Rust.\n"); Terminal::get().print("\e[33mWarning\e[m: could not find Rust installation.\n");
Terminal::get().print("For installation instructions please visit: https://gitlab.com/cppit/jucipp/-/blob/master/docs/language_servers.md#rust.\n"); Terminal::get().print("For installation instructions please visit: https://gitlab.com/cppit/jucipp/-/blob/master/docs/language_servers.md#rust.\n");
Terminal::get().print("You will need to restart juCi++ after installing Rust.\n");
return; return;
} }
boost::filesystem::path project_path = Dialog::new_folder(Project::get_preferably_directory_folder()); boost::filesystem::path project_path = Dialog::new_folder(Project::get_preferably_directory_folder());

Loading…
Cancel
Save