# Sort variable dropdowns so that they match the order displayed in the block palette

OK, this isn't an especially big request - just a very useful quality of life change! :')

When you're working on a project with a ton of variables, it very quickly becomes a hassle to search for the position of your variable in the dropdowns. As such, the list should automatically be arranged alphabetically.

There are technically some arguments that could be had over whether variables in the particular scope of a script should be arranged separately, but frankly that is a separate feature request than this. They aren't grouped separately now and they don't need to be in order to implement this; the full list, as it is now, simply needs to be sorted alphabetically.

Thanks for this flurry of suggestions!

I think you're wrong about this one, though. I think variables are arranged by scope, even with a procedure's inputs separated from its script variables.

Sure, happy to help!

Ooh, you're right! Scratch that part of my post, then. But still: within a particular scope (group in the dropdown), variables aren't sorted alphabetically. That should be fixed.

Yeah, I guess we could do that.

Yeah, I think sorting them makes sense, absent letting users drag to a specific order.

I would also suggest that we visually indicate the scope somehow in that dropdown. We indicate it elsewhere...

I guess, although this is starting to get a little lengthy:

innermost procedure script var
innermost procedure script var
- - - - -
innermost procedure input
innermost procedure input
- - - - -
.
.
.
- - - - -
outermost procedure script var
outermost procedure script var
- - - - -
outermost procedure input
outermost procedure input
- - - - -
toplevel script script var
toplevel script script var
- - - - -
sprite-local
sprite-local
- - - - -
global
global


Plus, when we do hybrid scope, we need a way to get dynamically visible bindings in that list. :~/