示例#1
0
 def install_rls(self):
     for component_name in ('rust-analysis', 'rust-src', self._config.component_name):
         spinner.start("Rust-CodeIntel", "Installing {} Rust component…".format(component_name), timeout=-1)
         if not self.install_component(component_name):
             spinner.stop("Could not install Rust component {}".format(component_name))
             return False
     spinner.stop("Rust components installed successfully")
     return True
示例#2
0
    def try_to_install_toolchain(self):
        spinner.start("Rust-CodeIntel", "Installing Rust {} toolchain…".format(self._config.channel), timeout=-1)
        try:
            stdoutdata, stderrdata = exec_child_process([
                rustup_command(),
                "toolchain",
                "install",
                self._config.channel,
            ], env=self._config.env)
        except RuntimeError:
            spinner.stop("Could not install Rust {} toolchain".format(self._config.channel))
            return False

        spinner.stop("Rust {} toolchain installed successfully".format(self._config.channel))
        return True
示例#3
0
    def rustup_update(self):
        spinner.start("Rust-CodeIntel", "Updating Rustup…", timeout=-1)
        try:
            stdoutdata, stderrdata = exec_child_process([
                rustup_command(),
                "update",
            ], env=self._config.env)
        except RuntimeError:
            spinner.stop("An error occurred whilst trying to update.")
            return False

        # This test is imperfect because if the user has multiple toolchains installed, they
        # might have one updated and one unchanged. But I don't want to go too far down the
        # rabbit hole of parsing rustup's output.
        if "unchanged" in stdoutdata:
            spinner.stop("Up to date.")
        else:
            spinner.stop("Up to date. Restart Sublime Text for changes to take effect.")
        return True
示例#4
0
 def on_diagnostics(self, params):
     spinner.start("YAML-CodeIntel", spinner='monkey')
示例#5
0
 def on_progress(self, params):
     spinner.start("Rust-CodeIntel", spinner='fire')
示例#6
0
 def on_diagnostics(self, params):
     spinner.start("JavaScript-CodeIntel", spinner='monkey')