From e1ecc92bcbbc5fc2ceabc7ddba8accb389fea372 Mon Sep 17 00:00:00 2001 From: Jack Cherng Date: Sat, 13 Jul 2024 14:13:06 +0800 Subject: [PATCH] fix: shouldn't work for Python syntax test files Signed-off-by: Jack Cherng --- plugin/client.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/plugin/client.py b/plugin/client.py index 5e105a2..2cb7993 100644 --- a/plugin/client.py +++ b/plugin/client.py @@ -60,10 +60,12 @@ def required_node_version(cls) -> str: @classmethod def should_ignore(cls, view: sublime.View) -> bool: - # ignore REPL views (https://github.com/sublimelsp/LSP-pyright/issues/343) - if view.settings().get("repl"): - return True - return False + return bool( + # ignore REPL views (https://github.com/sublimelsp/LSP-pyright/issues/343) + view.settings().get("repl") + # ignore Python-like syntax test files + or view.substr(sublime.Region(0, 20)).startswith("# SYNTAX TEST ") + ) @classmethod def can_start(