Stream: t-compiler/wg-rls-2.0

Topic: building crate with features


Sunjay Varma (May 15 2020 at 23:42, on Zulip):

Is this the right place to ask questions about using rust-analyzer?

Sunjay Varma (May 15 2020 at 23:42, on Zulip):

I'm wondering if there is a cross-editor way to tell rust-analyzer to use a certain feature when it is building my crate

Sunjay Varma (May 15 2020 at 23:44, on Zulip):

Maybe there is a config file or something where I can tell rust-analyzer to use --features "unstable" when building my crate?

Sunjay Varma (May 15 2020 at 23:45, on Zulip):

I also have a "test" feature and it would be great if I could tell rust-analyzer to run test builds using that

Sunjay Varma (May 15 2020 at 23:47, on Zulip):

The features terminology can be a bit confusing, so to be clear I'm referring to "features" defined under the "[features]" table in my Cargo.toml file

matklad (May 15 2020 at 23:50, on Zulip):

Is this the right place to ask questions about using rust-analyzer?

So far, yes. Though, I've been planing to create a category on urlo for some time now.

matklad (May 15 2020 at 23:51, on Zulip):

The answer to your question is no -- unfortunatelly, LSP doesn't specify a cross-editor way to store config, and I think it ideally should be handled on that layer

matklad (May 15 2020 at 23:52, on Zulip):

I guess, in practice we also might add something like rust-analyzer.toml, but it does not feel like the right soln

pksunkara (May 16 2020 at 06:23, on Zulip):

What about [package.metadata.rust-analyzer] in Cargo.toml?

Last update: Sep 22 2020 at 03:00UTC