@@ -139,9 +139,8 @@ def __repr__(self) -> str:
139
139
class DocumentSyncListener (sublime_plugin .ViewEventListener , AbstractViewListener ):
140
140
141
141
ACTIVE_DIAGNOSTIC = "lsp_active_diagnostic"
142
- code_actions_debounce_time = FEATURES_TIMEOUT
142
+ debounce_time = FEATURES_TIMEOUT
143
143
color_boxes_debounce_time = FEATURES_TIMEOUT
144
- highlights_debounce_time = FEATURES_TIMEOUT
145
144
code_lenses_debounce_time = FEATURES_TIMEOUT
146
145
147
146
@classmethod
@@ -388,16 +387,19 @@ def on_selection_modified_async(self) -> None:
388
387
return
389
388
if not self ._is_in_higlighted_region (first_region .b ):
390
389
self ._clear_highlight_regions ()
391
- if userprefs ().document_highlight_style :
392
- self ._when_selection_remains_stable_async (self ._do_highlights_async , first_region ,
393
- after_ms = self .highlights_debounce_time )
394
390
self ._clear_code_actions_annotation ()
395
- if userprefs ().show_code_actions :
396
- self ._when_selection_remains_stable_async (self . _do_code_actions_async , first_region ,
397
- after_ms = self .code_actions_debounce_time )
391
+ if userprefs ().document_highlight_style or userprefs (). show_code_actions :
392
+ self ._when_selection_remains_stable_async (
393
+ self . _on_selection_modified_debounced_async , first_region , after_ms = self .debounce_time )
398
394
self ._update_diagnostic_in_status_bar_async ()
399
395
self ._resolve_visible_code_lenses_async ()
400
396
397
+ def _on_selection_modified_debounced_async (self ) -> None :
398
+ if userprefs ().document_highlight_style :
399
+ self ._do_highlights_async ()
400
+ if userprefs ().show_code_actions :
401
+ self ._do_code_actions_async ()
402
+
401
403
def on_post_save_async (self ) -> None :
402
404
# Re-determine the URI; this time it's guaranteed to be a file because ST can only save files to a real
403
405
# filesystem.
@@ -952,7 +954,7 @@ def _on_view_updated_async(self) -> None:
952
954
self ._clear_highlight_regions ()
953
955
if userprefs ().document_highlight_style :
954
956
self ._when_selection_remains_stable_async (
955
- self ._do_highlights_async , first_region , after_ms = self .highlights_debounce_time )
957
+ self ._do_highlights_async , first_region , after_ms = self .debounce_time )
956
958
self .do_signature_help_async (manual = False )
957
959
958
960
def _update_stored_selection_async (self ) -> tuple [sublime .Region | None , bool ]:
0 commit comments