Skip to content
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

Generated bindings not showing up as intellisense suggestions #5992

Closed
Sibz opened this issue Sep 13, 2020 · 5 comments
Closed

Generated bindings not showing up as intellisense suggestions #5992

Sibz opened this issue Sep 13, 2020 · 5 comments
Labels
E-unknown It's unclear if the issue is E-hard or E-easy without digging in

Comments

@Sibz
Copy link

Sibz commented Sep 13, 2020

I am using the library godot-rust and while everything runs fine, there is no intellisense happening for the (generated) types provided by the package.

This can reproduced by cloning my example repository here:
https://github.com/Sibz/godotrust-bugdemo
This may need LLVM installed in order to compile.

On line 15 I have picked an example method that should hint, but does not.
The description for this struct is here: https://docs.rs/gdnative/0.9.0-preview.0/gdnative/api/rigid_body/struct.RigidBody.html

I have contacted the developer and he is aware of the issue but believes the issue probably lies with rust-analyser - it should be able to pick up the bindings generated but it doesn't.

The code compiles and runs fine.

@bjorn3
Copy link
Member

bjorn3 commented Sep 13, 2020

Try enabling rust-analyzer.cargo.loadOutDirsFromCheck.

@Sibz
Copy link
Author

Sibz commented Sep 14, 2020

Thank you for your reply. I tried the following combinations (because the first didn't work) in my code workspace settings:

"rust.rust-analyzer.cargo.loadOutDirsFromCheck": true
"rust-analyzer.cargo.loadOutDirsFromCheck": true
"rust-analyzer.cargo": {
	"loadOutDirsFromCheck": true
}
"rust.rust-analyzer.cargo": {
	"loadOutDirsFromCheck": true
}

I still didn't couldn't get the intellisense to pop.

@matklad matklad added E-unknown It's unclear if the issue is E-hard or E-easy without digging in S-unactionable Issue requires feedback, design decisions or is blocked on other work and removed S-unactionable Issue requires feedback, design decisions or is blocked on other work labels Oct 15, 2020
@matklad
Copy link
Member

matklad commented Oct 15, 2020

Hm, this works for me as intended:

with "rust-analyzer.cargo.loadOutDirsFromCheck": true

image

with "rust-analyzer.cargo.loadOutDirsFromCheck": false

image

Couple of hypothesis why this migth be the case:

  • perhaps cargo check running from rust-analyzer failed due to some differnece in env variables? It took me a while to convince nixos to biuld the example
  • " I tried the following combinations" feels suspicious. There should be completion for VS Code options, if you don't get it, perhaps something is misconfigured.

As I can't repro this locally, closing -- seems to be an env specific issue

@matklad matklad closed this as completed Oct 15, 2020
@problame
Copy link

problame commented Mar 3, 2021

Why is rust-analyzer.cargo.loadOutDirsFromCheck not enabled by default? I spent several months in a project with bindgen-generated bindings and became unnecessarily frustrated with RA.

@lnicola
Copy link
Member

lnicola commented Mar 3, 2021

There's a discussion in #6448.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-unknown It's unclear if the issue is E-hard or E-easy without digging in
Projects
None yet
Development

No branches or pull requests

5 participants