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

Improve function and signal parameter highlighting, add shadowing warning #92085

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ckaiser
Copy link
Contributor

@ckaiser ckaiser commented May 18, 2024

I noticed that signal parameters got highlighted as class names if they matched, so it could potentially be confusing to see a signal declared as signal name(bool), since at first glance it might seem like it accepts only booleans, when in fact that's just the parameter name. I also added a warning when any signal parameters shadow global class names, to discourage it.

This led me down a bit of a rabbit hole with regards to syntax highlighting for function parameters in general, which suffered from the same problem, but the fix was similar to the one for signals except lambdas which was a bit more complicated since those were not being flagged properly when there was a space after the func token.

I attempted a fix for that as well, although I'm not super familiar with this kind of code so there may be a cleaner fix.

Before:
signal_highlight_before

After:
signal_highlight_after

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

Successfully merging this pull request may close these issues.

None yet

2 participants