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

Generic Types are resolving to {unknown} #18701

Open
TheColorRed opened this issue Dec 16, 2024 · 5 comments
Open

Generic Types are resolving to {unknown} #18701

TheColorRed opened this issue Dec 16, 2024 · 5 comments
Labels
C-bug Category: bug

Comments

@TheColorRed
Copy link

TheColorRed commented Dec 16, 2024

When using the latest version v0.3.2220, my types are not getting resolved property, however, rolling back to v0.3.2212 the types are resolving. This is causing suggestions to not show.

The tool thinks base: Base<Node2D> is base: Base<{unknown}>.

rust-analyzer version: v0.3.2220

rustc version: 1.83.0

editor or extension: VSCode

code snippet to reproduce:

[package]
name = "test"

[dependencies]
godot = "0.2.0"
// add your code here
use godot::obj::Base;
use godot::prelude::*;

pub struct Test {
  base: Base<Node2D>,
}
@TheColorRed TheColorRed added the C-bug Category: bug label Dec 16, 2024
@ChayimFriedman2
Copy link
Contributor

I cannot reproduce. It shows Base<Node2D> for me (no completions because there aren't any methods to Base). Node2D is code-generated into the target folder - perhaps you have some problems with build scripts?

@TheColorRed
Copy link
Author

TheColorRed commented Dec 16, 2024

@ChayimFriedman2

I am not using any build scripts in my source, but if a repository helps, here is the line https://github.com/TheColorRed/planet-game/blob/5d5ca326660d63506d7a15a3d1d53c80afa937ef/packages/celestial_bodies/src/planet.rs#L23

It seems to now work, I am not sure why it keeps working, then breaking...

@ChayimFriedman2
Copy link
Contributor

You don't, but godot does use build scripts.

@xianziljl
Copy link

Image

@ChayimFriedman2
Copy link
Contributor

@xianziljl This is an unrelated issue; you probably have a corrupted sysroot. Try rustup component remove rust-src then rustup component install rust-src.

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

No branches or pull requests

3 participants