The documentation references Packages/Default/arithmetic.py as an example of taking input from the command palette, but I can’t find the file anywhere, neither on my system nor on the tubes.
Otherwise, I found this, which purports to take input by using a TextInputHandler, but I get an error when I try using it.
Code:
class SampleCommand(sublime_plugin.TextCommand):
def run(self, edit, text):
print(text)
def input(self, args):
print("input(%s)" % args)
return sublime_plugin.TextInputHandler()
Error:
Traceback (most recent call last):
File "/opt/sublime_text/sublime_plugin.py", line 460, in is_visible_
ret = self.is_visible()
TypeError: is_visible() missing 1 required positional argument: 'paths'
Traceback (most recent call last):
File "/opt/sublime_text/sublime_plugin.py", line 556, in run_
return self.run(edit)
TypeError: run() missing 1 required positional argument: 'text'