SublimeText / PackageDev

Tools to ease the creation of snippets, syntax definitions, etc. for Sublime Text.
MIT License
436 stars 83 forks source link

Prepopulate keymap and command files with commands found in current folder. #184

Closed pykong closed 6 years ago

pykong commented 6 years ago

When creating a keymap or command file, PackageDev might in a future implementation look for any command declarations present in the same directory. Found commands could then automatically be included into those files, leaving the developer only with the task to add description and a key combination.

Example. Say I got in the root of my new plugin the main file awesome_plugin.py:

class MyAwesomeCommand(sublime_plugin.TextCommand):
    ...

When invoking PackageDev: New Keymap File it would already contain that command:

[
    { "keys": ["ctrl+shift+h"], "command": "my_awesome", },
]
FichteFoll commented 6 years ago

Interesting idea.

It would require a different technique rather than simple templates that I use, though, and I'm honestly not sure how many people structure their packages in a way that they could make a lot of use for this. Specifically for key bindings, as you are likely to run into conflicts by adding them by default, but even for command files you might just not want to include the command or it requires some special arguments, not to mention that you need to add the caption anyway and the whole thing will only be useful once when the file is created.

I'm not convinced this is worth spending development time on.

FichteFoll commented 6 years ago

While cleaning up on open issues, I decided that I won't implement this.