coc.nvim 配置 Rust 代码提醒补全

  1. 安装 coc-rust-analyzer

  2. 安装 rust-analyzer

$ git clone https://github.com/rust-lang/rust-analyzer.git && cd rust-analyzer
$ cargo xtask install --server
  1. 配置 coc-setting.conf
{
"languageserver": {
"golang": {
"command": "gopls",
"rootPatterns": ["go.mod"],
"filetypes": ["go"]
},
"rust": {
"command": "rust-analyzer",
"filetypes": ["rust"],
"rootPatterns": ["Cargo.toml"]
}
},
"rust-analyzer.serverPath": "~/.cargo/bin/rust-analyzer"
}

rust-analyzer.serverPath 配置成 rust-analyzer 安装的路径

Published At