本文整理汇总了Python中sublime.View.set_status方法的典型用法代码示例。如果您正苦于以下问题:Python View.set_status方法的具体用法?Python View.set_status怎么用?Python View.set_status使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sublime.View
的用法示例。
在下文中一共展示了View.set_status方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _show_status
# 需要导入模块: from sublime import View [as 别名]
# 或者: from sublime.View import set_status [as 别名]
def _show_status(self, view: sublime.View) -> None:
"""Show message in the view status bar
"""
view.set_status(
'anaconda_doc', 'Anaconda: {}'.format(self.signature)
)
示例2: update_diagnostics_in_status_bar
# 需要导入模块: from sublime import View [as 别名]
# 或者: from sublime.View import set_status [as 别名]
def update_diagnostics_in_status_bar(view: sublime.View):
errors = 0
warnings = 0
window = view.window()
if window:
diagnostics_by_file = get_window_diagnostics(window)
if diagnostics_by_file:
for file_path, source_diagnostics in diagnostics_by_file.items():
if source_diagnostics:
for origin, diagnostics in source_diagnostics.items():
for diagnostic in diagnostics:
if diagnostic.severity == DiagnosticSeverity.Error:
errors += 1
if diagnostic.severity == DiagnosticSeverity.Warning:
warnings += 1
count = 'E: {} W: {}'.format(errors, warnings)
view.set_status('code_intel_errors_warning_count', count)
示例3: notify_did_open
# 需要导入模块: from sublime import View [as 别名]
# 或者: from sublime.View import set_status [as 别名]
def notify_did_open(view: sublime.View):
config = config_for_scope(view)
client = client_for_view(view)
if client and config:
view.settings().set("show_definitions", False)
window = view.window()
view_file = view.file_name()
if window and view_file:
if not has_document_state(window, view_file):
ds = get_document_state(window, view_file)
ds.languageId = config.get_language_id(view)
if settings.show_view_status:
view.set_status("code_intel_clients", config.name)
params = {
"textDocument": {
"uri": filename_to_uri(view_file),
"languageId": ds.languageId,
"text": view.substr(sublime.Region(0, view.size())),
"version": ds.version
}
}
client.send_notification(Notification.didOpen(params))