rust-analyzer for Vim/Neovim, works as an extension with coc.nvim.
:CocInstall coc-rust-analyzer
remove
ra_lsp_server
config fromcoc-settings.json
if you set
You need ra_lsp_server
installed. You can build it from source:
git clone https://github.com/rust-analyzer/rust-analyzer && cd rust-analyzer
rustup component add rust-src
cargo xtask install --server
This extension is configured using a jsonc file. You can open this configuration file using
the command :CocConfig
, and it is typically located at $HOME/.config/nvim/coc-settings.json
.
rust-analyzer.raLspServerPath
: Path to ra_lsp_server executable, default:ra_lsp_server
rust-analyzer.featureFlags
: Fine grained feature flags to disable annoying features, default:{}
, available flagsrust-analyzer.excludeGlobs
: Paths to exclude from analysis, default:[]
rust-analyzer.lruCapacity
: Number of syntax trees rust-analyzer keeps in memory, default:null
rust-analyzer.useClientWatching
: use client provided file watching instead of notify watching, default:true
rust-analyzer.cargo-watch.enable
: Runcargo check
for diagnostics on save, default:true
rust-analyzer.cargo-watch.arguments
:cargo-watch
arguments, default:[]
rust-analyzer.cargo-watch.command
:cargo-watch
arguments, default:check
rust-analyzer.cargo-watch.allTargets
: Check all targets and tests (will be passed as--all-targets
)rust-analyzer.cargoFeatures.noDefaultFeatures
: do not activate thedefault
featurerust-analyzer.cargoFeatures.allFeatures
: activate all available featuresrust-analyzer.cargoFeatures.features
: list of features to activaterust-analyzer.trace.server
: Trace requests to the ra_lsp_server, default:off
Settings not specific to rust-analyzer
can be found at :help coc-configuration
.
rust-analyzer.analyzerStatus
: Show rust-analyzer statusrust-analyzer.applySourceChange
: Apply source changerust-analyzer.collectGarbage
: Run garbage collectionrust-analyzer.expandMacro
: Expand macro recursivelyrust-analyzer.joinLines
: Join linesrust-analyzer.matchingBrace
: Find matching bracerust-analyzer.parentModule
: Locate parent modulerust-analyzer.reload
: Restart rust-analyzer serverrust-analyzer.run
: List available runnables of current filerust-analyzer.runSingle
: Run runnable at positionrust-analyzer.syntaxTree
: Show syntax tree
MIT
This extension is created by create-coc-extension