Need help with coc-rust-analyzer?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

fannheyward
499 Stars 21 Forks MIT License 874 Commits 3 Opened issues

Description

rust-analyzer extension for coc.nvim

Services available

!
?

Need anything else?

Contributors list

# 33,735
coc
Vim
Markdow...
lsp
460 commits
# 161,564
HTML
dummy
C
messeng...
4 commits
# 308,445
Emacs
emacs-l...
gruvbox
Rust
2 commits
# 580,303
GraphQL
hyperme...
coc
Node.js
1 commit
# 152,752
Rust
federat...
coc
Shell
1 commit
# 68,282
Rust
Arch Li...
lsp-ser...
memory-...
1 commit
# 232,627
Haskell
sh
ffmpeg
gtk
1 commit
# 141,330
Rust
Shell
CSS
filesys...
1 commit
# 52,409
Rust
Shell
trait
danboor...
1 commit
# 21,782
Vim
Less
Shell
Python
1 commit
# 490,232
hugo
HTML
mojolic...
Shell
1 commit
# 37,382
acl
abac
Go
js
1 commit

coc-rust-analyzer

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 set

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
.

| Configuration | Description | Default | | -- | -- | -- | |

rust-analyzer.enable
| Enable coc-rust-analyzer extension |
true
| |
rust-analyzer.server.path
| Path to custom
rust-analyzer
executable |
''
| |
rust-analyzer.updates.prompt
| Prompt the user before downloading |
true
| |
rust-analyzer.updates.channel
| Use
stable
or
nightly
updates |
stable
| |
rust-analyzer.diagnostics.enable
| Whether to show native rust-analyzer diagnostics |
true
| |
rust-analyzer.diagnostics.enableExperimental
| Whether to show experimental rust-analyzer diagnostics that might have more false positives than usual |
true
| |
rust-analyzer.diagnostics.disabled
| List of rust-analyzer diagnostics to disable |
[]
| |
rust-analyzer.diagnostics.warningsAsInfo
| List of warnings that should be displayed with info severity |
[]
| |
rust-analyzer.diagnostics.warningsAsHint
| List of warnings that should be displayed with hint severity |
[]
| |
rust-analyzer.lruCapacity
| Number of syntax trees rust-analyzer keeps in memory |
null
| |
rust-analyzer.inlayHints.enable
| Whether to show inlay hints |
true
| |
rust-analyzer.inlayHints.typeHints
| Whether to show inlay type hints for variables, Neovim Only |
true
| |
rust-analyzer.inlayHints.typeHintsSeparator
| Separator text for typeHints in virtual text |
| |
rust-analyzer.inlayHints.chainingHints
| Whether to show inlay type hints for method chains, Neovim Only |
true
| |
rust-analyzer.inlayHints.chainingHintsSeparator
| Separator text for chainingHints in virtual text |
| |
rust-analyzer.inlayHints.refreshOnInsertMode
| Whether to refresh inlayHints on insert mode |
false
| |
rust-analyzer.files.watcher
| Controls file watching implementation |
client
| |
rust-analyzer.notifications.cargoTomlNotFound
| Whether to show
can't find Cargo.toml
error message |
true
| |
rust-analyzer.cargo.autoreload
| Automatically refresh project info via
cargo metadata
on Cargo.toml changes |
true
| |
rust-analyzer.cargo.allFeatures
| Activate all available features |
false
| |
rust-analyzer.cargo.features
| List of features to activate |
[]
| |
rust-analyzer.cargo.noDefaultFeatures
| Do not activate the
default
feature |
false
| |
rust-analyzer.cargo.loadOutDirsFromCheck
| Run build scripts (
build.rs
) for more precise code analysis |
false
| |
rust-analyzer.procMacro.enable
| Enable support for procedural macros, implies
#rust-analyzer.cargo.runBuildScripts#
|
false
| |
rust-analyzer.rustfmt.extraArgs
| Additional arguments to rustfmt |
[]
| |
rust-analyzer.rustfmt.overrideCommand
| Advanced option, fully override the command rust-analyzer uses for formatting |
null
| |
rust-analyzer.checkOnSave.enable
| Run specified
cargo check
command for diagnostics on save |
true
| |
rust-analyzer.checkOnSave.target
| Check for a specific target |
null
| |
rust-analyzer.checkOnSave.extraArgs
| Extra arguments for
cargo check
|
[]
| |
rust-analyzer.checkOnSave.command
| Cargo command to use for
cargo check
|
check
| |
rust-analyzer.checkOnSave.overrideCommand
| Advanced option, fully override the command rust-analyzer uses for checking. The command should include
--message=format=json
or similar option |
null
| |
rust-analyzer.checkOnSave.allTargets
| Check all targets and tests (will be passed as
--all-targets
) |
true
| |
rust-analyzer.checkOnSave.noDefaultFeatures
| Do not activate the
default
feature |
null
| |
rust-analyzer.checkOnSave.allFeatures
| Check with all features (will be passed as
--all-features
) |
null
| |
rust-analyzer.checkOnSave.features
| List of features to activate |
null
| |
rust-analyzer.completion.addCallParenthesis
| Whether to add parenthesis when completing functions |
true
| |
rust-analyzer.completion.addCallArgumentSnippets
| Whether to add argument snippets when completing functions |
true
| |
rust-analyzer.completion.postfix.enable
| Whether to show postfix snippets like
dbg
,
if
,
not
, etc |
true
| |
rust-analyzer.completion.autoimport.enable
| Whether to enable additional completions that automatically add imports when completed |
true
| |
rust-analyzer.lens.enable
| Whether to show CodeLens in Rust files |
true
| |
rust-analyzer.lens.run
| Whether to show Run lens |
true
| |
rust-analyzer.lens.implementations
| Whether to show Implementations lens |
true
| |
rust-analyzer.lens.methodReferences
| Whether to show
Method References
lens |
false
| |
rust-analyzer.hoverActions.linksInHover
| Whether to show document links in hover |
false
| |
rust-analyzer.assist.importMergeBehavior
| The strategy to use when inserting new imports or merging imports |
full
| |
rust-analyzer.assist.importPrefix
| The path structure for newly inserted paths to use |
plain
| |
rust-analyzer.assist.importGroup
| Group inserted imports by the following order. Groups are separated by newlines |
true
| |
rust-analyzer.callInfo.full
| Show function name and docs in parameter hints |
true
| |
rust-analyzer.trace.server
| Trace requests to server |
off
| |
rust-analyzer.debug.runtime
| Which runtime debug to use, options:
vimspector
,
termdebug
|
termdebug
| |
rust-analyzer.debug.vimspector.configuration.name
| The name of the vimspector configuration. The following variables will be passed to the configuration
Executable
and
Args
. Make sure to add them to the configuration |
launch
|

Settings not specific to

rust-analyzer
can be found at
:help coc-configuration
.

Commands

You can use these commands by

:CocCommand XYZ
.

| Command | Description | | -- | -- | | rust-analyzer.analyzerStatus | Show rust-analyzer status | | 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 | | rust-analyzer.serverVersion | Show current Rust Analyzer server version | | rust-analyzer.ssr | Structural Search Replace | | rust-analyzer.syntaxTree | Show syntax tree | | rust-analyzer.toggleInlayHints | Toggle inlay hints on/off | | rust-analyzer.upgrade | Download latest

rust-analyzer
from GitHub release | | rust-analyzer.viewHir | View Hir |

Highlight Group

  • CocRustTypeHint
    : highlight name for
    typeHints
    , default link to
    CocHintSign
  • CocRustChainingHint
    : highlight name for
    chainingHints
    , default link to
    CocHintSign

Supporting

If this extension is helpful to you, please support me via Patreon or PayPal:

Patreon donate button <!-- markdownlint-disable-next-line --> PayPal donate button

License

MIT


This extension is created by create-coc-extension

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.