安装 rust-analyzer
$ git clone https://github.com/rust-lang/rust-analyzer.git && cd rust-analyzer
$ cargo xtask install --server
- 配置 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
安装的路径