One thing I love/hate about Golang is that it refuses to compile if there are any variables that are created but not used in the code. It forces me to be tidy, and keep my code clean. I don’t want Roblox to go quite so far, but it would certainly be helpful to see at a glance which variables are vestigial.
I haven’t been able to use studio for a bit over a two weeks now but I’m pretty sure it already does this
Like I’m almost certain you get a blue highlight under a variable if it isn’t used
Correct me if i’m wrong.
No, it doesn’t highlight unused variables. It does kinda the opposite, it highlights unknown variables with blue. Which is to say, variables you use without first declaring. My suggestion is to highlight variables that have been declared but not used.
If you’re checking so see if a variable is used or not, why not Ctrl F that specific script to see if it’s used other than declaring it?
If you want to see if a global variable or value is used, use Ctrl Shift F to search through all scripts in your project.
[quote] If you’re checking so see if a variable is used or not, why not Ctrl F that specific script to see if it’s used other than declaring it?
If you want to see if a global variable or value is used, use Ctrl Shift F to search through all scripts in your project. [/quote]
Because that takes a lot more effort than glancing at a blue squiggle
There is a practical solution to this problem
Take it or leave it
[quote] If you’re checking so see if a variable is used or not, why not Ctrl F that specific script to see if it’s used other than declaring it?
If you want to see if a global variable or value is used, use Ctrl Shift F to search through all scripts in your project. [/quote]
Problem is that you don’t what the variable is, so you can’t search for it. You could CTRL-F every variable as you go down the script but looking in Script Analysis would be much faster. There could be like 250+ variables (they keep everything in one script) and that should be acceptable behavior, it reduces the amount of Remotes they have to use keeping it all in one. Even 20 variables would be a pain to CTRL-F run
Thought the scenario is you see variables at the top of your script or something and are wondering which ones are unused.
I’m assuming you can find them in the first place.
[quote] There is a practical solution to this problem
Take it or leave it [/quote]
There’s a “practical” solution to every problem the Script Analysis window helps with. Whether there’s already a solution is irrelevant, as this kind of thing is exactly what is expected of Script Analysis
Microsoft Visual Studio does this. Why not. However note that it should not be underlined with the same color as a real problem in the code. It could be, for example with a green underline.
This has been getting annoying for me too at times. I would definitely like to see this added.
I would also like it if unused variables were dimmed out. When cleaning up and removing unused code, it can be hard to find variables that are unused. Some of these variables might be use a lot of resources to get and would be beneficial if they were removed.