Jon Gjengset
9802c0ccd0
Default to host platform for cargo metadata
...
This modifies the logic for calling cargo metadata so that it will use
the host platform if no explicit target platform is given. This is
needed since cargo metadata defaults to outputting information for _all_
targets.
Fixes #6908 .
2020-12-16 17:38:37 -08:00
Florian Diebold
7d7949b315
Change recommendation when source can't be loaded from sysroot
...
Since we just tried running `rustup component add`, it doesn't make sense to me
to recommend trying that again. If we're reaching this case, it's probably more
likely that rustc was installed via package manager, in which case the source
should be installed the same way (e.g. if you install the rust-src package on
Ubuntu it will install a symlink in the right place to make our sysroot
detection work).
2020-12-13 13:04:50 +01:00
Jeremy Kolb
26a1675764
Remove some redundant allocations
2020-12-12 12:27:09 -05:00
Jonas Schievink
4d4b91117a
Use itertools
2020-12-10 19:29:11 +01:00
Jonas Schievink
41d73d1312
Replicate Cargo environment variables
2020-12-10 18:51:39 +01:00
Jonas Schievink
eeeacc4727
Apply environment set by build scripts
2020-12-07 20:52:31 +01:00
Jonas Schievink
a69996933a
Pass --target
when loading out dirs from check
2020-12-07 20:39:29 +01:00
Jonas Schievink
2b2318e695
Remove dummy ProcMacroClient in favor of Option
2020-12-07 17:16:50 +01:00
Aleksey Kladov
e88b5fe916
Simplify
2020-11-17 15:25:58 +01:00
Aleksey Kladov
bd4d375a64
Make code more readable
2020-11-17 15:25:58 +01:00
Aleksey Kladov
a0c4dbc399
Minor
2020-11-17 15:25:58 +01:00
Aleksey Kladov
0d19ee1d70
Simplify
2020-11-17 15:25:57 +01:00
Aleksey Kladov
0dc1742187
Remove needless alloc
2020-11-17 11:52:28 +01:00
Aleksey Kladov
e4927d52e2
Compress code
2020-11-17 11:52:28 +01:00
Aleksey Kladov
a6960fb3b8
simplify
2020-11-17 11:31:40 +01:00
Aleksey Kladov
b1377363df
Remove dead code
2020-11-13 17:53:48 +01:00
Aleksey Kladov
4dfda64b39
Cleanup workspace loading a tiny bit
2020-11-13 17:38:26 +01:00
Aleksey Kladov
aeda30e301
Move tricky workspace logic to a separate module
2020-11-13 16:44:48 +01:00
Xavier Denis
89ce6b6664
Address review comments
2020-11-12 18:49:22 +01:00
Xavier Denis
16443760a3
Reorder rustc_private loading
2020-11-11 13:04:27 +01:00
Xavier Denis
8716087919
Add support for loading rustc private crates
2020-11-11 12:45:40 +01:00
Aleksey Kladov
85db47ac76
Ignore RUST_SRC_PATH if it is set to invalid value
...
Folks report a ton of hard-to-diagnose issues, the solution for which
is "unset RUST_SRC_PATH". Let's just ignore RUST_SRC_PATH when it
won't work anyway!
2020-11-06 11:30:57 +01:00
Aleksey Kladov
ba8d6d1e4e
Remove more unreachable pubs
2020-11-02 16:58:33 +01:00
yuqing
6c4bb30e95
remove FIXME after rust 1.47 comes out
2020-10-30 14:58:59 +08:00
Aleksey Kladov
f753c3ecd2
Support Display name in project.json
2020-10-20 17:13:15 +02:00
Aleksey Kladov
3b1a648539
More type safety around names
2020-10-20 17:09:03 +02:00
Aleksey Kladov
7a21e9302e
Add a hacky remidy for #6038
...
The proper fix I think is:
* move rust-lang/rust library crates to a separate workspace
* when packaging rust-src component, vendor sources of external deps
2020-10-20 12:34:39 +02:00
Aleksey Kladov
1b3b8c7fda
Log around sysroot discovery
2020-10-14 17:22:07 +02:00
Jonas Schievink
55ecfbb99b
Update crates/project_model/src/sysroot.rs
...
Co-authored-by: Laurențiu Nicola <lnicola@users.noreply.github.com>
2020-10-09 16:17:05 +02:00
Jonas Schievink
7d0772e796
Add note if RUST_SRC_PATH is likely to be wrong
2020-10-09 16:11:16 +02:00
Kirill Bulatov
99952f3be2
Fix the hover dash issues
2020-10-02 21:16:22 +03:00
bors[bot]
e70cf706bb
Merge #6018
...
6018: Correct project_root path for ProjectJson. r=jonas-schievink a=woody77
It was already the folder containing the rust-project.json file, not the file itself. This also removes the Option-ness of it, since it's now an infallible operation to set the member value.
Co-authored-by: Aaron Wood <aaronwood@google.com>
2020-09-20 19:25:09 +00:00
Aaron Wood
38f1ce633d
Add rustdoc for ProjectJson methods
2020-09-20 12:06:12 -07:00
Jonas Schievink
46c5b557fe
Log failure to load crate root file
2020-09-18 19:27:19 +02:00
Aaron Wood
2fbb09a73f
Correct project_root path for ProjectJson.
...
It was already the folder containing the rust-project.json file, not the file itself.
2020-09-16 12:09:44 -07:00
Aaron Wood
74c26a785a
Add support for custom flycheck commands with JSON project workspaces
...
Enable flychecks with JSON project workspaces if an override command was provided as part
of the client configuration.
2020-09-15 18:51:57 -07:00
Jonas Schievink
681ac6294a
Report better errors in project.json/sysroot
2020-09-11 14:48:56 +02:00
Aleksey Kladov
189521a4db
Add sysroot shortcut to rust-project.json
2020-08-25 19:41:56 +02:00
Aleksey Kladov
9786a8f2d4
Don't expose indexing details
2020-08-25 18:40:41 +02:00
Aleksey Kladov
7fcda5aa46
Prepare to share sysroot lowering code between Cargo & ProjectJSON
2020-08-25 17:53:24 +02:00
Aleksey Kladov
6b8bc132dc
Prep work for overriding sysroot
...
The idea here is to make auto-discovery optional, and to allow to set
the path to sysroot directly. This is handy for JSON projects.
2020-08-25 17:04:24 +02:00
Aleksey Kladov
3a72afed8c
Improve logging
2020-08-25 11:43:21 +02:00
Aleksey Kladov
73f4fcbd0f
Better error if Cargo is not in Path
2020-08-19 16:34:11 +02:00
Aleksey Kladov
ed20a857f4
Rename ra_db -> base_db
2020-08-13 16:29:33 +02:00
Aleksey Kladov
2119dc23e8
Rename ra_proc_macro -> proc_macro_api
2020-08-13 12:39:27 +02:00
Pavan Kumar Sunkara
eac24d52e6
Rename ra_project_model -> project_model
2020-08-13 12:05:30 +02:00