From d0c039ecce2e31b7e348a06265674586ea679f01 Mon Sep 17 00:00:00 2001 From: Gianmaria Bajo Date: Thu, 7 Mar 2024 12:58:45 +0100 Subject: [PATCH] Rename _must_refresh -> must_ensure Remove the underscore since it's accessed in the manager class. --- pythonx/UltiSnips/snippet/source/base.py | 2 +- pythonx/UltiSnips/snippet/source/file/base.py | 4 ++-- pythonx/UltiSnips/snippet_manager.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pythonx/UltiSnips/snippet/source/base.py b/pythonx/UltiSnips/snippet/source/base.py index a7e4079f..a1cb67a1 100644 --- a/pythonx/UltiSnips/snippet/source/base.py +++ b/pythonx/UltiSnips/snippet/source/base.py @@ -15,7 +15,7 @@ class SnippetSource: def __init__(self): self._snippets = defaultdict(SnippetDictionary) self._extends = defaultdict(set) - self._must_refresh = True + self.must_ensure = True def ensure(self, filetypes): """Ensures that snippets are loaded.""" diff --git a/pythonx/UltiSnips/snippet/source/file/base.py b/pythonx/UltiSnips/snippet/source/file/base.py index e36c142a..f79ec661 100644 --- a/pythonx/UltiSnips/snippet/source/file/base.py +++ b/pythonx/UltiSnips/snippet/source/file/base.py @@ -27,11 +27,11 @@ def __init__(self): SnippetSource.__init__(self) def ensure(self, filetypes): - if self._must_refresh: + if self.must_ensure: for ft in self.get_deep_extends(filetypes): if self._needs_update(ft): self._load_snippets_for(ft) - self._must_refresh = False + self.must_ensure = False def refresh(self): self.__init__() diff --git a/pythonx/UltiSnips/snippet_manager.py b/pythonx/UltiSnips/snippet_manager.py index 640e4c25..477d16a2 100644 --- a/pythonx/UltiSnips/snippet_manager.py +++ b/pythonx/UltiSnips/snippet_manager.py @@ -982,7 +982,7 @@ def _check_filetype(self, ft): if ft not in self._filetypes: self._filetypes.append(ft) for _, source in self._snippet_sources: - source._must_refresh = True + source.must_ensure = True UltiSnips_Manager = SnippetManager( # pylint:disable=invalid-name