From a3dec7c4e2a45df95d85b7376ec0977d8116f675 Mon Sep 17 00:00:00 2001 From: jwortmann Date: Sat, 26 Oct 2024 17:28:34 +0200 Subject: [PATCH] Don't attach LSP to syntax test files (#2531) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Rafał Chłodnicki --- plugin/documents.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugin/documents.py b/plugin/documents.py index b944f1323..492ab43d8 100644 --- a/plugin/documents.py +++ b/plugin/documents.py @@ -56,6 +56,7 @@ from .session_view import SessionView from functools import partial from functools import wraps +from os.path import basename from typing import Any, Callable, Generator, Iterable, TypeVar from typing import cast from typing_extensions import Concatenate, ParamSpec @@ -95,6 +96,10 @@ def is_regular_view(v: sublime.View) -> bool: return False if v.settings().get('is_widget'): return False + # Not a syntax test file. + if (filename := v.file_name()) and basename(filename).startswith('syntax_test_'): + return False + # Not a transient sheet (preview). sheet = v.sheet() if not sheet: return False