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

Variables being highlighted seemingly randomly #157

Open
MangoDev1 opened this issue Nov 27, 2021 · 1 comment
Open

Variables being highlighted seemingly randomly #157

MangoDev1 opened this issue Nov 27, 2021 · 1 comment

Comments

@MangoDev1
Copy link

I noticed in my project that some variables are different colors than others, yet I couldn't really notice a difference between them. Is there anything that I'm missing? I'm going to use my simple delta time code as an example.

Create event:
image

Step event (starts to show seemingly random coloring):
image

Also, here's another example with some structs I have for my player movement;

Move struct:
image

Key.Move struct (different coloring? maybe from nested structs?):
image

I'm just asking if this is supposed to be like this and if so then what this means.

I'm using the GMEdit Windows beta from the itch.io page, GMS2.3, and the One Dark theme from the list of community themes in the GMEdit wiki.
How to reproduce: ??? (seems to be random, maybe try to just make a bunch of variables across a file until you see something like what is in this issue)

@YellowAfterlife
Copy link
Owner

Current versions of GMEdit index variables that are assigned in Create event (optionally with types, if your linter settings say so) and use this information to color variables in object's other events (or scripts with @self tag set to that object). This helps to track down variable "leaks" (additional variables being introduced at some point and forgotten about) and variables that are being accessed without necessarily being assigned. I can add an option to disable this.

As for Move: in a struct declaration, that's the same as the other issue - the syntax highlighter cannot have knowledge of what context a word is used in unless it processes entirety of syntax (that's a few thousand more lines of code and a performance hit)

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

No branches or pull requests

2 participants