server.py 文件源码

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

项目:purescript-ide-sublime 作者: b123400 项目源码 文件源码
def on_pre_close(self, view):
        if view.file_name() is None:
            return

        window = view.window()
        this_project_path = find_project_dir(view)

        def perform():
            all_views = [view for win in sublime.windows() for view in win.views()]
            all_project_paths = [find_project_dir(v) for v in all_views]
            all_project_paths = [p for p in all_project_paths if p is not None]
            all_project_paths = list(set(all_project_paths))

            if this_project_path not in all_project_paths:
                stop_server(this_project_path)
                window.status_message('Closed server for path:' + this_project_path)

        # delay server closing for 0.5s, because we may be "switching" between files
        sublime.set_timeout(perform, 500)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号