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

Autocomplete suggests invalid methods, ignoring static typing #86871

Closed
Mopsephu opened this issue Jan 6, 2024 · 6 comments · Fixed by #85224
Closed

Autocomplete suggests invalid methods, ignoring static typing #86871

Mopsephu opened this issue Jan 6, 2024 · 6 comments · Fixed by #85224

Comments

@Mopsephu
Copy link

Mopsephu commented Jan 6, 2024

Tested versions

Godot v4.2.1.stable (Steam)

System information

Godot v4.2.1.stable - Windows 10.0.19045 - GLES3 (Compatibility) - NVIDIA GeForce RTX 2060 SUPER (NVIDIA; 31.0.15.3713) - AMD Ryzen 5 3500 6-Core Processor (6 Threads)

Issue description

I am currently working on a project allowing user to access files on the computer. I note suitable files in PackedStringArray to use less memory and fast-up the application. When it's time to not use these files anymore I want to erase them from PackedStringArray. The syntaxis hint showed me that the method I want can be used, but then for some reason debugger complains that such method does not exist in PackedStringArray. Later on, I checked up the embedded documentation and it indeed shows that 'erase' method does not exist.
I do not know if it was intended for the method to be absent, but I hope it was not as it would helped me a lot in my project.
Report_1
Report_2

Steps to reproduce

Create a PackedStringArray and after that try to type ".erase()". The hint appears, but debugger complains.

Minimal reproduction project (MRP)

N/A

@AThousandShips
Copy link
Member

AThousandShips commented Jan 6, 2024

There is no such method indeed, this is a bug in the autocompletion

This doesn't happen if you instead write:

var allowed_files : PackedStringArray

or

var allowed_files : PackedStringArray = PackedStringArray()

It seems the autocomplete assumes too much from the right hand side and ignores the type hint

@Mickeon

This comment was marked as off-topic.

@AThousandShips

This comment was marked as off-topic.

@Mickeon

This comment was marked as off-topic.

@AThousandShips

This comment was marked as off-topic.

@AThousandShips AThousandShips changed the title Cannot find property "erase" on base "PackedStringArray" Autocomplete suggests invalid methods, ignoring static typing Jan 6, 2024
@HolonProduction
Copy link
Member

Pick your duplicate at #85224

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