Stream: t-compiler/wg-rls-2.0

Topic: cargo-watch


Pascal (Mar 26 2019 at 08:33, on Zulip):

hey, just tried the cargo-watch mode of ra. looks like it restarts itself because a build script is used to generate source files outside of target. is there any way to configure the command to avoid this?

matklad (Mar 26 2019 at 08:35, on Zulip):

You can disable the watch task that is created by rust-analyzer and deinfe one manaully

matklad (Mar 26 2019 at 08:35, on Zulip):
    {
      "label": "cargo watch",
      "group": "build",
      "isBackground": true,
      "type": "shell",
      "command": "cargo",
      "args": [
        "watch"
      ],
      "problemMatcher": "$rustc-watch"
    },
Pascal (Mar 26 2019 at 08:36, on Zulip):

cool, thanks, will try that!

Pascal (Mar 26 2019 at 08:44, on Zulip):

Interesting. It finished (not sure if passing --no-restartactually helped) but it seems like the task itself keeps retriggering:

[Running 'cargo check']
    Finished dev [unoptimized + debuginfo] target(s) in 0.27s
[Finished running. Exit status: 0]
[Running 'cargo check']
    Finished dev [unoptimized + debuginfo] target(s) in 0.27s
[Finished running. Exit status: 0]
[Running 'cargo check']
…
matklad (Mar 26 2019 at 08:48, on Zulip):

Is this because VS code starts the task, or is it something internal to cargo watch? (to be clear, I know nothing about cargo watch) :)

Pascal (Mar 26 2019 at 09:17, on Zulip):

no clue. will investigate later

Last update: Nov 12 2019 at 15:50UTC