aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_project_model/src
Commit message (Collapse)AuthorAgeFilesLines
* Add is_workspace_member for rust-project.jsonAleksey Kladov2020-07-201-24/+36
| | | | | | | | | | | It is currently unused, but, in the future, it will be used to: * drive certain UX (symbols search by default will look only in the members) * improve performance (rust-analyzer will assume that non-members change rarely) If not specified, is_workspace member is inferred from the path
* Sort cargo metadataAleksey Kladov2020-07-101-2/+4
| | | | | | See https://github.com/rust-lang/cargo/issues/8477 We need this to prevent spurious workspace reloads
* Automatically reload project info on Cargo.toml changesAleksey Kladov2020-07-103-8/+8
|
* Replace ad hocery with scienceAleksey Kladov2020-07-071-1/+0
|
* AbsPathAleksey Kladov2020-07-051-3/+3
|
* Fallback to target in cfg if not specified in project json configPaul Daniel Faria2020-07-041-1/+1
|
* Add optional target to crates in json project, lookup default cfgs per ↵Paul Daniel Faria2020-07-042-1/+13
| | | | target when generating cfg list
* Move cargo metadata off the main loopAleksey Kladov2020-07-021-2/+2
|
* MinorAleksey Kladov2020-07-021-13/+1
|
* Automatically reload project on config changeAleksey Kladov2020-07-011-3/+3
|
* Use Strings for display namesAleksey Kladov2020-07-011-5/+3
|
* Use CrateName for semantic namesAleksey Kladov2020-07-012-8/+14
|
* Don't crash on empty out_dirs with older cargosAleksey Kladov2020-06-301-4/+13
| | | | closes #5125
* Cleanup project.json deserializationAleksey Kladov2020-06-243-110/+109
|
* Rename json_project -> project_jsonAleksey Kladov2020-06-242-9/+9
|
* Be more explicit about absolute paths at various placesAleksey Kladov2020-06-243-58/+58
|
* New VFSAleksey Kladov2020-06-231-14/+1
|
* Accept relative paths in rust-project.jsonThiébaud Weksteen2020-06-151-15/+17
| | | | | If a relative path is found as part of Crate.root_module or Root.path, interpret it as relative to the location of the rust-project.json file.
* Reduce OUT_DIR special casingAleksey Kladov2020-06-101-13/+7
|
* Merge #4824bors[bot]2020-06-101-1/+1
|\ | | | | | | | | | | | | | | 4824: Correct "debug_assertion" to "debug_assertions" to match the cfg that the rust debug assert macros use. r=matklad a=woody77 This is for #4823. Co-authored-by: Aaron Wood <[email protected]>
| * Correct "debug_assertion" to "debug_assertions" to match the cfgAaron Wood2020-06-101-1/+1
| | | | | | | | option that the rust debug assert macros use.
* | Finish transition to cfgs from the separate atoms and features.Aaron Wood2020-06-092-47/+1
|/
* Use Option<&str> for target instead of Option<&String>Paul Daniel Faria2020-06-081-3/+3
|
* Remove default_cfg_options, pass target instead so it can be used for ↵Paul Daniel Faria2020-06-081-13/+13
| | | | building cargo workspaces
* Change management of test cfg to better support json projectsPaul Daniel Faria2020-06-071-6/+7
|
* Document rust-project.jsonAleksey Kladov2020-06-031-2/+8
|
* Rename ProjectRoot -> ProjectManifestAleksey Kladov2020-06-031-15/+15
|
* Move project discoveryAleksey Kladov2020-06-031-2/+14
|
* Put important things on topAleksey Kladov2020-06-031-7/+7
|
* Merge pull request #4382 from woody77/json_cfgsAleksey Kladov2020-06-032-0/+89
|\ | | | | Begin transition to new fields for JsonProject crate cfgs
| * Begin transition to new fields for JsonProject crate cfgsAaron Wood2020-05-092-0/+89
| | | | | | | | | | | | | | | | | | | | | | | | This starts the transition to a new method of documenting the cfgs that are enabled for a given crate in the json file. This is changing from a list of atoms and a dict of key:value pairs, to a list of strings that is equivalent to that returned by `rustc --print cfg ..`, and parsed in the same manner by rust-analyzer. This is the first of two changes, which adds the new field that contains the list of strings. Next change will complete the transition and remove the previous fields.
* | Disable rust-analyzer.{cargo,checkOnSave}.allFeatures by defaultLaurențiu Nicola2020-06-021-1/+1
| |
* | Make some stuff public so that they can be reused by other toolsPavan Kumar Sunkara2020-05-141-1/+1
| |
* | Merge #4406 #4410 #4411 #4417bors[bot]2020-05-101-9/+5
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4406: Update cargo-metadata r=matklad a=edwin0cheng This PR update `cargo-metadata` to 0.10.0 and it also relax the` serde-derive` deps to 1.0 for tests in `proc-macro-srv`. cc @robojumper r= @matklad , I think you would have something to say related to https://github.com/serde-rs/json/issues/647#issue-593788429 ? 4410: Improve wording in comment r=matklad a=edwin0cheng 4411: do not remove then block when you unwrap else block #4361 r=matklad a=bnjjj close #4361 4417: Omit default types in HirDisplay SourceCode mode r=matklad a=TimoFreiberg Closes #4390 Co-authored-by: Edwin Cheng <[email protected]> Co-authored-by: Benjamin Coenen <[email protected]> Co-authored-by: Timo Freiberg <[email protected]>
| * | Update cargo-metadataEdwin Cheng2020-05-091-9/+5
| | |
* | | Simpify project discoveryveetaha2020-05-091-36/+15
| | |
* | | Add stderr to error messageAleksey Kladov2020-05-081-1/+6
| | |
* | | CleanupAleksey Kladov2020-05-083-57/+29
| | |
* | | Rename ra_env -> ra_toolchainAleksey Kladov2020-05-083-4/+4
|/ /
* | Merge #4329bors[bot]2020-05-083-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 fmtCraig Disselkoen2020-05-061-1/+5
| | |
| * | return a PathBuf instead of StringCraig Disselkoen2020-05-061-2/+3
| | |
| * | pull function out into new crate ra_env; use in ra_flycheck as wellCraig Disselkoen2020-05-064-68/+6
| | |
| * | more generic, find rustc as wellCraig Disselkoen2020-05-064-54/+71
| | |
| * | ra_project_model: look for Cargo in more placesCraig Disselkoen2020-05-061-9/+50
| | | | | | | | | | | | See #3118
* | | Move feature desugaring to the right abstraction layerAleksey Kladov2020-05-081-2/+12
| | |
* | | Merge #4296bors[bot]2020-05-072-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 soonrobojumper2020-05-052-10/+9
| | |
| * | Support build.rs cargo:rustc-cfgrobojumper2020-05-042-2/+15
| |/
* | Remove code duplicatesChristophe MASSOLIN2020-05-051-12/+6
| |