Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cargo check failed on default rust project #1015

Closed
TENX-S opened this issue Jul 6, 2022 · 6 comments
Closed

cargo check failed on default rust project #1015

TENX-S opened this issue Jul 6, 2022 · 6 comments
Assignees

Comments

@TENX-S
Copy link

TENX-S commented Jul 6, 2022

What's the output of :CocInfo

## versions

vim version: NVIM v0.7.0
node version: v14.2.0
coc.nvim version: 0.0.81-2522eee5 2022-06-14 19:03:29 +0800
coc.nvim directory: /Users/tenx/.vim/plugged/coc.nvim
term: tmux
platform: darwin

## Log of coc.nvim

2022-07-06T20:54:24.613 INFO (pid:93364) [coc-git] - Looking for git in: git
2022-07-06T20:54:24.624 INFO (pid:93364) [plugin] - coc.nvim initialized with node: v14.2.0 after 184ms
2022-07-06T20:54:25.043 INFO (pid:93364) [attach] - receive notification: runCommand [ 'explorer', '--preset', 'floating' ]
2022-07-06T20:54:25.087 INFO (pid:93364) [attach] - receive notification: doAutocmd [ 1 ]
2022-07-06T20:54:25.167 INFO (pid:93364) [attach] - receive notification: doAutocmd [ 1 ]
2022-07-06T20:54:25.298 INFO (pid:93364) [attach] - receive notification: doAutocmd [ 1 ]
2022-07-06T20:54:25.800 INFO (pid:93364) [attach] - receive notification: doAutocmd [ 1 ]
2022-07-06T20:54:26.069 INFO (pid:93364) [attach] - receive notification: doAutocmd [ 1 ]
2022-07-06T20:54:26.316 INFO (pid:93364) [attach] - receive notification: doAutocmd [ 1 ]
2022-07-06T20:54:26.916 INFO (pid:93364) [attach] - receive notification: doAutocmd [ 1 ]
2022-07-06T20:54:27.067 INFO (pid:93364) [attach] - receive notification: doAutocmd [ 1 ]
2022-07-06T20:54:27.284 INFO (pid:93364) [attach] - Request action: doKeymap [ 'explorer-key-n-o' ]
2022-07-06T20:54:27.302 INFO (pid:93364) [attach] - receive notification: doAutocmd [ 1 ]
2022-07-06T20:54:27.308 INFO (pid:93364) [attach] - receive notification: doAutocmd [ 1 ]
2022-07-06T20:54:27.466 INFO (pid:93364) [attach] - receive notification: doAutocmd [ 1 ]
2022-07-06T20:54:27.654 INFO (pid:93364) [attach] - Request action: doKeymap [ 'explorer-key-n-o' ]
2022-07-06T20:54:27.682 INFO (pid:93364) [attach] - receive notification: doAutocmd [ 1 ]
2022-07-06T20:54:27.682 INFO (pid:93364) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_coc_helper_1',
  'BufDelete',
  1
]
2022-07-06T20:54:27.682 INFO (pid:93364) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_explorer_2',
  'BufDelete',
  1
]
2022-07-06T20:54:27.682 INFO (pid:93364) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_coc_helper_1',
  'BufWipeout',
  1
]
2022-07-06T20:54:27.682 INFO (pid:93364) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_explorer_2',
  'BufWipeout',
  1
]
2022-07-06T20:54:27.813 INFO (pid:93364) [services] - registered service "rust-analyzer"
2022-07-06T20:54:27.814 INFO (pid:93364) [services] - Rust Analyzer Language Server state change: stopped => starting
2022-07-06T20:54:27.820 INFO (pid:93364) [attach] - receive notification: doAutocmd [ 1 ]
2022-07-06T20:54:27.832 INFO (pid:93364) [language-client-index] - Language server "rust-analyzer" started with 93476
2022-07-06T20:54:27.846 INFO (pid:93364) [services] - Rust Analyzer Language Server state change: starting => running
2022-07-06T20:54:27.852 INFO (pid:93364) [services] - service rust-analyzer started
2022-07-06T20:54:27.925 INFO (pid:93364) [attach] - receive notification: runCommand [
  'coc-helper.internal.didVimEvent_m1_v0_13_0_explorer_2',
  'CocGitStatusChange'
]
2022-07-06T20:54:28.323 INFO (pid:93364) [attach] - receive notification: doAutocmd [ 1 ]
2022-07-06T20:55:24.614 INFO (pid:93364) [attach] - receive notification: showInfo []

What's the output of :CocCommand rust-analyzer.serverVersion
rust-analyzer 0.0.0 (75b22326d 2022-07-03)

macOS 12.4

Screen Shot 2022-07-06 at 20 54 39

@fannheyward
Copy link
Owner

Can't reproduce.

  1. cd /tmp
  2. cargo new a1 && cd a1
  3. nvim src/main.rs

Set "rust-analyzer.trace.server": "verbose" in your coc-settings.json, reproduce your issue and check :CocCommand workspace.showOutput rust-analyzer

@TENX-S
Copy link
Author

TENX-S commented Jul 8, 2022

output.txt

@fannheyward
Copy link
Owner

[ERROR flycheck] Flycheck failed to run the following command: "cargo" "fmt" "--workspace" "--message-format=json" "--manifest-path" "/private/tmp/a1/Cargo.toml" "--all-targets"
[ERROR rust_analyzer::lsp_utils] cargo check failed

Cargo watcher failed, the command produced no valid metadata (exit code: ExitStatus(unix_wait_status(256))):
error: Found argument '--workspace' which wasn't expected, or isn't valid in this context

--workspace was unexpected.

@TENX-S
Copy link
Author

TENX-S commented Jul 8, 2022

Whoops. rust-lang/rust-analyzer#6589 (comment)
comment this line works for me, anything wrong about it?

"rust-analyzer.checkOnSave.command": "fmt",

@fannheyward
Copy link
Owner

I don't think you can use fmt as checkOnSave command.

@TENX-S
Copy link
Author

TENX-S commented Jul 8, 2022

Alright.

@TENX-S TENX-S closed this as completed Jul 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants