跳转至

rust-analyzer 插件

1 安装使用

  1. 扩展中搜索 rust,选择 rust-analyzer 插件安装。
  2. 使用 cargo new hello_cargo 创建新项目。vscode 中打开 hello_cargo 目录(一定指只能打开此目录,不能时上层目录,否则,插件无效。)具体操作,选择 "File" -> "Open Folder.." ->选择新建的 hello_cargo 目录。

2 rust-analyzer failed to discover workspace 问题

  • https://stackoverflow.com/questions/72062935/rust-analyzer-failed-to-discover-workspace-in-vscode
  • 详见安装使用步骤 2 中的 vscode 工作目录设置