Stream: t-compiler/rust-analyzer

Topic: vim configuration for rustc dev


Santiago Pastorino (May 13 2020 at 13:43, on Zulip):

I wanted to try out vim+RLS in Rustc itself

Santiago Pastorino (May 13 2020 at 13:44, on Zulip):

I'm using coc and coc-rust-analyzer

Santiago Pastorino (May 13 2020 at 13:44, on Zulip):

have placed this ...

Santiago Pastorino (May 13 2020 at 13:44, on Zulip):
{
    "rust-analyzer.checkOnSave.overrideCommand": [
        "./x.py",
        "check",
        "--stage 1",
        "--json-output"
    ]
}
Santiago Pastorino (May 13 2020 at 13:44, on Zulip):

in .vim directory on the workspace

Santiago Pastorino (May 13 2020 at 13:45, on Zulip):

but doesn't seem to work

Santiago Pastorino (May 13 2020 at 13:45, on Zulip):

was someone able to make it work

matklad (May 13 2020 at 13:46, on Zulip):

"--stage", "1" rather than "--stage 1"?

Santiago Pastorino (May 13 2020 at 13:46, on Zulip):

yeah, was wondering about that

Santiago Pastorino (May 13 2020 at 13:46, on Zulip):

I'm also wondering if this is not related to the fact that I've placed .vim inside rustc dir

Santiago Pastorino (May 13 2020 at 13:47, on Zulip):

but I'm actually working in librustc_mir

Santiago Pastorino (May 13 2020 at 13:47, on Zulip):

so probably the workspace config that vim is looking for should be in librustc_mir

Santiago Pastorino (May 13 2020 at 13:47, on Zulip):

trying those things out

matklad (May 13 2020 at 13:48, on Zulip):

Can you see the log from the LSP? Might be a good way to figure out what's wrong

Santiago Pastorino (May 13 2020 at 13:49, on Zulip):

yeah have done zero investigation to be honest

Santiago Pastorino (May 13 2020 at 13:49, on Zulip):

where is the log file typically located?

matklad (May 13 2020 at 13:51, on Zulip):

Logging protocol requests is a client-side thing

matklad (May 13 2020 at 13:52, on Zulip):

So, I don't know how is it set up in coc-vim unfortunately. In VS Code, you enable "rust-analyzer.trace.server": "verbose", setting and then see the log in the UI

Santiago Pastorino (May 13 2020 at 13:53, on Zulip):

let me try setting that to verbose and seeing what happens

Santiago Pastorino (May 13 2020 at 13:56, on Zulip):

ok both things were wrong :)

Santiago Pastorino (May 13 2020 at 13:57, on Zulip):

I meant, it needed "--stage", "1" and also the problem is related to what I'm saying, I'd need to place the config on each crate or find a better way to set up this on all subdirectories under rustc main dir

matklad (May 13 2020 at 13:58, on Zulip):

@Santiago Pastorino if you got client-side logging working, could you add the instructions to do this here? https://github.com/rust-analyzer/rust-analyzer/blob/master/docs/user/readme.adoc#coc-rust-analyzer

Santiago Pastorino (May 13 2020 at 13:58, on Zulip):

didn't try the logging because I realized by testing about the problem

Santiago Pastorino (May 13 2020 at 13:58, on Zulip):

but could try to enable logging

Santiago Pastorino (May 13 2020 at 13:58, on Zulip):

let me check

matklad (May 13 2020 at 13:59, on Zulip):

(in general, any improvements to the docs are welcome ;) )

Santiago Pastorino (May 13 2020 at 14:00, on Zulip):

have enabled it and no idea where is storing logs

Santiago Pastorino (May 13 2020 at 14:00, on Zulip):

searching

Santiago Pastorino (May 13 2020 at 14:46, on Zulip):

btw, forgot to report back here, my problem seemed to be that in order to have the top level coc configuration and the workspace coc configuration merged you need to reload coc after starting vim and loading an rs file

Santiago Pastorino (May 13 2020 at 14:47, on Zulip):

if someone has a better solution would be great to hear that

Santiago Pastorino (May 14 2020 at 20:57, on Zulip):

btw created this https://github.com/neoclide/coc.nvim/issues/1926

Santiago Pastorino (May 16 2020 at 23:04, on Zulip):

this issue was fixed https://github.com/neoclide/coc.nvim/commit/9704f8d076426177dcbd92067dc76bafa266f852

Last update: Jul 28 2021 at 04:45UTC