def run(self, args, simulate=False):
view = self.view
window = view.window()
save_and_format(window)
if not check_num_selections(view, 1):
return
byte_offset = view.sel()[0].begin()
cmd = [
'guru', '-json', 'describe',
view.file_name() + ':#' + str(byte_offset)
]
cmd_output = run_tool(cmd)
if not cmd_output:
return
json_obj = sublime.decode_value(cmd_output.decode('utf-8'))
type_str = json_obj['value']['type']
window.settings().set(SettingsKeys.PANEL_QUERIED_TYPE, type_str)
window.run_command('show_go_doc_from_panel')
window.settings().erase(SettingsKeys.PANEL_QUERIED_TYPE)
评论列表
文章目录