GithubHelp home page GithubHelp logo

fannheyward / coc-rust-analyzer Goto Github PK

View Code? Open in Web Editor NEW
1.1K 7.0 39.0 2.42 MB

rust-analyzer extension for coc.nvim

License: MIT License

TypeScript 95.93% JavaScript 4.07%
rust coc coc-nvim rust-analyzer coc-extensions

coc-rust-analyzer's Introduction

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

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.

Configuration Description Default
rust-analyzer.enable Enable coc-rust-analyzer true
rust-analyzer.assist.emitMustUse Whether to insert #[must_use] when generating as_ methods for enum variants. false
rust-analyzer.assist.expressionFillDefault Placeholder expression to use for missing expressions in assists. todo
rust-analyzer.cachePriming.enable Warm up caches on project load. true
rust-analyzer.cachePriming.numThreads How many worker threads to handle priming caches. The default 0 means to pick automatically. 0
rust-analyzer.cargo.autoreload Automatically refresh project info via cargo metadata on Cargo.toml or .cargo/config.toml changes. true
rust-analyzer.cargo.buildScripts.enable Run build scripts (build.rs) for more precise code analysis. true
rust-analyzer.cargo.buildScripts.invocationLocation Specifies the working directory for running build scripts. workspace
rust-analyzer.cargo.buildScripts.invocationStrategy Specifies the invocation strategy to use when running the build scripts command. null
rust-analyzer.cargo.buildScripts.useRustcWrapper Use RUSTC_WRAPPER=rust-analyzer when running build scripts to avoid checking unnecessary things. true
rust-analyzer.cargo.extraEnv Extra environment variables that will be set when running cargo, rustc or other commands within the workspace. Useful for setting RUSTFLAGS. null
rust-analyzer.cargo.features List of features to activate. Set this to "all" to pass --all-features to cargo. ``
rust-analyzer.cargo.noDefaultFeatures Whether to pass --no-default-features to cargo. false
rust-analyzer.cargo.sysroot Relative path to the sysroot, or "discover" to try to automatically find it via "rustc --print sysroot". discover
rust-analyzer.cargo.sysrootSrc Relative path to the sysroot library sources. If left unset, this will default to {cargo.sysroot}/lib/rustlib/src/rust/library. null
rust-analyzer.cargo.target Compilation target override (target triple). null
rust-analyzer.cargo.unsetTest Unsets #[cfg(test)] for the specified crates. core
rust-analyzer.check.allTargets Check all targets and tests (--all-targets). true
rust-analyzer.check.command Cargo command to use for cargo check. check
rust-analyzer.check.extraArgs Extra arguments for cargo check. []
rust-analyzer.check.extraEnv Extra environment variables that will be set when running cargo check. Extends #rust-analyzer.cargo.extraEnv#. {}
rust-analyzer.check.features List of features to activate. Defaults to #rust-analyzer.cargo.features#. Set to "all" to pass --all-features to Cargo. null
rust-analyzer.check.invocationLocation Specifies the working directory for running checks. workspace
rust-analyzer.check.invocationStrategy Specifies the invocation strategy to use when running the checkOnSave command. per_workspace
rust-analyzer.check.noDefaultFeatures Whether to pass --no-default-features to Cargo. Defaults to #rust-analyzer.cargo.noDefaultFeatures#. null
rust-analyzer.check.overrideCommand Override the command rust-analyzer uses instead of cargo check for diagnostics on save. null
rust-analyzer.check.targets Check for specific targets. Defaults to #rust-analyzer.cargo.target# if empty. null
rust-analyzer.checkOnSave Run the check command for diagnostics on save. true
rust-analyzer.completion.autoimport.enable Toggles the additional completions that automatically add imports when completed true
rust-analyzer.completion.autoself.enable Toggles 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.snippets Whether to add parenthesis and argument snippets when completing function. fill_arguments
rust-analyzer.completion.limit Maximum number of completions to return. If None, the limit is infinite. null
rust-analyzer.completion.postfix.enable Whether to show postfix snippets like dbg, if, not, etc. true
rust-analyzer.completion.privateEditable.enable Enables 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.custom Custom completion snippets.
rust-analyzer.debug.runtime Choose which debug runtime to use termdebug
rust-analyzer.debug.vimspector.configuration.name Specify 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.template Configuration 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.disabled List of rust-analyzer diagnostics to disable. ``
rust-analyzer.diagnostics.enable Whether to show native rust-analyzer diagnostics. true
rust-analyzer.diagnostics.experimental.enable Whether to show experimental rust-analyzer diagnostics that might have more false positives than usual. false
rust-analyzer.diagnostics.remapPrefix Map 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.warningsAsHint List of warnings that should be displayed with hint severity. ``
rust-analyzer.diagnostics.warningsAsInfo List of warnings that should be displayed with info severity. ``
rust-analyzer.disableProgressNotifications Disable initialization and workdone progress notifications false
rust-analyzer.files.excludeDirs These directories will be ignored by rust-analyzer. ``
rust-analyzer.files.watcher Controls file watching implementation. client
rust-analyzer.highlightRelated.breakPoints.enable Enables highlighting of related references while the cursor is on break, loop, while, or for keywords. true
rust-analyzer.highlightRelated.exitPoints.enable Enables highlighting of all exit points while the cursor is on any return, ?, fn, or return type arrow (->). true
rust-analyzer.highlightRelated.references.enable Enables highlighting of related references while the cursor is on any identifier. true
rust-analyzer.highlightRelated.yieldPoints.enable Enables 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.enable Whether to show documentation on hover. true
rust-analyzer.hover.documentation.keywords.enable Whether to show keyword hover popups. Only applies when #rust-analyzer.hover.documentation.enable# is set. true
rust-analyzer.hover.links.enable Use markdown syntax for links in hover. true
rust-analyzer.imports.granularity.enforce Whether 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.group How imports should be grouped into use statements. crate
rust-analyzer.imports.group.enable Group 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.glob Whether to allow import insertion to merge new imports into single path glob imports like use std::fmt::*;. true
rust-analyzer.imports.prefer.no.std Prefer to unconditionally use imports of the core and alloc crate, over the std crate. false
rust-analyzer.imports.prefix The path structure for newly inserted paths to use. plain
rust-analyzer.inlayHints.bindingModeHints.enable Whether to show inlay type hints for binding modes. false
rust-analyzer.inlayHints.chainingHints.enable Whether to show inlay type hints for method chains. true
rust-analyzer.inlayHints.closingBraceHints.enable Whether to show inlay hints after a closing } to indicate what item it belongs to. true
rust-analyzer.inlayHints.closingBraceHints.minLines Minimum 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.enable Whether to show inlay type hints for return types of closures. never
rust-analyzer.inlayHints.discriminantHints.enable Whether to show enum variant discriminant hints. never
rust-analyzer.inlayHints.expressionAdjustmentHints.enable Whether to show inlay hints for type adjustments. never
rust-analyzer.inlayHints.expressionAdjustmentHints.hideOutsideUnsafe Whether to hide inlay hints for type adjustments outside of unsafe blocks. false
rust-analyzer.inlayHints.expressionAdjustmentHints.mode Whether to show inlay hints as postfix ops (.* instead of *, etc). prefix
rust-analyzer.inlayHints.lifetimeElisionHints.enable Whether to show inlay type hints for elided lifetimes in function signatures. never
rust-analyzer.inlayHints.lifetimeElisionHints.useParameterNames Whether to prefer using parameter names as the name for elided lifetime hints if possible. false
rust-analyzer.inlayHints.maxLength Maximum length for inlay hints. Set to null to have an unlimited length. 25
rust-analyzer.inlayHints.parameterHints.enable Whether to show function parameter name inlay hints at the call site. true
rust-analyzer.inlayHints.reborrowHints.enable Whether to show inlay hints for compiler inserted reborrows. This setting is deprecated in favor of #rust-analyzer.inlayHints.expressionAdjustmentHints.enable#. never
rust-analyzer.inlayHints.renderColons Whether to render leading colons for type hints, and trailing colons for parameter hints. true
rust-analyzer.inlayHints.typeHints.enable Whether to show inlay type hints for variables. true
rust-analyzer.inlayHints.typeHints.hideClosureInitialization Whether 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.hideNamedConstructor Whether to hide inlay type hints for constructors. false
rust-analyzer.joinLines.joinAssignments Join lines merges consecutive declaration and initialization of an assignment. true
rust-analyzer.joinLines.joinElseIf Join lines inserts else between consecutive ifs. true
rust-analyzer.joinLines.removeTrailingComma Join lines removes trailing commas. true
rust-analyzer.joinLines.unwrapTrivialBlock Join lines unwraps trivial blocks. true
rust-analyzer.lens.debug.enable Whether to show Debug lens. Only applies when #rust-analyzer.lens.enable# is set. true
rust-analyzer.lens.enable Whether to show CodeLens in Rust files. true
rust-analyzer.lens.forceCustomCommands Internal config: use custom client-side commands even when the client doesn't set the corresponding capability. true
rust-analyzer.lens.implementations.enable Whether to show Implementations lens. Only applies when #rust-analyzer.lens.enable# is set. true
rust-analyzer.lens.location Where to render annotations. above_name
rust-analyzer.lens.references.adt.enable Whether to show References lens for Struct, Enum, and Union. Only applies when #rust-analyzer.lens.enable# is set. false
rust-analyzer.lens.references.enumVariant.enable Whether to show References lens for Enum Variants. Only applies when #rust-analyzer.lens.enable# is set. false
rust-analyzer.lens.references.method.enable Whether to show Method References lens. Only applies when #rust-analyzer.lens.enable# is set. false
rust-analyzer.lens.references.trait.enable Whether to show References lens for Trait. Only applies when #rust-analyzer.lens.enable# is set. false
rust-analyzer.lens.run.enable Whether to show Run lens. Only applies when #rust-analyzer.lens.enable# is set. true
rust-analyzer.linkedProjects Disable project auto-discovery in favor of explicitly specified set of projects. ``
rust-analyzer.lru.capacity Number of syntax trees rust-analyzer keeps in memory. Defaults to 128. null
rust-analyzer.notifications.cargoTomlNotFound Whether to show can't find Cargo.toml error message. true
rust-analyzer.numThreads How many worker threads in the main loop. The default null means to pick automatically. null
rust-analyzer.procMacro.attributes.enable Expand attribute macros. Requires #rust-analyzer.procMacro.enable# to be set. true
rust-analyzer.procMacro.enable Enable support for procedural macros, implies #rust-analyzer.cargo.buildScripts.enable#. true
rust-analyzer.procMacro.ignored These proc-macros will be ignored when trying to expand them. {}
rust-analyzer.procMacro.server Internal config, path to proc-macro server executable (typically, this is rust-analyzer itself, but we override this in tests). null
rust-analyzer.references.excludeImports Exclude imports from find-all-references. false
rust-analyzer.restartServerOnConfigChange Whether to restart the server automatically when certain settings that require a restart are changed. false
rust-analyzer.runnables.command Command to be executed instead of 'cargo' for runnables. null
rust-analyzer.runnables.extraArgs Additional arguments to be passed to cargo for runnables such as tests or binaries. For example, it may be --release. ``
rust-analyzer.rustc.source Path 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.extraArgs Additional arguments to rustfmt. ``
rust-analyzer.rustfmt.overrideCommand Advanced option, fully override the command rust-analyzer uses for formatting. null
rust-analyzer.rustfmt.rangeFormatting.enable Enables 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.enable Inject additional highlighting into doc comments. true
rust-analyzer.semanticHighlighting.operator.enable Use semantic tokens for operators. true
rust-analyzer.semanticHighlighting.operator.specialization.enable Use specialized semantic tokens for operators. false
rust-analyzer.semanticHighlighting.punctuation.enable Use semantic tokens for punctuations. false
rust-analyzer.semanticHighlighting.punctuation.separate.macro.bang When enabled, rust-analyzer will emit a punctuation semantic token for the ! of macro calls. false
rust-analyzer.semanticHighlighting.punctuation.specialization.enable Use specialized semantic tokens for punctuations. false
rust-analyzer.semanticHighlighting.strings.enable Use semantic tokens for strings. true
rust-analyzer.server.extraEnv Extra environment variables that will be passed to the rust-analyzer executable. Useful for passing e.g. RA_LOG for debugging. null
rust-analyzer.server.path Path to rust-analyzer executable (points to bundled binary by default). If this is set, then "rust-analyzer.updates.channel" setting is not used null
rust-analyzer.signatureInfo.detail Show full signature of the callable. Only shows parameters if disabled. full
rust-analyzer.signatureInfo.documentation.enable Show documentation. true
rust-analyzer.terminal.startinsert Enter insert mode after terminal displayed false
rust-analyzer.trace.server Trace requests to the rust-analyzer off
rust-analyzer.typing.autoClosingAngleBrackets.enable Whether to insert closing angle brackets when typing an opening angle bracket of a generic argument list. false
rust-analyzer.updates.channel Choose "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 APIs stable
rust-analyzer.updates.checkOnStartup Auto-check rust-analyzer updates on startup true
rust-analyzer.updates.prompt Prompt the user before downloading rust-analyzer true
rust-analyzer.workspace.symbol.search.kind Workspace symbol search kind. only_types
rust-analyzer.workspace.symbol.search.limit Limits the number of items returned from a workspace symbol search (Defaults to 128). 128
rust-analyzer.workspace.symbol.search.scope Workspace symbol search scope. workspace

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.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

coc-rust-analyzer's People

Contributors

danielrainer avatar darksonn avatar dependabot-preview[bot] avatar dependabot[bot] avatar elkowar avatar fannheyward avatar gopherj avatar gustavokatel avatar j0hn50n133 avatar joshmcguigan avatar lnicola avatar medwards avatar pastalian avatar poga avatar seniormars avatar sify21 avatar the10thwiz avatar timofreiberg avatar tistatos avatar trygveaa avatar tweksteen avatar typoon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

coc-rust-analyzer's Issues

Error when updating

[coc.nvim] error: Uncaught exception: Error: ETXTBSY: text file is busy, open '/home/vn-ki/.config/coc/extensions/coc-rust-analyzer-data/rust-analyzer'

After this error appears, the download never finishes.

"create module" assist fails to open created file

When running the "create module" assist, I get the following prompt:

1 documents on disk would be loaded for change, confirm?
[Y]es, (N)o: 

No matter what I choose, I stay in the current file and get the following error:

2020-04-19T11:39:14.479 ERROR (pid:16623) [commands] - Error: [UriError]: Scheme is missing: {scheme: "", authority: "", path: "/home/tf/Projects/rust/test-create-mod/src/foo.rs", query: "", fragment: ""}
    at _validateUri (/home/tf/.local/share/nvim/plugged/coc.nvim/build/index.js:21303:19)
    at _URI.URI (/home/tf/.local/share/nvim/plugged/coc.nvim/build/index.js:21405:13)
    at new _URI (/home/tf/.local/share/nvim/plugged/coc.nvim/build/index.js:21607:47)
    at Function.URI.parse (/home/tf/.local/share/nvim/plugged/coc.nvim/build/index.js:21517:16)
    at Workspace.getDocument (/home/tf/.local/share/nvim/plugged/coc.nvim/build/index.js:24569:32)
    at Workspace.readFile (/home/tf/.local/share/nvim/plugged/coc.nvim/build/index.js:24868:29)
    at Object.applySourceChange (/home/tf/.local/share/nvim/plugged/coc-rust-analyzer/lib/index.js:5553:36)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async /home/tf/.local/share/nvim/plugged/coc-rust-analyzer/lib/index.js:227:9

I didn't manage to add logging here, so I'm not sure if this is a bug in coc-rust-analyzer, coc.nvim or my config.

Do you know if it's possible to disable the 1 documents on disk would be loaded for change, confirm? prompt?

Error appears then goes away

I'm having an issue where after I save it'll correctly detect an error but after about a second the error goes away. Any idea whats going on?

Recording:

coc error goes away

Error while opening file

Hi,
I'm trying to use coc-rust-analyzer but I get this error message in vim:

[coc.nvim] Error on active extension coc-rust-analyzer: TypeError: Cannot read property 'uri' of null                                                                                                 
    at Function.prepare (/home/wojtek/.config/coc/extensions/node_modules/coc-rust-analyzer/lib/index.js:289:50)                                                                                      
    at Object.activate (/home/wojtek/.config/coc/extensions/node_modules/coc-rust-analyzer/lib/index.js:106:33)                                                                                       
    at Object.activate (/home/wojtek/.config/nvim/plugged/coc.nvim/build/index.js:36128:57)                                                                                                           
    at Extensions.activate (/home/wojtek/.config/nvim/plugged/coc.nvim/build/index.js:35853:19)                                                                                                       
    at active (/home/wojtek/.config/nvim/plugged/coc.nvim/build/index.js:36033:18)                                                                                                                    
    at Extensions.setupActiveEvents (/home/wojtek/.config/nvim/plugged/coc.nvim/build/index.js:36042:21)                                                                                              
    at Extensions.createExtension (/home/wojtek/.config/nvim/plugged/coc.nvim/build/index.js:36197:18)                                                                                                
    at Extensions.loadExtension (/home/wojtek/.config/nvim/plugged/coc.nvim/build/index.js:35803:18)

Building/installing from source

:CocInstall https://github.com/fannheyward/coc-rust-analyzer does not generate index.js and yarn install errors with:

index.js  4.02 KiB       0  [emitted]  main
Entrypoint main = index.js
[0] ./src/index.ts 400 bytes {0} [built] [failed] [1 error]

ERROR in ./src/index.ts 8:38
Module parse failed: Unexpected token (8:38)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| import { Server } from './server';
| 
> export async function activate(context: ExtensionContext): Promise<void> {
|   const run = Server.prepare();
|   if (!run) {
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
ERROR: "build" exited with 2.
error Command failed with exit code 1.

Cargo watch throws errors

After upgrading to the latest version, and starting cargo-watch, I got the following error:

[coc.nvim] Command: codeAction not found
[coc.nvim] error: { Error: Connection is disposed.
    at throwIfClosedOrDisposed (/Users/jean/.config/nvim/plugged/coc.nvim/build/index.js:38379:19)
    at Object.sendNotification (/Users/jean/.config/nvim/plugged/coc.nvim/build/index.js:38426:13)
    at token.onCancellationRequested (/Users/jean/.config/nvim/plugged/coc.nvim/build/index.js:38538:32)
    at CallbackList.invoke (/Users/jean/.config/nvim/plugged/coc.nvim/build/index.js:39233:39)
    at Emitter.fire (/Users/jean/.config/nvim/plugged/coc.nvim/build/index.js:39291:36)
    at MutableToken.cancel (/Users/jean/.config/nvim/plugged/coc.nvim/build/index.js:39549:31)
    at CancellationTokenSource.cancel (/Users/jean/.config/nvim/plugged/coc.nvim/build/index.js:39590:25)
    at Handler.triggerSignatureHelp (/Users/jean/.config/nvim/plugged/coc.nvim/build/index.js:86437:39)
    at Handler.events_1.default.on (/Users/jean/.config/nvim/plugged/coc.nvim/build/index.js:85792:32)
    at processTicksAndRejections (internal/process/next_tick.js:81:5) code: 2 }

Don't really have a minimal reproducible example, as it happened while working in a bigger work-related project.

CPU 100% and freeze when too many syntax error

First of all, thank you for your great coc plugin 🎉 Well, I'm not 100% sure if it's caused by the coc-rust-analyzer but it seems syntax error cause 100% CPU usage and freezes like below.

Alacritty 2020-02-08 00-10-00

Once Neovim becomes enter this situation, I had to kill it by kill {PID}.

Procedure

  1. Save the following file
  2. Move cursor after process::
  3. Insert { then escape insert mode and wait
  4. Freeze 🍨
use std::process::Command;

fn main() {
    let a = "a";
    let a = "a";
    let a = "a";
    let a = "a";
    let a = "a";
    let a = "a";
    let a = "a";
    let a = "a";
    let a = "a";
    let a = "a";
    let a = "a";
    let a = "a";
    let a = "a";
    let a = "a";
    let a = "a";
    let a = "a";
    let a = "a";
    let a = "a";
    let a = "a";
    let a = "a";
    let a = "a";
    let a = "a";
    let a = "a";
    let a = "a";
    let a = "a";
    let a = "a";
    let a = "a";
    let a = "a";
    let a = "a";
    let a = "a";
    let a = "a";
    let a = "a";
    let a = "a";
    let a = "a";
    let a = "a";
    let a = "a";
    let a = "a";
    let a = "a";
    let a = "a";
    let a = "a";
    let a = "a";
    let a = "a";
    let a = "a";
    let a = "a";
    let a = "a";
    let a = "a";
    let a = "a";
    let a = "a";
    let a = "a";
    let a = "a";
    let a = "a";
    let a = "a";
    let a = "a";
    let a = "a";
    let a = "a";
    let a = "a";
    let a = "a";
    let a = "a";
    let a = "a";
}

Some questions

Hey,
I hope you don't mind some questions here. I'm unsure in which repository I should ask.

  • Can I configure coc or rust-analyzer to use Clippy?
  • Is there any way to jump between errors in a file?
  • Is there any way to let the location list (:lopen) show errors from more than just the current file, or to otherwise at least get an idea of which other files have errors?

Requires Cargo.toml to be in root of git repo

When trying to use coc in a project that isn't at the root of the git repo, I get this error:

[coc.nvim] Couldn't find 'Cargo.toml' in /home/alice/src/server/Cargo.toml

While the Cargo.toml is located one directory deeper in the current working directory.

Autocomplete?

I'm switching from coc-rls, but I'm noticing this has no autocomplete. Did I not add a config for that, or does this have no autocomplete.

inlayHints toggle.

While it's pretty cool with the new inlayHints. I'd very much like to have a command to toggle it on/off since sometimes it clutters the code.

Workspace loaded, 0 rust packages

I have downloaded, built and installed ra and setup this line in my coc-settings.json:

"rust-analyzer.raLspServerPath": "/opt/rust-analyzer/target/release/ra_lsp_server"

Then, after a fresh :CocInstall coc-rust-analyzer, I get this message when I open a .rs file:

[coc.nvim] workspace loaded, 0 rust packages

Nothing else seems to happen, only syntax errors seem to be detected, and I get no hover information like I used to get with coc-rls.

What could be wrong? Thank you for support :)

[Breaking Changes] rust-analyzer 2020-04-06 renames many configuration options

rust-analyzer #3824

  • rust-analyzer.featureFlags removed
  • rust-analyzer.excludeGlobs removed
  • rust-analyzer.useClientWatching removed
  • rust-analyzer.cargo-watch.enable -> rust-analyzer.checkOnSave.enable
  • rust-analyzer.cargo-watch.arguments -> rust-analyzer.checkOnSave.extraArgs
  • rust-analyzer.cargo-watch.command -> rust-analyzer.checkOnSave.command
  • rust-analyzer.cargo-watch.allTargets -> rust-analyzer.checkOnSave.allTargets
  • rust-analyzer.cargoFeatures.noDefaultFeatures -> rust-analyzer.cargo.noDefaultFeatures
  • rust-analyzer.cargoFeatures.allFeatures -> rust-analyzer.cargo.allFeatures
  • rust-analyzer.cargoFeatures.features -> rust-analyzer.cargo.features
  • rust-analyzer.cargoFeatures.loadOutDirsFromCheck -> rust-analyzer.cargo.loadOutDirsFromCheck

Question: Inlay hints

I just setup coc-rust-analyzer and it works just fine.
I wonder if the extension is able to provide inlay hints out of chaining calls :

Screenshot 2020-05-01 at 10 14 11

On the image above, the extension provide inlay hints for chaining calls but variables string and frequency do not have inlay hints.

Example with VSCODE

Screenshot 2020-05-01 at 10 58 10

Did I miss one configuration to enable this feature ?
Thanks for your help.

Additional information

  • My CocConfig is empty
  • Rust analyzer
$ rust-analyzer --version
rust-analyzer 7a9ba16
  • CocVersion
## versions
vim version: NVIM v0.4.3
node version: v14.1.0
coc.nvim version: 0.0.78-030aef2f6d
term: iTerm.app
platform: darwin
  • CocOpenLog
2020-05-01T10:26:31.367 INFO (pid:1041) [plugin] - coc 0.0.78-030aef2f6d initialized with node: v14.1.0
2020-05-01T10:26:47.182 INFO (pid:1041) [services] - registered service "rust-analyzer"
2020-05-01T10:26:47.183 INFO (pid:1041) [services] - Rust Analyzer Language Server state change: stopped => starting
2020-05-01T10:26:47.191 INFO (pid:1041) [language-client-index] - rust-analyzer started with 1091
2020-05-01T10:26:47.197 INFO (pid:1041) [services] - Rust Analyzer Language Server state change: starting => running
2020-05-01T10:26:47.203 INFO (pid:1041) [services] - service rust-analyzer started

cargo-watch + ALE slows down nvim

When I enable cargo-watch support (using the clippy command), and I use diagnostic.displayByAle, it looks like something happens synchronously that makes the editor become really slow/unresponsive.

If I save a file that has 2 or 3 warnings, the cursor flashes several times as it's updating the status, and the editor is unresponsive during that time, so I can't move the cursor for a second or so.

Unfortunately I don't have a minimum reproducible example, but I'm posting it here instead of coc.nvim, because all the other extensions don't show this behaviour with ALE integration enabled.

Rust-analyzer starting from scratch every time I open vim

I'm not sure if this is a coc-r-a problem or a r-a problem.

My workflow is such that vim instances have pretty short lives. Every time I open a new instance, the whole project gets rechecked by rust-analyzer so it makes it kind of useless.

I'm not sure why it restarts from scratch every time (for every dependency) given that it's writing to the target/ directory.

UnhandledRejection: TypeError

Since I updated fairly recently, whenever I open a rust project I continuously get errors from coc.nvim. The error says:

[coc.nvim] error: UnhandledRejection: TypeError: this.ctx.sendRequestWithRetry(...).catch(...).finally is not a function

Heres the coc.nvim log:

    8   <rejected> TypeError: this.ctx.sendRequestWithRetry(...).catch(...).finally is not a function
    9     at HintsUpdater.fetchHints (/home/matt/.config/coc/extensions/node_modules/coc-rust-analyzer/lib/index.js: 8258:21)
   10     at sourceFiles.forEach (/home/matt/.config/coc/extensions/node_modules/coc-rust-analyzer/lib/index.js:8219:54)
   11     at Map.forEach (<anonymous>)
   12     at HintsUpdater.syncCacheAndRenderHints (/home/matt/.config/coc/extensions/node_modules/coc-rust-analyzer/lib/index.js:8219:26)
   13     at new HintsUpdater (/home/matt/.config/coc/extensions/node_modules/coc-rust-analyzer/lib/index.js:8211:14)
   14     at Object.onConfigChange (/home/matt/.config/coc/extensions/node_modules/coc-rust-analyzer/lib/index.js:8278:32)
   15     at <anonymous>
   16     at process._tickCallback (internal/process/next_tick.js:188:7) } TypeError: this.ctx.sendRequestWithRetry(...).catch(...).finally is not a function
   17     at HintsUpdater.fetchHints (/home/matt/.config/coc/extensions/node_modules/coc-rust-analyzer/lib/index.js:8258:21)
   18     at sourceFiles.forEach (/home/matt/.config/coc/extensions/node_modules/coc-rust-analyzer/lib/index.js:8219:54)
   19     at Map.forEach (<anonymous>)
   20     at HintsUpdater.syncCacheAndRenderHints (/home/matt/.config/coc/extensions/node_modules/coc-rust-analyzer/lib/index.js:8219:26)
   21     at new HintsUpdater (/home/matt/.config/coc/extensions/node_modules/coc-rust-analyzer/lib/index.js:8211:14)
   22     at Object.onConfigChange (/home/matt/.config/coc/extensions/node_modules/coc-rust-analyzer/lib/index.js:8278:32)
   23     at <anonymous>
   24     at process._tickCallback (internal/process/next_tick.js:188:7)

Sorry for any weird formatting, it was a pain to copy/paste.

From a bunch of random searching, it looks like it was caused by this commit here handing something it wasn't supposed to to coc (that's about as specific as I can be)

(edit)

here's the specific line that's causing problems

Adding

{
    "rust-analyzer.inlayHints.chainingHints": "false"
}

to coc-settings.json does not fix the problem

Connection error

I tried 'rust-analyzer' without any plugin yesterday, and seems to work perfectly, but after adding coc-rust-analyzer i got the following error:

`2020-05-02T14:17:18.457 INFO (pid:526) [plugin] - coc 0.0.78-030aef2f6d initialized with node: v8.10.0

23 2020-05-02T14:17:23.491 INFO (pid:526) [services] - registered service "rust-analyzer"

22 2020-05-02T14:17:23.492 INFO (pid:526) [services] - Rust Analyzer Language Server state change: stopped => starting

21 2020-05-02T14:17:23.547 INFO (pid:526) [language-client-index] - rust-analyzer started with 538

20 2020-05-02T14:17:23.560 ERROR (pid:526) [language-client-client] - connection error: { Error: write EPIPE

19 at _errnoException (util.js:1022:11)

18 at WriteWrap.afterWrite [as oncomplete] (net.js:880:14) code: 'EPIPE', errno: 'EPIPE', syscall: 'write' } undefined

17 2020-05-02T14:17:25.290 INFO (pid:526) [services] - Rust Analyzer Language Server state change: starting => stopped

16 2020-05-02T14:17:25.292 ERROR (pid:526) [language-client-client] - connection error: Error: This socket is closed

15 at Socket._writeGeneric (net.js:739:18)

14 at Socket._write (net.js:799:8)

13 at doWrite (_stream_writable.js:397:12)

12 at writeOrBuffer (_stream_writable.js:383:5)

11 at Socket.Writable.write (_stream_writable.js:290:11)

10 at Socket.write (net.js:717:40)

9 at StreamMessageWriter.write (/home/anouar/.vim/plugged/coc.nvim/build/index.js:17174:27)

8 at Promise (/home/anouar/.vim/plugged/coc.nvim/build/index.js:16322:35)

7 at new Promise ()

6 at Object.sendRequest (/home/anouar/.vim/plugged/coc.nvim/build/index.js:16312:26) undefined

5 2020-05-02T14:17:25.293 ERROR (pid:526) [language-client-client] - connection error: Error: This socket is closed

4 at Socket._writeGeneric (net.js:739:18)

3 at Socket._write (net.js:799:8)

2 at doWrite (_stream_writable.js:397:12)

1 at writeOrBuffer (_stream_writable.js:383:5)

0 at Socket.Writable.write (_stream_writable.js:290:11)

1 at Socket.write (net.js:717:40)

2 at StreamMessageWriter.write (/home/anouar/.vim/plugged/coc.nvim/build/index.js:17176:27)

3 at Promise (/home/anouar/.vim/plugged/coc.nvim/build/index.js:16322:35)

4 at new Promise ()

5 at Object.sendRequest (/home/anouar/.vim/plugged/coc.nvim/build/index.js:16312:26) undefined`

No code autocomplete

I'm trying to replace rls with rust-analyzer. I'm using coc and I've installed the extension coc-rust-analyzer. I've used rust-analyzer from the arch linux aur repository and the one downloaded by the extension but none of theme seems to work for me. There should be something wrong with my setup despite I'v followed the installation guide.

With coc-rls i see this:
rust-rls

but with coc-rust-analyzer (the rls extension removed) I only get the diagnostic but no completion suggestions:

rust-analyzer

I've tried to add these lines to coc-settings.json but with no luck.

{
  "diagnostic.enableHighlightLineNumber": true,
  "rust-analyzer.diagnostics.enable": true,
  "rust-analyzer.procMacro.enable": true,
  "rust-analyzer.cargo.loadOutDirsFromCheck": true,
  "rust-analyzer.trace.server": "verbose",
....
}

Is it supposed to provide auto completion suggestions ?
Is there anything I'm missing in my config ? Thanks.

Jump to definition failed

My project is a large size project (>100k code of line). When I try to jump to definition, it always failed.

Triggering assists

Hi, Thanks for creating the extension! Are the assists mentioned here supported in Neovim?

I've tried the examples mentioned on the page, but don't see any completion suggestions to trigger the assists.

v0.4.5 errors

Thanks for your work maintaining this plugin. I've noticed since the v0.4.5 update I started getting an error on startup. It seems to show up the first time I open a .rs file.

   22 2020-03-10T04:13:53.991 INFO (pid:1574866) [services] - registed service "rust-analyzer"
   23 2020-03-10T04:13:53.995 INFO (pid:1574866) [language-client-index] - rust-analyzer started with 1574999
   24 2020-03-10T04:13:53.997 INFO (pid:1574866) [services] - Rust Analyzer Language Server state change: starting => running
   25 2020-03-10T04:13:53.999 ERROR (pid:1574866) [extensions] - TypeError: client.onProgress is not a function
   26     at /home/josh/.config/coc/extensions/node_modules/coc-rust-analyzer/lib/index.js:8194:16
   27     at Ctx.startServer (/home/josh/.config/coc/extensions/node_modules/coc-rust-analyzer/lib/index.js:6050:13)
   28     at async Object.activate (/home/josh/.config/coc/extensions/node_modules/coc-rust-analyzer/lib/index.js:132:5)
   29     at async Object.activate (/home/josh/.vim/plugged/coc.nvim/build/index.js:58421:31)

I also get an error when attempting to use the fill match arms code action:

[coc.nvim] Execute 'rust-analyzer.applySourceChange error: Error: unknown request'

Finally, it seems the rust-analyzer plugin isn't registering commands with coc. I get no autocomplete if I try to :CocCommand rust-an<TAB>, and if I enter a command manually I get:

[coc.nvim] Command: rust-analyzer.reload not found

I've confirmed that none of these are there if I downgrade to v0.4.4.

Let me know if there is anything further I can do to help troubleshoot or fix this issue!

Add support for `useClientWatching`

There's a bug in a dependency of RA that can cause 100% CPU usage in some projects.

A workaround was implemented that requires setting the useClientWatching flag. It would be nice if coc-rust-analyzer added support for that.

I'm not sure if coc supports the watching part of the LSP protocol though, so I'm not even sure this can work.

Semantic checking/autocomplete not working

Fresh CoC install/plugin install, syntax checking works but semantic checking and autocomplete do not.

For instance, while this syntactically malformed function is rejected:

pub fn f() -> {
}

this semantically malformed one is not, when it should be:

pub fn f() -> i32 {
   "hi"
}

Similarly, no completion is offered for struct members/namespaces

Add disableDiagnostics setting

I'm not yet using coc-rust-analyzer, my old setup is:

  let languageservers = {}

  let languageservers['rust'] = {
  \   'command': 'ra_lsp_server',
  \   'filetypes': ['rust'],
  \   'rootPatterns': ['Cargo.toml'],
  \   'disableDiagnostics': v:true
  \ }

  call coc#config('languageserver', languageservers)

Having disableDiagnostics is important in my setup because at the moment rust-analyzer isn't useful for diagnostics, so I'm using ALE with RLS for that. I'm not sure whether I can already use this setting with coc-rust-analyzer or it needs to be added.

coc-rust-analyzer doesn't display "related information" diagnostics ("value moved here" etc)

coc-rust-analyzer doesn't display the "related information" part of diagnostic messages, even though it is reported by the rust-analyzer language server:

Example program: (playground)

fn main() {
    let x = "hello world!\n".to_string();
    //  - move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait
    // (this diagnostic is missing)

    take(x);
    //   - value moved here
    // (this diagnostic is missing)

    println!("{}", x);
    //             ^ value borrowed here after move
    // (this diagnostic is displayed)
}

fn take(s: String) {
    println!("{}", s);
}

Diagnostic information from trace:

[Trace - 18:21:52] Received notification 'textDocument/publishDiagnostics'.
Params: {
    "diagnostics": [
        {
            "code": "E0382",
            "message": "borrow of moved value: `x`\nvalue borrowed here after move",
            "range": {
                "end": {
                    "character": 20,
                    "line": 5
                },
                "start": {
                    "character": 19,
                    "line": 5
                }
            },
            "relatedInformation": [
                {
                    "location": {
                        "range": {
                            "end": {
                                "character": 10,
                                "line": 3
                            },
                            "start": {
                                "character": 9,
                                "line": 3
                            }
                        },
                        "uri": "file:///home/yrlf/Programming/rs/misc/foo/src/main.rs"
                    },
                    "message": "value moved here"
                },
                {
                    "location": {
                        "range": {
                            "end": {
                                "character": 9,
                                "line": 1
                            },
                            "start": {
                                "character": 8,
                                "line": 1
                            }
                        },
                        "uri": "file:///home/yrlf/Programming/rs/misc/foo/src/main.rs"
                    },
                    "message": "move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait"
                }
            ],
            "severity": 1,
            "source": "rustc"
        }
    ],
    "uri": "file:///home/yrlf/Programming/rs/misc/foo/src/main.rs"
}

Current display in CoC with coc-rust-analyzer:
view in editor

Client-side cargo watch support has been removed

Because ra_lsp_server has added built-in-server support: rust-lang/rust-analyzer#2668, please upgrade to the latest version server.

Changes:

  1. commands rust-analyzer.startCargoWatch and rust-analyzer.stopCargoWatch have been removed
  2. rust-analyzer.enableCargoWatchOnStartup renamed to rust-analyzer.cargo-watch.enable, defaults true
  3. rust-analyzer.cargo-watch.arguments changed to string[] type
  4. rust-analyzer.cargo-watch.ignore has been removed

Cargo watch “ask” is completely obnoxious

Every time I open up vim, there’s a pause, I begin typing...and then it asks me if I want to cargo-watch, which screws up the command I’m typing and immediately cancels the message so you can’t see what happened.

I’m currently in the process of figuring out how to switch this off via the config file. An example would go a long way, and I don’t think this “ask” method is a good default if it can’t immediately show up. At the very least, it should have an “always” or “never” option that updates the config for you.

EDIT: The other problem I’ve run into is that no variants other than ask are in the readme

Otherwise, very happy that I can now use Vista.vim and it seems to be working correctly with rust-analyzer. Thanks for the hard work!

Uncaught exception: RangeError: Invalid string length

VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Dec 20 2019 13:24:40)
I installed coc and coc-rust-analyzer. I'm using the latest master branch of rust-analyzer.
When I load my Rust sample project, ra_lsp_server runs for 35 seconds and the error message pasted at the end of this issue infinitely loops in the vim window.

I tried two versions of coc:
Plug 'neoclide/coc.nvim', {'branch': 'master'}
and
Plug 'neoclide/coc.nvim', {'do': 'yarn install --frozen-lockfile'}

The exact same thing happens no matter what Rust project/source I attempt to load.

[coc.nvim] error: Uncaught exception: RangeError: Invalid string length
[coc.nvim] error: at BufferChannel.append (/home/mswanson/.vim/plugged/coc.nvim/lib/model/outputChannel.js:44:26)
[coc.nvim] error: at LanguageClient.appendOutput (/home/mswanson/.vim/plugged/coc.nvim/lib/language-client/index.js:420:28)
[coc.nvim] error: at Socket. (/home/mswanson/.vim/plugged/coc.nvim/lib/language-client/index.js:370:58)
[coc.nvim] error: at Socket.emit (events.js:210:5)
[coc.nvim] error: at addChunk (_stream_readable.js:309:12)
[coc.nvim] error: at readableAddChunk (_stream_readable.js:290:11)
[coc.nvim] error: at Socket.Readable.push (_stream_readable.js:224:10)
[coc.nvim] error: at Pipe.onStreamRead (internal/stream_base_commons.js:182:23)

[Breaking Change]: Using Rust Analyzer GitHub release by default

According rust-lang/rust-analyzer#2988 (comment)

With the proposal, the default is effectively "use rust-analyzer from ~/.cargo/bin". I strongly feel that the default should be "use bundled rust-analyzer". Without any options, we should suggest downloading the thing even there is a ra_lsp_server in PATH.

coc-rust-analyzer will use Rust Analyzer GitHub releases by default. ra_lsp_server in PATH will be ignored. When no RA server found in extension root, extension will guide you to download from GitHub:

Screen Shot 2020-02-07 at 15 29 02

Input 1 to download. You can always use :CocCommand rust-analyzer.upgrade to upgrade. coc-rust-analyzer also can do auto update check:

Screen Shot 2020-02-07 at 15 40 35

You can also use rust-analyzer.raLspServerPath to set a custom server path, this will be used first.

Error message on first download/install

I get [coc.nvim]: Unable to execute '/home/francisco/.config/coc/extensions/coc-rust-analyzer-data/ra_lsp_server --version' after it first downloads the latest release. rust-analyzer isn't loaded after install, reopening nvim fix the problem.

rust-analyzer cannot find Cargo.toml if rust project root is in a subdir relative to .git

I have a rust project set up in a subdir of a project using Git. CocInfo shows that rust-analyzer fails to find Cargo.toml after trying to find it in the git project root instead of the subdir that contains the rust project (and is also the current working directory; where I ran neovim from). If I run git init in the subdir and create a .git in the subdir where the rust project is, rust-analyzer then starts working.

EDIT: Wait.. should I have posted an issue in the rust-analyzer github page instead?

Leaks processes that are spawned continously

I don't know what's going on here, but some random node process keeps spawning ra_lsp_server to the point that my OOM killer triggers. When disabling this plugin, my computer works again.

[Feature request/Regression] Extension no longer searches PATH for the server executable?

When I used this plugin in the past, (back when the the server executable was still called ra_lsp_server and pre-compiled releases were not yet available) I remember that it used to search the PATH for the server executable. Some sleuthing shows that this capability was removed in 7d9a11b. I was wondering if this feature could be added back in.

The reason I'd like this feature is that it'd allow for better support for installation from other sources without having to touch rust-analyzer.serverPath:

  • Building rust-analyzer from source with cargo xtask install places the binary under ~/.cargo/bin/rust-analyzer
  • Installing it via a package manager, like AUR - rust-analyzer-bin places the binary under /usr/bin/rust-analyzer
  • Users who download the pre-compiled release could place it under ~/.local/bin/ or whatever directory under their PATH that they normally use.

I'd be willing to open a PR if this is something you'd be willing to accept.

Hangs on writes

I'm new to coc, coc-rust-analyzer and rust-analyzer in general (I've been using IntelliJ Rust), so apologies if I'm missing something obvious.

I'm working an issue with cargo and I noticed that when I write the buffer my cursor disappears for at least a second until diagnostics are populated. It seems that something is blocking while either rust-analyzer or some other operation is executing.

Isn't this supposed to work asynchronously? I'm wondering if I've misconfigured something. Could you offer some suggestions?

Here are my coc settings:

{
  "languageserver": {
    "rust": {
      "command": "ra_lsp_server",
      "filetypes": ["rust"],
      "rootPatterns": ["Cargo.toml"],
      "trace.server": "verbose"
    }
  },
  "rust-analyzer": {
      "enableCargoWatchOnStartup": "never"
  }
}

Autocmd issues

I am using minpac to manage my coc-extensions and using to autocmds to load them on filetype. I am loading them like this.

call minpac#add('neoclide/coc.nvim', {'do': {-> system('yarn install --frozen-lockfile') }})
if executable('ra_lsp_server')
	call minpac#add('fannheyward/coc-rust-analyzer', {'type': 'opt'}, {'do': {-> system('yarn install --frozen-lockfile') }})
elseif executable('rls')
	call minpac#add('neoclide/coc-rls', {'type': 'opt'}, {'do': {-> system('yarn install --frozen-lockfile') }})
endif
if executable('ra_lsp_server')
	autocmd! FileType rust					packadd coc-rust-analyzer | silent CocRestart 
elseif executable('rls')
	autocmd! FileType rust					packadd coc-rls | silent CocRestart 
endif

Running :CocList extensions shows

* coc-rust-analyzer [RTP] 0.0.22 ~/.cache/vim/pack/minpac/opt/coc-rust-analyzer

But I don't get prompted to start Cargo Watch and rust-analyzer.analyzerStatus returns
E492: Not and editor command: rust-analyzer.analyzerStatus

Also if coc-rust-analyzer is run without restarting coc.nvim Running :CocList extensions shows

? coc-rust-analyzer [RTP] 0.0.22 ~/.cache/vim/pack/minpac/opt/coc-rust-analyzer

and cannot be started via enabling or reloading in CocList

Real time diagnostics?

Is there any way to allow the diagnostics to be updated as we type as with coc-rls or the rust-analyzer plugin for vscode?

Maybe I missed something but right now the diagnostics are only updated when opening a file or saving it.

EDIT: Nevermind, it seems it just needs some time after startup before being able to do live diagnostics.

rust-analyzer.upgrade gives "Error: ETXTBSY: text file is busy on"

With a rust file open and trying to upgrade to last release I get on :CocCommand rust-analyzer.upgrade:

[coc.nvim] error: Uncaught exception: Error: ETXTBSY: text file is busy, open '/home/francisco/.config/coc/extensions/coc-rust-analyzer-data/ra_lsp_server'

Then the downloading status keep spinning and doesn't go away.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.