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

Incorrect GDScript highlighting of variables passed as values in dictionary function arguments. #81362

Closed
MewPurPur opened this issue Sep 6, 2023 · 3 comments · Fixed by #82326

Comments

@MewPurPur
Copy link
Contributor

Godot version

4.2.dev4

System information

Godot v4.2.dev4 - Pop!_OS 22.04 LTS - X11 - Vulkan (Forward+) - integrated Intel(R) Graphics (ADL GT2) () - 12th Gen Intel(R) Core(TM) i5-1235U (12 Threads)

Issue description

image

I noticed the bug in a real use case here. Note that w and h are highlighted like they are types.

Steps to reproduce

var a = 3
f({"a": a})

Paste this into a script

Minimal reproduction project

N/A

@MewPurPur MewPurPur changed the title Incorrect GDScript highlighting with a Dictionary in format() Incorrect GDScript highlighting of variables passed as values in dictionary function arguments. Sep 6, 2023
@adeneve
Copy link
Contributor

adeneve commented Sep 25, 2023

Looks like this is happening because it thinks it's a function argument hint (because of the colon ':"). I have a potential fix here (tested and seems to work) https://github.com/adeneve/godot_fork/tree/gdscript_dict_highlighter_fix. Let me know what you guys think!

@MewPurPur
Copy link
Contributor Author

Make a PR please!

@adeneve
Copy link
Contributor

adeneve commented Sep 25, 2023

Ok, PR created. FYI, I made a slight change to try to account for nested dictionaries.

@akien-mga akien-mga added this to the 4.2 milestone Oct 5, 2023
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