I’m stumped why the following isn’t working. I’ve reduced it to minimal code that’s the same as other *InputHandlers I use successfully. What am I missing?
import sublime_plugin
class ReplFlavourInputHandler(sublime_plugin.ListInputHandler):
def placeholder(self):
return "Select a REPL flavour"
def list_items(self):
return ["JVM", "Browser", "Node"]
class OpenClojureRepl(sublime_plugin.TextCommand):
def run(self, edit, repl_flavour):
pass
def input(self, args):
return ReplFlavourInputHandler()
That open_clojure_repl
command is bound to a key. The problem seems to be that its input
method is never consulted by Sublime and so its run
method fails with:
TypeError: run() missing 1 required positional argument: 'repl_flavour'
REF:
https://www.sublimetext.com/docs/3/api_reference.html#sublime_plugin.TextCommand
https://www.sublimetext.com/docs/3/api_reference.html#sublime_plugin.ListInputHandler