-
-
Notifications
You must be signed in to change notification settings - Fork 31
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
Misleading variable name annotation #112
Comments
This should actually be done on all expressions that have a "receiver" such as function call arguments. |
I would be very careful about assuming something about people's code. Fact that IntelliJ does this (for Java at least) in a very limited scope, only for some specific parameters, for example it warns when you assign something called So, good idea, but unless you/someone comes up with a robust specification, I doubt it is worth implementing. Something like Parameter info (which works, but is kinda wonky) is much more useful for this kind of mistakes IMHO. |
If you can think of a case where |
I would be happy to do this myself but posting here in case I forget or lose motivation.
For some variables you can deduce their usage. For example if the variable initializer is
fragPos - lightPos
you can pretty safely guess that it is the vector from light to frag orlightToFrag
. Now if the variable name isfragToLight
the plugin could add a warning annotation about it and maybe save some tears or at least wasted time.This kind of analyzing doesn't work for all languages, but I think it'd be great for GLSL because of its limited use cases and somewhat consistent naming schemes.
Also the same code could later be used for naming suggestions if such thing is needed.
The text was updated successfully, but these errors were encountered: