-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
autocomplete options does not appear #7897
Comments
Does it work if you enable "load out dirs from check"? |
I did try both |
Confirmed. Looks like some |
That's actually |
Reading the sourcing code and doing some debug from rust-analyzer, it appears that cargo environment variables are not supported at all. Taking a closer look on: My debug showed that it was always empty and there was nothing in Doing research over cargo, it appears that cargo OUT_DIR variable may not be possible at all to get: For you that is reading this in the future, if you are generated stuff under |
mavlink does not seem to be using |
Ah, this might be due to #7846 |
Though, projects that depends of rust-mavlink are still not working with that change, but inside the project the autocomplete now works.
|
@patrickelectric |
|
@patrickelectric what does |
{"reason":"build-script-executed","package_id":"libc 0.2.88 (registry+https://github.com/rust-lang/crates.io-index)","linked_libs":[],"linked_paths":[],"cfgs":["freebsd11","libc_priv_mod_use","libc_union","libc_const_size_of","libc_align","libc_core_cvoid","libc_packedN","libc_cfg_target_vendor"],"env":[],"out_dir":"/home/patrick/git/patrick/vscode-autocomplete-problem/target/debug/build/libc-cf127cddf224d515/out"}
{"reason":"build-script-executed","package_id":"proc-macro2 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)","linked_libs":[],"linked_paths":[],"cfgs":["lexerror_display","hygiene","use_proc_macro","wrap_proc_macro"],"env":[],"out_dir":"/home/patrick/git/patrick/vscode-autocomplete-problem/target/debug/build/proc-macro2-3498c16925406714/out"}
{"reason":"build-script-executed","package_id":"syn 1.0.62 (registry+https://github.com/rust-lang/crates.io-index)","linked_libs":[],"linked_paths":[],"cfgs":["syn_disable_nightly_tests"],"env":[],"out_dir":"/home/patrick/git/patrick/vscode-autocomplete-problem/target/debug/build/syn-e4255a1c653518e2/out"}
{"reason":"build-script-executed","package_id":"serde_derive 1.0.124 (registry+https://github.com/rust-lang/crates.io-index)","linked_libs":[],"linked_paths":[],"cfgs":["underscore_consts"],"env":[],"out_dir":"/home/patrick/git/patrick/vscode-autocomplete-problem/target/debug/build/serde_derive-50d3257b96e1e96e/out"}
{"reason":"build-script-executed","package_id":"serde 1.0.124 (registry+https://github.com/rust-lang/crates.io-index)","linked_libs":[],"linked_paths":[],"cfgs":["ops_bound","core_reverse","de_boxed_c_str","de_boxed_path","de_rc_dst","core_duration","integer128","range_inclusive","num_nonzero","serde_derive","core_try_from","num_nonzero_signed","systemtime_checked_add","std_atomic64","std_atomic"],"env":[],"out_dir":"/home/patrick/git/patrick/vscode-autocomplete-problem/target/debug/build/serde-73ca5304cca9ae09/out"}
{"reason":"build-script-executed","package_id":"bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)","linked_libs":[],"linked_paths":[],"cfgs":["bitflags_const_fn"],"env":[],"out_dir":"/home/patrick/git/patrick/vscode-autocomplete-problem/target/debug/build/bitflags-f9113967e336fcbe/out"}
{"reason":"build-script-executed","package_id":"num-traits 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)","linked_libs":[],"linked_paths":[],"cfgs":["has_i128","has_to_int_unchecked"],"env":[],"out_dir":"/home/patrick/git/patrick/vscode-autocomplete-problem/target/debug/build/num-traits-9247bc1ce3fdb48a/out"}
{"reason":"build-script-executed","package_id":"mavlink 0.8.6 (registry+https://github.com/rust-lang/crates.io-index)","linked_libs":[],"linked_paths":[],"cfgs":[],"env":[],"out_dir":"/home/patrick/git/patrick/vscode-autocomplete-problem/target/debug/build/mavlink-2f7d07fb4a9be9fc/out"}
|
|
Yep, thanks for the feedback. |
Yes, the only way to work around this bug is to only generate a single file. Once #7846 is fixed, what you have now should start working as-is. |
#7846 is fixed, and I tested in |
Yep, I can confirm that it works, just downloaded https://github.com/rust-analyzer/rust-analyzer/releases/tag/2021-03-22 with: "rust-analyzer.cargo.runBuildScripts": true,
"rust-analyzer.lruCapacity": 1024,
"rust-analyzer.procMacro.enable": true,
"rust-analyzer.cargo.allFeatures": true, |
Thank you everybody for your patience and time! |
Heads-up: build scripts and proc macros are now enabled by default. |
I did a simple repository if someone wants to replicate the problem:
https://github.com/patrickelectric/vscode-autocomplete-problem/blob/master/src/main.rs#L7
In 3 different computers I was unable to make rust-analyzer to work with it.
I'm using rust-analyzer (v0.2.497) directly from vscodium (1.53.2).
The text was updated successfully, but these errors were encountered: