From 2030660f1f2216abe3f1fe8bdf79ef0a4f833b7b Mon Sep 17 00:00:00 2001 From: FichteFoll Date: Sun, 28 Jan 2024 18:25:08 +0100 Subject: [PATCH] Address more pyright warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `window` argument was entirely ignored … --- plugins/syntax_dev/completions.py | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/plugins/syntax_dev/completions.py b/plugins/syntax_dev/completions.py index b5649f86..afc76a9a 100644 --- a/plugins/syntax_dev/completions.py +++ b/plugins/syntax_dev/completions.py @@ -90,9 +90,9 @@ PACKAGE_NAME = __package__.split('.')[0] -def status(msg, console=False): +def status(msg, window=None, console=False): msg = "[%s] %s" % (PACKAGE_NAME, msg) - sublime.status_message(msg) + (window or sublime).status_message(msg) if console: print(msg) @@ -246,19 +246,25 @@ def match_selector(selector, offset=0): return self._complete_scope(prefix, locations) # Auto-completion for include values using the 'contexts' keys and for - if match_selector("meta.expect-context-list-or-content" - " | meta.context-list-or-content", -1): + if match_selector( + "meta.expect-context-list-or-content | meta.context-list-or-content", + -1, + ): return ((self._complete_keyword(prefix, locations) or []) + self._complete_context(prefix, locations)) # Auto-completion for include values using the 'contexts' keys - if match_selector("meta.expect-context-list | meta.expect-context" - " | meta.include | meta.context-list", -1): + if match_selector( + "meta.expect-context-list | meta.expect-context | meta.include | meta.context-list", + -1, + ): return self._complete_context(prefix, locations) or None # Auto-completion for branch points with 'fail' key - if match_selector("meta.expect-branch-point-reference" - " | meta.branch-point-reference", -1): + if match_selector( + "meta.expect-branch-point-reference | meta.branch-point-reference", + -1, + ): return self._complete_branch_point() # Auto-completion for variables in match patterns using 'variables' keys