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
评论列表
文章目录