@@ -328,10 +328,11 @@ def session_views_async(self) -> list[SessionView]:
328
328
return list (self ._session_views .values ())
329
329
330
330
def on_text_changed_async (self , change_count : int , changes : Iterable [sublime .TextChange ]) -> None :
331
- if not self .sessions_async ():
331
+ session_views = self .session_views_async ()
332
+ if not session_views :
332
333
return
333
334
if self .view .is_primary ():
334
- for sv in self . session_views_async () :
335
+ for sv in session_views :
335
336
sv .on_text_changed_async (change_count , changes )
336
337
self ._on_view_updated_async ()
337
338
@@ -366,11 +367,12 @@ def on_activated_async(self) -> None:
366
367
return
367
368
if not self ._registered :
368
369
self ._register_async ()
369
- if not self .sessions_async ():
370
+ session_views = self .session_views_async ()
371
+ if not session_views :
370
372
return
371
373
if userprefs ().show_code_actions :
372
374
self ._do_code_actions_async ()
373
- for sv in self . session_views_async () :
375
+ for sv in session_views :
374
376
if sv .code_lenses_needs_refresh :
375
377
sv .set_code_lenses_pending_refresh (needs_refresh = False )
376
378
sv .start_code_lenses_async ()
@@ -386,7 +388,7 @@ def on_activated_async(self) -> None:
386
388
sb .do_inlay_hints_async (self .view )
387
389
388
390
def on_selection_modified_async (self ) -> None :
389
- if not self .sessions_async ():
391
+ if not self .session_views_async ():
390
392
return
391
393
first_region , _ = self ._update_stored_selection_async ()
392
394
if first_region is None :
@@ -489,7 +491,7 @@ def on_query_context(self, key: str, operator: int, operand: Any, match_all: boo
489
491
return None
490
492
491
493
def on_hover (self , point : int , hover_zone : int ) -> None :
492
- if not self .sessions_async ():
494
+ if not self .session_views_async ():
493
495
return
494
496
if self .view .is_popup_visible ():
495
497
return
@@ -533,7 +535,7 @@ def _on_hover_gutter_async(self, point: int) -> None:
533
535
on_navigate = lambda href : self ._on_navigate (href , point ))
534
536
535
537
def on_text_command (self , command_name : str , args : dict | None ) -> tuple [str , dict ] | None :
536
- if not self .sessions_async ():
538
+ if not self .session_views_async ():
537
539
return None
538
540
if command_name == "auto_complete" :
539
541
self ._auto_complete_triggered_manually = True
@@ -550,7 +552,7 @@ def on_text_command(self, command_name: str, args: dict | None) -> tuple[str, di
550
552
return None
551
553
552
554
def on_post_text_command (self , command_name : str , args : dict [str , Any ] | None ) -> None :
553
- if not self .sessions_async ():
555
+ if not self .session_views_async ():
554
556
return
555
557
if command_name == 'paste' :
556
558
format_on_paste = self .view .settings ().get ('lsp_format_on_paste' , userprefs ().lsp_format_on_paste )
@@ -565,7 +567,7 @@ def on_post_text_command(self, command_name: str, args: dict[str, Any] | None) -
565
567
self .view .hide_popup ()
566
568
567
569
def on_query_completions (self , prefix : str , locations : list [int ]) -> sublime .CompletionList | None :
568
- if not self .sessions_async ():
570
+ if not self .session_views_async ():
569
571
return None
570
572
completion_list = sublime .CompletionList ()
571
573
triggered_manually = self ._auto_complete_triggered_manually
0 commit comments