completion.py 文件源码

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

项目:sublimeTextConfig 作者: luoye-fe 项目源码 文件源码
def _complete(self, data: Dict[str, Any]) -> None:

        view = active_view()
        proposals = data['completions'] if data['success'] else []

        if proposals:
            if int(sublime.version()) >= 3103 and view.is_auto_complete_visible():  # noqa
                view.run_command("hide_auto_complete")
            else:
                view.run_command("hide_auto_complete")

            self.completions = proposals
            self.ready_from_defer = True

            # if the tab key is used to complete just undo the last insertion
            if view.command_history(0)[0] == 'insert_best_completion':
                if view.substr(sublime.Region(
                        view.sel()[0].begin() - 5,
                        view.sel()[0].end())) == 'self.':
                    view.run_command('undo')

            self._run_auto_complete()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号