diff --git a/plugin/session_buffer.py b/plugin/session_buffer.py index 06de98ef6..68be5936a 100644 --- a/plugin/session_buffer.py +++ b/plugin/session_buffer.py @@ -681,12 +681,12 @@ def _draw_semantic_tokens_async(self) -> None: if region_key not in scope_regions.keys(): self.semantic_tokens.active_region_keys.remove(region_key) for sv in self.session_views: - sv.view.erase_regions(f"lsp_semantic_{region_key}") + sv.view.erase_regions(f"lsp_semantic_{self.session.config.name}_{region_key}") for region_key, (scope, regions) in scope_regions.items(): if region_key not in self.semantic_tokens.active_region_keys: self.semantic_tokens.active_region_keys.add(region_key) for sv in self.session_views: - sv.view.add_regions(f"lsp_semantic_{region_key}", regions, scope, flags=SEMANTIC_TOKEN_FLAGS) + sv.view.add_regions(f"lsp_semantic_{self.session.config.name}_{region_key}", regions, scope, flags=SEMANTIC_TOKEN_FLAGS) def _get_semantic_region_key_for_scope(self, scope: str) -> int: if scope not in self._semantic_region_keys: @@ -696,7 +696,7 @@ def _get_semantic_region_key_for_scope(self, scope: str) -> int: def _clear_semantic_token_regions(self, view: sublime.View) -> None: for region_key in self.semantic_tokens.active_region_keys: - view.erase_regions(f"lsp_semantic_{region_key}") + view.erase_regions(f"lsp_semantic_{self.session.config.name}_{region_key}") def set_semantic_tokens_pending_refresh(self, needs_refresh: bool = True) -> None: self.semantic_tokens.needs_refresh = needs_refresh diff --git a/plugin/session_view.py b/plugin/session_view.py index 6d4d0c706..cb7bc8acc 100644 --- a/plugin/session_view.py +++ b/plugin/session_view.py @@ -141,7 +141,7 @@ def _initialize_region_keys(self) -> None: line_modes = ["m", "s"] self.view.add_regions(self.CODE_ACTIONS_KEY, r) # code actions lightbulb icon should always be on top for key in range(1, 100): - keys.append(f"lsp_semantic_{key}") + keys.append(f"lsp_semantic_{self.session.config.name}_{key}") if document_highlight_style in ("background", "fill"): for kind in DOCUMENT_HIGHLIGHT_KIND_NAMES.values(): for mode in line_modes: