Skip to content

Commit

Permalink
Fix debouncer logic
Browse files Browse the repository at this point in the history
  • Loading branch information
jwortmann committed May 1, 2023
1 parent 2269363 commit 6a1f0ff
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 1 addition & 2 deletions plugin/core/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -773,8 +773,7 @@ def from_config(cls, src_config: "ClientConfig", override: Dict[str, Any]) -> "C
disabled_capabilities=disabled_capabilities,
file_watcher=override.get("file_watcher", src_config.file_watcher),
semantic_tokens=override.get("semantic_tokens", src_config.semantic_tokens),
diagnostics_mode=override.get(
"diagnostics_mode", src_config.diagnostics_mode),
diagnostics_mode=override.get("diagnostics_mode", src_config.diagnostics_mode),
path_maps=path_map_override if path_map_override else src_config.path_maps
)

Expand Down
5 changes: 4 additions & 1 deletion plugin/session_buffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ def __init__(self, session_view: SessionViewProtocol, buffer_id: int, uri: Docum
self.document_diagnostic_pending_response = None # type: Optional[int]
self.last_text_change_time = 0.0
self.diagnostics_debouncer_async = DebouncerNonThreadSafe(async_thread=True)
self.workspace_diagnostics_debouncer_async = DebouncerNonThreadSafe(async_thread=True)
self.color_phantoms = sublime.PhantomSet(view, "lsp_color")
self.document_links = [] # type: List[DocumentLink]
self.semantic_tokens = SemanticTokensData()
Expand Down Expand Up @@ -346,8 +347,10 @@ def _on_after_change_async(self, view: sublime.View, version: int) -> None:
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'):
debounced(self.session.do_workspace_diagnostics_async, WORKSPACE_DIAGNOSTICS_TIMEOUT, async_thread=True)
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)
Expand Down

0 comments on commit 6a1f0ff

Please sign in to comment.