Skip to content

fannheyward/coc-rust-analyzer

Repository files navigation

coc-rust-analyzer

GitHub Sponsors Patreon donate button PayPal donate button

rust-analyzer for Vim/Neovim, works as an extension with coc.nvim.

10

Install

:CocInstall coc-rust-analyzer

remove rust-analyzer config from coc-settings.json if you've set

Notes

It's recommended to add $CARGO_HOME to workspace.ignoredFolders to stop rust-analyzer runs cargo check on sysroot crates:

"workspace.ignoredFolders": [
  "$HOME",
  "$HOME/.cargo/**",
  "$HOME/.rustup/**"
],

Configurations

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. You can get the configurations list from the package.json file of this extension.

Commands

You can use these commands by :CocCommand XYZ.

Command Description
rust-analyzer.analyzerStatus Show rust-analyzer status
rust-analyzer.debug List available runnables of current file and debug the selected one
rust-analyzer.expandMacro Expand macro recursively
rust-analyzer.explainError Explain the currently hovered error message
rust-analyzer.joinLines Join lines
rust-analyzer.matchingBrace Find matching brace
rust-analyzer.memoryUsage Memory Usage (Clears Database)
rust-analyzer.moveItemUp Move item up
rust-analyzer.moveItemDown Move item down
rust-analyzer.openDocs Open docs under cursor
rust-analyzer.parentModule Locate parent module
rust-analyzer.peekTests Peek related tests
rust-analyzer.reload Restart rust-analyzer server
rust-analyzer.reloadWorkspace Reload workspace
rust-analyzer.run List available runnables of current file and run the selected one
rust-analyzer.serverVersion Show current Rust Analyzer server version
rust-analyzer.ssr Structural Search Replace
rust-analyzer.syntaxTree Show syntax tree
rust-analyzer.testCurrent Test Current
rust-analyzer.install Install latest rust-analyzer from GitHub release
rust-analyzer.upgrade Download latest rust-analyzer from GitHub release
rust-analyzer.viewHir View Hir
rust-analyzer.viewMir View Mir
rust-analyzer.viewFileText View File Text
rust-analyzer.viewCrateGraph View Crate Graph
rust-analyzer.viewFullCrateGraph View Crate Graph (Full)
rust-analyzer.shuffleCrateGraph Shuffle Crate Graph
rust-analyzer.runFlycheck Run flycheck
rust-analyzer.cancelFlycheck Cancel running flychecks
rust-analyzer.clearFlycheck Clear flycheck diagnostics
rust-analyzer.rebuildProcMacros Rebuild proc macros and build scripts
rust-analyzer.interpretFunction Interpret Function

License

MIT


This extension is built with create-coc-extension