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

gdnative::api::* no tooltip in IDE #916

Closed
NoeelMoeskops opened this issue Jul 31, 2022 · 5 comments
Closed

gdnative::api::* no tooltip in IDE #916

NoeelMoeskops opened this issue Jul 31, 2022 · 5 comments
Labels

Comments

@NoeelMoeskops
Copy link

Hi,

I am new to Rust. So I hope I did not make and rookie mistake and that this is the correct place to make an issue for this problem.
Both Clion and VScodium (with Rust plugin installed) don't give any tooltip for the modules inside gdnative::api. I am not sure how exactly the Godot rust wrapper works (whether the code is generated or not) or how the linter gets the code hints. But the only module in gdnative::api according to my linter is utils and looking at the gdnative::api file (according to Clion) It seems to only contain utils:

// For silenced lints/warnings, see also gdnative-sys/src/lib.rs

// Generated bindings don't follow some conventions
#![allow(non_snake_case)]
#![allow(unused_unsafe)]
// False positives on generated drops that enforce lifetime
#![allow(clippy::drop_copy)]
// False positives on thread-safe singletons
#![allow(clippy::non_send_fields_in_send_ty)]
// Disable non-critical lints for generated code
#![allow(clippy::style, clippy::complexity, clippy::perf)]

mod generated;
pub use generated::*;

pub mod utils;

pub(crate) mod icalls;

Is this normal behaviour, am I missing a fatal step or is my installation borked? Typing without tooltip and alt-tabbing to the online docs is a bit cumbersome :)

@Bromeon
Copy link
Member

Bromeon commented Aug 1, 2022

No worries, glad you asked 🙂 this is a known issue, and we want to improve this with #789.

  1. Could you try compiling the gdnative crate with the formatted feature flag? That will take a bit longer to compile initially, but split the output into separate files, which gives IDEs an easier time to pick up the symbols.
  2. if that doesn't help, could you try this advice in the FAQ?

Let me know if that helps!

@NoeelMoeskops
Copy link
Author

Thank you Jan, it is working fine now :).
I have a different question if you don't mind: what is the recommended way to debug? I currently launch lldb-server g localhost:1234 -- /usr/bin/godot -d --path ../path/to/godot/project and attached to it with a seperate lldb instance. However, Clion does not seem to resolve bytecode to rust (or gives strange errors and exits when given the symbol file). I know this is not really related to godot-rust but I am wondering what your workflow is.

@Bromeon
Copy link
Member

Bromeon commented Aug 7, 2022

Glad to hear it works!

Regarding debugging, I have a bit a different setup locally. I'm using Windows, but also CLion. The trick is to use Custom Build Application run configurations.

First, I have one that calls Cargo. The built-in Cargo run configuration works well on its own, but not really as a dependency of another run configuation.

grafik

The DoNothing target has no actual build steps, but it uses the system C toolchain (in my case Visual Studio):

grafik

Then, a 2nd run configuration (again of type Custom Build Application) invokes the Godot executable. It also depends on the Cargo configuration (see arrow) -- the default Build one can be replaced with it:

grafik

I think it should work the same on Linux, you will need to change paths and toolchain. Once you set that up, you can launch Godot directly from CLion (with debugger if you click the green bug icon).

One thing to keep in mind is that you may need to recompile Godot with debug symbols. I'm not sure about the Linux builds, but on Windows, Godot releases don't ship the .pdb symbol database due to its size.

@Bromeon
Copy link
Member

Bromeon commented Aug 25, 2022

Closing as answered.

@Bromeon Bromeon closed this as completed Aug 25, 2022
@NoeelMoeskops
Copy link
Author

Sorry for not replying earlier. It is working perfectly. Thank you for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants