mirror of
https://github.com/tiennm99/serena.git
synced 2026-10-13 06:15:43 +00:00
Cache FilenameMatcher instances, effectively turning them into per-language singletons
This commit is contained in:
1 parent
fd91dd10f6
commit
a7b638528b
1 file changed
+2
@@ -8,6 +8,7 @@ import re
|
||||
from collections.abc import Iterable
|
||||
from dataclasses import dataclass, field
|
||||
from enum import Enum
|
||||
from functools import cache
|
||||
from pathlib import Path
|
||||
from typing import TYPE_CHECKING, Self
|
||||
|
||||
@@ -310,6 +311,7 @@ class Language(str, Enum):
|
||||
"""
|
||||
return self.get_ls_class().supports_implementation_request()
|
||||
|
||||
@cache
|
||||
def get_source_fn_matcher(self) -> FilenameMatcher:
|
||||
match self:
|
||||
case self.PYTHON | self.PYTHON_JEDI | self.PYTHON_TY | self.PYTHON_PYREFLY:
|
||||
|
||||
Reference in new issue
Block a user