diagnostics.py 文件源码

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

项目:LSP 作者: tomv564 项目源码 文件源码
def handle_diagnostics(update: 'Any'):
    file_path = uri_to_filename(update.get('uri'))
    window = sublime.active_window()

    if not is_in_workspace(window, file_path):
        debug("Skipping diagnostics for file", file_path,
              " it is not in the workspace")
        return

    diagnostics = list(
        Diagnostic.from_lsp(item) for item in update.get('diagnostics', []))

    origin = 'lsp'  # TODO: use actual client name to be able to update diagnostics per client
    update_file_diagnostics(window, file_path, origin, diagnostics)
    Events.publish("document.diagnostics", DiagnosticsUpdate(file_path, diagnostics))
    # TODO: expose updates to features
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号