如何为IntelliJ IDEA的Rust项目提供标准库资源? [英] How to provide standard library sources for IntelliJ IDEA's Rust project?

查看:605
本文介绍了如何为IntelliJ IDEA的Rust项目提供标准库资源?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Mac进行开发.我使用brew install rust和用于IntelliJ IDEA的Rust插件0.1.0.1385安装了Rust 1.13.0.我用cargo创建了我的第一个测试项目,并用IDEA打开它时得到了消息

I am using Mac for development. I installed Rust 1.13.0 using brew install rust and the Rust plugin 0.1.0.1385 for IntelliJ IDEA. I created my first test project with cargo and while opening it with IDEA I got the message

未找到标准库源,某些代码洞察将不起作用

No standard library sources found, some code insight will not work

我还没有找到任何安装的源,也没有在Homebrew中找到Rust源软件包.

I haven't found any sources installed, nor the Rust sources package in Homebrew.

我如何为项目提供资源,如果我忽略此步骤,会有什么实际意义?

How do I provide sources for the project and what are the practical implication if I ignore this step?

推荐答案

如前所述,受支持的方法是使用rustup:

As commented, the supported approach is to use rustup:

  • 导航到 https://rustup.rs/并按照您平台的安装说明进行操作.
  • 通过运行以下命令添加rust-src组件:rustup component add rust-src
  • 在IntelliJ中创建一个新的Rust项目,然后选择您现有的Rust项目源.如果该文件夹已经包含以前的IntelliJ项目文件,则可能必须先删除这些文件,然后才能继续进行操作.
  • IntelliJ-Rust应该自动将标准库源配置为指向rustup下载的源.
  • Navigate to https://rustup.rs/ and follow the installation instructions for your platform.
  • Add the rust-src component by running: rustup component add rust-src
  • Create a new Rust project in IntelliJ and choose your existing Rust project source. If the folder already contains previous IntelliJ project files, you may have to delete those first before it will let you proceed.
  • IntelliJ-Rust should automatically configure the standard library sources to point to the sources downloaded by rustup.

这篇关于如何为IntelliJ IDEA的Rust项目提供标准库资源?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆