Stream: general

Topic: rust-analyzer with rustc


Diggory Blake (May 21 2020 at 21:54, on Zulip):

Is there any information on using rust-analyzer to dev on rustc itself?

Jonas Schievink (May 21 2020 at 21:58, on Zulip):

only a select few are mighty enough to wield the secret JSON

{
    "rust-analyzer.checkOnSave.overrideCommand": [
        "./x.py",
        "check",
        "--json-output"
    ],
    "rust-analyzer.rustfmt.overrideCommand": [
        "/absolute/path/to/rust/build/x86_64-unknown-linux-gnu/stage0/bin/rustfmt",
        "--edition",
        "2018",
    ],
}
Jonas Schievink (May 21 2020 at 21:58, on Zulip):

that is, if you're using VS Code

Diggory Blake (May 21 2020 at 21:58, on Zulip):

cool, is that sufficient for everything to work??

Jonas Schievink (May 21 2020 at 21:58, on Zulip):

should be, yeah

Diggory Blake (May 21 2020 at 21:59, on Zulip):

thanks

Diggory Blake (May 21 2020 at 22:05, on Zulip):

nice, it does indeed work - and a relative path for rustfmt worked just fine too

Jonas Schievink (May 21 2020 at 22:06, on Zulip):

Hmm, we hit some issues with that: https://github.com/rust-analyzer/rust-analyzer/issues/4486

Diggory Blake (May 21 2020 at 22:07, on Zulip):

I'm on windows, so maybe that makes a difference?

Diggory Blake (May 21 2020 at 22:07, on Zulip):

it seems to work so far at least

RalfJ (May 22 2020 at 19:58, on Zulip):

I use a slightly different config:

{
    "rust-analyzer.checkOnSave.overrideCommand": [
        "./x.py",
        "check",
        "--json-output"
    ],
    "rust-analyzer.rustfmt.extraArgs": [
        "+nightly"
    ],
    "files.watcherExclude": {
        "**/src/llvm-project/**": true,
        "**/build/**": true,
        "**/target/**": true
    },
    "files.exclude": {
        "**/llvm-project/**": true,
        "**/build/**": true
    }
}
RalfJ (May 22 2020 at 19:58, on Zulip):

but anyway I otherwise asked the exact same question a week ago. we should document this somewhere... presumably rustc-dev-guide?

RalfJ (May 22 2020 at 19:59, on Zulip):

@Santiago Pastorino ^

Santiago Pastorino (May 22 2020 at 20:07, on Zulip):

yes, we should add this to rustc-dev-guide

Santiago Pastorino (May 22 2020 at 20:09, on Zulip):

maybe I'd suggest to use +beta instead of +nightly :)

Wesley Wiser (May 22 2020 at 20:30, on Zulip):

Has anyone noticed issues with this week's ra release?

Wesley Wiser (May 22 2020 at 20:30, on Zulip):

I'm getting minutes long waits for completions

Wesley Wiser (May 22 2020 at 20:30, on Zulip):

https://github.com/rust-analyzer/rust-analyzer/issues/4567

Wesley Wiser (May 22 2020 at 20:30, on Zulip):

And I don't think I've changed anything else about my setup

RalfJ (May 22 2020 at 20:33, on Zulip):

hm, it worked some days ago but earlier today I also felt like it didnt seem to do anything (Im on RA nightly). I didnt investigate though.

Last update: May 29 2020 at 18:05UTC