From dd2bbc61ffe308aa7262bec9b30b118aa369cdcc Mon Sep 17 00:00:00 2001 From: 95833 <987004590@qq.com> Date: Sun, 22 Dec 2024 20:08:44 +0800 Subject: [PATCH] Update types.py --- plugin/core/types.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/plugin/core/types.py b/plugin/core/types.py index 0add32ce1..d89897f8d 100644 --- a/plugin/core/types.py +++ b/plugin/core/types.py @@ -845,6 +845,15 @@ def set_view_status(self, view: sublime.View, message: str) -> None: def erase_view_status(self, view: sublime.View) -> None: view.erase_status(self.status_key) + def match_view(self, view: sublime.View, scheme: str) -> bool: + syntax = view.syntax() + if not syntax: + return False + selector = self.selector.strip() + if not selector: + return False + return scheme in self.schemes and sublime.score_selector(syntax.scope, selector) > 0 + def map_uri_on_payload(self, payload: Any, is_from_client_to_server: bool) -> Any: if isinstance(payload, dict): for k, v in payload.items(): @@ -862,15 +871,6 @@ def map_uri_on_payload(self, payload: Any, is_from_client_to_server: bool) -> An payload = path return payload - - def match_view(self, view: sublime.View, scheme: str) -> bool: - syntax = view.syntax() - if not syntax: - return False - selector = self.selector.strip() - if not selector: - return False - return scheme in self.schemes and sublime.score_selector(syntax.scope, selector) > 0 def map_client_path_to_server_uri(self, path: str) -> str: return self.map_uri_on_payload(filename_to_uri(path), is_from_client_to_server=True)