Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Simpify project discovery | veetaha | 2020-05-09 | 1 | -36/+15 |
| | |||||
* | Add stderr to error message | Aleksey Kladov | 2020-05-08 | 1 | -1/+6 |
| | |||||
* | Cleanup | Aleksey Kladov | 2020-05-08 | 3 | -57/+29 |
| | |||||
* | Rename ra_env -> ra_toolchain | Aleksey Kladov | 2020-05-08 | 3 | -4/+4 |
| | |||||
* | Merge #4329 | bors[bot] | 2020-05-08 | 3 | -16/+17 |
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4329: Look for `cargo`, `rustc`, and `rustup` in standard installation path r=matklad a=cdisselkoen Discussed in #3118. This is approximately a 90% fix for the issue described there. This PR creates a new crate `ra_env` with a function `get_path_for_executable()`; see docs there. `get_path_for_executable()` improves and generalizes the function `cargo_binary()` which was previously duplicated in the `ra_project_model` and `ra_flycheck` crates. (Both of those crates now depend on the new `ra_env` crate.) The new function checks (e.g.) `$CARGO` and `$PATH`, but also falls back on `~/.cargo/bin` manually before erroring out. This should allow most users to not have to worry about setting the `$CARGO` or `$PATH` variables for VSCode, which can be difficult e.g. on macOS as discussed in #3118. I've attempted to replace all calls to `cargo`, `rustc`, and `rustup` in rust-analyzer with appropriate invocations of `get_path_for_executable()`; I don't think I've missed any in Rust code, but there is at least one invocation in TypeScript code which I haven't fixed. (I'm not sure whether it's affected by the same problem or not.) https://github.com/rust-analyzer/rust-analyzer/blob/a4778ddb7a00f552a8e653bbf56ae9fd69cfe1d3/editors/code/src/cargo.ts#L79 I'm sure this PR could be improved a bunch, so I'm happy to take feedback/suggestions on how to solve this problem better, or just bikeshedding variable/function/crate names etc. cc @Veetaha Fixes #3118. Co-authored-by: Craig Disselkoen <[email protected]> Co-authored-by: veetaha <[email protected]> | ||||
| * | cargo fmt | Craig Disselkoen | 2020-05-06 | 1 | -1/+5 |
| | | |||||
| * | return a PathBuf instead of String | Craig Disselkoen | 2020-05-06 | 1 | -2/+3 |
| | | |||||
| * | pull function out into new crate ra_env; use in ra_flycheck as well | Craig Disselkoen | 2020-05-06 | 4 | -68/+6 |
| | | |||||
| * | more generic, find rustc as well | Craig Disselkoen | 2020-05-06 | 4 | -54/+71 |
| | | |||||
| * | ra_project_model: look for Cargo in more places | Craig Disselkoen | 2020-05-06 | 1 | -9/+50 |
| | | | | | | | | See #3118 | ||||
* | | Move feature desugaring to the right abstraction layer | Aleksey Kladov | 2020-05-08 | 1 | -2/+12 |
| | | |||||
* | | Merge #4296 | bors[bot] | 2020-05-07 | 2 | -2/+14 |
|\ \ | |/ |/| | | | | | | | | | | | 4296: Support cargo:rustc-cfg in build.rs r=matklad a=robojumper Fixes #4238. Co-authored-by: robojumper <[email protected]> | ||||
| * | Assume cargo_metadata uses String for cfgs soon | robojumper | 2020-05-05 | 2 | -10/+9 |
| | | |||||
| * | Support build.rs cargo:rustc-cfg | robojumper | 2020-05-04 | 2 | -2/+15 |
| | | |||||
* | | Remove code duplicates | Christophe MASSOLIN | 2020-05-05 | 1 | -12/+6 |
| | | |||||
* | | Pass cargo.target to rustc | Christophe MASSOLIN | 2020-05-05 | 1 | -5/+13 |
| | | |||||
* | | Rename `defaultTarget` to target | Christophe MASSOLIN | 2020-05-05 | 1 | -3/+3 |
| | | |||||
* | | [config] remove RustcConfig | Christophe MASSOLIN | 2020-04-27 | 1 | -5/+0 |
| | | |||||
* | | [config] rename cargo.defaultTarget | Christophe MASSOLIN | 2020-04-27 | 1 | -4/+4 |
| | | |||||
* | | Started rust-analyzer.cargo.defaultTarget implementation | Christophe MASSOLIN | 2020-04-26 | 1 | -0/+12 |
|/ | |||||
* | Merge #4125 | bors[bot] | 2020-04-25 | 1 | -4/+8 |
|\ | | | | | | | | | | | | | | | 4125: Avoid lossy OsString conversions r=matklad a=lnicola This is a bit invasive, and perhaps for not much benefit since non-UTF-8 environment variables don't work anyway. Co-authored-by: Laurențiu Nicola <[email protected]> | ||||
| * | Avoid lossy OsString conversions | Laurențiu Nicola | 2020-04-25 | 1 | -4/+8 |
| | | |||||
* | | Don't print cargo version to stdout, breaking everything | Aleksey Kladov | 2020-04-24 | 1 | -1/+1 |
| | | |||||
* | | More helpful error message if toolchain is not in PATH | Aleksey Kladov | 2020-04-24 | 1 | -0/+5 |
|/ | |||||
* | Some clippy fixes | Jeremy Kolb | 2020-04-19 | 1 | -2/+1 |
| | |||||
* | Unmix error handling when discovering workspaces | Aleksey Kladov | 2020-04-16 | 1 | -55/+23 |
| | | | | | Hitting an io::Error is a legit problem. Finding more than one Cargo.toml is not. | ||||
* | Decouple project loading from project discovery a bit | Aleksey Kladov | 2020-04-16 | 1 | -100/+121 |
| | |||||
* | Migrate to privacy as per review commets | veetaha | 2020-04-02 | 1 | -2/+8 |
| | |||||
* | Less mutability | veetaha | 2020-04-02 | 1 | -19/+23 |
| | |||||
* | Migrate to iters some more | veetaha | 2020-04-02 | 1 | -18/+11 |
| | |||||
* | Migrate to iterators | veetaha | 2020-04-02 | 1 | -15/+3 |
| | |||||
* | Simpify workspace handling | veetaha | 2020-04-02 | 1 | -29/+17 |
| | |||||
* | Unique package by name and version. | o0Ignition0o | 2020-04-02 | 1 | -4/+5 |
| | | | | | This commit is a fixup of a bug I introduced by using a PackageId to refer to a crate when its name conflicts with a dependency. It turns out the package id currently is `name version path` while cargo expects `name:version` as argument. | ||||
* | Reduce scope of deserialization | Aleksey Kladov | 2020-04-01 | 2 | -15/+11 |
| | |||||
* | Move all config to config | Aleksey Kladov | 2020-04-01 | 1 | -0/+1 |
| | |||||
* | Reduce deps | Aleksey Kladov | 2020-03-31 | 1 | -36/+39 |
| | |||||
* | Rename cargo_watch -> flycheck | Aleksey Kladov | 2020-03-31 | 1 | -1/+1 |
| | |||||
* | Use matches in is_dylib | Edwin Cheng | 2020-03-31 | 1 | -11/+3 |
| | |||||
* | Implement ra_proc_macro client logic | Edwin Cheng | 2020-03-31 | 1 | -1/+21 |
| | |||||
* | Add crate versions when running cargo -p commands. | o0Ignition0o | 2020-03-31 | 1 | -0/+14 |
| | | | | | | | Until now cargo commands with the -p flag would pass the package name only. It doesn't play super well with the toml Renaming dependencies feature. This commit specifies the package name and version when a cargo command is run with the -p flag, to avoid ambiguities. | ||||
* | Add ProcMacroClient | Edwin Cheng | 2020-03-25 | 3 | -9/+64 |
| | |||||
* | ra_cargo_watch: return Result<> from run_cargo(), and don't read stderr for now | veetaha | 2020-03-21 | 1 | -14/+13 |
| | | | | | | | | | | | | | | As stated by matklad, reading the stderr should be done alngside with stdout via select() (or I guess poll()), there is no such implementation in stdlib, since it is quite low level and platform-dependent and it also requires quite a bit of unrelated code we don't use it for now. As referenced by bjorn3, there is an implementation of the needed read2() function in rustc compiletest. The better solution will be to extract this function to a separate crate in future: https://github.com/rust-analyzer/rust-analyzer/pull/3632#discussion_r395605298 | ||||
* | Use target-name for crate-name | Edwin Cheng | 2020-03-21 | 1 | -3/+3 |
| | |||||
* | Simplify Arena to use a generic index | Aleksey Kladov | 2020-03-19 | 2 | -14/+8 |
| | |||||
* | Simplify Sysroot | Aleksey Kladov | 2020-03-19 | 2 | -22/+20 |
| | |||||
* | More direct CargoWorkspace | Aleksey Kladov | 2020-03-19 | 2 | -84/+61 |
| | |||||
* | Use dyn-ref instead of impl to impact compile times the least | Emil Lauridsen | 2020-03-17 | 1 | -1/+1 |
| | |||||
* | Slight readablity improvement | Emil Lauridsen | 2020-03-17 | 1 | -1/+1 |
| | |||||
* | Remove outDirOverrides | Emil Lauridsen | 2020-03-17 | 1 | -8/+0 |
| | |||||
* | Support specifying OUT_DIR in json project | Emil Lauridsen | 2020-03-17 | 2 | -3/+22 |
| |