Skip to content
/ LSP Public
forked from sublimelsp/LSP

Commit

Permalink
Small tweak to save an API call
Browse files Browse the repository at this point in the history
  • Loading branch information
jwortmann committed Apr 7, 2024
1 parent 4dd2e91 commit aca100e
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions plugin/session_buffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,19 +338,22 @@ def _on_after_change_async(self, view: sublime.View, version: int, suppress_requ
if self._is_saving:
self._has_changed_during_save = True
return
if suppress_requests or not view.is_valid():
if suppress_requests:
return
self._do_color_boxes_async(view, version)
self.do_document_diagnostic_async(view, version)
if self.session.config.diagnostics_mode == "workspace" and \
not self.session.workspace_diagnostics_pending_response and \
self.session.has_capability('diagnosticProvider.workspaceDiagnostics'):
self._workspace_diagnostics_debouncer_async.debounce(
self.session.do_workspace_diagnostics_async, timeout_ms=WORKSPACE_DIAGNOSTICS_TIMEOUT)
self.do_semantic_tokens_async(view)
if userprefs().link_highlight_style in ("underline", "none"):
self._do_document_link_async(view, version)
self.do_inlay_hints_async(view)
try:
self._do_color_boxes_async(view, version)
self.do_document_diagnostic_async(view, version)
if self.session.config.diagnostics_mode == "workspace" and \
not self.session.workspace_diagnostics_pending_response and \
self.session.has_capability('diagnosticProvider.workspaceDiagnostics'):
self._workspace_diagnostics_debouncer_async.debounce(
self.session.do_workspace_diagnostics_async, timeout_ms=WORKSPACE_DIAGNOSTICS_TIMEOUT)
self.do_semantic_tokens_async(view)
if userprefs().link_highlight_style in ("underline", "none"):
self._do_document_link_async(view, version)
self.do_inlay_hints_async(view)
except MissingUriError:
pass

def on_pre_save_async(self, view: sublime.View) -> None:
self._is_saving = True
Expand Down

0 comments on commit aca100e

Please sign in to comment.