]> git.lizzy.rs Git - rust.git/commit
Merge #5954
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>
Fri, 2 Oct 2020 09:42:03 +0000 (09:42 +0000)
committerGitHub <noreply@github.com>
Fri, 2 Oct 2020 09:42:03 +0000 (09:42 +0000)
commitd8e5265309cf92857c996d4f55372e3b431468bf
tree101f5f55c324d7cb7bf3c7ae22a553ca4f7bf66c
parent40a028c9a837f4f189b7db82cd4034536af87322
parent4ebacf9024d82349c4b95826a4a791bdf384d0df
Merge #5954

5954: Add flexible configuration for runnables r=popzxc a=popzxc

This PR introduces two new configuration options for runnables: `overrideCargo` and `cargoExtraArgs`.
These options are applied to all the "run" tasks of rust analyzer, such as binaries and tests.

Overall motivation is that rust-analyzer provides similar options, for example, for `rustfmt`, but not for runnables.

## `overrideCargo`

This option allows user to replace `cargo` command with something else (well, something that is compatible with the cargo arguments).

Motivation is that some projects may have wrappers around cargo (or even whole alternatives to cargo), which do something related to the project, and only then run `cargo`. With this feature, such users will be able to use lens and run tests directly from the IDE rather than from terminal.

![cargo_override](https://user-images.githubusercontent.com/12111581/92306622-2f404f80-ef99-11ea-9bb7-6c6192a2c54a.gif)

## `cargoExtraArgs`

This option allows user to add any additional arguments for `cargo`, such as `--release`.

It may be useful, for example, if project has big integration tests which take too long in debug mode, or if any other `cargo` flag has to be passed.

![cargo_extra_args](https://user-images.githubusercontent.com/12111581/92306658-821a0700-ef99-11ea-8be9-bf0aff78e154.gif)

Co-authored-by: Igor Aleksanov <popzxc@yandex.ru>