Sublime Forum

Command reflection

#1

Is there a way to reflect over a command and get its expected arguments? This would be pretty easy to do given a Command subclass instance, but I’m not sure how to get that for some of the built in commands (if such a thing even exists). e.g. "what are the valid arguments to the “open_dir” command?

0 Likes

Shortcut Command API
#2

And actually, not just reflect over a command’s arguments, but reflecting over the list of all commands would be helpful as well. Is that possible?

0 Likes

#3

Neither is available, although enumerating the available commands would be possible to add

0 Likes

#4

Ah, ok. Are you ever planning on documenting the built in commands, or is it still to early for that?

0 Likes

#5

@Jon

This would be a really nice feature to have (as suggested by jburnett). Any chance for it to make it into the ToDo list?

0 Likes

#6

gist.github.com/1594430

As part of migrating from ST1 to ST2 I needed something looks at the sublime-menu and sublime-keymap files and collects a set() of all the values provided for each command parameter …

eg.

u'permute_selection': {u'operation': set()},

Not exactly what you were wanting but It’s somewhat useful as an overview …

0 Likes