def file_is_valid(cls, view, file_path=None): """Returns a boolean whether ``file_path`` is a valid file for this loader. """ file_path = file_path or view and view.file_name() if not file_path: return None return (cls.get_ext_appendix(file_path) is not None or file_path_tuple(file_path).ext == '.' + cls.ext or (cls.scope is not None and view and base_scope(view) == cls.scope))
def is_visible(self): return base_scope(self.view) in ('source.yaml', 'source.yaml-tmlanguage')
def is_enabled(self): return base_scope(self.view) in ("source.yaml", "source.yaml-tmlanguage")