Fix for not being able to ignore shadowing warnings on class scope #75620
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #75208
Unifies the code for checking both the class scope and local scope shadowing of variables inside the 'is_shadowing' function from the gdscript analyzer. The class scope shadowing was being incorrectly checked during the parsing stage, and thus the annotations to ignore warnings were not being taken into account.
Adds two new scenarios to the shadowing unit test that check for a class level shadow warning. Validating that it correctly appears when there's no annotation present and that it doesn't when there's an annotation that ignores it.
Modifies another test that would start breaking with this change as it contained a variable that was shadowing a global one but wasn't being detected as such.
This is my first PR :) please let me know if I'm missing something!