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

[3.x] No autocompletion for typed variables sometimes (fixed in master) #42005

Open
KoBeWi opened this issue Sep 12, 2020 · 4 comments · Fixed by #62760
Open

[3.x] No autocompletion for typed variables sometimes (fixed in master) #42005

KoBeWi opened this issue Sep 12, 2020 · 4 comments · Fixed by #62760

Comments

@KoBeWi
Copy link
Member

KoBeWi commented Sep 12, 2020

Godot version:

3.2.3 rc6

Issue description:

onready var sprite := $Sprite as Sprite
onready var sprite2: Sprite = $Sprite

Autocompletion
image
No autocompletion
image

What's even more weird, in my project I have a script where it's opposite (i.e. when type is assigned with as, the autocompletion fails)

@KoBeWi
Copy link
Member Author

KoBeWi commented Oct 27, 2020

Ok so I found another similar case (screenshot from master):
image
image
Even though I declared a variable with a type, I need to cast it explicitly when assigning, otherwise it uses wrong type (probably Node in this case).

@greatmomo
Copy link
Contributor

I just wanted to add that this is still happening in 3.3.1 and in the 4.0 devel master

@YeldhamDev YeldhamDev linked a pull request Jul 6, 2022 that will close this issue
@akien-mga akien-mga changed the title No autocompletion for typed variables sometimes No autocompletion for typed variables sometimes (fixed in master) Jul 6, 2022
@akien-mga
Copy link
Member

Fixed in master by #62760 but let's keep open if someone wants to attempt a similar fix for 3.x.

@akien-mga akien-mga reopened this Jul 6, 2022
@akien-mga akien-mga added this to the 3.x milestone Jul 6, 2022
@cdemirer
Copy link
Contributor

cdemirer commented Jul 7, 2022

Ok so I found another similar case (screenshot from master):

By the way, I realized the fix in master doesn't fix the situation in this image since the type guesser uses the last assigned value type with more priority. This could be fixed again by tweaking the order of stuff in _guess_identifier_type(), but maybe we want it to combine the 2 instead (choose the more precise one)?

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

Successfully merging a pull request may close this issue.

4 participants