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

Renaming procedure parameters causes identically named struct fields to be replaced with the same token. #528

Open
quatricise opened this issue Oct 16, 2024 · 0 comments

Comments

@quatricise
Copy link

I only tested this in VS Code, the latest version as of this date. I'm not sure when this became a bug, or whether it's always been this way.
To replicate the bug, create a procedure and then using the F2 command rename one of the parameters which happens to have the exact identifier as a field from any struct used in the procedure. This only replaces the token, and it doesn't rename the actual struct field in the struct definition.

Example:
Before renaming parameter 'x':

random_procedure :: proc(x, y: f32)
{
	mouse.x += x
	mouse.y += y
}

After renaming parameter 'x' to 'offset_x':

random_procedure :: proc(offset_x, y: f32)
{
	mouse.offset_x += offset_x
	mouse.y += y
}

It doesn't matter where the struct lives, if outside or inside the procedure scope.

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

No branches or pull requests

1 participant