cyclegadget, thanks for the helpful feedback! 1)
Yes, that is correct. Fetch only supports global variables. We do not plan to have Fetch support local variables since the compiler does not allocate a fixed memory address for locals. Also, multiple local variables with the same name could exist but in separate functions (not likely for most Arduino users only using the loop() function, but possible).
Supporting "static" local variables would be possible since they do get allocated a fixed memory location. It would be difficult but not impossible to distinguish multiple static local vars with the same name but in different functions.
How important is this functionality, versus declaring any parameter you want to view as global at the top of the file outside of any functions?2)
I looked into Arduino Enhanced Release for Windows
. Looks like a nice improvement to the standard editor!
Fetch Alpha1 will work with it, but the preferences for ERW are in a different file (e.g. idesettings_v1.0.2.txt). Those prefs files can be located by going to Arduino File->Preferences window and clicking link at the bottom. You just have to make sure the build.path setting is the same in that ERW file as it is in preferences.txt. Only edit preferences files when Arduino Editor is closed!!
Otherwise, when Arduino is closed, it will overwrite any edits you made.
In future releases, Fetch can automatically add build.path setting to ERW prefs and ensure both files have same setting if both preferences files exist.3)
You are right, there is a bug if a global variable is defined and initialized to a value, but never used in the code. Fetch Alpha1 will present it as a valid parameter and show the wrong value for it since it isn't truly a parameter (the compiler recognized it wasn't used and didn't allocate memory for it). It should be able to be fixed so it doesn't show up as a valid selection in future releases. Not sure if I can get it to show up as an option AND report the correct constant value, would that be desirable?
In the meantime, there are some workarounds. If you really want to declare a constant value, you could use either option below, and Fetch will not show it:
#define LEDPIN 12
const int ledpin =12;
we'll be working on some more tweaks and releasing again soon. let us know any other feedback!