autocomplete.py 文件源码

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

项目:FlowIDE 作者: tptee 项目源码 文件源码
def on_query_completions_async(self, view, prefix, locations):
        self.completions = None

        flow_settings = find_flow_settings(view.window().project_data())
        autocomplete_flags = sublime.INHIBIT_WORD_COMPLETIONS | \
            sublime.INHIBIT_EXPLICIT_COMPLETIONS
        if flow_settings.get('show_sublime_autocomplete_suggestions'):
            autocomplete_flags = 0

        result = None
        try:
            result = CLI(view).autocomplete()
        except InvalidContext:
            pass
        except Exception as e:
            display_unknown_error(self.view, e)

        if not result:
            return

        self.completions = (
            [
                (
                    # matching text
                    match['name'] + '\t' + match['type'],
                    # inserted text
                    build_snippet(
                        match['name'],
                        match.get('func_details')['params']
                    )
                    if (
                        match.get('func_details') and
                        not flow_settings.get('omit_function_parameters')
                    )
                    else match['name']
                )
                for match in result['result']
            ],
            autocomplete_flags
        )
        self.completions_ready = True
        sublime.active_window().active_view().run_command(
            'hide_auto_complete'
        )
        self.run_auto_complete()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号