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

Autocompletion in array indices in 4.x is worse than in 3.x #76955

Closed
451507056 opened this issue May 11, 2023 · 6 comments · Fixed by #79378
Closed

Autocompletion in array indices in 4.x is worse than in 3.x #76955

451507056 opened this issue May 11, 2023 · 6 comments · Fixed by #79378

Comments

@451507056
Copy link

Godot version

4.0.2.stable

System information

windows10,gtx1050ti

Issue description

The bracket code prompt is not as good as it used to be.

Steps to reproduce

3 5 1
4 0 2
It was OK in 3.5.1, but not after 4.0.

Minimal reproduction project

none

@Calinou Calinou changed the title The bracket code prompt is not as good as it used to be. Autocompletion in array indices in 4.x is worse than in 3.x May 11, 2023
@ajreckof
Copy link
Member

ajreckof commented May 11, 2023

It should be fixed by #75746.

PS: not 100% sure because there is no MRP

@HolonProduction
Copy link
Member

Can still reproduce this in 4.1.stable

@Calinou
Copy link
Member

Calinou commented Jul 11, 2023

Can still reproduce this in 4.1.stable

Can you post a code sample that reproduces the issue? Does it occur in a blank project with no other scripts and no open scene?

@HolonProduction
Copy link
Member

HolonProduction commented Jul 11, 2023

Yes. Just a script without anything else:

var outside = 2

func _ready():
	var inside = 1

	var k = {}
	k[]

When typing inside of the brackets inside and outside are not proposed.

Some inside information:
The completion type of the completion context is COMPLETION_SUBSCRIPT. This case only searchs inside properties of the class on which the subscript appears (here an dictionary). It does not search for local identifiers. The case seems to be written for the . syntax which is also packed into the subscript node but has its own completion type (COMPLETION_ATTRIBUTE). I will propably try to add new behaviour for this tomorrow.

@451507056
Copy link
Author

bbb
aaa.zip
I ran a test and the problem persisted.

@hsandt
Copy link
Contributor

hsandt commented Aug 26, 2024

When trying to access an enum stored in a pure class such as:

class_name HeroEnums

enum HeroType {
	SPEED,
	FLY,
	POWER,
}

and then accessing this from another script, the first level autocomplete fails: heroes[HeroEn...] will not autocomplete

but the second level autocomplete will work: heroes[HeroEnums.HeroTy...] will autocomplete.

I'll ask on the PR if this is fixed too.

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.

7 participants