Home Download Buy Blog Forum Support

Command reflection

Command reflection

Postby jburnett on Fri Sep 02, 2011 9:52 pm

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?
jburnett
 
Posts: 89
Joined: Wed Jul 27, 2011 9:23 pm

Re: Command reflection

Postby jburnett on Fri Sep 02, 2011 10:00 pm

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?
jburnett
 
Posts: 89
Joined: Wed Jul 27, 2011 9:23 pm

Re: Command reflection

Postby jps on Sat Sep 03, 2011 12:01 am

Neither is available, although enumerating the available commands would be possible to add
jps
Site Admin
 
Posts: 3067
Joined: Wed Mar 19, 2008 12:33 pm

Re: Command reflection

Postby jburnett on Sat Sep 03, 2011 9:43 pm

Ah, ok. Are you ever planning on documenting the built in commands, or is it still to early for that?
jburnett
 
Posts: 89
Joined: Wed Jul 27, 2011 9:23 pm

Re: Command reflection

Postby riffito on Wed Dec 28, 2011 8:22 pm

@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?
riffito
 
Posts: 17
Joined: Wed Dec 21, 2011 2:30 pm

Re: Command reflection

Postby sublimator on Wed Jan 11, 2012 12:34 pm

https://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.
Code: Select all
u'permute_selection': {u'operation': set([u'reverse',
                                           u'shuffle',
                                           u'unique'])},


Not exactly what you were wanting but It's somewhat useful as an overview ...
It is better to remain silent and be thought a fool, than to speak out and remove all doubt
sublimator
 
Posts: 649
Joined: Thu Mar 20, 2008 5:41 am


Return to Plugin Development

Who is online

Users browsing this forum: Yahoo [Bot] and 5 guests