ToolTipHelper.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:ToolTip-Helper 作者: AvitanI 项目源码 文件源码
def run(self, edit):
        # get the cursor point
        sel = self.view.sel()[0]
        # get the current scope by cursor position
        current_scope = self.view.scope_name(sel.begin())
        # print(current_file_source)
        tooltip_files_arr = self.get_tooltip_files(current_scope)
        # get user selection
        sel = self.get_user_selection(sel)
        # do match with user selection and return the result
        results = self.match_selection(sel, tooltip_files_arr)
        # print("len results: " + str(len(results)))
        for result in results:
            # get the correct link if there is 
            link = self.has_link(result)
            # edit the result in html for tooltip window
            html_tooltip = Utilities.result_format(result['json_result'], self.keyorder, link)
            self.results_arr.append(html_tooltip)
        names = self.get_file_names(results)
        # print("len results_arr: " + str(len(self.results_arr)))
        if len(self.results_arr) == 1:
            self.show_popup_with_timeout(self.results_arr[0])
        elif len(self.results_arr) > 1:
            sublime.active_window().show_quick_panel(names, self.on_done, sublime.MONOSPACE_FONT)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号