0.81.0 • Published 8 months ago

coc-rust-analyzer v0.81.0

Weekly downloads
2,026
License
MIT
Repository
github
Last release
8 months ago

coc-rust-analyzer

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

Install

:CocInstall coc-rust-analyzer

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

NOTE: For Apple Silicon users, you shouldn't use Node.js v15, checkout #975 for more.

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.

ConfigurationDescriptionDefault
rust-analyzer.enableEnable coc-rust-analyzertrue
rust-analyzer.assist.emitMustUseWhether to insert #must_use when generating as_ methods for enum variants.false
rust-analyzer.assist.expressionFillDefaultPlaceholder expression to use for missing expressions in assists.todo
rust-analyzer.cachePriming.enableWarm up caches on project load.true
rust-analyzer.cachePriming.numThreadsHow many worker threads to handle priming caches. The default 0 means to pick automatically.0
rust-analyzer.cargo.autoreloadAutomatically refresh project info via cargo metadata on Cargo.toml or .cargo/config.toml changes.true
rust-analyzer.cargo.buildScripts.enableRun build scripts (build.rs) for more precise code analysis.true
rust-analyzer.cargo.buildScripts.invocationLocationSpecifies the working directory for running build scripts.workspace
rust-analyzer.cargo.buildScripts.invocationStrategySpecifies the invocation strategy to use when running the build scripts command.null
rust-analyzer.cargo.buildScripts.useRustcWrapperUse RUSTC_WRAPPER=rust-analyzer when running build scripts to avoid checking unnecessary things.true
rust-analyzer.cargo.extraEnvExtra environment variables that will be set when running cargo, rustc or other commands within the workspace. Useful for setting RUSTFLAGS.null
rust-analyzer.cargo.featuresList of features to activate. Set this to "all" to pass --all-features to cargo.
rust-analyzer.cargo.noDefaultFeaturesWhether to pass --no-default-features to cargo.false
rust-analyzer.cargo.sysrootRelative path to the sysroot, or "discover" to try to automatically find it via "rustc --print sysroot".discover
rust-analyzer.cargo.sysrootSrcRelative path to the sysroot library sources. If left unset, this will default to {cargo.sysroot}/lib/rustlib/src/rust/library.null
rust-analyzer.cargo.targetCompilation target override (target triple).null
rust-analyzer.cargo.unsetTestUnsets #[cfg(test)] for the specified crates.core
rust-analyzer.check.allTargetsCheck all targets and tests (--all-targets).true
rust-analyzer.check.commandCargo command to use for cargo check.check
rust-analyzer.check.extraArgsExtra arguments for cargo check.[]
rust-analyzer.check.extraEnvExtra environment variables that will be set when running cargo check. Extends #rust-analyzer.cargo.extraEnv#.{}
rust-analyzer.check.featuresList of features to activate. Defaults to #rust-analyzer.cargo.features#. Set to "all" to pass --all-features to Cargo.null
rust-analyzer.check.invocationLocationSpecifies the working directory for running checks.workspace
rust-analyzer.check.invocationStrategySpecifies the invocation strategy to use when running the checkOnSave command.per_workspace
rust-analyzer.check.noDefaultFeaturesWhether to pass --no-default-features to Cargo. Defaults to #rust-analyzer.cargo.noDefaultFeatures#.null
rust-analyzer.check.overrideCommandOverride the command rust-analyzer uses instead of cargo check for diagnostics on save.null
rust-analyzer.check.targetsCheck for specific targets. Defaults to #rust-analyzer.cargo.target# if empty.null
rust-analyzer.checkOnSaveRun the check command for diagnostics on save.true
rust-analyzer.completion.autoimport.enableToggles the additional completions that automatically add imports when completedtrue
rust-analyzer.completion.autoself.enableToggles the additional completions that automatically show method calls and field accesses with self prefixed to them when inside a method.true
rust-analyzer.completion.callable.snippetsWhether to add parenthesis and argument snippets when completing function.fill_arguments
rust-analyzer.completion.limitMaximum number of completions to return. If None, the limit is infinite.null
rust-analyzer.completion.postfix.enableWhether to show postfix snippets like dbg, if, not, etc.true
rust-analyzer.completion.privateEditable.enableEnables completions of private items and fields that are defined in the current workspace even if they are not visible at the current position.false
rust-analyzer.completion.snippets.customCustom completion snippets.
rust-analyzer.debug.runtimeChoose which debug runtime to usetermdebug
rust-analyzer.debug.vimspector.configuration.nameSpecify the name of the vimspector configuration name. The following args will be passed to the configuration: Executable and Args (both strings)launch
rust-analyzer.debug.nvimdap.configuration.templateConfiguration template used to invoked dap.run(conf). The template will be instantiate like thie: $exe will be replaced with executable path, $args will be replaced with arguments. An example template: { name = \"Debug (with args)\", type = \"codelldb\", request = \"launch\", program = $exe, args = $args, cwd = \"${workspaceFolder}\", stopOnEntry = false, terminal = \"integrated\" }""
rust-analyzer.diagnostics.disabledList of rust-analyzer diagnostics to disable.
rust-analyzer.diagnostics.enableWhether to show native rust-analyzer diagnostics.true
rust-analyzer.diagnostics.experimental.enableWhether to show experimental rust-analyzer diagnostics that might have more false positives than usual.false
rust-analyzer.diagnostics.remapPrefixMap of prefixes to be substituted when parsing diagnostic file paths. This should be the reverse mapping of what is passed to rustc as --remap-path-prefix.{}
rust-analyzer.diagnostics.warningsAsHintList of warnings that should be displayed with hint severity.
rust-analyzer.diagnostics.warningsAsInfoList of warnings that should be displayed with info severity.
rust-analyzer.disableProgressNotificationsDisable initialization and workdone progress notificationsfalse
rust-analyzer.files.excludeDirsThese directories will be ignored by rust-analyzer.
rust-analyzer.files.watcherControls file watching implementation.client
rust-analyzer.highlightRelated.breakPoints.enableEnables highlighting of related references while the cursor is on break, loop, while, or for keywords.true
rust-analyzer.highlightRelated.exitPoints.enableEnables highlighting of all exit points while the cursor is on any return, ?, fn, or return type arrow (->).true
rust-analyzer.highlightRelated.references.enableEnables highlighting of related references while the cursor is on any identifier.true
rust-analyzer.highlightRelated.yieldPoints.enableEnables highlighting of all break points for a loop or block context while the cursor is on any async or await keywords.true
rust-analyzer.hover.documentation.enableWhether to show documentation on hover.true
rust-analyzer.hover.documentation.keywords.enableWhether to show keyword hover popups. Only applies when #rust-analyzer.hover.documentation.enable# is set.true
rust-analyzer.hover.links.enableUse markdown syntax for links in hover.true
rust-analyzer.imports.granularity.enforceWhether to enforce the import granularity setting for all files. If set to false rust-analyzer will try to keep import styles consistent per file.false
rust-analyzer.imports.granularity.groupHow imports should be grouped into use statements.crate
rust-analyzer.imports.group.enableGroup inserted imports by the https://rust-analyzer.github.io/manual.html#auto-import[following order]. Groups are separated by newlines.true
rust-analyzer.imports.merge.globWhether to allow import insertion to merge new imports into single path glob imports like use std::fmt::*;.true
rust-analyzer.imports.prefer.no.stdPrefer to unconditionally use imports of the core and alloc crate, over the std crate.false
rust-analyzer.imports.prefixThe path structure for newly inserted paths to use.plain
rust-analyzer.inlayHints.bindingModeHints.enableWhether to show inlay type hints for binding modes.false
rust-analyzer.inlayHints.chainingHints.enableWhether to show inlay type hints for method chains.true
rust-analyzer.inlayHints.closingBraceHints.enableWhether to show inlay hints after a closing } to indicate what item it belongs to.true
rust-analyzer.inlayHints.closingBraceHints.minLinesMinimum number of lines required before the } until the hint is shown (set to 0 or 1 to always show them).25
rust-analyzer.inlayHints.closureReturnTypeHints.enableWhether to show inlay type hints for return types of closures.never
rust-analyzer.inlayHints.discriminantHints.enableWhether to show enum variant discriminant hints.never
rust-analyzer.inlayHints.expressionAdjustmentHints.enableWhether to show inlay hints for type adjustments.never
rust-analyzer.inlayHints.expressionAdjustmentHints.hideOutsideUnsafeWhether to hide inlay hints for type adjustments outside of unsafe blocks.false
rust-analyzer.inlayHints.expressionAdjustmentHints.modeWhether to show inlay hints as postfix ops (.* instead of *, etc).prefix
rust-analyzer.inlayHints.lifetimeElisionHints.enableWhether to show inlay type hints for elided lifetimes in function signatures.never
rust-analyzer.inlayHints.lifetimeElisionHints.useParameterNamesWhether to prefer using parameter names as the name for elided lifetime hints if possible.false
rust-analyzer.inlayHints.maxLengthMaximum length for inlay hints. Set to null to have an unlimited length.25
rust-analyzer.inlayHints.parameterHints.enableWhether to show function parameter name inlay hints at the call site.true
rust-analyzer.inlayHints.reborrowHints.enableWhether to show inlay hints for compiler inserted reborrows. This setting is deprecated in favor of #rust-analyzer.inlayHints.expressionAdjustmentHints.enable#.never
rust-analyzer.inlayHints.renderColonsWhether to render leading colons for type hints, and trailing colons for parameter hints.true
rust-analyzer.inlayHints.typeHints.enableWhether to show inlay type hints for variables.true
rust-analyzer.inlayHints.typeHints.hideClosureInitializationWhether to hide inlay type hints for let statements that initialize to a closure. Only applies to closures with blocks, same as #rust-analyzer.inlayHints.closureReturnTypeHints.enable#.false
rust-analyzer.inlayHints.typeHints.hideNamedConstructorWhether to hide inlay type hints for constructors.false
rust-analyzer.joinLines.joinAssignmentsJoin lines merges consecutive declaration and initialization of an assignment.true
rust-analyzer.joinLines.joinElseIfJoin lines inserts else between consecutive ifs.true
rust-analyzer.joinLines.removeTrailingCommaJoin lines removes trailing commas.true
rust-analyzer.joinLines.unwrapTrivialBlockJoin lines unwraps trivial blocks.true
rust-analyzer.lens.debug.enableWhether to show Debug lens. Only applies when #rust-analyzer.lens.enable# is set.true
rust-analyzer.lens.enableWhether to show CodeLens in Rust files.true
rust-analyzer.lens.forceCustomCommandsInternal config: use custom client-side commands even when the client doesn't set the corresponding capability.true
rust-analyzer.lens.implementations.enableWhether to show Implementations lens. Only applies when #rust-analyzer.lens.enable# is set.true
rust-analyzer.lens.locationWhere to render annotations.above_name
rust-analyzer.lens.references.adt.enableWhether to show References lens for Struct, Enum, and Union. Only applies when #rust-analyzer.lens.enable# is set.false
rust-analyzer.lens.references.enumVariant.enableWhether to show References lens for Enum Variants. Only applies when #rust-analyzer.lens.enable# is set.false
rust-analyzer.lens.references.method.enableWhether to show Method References lens. Only applies when #rust-analyzer.lens.enable# is set.false
rust-analyzer.lens.references.trait.enableWhether to show References lens for Trait. Only applies when #rust-analyzer.lens.enable# is set.false
rust-analyzer.lens.run.enableWhether to show Run lens. Only applies when #rust-analyzer.lens.enable# is set.true
rust-analyzer.linkedProjectsDisable project auto-discovery in favor of explicitly specified set of projects.
rust-analyzer.lru.capacityNumber of syntax trees rust-analyzer keeps in memory. Defaults to 128.null
rust-analyzer.notifications.cargoTomlNotFoundWhether to show can't find Cargo.toml error message.true
rust-analyzer.numThreadsHow many worker threads in the main loop. The default null means to pick automatically.null
rust-analyzer.procMacro.attributes.enableExpand attribute macros. Requires #rust-analyzer.procMacro.enable# to be set.true
rust-analyzer.procMacro.enableEnable support for procedural macros, implies #rust-analyzer.cargo.buildScripts.enable#.true
rust-analyzer.procMacro.ignoredThese proc-macros will be ignored when trying to expand them.{}
rust-analyzer.procMacro.serverInternal config, path to proc-macro server executable (typically, this is rust-analyzer itself, but we override this in tests).null
rust-analyzer.references.excludeImportsExclude imports from find-all-references.false
rust-analyzer.restartServerOnConfigChangeWhether to restart the server automatically when certain settings that require a restart are changed.false
rust-analyzer.runnables.commandCommand to be executed instead of 'cargo' for runnables.null
rust-analyzer.runnables.extraArgsAdditional arguments to be passed to cargo for runnables such as tests or binaries. For example, it may be --release.
rust-analyzer.rustc.sourcePath to the Cargo.toml of the rust compiler workspace, for usage in rustc_private projects, or "discover" to try to automatically find it if the rustc-dev component is installed.null
rust-analyzer.rustfmt.extraArgsAdditional arguments to rustfmt.
rust-analyzer.rustfmt.overrideCommandAdvanced option, fully override the command rust-analyzer uses for formatting.null
rust-analyzer.rustfmt.rangeFormatting.enableEnables the use of rustfmt's unstable range formatting command for the textDocument/rangeFormatting request. The rustfmt option is unstable and only available on a nightly build.false
rust-analyzer.semanticHighlighting.doc.comment.inject.enableInject additional highlighting into doc comments.true
rust-analyzer.semanticHighlighting.operator.enableUse semantic tokens for operators.true
rust-analyzer.semanticHighlighting.operator.specialization.enableUse specialized semantic tokens for operators.false
rust-analyzer.semanticHighlighting.punctuation.enableUse semantic tokens for punctuations.false
rust-analyzer.semanticHighlighting.punctuation.separate.macro.bangWhen enabled, rust-analyzer will emit a punctuation semantic token for the ! of macro calls.false
rust-analyzer.semanticHighlighting.punctuation.specialization.enableUse specialized semantic tokens for punctuations.false
rust-analyzer.semanticHighlighting.strings.enableUse semantic tokens for strings.true
rust-analyzer.server.extraEnvExtra environment variables that will be passed to the rust-analyzer executable. Useful for passing e.g. RA_LOG for debugging.null
rust-analyzer.server.pathPath to rust-analyzer executable (points to bundled binary by default). If this is set, then "rust-analyzer.updates.channel" setting is not usednull
rust-analyzer.signatureInfo.detailShow full signature of the callable. Only shows parameters if disabled.full
rust-analyzer.signatureInfo.documentation.enableShow documentation.true
rust-analyzer.terminal.startinsertEnter insert mode after terminal displayedfalse
rust-analyzer.trace.serverTrace requests to the rust-analyzeroff
rust-analyzer.typing.autoClosingAngleBrackets.enableWhether to insert closing angle brackets when typing an opening angle bracket of a generic argument list.false
rust-analyzer.updates.channelChoose "nightly" updates to get the latest features and bug fixes every day. While "stable" releases occur weekly and don't contain cutting-edge features from VSCode proposed APIsstable
rust-analyzer.updates.checkOnStartupAuto-check rust-analyzer updates on startuptrue
rust-analyzer.updates.promptPrompt the user before downloading rust-analyzertrue
rust-analyzer.workspace.symbol.search.kindWorkspace symbol search kind.only_types
rust-analyzer.workspace.symbol.search.limitLimits the number of items returned from a workspace symbol search (Defaults to 128).128
rust-analyzer.workspace.symbol.search.scopeWorkspace symbol search scope.workspace

Commands

You can use these commands by :CocCommand XYZ.

CommandDescription
rust-analyzer.analyzerStatusShow rust-analyzer status
rust-analyzer.debugList available runnables of current file and debug the selected one
rust-analyzer.expandMacroExpand macro recursively
rust-analyzer.explainErrorExplain the currently hovered error message
rust-analyzer.joinLinesJoin lines
rust-analyzer.matchingBraceFind matching brace
rust-analyzer.memoryUsageMemory Usage (Clears Database)
rust-analyzer.moveItemUpMove item up
rust-analyzer.moveItemDownMove item down
rust-analyzer.openDocsOpen docs under cursor
rust-analyzer.parentModuleLocate parent module
rust-analyzer.peekTestsPeek related tests
rust-analyzer.reloadRestart rust-analyzer server
rust-analyzer.reloadWorkspaceReload workspace
rust-analyzer.runList available runnables of current file and run the selected one
rust-analyzer.serverVersionShow current Rust Analyzer server version
rust-analyzer.ssrStructural Search Replace
rust-analyzer.syntaxTreeShow syntax tree
rust-analyzer.testCurrentTest Current
rust-analyzer.installInstall latest rust-analyzer from GitHub release
rust-analyzer.upgradeDownload latest rust-analyzer from GitHub release
rust-analyzer.viewHirView Hir
rust-analyzer.viewMirView Mir
rust-analyzer.viewFileTextView File Text
rust-analyzer.viewCrateGraphView Crate Graph
rust-analyzer.viewFullCrateGraphView Crate Graph (Full)
rust-analyzer.shuffleCrateGraphShuffle Crate Graph
rust-analyzer.runFlycheckRun flycheck
rust-analyzer.cancelFlycheckCancel running flychecks
rust-analyzer.clearFlycheckClear flycheck diagnostics
rust-analyzer.rebuildProcMacrosRebuild proc macros and build scripts
rust-analyzer.interpretFunctionInterpret Function

License

MIT


This extension is built with create-coc-extension

0.81.0

8 months ago

0.80.4

9 months ago

0.80.0

10 months ago

0.80.1

10 months ago

0.80.2

10 months ago

0.79.2

10 months ago

0.78.0

11 months ago

0.79.1

11 months ago

0.79.0

11 months ago

0.77.5

1 year ago

0.77.4

1 year ago

0.77.3

1 year ago

0.77.1

1 year ago

0.77.0

1 year ago

0.77.2

1 year ago

0.76.1

1 year ago

0.75.5

1 year ago

0.75.4

1 year ago

0.75.3

2 years ago

0.75.2

2 years ago

0.75.1

2 years ago

0.74.0

2 years ago

0.75.0

2 years ago

0.73.0

2 years ago

0.70.0

3 years ago

0.71.1

3 years ago

0.71.0

3 years ago

0.72.1

3 years ago

0.72.0

3 years ago

0.68.3

3 years ago

0.68.4

3 years ago

0.69.2

3 years ago

0.69.1

3 years ago

0.69.4

3 years ago

0.69.3

3 years ago

0.69.0

3 years ago

0.69.6

3 years ago

0.69.5

3 years ago

0.69.7

3 years ago

0.68.2

3 years ago

0.68.1

3 years ago

0.68.0

3 years ago

0.67.0

3 years ago

0.67.1

3 years ago

0.64.1

3 years ago

0.64.0

3 years ago

0.65.2

3 years ago

0.65.1

3 years ago

0.65.3

3 years ago

0.65.0

3 years ago

0.66.0

3 years ago

0.62.1

3 years ago

0.63.0

3 years ago

0.62.0

4 years ago

0.60.2

4 years ago

0.61.2

4 years ago

0.61.1

4 years ago

0.61.0

4 years ago

0.60.1

4 years ago

0.59.0

4 years ago

0.59.1

4 years ago

0.60.0

4 years ago

0.57.0

4 years ago

0.58.0

4 years ago

0.55.0

4 years ago

0.56.0

4 years ago

0.54.0

4 years ago

0.53.0

4 years ago

0.52.0

4 years ago

0.51.0

4 years ago

0.51.1

4 years ago

0.50.0

4 years ago

0.49.0

4 years ago

0.48.0

4 years ago

0.47.3

4 years ago

0.47.2

4 years ago

0.47.1

4 years ago

0.47.0

4 years ago

0.46.3

4 years ago

0.46.2

4 years ago

0.45.1

4 years ago

0.46.0

4 years ago

0.46.1

4 years ago

0.44.0

4 years ago

0.45.0

4 years ago

0.43.1

5 years ago

0.43.0

5 years ago

0.41.0

5 years ago

0.42.0

5 years ago

0.40.0

5 years ago

0.38.0

5 years ago

0.39.0

5 years ago

0.37.1

5 years ago

0.37.0

5 years ago

0.36.1

5 years ago

0.36.0

5 years ago

0.35.0

5 years ago

0.34.0

5 years ago

0.33.0

5 years ago

0.32.0

5 years ago

0.31.0

5 years ago

0.30.0

5 years ago

0.29.0

5 years ago

0.28.0

5 years ago

0.27.0

5 years ago

0.26.0

5 years ago

0.25.0

5 years ago

0.24.0

5 years ago

0.22.0

5 years ago

0.23.0

5 years ago

0.20.0

5 years ago

0.21.0

5 years ago

0.19.0

5 years ago

0.18.0

5 years ago

0.17.0

5 years ago

0.16.0

5 years ago

0.15.0

5 years ago

0.14.0

5 years ago

0.13.0

5 years ago

0.12.0

5 years ago

0.11.2

5 years ago

0.11.1

5 years ago

0.11.0

5 years ago

0.10.1

5 years ago

0.10.0

5 years ago

0.9.0

5 years ago

0.8.2

5 years ago

0.8.1

5 years ago

0.8.0

5 years ago

0.7.16

5 years ago

0.7.15

5 years ago

0.7.14

5 years ago

0.7.13

5 years ago

0.7.12

5 years ago

0.7.11

5 years ago

0.7.10

5 years ago

0.7.9

5 years ago

0.7.8

5 years ago

0.7.7

5 years ago

0.7.6

5 years ago

0.7.5

5 years ago

0.7.4

5 years ago

0.7.3

5 years ago

0.7.2

5 years ago

0.7.1

5 years ago

0.7.0

5 years ago

0.6.6

5 years ago

0.6.5

5 years ago

0.6.4

5 years ago

0.6.3

5 years ago

0.6.2

5 years ago

0.6.1

5 years ago

0.6.0

5 years ago

0.5.5

6 years ago

0.5.4

6 years ago

0.5.3

6 years ago

0.5.2

6 years ago

0.5.1

6 years ago

0.5.0

6 years ago

0.4.13

6 years ago

0.4.12

6 years ago

0.4.10

6 years ago

0.4.11

6 years ago

0.4.9

6 years ago

0.4.8

6 years ago

0.4.7

6 years ago

0.4.6

6 years ago

0.4.5

6 years ago

0.4.4

6 years ago

0.4.3

6 years ago

0.4.2

6 years ago

0.4.1

6 years ago

0.4.0

6 years ago

0.3.5

6 years ago

0.3.4

6 years ago

0.3.2

6 years ago

0.3.3

6 years ago

0.3.1

6 years ago

0.3.0

6 years ago

0.2.4

6 years ago

0.2.3

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.0

6 years ago

0.0.20

6 years ago

0.0.21

6 years ago

0.0.19

6 years ago

0.0.18

6 years ago

0.0.17

6 years ago

0.0.16

6 years ago

0.0.15

6 years ago

0.0.14

6 years ago

0.0.13

6 years ago

0.0.12

6 years ago

0.0.11

6 years ago

0.0.10

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2-4

6 years ago

0.0.2-3

6 years ago

0.0.2-2

6 years ago

0.0.2-1

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago